@camstack/addon-pipeline-orchestrator 1.2.222 → 1.2.224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/assets/viewer/.viewer-current-files.json +7 -7
  2. package/assets/viewer/.viewer-version +1 -1
  3. package/assets/viewer/_expo/static/js/web/{index-52215d1c19f7bf489007e4b4ecb9770f.js → index-44b4758d64ed6c629120bf8deef01485.js} +8 -8
  4. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-PKlfDq_e.js → MaskShapeCanvas-DI4BY7W2-DW9iUovV.js} +1 -1
  5. package/assets/viewer/embed/assets/MotionZonesSettings-7c3yiT5E-CzRwhaU6.js +1 -0
  6. package/assets/viewer/embed/assets/PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js +1 -0
  7. package/assets/viewer/embed/assets/SceneMonitorEditor-BvDy3x3k-zFGikTQ4.js +1 -0
  8. package/assets/viewer/embed/assets/index-BSfCOPKT.css +1 -0
  9. package/assets/viewer/embed/assets/index-G1DWVOwz.js +115 -0
  10. package/assets/viewer/embed/index.html +2 -2
  11. package/assets/viewer/index.html +1 -1
  12. package/dist/_stub.js +32 -32
  13. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-Ba6QA7CL.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-D9hT9aw6.mjs} +2 -2
  14. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CJKRvrm0.mjs +26 -0
  15. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-lkkSZHH0.mjs +26 -0
  16. package/dist/{hostInit-Be3_uqeJ.mjs → hostInit-B77DKArA.mjs} +2 -2
  17. package/dist/index.js +442 -33
  18. package/dist/index.mjs +442 -33
  19. package/dist/remoteEntry.js +1 -1
  20. package/package.json +1 -1
  21. package/assets/viewer/embed/assets/MotionZonesSettings-DNdnFHso-BcC-Qswj.js +0 -1
  22. package/assets/viewer/embed/assets/PrivacyMaskSettings-DNSLc6ww-DTaiq5jX.js +0 -1
  23. package/assets/viewer/embed/assets/SceneMonitorEditor-d_A4kO-M-DeAdwgn5.js +0 -1
  24. package/assets/viewer/embed/assets/index-CXJTH6mq.css +0 -1
  25. package/assets/viewer/embed/assets/index-Qxe8ijDE.js +0 -115
  26. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-SM4f3ulJ.mjs +0 -26
  27. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BI7e6C_J.mjs +0 -26
@@ -1,115 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-DNdnFHso-BcC-Qswj.js","./MaskShapeCanvas-DI4BY7W2-PKlfDq_e.js","./PrivacyMaskSettings-DNSLc6ww-DTaiq5jX.js","./SceneMonitorEditor-d_A4kO-M-DeAdwgn5.js"])))=>i.map(i=>d[i]);
2
- function XP(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const p=Object.getOwnPropertyDescriptor(a,s);p&&Object.defineProperty(e,s,p.get?p:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const p of s)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function n(s){const p={};return s.integrity&&(p.integrity=s.integrity),s.referrerPolicy&&(p.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?p.credentials="include":s.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function a(s){if(s.ep)return;s.ep=!0;const p=n(s);fetch(s.href,p)}})();function JP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qh={exports:{}},ic={};var hk;function ej(){if(hk)return ic;hk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,p){var f=null;if(p!==void 0&&(f=""+p),s.key!==void 0&&(f=""+s.key),"key"in s){p={};for(var m in s)m!=="key"&&(p[m]=s[m])}else p=s;return s=p.ref,{$$typeof:e,type:a,key:f,ref:s!==void 0?s:null,props:p}}return ic.Fragment=t,ic.jsx=n,ic.jsxs=n,ic}var gk;function tj(){return gk||(gk=1,qh.exports=ej()),qh.exports}var v=tj(),Bh={exports:{}},rc={},Uh={exports:{}},Fh={};var vk;function nj(){return vk||(vk=1,(function(e){function t($,ue){var ke=$.length;$.push(ue);e:for(;0<ke;){var Ie=ke-1>>>1,ge=$[Ie];if(0<s(ge,ue))$[Ie]=ue,$[ke]=ge,ke=Ie;else break e}}function n($){return $.length===0?null:$[0]}function a($){if($.length===0)return null;var ue=$[0],ke=$.pop();if(ke!==ue){$[0]=ke;e:for(var Ie=0,ge=$.length,z=ge>>>1;Ie<z;){var ae=2*(Ie+1)-1,de=$[ae],Se=ae+1,J=$[Se];if(0>s(de,ke))Se<ge&&0>s(J,de)?($[Ie]=J,$[Se]=ke,Ie=Se):($[Ie]=de,$[ae]=ke,Ie=ae);else if(Se<ge&&0>s(J,ke))$[Ie]=J,$[Se]=ke,Ie=Se;else break e}}return ue}function s($,ue){var ke=$.sortIndex-ue.sortIndex;return ke!==0?ke:$.id-ue.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var f=Date,m=f.now();e.unstable_now=function(){return f.now()-m}}var h=[],c=[],x=1,M=null,C=3,E=!1,R=!1,_=!1,P=!1,D=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function q($){for(var ue=n(c);ue!==null;){if(ue.callback===null)a(c);else if(ue.startTime<=$)a(c),ue.sortIndex=ue.expirationTime,t(h,ue);else break;ue=n(c)}}function G($){if(_=!1,q($),!R)if(n(h)!==null)R=!0,ne||(ne=!0,Ae());else{var ue=n(c);ue!==null&&Te(G,ue.startTime-$)}}var ne=!1,V=-1,U=5,me=-1;function Me(){return P?!0:!(e.unstable_now()-me<U)}function Ce(){if(P=!1,ne){var $=e.unstable_now();me=$;var ue=!0;try{e:{R=!1,_&&(_=!1,L(V),V=-1),E=!0;var ke=C;try{t:{for(q($),M=n(h);M!==null&&!(M.expirationTime>$&&Me());){var Ie=M.callback;if(typeof Ie=="function"){M.callback=null,C=M.priorityLevel;var ge=Ie(M.expirationTime<=$);if($=e.unstable_now(),typeof ge=="function"){M.callback=ge,q($),ue=!0;break t}M===n(h)&&a(h),q($)}else a(h);M=n(h)}if(M!==null)ue=!0;else{var z=n(c);z!==null&&Te(G,z.startTime-$),ue=!1}}break e}finally{M=null,C=ke,E=!1}ue=void 0}}finally{ue?Ae():ne=!1}}}var Ae;if(typeof B=="function")Ae=function(){B(Ce)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,re=Ee.port2;Ee.port1.onmessage=Ce,Ae=function(){re.postMessage(null)}}else Ae=function(){D(Ce,0)};function Te($,ue){V=D(function(){$(e.unstable_now())},ue)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function($){switch(C){case 1:case 2:case 3:var ue=3;break;default:ue=C}var ke=C;C=ue;try{return $()}finally{C=ke}},e.unstable_requestPaint=function(){P=!0},e.unstable_runWithPriority=function($,ue){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ke=C;C=$;try{return ue()}finally{C=ke}},e.unstable_scheduleCallback=function($,ue,ke){var Ie=e.unstable_now();switch(typeof ke=="object"&&ke!==null?(ke=ke.delay,ke=typeof ke=="number"&&0<ke?Ie+ke:Ie):ke=Ie,$){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=ke+ge,$={id:x++,callback:ue,priorityLevel:$,startTime:ke,expirationTime:ge,sortIndex:-1},ke>Ie?($.sortIndex=ke,t(c,$),n(h)===null&&$===n(c)&&(_?(L(V),V=-1):_=!0,Te(G,ke-Ie))):($.sortIndex=ge,t(h,$),R||E||(R=!0,ne||(ne=!0,Ae()))),$},e.unstable_shouldYield=Me,e.unstable_wrapCallback=function($){var ue=C;return function(){var ke=C;C=ue;try{return $.apply(this,arguments)}finally{C=ke}}}})(Fh)),Fh}var yk;function aj(){return yk||(yk=1,Uh.exports=nj()),Uh.exports}var Hh={exports:{}},nt={};var bk;function ij(){if(bk)return nt;bk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),C=Symbol.iterator;function E(z){return z===null||typeof z!="object"?null:(z=C&&z[C]||z["@@iterator"],typeof z=="function"?z:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,P={};function D(z,ae,de){this.props=z,this.context=ae,this.refs=P,this.updater=de||R}D.prototype.isReactComponent={},D.prototype.setState=function(z,ae){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,ae,"setState")},D.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function L(){}L.prototype=D.prototype;function B(z,ae,de){this.props=z,this.context=ae,this.refs=P,this.updater=de||R}var q=B.prototype=new L;q.constructor=B,_(q,D.prototype),q.isPureReactComponent=!0;var G=Array.isArray;function ne(){}var V={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function me(z,ae,de){var Se=de.ref;return{$$typeof:e,type:z,key:ae,ref:Se!==void 0?Se:null,props:de}}function Me(z,ae){return me(z.type,ae,z.props)}function Ce(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Ae(z){var ae={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(de){return ae[de]})}var Ee=/\/+/g;function re(z,ae){return typeof z=="object"&&z!==null&&z.key!=null?Ae(""+z.key):ae.toString(36)}function Te(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(ne,ne):(z.status="pending",z.then(function(ae){z.status==="pending"&&(z.status="fulfilled",z.value=ae)},function(ae){z.status==="pending"&&(z.status="rejected",z.reason=ae)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function $(z,ae,de,Se,J){var he=typeof z;(he==="undefined"||he==="boolean")&&(z=null);var De=!1;if(z===null)De=!0;else switch(he){case"bigint":case"string":case"number":De=!0;break;case"object":switch(z.$$typeof){case e:case t:De=!0;break;case x:return De=z._init,$(De(z._payload),ae,de,Se,J)}}if(De)return J=J(z),De=Se===""?"."+re(z,0):Se,G(J)?(de="",De!=null&&(de=De.replace(Ee,"$&/")+"/"),$(J,ae,de,"",function(Qe){return Qe})):J!=null&&(Ce(J)&&(J=Me(J,de+(J.key==null||z&&z.key===J.key?"":(""+J.key).replace(Ee,"$&/")+"/")+De)),ae.push(J)),1;De=0;var se=Se===""?".":Se+":";if(G(z))for(var be=0;be<z.length;be++)Se=z[be],he=se+re(Se,be),De+=$(Se,ae,de,he,J);else if(be=E(z),typeof be=="function")for(z=be.call(z),be=0;!(Se=z.next()).done;)Se=Se.value,he=se+re(Se,be++),De+=$(Se,ae,de,he,J);else if(he==="object"){if(typeof z.then=="function")return $(Te(z),ae,de,Se,J);throw ae=String(z),Error("Objects are not valid as a React child (found: "+(ae==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ae)+"). If you meant to render a collection of children, use an array instead.")}return De}function ue(z,ae,de){if(z==null)return z;var Se=[],J=0;return $(z,Se,"","",function(he){return ae.call(de,he,J++)}),Se}function ke(z){if(z._status===-1){var ae=z._result;ae=ae(),ae.then(function(de){(z._status===0||z._status===-1)&&(z._status=1,z._result=de)},function(de){(z._status===0||z._status===-1)&&(z._status=2,z._result=de)}),z._status===-1&&(z._status=0,z._result=ae)}if(z._status===1)return z._result.default;throw z._result}var Ie=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ae=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(ae))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ge={map:ue,forEach:function(z,ae,de){ue(z,function(){ae.apply(this,arguments)},de)},count:function(z){var ae=0;return ue(z,function(){ae++}),ae},toArray:function(z){return ue(z,function(ae){return ae})||[]},only:function(z){if(!Ce(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return nt.Activity=M,nt.Children=ge,nt.Component=D,nt.Fragment=n,nt.Profiler=s,nt.PureComponent=B,nt.StrictMode=a,nt.Suspense=h,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,nt.__COMPILER_RUNTIME={__proto__:null,c:function(z){return V.H.useMemoCache(z)}},nt.cache=function(z){return function(){return z.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(z,ae,de){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var Se=_({},z.props),J=z.key;if(ae!=null)for(he in ae.key!==void 0&&(J=""+ae.key),ae)!U.call(ae,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&ae.ref===void 0||(Se[he]=ae[he]);var he=arguments.length-2;if(he===1)Se.children=de;else if(1<he){for(var De=Array(he),se=0;se<he;se++)De[se]=arguments[se+2];Se.children=De}return me(z.type,J,Se)},nt.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:p,_context:z},z},nt.createElement=function(z,ae,de){var Se,J={},he=null;if(ae!=null)for(Se in ae.key!==void 0&&(he=""+ae.key),ae)U.call(ae,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(J[Se]=ae[Se]);var De=arguments.length-2;if(De===1)J.children=de;else if(1<De){for(var se=Array(De),be=0;be<De;be++)se[be]=arguments[be+2];J.children=se}if(z&&z.defaultProps)for(Se in De=z.defaultProps,De)J[Se]===void 0&&(J[Se]=De[Se]);return me(z,he,J)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(z){return{$$typeof:m,render:z}},nt.isValidElement=Ce,nt.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:ke}},nt.memo=function(z,ae){return{$$typeof:c,type:z,compare:ae===void 0?null:ae}},nt.startTransition=function(z){var ae=V.T,de={};V.T=de;try{var Se=z(),J=V.S;J!==null&&J(de,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(ne,Ie)}catch(he){Ie(he)}finally{ae!==null&&de.types!==null&&(ae.types=de.types),V.T=ae}},nt.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},nt.use=function(z){return V.H.use(z)},nt.useActionState=function(z,ae,de){return V.H.useActionState(z,ae,de)},nt.useCallback=function(z,ae){return V.H.useCallback(z,ae)},nt.useContext=function(z){return V.H.useContext(z)},nt.useDebugValue=function(){},nt.useDeferredValue=function(z,ae){return V.H.useDeferredValue(z,ae)},nt.useEffect=function(z,ae){return V.H.useEffect(z,ae)},nt.useEffectEvent=function(z){return V.H.useEffectEvent(z)},nt.useId=function(){return V.H.useId()},nt.useImperativeHandle=function(z,ae,de){return V.H.useImperativeHandle(z,ae,de)},nt.useInsertionEffect=function(z,ae){return V.H.useInsertionEffect(z,ae)},nt.useLayoutEffect=function(z,ae){return V.H.useLayoutEffect(z,ae)},nt.useMemo=function(z,ae){return V.H.useMemo(z,ae)},nt.useOptimistic=function(z,ae){return V.H.useOptimistic(z,ae)},nt.useReducer=function(z,ae,de){return V.H.useReducer(z,ae,de)},nt.useRef=function(z){return V.H.useRef(z)},nt.useState=function(z){return V.H.useState(z)},nt.useSyncExternalStore=function(z,ae,de){return V.H.useSyncExternalStore(z,ae,de)},nt.useTransition=function(){return V.H.useTransition()},nt.version="19.2.3",nt}var Sk;function nb(){return Sk||(Sk=1,Hh.exports=ij()),Hh.exports}var $h={exports:{}},Fn={};var xk;function rj(){if(xk)return Fn;xk=1;var e=nb();function t(h){var c="https://react.dev/errors/"+h;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)c+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+h+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function p(h,c,x){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:M==null?null:""+M,children:h,containerInfo:c,implementation:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,c){if(h==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Fn.createPortal=function(h,c){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return p(h,c,null,x)},Fn.flushSync=function(h){var c=f.T,x=a.p;try{if(f.T=null,a.p=2,h)return h()}finally{f.T=c,a.p=x,a.d.f()}},Fn.preconnect=function(h,c){typeof h=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,a.d.C(h,c))},Fn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Fn.preinit=function(h,c){if(typeof h=="string"&&c&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin),C=typeof c.integrity=="string"?c.integrity:void 0,E=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;x==="style"?a.d.S(h,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:M,integrity:C,fetchPriority:E}):x==="script"&&a.d.X(h,{crossOrigin:M,integrity:C,fetchPriority:E,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Fn.preinitModule=function(h,c){if(typeof h=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var x=m(c.as,c.crossOrigin);a.d.M(h,{crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&a.d.M(h)},Fn.preload=function(h,c){if(typeof h=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin);a.d.L(h,x,{crossOrigin:M,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Fn.preloadModule=function(h,c){if(typeof h=="string")if(c){var x=m(c.as,c.crossOrigin);a.d.m(h,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else a.d.m(h)},Fn.requestFormReset=function(h){a.d.r(h)},Fn.unstable_batchedUpdates=function(h,c){return h(c)},Fn.useFormState=function(h,c,x){return f.H.useFormState(h,c,x)},Fn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Fn.version="19.2.3",Fn}var kk;function HA(){if(kk)return $h.exports;kk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$h.exports=rj(),$h.exports}var wk;function oj(){if(wk)return rc;wk=1;var e=aj(),t=nb(),n=HA();function a(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function p(i){var r=i,u=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(u=r.return),i=r.return;while(i)}return r.tag===3?u:null}function f(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function m(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(p(i)!==i)throw Error(a(188))}function c(i){var r=i.alternate;if(!r){if(r=p(i),r===null)throw Error(a(188));return r!==i?null:i}for(var u=i,g=r;;){var S=u.return;if(S===null)break;var k=S.alternate;if(k===null){if(g=S.return,g!==null){u=g;continue}break}if(S.child===k.child){for(k=S.child;k;){if(k===u)return h(S),i;if(k===g)return h(S),r;k=k.sibling}throw Error(a(188))}if(u.return!==g.return)u=S,g=k;else{for(var I=!1,j=S.child;j;){if(j===u){I=!0,u=S,g=k;break}if(j===g){I=!0,g=S,u=k;break}j=j.sibling}if(!I){for(j=k.child;j;){if(j===u){I=!0,u=k,g=S;break}if(j===g){I=!0,g=k,u=S;break}j=j.sibling}if(!I)throw Error(a(189))}}if(u.alternate!==g)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?i:r}function x(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=x(i),r!==null)return r;i=i.sibling}return null}var M=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),B=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),Me=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function Ae(i){return i===null||typeof i!="object"?null:(i=Ce&&i[Ce]||i["@@iterator"],typeof i=="function"?i:null)}var Ee=Symbol.for("react.client.reference");function re(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ee?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case D:return"Profiler";case P:return"StrictMode";case G:return"Suspense";case ne:return"SuspenseList";case me:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case R:return"Portal";case B:return i.displayName||"Context";case L:return(i._context.displayName||"Context")+".Consumer";case q:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return r=i.displayName||null,r!==null?r:re(i.type)||"Memo";case U:r=i._payload,i=i._init;try{return re(i(r))}catch{}}return null}var Te=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ke={pending:!1,data:null,method:null,action:null},Ie=[],ge=-1;function z(i){return{current:i}}function ae(i){0>ge||(i.current=Ie[ge],Ie[ge]=null,ge--)}function de(i,r){ge++,Ie[ge]=i.current,i.current=r}var Se=z(null),J=z(null),he=z(null),De=z(null);function se(i,r){switch(de(he,r),de(J,i),de(Se,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Lx(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Lx(r),i=qx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ae(Se),de(Se,i)}function be(){ae(Se),ae(J),ae(he)}function Qe(i){i.memoizedState!==null&&de(De,i);var r=Se.current,u=qx(r,i.type);r!==u&&(de(J,i),de(Se,u))}function ct(i){J.current===i&&(ae(Se),ae(J)),De.current===i&&(ae(De),ec._currentValue=ke)}var Je,et;function $e(i){if(Je===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Je=r&&r[1]||"",et=-1<u.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Je+i+et}var we=!1;function Ve(i,r){if(!i||we)return"";we=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ce){var ie=ce}Reflect.construct(i,[],xe)}else{try{xe.call()}catch(ce){ie=ce}i.call(xe.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(xe=i())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),I=k[0],j=k[1];if(I&&j){var F=I.split(`
5
- `),te=j.split(`
6
- `);for(S=g=0;g<F.length&&!F[g].includes("DetermineComponentFrameRoot");)g++;for(;S<te.length&&!te[S].includes("DetermineComponentFrameRoot");)S++;if(g===F.length||S===te.length)for(g=F.length-1,S=te.length-1;1<=g&&0<=S&&F[g]!==te[S];)S--;for(;1<=g&&0<=S;g--,S--)if(F[g]!==te[S]){if(g!==1||S!==1)do if(g--,S--,0>S||F[g]!==te[S]){var fe=`
7
- `+F[g].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=g&&0<=S);break}}}finally{we=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?$e(u):""}function lt(i,r){switch(i.tag){case 26:case 27:case 5:return $e(i.type);case 16:return $e("Lazy");case 13:return i.child!==r&&r!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return Ve(i.type,!1);case 11:return Ve(i.type.render,!1);case 1:return Ve(i.type,!0);case 31:return $e("Activity");default:return""}}function dt(i){try{var r="",u=null;do r+=lt(i,u),u=i,i=i.return;while(i);return r}catch(g){return`
8
- Error generating stack: `+g.message+`
9
- `+g.stack}}var Tt=Object.prototype.hasOwnProperty,ot=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,Jt=e.unstable_shouldYield,Ln=e.unstable_requestPaint,en=e.unstable_now,$n=e.unstable_getCurrentPriorityLevel,fa=e.unstable_ImmediatePriority,Ia=e.unstable_UserBlockingPriority,Jn=e.unstable_NormalPriority,We=e.unstable_LowPriority,Tn=e.unstable_IdlePriority,qn=e.log,Ta=e.unstable_setDisableYieldValue,vi=null,An=null;function ha(i){if(typeof qn=="function"&&Ta(i),An&&typeof An.setStrictMode=="function")try{An.setStrictMode(vi,i)}catch{}}var Nn=Math.clz32?Math.clz32:Ji,Uo=Math.log,Gr=Math.LN2;function Ji(i){return i>>>=0,i===0?32:31-(Uo(i)/Gr|0)|0}var Qt=256,ve=262144,Re=4194304;function mt(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function qt(i,r,u){var g=i.pendingLanes;if(g===0)return 0;var S=0,k=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var j=g&134217727;return j!==0?(g=j&~k,g!==0?S=mt(g):(I&=j,I!==0?S=mt(I):u||(u=j&~i,u!==0&&(S=mt(u))))):(j=g&~k,j!==0?S=mt(j):I!==0?S=mt(I):u||(u=g&~i,u!==0&&(S=mt(u)))),S===0?0:r!==0&&r!==S&&(r&k)===0&&(k=S&-S,u=r&-r,k>=u||k===32&&(u&4194048)!==0)?r:S}function Bn(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Zr(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fo(){var i=Re;return Re<<=1,(Re&62914560)===0&&(Re=4194304),i}function Ha(i){for(var r=[],u=0;31>u;u++)r.push(i);return r}function er(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Su(i,r,u,g,S,k){var I=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var j=i.entanglements,F=i.expirationTimes,te=i.hiddenUpdates;for(u=I&~u;0<u;){var fe=31-Nn(u),xe=1<<fe;j[fe]=0,F[fe]=-1;var ie=te[fe];if(ie!==null)for(te[fe]=null,fe=0;fe<ie.length;fe++){var ce=ie[fe];ce!==null&&(ce.lane&=-536870913)}u&=~xe}g!==0&&Ho(i,g,0),k!==0&&S===0&&i.tag!==0&&(i.suspendedLanes|=k&~(I&~r))}function Ho(i,r,u){i.pendingLanes|=r,i.suspendedLanes&=~r;var g=31-Nn(r);i.entangledLanes|=r,i.entanglements[g]=i.entanglements[g]|1073741824|u&261930}function $a(i,r){var u=i.entangledLanes|=r;for(i=i.entanglements;u;){var g=31-Nn(u),S=1<<g;S&r|i[g]&r&&(i[g]|=r),u&=~S}}function ml(i,r){var u=r&-r;return u=(u&42)!==0?1:$o(u),(u&(i.suspendedLanes|r))!==0?0:u}function $o(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Qo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function fl(){var i=ue.p;return i!==0?i:(i=window.event,i===void 0?32:lk(i.type))}function hl(i,r){var u=ue.p;try{return ue.p=i,r()}finally{ue.p=u}}var Qa=Math.random().toString(36).slice(2),En="__reactFiber$"+Qa,Un="__reactProps$"+Qa,tr="__reactContainer$"+Qa,gl="__reactEvents$"+Qa,xu="__reactListeners$"+Qa,ku="__reactHandles$"+Qa,yi="__reactResources$"+Qa,bi="__reactMarker$"+Qa;function Wr(i){delete i[En],delete i[Un],delete i[gl],delete i[xu],delete i[ku]}function Si(i){var r=i[En];if(r)return r;for(var u=i.parentNode;u;){if(r=u[tr]||u[En]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(i=Vx(i);i!==null;){if(u=i[En])return u;i=Vx(i)}return r}i=u,u=i.parentNode}return null}function nr(i){if(i=i[En]||i[tr]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function ga(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function ar(i){var r=i[yi];return r||(r=i[yi]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function le(i){i[bi]=!0}var Le=new Set,Xe={};function Ct(i,r){Ke(i,r),Ke(i+"Capture",r)}function Ke(i,r){for(Xe[i]=r,i=0;i<r.length;i++)Le.add(r[i])}var Nt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Be={},at={};function Zt(i){return Tt.call(at,i)?!0:Tt.call(Be,i)?!1:Nt.test(i)?at[i]=!0:(Be[i]=!0,!1)}function Wt(i,r,u){if(Zt(r))if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var g=r.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+u)}}function Ue(i,r,u){if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+u)}}function At(i,r,u,g){if(g===null)i.removeAttribute(u);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(r,u,""+g)}}function wt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ot(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ea(i,r,u){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,k=g.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return S.call(this)},set:function(I){u=""+I,k.call(this,I)}}),Object.defineProperty(i,r,{enumerable:g.enumerable}),{getValue:function(){return u},setValue:function(I){u=""+I},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function an(i){if(!i._valueTracker){var r=Ot(i)?"checked":"value";i._valueTracker=ea(i,r,""+i[r])}}function Bt(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var u=r.getValue(),g="";return i&&(g=Ot(i)?i.checked?"true":"false":i.value),i=g,i!==u?(r.setValue(i),!0):!1}function Qn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var it=/[\n"\\]/g;function fn(i){return i.replace(it,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function _a(i,r,u,g,S,k,I,j){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),r!=null?I==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+wt(r)):i.value!==""+wt(r)&&(i.value=""+wt(r)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),r!=null?tt(i,I,wt(r)):u!=null?tt(i,I,wt(u)):g!=null&&i.removeAttribute("value"),S==null&&k!=null&&(i.defaultChecked=!!k),S!=null&&(i.checked=S&&typeof S!="function"&&typeof S!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?i.name=""+wt(j):i.removeAttribute("name")}function ta(i,r,u,g,S,k,I,j){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),r!=null||u!=null){if(!(k!=="submit"&&k!=="reset"||r!=null)){an(i);return}u=u!=null?""+wt(u):"",r=r!=null?""+wt(r):u,j||r===i.value||(i.value=r),i.defaultValue=r}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=j?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),an(i)}function tt(i,r,u){r==="number"&&Qn(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function pt(i,r,u,g){if(i=i.options,r){r={};for(var S=0;S<u.length;S++)r["$"+u[S]]=!0;for(u=0;u<i.length;u++)S=r.hasOwnProperty("$"+i[u].value),i[u].selected!==S&&(i[u].selected=S),S&&g&&(i[u].defaultSelected=!0)}else{for(u=""+wt(u),r=null,S=0;S<i.length;S++){if(i[S].value===u){i[S].selected=!0,g&&(i[S].defaultSelected=!0);return}r!==null||i[S].disabled||(r=i[S])}r!==null&&(r.selected=!0)}}function na(i,r,u){if(r!=null&&(r=""+wt(r),r!==i.value&&(i.value=r),u==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=u!=null?""+wt(u):""}function Kr(i,r,u,g){if(r==null){if(g!=null){if(u!=null)throw Error(a(92));if(Te(g)){if(1<g.length)throw Error(a(93));g=g[0]}u=g}u==null&&(u=""),r=u}u=wt(r),i.defaultValue=u,g=i.textContent,g===u&&g!==""&&g!==null&&(i.value=g),an(i)}function ti(i,r){if(r){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=r;return}}i.textContent=r}var Vo=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ir(i,r,u){var g=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?g?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":g?i.setProperty(r,u):typeof u!="number"||u===0||Vo.has(r)?r==="float"?i.cssFloat=u:i[r]=(""+u).trim():i[r]=u+"px"}function xi(i,r,u){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,u!=null){for(var g in u)!u.hasOwnProperty(g)||r!=null&&r.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var S in r)g=r[S],r.hasOwnProperty(S)&&u[S]!==g&&ir(i,S,g)}else for(var k in r)r.hasOwnProperty(k)&&ir(i,k,r[k])}function Yr(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ZO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),WO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wu(i){return WO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ki(){}var jm=null;function Dm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Go=null,Zo=null;function z0(i){var r=nr(i);if(r&&(i=r.stateNode)){var u=i[Un]||null;e:switch(i=r.stateNode,r.type){case"input":if(_a(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+fn(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var g=u[r];if(g!==i&&g.form===i.form){var S=g[Un]||null;if(!S)throw Error(a(90));_a(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<u.length;r++)g=u[r],g.form===i.form&&Bt(g)}break e;case"textarea":na(i,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&pt(i,!!u.multiple,r,!1)}}}var zm=!1;function L0(i,r,u){if(zm)return i(r,u);zm=!0;try{var g=i(r);return g}finally{if(zm=!1,(Go!==null||Zo!==null)&&(ud(),Go&&(r=Go,i=Zo,Zo=Go=null,z0(r),i)))for(r=0;r<i.length;r++)z0(i[r])}}function vl(i,r){var u=i.stateNode;if(u===null)return null;var g=u[Un]||null;if(g===null)return null;u=g[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(a(231,r,typeof u));return u}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lm=!1;if(wi)try{var yl={};Object.defineProperty(yl,"passive",{get:function(){Lm=!0}}),window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{Lm=!1}var rr=null,qm=null,Mu=null;function q0(){if(Mu)return Mu;var i,r=qm,u=r.length,g,S="value"in rr?rr.value:rr.textContent,k=S.length;for(i=0;i<u&&r[i]===S[i];i++);var I=u-i;for(g=1;g<=I&&r[u-g]===S[k-g];g++);return Mu=S.slice(i,1<g?1-g:void 0)}function Cu(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Au(){return!0}function B0(){return!1}function aa(i){function r(u,g,S,k,I){this._reactName=u,this._targetInst=S,this.type=g,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var j in i)i.hasOwnProperty(j)&&(u=i[j],this[j]=u?u(k):k[j]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Au:B0,this.isPropagationStopped=B0,this}return M(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),r}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eu=aa(Xr),bl=M({},Xr,{view:0,detail:0}),KO=aa(bl),Bm,Um,Sl,Ru=M({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Sl&&(Sl&&i.type==="mousemove"?(Bm=i.screenX-Sl.screenX,Um=i.screenY-Sl.screenY):Um=Bm=0,Sl=i),Bm)},movementY:function(i){return"movementY"in i?i.movementY:Um}}),U0=aa(Ru),YO=M({},Ru,{dataTransfer:0}),XO=aa(YO),JO=M({},bl,{relatedTarget:0}),Fm=aa(JO),e5=M({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),t5=aa(e5),n5=M({},Xr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),a5=aa(n5),i5=M({},Xr,{data:0}),F0=aa(i5),r5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},s5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l5(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=s5[i])?!!r[i]:!1}function Hm(){return l5}var c5=M({},bl,{key:function(i){if(i.key){var r=r5[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Cu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?o5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hm,charCode:function(i){return i.type==="keypress"?Cu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Cu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),u5=aa(c5),d5=M({},Ru,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),H0=aa(d5),p5=M({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hm}),m5=aa(p5),f5=M({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),h5=aa(f5),g5=M({},Ru,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),v5=aa(g5),y5=M({},Xr,{newState:0,oldState:0}),b5=aa(y5),S5=[9,13,27,32],$m=wi&&"CompositionEvent"in window,xl=null;wi&&"documentMode"in document&&(xl=document.documentMode);var x5=wi&&"TextEvent"in window&&!xl,$0=wi&&(!$m||xl&&8<xl&&11>=xl),Q0=" ",V0=!1;function G0(i,r){switch(i){case"keyup":return S5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Wo=!1;function k5(i,r){switch(i){case"compositionend":return Z0(r);case"keypress":return r.which!==32?null:(V0=!0,Q0);case"textInput":return i=r.data,i===Q0&&V0?null:i;default:return null}}function w5(i,r){if(Wo)return i==="compositionend"||!$m&&G0(i,r)?(i=q0(),Mu=qm=rr=null,Wo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return $0&&r.locale!=="ko"?null:r.data;default:return null}}var M5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function W0(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!M5[i.type]:r==="textarea"}function K0(i,r,u,g){Go?Zo?Zo.push(g):Zo=[g]:Go=g,r=vd(r,"onChange"),0<r.length&&(u=new Eu("onChange","change",null,u,g),i.push({event:u,listeners:r}))}var kl=null,wl=null;function C5(i){Nx(i,0)}function Iu(i){var r=ga(i);if(Bt(r))return i}function Y0(i,r){if(i==="change")return r}var X0=!1;if(wi){var Qm;if(wi){var Vm="oninput"in document;if(!Vm){var J0=document.createElement("div");J0.setAttribute("oninput","return;"),Vm=typeof J0.oninput=="function"}Qm=Vm}else Qm=!1;X0=Qm&&(!document.documentMode||9<document.documentMode)}function eS(){kl&&(kl.detachEvent("onpropertychange",tS),wl=kl=null)}function tS(i){if(i.propertyName==="value"&&Iu(wl)){var r=[];K0(r,wl,i,Dm(i)),L0(C5,r)}}function A5(i,r,u){i==="focusin"?(eS(),kl=r,wl=u,kl.attachEvent("onpropertychange",tS)):i==="focusout"&&eS()}function E5(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Iu(wl)}function R5(i,r){if(i==="click")return Iu(r)}function I5(i,r){if(i==="input"||i==="change")return Iu(r)}function T5(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var va=typeof Object.is=="function"?Object.is:T5;function Ml(i,r){if(va(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var u=Object.keys(i),g=Object.keys(r);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var S=u[g];if(!Tt.call(r,S)||!va(i[S],r[S]))return!1}return!0}function nS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function aS(i,r){var u=nS(i);i=0;for(var g;u;){if(u.nodeType===3){if(g=i+u.textContent.length,i<=r&&g>=r)return{node:u,offset:r-i};i=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=nS(u)}}function iS(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?iS(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function rS(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Qn(i.document);r instanceof i.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)i=r.contentWindow;else break;r=Qn(i.document)}return r}function Gm(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var _5=wi&&"documentMode"in document&&11>=document.documentMode,Ko=null,Zm=null,Cl=null,Wm=!1;function oS(i,r,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Wm||Ko==null||Ko!==Qn(g)||(g=Ko,"selectionStart"in g&&Gm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Cl&&Ml(Cl,g)||(Cl=g,g=vd(Zm,"onSelect"),0<g.length&&(r=new Eu("onSelect","select",null,r,u),i.push({event:r,listeners:g}),r.target=Ko)))}function Jr(i,r){var u={};return u[i.toLowerCase()]=r.toLowerCase(),u["Webkit"+i]="webkit"+r,u["Moz"+i]="moz"+r,u}var Yo={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},Km={},sS={};wi&&(sS=document.createElement("div").style,"AnimationEvent"in window||(delete Yo.animationend.animation,delete Yo.animationiteration.animation,delete Yo.animationstart.animation),"TransitionEvent"in window||delete Yo.transitionend.transition);function eo(i){if(Km[i])return Km[i];if(!Yo[i])return i;var r=Yo[i],u;for(u in r)if(r.hasOwnProperty(u)&&u in sS)return Km[i]=r[u];return i}var lS=eo("animationend"),cS=eo("animationiteration"),uS=eo("animationstart"),N5=eo("transitionrun"),O5=eo("transitionstart"),P5=eo("transitioncancel"),dS=eo("transitionend"),pS=new Map,Ym="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ym.push("scrollEnd");function Va(i,r){pS.set(i,r),Ct(r,[i])}var Tu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Na=[],Xo=0,Xm=0;function _u(){for(var i=Xo,r=Xm=Xo=0;r<i;){var u=Na[r];Na[r++]=null;var g=Na[r];Na[r++]=null;var S=Na[r];Na[r++]=null;var k=Na[r];if(Na[r++]=null,g!==null&&S!==null){var I=g.pending;I===null?S.next=S:(S.next=I.next,I.next=S),g.pending=S}k!==0&&mS(u,S,k)}}function Nu(i,r,u,g){Na[Xo++]=i,Na[Xo++]=r,Na[Xo++]=u,Na[Xo++]=g,Xm|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Jm(i,r,u,g){return Nu(i,r,u,g),Ou(i)}function to(i,r){return Nu(i,null,null,r),Ou(i)}function mS(i,r,u){i.lanes|=u;var g=i.alternate;g!==null&&(g.lanes|=u);for(var S=!1,k=i.return;k!==null;)k.childLanes|=u,g=k.alternate,g!==null&&(g.childLanes|=u),k.tag===22&&(i=k.stateNode,i===null||i._visibility&1||(S=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,S&&r!==null&&(S=31-Nn(u),i=k.hiddenUpdates,g=i[S],g===null?i[S]=[r]:g.push(r),r.lane=u|536870912),k):null}function Ou(i){if(50<Gl)throw Gl=0,ch=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Jo={};function j5(i,r,u,g){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ya(i,r,u,g){return new j5(i,r,u,g)}function ef(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Mi(i,r){var u=i.alternate;return u===null?(u=ya(i.tag,r,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=r,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,r=i.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function fS(i,r){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,r=u.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Pu(i,r,u,g,S,k){var I=0;if(g=i,typeof i=="function")ef(i)&&(I=1);else if(typeof i=="string")I=BP(i,u,Se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case me:return i=ya(31,u,r,S),i.elementType=me,i.lanes=k,i;case _:return no(u.children,S,k,r);case P:I=8,S|=24;break;case D:return i=ya(12,u,r,S|2),i.elementType=D,i.lanes=k,i;case G:return i=ya(13,u,r,S),i.elementType=G,i.lanes=k,i;case ne:return i=ya(19,u,r,S),i.elementType=ne,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:I=10;break e;case L:I=9;break e;case q:I=11;break e;case V:I=14;break e;case U:I=16,g=null;break e}I=29,u=Error(a(130,i===null?"null":typeof i,"")),g=null}return r=ya(I,u,r,S),r.elementType=i,r.type=g,r.lanes=k,r}function no(i,r,u,g){return i=ya(7,i,g,r),i.lanes=u,i}function tf(i,r,u){return i=ya(6,i,null,r),i.lanes=u,i}function hS(i){var r=ya(18,null,null,0);return r.stateNode=i,r}function nf(i,r,u){return r=ya(4,i.children!==null?i.children:[],i.key,r),r.lanes=u,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var gS=new WeakMap;function Oa(i,r){if(typeof i=="object"&&i!==null){var u=gS.get(i);return u!==void 0?u:(r={value:i,source:r,stack:dt(r)},gS.set(i,r),r)}return{value:i,source:r,stack:dt(r)}}var es=[],ts=0,ju=null,Al=0,Pa=[],ja=0,or=null,ni=1,ai="";function Ci(i,r){es[ts++]=Al,es[ts++]=ju,ju=i,Al=r}function vS(i,r,u){Pa[ja++]=ni,Pa[ja++]=ai,Pa[ja++]=or,or=i;var g=ni;i=ai;var S=32-Nn(g)-1;g&=~(1<<S),u+=1;var k=32-Nn(r)+S;if(30<k){var I=S-S%5;k=(g&(1<<I)-1).toString(32),g>>=I,S-=I,ni=1<<32-Nn(r)+S|u<<S|g,ai=k+i}else ni=1<<k|u<<S|g,ai=i}function af(i){i.return!==null&&(Ci(i,1),vS(i,1,0))}function rf(i){for(;i===ju;)ju=es[--ts],es[ts]=null,Al=es[--ts],es[ts]=null;for(;i===or;)or=Pa[--ja],Pa[ja]=null,ai=Pa[--ja],Pa[ja]=null,ni=Pa[--ja],Pa[ja]=null}function yS(i,r){Pa[ja++]=ni,Pa[ja++]=ai,Pa[ja++]=or,ni=r.id,ai=r.overflow,or=i}var On=null,Kt=null,xt=!1,sr=null,Da=!1,of=Error(a(519));function lr(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(Oa(r,i)),of}function bS(i){var r=i.stateNode,u=i.type,g=i.memoizedProps;switch(r[En]=i,r[Un]=g,u){case"dialog":ht("cancel",r),ht("close",r);break;case"iframe":case"object":case"embed":ht("load",r);break;case"video":case"audio":for(u=0;u<Wl.length;u++)ht(Wl[u],r);break;case"source":ht("error",r);break;case"img":case"image":case"link":ht("error",r),ht("load",r);break;case"details":ht("toggle",r);break;case"input":ht("invalid",r),ta(r,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ht("invalid",r);break;case"textarea":ht("invalid",r),Kr(r,g.value,g.defaultValue,g.children)}u=g.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||g.suppressHydrationWarning===!0||Dx(r.textContent,u)?(g.popover!=null&&(ht("beforetoggle",r),ht("toggle",r)),g.onScroll!=null&&ht("scroll",r),g.onScrollEnd!=null&&ht("scrollend",r),g.onClick!=null&&(r.onclick=ki),r=!0):r=!1,r||lr(i,!0)}function SS(i){for(On=i.return;On;)switch(On.tag){case 5:case 31:case 13:Da=!1;return;case 27:case 3:Da=!0;return;default:On=On.return}}function ns(i){if(i!==On)return!1;if(!xt)return SS(i),xt=!0,!1;var r=i.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Mh(i.type,i.memoizedProps)),u=!u),u&&Kt&&lr(i),SS(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Kt=Qx(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Kt=Qx(i)}else r===27?(r=Kt,kr(i.type)?(i=Ih,Ih=null,Kt=i):Kt=r):Kt=On?La(i.stateNode.nextSibling):null;return!0}function ao(){Kt=On=null,xt=!1}function sf(){var i=sr;return i!==null&&(sa===null?sa=i:sa.push.apply(sa,i),sr=null),i}function El(i){sr===null?sr=[i]:sr.push(i)}var lf=z(null),io=null,Ai=null;function cr(i,r,u){de(lf,r._currentValue),r._currentValue=u}function Ei(i){i._currentValue=lf.current,ae(lf)}function cf(i,r,u){for(;i!==null;){var g=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,g!==null&&(g.childLanes|=r)):g!==null&&(g.childLanes&r)!==r&&(g.childLanes|=r),i===u)break;i=i.return}}function uf(i,r,u,g){var S=i.child;for(S!==null&&(S.return=i);S!==null;){var k=S.dependencies;if(k!==null){var I=S.child;k=k.firstContext;e:for(;k!==null;){var j=k;k=S;for(var F=0;F<r.length;F++)if(j.context===r[F]){k.lanes|=u,j=k.alternate,j!==null&&(j.lanes|=u),cf(k.return,u,i),g||(I=null);break e}k=j.next}}else if(S.tag===18){if(I=S.return,I===null)throw Error(a(341));I.lanes|=u,k=I.alternate,k!==null&&(k.lanes|=u),cf(I,u,i),I=null}else I=S.child;if(I!==null)I.return=S;else for(I=S;I!==null;){if(I===i){I=null;break}if(S=I.sibling,S!==null){S.return=I.return,I=S;break}I=I.return}S=I}}function as(i,r,u,g){i=null;for(var S=r,k=!1;S!==null;){if(!k){if((S.flags&524288)!==0)k=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var I=S.alternate;if(I===null)throw Error(a(387));if(I=I.memoizedProps,I!==null){var j=S.type;va(S.pendingProps.value,I.value)||(i!==null?i.push(j):i=[j])}}else if(S===De.current){if(I=S.alternate,I===null)throw Error(a(387));I.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(i!==null?i.push(ec):i=[ec])}S=S.return}i!==null&&uf(r,i,u,g),r.flags|=262144}function Du(i){for(i=i.firstContext;i!==null;){if(!va(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ro(i){io=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pn(i){return xS(io,i)}function zu(i,r){return io===null&&ro(i),xS(i,r)}function xS(i,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},Ai===null){if(i===null)throw Error(a(308));Ai=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else Ai=Ai.next=r;return u}var D5=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(u,g){i.push(g)}};this.abort=function(){r.aborted=!0,i.forEach(function(u){return u()})}},z5=e.unstable_scheduleCallback,L5=e.unstable_NormalPriority,bn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function df(){return{controller:new D5,data:new Map,refCount:0}}function Rl(i){i.refCount--,i.refCount===0&&z5(L5,function(){i.controller.abort()})}var Il=null,pf=0,is=0,rs=null;function q5(i,r){if(Il===null){var u=Il=[];pf=0,is=hh(),rs={status:"pending",value:void 0,then:function(g){u.push(g)}}}return pf++,r.then(kS,kS),r}function kS(){if(--pf===0&&Il!==null){rs!==null&&(rs.status="fulfilled");var i=Il;Il=null,is=0,rs=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function B5(i,r){var u=[],g={status:"pending",value:null,reason:null,then:function(S){u.push(S)}};return i.then(function(){g.status="fulfilled",g.value=r;for(var S=0;S<u.length;S++)(0,u[S])(r)},function(S){for(g.status="rejected",g.reason=S,S=0;S<u.length;S++)(0,u[S])(void 0)}),g}var wS=$.S;$.S=function(i,r){ox=en(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&q5(i,r),wS!==null&&wS(i,r)};var oo=z(null);function mf(){var i=oo.current;return i!==null?i:Vt.pooledCache}function Lu(i,r){r===null?de(oo,oo.current):de(oo,r.pool)}function MS(){var i=mf();return i===null?null:{parent:bn._currentValue,pool:i}}var os=Error(a(460)),ff=Error(a(474)),qu=Error(a(542)),Bu={then:function(){}};function CS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function AS(i,r,u){switch(u=i[u],u===void 0?i.push(r):u!==r&&(r.then(ki,ki),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,RS(i),i;default:if(typeof r.status=="string")r.then(ki,ki);else{if(i=Vt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(g){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=g}},function(g){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,RS(i),i}throw lo=r,os}}function so(i){try{var r=i._init;return r(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(lo=u,os):u}}var lo=null;function ES(){if(lo===null)throw Error(a(459));var i=lo;return lo=null,i}function RS(i){if(i===os||i===qu)throw Error(a(483))}var ss=null,Tl=0;function Uu(i){var r=Tl;return Tl+=1,ss===null&&(ss=[]),AS(ss,i,r)}function _l(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Fu(i,r){throw r.$$typeof===C?Error(a(525)):(i=Object.prototype.toString.call(r),Error(a(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function IS(i){function r(K,Z){if(i){var ee=K.deletions;ee===null?(K.deletions=[Z],K.flags|=16):ee.push(Z)}}function u(K,Z){if(!i)return null;for(;Z!==null;)r(K,Z),Z=Z.sibling;return null}function g(K){for(var Z=new Map;K!==null;)K.key!==null?Z.set(K.key,K):Z.set(K.index,K),K=K.sibling;return Z}function S(K,Z){return K=Mi(K,Z),K.index=0,K.sibling=null,K}function k(K,Z,ee){return K.index=ee,i?(ee=K.alternate,ee!==null?(ee=ee.index,ee<Z?(K.flags|=67108866,Z):ee):(K.flags|=67108866,Z)):(K.flags|=1048576,Z)}function I(K){return i&&K.alternate===null&&(K.flags|=67108866),K}function j(K,Z,ee,ye){return Z===null||Z.tag!==6?(Z=tf(ee,K.mode,ye),Z.return=K,Z):(Z=S(Z,ee),Z.return=K,Z)}function F(K,Z,ee,ye){var He=ee.type;return He===_?fe(K,Z,ee.props.children,ye,ee.key):Z!==null&&(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===U&&so(He)===Z.type)?(Z=S(Z,ee.props),_l(Z,ee),Z.return=K,Z):(Z=Pu(ee.type,ee.key,ee.props,null,K.mode,ye),_l(Z,ee),Z.return=K,Z)}function te(K,Z,ee,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ee.containerInfo||Z.stateNode.implementation!==ee.implementation?(Z=nf(ee,K.mode,ye),Z.return=K,Z):(Z=S(Z,ee.children||[]),Z.return=K,Z)}function fe(K,Z,ee,ye,He){return Z===null||Z.tag!==7?(Z=no(ee,K.mode,ye,He),Z.return=K,Z):(Z=S(Z,ee),Z.return=K,Z)}function xe(K,Z,ee){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=tf(""+Z,K.mode,ee),Z.return=K,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return ee=Pu(Z.type,Z.key,Z.props,null,K.mode,ee),_l(ee,Z),ee.return=K,ee;case R:return Z=nf(Z,K.mode,ee),Z.return=K,Z;case U:return Z=so(Z),xe(K,Z,ee)}if(Te(Z)||Ae(Z))return Z=no(Z,K.mode,ee,null),Z.return=K,Z;if(typeof Z.then=="function")return xe(K,Uu(Z),ee);if(Z.$$typeof===B)return xe(K,zu(K,Z),ee);Fu(K,Z)}return null}function ie(K,Z,ee,ye){var He=Z!==null?Z.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return He!==null?null:j(K,Z,""+ee,ye);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:return ee.key===He?F(K,Z,ee,ye):null;case R:return ee.key===He?te(K,Z,ee,ye):null;case U:return ee=so(ee),ie(K,Z,ee,ye)}if(Te(ee)||Ae(ee))return He!==null?null:fe(K,Z,ee,ye,null);if(typeof ee.then=="function")return ie(K,Z,Uu(ee),ye);if(ee.$$typeof===B)return ie(K,Z,zu(K,ee),ye);Fu(K,ee)}return null}function ce(K,Z,ee,ye,He){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return K=K.get(ee)||null,j(Z,K,""+ye,He);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return K=K.get(ye.key===null?ee:ye.key)||null,F(Z,K,ye,He);case R:return K=K.get(ye.key===null?ee:ye.key)||null,te(Z,K,ye,He);case U:return ye=so(ye),ce(K,Z,ee,ye,He)}if(Te(ye)||Ae(ye))return K=K.get(ee)||null,fe(Z,K,ye,He,null);if(typeof ye.then=="function")return ce(K,Z,ee,Uu(ye),He);if(ye.$$typeof===B)return ce(K,Z,ee,zu(Z,ye),He);Fu(Z,ye)}return null}function ze(K,Z,ee,ye){for(var He=null,Et=null,qe=Z,st=Z=0,bt=null;qe!==null&&st<ee.length;st++){qe.index>st?(bt=qe,qe=null):bt=qe.sibling;var Rt=ie(K,qe,ee[st],ye);if(Rt===null){qe===null&&(qe=bt);break}i&&qe&&Rt.alternate===null&&r(K,qe),Z=k(Rt,Z,st),Et===null?He=Rt:Et.sibling=Rt,Et=Rt,qe=bt}if(st===ee.length)return u(K,qe),xt&&Ci(K,st),He;if(qe===null){for(;st<ee.length;st++)qe=xe(K,ee[st],ye),qe!==null&&(Z=k(qe,Z,st),Et===null?He=qe:Et.sibling=qe,Et=qe);return xt&&Ci(K,st),He}for(qe=g(qe);st<ee.length;st++)bt=ce(qe,K,st,ee[st],ye),bt!==null&&(i&&bt.alternate!==null&&qe.delete(bt.key===null?st:bt.key),Z=k(bt,Z,st),Et===null?He=bt:Et.sibling=bt,Et=bt);return i&&qe.forEach(function(Er){return r(K,Er)}),xt&&Ci(K,st),He}function Ge(K,Z,ee,ye){if(ee==null)throw Error(a(151));for(var He=null,Et=null,qe=Z,st=Z=0,bt=null,Rt=ee.next();qe!==null&&!Rt.done;st++,Rt=ee.next()){qe.index>st?(bt=qe,qe=null):bt=qe.sibling;var Er=ie(K,qe,Rt.value,ye);if(Er===null){qe===null&&(qe=bt);break}i&&qe&&Er.alternate===null&&r(K,qe),Z=k(Er,Z,st),Et===null?He=Er:Et.sibling=Er,Et=Er,qe=bt}if(Rt.done)return u(K,qe),xt&&Ci(K,st),He;if(qe===null){for(;!Rt.done;st++,Rt=ee.next())Rt=xe(K,Rt.value,ye),Rt!==null&&(Z=k(Rt,Z,st),Et===null?He=Rt:Et.sibling=Rt,Et=Rt);return xt&&Ci(K,st),He}for(qe=g(qe);!Rt.done;st++,Rt=ee.next())Rt=ce(qe,K,st,Rt.value,ye),Rt!==null&&(i&&Rt.alternate!==null&&qe.delete(Rt.key===null?st:Rt.key),Z=k(Rt,Z,st),Et===null?He=Rt:Et.sibling=Rt,Et=Rt);return i&&qe.forEach(function(YP){return r(K,YP)}),xt&&Ci(K,st),He}function Ht(K,Z,ee,ye){if(typeof ee=="object"&&ee!==null&&ee.type===_&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:e:{for(var He=ee.key;Z!==null;){if(Z.key===He){if(He=ee.type,He===_){if(Z.tag===7){u(K,Z.sibling),ye=S(Z,ee.props.children),ye.return=K,K=ye;break e}}else if(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===U&&so(He)===Z.type){u(K,Z.sibling),ye=S(Z,ee.props),_l(ye,ee),ye.return=K,K=ye;break e}u(K,Z);break}else r(K,Z);Z=Z.sibling}ee.type===_?(ye=no(ee.props.children,K.mode,ye,ee.key),ye.return=K,K=ye):(ye=Pu(ee.type,ee.key,ee.props,null,K.mode,ye),_l(ye,ee),ye.return=K,K=ye)}return I(K);case R:e:{for(He=ee.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===ee.containerInfo&&Z.stateNode.implementation===ee.implementation){u(K,Z.sibling),ye=S(Z,ee.children||[]),ye.return=K,K=ye;break e}else{u(K,Z);break}else r(K,Z);Z=Z.sibling}ye=nf(ee,K.mode,ye),ye.return=K,K=ye}return I(K);case U:return ee=so(ee),Ht(K,Z,ee,ye)}if(Te(ee))return ze(K,Z,ee,ye);if(Ae(ee)){if(He=Ae(ee),typeof He!="function")throw Error(a(150));return ee=He.call(ee),Ge(K,Z,ee,ye)}if(typeof ee.then=="function")return Ht(K,Z,Uu(ee),ye);if(ee.$$typeof===B)return Ht(K,Z,zu(K,ee),ye);Fu(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Z!==null&&Z.tag===6?(u(K,Z.sibling),ye=S(Z,ee),ye.return=K,K=ye):(u(K,Z),ye=tf(ee,K.mode,ye),ye.return=K,K=ye),I(K)):u(K,Z)}return function(K,Z,ee,ye){try{Tl=0;var He=Ht(K,Z,ee,ye);return ss=null,He}catch(qe){if(qe===os||qe===qu)throw qe;var Et=ya(29,qe,null,K.mode);return Et.lanes=ye,Et.return=K,Et}}}var co=IS(!0),TS=IS(!1),ur=!1;function hf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gf(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function dr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function pr(i,r,u){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(_t&2)!==0){var S=g.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),g.pending=r,r=Ou(i),mS(i,null,u),r}return Nu(i,g,r,u),Ou(i)}function Nl(i,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,$a(i,u)}}function vf(i,r){var u=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var S=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var I={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};k===null?S=k=I:k=k.next=I,u=u.next}while(u!==null);k===null?S=k=r:k=k.next=r}else S=k=r;u={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=r:i.next=r,u.lastBaseUpdate=r}var yf=!1;function Ol(){if(yf){var i=rs;if(i!==null)throw i}}function Pl(i,r,u,g){yf=!1;var S=i.updateQueue;ur=!1;var k=S.firstBaseUpdate,I=S.lastBaseUpdate,j=S.shared.pending;if(j!==null){S.shared.pending=null;var F=j,te=F.next;F.next=null,I===null?k=te:I.next=te,I=F;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,j=fe.lastBaseUpdate,j!==I&&(j===null?fe.firstBaseUpdate=te:j.next=te,fe.lastBaseUpdate=F))}if(k!==null){var xe=S.baseState;I=0,fe=te=F=null,j=k;do{var ie=j.lane&-536870913,ce=ie!==j.lane;if(ce?(yt&ie)===ie:(g&ie)===ie){ie!==0&&ie===is&&(yf=!0),fe!==null&&(fe=fe.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ze=i,Ge=j;ie=r;var Ht=u;switch(Ge.tag){case 1:if(ze=Ge.payload,typeof ze=="function"){xe=ze.call(Ht,xe,ie);break e}xe=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ge.payload,ie=typeof ze=="function"?ze.call(Ht,xe,ie):ze,ie==null)break e;xe=M({},xe,ie);break e;case 2:ur=!0}}ie=j.callback,ie!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=S.callbacks,ce===null?S.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:j.tag,payload:j.payload,callback:j.callback,next:null},fe===null?(te=fe=ce,F=xe):fe=fe.next=ce,I|=ie;if(j=j.next,j===null){if(j=S.shared.pending,j===null)break;ce=j,j=ce.next,ce.next=null,S.lastBaseUpdate=ce,S.shared.pending=null}}while(!0);fe===null&&(F=xe),S.baseState=F,S.firstBaseUpdate=te,S.lastBaseUpdate=fe,k===null&&(S.shared.lanes=0),vr|=I,i.lanes=I,i.memoizedState=xe}}function _S(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function NS(i,r){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)_S(u[i],r)}var ls=z(null),Hu=z(0);function OS(i,r){i=Di,de(Hu,i),de(ls,r),Di=i|r.baseLanes}function bf(){de(Hu,Di),de(ls,ls.current)}function Sf(){Di=Hu.current,ae(ls),ae(Hu)}var ba=z(null),za=null;function mr(i){var r=i.alternate;de(hn,hn.current&1),de(ba,i),za===null&&(r===null||ls.current!==null||r.memoizedState!==null)&&(za=i)}function xf(i){de(hn,hn.current),de(ba,i),za===null&&(za=i)}function PS(i){i.tag===22?(de(hn,hn.current),de(ba,i),za===null&&(za=i)):fr()}function fr(){de(hn,hn.current),de(ba,ba.current)}function Sa(i){ae(ba),za===i&&(za=null),ae(hn)}var hn=z(0);function $u(i){for(var r=i;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Eh(u)||Rh(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ri=0,rt=null,Ut=null,Sn=null,Qu=!1,cs=!1,uo=!1,Vu=0,jl=0,us=null,U5=0;function cn(){throw Error(a(321))}function kf(i,r){if(r===null)return!1;for(var u=0;u<r.length&&u<i.length;u++)if(!va(i[u],r[u]))return!1;return!0}function wf(i,r,u,g,S,k){return Ri=k,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,$.H=i===null||i.memoizedState===null?v1:Lf,uo=!1,k=u(g,S),uo=!1,cs&&(k=DS(r,u,g,S)),jS(i),k}function jS(i){$.H=Ll;var r=Ut!==null&&Ut.next!==null;if(Ri=0,Sn=Ut=rt=null,Qu=!1,jl=0,us=null,r)throw Error(a(300));i===null||xn||(i=i.dependencies,i!==null&&Du(i)&&(xn=!0))}function DS(i,r,u,g){rt=i;var S=0;do{if(cs&&(us=null),jl=0,cs=!1,25<=S)throw Error(a(301));if(S+=1,Sn=Ut=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}$.H=y1,k=r(u,g)}while(cs);return k}function F5(){var i=$.H,r=i.useState()[0];return r=typeof r.then=="function"?Dl(r):r,i=i.useState()[0],(Ut!==null?Ut.memoizedState:null)!==i&&(rt.flags|=1024),r}function Mf(){var i=Vu!==0;return Vu=0,i}function Cf(i,r,u){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~u}function Af(i){if(Qu){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Qu=!1}Ri=0,Sn=Ut=rt=null,cs=!1,jl=Vu=0,us=null}function Vn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?rt.memoizedState=Sn=i:Sn=Sn.next=i,Sn}function gn(){if(Ut===null){var i=rt.alternate;i=i!==null?i.memoizedState:null}else i=Ut.next;var r=Sn===null?rt.memoizedState:Sn.next;if(r!==null)Sn=r,Ut=i;else{if(i===null)throw rt.alternate===null?Error(a(467)):Error(a(310));Ut=i,i={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Sn===null?rt.memoizedState=Sn=i:Sn=Sn.next=i}return Sn}function Gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(i){var r=jl;return jl+=1,us===null&&(us=[]),i=AS(us,i,r),r=rt,(Sn===null?r.memoizedState:Sn.next)===null&&(r=r.alternate,$.H=r===null||r.memoizedState===null?v1:Lf),i}function Zu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Dl(i);if(i.$$typeof===B)return Pn(i)}throw Error(a(438,String(i)))}function Ef(i){var r=null,u=rt.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var g=rt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=Gu(),rt.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(i),g=0;g<i;g++)u[g]=Me;return r.index++,u}function Ii(i,r){return typeof r=="function"?r(i):r}function Wu(i){var r=gn();return Rf(r,Ut,i)}function Rf(i,r,u){var g=i.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=u;var S=i.baseQueue,k=g.pending;if(k!==null){if(S!==null){var I=S.next;S.next=k.next,k.next=I}r.baseQueue=S=k,g.pending=null}if(k=i.baseState,S===null)i.memoizedState=k;else{r=S.next;var j=I=null,F=null,te=r,fe=!1;do{var xe=te.lane&-536870913;if(xe!==te.lane?(yt&xe)===xe:(Ri&xe)===xe){var ie=te.revertLane;if(ie===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),xe===is&&(fe=!0);else if((Ri&ie)===ie){te=te.next,ie===is&&(fe=!0);continue}else xe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},F===null?(j=F=xe,I=k):F=F.next=xe,rt.lanes|=ie,vr|=ie;xe=te.action,uo&&u(k,xe),k=te.hasEagerState?te.eagerState:u(k,xe)}else ie={lane:xe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},F===null?(j=F=ie,I=k):F=F.next=ie,rt.lanes|=xe,vr|=xe;te=te.next}while(te!==null&&te!==r);if(F===null?I=k:F.next=j,!va(k,i.memoizedState)&&(xn=!0,fe&&(u=rs,u!==null)))throw u;i.memoizedState=k,i.baseState=I,i.baseQueue=F,g.lastRenderedState=k}return S===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function If(i){var r=gn(),u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=i;var g=u.dispatch,S=u.pending,k=r.memoizedState;if(S!==null){u.pending=null;var I=S=S.next;do k=i(k,I.action),I=I.next;while(I!==S);va(k,r.memoizedState)||(xn=!0),r.memoizedState=k,r.baseQueue===null&&(r.baseState=k),u.lastRenderedState=k}return[k,g]}function zS(i,r,u){var g=rt,S=gn(),k=xt;if(k){if(u===void 0)throw Error(a(407));u=u()}else u=r();var I=!va((Ut||S).memoizedState,u);if(I&&(S.memoizedState=u,xn=!0),S=S.queue,Nf(BS.bind(null,g,S,i),[i]),S.getSnapshot!==r||I||Sn!==null&&Sn.memoizedState.tag&1){if(g.flags|=2048,ds(9,{destroy:void 0},qS.bind(null,g,S,u,r),null),Vt===null)throw Error(a(349));k||(Ri&127)!==0||LS(g,r,u)}return u}function LS(i,r,u){i.flags|=16384,i={getSnapshot:r,value:u},r=rt.updateQueue,r===null?(r=Gu(),rt.updateQueue=r,r.stores=[i]):(u=r.stores,u===null?r.stores=[i]:u.push(i))}function qS(i,r,u,g){r.value=u,r.getSnapshot=g,US(r)&&FS(i)}function BS(i,r,u){return u(function(){US(r)&&FS(i)})}function US(i){var r=i.getSnapshot;i=i.value;try{var u=r();return!va(i,u)}catch{return!0}}function FS(i){var r=to(i,2);r!==null&&la(r,i,2)}function Tf(i){var r=Vn();if(typeof i=="function"){var u=i;if(i=u(),uo){ha(!0);try{u()}finally{ha(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:i},r}function HS(i,r,u,g){return i.baseState=u,Rf(i,Ut,typeof g=="function"?g:Ii)}function H5(i,r,u,g,S){if(Xu(i))throw Error(a(485));if(i=r.action,i!==null){var k={payload:S,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){k.listeners.push(I)}};$.T!==null?u(!0):k.isTransition=!1,g(k),u=r.pending,u===null?(k.next=r.pending=k,$S(r,k)):(k.next=u.next,r.pending=u.next=k)}}function $S(i,r){var u=r.action,g=r.payload,S=i.state;if(r.isTransition){var k=$.T,I={};$.T=I;try{var j=u(S,g),F=$.S;F!==null&&F(I,j),QS(i,r,j)}catch(te){_f(i,r,te)}finally{k!==null&&I.types!==null&&(k.types=I.types),$.T=k}}else try{k=u(S,g),QS(i,r,k)}catch(te){_f(i,r,te)}}function QS(i,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(g){VS(i,r,g)},function(g){return _f(i,r,g)}):VS(i,r,u)}function VS(i,r,u){r.status="fulfilled",r.value=u,GS(r),i.state=u,r=i.pending,r!==null&&(u=r.next,u===r?i.pending=null:(u=u.next,r.next=u,$S(i,u)))}function _f(i,r,u){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=u,GS(r),r=r.next;while(r!==g)}i.action=null}function GS(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function ZS(i,r){return r}function WS(i,r){if(xt){var u=Vt.formState;if(u!==null){e:{var g=rt;if(xt){if(Kt){t:{for(var S=Kt,k=Da;S.nodeType!==8;){if(!k){S=null;break t}if(S=La(S.nextSibling),S===null){S=null;break t}}k=S.data,S=k==="F!"||k==="F"?S:null}if(S){Kt=La(S.nextSibling),g=S.data==="F!";break e}}lr(g)}g=!1}g&&(r=u[0])}}return u=Vn(),u.memoizedState=u.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ZS,lastRenderedState:r},u.queue=g,u=f1.bind(null,rt,g),g.dispatch=u,g=Tf(!1),k=zf.bind(null,rt,!1,g.queue),g=Vn(),S={state:r,dispatch:null,action:i,pending:null},g.queue=S,u=H5.bind(null,rt,S,k,u),S.dispatch=u,g.memoizedState=i,[r,u,!1]}function KS(i){var r=gn();return YS(r,Ut,i)}function YS(i,r,u){if(r=Rf(i,r,ZS)[0],i=Wu(Ii)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Dl(r)}catch(I){throw I===os?qu:I}else g=r;r=gn();var S=r.queue,k=S.dispatch;return u!==r.memoizedState&&(rt.flags|=2048,ds(9,{destroy:void 0},$5.bind(null,S,u),null)),[g,k,i]}function $5(i,r){i.action=r}function XS(i){var r=gn(),u=Ut;if(u!==null)return YS(r,u,i);gn(),r=r.memoizedState,u=gn();var g=u.queue.dispatch;return u.memoizedState=i,[r,g,!1]}function ds(i,r,u,g){return i={tag:i,create:u,deps:g,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Gu(),rt.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=i.next=i:(g=u.next,u.next=i,i.next=g,r.lastEffect=i),i}function JS(){return gn().memoizedState}function Ku(i,r,u,g){var S=Vn();rt.flags|=i,S.memoizedState=ds(1|r,{destroy:void 0},u,g===void 0?null:g)}function Yu(i,r,u,g){var S=gn();g=g===void 0?null:g;var k=S.memoizedState.inst;Ut!==null&&g!==null&&kf(g,Ut.memoizedState.deps)?S.memoizedState=ds(r,k,u,g):(rt.flags|=i,S.memoizedState=ds(1|r,k,u,g))}function e1(i,r){Ku(8390656,8,i,r)}function Nf(i,r){Yu(2048,8,i,r)}function Q5(i){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Gu(),rt.updateQueue=r,r.events=[i];else{var u=r.events;u===null?r.events=[i]:u.push(i)}}function t1(i){var r=gn().memoizedState;return Q5({ref:r,nextImpl:i}),function(){if((_t&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function n1(i,r){return Yu(4,2,i,r)}function a1(i,r){return Yu(4,4,i,r)}function i1(i,r){if(typeof r=="function"){i=i();var u=r(i);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function r1(i,r,u){u=u!=null?u.concat([i]):null,Yu(4,4,i1.bind(null,r,i),u)}function Of(){}function o1(i,r){var u=gn();r=r===void 0?null:r;var g=u.memoizedState;return r!==null&&kf(r,g[1])?g[0]:(u.memoizedState=[i,r],i)}function s1(i,r){var u=gn();r=r===void 0?null:r;var g=u.memoizedState;if(r!==null&&kf(r,g[1]))return g[0];if(g=i(),uo){ha(!0);try{i()}finally{ha(!1)}}return u.memoizedState=[g,r],g}function Pf(i,r,u){return u===void 0||(Ri&1073741824)!==0&&(yt&261930)===0?i.memoizedState=r:(i.memoizedState=u,i=lx(),rt.lanes|=i,vr|=i,u)}function l1(i,r,u,g){return va(u,r)?u:ls.current!==null?(i=Pf(i,u,g),va(i,r)||(xn=!0),i):(Ri&42)===0||(Ri&1073741824)!==0&&(yt&261930)===0?(xn=!0,i.memoizedState=u):(i=lx(),rt.lanes|=i,vr|=i,r)}function c1(i,r,u,g,S){var k=ue.p;ue.p=k!==0&&8>k?k:8;var I=$.T,j={};$.T=j,zf(i,!1,r,u);try{var F=S(),te=$.S;if(te!==null&&te(j,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var fe=B5(F,g);zl(i,r,fe,wa(i))}else zl(i,r,g,wa(i))}catch(xe){zl(i,r,{then:function(){},status:"rejected",reason:xe},wa())}finally{ue.p=k,I!==null&&j.types!==null&&(I.types=j.types),$.T=I}}function V5(){}function jf(i,r,u,g){if(i.tag!==5)throw Error(a(476));var S=u1(i).queue;c1(i,S,r,ke,u===null?V5:function(){return d1(i),u(g)})}function u1(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:ke,baseState:ke,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:ke},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:u},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function d1(i){var r=u1(i);r.next===null&&(r=i.alternate.memoizedState),zl(i,r.next.queue,{},wa())}function Df(){return Pn(ec)}function p1(){return gn().memoizedState}function m1(){return gn().memoizedState}function G5(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var u=wa();i=dr(u);var g=pr(r,i,u);g!==null&&(la(g,r,u),Nl(g,r,u)),r={cache:df()},i.payload=r;return}r=r.return}}function Z5(i,r,u){var g=wa();u={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Xu(i)?h1(r,u):(u=Jm(i,r,u,g),u!==null&&(la(u,i,g),g1(u,r,g)))}function f1(i,r,u){var g=wa();zl(i,r,u,g)}function zl(i,r,u,g){var S={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Xu(i))h1(r,S);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=r.lastRenderedReducer,k!==null))try{var I=r.lastRenderedState,j=k(I,u);if(S.hasEagerState=!0,S.eagerState=j,va(j,I))return Nu(i,r,S,0),Vt===null&&_u(),!1}catch{}if(u=Jm(i,r,S,g),u!==null)return la(u,i,g),g1(u,r,g),!0}return!1}function zf(i,r,u,g){if(g={lane:2,revertLane:hh(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Xu(i)){if(r)throw Error(a(479))}else r=Jm(i,u,g,2),r!==null&&la(r,i,2)}function Xu(i){var r=i.alternate;return i===rt||r!==null&&r===rt}function h1(i,r){cs=Qu=!0;var u=i.pending;u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r}function g1(i,r,u){if((u&4194048)!==0){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,$a(i,u)}}var Ll={readContext:Pn,use:Zu,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useLayoutEffect:cn,useInsertionEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useSyncExternalStore:cn,useId:cn,useHostTransitionStatus:cn,useFormState:cn,useActionState:cn,useOptimistic:cn,useMemoCache:cn,useCacheRefresh:cn};Ll.useEffectEvent=cn;var v1={readContext:Pn,use:Zu,useCallback:function(i,r){return Vn().memoizedState=[i,r===void 0?null:r],i},useContext:Pn,useEffect:e1,useImperativeHandle:function(i,r,u){u=u!=null?u.concat([i]):null,Ku(4194308,4,i1.bind(null,r,i),u)},useLayoutEffect:function(i,r){return Ku(4194308,4,i,r)},useInsertionEffect:function(i,r){Ku(4,2,i,r)},useMemo:function(i,r){var u=Vn();r=r===void 0?null:r;var g=i();if(uo){ha(!0);try{i()}finally{ha(!1)}}return u.memoizedState=[g,r],g},useReducer:function(i,r,u){var g=Vn();if(u!==void 0){var S=u(r);if(uo){ha(!0);try{u(r)}finally{ha(!1)}}}else S=r;return g.memoizedState=g.baseState=S,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:S},g.queue=i,i=i.dispatch=Z5.bind(null,rt,i),[g.memoizedState,i]},useRef:function(i){var r=Vn();return i={current:i},r.memoizedState=i},useState:function(i){i=Tf(i);var r=i.queue,u=f1.bind(null,rt,r);return r.dispatch=u,[i.memoizedState,u]},useDebugValue:Of,useDeferredValue:function(i,r){var u=Vn();return Pf(u,i,r)},useTransition:function(){var i=Tf(!1);return i=c1.bind(null,rt,i.queue,!0,!1),Vn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,u){var g=rt,S=Vn();if(xt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=r(),Vt===null)throw Error(a(349));(yt&127)!==0||LS(g,r,u)}S.memoizedState=u;var k={value:u,getSnapshot:r};return S.queue=k,e1(BS.bind(null,g,k,i),[i]),g.flags|=2048,ds(9,{destroy:void 0},qS.bind(null,g,k,u,r),null),u},useId:function(){var i=Vn(),r=Vt.identifierPrefix;if(xt){var u=ai,g=ni;u=(g&~(1<<32-Nn(g)-1)).toString(32)+u,r="_"+r+"R_"+u,u=Vu++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=U5++,r="_"+r+"r_"+u.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Df,useFormState:WS,useActionState:WS,useOptimistic:function(i){var r=Vn();r.memoizedState=r.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=zf.bind(null,rt,!0,u),u.dispatch=r,[i,r]},useMemoCache:Ef,useCacheRefresh:function(){return Vn().memoizedState=G5.bind(null,rt)},useEffectEvent:function(i){var r=Vn(),u={impl:i};return r.memoizedState=u,function(){if((_t&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Lf={readContext:Pn,use:Zu,useCallback:o1,useContext:Pn,useEffect:Nf,useImperativeHandle:r1,useInsertionEffect:n1,useLayoutEffect:a1,useMemo:s1,useReducer:Wu,useRef:JS,useState:function(){return Wu(Ii)},useDebugValue:Of,useDeferredValue:function(i,r){var u=gn();return l1(u,Ut.memoizedState,i,r)},useTransition:function(){var i=Wu(Ii)[0],r=gn().memoizedState;return[typeof i=="boolean"?i:Dl(i),r]},useSyncExternalStore:zS,useId:p1,useHostTransitionStatus:Df,useFormState:KS,useActionState:KS,useOptimistic:function(i,r){var u=gn();return HS(u,Ut,i,r)},useMemoCache:Ef,useCacheRefresh:m1};Lf.useEffectEvent=t1;var y1={readContext:Pn,use:Zu,useCallback:o1,useContext:Pn,useEffect:Nf,useImperativeHandle:r1,useInsertionEffect:n1,useLayoutEffect:a1,useMemo:s1,useReducer:If,useRef:JS,useState:function(){return If(Ii)},useDebugValue:Of,useDeferredValue:function(i,r){var u=gn();return Ut===null?Pf(u,i,r):l1(u,Ut.memoizedState,i,r)},useTransition:function(){var i=If(Ii)[0],r=gn().memoizedState;return[typeof i=="boolean"?i:Dl(i),r]},useSyncExternalStore:zS,useId:p1,useHostTransitionStatus:Df,useFormState:XS,useActionState:XS,useOptimistic:function(i,r){var u=gn();return Ut!==null?HS(u,Ut,i,r):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:m1};y1.useEffectEvent=t1;function qf(i,r,u,g){r=i.memoizedState,u=u(g,r),u=u==null?r:M({},r,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Bf={enqueueSetState:function(i,r,u){i=i._reactInternals;var g=wa(),S=dr(g);S.payload=r,u!=null&&(S.callback=u),r=pr(i,S,g),r!==null&&(la(r,i,g),Nl(r,i,g))},enqueueReplaceState:function(i,r,u){i=i._reactInternals;var g=wa(),S=dr(g);S.tag=1,S.payload=r,u!=null&&(S.callback=u),r=pr(i,S,g),r!==null&&(la(r,i,g),Nl(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var u=wa(),g=dr(u);g.tag=2,r!=null&&(g.callback=r),r=pr(i,g,u),r!==null&&(la(r,i,u),Nl(r,i,u))}};function b1(i,r,u,g,S,k,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,k,I):r.prototype&&r.prototype.isPureReactComponent?!Ml(u,g)||!Ml(S,k):!0}function S1(i,r,u,g){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,g),r.state!==i&&Bf.enqueueReplaceState(r,r.state,null)}function po(i,r){var u=r;if("ref"in r){u={};for(var g in r)g!=="ref"&&(u[g]=r[g])}if(i=i.defaultProps){u===r&&(u=M({},u));for(var S in i)u[S]===void 0&&(u[S]=i[S])}return u}function x1(i){Tu(i)}function k1(i){console.error(i)}function w1(i){Tu(i)}function Ju(i,r){try{var u=i.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function M1(i,r,u){try{var g=i.onCaughtError;g(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Uf(i,r,u){return u=dr(u),u.tag=3,u.payload={element:null},u.callback=function(){Ju(i,r)},u}function C1(i){return i=dr(i),i.tag=3,i}function A1(i,r,u,g){var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var k=g.value;i.payload=function(){return S(k)},i.callback=function(){M1(r,u,g)}}var I=u.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){M1(r,u,g),typeof S!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var j=g.stack;this.componentDidCatch(g.value,{componentStack:j!==null?j:""})})}function W5(i,r,u,g,S){if(u.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=u.alternate,r!==null&&as(r,u,S,!0),u=ba.current,u!==null){switch(u.tag){case 31:case 13:return za===null?dd():u.alternate===null&&un===0&&(un=3),u.flags&=-257,u.flags|=65536,u.lanes=S,g===Bu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([g]):r.add(g),ph(i,g,S)),!1;case 22:return u.flags|=65536,g===Bu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([g]):u.add(g)),ph(i,g,S)),!1}throw Error(a(435,u.tag))}return ph(i,g,S),dd(),!1}if(xt)return r=ba.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,g!==of&&(i=Error(a(422),{cause:g}),El(Oa(i,u)))):(g!==of&&(r=Error(a(423),{cause:g}),El(Oa(r,u))),i=i.current.alternate,i.flags|=65536,S&=-S,i.lanes|=S,g=Oa(g,u),S=Uf(i.stateNode,g,S),vf(i,S),un!==4&&(un=2)),!1;var k=Error(a(520),{cause:g});if(k=Oa(k,u),Vl===null?Vl=[k]:Vl.push(k),un!==4&&(un=2),r===null)return!0;g=Oa(g,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,i=S&-S,u.lanes|=i,i=Uf(u.stateNode,g,i),vf(u,i),!1;case 1:if(r=u.type,k=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(yr===null||!yr.has(k))))return u.flags|=65536,S&=-S,u.lanes|=S,S=C1(S),A1(S,i,u,g),vf(u,S),!1}u=u.return}while(u!==null);return!1}var Ff=Error(a(461)),xn=!1;function jn(i,r,u,g){r.child=i===null?TS(r,null,u,g):co(r,i.child,u,g)}function E1(i,r,u,g,S){u=u.render;var k=r.ref;if("ref"in g){var I={};for(var j in g)j!=="ref"&&(I[j]=g[j])}else I=g;return ro(r),g=wf(i,r,u,I,k,S),j=Mf(),i!==null&&!xn?(Cf(i,r,S),Ti(i,r,S)):(xt&&j&&af(r),r.flags|=1,jn(i,r,g,S),r.child)}function R1(i,r,u,g,S){if(i===null){var k=u.type;return typeof k=="function"&&!ef(k)&&k.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=k,I1(i,r,k,g,S)):(i=Pu(u.type,null,g,r,r.mode,S),i.ref=r.ref,i.return=r,r.child=i)}if(k=i.child,!Kf(i,S)){var I=k.memoizedProps;if(u=u.compare,u=u!==null?u:Ml,u(I,g)&&i.ref===r.ref)return Ti(i,r,S)}return r.flags|=1,i=Mi(k,g),i.ref=r.ref,i.return=r,r.child=i}function I1(i,r,u,g,S){if(i!==null){var k=i.memoizedProps;if(Ml(k,g)&&i.ref===r.ref)if(xn=!1,r.pendingProps=g=k,Kf(i,S))(i.flags&131072)!==0&&(xn=!0);else return r.lanes=i.lanes,Ti(i,r,S)}return Hf(i,r,u,g,S)}function T1(i,r,u,g){var S=g.children,k=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((r.flags&128)!==0){if(k=k!==null?k.baseLanes|u:u,i!==null){for(g=r.child=i.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~k}else g=0,r.child=null;return _1(i,r,k,u,g)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Lu(r,k!==null?k.cachePool:null),k!==null?OS(r,k):bf(),PS(r);else return g=r.lanes=536870912,_1(i,r,k!==null?k.baseLanes|u:u,u,g)}else k!==null?(Lu(r,k.cachePool),OS(r,k),fr(),r.memoizedState=null):(i!==null&&Lu(r,null),bf(),fr());return jn(i,r,S,u),r.child}function ql(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function _1(i,r,u,g,S){var k=mf();return k=k===null?null:{parent:bn._currentValue,pool:k},r.memoizedState={baseLanes:u,cachePool:k},i!==null&&Lu(r,null),bf(),PS(r),i!==null&&as(i,r,g,!0),r.childLanes=S,null}function ed(i,r){return r=nd({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function N1(i,r,u){return co(r,i.child,null,u),i=ed(r,r.pendingProps),i.flags|=2,Sa(r),r.memoizedState=null,i}function K5(i,r,u){var g=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(xt){if(g.mode==="hidden")return i=ed(r,g),r.lanes=536870912,ql(null,i);if(xf(r),(i=Kt)?(i=$x(i,Da),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:or!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},u=hS(i),u.return=r,r.child=u,On=r,Kt=null)):i=null,i===null)throw lr(r);return r.lanes=536870912,null}return ed(r,g)}var k=i.memoizedState;if(k!==null){var I=k.dehydrated;if(xf(r),S)if(r.flags&256)r.flags&=-257,r=N1(i,r,u);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(xn||as(i,r,u,!1),S=(u&i.childLanes)!==0,xn||S){if(g=Vt,g!==null&&(I=ml(g,u),I!==0&&I!==k.retryLane))throw k.retryLane=I,to(i,I),la(g,i,I),Ff;dd(),r=N1(i,r,u)}else i=k.treeContext,Kt=La(I.nextSibling),On=r,xt=!0,sr=null,Da=!1,i!==null&&yS(r,i),r=ed(r,g),r.flags|=4096;return r}return i=Mi(i.child,{mode:g.mode,children:g.children}),i.ref=r.ref,r.child=i,i.return=r,i}function td(i,r){var u=r.ref;if(u===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(i===null||i.ref!==u)&&(r.flags|=4194816)}}function Hf(i,r,u,g,S){return ro(r),u=wf(i,r,u,g,void 0,S),g=Mf(),i!==null&&!xn?(Cf(i,r,S),Ti(i,r,S)):(xt&&g&&af(r),r.flags|=1,jn(i,r,u,S),r.child)}function O1(i,r,u,g,S,k){return ro(r),r.updateQueue=null,u=DS(r,g,u,S),jS(i),g=Mf(),i!==null&&!xn?(Cf(i,r,k),Ti(i,r,k)):(xt&&g&&af(r),r.flags|=1,jn(i,r,u,k),r.child)}function P1(i,r,u,g,S){if(ro(r),r.stateNode===null){var k=Jo,I=u.contextType;typeof I=="object"&&I!==null&&(k=Pn(I)),k=new u(g,k),r.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Bf,r.stateNode=k,k._reactInternals=r,k=r.stateNode,k.props=g,k.state=r.memoizedState,k.refs={},hf(r),I=u.contextType,k.context=typeof I=="object"&&I!==null?Pn(I):Jo,k.state=r.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(qf(r,u,I,g),k.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(I=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),I!==k.state&&Bf.enqueueReplaceState(k,k.state,null),Pl(r,g,k,S),Ol(),k.state=r.memoizedState),typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(i===null){k=r.stateNode;var j=r.memoizedProps,F=po(u,j);k.props=F;var te=k.context,fe=u.contextType;I=Jo,typeof fe=="object"&&fe!==null&&(I=Pn(fe));var xe=u.getDerivedStateFromProps;fe=typeof xe=="function"||typeof k.getSnapshotBeforeUpdate=="function",j=r.pendingProps!==j,fe||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(j||te!==I)&&S1(r,k,g,I),ur=!1;var ie=r.memoizedState;k.state=ie,Pl(r,g,k,S),Ol(),te=r.memoizedState,j||ie!==te||ur?(typeof xe=="function"&&(qf(r,u,xe,g),te=r.memoizedState),(F=ur||b1(r,u,F,g,ie,te,I))?(fe||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(r.flags|=4194308)):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=g,r.memoizedState=te),k.props=g,k.state=te,k.context=I,g=F):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{k=r.stateNode,gf(i,r),I=r.memoizedProps,fe=po(u,I),k.props=fe,xe=r.pendingProps,ie=k.context,te=u.contextType,F=Jo,typeof te=="object"&&te!==null&&(F=Pn(te)),j=u.getDerivedStateFromProps,(te=typeof j=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==xe||ie!==F)&&S1(r,k,g,F),ur=!1,ie=r.memoizedState,k.state=ie,Pl(r,g,k,S),Ol();var ce=r.memoizedState;I!==xe||ie!==ce||ur||i!==null&&i.dependencies!==null&&Du(i.dependencies)?(typeof j=="function"&&(qf(r,u,j,g),ce=r.memoizedState),(fe=ur||b1(r,u,fe,g,ie,ce,F)||i!==null&&i.dependencies!==null&&Du(i.dependencies))?(te||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ce,F),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ce,F)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=ce),k.props=g,k.state=ce,k.context=F,g=fe):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=1024),g=!1)}return k=g,td(i,r),g=(r.flags&128)!==0,k||g?(k=r.stateNode,u=g&&typeof u.getDerivedStateFromError!="function"?null:k.render(),r.flags|=1,i!==null&&g?(r.child=co(r,i.child,null,S),r.child=co(r,null,u,S)):jn(i,r,u,S),r.memoizedState=k.state,i=r.child):i=Ti(i,r,S),i}function j1(i,r,u,g){return ao(),r.flags|=256,jn(i,r,u,g),r.child}var $f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qf(i){return{baseLanes:i,cachePool:MS()}}function Vf(i,r,u){return i=i!==null?i.childLanes&~u:0,r&&(i|=ka),i}function D1(i,r,u){var g=r.pendingProps,S=!1,k=(r.flags&128)!==0,I;if((I=k)||(I=i!==null&&i.memoizedState===null?!1:(hn.current&2)!==0),I&&(S=!0,r.flags&=-129),I=(r.flags&32)!==0,r.flags&=-33,i===null){if(xt){if(S?mr(r):fr(),(i=Kt)?(i=$x(i,Da),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:or!==null?{id:ni,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},u=hS(i),u.return=r,r.child=u,On=r,Kt=null)):i=null,i===null)throw lr(r);return Rh(i)?r.lanes=32:r.lanes=536870912,null}var j=g.children;return g=g.fallback,S?(fr(),S=r.mode,j=nd({mode:"hidden",children:j},S),g=no(g,S,u,null),j.return=r,g.return=r,j.sibling=g,r.child=j,g=r.child,g.memoizedState=Qf(u),g.childLanes=Vf(i,I,u),r.memoizedState=$f,ql(null,g)):(mr(r),Gf(r,j))}var F=i.memoizedState;if(F!==null&&(j=F.dehydrated,j!==null)){if(k)r.flags&256?(mr(r),r.flags&=-257,r=Zf(i,r,u)):r.memoizedState!==null?(fr(),r.child=i.child,r.flags|=128,r=null):(fr(),j=g.fallback,S=r.mode,g=nd({mode:"visible",children:g.children},S),j=no(j,S,u,null),j.flags|=2,g.return=r,j.return=r,g.sibling=j,r.child=g,co(r,i.child,null,u),g=r.child,g.memoizedState=Qf(u),g.childLanes=Vf(i,I,u),r.memoizedState=$f,r=ql(null,g));else if(mr(r),Rh(j)){if(I=j.nextSibling&&j.nextSibling.dataset,I)var te=I.dgst;I=te,g=Error(a(419)),g.stack="",g.digest=I,El({value:g,source:null,stack:null}),r=Zf(i,r,u)}else if(xn||as(i,r,u,!1),I=(u&i.childLanes)!==0,xn||I){if(I=Vt,I!==null&&(g=ml(I,u),g!==0&&g!==F.retryLane))throw F.retryLane=g,to(i,g),la(I,i,g),Ff;Eh(j)||dd(),r=Zf(i,r,u)}else Eh(j)?(r.flags|=192,r.child=i.child,r=null):(i=F.treeContext,Kt=La(j.nextSibling),On=r,xt=!0,sr=null,Da=!1,i!==null&&yS(r,i),r=Gf(r,g.children),r.flags|=4096);return r}return S?(fr(),j=g.fallback,S=r.mode,F=i.child,te=F.sibling,g=Mi(F,{mode:"hidden",children:g.children}),g.subtreeFlags=F.subtreeFlags&65011712,te!==null?j=Mi(te,j):(j=no(j,S,u,null),j.flags|=2),j.return=r,g.return=r,g.sibling=j,r.child=g,ql(null,g),g=r.child,j=i.child.memoizedState,j===null?j=Qf(u):(S=j.cachePool,S!==null?(F=bn._currentValue,S=S.parent!==F?{parent:F,pool:F}:S):S=MS(),j={baseLanes:j.baseLanes|u,cachePool:S}),g.memoizedState=j,g.childLanes=Vf(i,I,u),r.memoizedState=$f,ql(i.child,g)):(mr(r),u=i.child,i=u.sibling,u=Mi(u,{mode:"visible",children:g.children}),u.return=r,u.sibling=null,i!==null&&(I=r.deletions,I===null?(r.deletions=[i],r.flags|=16):I.push(i)),r.child=u,r.memoizedState=null,u)}function Gf(i,r){return r=nd({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function nd(i,r){return i=ya(22,i,null,r),i.lanes=0,i}function Zf(i,r,u){return co(r,i.child,null,u),i=Gf(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function z1(i,r,u){i.lanes|=r;var g=i.alternate;g!==null&&(g.lanes|=r),cf(i.return,r,u)}function Wf(i,r,u,g,S,k){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:S,treeForkCount:k}:(I.isBackwards=r,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=u,I.tailMode=S,I.treeForkCount=k)}function L1(i,r,u){var g=r.pendingProps,S=g.revealOrder,k=g.tail;g=g.children;var I=hn.current,j=(I&2)!==0;if(j?(I=I&1|2,r.flags|=128):I&=1,de(hn,I),jn(i,r,g,u),g=xt?Al:0,!j&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&z1(i,u,r);else if(i.tag===19)z1(i,u,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(S){case"forwards":for(u=r.child,S=null;u!==null;)i=u.alternate,i!==null&&$u(i)===null&&(S=u),u=u.sibling;u=S,u===null?(S=r.child,r.child=null):(S=u.sibling,u.sibling=null),Wf(r,!1,S,u,k,g);break;case"backwards":case"unstable_legacy-backwards":for(u=null,S=r.child,r.child=null;S!==null;){if(i=S.alternate,i!==null&&$u(i)===null){r.child=S;break}i=S.sibling,S.sibling=u,u=S,S=i}Wf(r,!0,u,null,k,g);break;case"together":Wf(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function Ti(i,r,u){if(i!==null&&(r.dependencies=i.dependencies),vr|=r.lanes,(u&r.childLanes)===0)if(i!==null){if(as(i,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(a(153));if(r.child!==null){for(i=r.child,u=Mi(i,i.pendingProps),r.child=u,u.return=r;i.sibling!==null;)i=i.sibling,u=u.sibling=Mi(i,i.pendingProps),u.return=r;u.sibling=null}return r.child}function Kf(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Du(i)))}function Y5(i,r,u){switch(r.tag){case 3:se(r,r.stateNode.containerInfo),cr(r,bn,i.memoizedState.cache),ao();break;case 27:case 5:Qe(r);break;case 4:se(r,r.stateNode.containerInfo);break;case 10:cr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,xf(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(mr(r),r.flags|=128,null):(u&r.child.childLanes)!==0?D1(i,r,u):(mr(r),i=Ti(i,r,u),i!==null?i.sibling:null);mr(r);break;case 19:var S=(i.flags&128)!==0;if(g=(u&r.childLanes)!==0,g||(as(i,r,u,!1),g=(u&r.childLanes)!==0),S){if(g)return L1(i,r,u);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),de(hn,hn.current),g)break;return null;case 22:return r.lanes=0,T1(i,r,u,r.pendingProps);case 24:cr(r,bn,i.memoizedState.cache)}return Ti(i,r,u)}function q1(i,r,u){if(i!==null)if(i.memoizedProps!==r.pendingProps)xn=!0;else{if(!Kf(i,u)&&(r.flags&128)===0)return xn=!1,Y5(i,r,u);xn=(i.flags&131072)!==0}else xn=!1,xt&&(r.flags&1048576)!==0&&vS(r,Al,r.index);switch(r.lanes=0,r.tag){case 16:e:{var g=r.pendingProps;if(i=so(r.elementType),r.type=i,typeof i=="function")ef(i)?(g=po(i,g),r.tag=1,r=P1(null,r,i,g,u)):(r.tag=0,r=Hf(null,r,i,g,u));else{if(i!=null){var S=i.$$typeof;if(S===q){r.tag=11,r=E1(null,r,i,g,u);break e}else if(S===V){r.tag=14,r=R1(null,r,i,g,u);break e}}throw r=re(i)||i,Error(a(306,r,""))}}return r;case 0:return Hf(i,r,r.type,r.pendingProps,u);case 1:return g=r.type,S=po(g,r.pendingProps),P1(i,r,g,S,u);case 3:e:{if(se(r,r.stateNode.containerInfo),i===null)throw Error(a(387));g=r.pendingProps;var k=r.memoizedState;S=k.element,gf(i,r),Pl(r,g,null,u);var I=r.memoizedState;if(g=I.cache,cr(r,bn,g),g!==k.cache&&uf(r,[bn],u,!0),Ol(),g=I.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:I.cache},r.updateQueue.baseState=k,r.memoizedState=k,r.flags&256){r=j1(i,r,g,u);break e}else if(g!==S){S=Oa(Error(a(424)),r),El(S),r=j1(i,r,g,u);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Kt=La(i.firstChild),On=r,xt=!0,sr=null,Da=!0,u=TS(r,null,g,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ao(),g===S){r=Ti(i,r,u);break e}jn(i,r,g,u)}r=r.child}return r;case 26:return td(i,r),i===null?(u=Kx(r.type,null,r.pendingProps,null))?r.memoizedState=u:xt||(u=r.type,i=r.pendingProps,g=yd(he.current).createElement(u),g[En]=r,g[Un]=i,Dn(g,u,i),le(g),r.stateNode=g):r.memoizedState=Kx(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Qe(r),i===null&&xt&&(g=r.stateNode=Gx(r.type,r.pendingProps,he.current),On=r,Da=!0,S=Kt,kr(r.type)?(Ih=S,Kt=La(g.firstChild)):Kt=S),jn(i,r,r.pendingProps.children,u),td(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&xt&&((S=g=Kt)&&(g=EP(g,r.type,r.pendingProps,Da),g!==null?(r.stateNode=g,On=r,Kt=La(g.firstChild),Da=!1,S=!0):S=!1),S||lr(r)),Qe(r),S=r.type,k=r.pendingProps,I=i!==null?i.memoizedProps:null,g=k.children,Mh(S,k)?g=null:I!==null&&Mh(S,I)&&(r.flags|=32),r.memoizedState!==null&&(S=wf(i,r,F5,null,null,u),ec._currentValue=S),td(i,r),jn(i,r,g,u),r.child;case 6:return i===null&&xt&&((i=u=Kt)&&(u=RP(u,r.pendingProps,Da),u!==null?(r.stateNode=u,On=r,Kt=null,i=!0):i=!1),i||lr(r)),null;case 13:return D1(i,r,u);case 4:return se(r,r.stateNode.containerInfo),g=r.pendingProps,i===null?r.child=co(r,null,g,u):jn(i,r,g,u),r.child;case 11:return E1(i,r,r.type,r.pendingProps,u);case 7:return jn(i,r,r.pendingProps,u),r.child;case 8:return jn(i,r,r.pendingProps.children,u),r.child;case 12:return jn(i,r,r.pendingProps.children,u),r.child;case 10:return g=r.pendingProps,cr(r,r.type,g.value),jn(i,r,g.children,u),r.child;case 9:return S=r.type._context,g=r.pendingProps.children,ro(r),S=Pn(S),g=g(S),r.flags|=1,jn(i,r,g,u),r.child;case 14:return R1(i,r,r.type,r.pendingProps,u);case 15:return I1(i,r,r.type,r.pendingProps,u);case 19:return L1(i,r,u);case 31:return K5(i,r,u);case 22:return T1(i,r,u,r.pendingProps);case 24:return ro(r),g=Pn(bn),i===null?(S=mf(),S===null&&(S=Vt,k=df(),S.pooledCache=k,k.refCount++,k!==null&&(S.pooledCacheLanes|=u),S=k),r.memoizedState={parent:g,cache:S},hf(r),cr(r,bn,S)):((i.lanes&u)!==0&&(gf(i,r),Pl(r,null,null,u),Ol()),S=i.memoizedState,k=r.memoizedState,S.parent!==g?(S={parent:g,cache:g},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),cr(r,bn,g)):(g=k.cache,cr(r,bn,g),g!==S.cache&&uf(r,[bn],u,!0))),jn(i,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function _i(i){i.flags|=4}function Yf(i,r,u,g,S){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(S&335544128)===S)if(i.stateNode.complete)i.flags|=8192;else if(px())i.flags|=8192;else throw lo=Bu,ff}else i.flags&=-16777217}function B1(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!tk(r))if(px())i.flags|=8192;else throw lo=Bu,ff}function ad(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Fo():536870912,i.lanes|=r,hs|=r)}function Bl(i,r){if(!xt)switch(i.tailMode){case"hidden":r=i.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function Yt(i){var r=i.alternate!==null&&i.alternate.child===i.child,u=0,g=0;if(r)for(var S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=i,S=S.sibling;else for(S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=i,S=S.sibling;return i.subtreeFlags|=g,i.childLanes=u,r}function X5(i,r,u){var g=r.pendingProps;switch(rf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(r),null;case 1:return Yt(r),null;case 3:return u=r.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),Ei(bn),be(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(ns(r)?_i(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,sf())),Yt(r),null;case 26:var S=r.type,k=r.memoizedState;return i===null?(_i(r),k!==null?(Yt(r),B1(r,k)):(Yt(r),Yf(r,S,null,g,u))):k?k!==i.memoizedState?(_i(r),Yt(r),B1(r,k)):(Yt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==g&&_i(r),Yt(r),Yf(r,S,i,g,u)),null;case 27:if(ct(r),u=he.current,S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&_i(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Yt(r),null}i=Se.current,ns(r)?bS(r):(i=Gx(S,g,u),r.stateNode=i,_i(r))}return Yt(r),null;case 5:if(ct(r),S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&_i(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Yt(r),null}if(k=Se.current,ns(r))bS(r);else{var I=yd(he.current);switch(k){case 1:k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":k=I.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?I.createElement(S,{is:g.is}):I.createElement(S)}}k[En]=r,k[Un]=g;e:for(I=r.child;I!==null;){if(I.tag===5||I.tag===6)k.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===r)break e;for(;I.sibling===null;){if(I.return===null||I.return===r)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}r.stateNode=k;e:switch(Dn(k,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&_i(r)}}return Yt(r),Yf(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,u),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==g&&_i(r);else{if(typeof g!="string"&&r.stateNode===null)throw Error(a(166));if(i=he.current,ns(r)){if(i=r.stateNode,u=r.memoizedProps,g=null,S=On,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}i[En]=r,i=!!(i.nodeValue===u||g!==null&&g.suppressHydrationWarning===!0||Dx(i.nodeValue,u)),i||lr(r,!0)}else i=yd(i).createTextNode(g),i[En]=r,r.stateNode=i}return Yt(r),null;case 31:if(u=r.memoizedState,i===null||i.memoizedState!==null){if(g=ns(r),u!==null){if(i===null){if(!g)throw Error(a(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[En]=r}else ao(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Yt(r),i=!1}else u=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return r.flags&256?(Sa(r),r):(Sa(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Yt(r),null;case 13:if(g=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(S=ns(r),g!==null&&g.dehydrated!==null){if(i===null){if(!S)throw Error(a(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(a(317));S[En]=r}else ao(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Yt(r),S=!1}else S=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(Sa(r),r):(Sa(r),null)}return Sa(r),(r.flags&128)!==0?(r.lanes=u,r):(u=g!==null,i=i!==null&&i.memoizedState!==null,u&&(g=r.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==S&&(g.flags|=2048)),u!==i&&u&&(r.child.flags|=8192),ad(r,r.updateQueue),Yt(r),null);case 4:return be(),i===null&&bh(r.stateNode.containerInfo),Yt(r),null;case 10:return Ei(r.type),Yt(r),null;case 19:if(ae(hn),g=r.memoizedState,g===null)return Yt(r),null;if(S=(r.flags&128)!==0,k=g.rendering,k===null)if(S)Bl(g,!1);else{if(un!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(k=$u(i),k!==null){for(r.flags|=128,Bl(g,!1),i=k.updateQueue,r.updateQueue=i,ad(r,i),r.subtreeFlags=0,i=u,u=r.child;u!==null;)fS(u,i),u=u.sibling;return de(hn,hn.current&1|2),xt&&Ci(r,g.treeForkCount),r.child}i=i.sibling}g.tail!==null&&en()>ld&&(r.flags|=128,S=!0,Bl(g,!1),r.lanes=4194304)}else{if(!S)if(i=$u(k),i!==null){if(r.flags|=128,S=!0,i=i.updateQueue,r.updateQueue=i,ad(r,i),Bl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!xt)return Yt(r),null}else 2*en()-g.renderingStartTime>ld&&u!==536870912&&(r.flags|=128,S=!0,Bl(g,!1),r.lanes=4194304);g.isBackwards?(k.sibling=r.child,r.child=k):(i=g.last,i!==null?i.sibling=k:r.child=k,g.last=k)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=en(),i.sibling=null,u=hn.current,de(hn,S?u&1|2:u&1),xt&&Ci(r,g.treeForkCount),i):(Yt(r),null);case 22:case 23:return Sa(r),Sf(),g=r.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(u&536870912)!==0&&(r.flags&128)===0&&(Yt(r),r.subtreeFlags&6&&(r.flags|=8192)):Yt(r),u=r.updateQueue,u!==null&&ad(r,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==u&&(r.flags|=2048),i!==null&&ae(oo),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Ei(bn),Yt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function J5(i,r){switch(rf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Ei(bn),be(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return ct(r),null;case 31:if(r.memoizedState!==null){if(Sa(r),r.alternate===null)throw Error(a(340));ao()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Sa(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));ao()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return ae(hn),null;case 4:return be(),null;case 10:return Ei(r.type),null;case 22:case 23:return Sa(r),Sf(),i!==null&&ae(oo),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Ei(bn),null;case 25:return null;default:return null}}function U1(i,r){switch(rf(r),r.tag){case 3:Ei(bn),be();break;case 26:case 27:case 5:ct(r);break;case 4:be();break;case 31:r.memoizedState!==null&&Sa(r);break;case 13:Sa(r);break;case 19:ae(hn);break;case 10:Ei(r.type);break;case 22:case 23:Sa(r),Sf(),i!==null&&ae(oo);break;case 24:Ei(bn)}}function Ul(i,r){try{var u=r.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var S=g.next;u=S;do{if((u.tag&i)===i){g=void 0;var k=u.create,I=u.inst;g=k(),I.destroy=g}u=u.next}while(u!==S)}}catch(j){Dt(r,r.return,j)}}function hr(i,r,u){try{var g=r.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var k=S.next;g=k;do{if((g.tag&i)===i){var I=g.inst,j=I.destroy;if(j!==void 0){I.destroy=void 0,S=r;var F=u,te=j;try{te()}catch(fe){Dt(S,F,fe)}}}g=g.next}while(g!==k)}}catch(fe){Dt(r,r.return,fe)}}function F1(i){var r=i.updateQueue;if(r!==null){var u=i.stateNode;try{NS(r,u)}catch(g){Dt(i,i.return,g)}}}function H1(i,r,u){u.props=po(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(g){Dt(i,r,g)}}function Fl(i,r){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof u=="function"?i.refCleanup=u(g):u.current=g}}catch(S){Dt(i,r,S)}}function ii(i,r){var u=i.ref,g=i.refCleanup;if(u!==null)if(typeof g=="function")try{g()}catch(S){Dt(i,r,S)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(S){Dt(i,r,S)}else u.current=null}function $1(i){var r=i.type,u=i.memoizedProps,g=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&g.focus();break e;case"img":u.src?g.src=u.src:u.srcSet&&(g.srcset=u.srcSet)}}catch(S){Dt(i,i.return,S)}}function Xf(i,r,u){try{var g=i.stateNode;xP(g,i.type,u,r),g[Un]=r}catch(S){Dt(i,i.return,S)}}function Q1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&kr(i.type)||i.tag===4}function Jf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Q1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&kr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function eh(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(i),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=ki));else if(g!==4&&(g===27&&kr(i.type)&&(u=i.stateNode,r=null),i=i.child,i!==null))for(eh(i,r,u),i=i.sibling;i!==null;)eh(i,r,u),i=i.sibling}function id(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?u.insertBefore(i,r):u.appendChild(i);else if(g!==4&&(g===27&&kr(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(id(i,r,u),i=i.sibling;i!==null;)id(i,r,u),i=i.sibling}function V1(i){var r=i.stateNode,u=i.memoizedProps;try{for(var g=i.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);Dn(r,g,u),r[En]=i,r[Un]=u}catch(k){Dt(i,i.return,k)}}var Ni=!1,kn=!1,th=!1,G1=typeof WeakSet=="function"?WeakSet:Set,_n=null;function eP(i,r){if(i=i.containerInfo,kh=Cd,i=rS(i),Gm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var S=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var I=0,j=-1,F=-1,te=0,fe=0,xe=i,ie=null;t:for(;;){for(var ce;xe!==u||S!==0&&xe.nodeType!==3||(j=I+S),xe!==k||g!==0&&xe.nodeType!==3||(F=I+g),xe.nodeType===3&&(I+=xe.nodeValue.length),(ce=xe.firstChild)!==null;)ie=xe,xe=ce;for(;;){if(xe===i)break t;if(ie===u&&++te===S&&(j=I),ie===k&&++fe===g&&(F=I),(ce=xe.nextSibling)!==null)break;xe=ie,ie=xe.parentNode}xe=ce}u=j===-1||F===-1?null:{start:j,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(wh={focusedElem:i,selectionRange:u},Cd=!1,_n=r;_n!==null;)if(r=_n,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,_n=i;else for(;_n!==null;){switch(r=_n,k=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)S=i[u],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,u=r,S=k.memoizedProps,k=k.memoizedState,g=u.stateNode;try{var ze=po(u.type,S);i=g.getSnapshotBeforeUpdate(ze,k),g.__reactInternalSnapshotBeforeUpdate=i}catch(Ge){Dt(u,u.return,Ge)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,u=i.nodeType,u===9)Ah(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ah(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(a(163))}if(i=r.sibling,i!==null){i.return=r.return,_n=i;break}_n=r.return}}function Z1(i,r,u){var g=u.flags;switch(u.tag){case 0:case 11:case 15:Pi(i,u),g&4&&Ul(5,u);break;case 1:if(Pi(i,u),g&4)if(i=u.stateNode,r===null)try{i.componentDidMount()}catch(I){Dt(u,u.return,I)}else{var S=po(u.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(S,r,i.__reactInternalSnapshotBeforeUpdate)}catch(I){Dt(u,u.return,I)}}g&64&&F1(u),g&512&&Fl(u,u.return);break;case 3:if(Pi(i,u),g&64&&(i=u.updateQueue,i!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{NS(i,r)}catch(I){Dt(u,u.return,I)}}break;case 27:r===null&&g&4&&V1(u);case 26:case 5:Pi(i,u),r===null&&g&4&&$1(u),g&512&&Fl(u,u.return);break;case 12:Pi(i,u);break;case 31:Pi(i,u),g&4&&Y1(i,u);break;case 13:Pi(i,u),g&4&&X1(i,u),g&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=cP.bind(null,u),IP(i,u))));break;case 22:if(g=u.memoizedState!==null||Ni,!g){r=r!==null&&r.memoizedState!==null||kn,S=Ni;var k=kn;Ni=g,(kn=r)&&!k?ji(i,u,(u.subtreeFlags&8772)!==0):Pi(i,u),Ni=S,kn=k}break;case 30:break;default:Pi(i,u)}}function W1(i){var r=i.alternate;r!==null&&(i.alternate=null,W1(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Wr(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var tn=null,ia=!1;function Oi(i,r,u){for(u=u.child;u!==null;)K1(i,r,u),u=u.sibling}function K1(i,r,u){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(vi,u)}catch{}switch(u.tag){case 26:kn||ii(u,r),Oi(i,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:kn||ii(u,r);var g=tn,S=ia;kr(u.type)&&(tn=u.stateNode,ia=!1),Oi(i,r,u),Yl(u.stateNode),tn=g,ia=S;break;case 5:kn||ii(u,r);case 6:if(g=tn,S=ia,tn=null,Oi(i,r,u),tn=g,ia=S,tn!==null)if(ia)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(u.stateNode)}catch(k){Dt(u,r,k)}else try{tn.removeChild(u.stateNode)}catch(k){Dt(u,r,k)}break;case 18:tn!==null&&(ia?(i=tn,Fx(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),ws(i)):Fx(tn,u.stateNode));break;case 4:g=tn,S=ia,tn=u.stateNode.containerInfo,ia=!0,Oi(i,r,u),tn=g,ia=S;break;case 0:case 11:case 14:case 15:hr(2,u,r),kn||hr(4,u,r),Oi(i,r,u);break;case 1:kn||(ii(u,r),g=u.stateNode,typeof g.componentWillUnmount=="function"&&H1(u,r,g)),Oi(i,r,u);break;case 21:Oi(i,r,u);break;case 22:kn=(g=kn)||u.memoizedState!==null,Oi(i,r,u),kn=g;break;default:Oi(i,r,u)}}function Y1(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ws(i)}catch(u){Dt(r,r.return,u)}}}function X1(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ws(i)}catch(u){Dt(r,r.return,u)}}function tP(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new G1),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new G1),r;default:throw Error(a(435,i.tag))}}function rd(i,r){var u=tP(i);r.forEach(function(g){if(!u.has(g)){u.add(g);var S=uP.bind(null,i,g);g.then(S,S)}})}function ra(i,r){var u=r.deletions;if(u!==null)for(var g=0;g<u.length;g++){var S=u[g],k=i,I=r,j=I;e:for(;j!==null;){switch(j.tag){case 27:if(kr(j.type)){tn=j.stateNode,ia=!1;break e}break;case 5:tn=j.stateNode,ia=!1;break e;case 3:case 4:tn=j.stateNode.containerInfo,ia=!0;break e}j=j.return}if(tn===null)throw Error(a(160));K1(k,I,S),tn=null,ia=!1,k=S.alternate,k!==null&&(k.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)J1(r,i),r=r.sibling}var Ga=null;function J1(i,r){var u=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ra(r,i),oa(i),g&4&&(hr(3,i,i.return),Ul(3,i),hr(5,i,i.return));break;case 1:ra(r,i),oa(i),g&512&&(kn||u===null||ii(u,u.return)),g&64&&Ni&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?g:u.concat(g))));break;case 26:var S=Ga;if(ra(r,i),oa(i),g&512&&(kn||u===null||ii(u,u.return)),g&4){var k=u!==null?u.memoizedState:null;if(g=i.memoizedState,u===null)if(g===null)if(i.stateNode===null){e:{g=i.type,u=i.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":k=S.getElementsByTagName("title")[0],(!k||k[bi]||k[En]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=S.createElement(g),S.head.insertBefore(k,S.querySelector("head > title"))),Dn(k,g,u),k[En]=i,le(k),g=k;break e;case"link":var I=Jx("link","href",S).get(g+(u.href||""));if(I){for(var j=0;j<I.length;j++)if(k=I[j],k.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&k.getAttribute("rel")===(u.rel==null?null:u.rel)&&k.getAttribute("title")===(u.title==null?null:u.title)&&k.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){I.splice(j,1);break t}}k=S.createElement(g),Dn(k,g,u),S.head.appendChild(k);break;case"meta":if(I=Jx("meta","content",S).get(g+(u.content||""))){for(j=0;j<I.length;j++)if(k=I[j],k.getAttribute("content")===(u.content==null?null:""+u.content)&&k.getAttribute("name")===(u.name==null?null:u.name)&&k.getAttribute("property")===(u.property==null?null:u.property)&&k.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&k.getAttribute("charset")===(u.charSet==null?null:u.charSet)){I.splice(j,1);break t}}k=S.createElement(g),Dn(k,g,u),S.head.appendChild(k);break;default:throw Error(a(468,g))}k[En]=i,le(k),g=k}i.stateNode=g}else ek(S,i.type,i.stateNode);else i.stateNode=Xx(S,g,i.memoizedProps);else k!==g?(k===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):k.count--,g===null?ek(S,i.type,i.stateNode):Xx(S,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Xf(i,i.memoizedProps,u.memoizedProps)}break;case 27:ra(r,i),oa(i),g&512&&(kn||u===null||ii(u,u.return)),u!==null&&g&4&&Xf(i,i.memoizedProps,u.memoizedProps);break;case 5:if(ra(r,i),oa(i),g&512&&(kn||u===null||ii(u,u.return)),i.flags&32){S=i.stateNode;try{ti(S,"")}catch(ze){Dt(i,i.return,ze)}}g&4&&i.stateNode!=null&&(S=i.memoizedProps,Xf(i,S,u!==null?u.memoizedProps:S)),g&1024&&(th=!0);break;case 6:if(ra(r,i),oa(i),g&4){if(i.stateNode===null)throw Error(a(162));g=i.memoizedProps,u=i.stateNode;try{u.nodeValue=g}catch(ze){Dt(i,i.return,ze)}}break;case 3:if(xd=null,S=Ga,Ga=bd(r.containerInfo),ra(r,i),Ga=S,oa(i),g&4&&u!==null&&u.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(ze){Dt(i,i.return,ze)}th&&(th=!1,ex(i));break;case 4:g=Ga,Ga=bd(i.stateNode.containerInfo),ra(r,i),oa(i),Ga=g;break;case 12:ra(r,i),oa(i);break;case 31:ra(r,i),oa(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,rd(i,g)));break;case 13:ra(r,i),oa(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(sd=en()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,rd(i,g)));break;case 22:S=i.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,te=Ni,fe=kn;if(Ni=te||S,kn=fe||F,ra(r,i),kn=fe,Ni=te,oa(i),g&8192)e:for(r=i.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(u===null||F||Ni||kn||mo(i)),u=null,r=i;;){if(r.tag===5||r.tag===26){if(u===null){F=u=r;try{if(k=F.stateNode,S)I=k.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{j=F.stateNode;var xe=F.memoizedProps.style,ie=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;j.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ze){Dt(F,F.return,ze)}}}else if(r.tag===6){if(u===null){F=r;try{F.stateNode.nodeValue=S?"":F.memoizedProps}catch(ze){Dt(F,F.return,ze)}}}else if(r.tag===18){if(u===null){F=r;try{var ce=F.stateNode;S?Hx(ce,!0):Hx(F.stateNode,!1)}catch(ze){Dt(F,F.return,ze)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}g&4&&(g=i.updateQueue,g!==null&&(u=g.retryQueue,u!==null&&(g.retryQueue=null,rd(i,u))));break;case 19:ra(r,i),oa(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,rd(i,g)));break;case 30:break;case 21:break;default:ra(r,i),oa(i)}}function oa(i){var r=i.flags;if(r&2){try{for(var u,g=i.return;g!==null;){if(Q1(g)){u=g;break}g=g.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var S=u.stateNode,k=Jf(i);id(i,k,S);break;case 5:var I=u.stateNode;u.flags&32&&(ti(I,""),u.flags&=-33);var j=Jf(i);id(i,j,I);break;case 3:case 4:var F=u.stateNode.containerInfo,te=Jf(i);eh(i,te,F);break;default:throw Error(a(161))}}catch(fe){Dt(i,i.return,fe)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function ex(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;ex(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Pi(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Z1(i,r.alternate,r),r=r.sibling}function mo(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:hr(4,r,r.return),mo(r);break;case 1:ii(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&H1(r,r.return,u),mo(r);break;case 27:Yl(r.stateNode);case 26:case 5:ii(r,r.return),mo(r);break;case 22:r.memoizedState===null&&mo(r);break;case 30:mo(r);break;default:mo(r)}i=i.sibling}}function ji(i,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,S=i,k=r,I=k.flags;switch(k.tag){case 0:case 11:case 15:ji(S,k,u),Ul(4,k);break;case 1:if(ji(S,k,u),g=k,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(te){Dt(g,g.return,te)}if(g=k,S=g.updateQueue,S!==null){var j=g.stateNode;try{var F=S.shared.hiddenCallbacks;if(F!==null)for(S.shared.hiddenCallbacks=null,S=0;S<F.length;S++)_S(F[S],j)}catch(te){Dt(g,g.return,te)}}u&&I&64&&F1(k),Fl(k,k.return);break;case 27:V1(k);case 26:case 5:ji(S,k,u),u&&g===null&&I&4&&$1(k),Fl(k,k.return);break;case 12:ji(S,k,u);break;case 31:ji(S,k,u),u&&I&4&&Y1(S,k);break;case 13:ji(S,k,u),u&&I&4&&X1(S,k);break;case 22:k.memoizedState===null&&ji(S,k,u),Fl(k,k.return);break;case 30:break;default:ji(S,k,u)}r=r.sibling}}function nh(i,r){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Rl(u))}function ah(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Rl(i))}function Za(i,r,u,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)tx(i,r,u,g),r=r.sibling}function tx(i,r,u,g){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Za(i,r,u,g),S&2048&&Ul(9,r);break;case 1:Za(i,r,u,g);break;case 3:Za(i,r,u,g),S&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Rl(i)));break;case 12:if(S&2048){Za(i,r,u,g),i=r.stateNode;try{var k=r.memoizedProps,I=k.id,j=k.onPostCommit;typeof j=="function"&&j(I,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(F){Dt(r,r.return,F)}}else Za(i,r,u,g);break;case 31:Za(i,r,u,g);break;case 13:Za(i,r,u,g);break;case 23:break;case 22:k=r.stateNode,I=r.alternate,r.memoizedState!==null?k._visibility&2?Za(i,r,u,g):Hl(i,r):k._visibility&2?Za(i,r,u,g):(k._visibility|=2,ps(i,r,u,g,(r.subtreeFlags&10256)!==0||!1)),S&2048&&nh(I,r);break;case 24:Za(i,r,u,g),S&2048&&ah(r.alternate,r);break;default:Za(i,r,u,g)}}function ps(i,r,u,g,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var k=i,I=r,j=u,F=g,te=I.flags;switch(I.tag){case 0:case 11:case 15:ps(k,I,j,F,S),Ul(8,I);break;case 23:break;case 22:var fe=I.stateNode;I.memoizedState!==null?fe._visibility&2?ps(k,I,j,F,S):Hl(k,I):(fe._visibility|=2,ps(k,I,j,F,S)),S&&te&2048&&nh(I.alternate,I);break;case 24:ps(k,I,j,F,S),S&&te&2048&&ah(I.alternate,I);break;default:ps(k,I,j,F,S)}r=r.sibling}}function Hl(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=i,g=r,S=g.flags;switch(g.tag){case 22:Hl(u,g),S&2048&&nh(g.alternate,g);break;case 24:Hl(u,g),S&2048&&ah(g.alternate,g);break;default:Hl(u,g)}r=r.sibling}}var $l=8192;function ms(i,r,u){if(i.subtreeFlags&$l)for(i=i.child;i!==null;)nx(i,r,u),i=i.sibling}function nx(i,r,u){switch(i.tag){case 26:ms(i,r,u),i.flags&$l&&i.memoizedState!==null&&UP(u,Ga,i.memoizedState,i.memoizedProps);break;case 5:ms(i,r,u);break;case 3:case 4:var g=Ga;Ga=bd(i.stateNode.containerInfo),ms(i,r,u),Ga=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=$l,$l=16777216,ms(i,r,u),$l=g):ms(i,r,u));break;default:ms(i,r,u)}}function ax(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Ql(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];_n=g,rx(g,i)}ax(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ix(i),i=i.sibling}function ix(i){switch(i.tag){case 0:case 11:case 15:Ql(i),i.flags&2048&&hr(9,i,i.return);break;case 3:Ql(i);break;case 12:Ql(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,od(i)):Ql(i);break;default:Ql(i)}}function od(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];_n=g,rx(g,i)}ax(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:hr(8,r,r.return),od(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,od(r));break;default:od(r)}i=i.sibling}}function rx(i,r){for(;_n!==null;){var u=_n;switch(u.tag){case 0:case 11:case 15:hr(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var g=u.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Rl(u.memoizedState.cache)}if(g=u.child,g!==null)g.return=u,_n=g;else e:for(u=i;_n!==null;){g=_n;var S=g.sibling,k=g.return;if(W1(g),g===u){_n=null;break e}if(S!==null){S.return=k,_n=S;break e}_n=k}}}var nP={getCacheForType:function(i){var r=Pn(bn),u=r.data.get(i);return u===void 0&&(u=i(),r.data.set(i,u)),u},cacheSignal:function(){return Pn(bn).controller.signal}},aP=typeof WeakMap=="function"?WeakMap:Map,_t=0,Vt=null,ft=null,yt=0,jt=0,xa=null,gr=!1,fs=!1,ih=!1,Di=0,un=0,vr=0,fo=0,rh=0,ka=0,hs=0,Vl=null,sa=null,oh=!1,sd=0,ox=0,ld=1/0,cd=null,yr=null,Rn=0,br=null,gs=null,zi=0,sh=0,lh=null,sx=null,Gl=0,ch=null;function wa(){return(_t&2)!==0&&yt!==0?yt&-yt:$.T!==null?hh():fl()}function lx(){if(ka===0)if((yt&536870912)===0||xt){var i=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),ka=i}else ka=536870912;return i=ba.current,i!==null&&(i.flags|=32),ka}function la(i,r,u){(i===Vt&&(jt===2||jt===9)||i.cancelPendingCommit!==null)&&(vs(i,0),Sr(i,yt,ka,!1)),er(i,u),((_t&2)===0||i!==Vt)&&(i===Vt&&((_t&2)===0&&(fo|=u),un===4&&Sr(i,yt,ka,!1)),ri(i))}function cx(i,r,u){if((_t&6)!==0)throw Error(a(327));var g=!u&&(r&127)===0&&(r&i.expiredLanes)===0||Bn(i,r),S=g?oP(i,r):dh(i,r,!0),k=g;do{if(S===0){fs&&!g&&Sr(i,r,0,!1);break}else{if(u=i.current.alternate,k&&!iP(u)){S=dh(i,r,!1),k=!1;continue}if(S===2){if(k=r,i.errorRecoveryDisabledLanes&k)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){r=I;e:{var j=i;S=Vl;var F=j.current.memoizedState.isDehydrated;if(F&&(vs(j,I).flags|=256),I=dh(j,I,!1),I!==2){if(ih&&!F){j.errorRecoveryDisabledLanes|=k,fo|=k,S=4;break e}k=sa,sa=S,k!==null&&(sa===null?sa=k:sa.push.apply(sa,k))}S=I}if(k=!1,S!==2)continue}}if(S===1){vs(i,0),Sr(i,r,0,!0);break}e:{switch(g=i,k=S,k){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:Sr(g,r,ka,!gr);break e;case 2:sa=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(S=sd+300-en(),10<S)){if(Sr(g,r,ka,!gr),qt(g,0,!0)!==0)break e;zi=r,g.timeoutHandle=Bx(ux.bind(null,g,u,sa,cd,oh,r,ka,fo,hs,gr,k,"Throttled",-0,0),S);break e}ux(g,u,sa,cd,oh,r,ka,fo,hs,gr,k,null,-0,0)}}break}while(!0);ri(i)}function ux(i,r,u,g,S,k,I,j,F,te,fe,xe,ie,ce){if(i.timeoutHandle=-1,xe=r.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ki},nx(r,k,xe);var ze=(k&62914560)===k?sd-en():(k&4194048)===k?ox-en():0;if(ze=FP(xe,ze),ze!==null){zi=k,i.cancelPendingCommit=ze(yx.bind(null,i,r,k,u,g,S,I,j,F,fe,xe,null,ie,ce)),Sr(i,k,I,!te);return}}yx(i,r,k,u,g,S,I,j,F)}function iP(i){for(var r=i;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var g=0;g<u.length;g++){var S=u[g],k=S.getSnapshot;S=S.value;try{if(!va(k(),S))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Sr(i,r,u,g){r&=~rh,r&=~fo,i.suspendedLanes|=r,i.pingedLanes&=~r,g&&(i.warmLanes|=r),g=i.expirationTimes;for(var S=r;0<S;){var k=31-Nn(S),I=1<<k;g[k]=-1,S&=~I}u!==0&&Ho(i,u,r)}function ud(){return(_t&6)===0?(Zl(0),!1):!0}function uh(){if(ft!==null){if(jt===0)var i=ft.return;else i=ft,Ai=io=null,Af(i),ss=null,Tl=0,i=ft;for(;i!==null;)U1(i.alternate,i),i=i.return;ft=null}}function vs(i,r){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,MP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),zi=0,uh(),Vt=i,ft=u=Mi(i.current,null),yt=r,jt=0,xa=null,gr=!1,fs=Bn(i,r),ih=!1,hs=ka=rh=fo=vr=un=0,sa=Vl=null,oh=!1,(r&8)!==0&&(r|=r&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=r;0<g;){var S=31-Nn(g),k=1<<S;r|=i[S],g&=~k}return Di=r,_u(),u}function dx(i,r){rt=null,$.H=Ll,r===os||r===qu?(r=ES(),jt=3):r===ff?(r=ES(),jt=4):jt=r===Ff?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,xa=r,ft===null&&(un=1,Ju(i,Oa(r,i.current)))}function px(){var i=ba.current;return i===null?!0:(yt&4194048)===yt?za===null:(yt&62914560)===yt||(yt&536870912)!==0?i===za:!1}function mx(){var i=$.H;return $.H=Ll,i===null?Ll:i}function fx(){var i=$.A;return $.A=nP,i}function dd(){un=4,gr||(yt&4194048)!==yt&&ba.current!==null||(fs=!0),(vr&134217727)===0&&(fo&134217727)===0||Vt===null||Sr(Vt,yt,ka,!1)}function dh(i,r,u){var g=_t;_t|=2;var S=mx(),k=fx();(Vt!==i||yt!==r)&&(cd=null,vs(i,r)),r=!1;var I=un;e:do try{if(jt!==0&&ft!==null){var j=ft,F=xa;switch(jt){case 8:uh(),I=6;break e;case 3:case 2:case 9:case 6:ba.current===null&&(r=!0);var te=jt;if(jt=0,xa=null,ys(i,j,F,te),u&&fs){I=0;break e}break;default:te=jt,jt=0,xa=null,ys(i,j,F,te)}}rP(),I=un;break}catch(fe){dx(i,fe)}while(!0);return r&&i.shellSuspendCounter++,Ai=io=null,_t=g,$.H=S,$.A=k,ft===null&&(Vt=null,yt=0,_u()),I}function rP(){for(;ft!==null;)hx(ft)}function oP(i,r){var u=_t;_t|=2;var g=mx(),S=fx();Vt!==i||yt!==r?(cd=null,ld=en()+500,vs(i,r)):fs=Bn(i,r);e:do try{if(jt!==0&&ft!==null){r=ft;var k=xa;t:switch(jt){case 1:jt=0,xa=null,ys(i,r,k,1);break;case 2:case 9:if(CS(k)){jt=0,xa=null,gx(r);break}r=function(){jt!==2&&jt!==9||Vt!==i||(jt=7),ri(i)},k.then(r,r);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:CS(k)?(jt=0,xa=null,gx(r)):(jt=0,xa=null,ys(i,r,k,7));break;case 5:var I=null;switch(ft.tag){case 26:I=ft.memoizedState;case 5:case 27:var j=ft;if(I?tk(I):j.stateNode.complete){jt=0,xa=null;var F=j.sibling;if(F!==null)ft=F;else{var te=j.return;te!==null?(ft=te,pd(te)):ft=null}break t}}jt=0,xa=null,ys(i,r,k,5);break;case 6:jt=0,xa=null,ys(i,r,k,6);break;case 8:uh(),un=6;break e;default:throw Error(a(462))}}sP();break}catch(fe){dx(i,fe)}while(!0);return Ai=io=null,$.H=g,$.A=S,_t=u,ft!==null?0:(Vt=null,yt=0,_u(),un)}function sP(){for(;ft!==null&&!Jt();)hx(ft)}function hx(i){var r=q1(i.alternate,i,Di);i.memoizedProps=i.pendingProps,r===null?pd(i):ft=r}function gx(i){var r=i,u=r.alternate;switch(r.tag){case 15:case 0:r=O1(u,r,r.pendingProps,r.type,void 0,yt);break;case 11:r=O1(u,r,r.pendingProps,r.type.render,r.ref,yt);break;case 5:Af(r);default:U1(u,r),r=ft=fS(r,Di),r=q1(u,r,Di)}i.memoizedProps=i.pendingProps,r===null?pd(i):ft=r}function ys(i,r,u,g){Ai=io=null,Af(r),ss=null,Tl=0;var S=r.return;try{if(W5(i,S,r,u,yt)){un=1,Ju(i,Oa(u,i.current)),ft=null;return}}catch(k){if(S!==null)throw ft=S,k;un=1,Ju(i,Oa(u,i.current)),ft=null;return}r.flags&32768?(xt||g===1?i=!0:fs||(yt&536870912)!==0?i=!1:(gr=i=!0,(g===2||g===9||g===3||g===6)&&(g=ba.current,g!==null&&g.tag===13&&(g.flags|=16384))),vx(r,i)):pd(r)}function pd(i){var r=i;do{if((r.flags&32768)!==0){vx(r,gr);return}i=r.return;var u=X5(r.alternate,r,Di);if(u!==null){ft=u;return}if(r=r.sibling,r!==null){ft=r;return}ft=r=i}while(r!==null);un===0&&(un=5)}function vx(i,r){do{var u=J5(i.alternate,i);if(u!==null){u.flags&=32767,ft=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(i=i.sibling,i!==null)){ft=i;return}ft=i=u}while(i!==null);un=6,ft=null}function yx(i,r,u,g,S,k,I,j,F){i.cancelPendingCommit=null;do md();while(Rn!==0);if((_t&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(k=r.lanes|r.childLanes,k|=Xm,Su(i,u,k,I,j,F),i===Vt&&(ft=Vt=null,yt=0),gs=r,br=i,zi=u,sh=k,lh=S,sx=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,dP(Jn,function(){return wx(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=$.T,$.T=null,S=ue.p,ue.p=2,I=_t,_t|=4;try{eP(i,r,u)}finally{_t=I,ue.p=S,$.T=g}}Rn=1,bx(),Sx(),xx()}}function bx(){if(Rn===1){Rn=0;var i=br,r=gs,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=$.T,$.T=null;var g=ue.p;ue.p=2;var S=_t;_t|=4;try{J1(r,i);var k=wh,I=rS(i.containerInfo),j=k.focusedElem,F=k.selectionRange;if(I!==j&&j&&j.ownerDocument&&iS(j.ownerDocument.documentElement,j)){if(F!==null&&Gm(j)){var te=F.start,fe=F.end;if(fe===void 0&&(fe=te),"selectionStart"in j)j.selectionStart=te,j.selectionEnd=Math.min(fe,j.value.length);else{var xe=j.ownerDocument||document,ie=xe&&xe.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),ze=j.textContent.length,Ge=Math.min(F.start,ze),Ht=F.end===void 0?Ge:Math.min(F.end,ze);!ce.extend&&Ge>Ht&&(I=Ht,Ht=Ge,Ge=I);var K=aS(j,Ge),Z=aS(j,Ht);if(K&&Z&&(ce.rangeCount!==1||ce.anchorNode!==K.node||ce.anchorOffset!==K.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var ee=xe.createRange();ee.setStart(K.node,K.offset),ce.removeAllRanges(),Ge>Ht?(ce.addRange(ee),ce.extend(Z.node,Z.offset)):(ee.setEnd(Z.node,Z.offset),ce.addRange(ee))}}}}for(xe=[],ce=j;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<xe.length;j++){var ye=xe[j];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Cd=!!kh,wh=kh=null}finally{_t=S,ue.p=g,$.T=u}}i.current=r,Rn=2}}function Sx(){if(Rn===2){Rn=0;var i=br,r=gs,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=$.T,$.T=null;var g=ue.p;ue.p=2;var S=_t;_t|=4;try{Z1(i,r.alternate,r)}finally{_t=S,ue.p=g,$.T=u}}Rn=3}}function xx(){if(Rn===4||Rn===3){Rn=0,Ln();var i=br,r=gs,u=zi,g=sx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Rn=5:(Rn=0,gs=br=null,kx(i,i.pendingLanes));var S=i.pendingLanes;if(S===0&&(yr=null),Qo(u),r=r.stateNode,An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(vi,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=$.T,S=ue.p,ue.p=2,$.T=null;try{for(var k=i.onRecoverableError,I=0;I<g.length;I++){var j=g[I];k(j.value,{componentStack:j.stack})}}finally{$.T=r,ue.p=S}}(zi&3)!==0&&md(),ri(i),S=i.pendingLanes,(u&261930)!==0&&(S&42)!==0?i===ch?Gl++:(Gl=0,ch=i):Gl=0,Zl(0)}}function kx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Rl(r)))}function md(){return bx(),Sx(),xx(),wx()}function wx(){if(Rn!==5)return!1;var i=br,r=sh;sh=0;var u=Qo(zi),g=$.T,S=ue.p;try{ue.p=32>u?32:u,$.T=null,u=lh,lh=null;var k=br,I=zi;if(Rn=0,gs=br=null,zi=0,(_t&6)!==0)throw Error(a(331));var j=_t;if(_t|=4,ix(k.current),tx(k,k.current,I,u),_t=j,Zl(0,!1),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(vi,k)}catch{}return!0}finally{ue.p=S,$.T=g,kx(i,r)}}function Mx(i,r,u){r=Oa(u,r),r=Uf(i.stateNode,r,2),i=pr(i,r,2),i!==null&&(er(i,2),ri(i))}function Dt(i,r,u){if(i.tag===3)Mx(i,i,u);else for(;r!==null;){if(r.tag===3){Mx(r,i,u);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(yr===null||!yr.has(g))){i=Oa(u,i),u=C1(2),g=pr(r,u,2),g!==null&&(A1(u,g,r,i),er(g,2),ri(g));break}}r=r.return}}function ph(i,r,u){var g=i.pingCache;if(g===null){g=i.pingCache=new aP;var S=new Set;g.set(r,S)}else S=g.get(r),S===void 0&&(S=new Set,g.set(r,S));S.has(u)||(ih=!0,S.add(u),i=lP.bind(null,i,r,u),r.then(i,i))}function lP(i,r,u){var g=i.pingCache;g!==null&&g.delete(r),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Vt===i&&(yt&u)===u&&(un===4||un===3&&(yt&62914560)===yt&&300>en()-sd?(_t&2)===0&&vs(i,0):rh|=u,hs===yt&&(hs=0)),ri(i)}function Cx(i,r){r===0&&(r=Fo()),i=to(i,r),i!==null&&(er(i,r),ri(i))}function cP(i){var r=i.memoizedState,u=0;r!==null&&(u=r.retryLane),Cx(i,u)}function uP(i,r){var u=0;switch(i.tag){case 31:case 13:var g=i.stateNode,S=i.memoizedState;S!==null&&(u=S.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(r),Cx(i,u)}function dP(i,r){return ot(i,r)}var fd=null,bs=null,mh=!1,hd=!1,fh=!1,xr=0;function ri(i){i!==bs&&i.next===null&&(bs===null?fd=bs=i:bs=bs.next=i),hd=!0,mh||(mh=!0,mP())}function Zl(i,r){if(!fh&&hd){fh=!0;do for(var u=!1,g=fd;g!==null;){if(i!==0){var S=g.pendingLanes;if(S===0)var k=0;else{var I=g.suspendedLanes,j=g.pingedLanes;k=(1<<31-Nn(42|i)+1)-1,k&=S&~(I&~j),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(u=!0,Ix(g,k))}else k=yt,k=qt(g,g===Vt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||Bn(g,k)||(u=!0,Ix(g,k));g=g.next}while(u);fh=!1}}function pP(){Ax()}function Ax(){hd=mh=!1;var i=0;xr!==0&&wP()&&(i=xr);for(var r=en(),u=null,g=fd;g!==null;){var S=g.next,k=Ex(g,r);k===0?(g.next=null,u===null?fd=S:u.next=S,S===null&&(bs=u)):(u=g,(i!==0||(k&3)!==0)&&(hd=!0)),g=S}Rn!==0&&Rn!==5||Zl(i),xr!==0&&(xr=0)}function Ex(i,r){for(var u=i.suspendedLanes,g=i.pingedLanes,S=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var I=31-Nn(k),j=1<<I,F=S[I];F===-1?((j&u)===0||(j&g)!==0)&&(S[I]=Zr(j,r)):F<=r&&(i.expiredLanes|=j),k&=~j}if(r=Vt,u=yt,u=qt(i,i===r?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,u===0||i===r&&(jt===2||jt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&mn(g),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Bn(i,u)){if(r=u&-u,r===i.callbackPriority)return r;switch(g!==null&&mn(g),Qo(u)){case 2:case 8:u=Ia;break;case 32:u=Jn;break;case 268435456:u=Tn;break;default:u=Jn}return g=Rx.bind(null,i),u=ot(u,g),i.callbackPriority=r,i.callbackNode=u,r}return g!==null&&g!==null&&mn(g),i.callbackPriority=2,i.callbackNode=null,2}function Rx(i,r){if(Rn!==0&&Rn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(md()&&i.callbackNode!==u)return null;var g=yt;return g=qt(i,i===Vt?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(cx(i,g,r),Ex(i,en()),i.callbackNode!=null&&i.callbackNode===u?Rx.bind(null,i):null)}function Ix(i,r){if(md())return null;cx(i,r,!0)}function mP(){CP(function(){(_t&6)!==0?ot(fa,pP):Ax()})}function hh(){if(xr===0){var i=is;i===0&&(i=Qt,Qt<<=1,(Qt&261888)===0&&(Qt=256)),xr=i}return xr}function Tx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:wu(""+i)}function _x(i,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,i.id&&u.setAttribute("form",i.id),r.parentNode.insertBefore(u,r),i=new FormData(i),u.parentNode.removeChild(u),i}function fP(i,r,u,g,S){if(r==="submit"&&u&&u.stateNode===S){var k=Tx((S[Un]||null).action),I=g.submitter;I&&(r=(r=I[Un]||null)?Tx(r.formAction):I.getAttribute("formAction"),r!==null&&(k=r,I=null));var j=new Eu("action","action",null,g,S);i.push({event:j,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(xr!==0){var F=I?_x(S,I):new FormData(S);jf(u,{pending:!0,data:F,method:S.method,action:k},null,F)}}else typeof k=="function"&&(j.preventDefault(),F=I?_x(S,I):new FormData(S),jf(u,{pending:!0,data:F,method:S.method,action:k},k,F))},currentTarget:S}]})}}for(var gh=0;gh<Ym.length;gh++){var vh=Ym[gh],hP=vh.toLowerCase(),gP=vh[0].toUpperCase()+vh.slice(1);Va(hP,"on"+gP)}Va(lS,"onAnimationEnd"),Va(cS,"onAnimationIteration"),Va(uS,"onAnimationStart"),Va("dblclick","onDoubleClick"),Va("focusin","onFocus"),Va("focusout","onBlur"),Va(N5,"onTransitionRun"),Va(O5,"onTransitionStart"),Va(P5,"onTransitionCancel"),Va(dS,"onTransitionEnd"),Ke("onMouseEnter",["mouseout","mouseover"]),Ke("onMouseLeave",["mouseout","mouseover"]),Ke("onPointerEnter",["pointerout","pointerover"]),Ke("onPointerLeave",["pointerout","pointerover"]),Ct("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ct("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ct("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ct("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ct("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ct("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function Nx(i,r){r=(r&4)!==0;for(var u=0;u<i.length;u++){var g=i[u],S=g.event;g=g.listeners;e:{var k=void 0;if(r)for(var I=g.length-1;0<=I;I--){var j=g[I],F=j.instance,te=j.currentTarget;if(j=j.listener,F!==k&&S.isPropagationStopped())break e;k=j,S.currentTarget=te;try{k(S)}catch(fe){Tu(fe)}S.currentTarget=null,k=F}else for(I=0;I<g.length;I++){if(j=g[I],F=j.instance,te=j.currentTarget,j=j.listener,F!==k&&S.isPropagationStopped())break e;k=j,S.currentTarget=te;try{k(S)}catch(fe){Tu(fe)}S.currentTarget=null,k=F}}}}function ht(i,r){var u=r[gl];u===void 0&&(u=r[gl]=new Set);var g=i+"__bubble";u.has(g)||(Ox(r,i,2,!1),u.add(g))}function yh(i,r,u){var g=0;r&&(g|=4),Ox(u,i,g,r)}var gd="_reactListening"+Math.random().toString(36).slice(2);function bh(i){if(!i[gd]){i[gd]=!0,Le.forEach(function(u){u!=="selectionchange"&&(vP.has(u)||yh(u,!1,i),yh(u,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[gd]||(r[gd]=!0,yh("selectionchange",!1,r))}}function Ox(i,r,u,g){switch(lk(r)){case 2:var S=QP;break;case 8:S=VP;break;default:S=Ph}u=S.bind(null,r,u,i),S=void 0,!Lm||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),g?S!==void 0?i.addEventListener(r,u,{capture:!0,passive:S}):i.addEventListener(r,u,!0):S!==void 0?i.addEventListener(r,u,{passive:S}):i.addEventListener(r,u,!1)}function Sh(i,r,u,g,S){var k=g;if((r&1)===0&&(r&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var j=g.stateNode.containerInfo;if(j===S)break;if(I===4)for(I=g.return;I!==null;){var F=I.tag;if((F===3||F===4)&&I.stateNode.containerInfo===S)return;I=I.return}for(;j!==null;){if(I=Si(j),I===null)return;if(F=I.tag,F===5||F===6||F===26||F===27){g=k=I;continue e}j=j.parentNode}}g=g.return}L0(function(){var te=k,fe=Dm(u),xe=[];e:{var ie=pS.get(i);if(ie!==void 0){var ce=Eu,ze=i;switch(i){case"keypress":if(Cu(u)===0)break e;case"keydown":case"keyup":ce=u5;break;case"focusin":ze="focus",ce=Fm;break;case"focusout":ze="blur",ce=Fm;break;case"beforeblur":case"afterblur":ce=Fm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=U0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=XO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=m5;break;case lS:case cS:case uS:ce=t5;break;case dS:ce=h5;break;case"scroll":case"scrollend":ce=KO;break;case"wheel":ce=v5;break;case"copy":case"cut":case"paste":ce=a5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=H0;break;case"toggle":case"beforetoggle":ce=b5}var Ge=(r&4)!==0,Ht=!Ge&&(i==="scroll"||i==="scrollend"),K=Ge?ie!==null?ie+"Capture":null:ie;Ge=[];for(var Z=te,ee;Z!==null;){var ye=Z;if(ee=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ee===null||K===null||(ye=vl(Z,K),ye!=null&&Ge.push(Kl(Z,ye,ee))),Ht)break;Z=Z.return}0<Ge.length&&(ie=new ce(ie,ze,null,u,fe),xe.push({event:ie,listeners:Ge}))}}if((r&7)===0){e:{if(ie=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",ie&&u!==jm&&(ze=u.relatedTarget||u.fromElement)&&(Si(ze)||ze[tr]))break e;if((ce||ie)&&(ie=fe.window===fe?fe:(ie=fe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(ze=u.relatedTarget||u.toElement,ce=te,ze=ze?Si(ze):null,ze!==null&&(Ht=p(ze),Ge=ze.tag,ze!==Ht||Ge!==5&&Ge!==27&&Ge!==6)&&(ze=null)):(ce=null,ze=te),ce!==ze)){if(Ge=U0,ye="onMouseLeave",K="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(Ge=H0,ye="onPointerLeave",K="onPointerEnter",Z="pointer"),Ht=ce==null?ie:ga(ce),ee=ze==null?ie:ga(ze),ie=new Ge(ye,Z+"leave",ce,u,fe),ie.target=Ht,ie.relatedTarget=ee,ye=null,Si(fe)===te&&(Ge=new Ge(K,Z+"enter",ze,u,fe),Ge.target=ee,Ge.relatedTarget=Ht,ye=Ge),Ht=ye,ce&&ze)t:{for(Ge=yP,K=ce,Z=ze,ee=0,ye=K;ye;ye=Ge(ye))ee++;ye=0;for(var He=Z;He;He=Ge(He))ye++;for(;0<ee-ye;)K=Ge(K),ee--;for(;0<ye-ee;)Z=Ge(Z),ye--;for(;ee--;){if(K===Z||Z!==null&&K===Z.alternate){Ge=K;break t}K=Ge(K),Z=Ge(Z)}Ge=null}else Ge=null;ce!==null&&Px(xe,ie,ce,Ge,!1),ze!==null&&Ht!==null&&Px(xe,Ht,ze,Ge,!0)}}e:{if(ie=te?ga(te):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Et=Y0;else if(W0(ie))if(X0)Et=I5;else{Et=E5;var qe=A5}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?te&&Yr(te.elementType)&&(Et=Y0):Et=R5;if(Et&&(Et=Et(i,te))){K0(xe,Et,u,fe);break e}qe&&qe(i,ie,te),i==="focusout"&&te&&ie.type==="number"&&te.memoizedProps.value!=null&&tt(ie,"number",ie.value)}switch(qe=te?ga(te):window,i){case"focusin":(W0(qe)||qe.contentEditable==="true")&&(Ko=qe,Zm=te,Cl=null);break;case"focusout":Cl=Zm=Ko=null;break;case"mousedown":Wm=!0;break;case"contextmenu":case"mouseup":case"dragend":Wm=!1,oS(xe,u,fe);break;case"selectionchange":if(_5)break;case"keydown":case"keyup":oS(xe,u,fe)}var st;if($m)e:{switch(i){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Wo?G0(i,u)&&(bt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(bt="onCompositionStart");bt&&($0&&u.locale!=="ko"&&(Wo||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Wo&&(st=q0()):(rr=fe,qm="value"in rr?rr.value:rr.textContent,Wo=!0)),qe=vd(te,bt),0<qe.length&&(bt=new F0(bt,i,null,u,fe),xe.push({event:bt,listeners:qe}),st?bt.data=st:(st=Z0(u),st!==null&&(bt.data=st)))),(st=x5?k5(i,u):w5(i,u))&&(bt=vd(te,"onBeforeInput"),0<bt.length&&(qe=new F0("onBeforeInput","beforeinput",null,u,fe),xe.push({event:qe,listeners:bt}),qe.data=st)),fP(xe,i,te,u,fe)}Nx(xe,r)})}function Kl(i,r,u){return{instance:i,listener:r,currentTarget:u}}function vd(i,r){for(var u=r+"Capture",g=[];i!==null;){var S=i,k=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||k===null||(S=vl(i,u),S!=null&&g.unshift(Kl(i,S,k)),S=vl(i,r),S!=null&&g.push(Kl(i,S,k))),i.tag===3)return g;i=i.return}return[]}function yP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Px(i,r,u,g,S){for(var k=r._reactName,I=[];u!==null&&u!==g;){var j=u,F=j.alternate,te=j.stateNode;if(j=j.tag,F!==null&&F===g)break;j!==5&&j!==26&&j!==27||te===null||(F=te,S?(te=vl(u,k),te!=null&&I.unshift(Kl(u,te,F))):S||(te=vl(u,k),te!=null&&I.push(Kl(u,te,F)))),u=u.return}I.length!==0&&i.push({event:r,listeners:I})}var bP=/\r\n?/g,SP=/\u0000|\uFFFD/g;function jx(i){return(typeof i=="string"?i:""+i).replace(bP,`
10
- `).replace(SP,"")}function Dx(i,r){return r=jx(r),jx(i)===r}function Ft(i,r,u,g,S,k){switch(u){case"children":typeof g=="string"?r==="body"||r==="textarea"&&g===""||ti(i,g):(typeof g=="number"||typeof g=="bigint")&&r!=="body"&&ti(i,""+g);break;case"className":Ue(i,"class",g);break;case"tabIndex":Ue(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Ue(i,u,g);break;case"style":xi(i,g,k);break;case"data":if(r!=="object"){Ue(i,"data",g);break}case"src":case"href":if(g===""&&(r!=="a"||u!=="href")){i.removeAttribute(u);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=wu(""+g),i.setAttribute(u,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(u==="formAction"?(r!=="input"&&Ft(i,r,"name",S.name,S,null),Ft(i,r,"formEncType",S.formEncType,S,null),Ft(i,r,"formMethod",S.formMethod,S,null),Ft(i,r,"formTarget",S.formTarget,S,null)):(Ft(i,r,"encType",S.encType,S,null),Ft(i,r,"method",S.method,S,null),Ft(i,r,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=wu(""+g),i.setAttribute(u,g);break;case"onClick":g!=null&&(i.onclick=ki);break;case"onScroll":g!=null&&ht("scroll",i);break;case"onScrollEnd":g!=null&&ht("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}u=wu(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""+g):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":g===!0?i.setAttribute(u,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,g):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(u,g):i.removeAttribute(u);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(u):i.setAttribute(u,g);break;case"popover":ht("beforetoggle",i),ht("toggle",i),Wt(i,"popover",g);break;case"xlinkActuate":At(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":At(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":At(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":At(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":At(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":At(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":At(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":At(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":At(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Wt(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ZO.get(u)||u,Wt(i,u,g))}}function xh(i,r,u,g,S,k){switch(u){case"style":xi(i,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"children":typeof g=="string"?ti(i,g):(typeof g=="number"||typeof g=="bigint")&&ti(i,""+g);break;case"onScroll":g!=null&&ht("scroll",i);break;case"onScrollEnd":g!=null&&ht("scrollend",i);break;case"onClick":g!=null&&(i.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xe.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(S=u.endsWith("Capture"),r=u.slice(2,S?u.length-7:void 0),k=i[Un]||null,k=k!=null?k[u]:null,typeof k=="function"&&i.removeEventListener(r,k,S),typeof g=="function")){typeof k!="function"&&k!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(r,g,S);break e}u in i?i[u]=g:g===!0?i.setAttribute(u,""):Wt(i,u,g)}}}function Dn(i,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",i),ht("load",i);var g=!1,S=!1,k;for(k in u)if(u.hasOwnProperty(k)){var I=u[k];if(I!=null)switch(k){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Ft(i,r,k,I,u,null)}}S&&Ft(i,r,"srcSet",u.srcSet,u,null),g&&Ft(i,r,"src",u.src,u,null);return;case"input":ht("invalid",i);var j=k=I=S=null,F=null,te=null;for(g in u)if(u.hasOwnProperty(g)){var fe=u[g];if(fe!=null)switch(g){case"name":S=fe;break;case"type":I=fe;break;case"checked":F=fe;break;case"defaultChecked":te=fe;break;case"value":k=fe;break;case"defaultValue":j=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,r));break;default:Ft(i,r,g,fe,u,null)}}ta(i,k,j,F,te,I,S,!1);return;case"select":ht("invalid",i),g=I=k=null;for(S in u)if(u.hasOwnProperty(S)&&(j=u[S],j!=null))switch(S){case"value":k=j;break;case"defaultValue":I=j;break;case"multiple":g=j;default:Ft(i,r,S,j,u,null)}r=k,u=I,i.multiple=!!g,r!=null?pt(i,!!g,r,!1):u!=null&&pt(i,!!g,u,!0);return;case"textarea":ht("invalid",i),k=S=g=null;for(I in u)if(u.hasOwnProperty(I)&&(j=u[I],j!=null))switch(I){case"value":g=j;break;case"defaultValue":S=j;break;case"children":k=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:Ft(i,r,I,j,u,null)}Kr(i,g,S,k);return;case"option":for(F in u)u.hasOwnProperty(F)&&(g=u[F],g!=null)&&(F==="selected"?i.selected=g&&typeof g!="function"&&typeof g!="symbol":Ft(i,r,F,g,u,null));return;case"dialog":ht("beforetoggle",i),ht("toggle",i),ht("cancel",i),ht("close",i);break;case"iframe":case"object":ht("load",i);break;case"video":case"audio":for(g=0;g<Wl.length;g++)ht(Wl[g],i);break;case"image":ht("error",i),ht("load",i);break;case"details":ht("toggle",i);break;case"embed":case"source":case"link":ht("error",i),ht("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(g=u[te],g!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Ft(i,r,te,g,u,null)}return;default:if(Yr(r)){for(fe in u)u.hasOwnProperty(fe)&&(g=u[fe],g!==void 0&&xh(i,r,fe,g,u,void 0));return}}for(j in u)u.hasOwnProperty(j)&&(g=u[j],g!=null&&Ft(i,r,j,g,u,null))}function xP(i,r,u,g){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,k=null,I=null,j=null,F=null,te=null,fe=null;for(ce in u){var xe=u[ce];if(u.hasOwnProperty(ce)&&xe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":F=xe;default:g.hasOwnProperty(ce)||Ft(i,r,ce,null,g,xe)}}for(var ie in g){var ce=g[ie];if(xe=u[ie],g.hasOwnProperty(ie)&&(ce!=null||xe!=null))switch(ie){case"type":k=ce;break;case"name":S=ce;break;case"checked":te=ce;break;case"defaultChecked":fe=ce;break;case"value":I=ce;break;case"defaultValue":j=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,r));break;default:ce!==xe&&Ft(i,r,ie,ce,g,xe)}}_a(i,I,j,F,te,fe,k,S);return;case"select":ce=I=j=ie=null;for(k in u)if(F=u[k],u.hasOwnProperty(k)&&F!=null)switch(k){case"value":break;case"multiple":ce=F;default:g.hasOwnProperty(k)||Ft(i,r,k,null,g,F)}for(S in g)if(k=g[S],F=u[S],g.hasOwnProperty(S)&&(k!=null||F!=null))switch(S){case"value":ie=k;break;case"defaultValue":j=k;break;case"multiple":I=k;default:k!==F&&Ft(i,r,S,k,g,F)}r=j,u=I,g=ce,ie!=null?pt(i,!!u,ie,!1):!!g!=!!u&&(r!=null?pt(i,!!u,r,!0):pt(i,!!u,u?[]:"",!1));return;case"textarea":ce=ie=null;for(j in u)if(S=u[j],u.hasOwnProperty(j)&&S!=null&&!g.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ft(i,r,j,null,g,S)}for(I in g)if(S=g[I],k=u[I],g.hasOwnProperty(I)&&(S!=null||k!=null))switch(I){case"value":ie=S;break;case"defaultValue":ce=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==k&&Ft(i,r,I,S,g,k)}na(i,ie,ce);return;case"option":for(var ze in u)ie=u[ze],u.hasOwnProperty(ze)&&ie!=null&&!g.hasOwnProperty(ze)&&(ze==="selected"?i.selected=!1:Ft(i,r,ze,null,g,ie));for(F in g)ie=g[F],ce=u[F],g.hasOwnProperty(F)&&ie!==ce&&(ie!=null||ce!=null)&&(F==="selected"?i.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":Ft(i,r,F,ie,g,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in u)ie=u[Ge],u.hasOwnProperty(Ge)&&ie!=null&&!g.hasOwnProperty(Ge)&&Ft(i,r,Ge,null,g,ie);for(te in g)if(ie=g[te],ce=u[te],g.hasOwnProperty(te)&&ie!==ce&&(ie!=null||ce!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,r));break;default:Ft(i,r,te,ie,g,ce)}return;default:if(Yr(r)){for(var Ht in u)ie=u[Ht],u.hasOwnProperty(Ht)&&ie!==void 0&&!g.hasOwnProperty(Ht)&&xh(i,r,Ht,void 0,g,ie);for(fe in g)ie=g[fe],ce=u[fe],!g.hasOwnProperty(fe)||ie===ce||ie===void 0&&ce===void 0||xh(i,r,fe,ie,g,ce);return}}for(var K in u)ie=u[K],u.hasOwnProperty(K)&&ie!=null&&!g.hasOwnProperty(K)&&Ft(i,r,K,null,g,ie);for(xe in g)ie=g[xe],ce=u[xe],!g.hasOwnProperty(xe)||ie===ce||ie==null&&ce==null||Ft(i,r,xe,ie,g,ce)}function zx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,u=performance.getEntriesByType("resource"),g=0;g<u.length;g++){var S=u[g],k=S.transferSize,I=S.initiatorType,j=S.duration;if(k&&j&&zx(I)){for(I=0,j=S.responseEnd,g+=1;g<u.length;g++){var F=u[g],te=F.startTime;if(te>j)break;var fe=F.transferSize,xe=F.initiatorType;fe&&zx(xe)&&(F=F.responseEnd,I+=fe*(F<j?1:(j-te)/(F-te)))}if(--g,r+=8*(k+I)/(S.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var kh=null,wh=null;function yd(i){return i.nodeType===9?i:i.ownerDocument}function Lx(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qx(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Mh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Ch=null;function wP(){var i=window.event;return i&&i.type==="popstate"?i===Ch?!1:(Ch=i,!0):(Ch=null,!1)}var Bx=typeof setTimeout=="function"?setTimeout:void 0,MP=typeof clearTimeout=="function"?clearTimeout:void 0,Ux=typeof Promise=="function"?Promise:void 0,CP=typeof queueMicrotask=="function"?queueMicrotask:typeof Ux<"u"?function(i){return Ux.resolve(null).then(i).catch(AP)}:Bx;function AP(i){setTimeout(function(){throw i})}function kr(i){return i==="head"}function Fx(i,r){var u=r,g=0;do{var S=u.nextSibling;if(i.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"||u==="/&"){if(g===0){i.removeChild(S),ws(r);return}g--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")g++;else if(u==="html")Yl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Yl(u);for(var k=u.firstChild;k;){var I=k.nextSibling,j=k.nodeName;k[bi]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&k.rel.toLowerCase()==="stylesheet"||u.removeChild(k),k=I}}else u==="body"&&Yl(i.ownerDocument.body);u=S}while(u);ws(r)}function Hx(i,r){var u=i;i=0;do{var g=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=g}while(u)}function Ah(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Ah(u),Wr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function EP(i,r,u,g){for(;i.nodeType===1;){var S=u;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[bi])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(k=i.getAttribute("rel"),k==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(k!==S.rel||i.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||i.getAttribute("title")!==(S.title==null?null:S.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(S.src==null?null:S.src)||i.getAttribute("type")!==(S.type==null?null:S.type)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var k=S.name==null?null:""+S.name;if(S.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=La(i.nextSibling),i===null)break}return null}function RP(i,r,u){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=La(i.nextSibling),i===null))return null;return i}function $x(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=La(i.nextSibling),i===null))return null;return i}function Eh(i){return i.data==="$?"||i.data==="$~"}function Rh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function IP(i,r){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||u.readyState!=="loading")r();else{var g=function(){r(),u.removeEventListener("DOMContentLoaded",g)};u.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function La(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Ih=null;function Qx(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(r===0)return La(i.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}i=i.nextSibling}return null}function Vx(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return i;r--}else u!=="/$"&&u!=="/&"||r++}i=i.previousSibling}return null}function Gx(i,r,u){switch(r=yd(u),i){case"html":if(i=r.documentElement,!i)throw Error(a(452));return i;case"head":if(i=r.head,!i)throw Error(a(453));return i;case"body":if(i=r.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function Yl(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Wr(i)}var qa=new Map,Zx=new Set;function bd(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Li=ue.d;ue.d={f:TP,r:_P,D:NP,C:OP,L:PP,m:jP,X:zP,S:DP,M:LP};function TP(){var i=Li.f(),r=ud();return i||r}function _P(i){var r=nr(i);r!==null&&r.tag===5&&r.type==="form"?d1(r):Li.r(i)}var Ss=typeof document>"u"?null:document;function Wx(i,r,u){var g=Ss;if(g&&typeof r=="string"&&r){var S=fn(r);S='link[rel="'+i+'"][href="'+S+'"]',typeof u=="string"&&(S+='[crossorigin="'+u+'"]'),Zx.has(S)||(Zx.add(S),i={rel:i,crossOrigin:u,href:r},g.querySelector(S)===null&&(r=g.createElement("link"),Dn(r,"link",i),le(r),g.head.appendChild(r)))}}function NP(i){Li.D(i),Wx("dns-prefetch",i,null)}function OP(i,r){Li.C(i,r),Wx("preconnect",i,r)}function PP(i,r,u){Li.L(i,r,u);var g=Ss;if(g&&i&&r){var S='link[rel="preload"][as="'+fn(r)+'"]';r==="image"&&u&&u.imageSrcSet?(S+='[imagesrcset="'+fn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(S+='[imagesizes="'+fn(u.imageSizes)+'"]')):S+='[href="'+fn(i)+'"]';var k=S;switch(r){case"style":k=xs(i);break;case"script":k=ks(i)}qa.has(k)||(i=M({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:i,as:r},u),qa.set(k,i),g.querySelector(S)!==null||r==="style"&&g.querySelector(Xl(k))||r==="script"&&g.querySelector(Jl(k))||(r=g.createElement("link"),Dn(r,"link",i),le(r),g.head.appendChild(r)))}}function jP(i,r){Li.m(i,r);var u=Ss;if(u&&i){var g=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+fn(g)+'"][href="'+fn(i)+'"]',k=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ks(i)}if(!qa.has(k)&&(i=M({rel:"modulepreload",href:i},r),qa.set(k,i),u.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Jl(k)))return}g=u.createElement("link"),Dn(g,"link",i),le(g),u.head.appendChild(g)}}}function DP(i,r,u){Li.S(i,r,u);var g=Ss;if(g&&i){var S=ar(g).hoistableStyles,k=xs(i);r=r||"default";var I=S.get(k);if(!I){var j={loading:0,preload:null};if(I=g.querySelector(Xl(k)))j.loading=5;else{i=M({rel:"stylesheet",href:i,"data-precedence":r},u),(u=qa.get(k))&&Th(i,u);var F=I=g.createElement("link");le(F),Dn(F,"link",i),F._p=new Promise(function(te,fe){F.onload=te,F.onerror=fe}),F.addEventListener("load",function(){j.loading|=1}),F.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Sd(I,r,g)}I={type:"stylesheet",instance:I,count:1,state:j},S.set(k,I)}}}function zP(i,r){Li.X(i,r);var u=Ss;if(u&&i){var g=ar(u).hoistableScripts,S=ks(i),k=g.get(S);k||(k=u.querySelector(Jl(S)),k||(i=M({src:i,async:!0},r),(r=qa.get(S))&&_h(i,r),k=u.createElement("script"),le(k),Dn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function LP(i,r){Li.M(i,r);var u=Ss;if(u&&i){var g=ar(u).hoistableScripts,S=ks(i),k=g.get(S);k||(k=u.querySelector(Jl(S)),k||(i=M({src:i,async:!0,type:"module"},r),(r=qa.get(S))&&_h(i,r),k=u.createElement("script"),le(k),Dn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function Kx(i,r,u,g){var S=(S=he.current)?bd(S):null;if(!S)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=xs(u.href),u=ar(S).hoistableStyles,g=u.get(r),g||(g={type:"style",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=xs(u.href);var k=ar(S).hoistableStyles,I=k.get(i);if(I||(S=S.ownerDocument||S,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,I),(k=S.querySelector(Xl(i)))&&!k._p&&(I.instance=k,I.state.loading=5),qa.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},qa.set(i,u),k||qP(S,i,u,I.state))),r&&g===null)throw Error(a(528,""));return I}if(r&&g!==null)throw Error(a(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ks(u),u=ar(S).hoistableScripts,g=u.get(r),g||(g={type:"script",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function xs(i){return'href="'+fn(i)+'"'}function Xl(i){return'link[rel="stylesheet"]['+i+"]"}function Yx(i){return M({},i,{"data-precedence":i.precedence,precedence:null})}function qP(i,r,u,g){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?g.loading=1:(r=i.createElement("link"),g.preload=r,r.addEventListener("load",function(){return g.loading|=1}),r.addEventListener("error",function(){return g.loading|=2}),Dn(r,"link",u),le(r),i.head.appendChild(r))}function ks(i){return'[src="'+fn(i)+'"]'}function Jl(i){return"script[async]"+i}function Xx(i,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var g=i.querySelector('style[data-href~="'+fn(u.href)+'"]');if(g)return r.instance=g,le(g),g;var S=M({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),le(g),Dn(g,"style",S),Sd(g,u.precedence,i),r.instance=g;case"stylesheet":S=xs(u.href);var k=i.querySelector(Xl(S));if(k)return r.state.loading|=4,r.instance=k,le(k),k;g=Yx(u),(S=qa.get(S))&&Th(g,S),k=(i.ownerDocument||i).createElement("link"),le(k);var I=k;return I._p=new Promise(function(j,F){I.onload=j,I.onerror=F}),Dn(k,"link",g),r.state.loading|=4,Sd(k,u.precedence,i),r.instance=k;case"script":return k=ks(u.src),(S=i.querySelector(Jl(k)))?(r.instance=S,le(S),S):(g=u,(S=qa.get(k))&&(g=M({},u),_h(g,S)),i=i.ownerDocument||i,S=i.createElement("script"),le(S),Dn(S,"link",g),i.head.appendChild(S),r.instance=S);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(g=r.instance,r.state.loading|=4,Sd(g,u.precedence,i));return r.instance}function Sd(i,r,u){for(var g=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,k=S,I=0;I<g.length;I++){var j=g[I];if(j.dataset.precedence===r)k=j;else if(k!==S)break}k?k.parentNode.insertBefore(i,k.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(i,r.firstChild))}function Th(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function _h(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var xd=null;function Jx(i,r,u){if(xd===null){var g=new Map,S=xd=new Map;S.set(u,g)}else S=xd,g=S.get(u),g||(g=new Map,S.set(u,g));if(g.has(i))return g;for(g.set(i,null),u=u.getElementsByTagName(i),S=0;S<u.length;S++){var k=u[S];if(!(k[bi]||k[En]||i==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var I=k.getAttribute(r)||"";I=i+I;var j=g.get(I);j?j.push(k):g.set(I,[k])}}return g}function ek(i,r,u){i=i.ownerDocument||i,i.head.insertBefore(u,r==="title"?i.querySelector("head > title"):null)}function BP(i,r,u){if(u===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(i=r.disabled,typeof r.precedence=="string"&&i==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function tk(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function UP(i,r,u,g){if(u.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var S=xs(g.href),k=r.querySelector(Xl(S));if(k){r=k._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=kd.bind(i),r.then(i,i)),u.state.loading|=4,u.instance=k,le(k);return}k=r.ownerDocument||r,g=Yx(g),(S=qa.get(S))&&Th(g,S),k=k.createElement("link"),le(k);var I=k;I._p=new Promise(function(j,F){I.onload=j,I.onerror=F}),Dn(k,"link",g),u.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=kd.bind(i),r.addEventListener("load",u),r.addEventListener("error",u))}}var Nh=0;function FP(i,r){return i.stylesheets&&i.count===0&&Md(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var g=setTimeout(function(){if(i.stylesheets&&Md(i,i.stylesheets),i.unsuspend){var k=i.unsuspend;i.unsuspend=null,k()}},6e4+r);0<i.imgBytes&&Nh===0&&(Nh=62500*kP());var S=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Md(i,i.stylesheets),i.unsuspend)){var k=i.unsuspend;i.unsuspend=null,k()}},(i.imgBytes>Nh?50:800)+r);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function kd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Md(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var wd=null;function Md(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,wd=new Map,r.forEach(HP,i),wd=null,kd.call(i))}function HP(i,r){if(!(r.state.loading&4)){var u=wd.get(i);if(u)var g=u.get(null);else{u=new Map,wd.set(i,u);for(var S=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<S.length;k++){var I=S[k];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(u.set(I.dataset.precedence,I),g=I)}g&&u.set(null,g)}S=r.instance,I=S.getAttribute("data-precedence"),k=u.get(I)||g,k===g&&u.set(null,S),u.set(I,S),this.count++,g=kd.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),k?k.parentNode.insertBefore(S,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(S,i.firstChild)),r.state.loading|=4}}var ec={$$typeof:B,Provider:null,Consumer:null,_currentValue:ke,_currentValue2:ke,_threadCount:0};function $P(i,r,u,g,S,k,I,j,F){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.hiddenUpdates=Ha(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=k,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function nk(i,r,u,g,S,k,I,j,F,te,fe,xe){return i=new $P(i,r,u,I,F,te,fe,xe,j),r=1,k===!0&&(r|=24),k=ya(3,null,null,r),i.current=k,k.stateNode=i,r=df(),r.refCount++,i.pooledCache=r,r.refCount++,k.memoizedState={element:g,isDehydrated:u,cache:r},hf(k),i}function ak(i){return i?(i=Jo,i):Jo}function ik(i,r,u,g,S,k){S=ak(S),g.context===null?g.context=S:g.pendingContext=S,g=dr(r),g.payload={element:u},k=k===void 0?null:k,k!==null&&(g.callback=k),u=pr(i,g,r),u!==null&&(la(u,i,r),Nl(u,i,r))}function rk(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<r?u:r}}function Oh(i,r){rk(i,r),(i=i.alternate)&&rk(i,r)}function ok(i){if(i.tag===13||i.tag===31){var r=to(i,67108864);r!==null&&la(r,i,67108864),Oh(i,67108864)}}function sk(i){if(i.tag===13||i.tag===31){var r=wa();r=$o(r);var u=to(i,r);u!==null&&la(u,i,r),Oh(i,r)}}var Cd=!0;function QP(i,r,u,g){var S=$.T;$.T=null;var k=ue.p;try{ue.p=2,Ph(i,r,u,g)}finally{ue.p=k,$.T=S}}function VP(i,r,u,g){var S=$.T;$.T=null;var k=ue.p;try{ue.p=8,Ph(i,r,u,g)}finally{ue.p=k,$.T=S}}function Ph(i,r,u,g){if(Cd){var S=jh(g);if(S===null)Sh(i,r,g,Ad,u),ck(i,g);else if(ZP(S,i,r,u,g))g.stopPropagation();else if(ck(i,g),r&4&&-1<GP.indexOf(i)){for(;S!==null;){var k=nr(S);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var I=mt(k.pendingLanes);if(I!==0){var j=k;for(j.pendingLanes|=2,j.entangledLanes|=2;I;){var F=1<<31-Nn(I);j.entanglements[1]|=F,I&=~F}ri(k),(_t&6)===0&&(ld=en()+500,Zl(0))}}break;case 31:case 13:j=to(k,2),j!==null&&la(j,k,2),ud(),Oh(k,2)}if(k=jh(g),k===null&&Sh(i,r,g,Ad,u),k===S)break;S=k}S!==null&&g.stopPropagation()}else Sh(i,r,g,null,u)}}function jh(i){return i=Dm(i),Dh(i)}var Ad=null;function Dh(i){if(Ad=null,i=Si(i),i!==null){var r=p(i);if(r===null)i=null;else{var u=r.tag;if(u===13){if(i=f(r),i!==null)return i;i=null}else if(u===31){if(i=m(r),i!==null)return i;i=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Ad=i,null}function lk(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($n()){case fa:return 2;case Ia:return 8;case Jn:case We:return 32;case Tn:return 268435456;default:return 32}default:return 32}}var zh=!1,wr=null,Mr=null,Cr=null,tc=new Map,nc=new Map,Ar=[],GP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ck(i,r){switch(i){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Cr=null;break;case"pointerover":case"pointerout":tc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(r.pointerId)}}function ac(i,r,u,g,S,k){return i===null||i.nativeEvent!==k?(i={blockedOn:r,domEventName:u,eventSystemFlags:g,nativeEvent:k,targetContainers:[S]},r!==null&&(r=nr(r),r!==null&&ok(r)),i):(i.eventSystemFlags|=g,r=i.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),i)}function ZP(i,r,u,g,S){switch(r){case"focusin":return wr=ac(wr,i,r,u,g,S),!0;case"dragenter":return Mr=ac(Mr,i,r,u,g,S),!0;case"mouseover":return Cr=ac(Cr,i,r,u,g,S),!0;case"pointerover":var k=S.pointerId;return tc.set(k,ac(tc.get(k)||null,i,r,u,g,S)),!0;case"gotpointercapture":return k=S.pointerId,nc.set(k,ac(nc.get(k)||null,i,r,u,g,S)),!0}return!1}function uk(i){var r=Si(i.target);if(r!==null){var u=p(r);if(u!==null){if(r=u.tag,r===13){if(r=f(u),r!==null){i.blockedOn=r,hl(i.priority,function(){sk(u)});return}}else if(r===31){if(r=m(u),r!==null){i.blockedOn=r,hl(i.priority,function(){sk(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ed(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var u=jh(i.nativeEvent);if(u===null){u=i.nativeEvent;var g=new u.constructor(u.type,u);jm=g,u.target.dispatchEvent(g),jm=null}else return r=nr(u),r!==null&&ok(r),i.blockedOn=u,!1;r.shift()}return!0}function dk(i,r,u){Ed(i)&&u.delete(r)}function WP(){zh=!1,wr!==null&&Ed(wr)&&(wr=null),Mr!==null&&Ed(Mr)&&(Mr=null),Cr!==null&&Ed(Cr)&&(Cr=null),tc.forEach(dk),nc.forEach(dk)}function Rd(i,r){i.blockedOn===r&&(i.blockedOn=null,zh||(zh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WP)))}var Id=null;function pk(i){Id!==i&&(Id=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Id===i&&(Id=null);for(var r=0;r<i.length;r+=3){var u=i[r],g=i[r+1],S=i[r+2];if(typeof g!="function"){if(Dh(g||u)===null)continue;break}var k=nr(u);k!==null&&(i.splice(r,3),r-=3,jf(k,{pending:!0,data:S,method:u.method,action:g},g,S))}}))}function ws(i){function r(F){return Rd(F,i)}wr!==null&&Rd(wr,i),Mr!==null&&Rd(Mr,i),Cr!==null&&Rd(Cr,i),tc.forEach(r),nc.forEach(r);for(var u=0;u<Ar.length;u++){var g=Ar[u];g.blockedOn===i&&(g.blockedOn=null)}for(;0<Ar.length&&(u=Ar[0],u.blockedOn===null);)uk(u),u.blockedOn===null&&Ar.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(g=0;g<u.length;g+=3){var S=u[g],k=u[g+1],I=S[Un]||null;if(typeof k=="function")I||pk(u);else if(I){var j=null;if(k&&k.hasAttribute("formAction")){if(S=k,I=k[Un]||null)j=I.formAction;else if(Dh(S)!==null)continue}else j=I.action;typeof j=="function"?u[g+1]=j:(u.splice(g,3),g-=3),pk(u)}}}function mk(){function i(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(I){return S=I})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),g||setTimeout(u,20)}function u(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function Lh(i){this._internalRoot=i}Td.prototype.render=Lh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var u=r.current,g=wa();ik(u,g,i,r,null,null)},Td.prototype.unmount=Lh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;ik(i.current,2,null,i,null,null),ud(),r[tr]=null}};function Td(i){this._internalRoot=i}Td.prototype.unstable_scheduleHydration=function(i){if(i){var r=fl();i={blockedOn:null,target:i,priority:r};for(var u=0;u<Ar.length&&r!==0&&r<Ar[u].priority;u++);Ar.splice(u,0,i),u===0&&uk(i)}};var fk=t.version;if(fk!=="19.2.3")throw Error(a(527,fk,"19.2.3"));ue.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=c(r),i=i!==null?x(i):null,i=i===null?null:i.stateNode,i};var KP={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_d.isDisabled&&_d.supportsFiber)try{vi=_d.inject(KP),An=_d}catch{}}return rc.createRoot=function(i,r){if(!s(i))throw Error(a(299));var u=!1,g="",S=x1,k=k1,I=w1;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError)),r=nk(i,1,!1,null,null,u,g,null,S,k,I,mk),i[tr]=r.current,bh(i),new Lh(r)},rc.hydrateRoot=function(i,r,u){if(!s(i))throw Error(a(299));var g=!1,S="",k=x1,I=k1,j=w1,F=null;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onUncaughtError!==void 0&&(k=u.onUncaughtError),u.onCaughtError!==void 0&&(I=u.onCaughtError),u.onRecoverableError!==void 0&&(j=u.onRecoverableError),u.formState!==void 0&&(F=u.formState)),r=nk(i,1,!0,r,u??null,g,S,F,k,I,j,mk),r.context=ak(null),u=r.current,g=wa(),g=$o(g),S=dr(g),S.callback=null,pr(u,S,g),u=g,r.current.lanes=u,er(r,u),ri(r),i[tr]=r.current,bh(i),new Td(r)},rc.version="19.2.3",rc}var Mk;function sj(){if(Mk)return Bh.exports;Mk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bh.exports=oj(),Bh.exports}var lj=sj(),cj=Object.create,$A=Object.defineProperty,uj=Object.getOwnPropertyDescriptor,QA=Object.getOwnPropertyNames,dj=Object.getPrototypeOf,pj=Object.prototype.hasOwnProperty,fi=(e,t)=>function(){return t||(0,e[QA(e)[0]])((t={exports:{}}).exports,t),t.exports},mj=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=QA(t),p=0,f=s.length,m;p<f;p++)m=s[p],!pj.call(e,m)&&m!==n&&$A(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=uj(t,m))||a.enumerable});return e},yn=(e,t,n)=>(n=e!=null?cj(dj(e)):{},mj(t||!e||!e.__esModule?$A(n,"default",{value:e,enumerable:!0}):n,e)),VA=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),fj=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=VA().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),hj=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=VA().default,a=fj();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Oo=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=hj();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ja=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Oo();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function cl(e){const t={subscribe(n){let a=null,s=!1,p=!1,f=!1;function m(){if(a===null){f=!0;return}p||(p=!0,typeof a=="function"?a():a&&a.unsubscribe())}return a=e({next(h){var c;s||(c=n.next)===null||c===void 0||c.call(n,h)},error(h){var c;s||(s=!0,(c=n.error)===null||c===void 0||c.call(n,h),m())},complete(){var h;s||(s=!0,(h=n.complete)===null||h===void 0||h.call(n),m())}}),f&&m(),{unsubscribe:m}},pipe(...n){return n.reduce(gj,t)}};return t}function gj(e,t){return t(e)}function vj(e){const t=new AbortController;return new Promise((a,s)=>{let p=!1;function f(){p||(p=!0,m.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});const m=e.subscribe({next(h){p=!0,a(h),f()},error(h){s(h)},complete(){t.abort(),f()}})})}function yj(e){return t=>{let n=0,a=null;const s=[];function p(){a||(a=t.subscribe({next(m){for(const c of s){var h;(h=c.next)===null||h===void 0||h.call(c,m)}},error(m){for(const c of s){var h;(h=c.error)===null||h===void 0||h.call(c,m)}},complete(){for(const h of s){var m;(m=h.complete)===null||m===void 0||m.call(h)}}}))}function f(){if(n===0&&a){const m=a;a=null,m.unsubscribe()}}return cl(m=>(n++,s.push(m),p(),{unsubscribe(){n--,f();const h=s.findIndex(c=>c===m);h>-1&&s.splice(h,1)}}))}}function GA(e){let t=e;const n=[],a=f=>{t!==void 0&&f.next(t),n.push(f)},s=f=>{n.splice(n.indexOf(f),1)},p=cl(f=>(a(f),()=>{s(f)}));return p.next=f=>{if(t!==f){t=f;for(const m of n)m.next(f)}},p.get=()=>t,p}function bj(e){return cl(t=>{function n(s=0,p=e.op){const f=e.links[s];if(!f)throw new Error("No more links to execute - did you forget to add an ending link?");return f({op:p,next(h){return n(s+1,h)}})}return n().subscribe(t)})}function _o(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Sj(){return Object.create(null)}const xj=typeof Symbol=="function"&&!!Symbol.asyncIterator;function ZA(e){return xj&&_o(e)&&Symbol.asyncIterator in e}const Ck=e=>e();function Ak(e=0){return new Promise(t=>setTimeout(t,e))}var kj=Object.create,WA=Object.defineProperty,wj=Object.getOwnPropertyDescriptor,KA=Object.getOwnPropertyNames,Mj=Object.getPrototypeOf,Cj=Object.prototype.hasOwnProperty,eu=(e,t)=>function(){return t||(0,e[KA(e)[0]])((t={exports:{}}).exports,t),t.exports},Aj=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=KA(t),p=0,f=s.length,m;p<f;p++)m=s[p],!Cj.call(e,m)&&m!==n&&WA(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=wj(t,m))||a.enumerable});return e},um=(e,t,n)=>(n=e!=null?kj(Mj(e)):{},Aj(WA(n,"default",{value:e,enumerable:!0}),e));const YA=()=>{},Ek=e=>{Object.freeze&&Object.freeze(e)};function XA(e,t,n){var a;const s=t.join(".");return(a=n[s])!==null&&a!==void 0||(n[s]=new Proxy(YA,{get(p,f){if(!(typeof f!="string"||f==="then"))return XA(e,[...t,f],n)},apply(p,f,m){const h=t[t.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let c={args:m,path:t};return h==="call"?c={args:m.length>=2?[m[1]]:[],path:t.slice(0,-1)}:h==="apply"&&(c={args:m.length>=2?m[1]:[],path:t.slice(0,-1)}),Ek(c.args),Ek(c.path),e(c)}})),n[s]}const dm=e=>XA(e,[],Sj()),ab=e=>new Proxy(YA,{get(t,n){if(n!=="then")return e(n)}});var JA=eu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ej=eu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=JA().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Rj=eu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=JA().default,a=Ej();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),eE=eu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Rj();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),ib=eu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=eE();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});um(ib());um(eE());var Nd=um(ib());function Ij(e,t){if("error"in e){const a=t.deserialize(e.error);return{ok:!1,error:(0,Nd.default)((0,Nd.default)({},e),{},{error:a})}}return{ok:!0,result:(0,Nd.default)((0,Nd.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Qh=class extends Error{constructor(){super("Unable to transform response from server")}};function tE(e,t){let n;try{n=Ij(e,t)}catch{throw new Qh}if(!n.ok&&(!_o(n.error.error)||typeof n.error.error.code!="number"))throw new Qh;if(n.ok&&!_o(n.result))throw new Qh;return n}um(ib());var Od=yn(Oo(),1),Ms=yn(Ja(),1);function Tj(e){return e instanceof Hi}function _j(e){return _o(e)&&_o(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Nj(e,t){return typeof e=="string"?e:_o(e)&&typeof e.message=="string"?e.message:t}var Hi=class ap extends Error{constructor(t,n){var a,s;const p=n?.cause;super(t,{cause:p}),(0,Od.default)(this,"cause",void 0),(0,Od.default)(this,"shape",void 0),(0,Od.default)(this,"data",void 0),(0,Od.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=p,this.shape=n==null||(a=n.result)===null||a===void 0?void 0:a.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,ap.prototype)}static from(t,n={}){const a=t;return Tj(a)?(n.meta&&(a.meta=(0,Ms.default)((0,Ms.default)({},a.meta),n.meta)),a):_j(a)?new ap(a.error.message,(0,Ms.default)((0,Ms.default)({},n),{},{result:a,cause:n.cause})):new ap(Nj(a,"Unknown error"),(0,Ms.default)((0,Ms.default)({},n),{},{cause:a}))}};function nE(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Rk=e=>typeof e=="function";function Oj(e){if(e)return e;if(typeof window<"u"&&Rk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Rk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Ac=yn(Ja());function Pj(e){return{url:e.url.toString(),fetch:e.fetch,transformer:nE(e.transformer),methodOverride:e.methodOverride}}function jj(e){const t={};for(let n=0;n<e.length;n++){const a=e[n];t[n]=a}return t}const Dj={query:"GET",mutation:"POST",subscription:"PATCH"};function aE(e){return"input"in e?e.transformer.input.serialize(e.input):jj(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Sv=e=>{const t=e.url.split("?");let a=t[0].replace(/\/$/,"")+"/"+e.path;const s=[];if(t[1]&&s.push(t[1]),"inputs"in e&&s.push("batch=1"),e.type==="query"||e.type==="subscription"){const p=aE(e);p!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(p))}`)}return s.length&&(a+="?"+s.join("&")),a},zj=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=aE(e);return t!==void 0?JSON.stringify(t):void 0},Lj=e=>xv((0,Ac.default)((0,Ac.default)({},e),{},{contentTypeHeader:"application/json",getUrl:Sv,getBody:zj}));var qj=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Bj=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new qj};async function Uj(e){var t,n;Bj(e.signal);const a=e.getUrl(e),s=e.getBody(e),p=(t=e.methodOverride)!==null&&t!==void 0?t:Dj[e.type],f=await(async()=>{const h=await e.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),m=(0,Ac.default)((0,Ac.default)((0,Ac.default)({},e.contentTypeHeader&&p!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),f);return Oj(e.fetch)(a,{method:p,signal:e.signal,body:s,headers:m})}async function xv(e){const t={},n=await Uj(e);t.response=n;const a=await n.json();return t.responseJSON=a,{json:a,meta:t}}function Fj(e){return e instanceof Uint8Array||e instanceof Blob}function Hj(e){return e instanceof FormData}var zs=yn(Ja(),1);const $j=e=>{if("input"in e){const{input:t}=e;if(Hj(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return xv((0,zs.default)((0,zs.default)({},e),{},{contentTypeHeader:void 0,getUrl:Sv,getBody:()=>t}))}if(Fj(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return xv((0,zs.default)((0,zs.default)({},e),{},{contentTypeHeader:"application/octet-stream",getUrl:Sv,getBody:()=>t}))}}return Lj(e)};function Qj(e){const t=Pj(e);return()=>n=>{const{op:a}=n;return cl(s=>{const{path:p,input:f,type:m}=a;if(m==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=$j((0,zs.default)((0,zs.default)({},t),{},{type:m,path:p,input:f,signal:a.signal,headers(){return e.headers?typeof e.headers=="function"?e.headers({op:a}):e.headers:{}}}));let c;return h.then(x=>{c=x.meta;const M=tE(x.json,t.transformer.output);if(!M.ok){s.error(Hi.from(M.error,{meta:c}));return}s.next({context:x.meta,result:M.result}),s.complete()}).catch(x=>{s.error(Hi.from(x,{meta:c}))}),()=>{}})}}yn(Ja(),1);yn(Ja(),1);const Vj={encode:e=>JSON.stringify(e),decode:e=>{if(typeof e!="string")throw new Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");return JSON.parse(e)}},Gj={enabled:!1,closeMs:0},Zj={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},Wj=e=>e===0?0:Math.min(1e3*2**e,3e4),iE=(e,...t)=>typeof e=="function"?e(...t):e;var Kj=yn(Oo(),1),Cs=class rE extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,rE.prototype)}},Yj=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,Kj.default)(this,"timeout",void 0)}reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function oE(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}async function Xj(e){const t=await iE(e.url);if(!e.connectionParams)return t;const a=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+a}async function Jj(e,t){const n={method:"connectionParams",data:await iE(e)};return t.encode(n)}var Ik=yn(Oo(),1),e3=class{constructor(){(0,Ik.default)(this,"outgoingRequests",new Array),(0,Ik.default)(this,"pendingRequests",{})}register(e,t){const{promise:n,resolve:a}=oE();return this.outgoingRequests.push({id:String(e.id),message:e,end:n,callbacks:{next:t.next,complete:()=>{t.complete(),a()},error:s=>{t.error(s),a()}}}),()=>{this.delete(e.id),t.complete(),a()}}delete(e){e!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:t})=>t!==String(e)),delete this.pendingRequests[String(e)])}flush(){const e=this.outgoingRequests;this.outgoingRequests=[];for(const t of e)this.pendingRequests[t.id]=t;return e}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(e){return e===null?null:this.pendingRequests[String(e)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(e=>({state:"outgoing",message:e.message,end:e.end,callbacks:e.callbacks})),...this.getPendingRequests().map(e=>({state:"pending",message:e.message,end:e.end,callbacks:e.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(e=>e.message.method==="subscription")}hasOutgoingRequests(){return this.outgoingRequests.length>0}},Tr=yn(Oo(),1);function t3(e){const{promise:t,resolve:n,reject:a}=oE();return e.addEventListener("open",()=>{e.removeEventListener("error",a),n()}),e.addEventListener("error",a),t}function n3(e,{intervalMs:t,pongTimeoutMs:n}){let a,s;function p(){a=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function f(){clearTimeout(a),p()}function m(){clearTimeout(s),f()}e.addEventListener("open",p),e.addEventListener("message",({data:h})=>{clearTimeout(a),p(),h==="PONG"&&m()}),e.addEventListener("close",()=>{clearTimeout(a),clearTimeout(s)})}var sE=class kv{constructor(t){var n;if((0,Tr.default)(this,"id",++kv.connectCount),(0,Tr.default)(this,"WebSocketPonyfill",void 0),(0,Tr.default)(this,"urlOptions",void 0),(0,Tr.default)(this,"keepAliveOpts",void 0),(0,Tr.default)(this,"encoder",void 0),(0,Tr.default)(this,"wsObservable",GA(null)),(0,Tr.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++kv.connectCount;const n=Xj(t.urlOptions).then(a=>new t.WebSocketPonyfill(a));t.openPromise=n.then(async a=>{t.ws=a,a.binaryType="arraybuffer",a.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&n3(a,t.keepAliveOpts),a.addEventListener("close",()=>{t.ws===a&&(t.ws=null)}),await t3(a),t.urlOptions.connectionParams&&a.send(await Jj(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var n;(n=t.ws)===null||n===void 0||n.close()}}};(0,Tr.default)(sE,"connectCount",0);function a3(e){return e.isOpen()?{id:e.id,state:"open",ws:e.ws}:e.isClosed()?{id:e.id,state:"closed",ws:e.ws}:e.ws?{id:e.id,state:"connecting",ws:e.ws}:null}var oi=yn(Oo(),1),As=yn(Ja(),1),i3=class{constructor(e){var t,n;(0,oi.default)(this,"connectionState",void 0),(0,oi.default)(this,"allowReconnect",!1),(0,oi.default)(this,"requestManager",new e3),(0,oi.default)(this,"activeConnection",void 0),(0,oi.default)(this,"reconnectRetryDelay",void 0),(0,oi.default)(this,"inactivityTimeout",void 0),(0,oi.default)(this,"callbacks",void 0),(0,oi.default)(this,"lazyMode",void 0),(0,oi.default)(this,"encoder",void 0),(0,oi.default)(this,"reconnecting",null),this.encoder=(t=e.experimental_encoder)!==null&&t!==void 0?t:Vj,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const a=(0,As.default)((0,As.default)({},Gj),e.lazy);this.inactivityTimeout=new Yj(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},a.closeMs),this.activeConnection=new sE({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,As.default)((0,As.default)({},Zj),e.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:s=>{s&&this.setupWebSocketListeners(s)}}),this.reconnectRetryDelay=(n=e.retryDelayMs)!==null&&n!==void 0?n:Wj,this.lazyMode=a.enabled,this.connectionState=GA({type:"state",state:a.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var e=this;e.allowReconnect=!0,e.connectionState.get().state==="idle"&&e.connectionState.next({type:"state",state:"connecting",error:null});try{await e.activeConnection.open()}catch(t){return e.reconnect(new Cs({message:"Initialization error",cause:t})),e.reconnecting}}async close(){var e=this;e.allowReconnect=!1,e.inactivityTimeout.stop();const t=[];for(const n of e.requestManager.getRequests())n.message.method==="subscription"?n.callbacks.complete():n.state==="outgoing"?n.callbacks.error(Hi.from(new Cs({message:"Closed before connection was established"}))):t.push(n.end);await Promise.all(t).catch(()=>null),await e.activeConnection.close().catch(()=>null),e.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:e,type:t,path:n,input:a,signal:s},transformer:p,lastEventId:f}){return cl(m=>{const h=this.batchSend({id:e,method:t,params:{input:p.input.serialize(a),path:n,lastEventId:f}},(0,As.default)((0,As.default)({},m),{},{next(c){const x=tE(c,p.output);if(!x.ok){m.error(Hi.from(x.error));return}m.next({result:x.result})}}));return()=>{h(),t==="subscription"&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",h)}})}get connection(){return a3(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:"state",state:"connecting",error:Hi.from(e)}),this.reconnecting)return;const n=async a=>{try{await Ak(t.reconnectRetryDelay(a)),t.allowReconnect&&(await t.activeConnection.close(),await t.activeConnection.open(),t.requestManager.hasPendingRequests()&&t.send(t.requestManager.getPendingRequests().map(({message:s})=>s))),t.reconnecting=null}catch{await n(a+1)}};this.reconnecting=n(0)}setupWebSocketListeners(e){var t=this;const n=a=>{const s=this.requestManager.getPendingRequests();for(const{message:p,callbacks:f}of s)p.method!=="subscription"&&(f.error(Hi.from(a??new Cs({message:"WebSocket closed",cause:a}))),this.requestManager.delete(p.id))};e.addEventListener("open",()=>{Ck(async()=>{var a,s;t.lazyMode&&t.inactivityTimeout.start(),(a=(s=t.callbacks).onOpen)===null||a===void 0||a.call(s),t.connectionState.next({type:"state",state:"pending",error:null})}).catch(a=>{e.close(3e3),n(a)})}),e.addEventListener("message",({data:a})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(a))return;const s=this.encoder.decode(a);if("method"in s){this.handleIncomingRequest(s);return}this.handleResponseMessage(s)}),e.addEventListener("close",a=>{var s,p;n(a),(s=(p=this.callbacks).onClose)===null||s===void 0||s.call(p,a),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new Cs({message:"WebSocket closed",cause:a}))}),e.addEventListener("error",a=>{var s,p;n(a),(s=(p=this.callbacks).onError)===null||s===void 0||s.call(p,a),this.reconnect(new Cs({message:"WebSocket closed",cause:a}))})}handleResponseMessage(e){const t=this.requestManager.getPendingRequest(e.id);if(!t)return;t.callbacks.next(e);let n=!0;"result"in e&&t.message.method==="subscription"&&(e.result.type==="data"&&(t.message.params.lastEventId=e.result.id),e.result.type!=="stopped"&&(n=!1)),n&&(t.callbacks.complete(),this.requestManager.delete(e.id))}handleIncomingRequest(e){e.method==="reconnect"&&this.reconnect(new Cs({message:"Server requested reconnect"}))}send(e){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const t=e instanceof Array?e:[e];this.activeConnection.ws.send(this.encoder.encode(t.length===1?t[0]:t))}batchSend(e,t){var n=this;return this.inactivityTimeout.reset(),Ck(async()=>{n.activeConnection.isOpen()||await n.open(),await Ak(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:a})=>a))}).catch(a=>{this.requestManager.delete(e.id),t.error(Hi.from(a))}),this.requestManager.register(e,t)}};function r3(e){return new i3(e)}function o3(e){const{client:t}=e,n=nE(e.transformer);return()=>({op:a})=>cl(s=>{const p=a.type==="subscription"?t.connectionState.subscribe({next(m){s.next({result:m,context:a.context})}}):null,f=t.request({op:a,transformer:n}).subscribe(s);return()=>{f.unsubscribe(),p?.unsubscribe()}})}var Vh=yn(Oo(),1),Tk=yn(Ja(),1),pm=class{constructor(e){(0,Vh.default)(this,"links",void 0),(0,Vh.default)(this,"runtime",void 0),(0,Vh.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return bj({links:this.links,op:(0,Tk.default)((0,Tk.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(yj())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await vj(n)).result.data}catch(n){throw Hi.from(n)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(s){switch(s.result.type){case"state":{var p;(p=n.onConnectionStateChange)===null||p===void 0||p.call(n,s.result);break}case"started":{var f;(f=n.onStarted)===null||f===void 0||f.call(n,{context:s.context});break}case"stopped":{var m;(m=n.onStopped)===null||m===void 0||m.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,s.result.data);break}}},error(s){var p;(p=n.onError)===null||p===void 0||p.call(n,s)},complete(){var s;(s=n.onComplete)===null||s===void 0||s.call(n)}})}};const lE=Symbol.for("trpc_untypedClient"),s3={query:"query",mutate:"mutation",subscribe:"subscription"},l3=e=>s3[e];function cE(e){const t=dm(({path:n,args:a})=>{const s=[...n],p=l3(s.pop()),f=s.join(".");return e[p](f,...a)});return ab(n=>n===lE?e:t[n])}function wv(e){const t=new pm(e);return cE(t)}function rb(e){return e[lE]}yn(Ja(),1);yn(Ja(),1);var c3=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});yn(c3(),1);yn(Ja(),1);var u3=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var a=typeof SuppressedError=="function"?SuppressedError:function(m,h){var c=Error();return c.name="SuppressedError",c.error=m,c.suppressed=h,c},s={},p=[];function f(m,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(m)var c=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=h[Symbol.dispose||Symbol.for("Symbol.dispose")],m))var x=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");x&&(c=function(){try{x.call(h)}catch(C){return Promise.reject(C)}}),p.push({v:h,d:c,a:m})}else m&&p.push({d:h,a:m});return h}return{e:s,u:f.bind(null,!1),a:f.bind(null,!0),d:function(){var h,c=this.e,x=0;function M(){for(;h=p.pop();)try{if(!h.a&&x===1)return x=0,p.push(h),Promise.resolve().then(M);if(h.d){var E=h.d.call(h.v);if(h.a)return x|=2,Promise.resolve(E).then(M,C)}else x|=1}catch(R){return C(R)}if(x===1)return c!==s?Promise.reject(c):Promise.resolve();if(c!==s)throw c}function C(E){return c=c!==s?new a(E,c):E,M()}return M()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),uE=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(a,s){this.v=a,this.k=s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),d3=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=uE();function a(s){return new n(s,0)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),p3=fi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=uE();function a(p){return function(){return new s(p.apply(this,arguments))}}function s(p){var f,m;function h(x,M){try{var C=p[x](M),E=C.value,R=E instanceof n;Promise.resolve(R?E.v:E).then(function(_){if(R){var P=x==="return"?"return":"next";if(!E.k||_.done)return h(P,_);_=p[P](_).value}c(C.done?"return":"normal",_)},function(_){h("throw",_)})}catch(_){c("throw",_)}}function c(x,M){switch(x){case"return":f.resolve({value:M,done:!0});break;case"throw":f.reject(M);break;default:f.resolve({value:M,done:!1})}(f=f.next)?h(f.key,f.arg):m=null}this._invoke=function(x,M){return new Promise(function(C,E){var R={key:x,arg:M,resolve:C,reject:E,next:null};m?m=m.next=R:(f=m=R,h(x,M))})},typeof p.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(p){return this._invoke("next",p)},s.prototype.throw=function(p){return this._invoke("throw",p)},s.prototype.return=function(p){return this._invoke("return",p)},t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});yn(u3(),1);yn(d3(),1);yn(p3(),1);yn(Ja(),1);const m3="modulepreload",f3=function(e,t){return new URL(e,t).href},_k={},Ys=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let c=function(x){return Promise.all(x.map(M=>Promise.resolve(M).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};const f=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");s=c(n.map(x=>{if(x=f3(x,a),x in _k)return;_k[x]=!0;const M=x.endsWith(".css"),C=M?'[rel="stylesheet"]':"";if(a)for(let R=f.length-1;R>=0;R--){const _=f[R];if(_.href===x&&(!M||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${C}`))return;const E=document.createElement("link");if(E.rel=M?"stylesheet":m3,M||(E.as="script"),E.crossOrigin="",E.href=x,h&&E.setAttribute("nonce",h),document.head.appendChild(E),M)return new Promise((R,_)=>{E.addEventListener("load",R),E.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${x}`)))})}))}function p(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return s.then(f=>{for(const m of f||[])m.status==="rejected"&&p(m.reason);return t().catch(p)})};var Ze=(function(e){return e.SystemBoot="system.boot",e.SystemAddonsReady="system.addons-ready",e.SystemRestarting="system.restarting",e.SystemRestartCompleted="system.restart-completed",e.SystemTlsCertChanged="system.tls-cert-changed",e.UpdateAvailable="update.available",e.SystemReadyState="system.ready-state",e.AddonStarted="addon.started",e.AddonStopped="addon.stopped",e.AddonRestarted="addon.restarted",e.AddonUpdated="addon.updated",e.AddonInstalled="addon.installed",e.AddonUninstalled="addon.uninstalled",e.AddonCrashed="addon.crashed",e.AddonRunnerFailed="addon.runner-failed",e.AddonError="addon.error",e.AddonPageReady="addon.page-ready",e.AddonWidgetReady="addon.widget-ready",e.AddonLoadFailed="addon.load-failed",e.AddonLoadRecovered="addon.load-recovered",e.AddonRetryScheduled="addon.retry-scheduled",e.SystemLivenessFailed="system.liveness-failed",e.SystemLivenessRecovered="system.liveness-recovered",e.AddonRetryAttempting="addon.retry-attempting",e.DeviceRegistered="device.registered",e.DeviceUnregistered="device.unregistered",e.DeviceEnabled="device.enabled",e.DeviceDisabled="device.disabled",e.DeviceSettingsUpdated="device.settings-updated",e.DeviceBindingsChanged="device.bindings-changed",e.DeviceMetaChanged="device.meta-changed",e.DeviceSourceInfoChanged="device.source-info-changed",e.DeviceStreamsRegistered="device.streams-registered",e.DeviceProvisioned="device.provisioned",e.DeviceReady="device.ready",e.IntegrationEnabled="integration.enabled",e.IntegrationDisabled="integration.disabled",e.IntegrationDeleted="integration.deleted",e.BrokerStatusChanged="broker.status-changed",e.BrokerMessage="broker.message",e.ProviderStarted="provider.started",e.ProviderStopped="provider.stopped",e.ProcessCrashed="process.crashed",e.ProcessRestartScheduled="process.restart_scheduled",e.ProcessRestarted="process.restarted",e.StorageLocationsChanged="storage.locations-changed",e.RecordingStarted="recording.started",e.RecordingStopped="recording.stopped",e.RecordingError="recording.error",e.RecordingHealthDegraded="recording.health.degraded",e.RecordingStorageCritical="recording.storage.critical",e.RecordingSegmentWritten="recording.segment.written",e.RecordingPolicyFallback="recording.policy.fallback",e.RecordingRetentionCompleted="recording.retention.completed",e.RecordingExportProgress="recording.export.progress",e.RecordingExportCompleted="recording.export.completed",e.RecordingExportFailed="recording.export.failed",e.DetectionEvent="detection.event",e.SessionTrackNew="session.track.new",e.SessionTrackExpired="session.track.expired",e.BenchmarkProgress="benchmark.progress",e.PlatformProbePhase="platform-probe.phase",e.PipelineProgress="pipeline.progress",e.PipelineTrace="pipeline.trace",e.PipelineInferenceResult="pipeline.inference-result",e.PipelineCameraAssigned="pipeline.camera-assigned",e.PipelineCameraUnassigned="pipeline.camera-unassigned",e.PipelineNodeInferenceUnavailable="pipeline.node-inference-unavailable",e.PipelineDetectionBlind="pipeline.detection-blind",e.PipelineCameraUpdated="pipeline.camera-updated",e.PipelineIngestOwnerChanged="pipeline.ingest-owner-changed",e.PipelineRunnerLoadSnapshot="pipeline.runner-load-snapshot",e.PipelineCameraMetricsSnapshot="pipeline.camera-metrics-snapshot",e.StreamBrokerMetricsSnapshot="stream-broker.metrics-snapshot",e.StreamBrokerOnCamStreamDemand="stream-broker.onCamStreamDemand",e.StreamBrokerOnCamStreamIdle="stream-broker.onCamStreamIdle",e.StreamBrokerOnRequestStreamSourceRefresh="stream-broker.onRequestStreamSourceRefresh",e.StreamParamsChanged="stream-params.changed",e.DeviceStateChanged="device.state-changed",e.ZoneAnalyticsOccupancyChanged="zone-analytics.occupancy-changed",e.BatteryOnStatusChanged="battery.onStatusChanged",e.NetworkLinkOnStatusChanged="network-link.onStatusChanged",e.BatteryOnWakeStarted="battery.onWakeStarted",e.DoorbellOnPressed="doorbell.onPressed",e.EventEmitted="event-emitter.event",e.PipelineEngineMetricsSnapshot="pipeline.engine-metrics-snapshot",e.PipelineEngineProvisioning="pipeline.engine-provisioning",e.ClusterTopologySnapshot="cluster.topology-snapshot",e.MetricsNodeResourcesSnapshot="metrics.node-resources-snapshot",e.MetricsNodeProcessesSnapshot="metrics.node-processes-snapshot",e.CapabilityBindingChanged="capability.binding-changed",e.ModelDownloadProgress="model.download.progress",e.AgentRegistered="agent.registered",e.AgentUnregistered="agent.unregistered",e.AgentOnline="agent.online",e.AgentOffline="agent.offline",e.WorkerOnline="worker.online",e.WorkerOffline="worker.offline",e.AgentTaskDispatched="agent.task.dispatched",e.AgentTaskAssigned="agent.task.assigned",e.AgentTrpcConnected="agent.trpc.connected",e.AgentWsConnected="agent.ws.connected",e.AgentWsDisconnected="agent.ws.disconnected",e.AgentBackupActivated="agent.backup.activated",e.OrchestrationSettingsUpdated="orchestration.settings-updated",e.PipelineAgentHwaccelChanged="pipeline.agent-hwaccel-changed",e.MotionAnalysis="detection.motion-analysis",e.MotionZonesRaw="detection.motion-zones-raw",e.MotionOnMotionChanged="motion.on-motion-changed",e.DetectionResult="detection.result",e.DetectionRaw="detection.raw",e.DetectionCameraNative="detection.camera-native",e.PipelineAudioInferenceResult="pipeline.audio-inference-result",e.DetectionPhaseTransition="detection.phase-transition",e.ProviderMotion="provider.motion",e.ProviderDetection="provider.detection",e.EnrichmentEmbeddingStored="enrichment.embedding.stored",e.EnrichmentSceneStateChanged="enrichment.scene.state-changed",e.EnrichmentActivitySummary="enrichment.activity.summary",e.PipelineAnalyticsTrackLifecycle="pipeline-analytics.track-lifecycle",e.PipelineAnalyticsTrackStarted="pipeline-analytics.track-started",e.PipelineAnalyticsTrackEnded="pipeline-analytics.track-ended",e.PipelineAnalyticsDetectionEvent="pipeline-analytics.detection-event",e.PipelineAnalyticsFrameTracked="pipeline-analytics.frame-tracked",e.PipelineAnalyticsStationaryChanged="pipeline-analytics.stationary-changed",e.PipelineAnalyticsPackageDelivered="pipeline-analytics.package-delivered",e.PipelineAnalyticsPackagePickedUp="pipeline-analytics.package-picked-up",e.PipelineAnalyticsFaceGalleryChanged="pipeline-analytics.face-gallery-changed",e.PipelineAnalyticsPlateGalleryChanged="pipeline-analytics.plate-gallery-changed",e.CameraStreamsProfileSlotsChanged="camera-streams.onProfileSlotsChanged",e.StreamOnline="stream.online",e.StreamOffline="stream.offline",e.NetworkTunnelStarted="network.tunnel.started",e.NetworkTunnelStopped="network.tunnel.stopped",e.LocalNetworkChanged="network.local.changed",e.MeshNetworkChanged="network.mesh.changed",e.BackupCompleted="backup.completed",e.BackupRunCompleted="backup.run-completed",e.BackupRestored="backup.restored",e.NotificationDispatched="notification.dispatched",e.NotificationFailed="notification.failed",e.DeviceUpdated="device.updated",e.DeviceOnline="device.online",e.DeviceOffline="device.offline",e.DeviceAwake="device.awake",e.DeviceSleeping="device.sleeping",e.RetentionCleanup="retention.cleanup",e.AddonsBulkUpdateProgress="addons.bulk-update-progress",e.AddonsJobProgress="addons.job-progress",e.AddonsJobLog="addons.job-log",e.AccessoriesChildVisibilityChanged="accessories.onChildVisibilityChanged",e.AccessoriesChanged="accessories.onAccessoriesChanged",e.ModelConvertProgress="model-convert.progress",e})({}),Nk;function pe(e,t,n){function a(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,h);const c=f.prototype,x=Object.keys(c);for(let M=0;M<x.length;M++){const C=x[M];C in m||(m[C]=c[C].bind(m))}}const s=n?.Parent??Object;class p extends s{}Object.defineProperty(p,"name",{value:e});function f(m){var h;const c=n?.Parent?new p:this;a(c,m),(h=c._zod).deferred??(h.deferred=[]);for(const x of c._zod.deferred)x();return c}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Gs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dE extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Nk=globalThis).__zod_globalConfig??(Nk.__zod_globalConfig={});const ob=globalThis.__zod_globalConfig;function Wi(e){return ob}function pE(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Mv(e,t){return typeof t=="bigint"?t.toString():t}function mm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sb(e){return e==null}function lb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function h3(e,t){const n=e/t,a=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-a)<s?0:n-a}const Ok=Symbol("evaluating");function Mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Ok)return a===void 0&&(a=Ok,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Po(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ur(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Pk(e){return JSON.stringify(e)}function g3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const mE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const v3=mm(()=>{if(ob.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Xs(e){if(Dc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Dc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function fE(e){return Xs(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const y3=new Set(["string","number","symbol"]);function Js(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function je(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function b3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const S3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function x3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const p=Ur(e._zod.def,{get shape(){const f={};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&(f[m]=n.shape[m])}return Po(this,"shape",f),f},checks:[]});return Yi(e,p)}function k3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const p=Ur(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&delete f[m]}return Po(this,"shape",f),f},checks:[]});return Yi(e,p)}function w3(e,t){if(!Xs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const p=e._zod.def.shape;for(const f in t)if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ur(e._zod.def,{get shape(){const p={...e._zod.def.shape,...t};return Po(this,"shape",p),p}});return Yi(e,s)}function M3(e,t){if(!Xs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ur(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Po(this,"shape",a),a}});return Yi(e,n)}function C3(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Ur(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Po(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Yi(e,n)}function A3(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=Ur(t._zod.def,{get shape(){const m=t._zod.def.shape,h={...m};if(n)for(const c in n){if(!(c in m))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(h[c]=e?new e({type:"optional",innerType:m[c]}):m[c])}else for(const c in m)h[c]=e?new e({type:"optional",innerType:m[c]}):m[c];return Po(this,"shape",h),h},checks:[]});return Yi(t,f)}function E3(e,t,n){const a=Ur(t._zod.def,{get shape(){const s=t._zod.def.shape,p={...s};if(n)for(const f in n){if(!(f in p))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(p[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)p[f]=new e({type:"nonoptional",innerType:s[f]});return Po(this,"shape",p),p}});return Yi(t,a)}function Ls(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function R3(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Nr(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Pd(e){return typeof e=="string"?e:e?.message}function Ki(e,t,n){const a=e.message?e.message:Pd(e.inst?._zod.def?.error?.(e))??Pd(t?.error?.(e))??Pd(n.customError?.(e))??Pd(n.localeError?.(e))??"Invalid input",{inst:s,continue:p,input:f,...m}=e;return m.path??(m.path=[]),m.message=a,t?.reportInput&&(m.input=f),m}function cb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function zc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const hE=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Mv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gE=pe("$ZodError",hE),vE=pe("$ZodError",hE,{Parent:Error});function I3(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function T3(e,t=n=>n.message){const n={_errors:[]},a=(s,p=[])=>{for(const f of s.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>a({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...p,...f.path]);else{const m=[...p,...f.path];if(m.length===0)n._errors.push(t(f));else{let h=n,c=0;for(;c<m.length;){const x=m[c];c===m.length-1?(h[x]=h[x]||{_errors:[]},h[x]._errors.push(t(f))):h[x]=h[x]||{_errors:[]},h=h[x],c++}}}};return a(e),n}const ub=e=>(t,n,a,s)=>{const p=a?{...a,async:!1}:{async:!1},f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise)throw new Gs;if(f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>Ki(h,p,Wi())));throw mE(m,s?.callee),m}return f.value},db=e=>async(t,n,a,s)=>{const p=a?{...a,async:!0}:{async:!0};let f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise&&(f=await f),f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>Ki(h,p,Wi())));throw mE(m,s?.callee),m}return f.value},fm=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},p=t._zod.run({value:n,issues:[]},s);if(p instanceof Promise)throw new Gs;return p.issues.length?{success:!1,error:new(e??gE)(p.issues.map(f=>Ki(f,s,Wi())))}:{success:!0,data:p.value}},_3=fm(vE),hm=e=>async(t,n,a)=>{const s=a?{...a,async:!0}:{async:!0};let p=t._zod.run({value:n,issues:[]},s);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(f=>Ki(f,s,Wi())))}:{success:!0,data:p.value}},N3=hm(vE),O3=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return ub(e)(t,n,s)},P3=e=>(t,n,a)=>ub(e)(t,n,a),j3=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return db(e)(t,n,s)},D3=e=>async(t,n,a)=>db(e)(t,n,a),z3=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return fm(e)(t,n,s)},L3=e=>(t,n,a)=>fm(e)(t,n,a),q3=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return hm(e)(t,n,s)},B3=e=>async(t,n,a)=>hm(e)(t,n,a),U3=/^[cC][0-9a-z]{6,}$/,F3=/^[0-9a-z]+$/,H3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$3=/^[0-9a-vA-V]{20}$/,Q3=/^[A-Za-z0-9]{27}$/,V3=/^[a-zA-Z0-9_-]{21}$/,G3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Z3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,W3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,K3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Y3(){return new RegExp(K3,"u")}const X3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,J3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yE=/^[A-Za-z0-9_-]*$/,aD=/^https?$/,iD=/^\+[1-9]\d{6,14}$/,bE="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rD=new RegExp(`^${bE}$`);function SE(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oD(e){return new RegExp(`^${SE(e)}$`)}function sD(e){const t=SE({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${bE}T(?:${a})$`)}const lD=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cD=/^-?\d+$/,xE=/^-?\d+(?:\.\d+)?$/,uD=/^(?:true|false)$/i,dD=/^null$/i,pD=/^[^A-Z]*$/,mD=/^[^a-z]*$/,ma=pe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),kE={number:"number",bigint:"bigint",object:"date"},wE=pe("$ZodCheckLessThan",(e,t)=>{ma.init(e,t);const n=kE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<p&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ME=pe("$ZodCheckGreaterThan",(e,t)=>{ma.init(e,t);const n=kE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>p&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fD=pe("$ZodCheckMultipleOf",(e,t)=>{ma.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):h3(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hD=pe("$ZodCheckNumberFormat",(e,t)=>{ma.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,p]=S3[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=s,m.maximum=p,n&&(m.pattern=cD)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<s&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>p&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:e,continue:!t.abort})}}),gD=pe("$ZodCheckMaxLength",(e,t)=>{var n;ma.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const f=cb(s);a.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),vD=pe("$ZodCheckMinLength",(e,t)=>{var n;ma.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const f=cb(s);a.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),yD=pe("$ZodCheckLengthEquals",(e,t)=>{var n;ma.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,p=s.length;if(p===t.length)return;const f=cb(s),m=p>t.length;a.issues.push({origin:f,...m?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),gm=pe("$ZodCheckStringFormat",(e,t)=>{var n,a;ma.init(e,t),e._zod.onattach.push(s=>{const p=s._zod.bag;p.format=t.format,t.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),bD=pe("$ZodCheckRegex",(e,t)=>{gm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),SD=pe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=pD),gm.init(e,t)}),xD=pe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mD),gm.init(e,t)}),kD=pe("$ZodCheckIncludes",(e,t)=>{ma.init(e,t);const n=Js(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const p=s._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),wD=pe("$ZodCheckStartsWith",(e,t)=>{ma.init(e,t);const n=new RegExp(`^${Js(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),MD=pe("$ZodCheckEndsWith",(e,t)=>{ma.init(e,t);const n=new RegExp(`.*${Js(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),CD=pe("$ZodCheckOverwrite",(e,t)=>{ma.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class AD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
11
- `).filter(f=>f),s=Math.min(...a.map(f=>f.length-f.trimStart().length)),p=a.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of p)this.content.push(f)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(p=>` ${p}`)];return new t(...n,s.join(`
12
- `))}}const ED={major:4,minor:4,patch:3},Pt=pe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ED;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const p of s._zod.onattach)p(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,m,h)=>{let c=Ls(f),x;for(const M of m){if(M._zod.def.when){if(R3(f)||!M._zod.def.when(f))continue}else if(c)continue;const C=f.issues.length,E=M._zod.check(f);if(E instanceof Promise&&h?.async===!1)throw new Gs;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,f.issues.length!==C&&(c||(c=Ls(f,C)))});else{if(f.issues.length===C)continue;c||(c=Ls(f,C))}}return x?x.then(()=>f):f},p=(f,m,h)=>{if(Ls(f))return f.aborted=!0,f;const c=s(m,a,h);if(c instanceof Promise){if(h.async===!1)throw new Gs;return c.then(x=>e._zod.parse(x,h))}return e._zod.parse(c,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const c=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return c instanceof Promise?c.then(x=>p(x,f,m)):p(c,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Gs;return h.then(c=>s(c,a,m))}return s(h,a,m)}}Mt(e,"~standard",()=>({validate:s=>{try{const p=_3(e,s);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return N3(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),pb=pe("$ZodString",(e,t)=>{Pt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??lD(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),nn=pe("$ZodStringFormat",(e,t)=>{gm.init(e,t),pb.init(e,t)}),RD=pe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Z3),nn.init(e,t)}),ID=pe("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jk(a))}else t.pattern??(t.pattern=jk());nn.init(e,t)}),TD=pe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=W3),nn.init(e,t)}),_D=pe("$ZodURL",(e,t)=>{nn.init(e,t),e._zod.check=n=>{try{const a=n.value.trim();if(!t.normalize&&t.protocol?.source===aD.source&&!/^https?:\/\//i.test(a)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ND=pe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Y3()),nn.init(e,t)}),OD=pe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=V3),nn.init(e,t)}),PD=pe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=U3),nn.init(e,t)}),jD=pe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=F3),nn.init(e,t)}),DD=pe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=H3),nn.init(e,t)}),zD=pe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$3),nn.init(e,t)}),LD=pe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Q3),nn.init(e,t)}),qD=pe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=sD(t)),nn.init(e,t)}),BD=pe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rD),nn.init(e,t)}),UD=pe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oD(t)),nn.init(e,t)}),FD=pe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=G3),nn.init(e,t)}),HD=pe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=X3),nn.init(e,t),e._zod.bag.format="ipv4"}),$D=pe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=J3),nn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),QD=pe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eD),nn.init(e,t)}),VD=pe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tD),nn.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,p]=a;if(!p)throw new Error;const f=Number(p);if(`${f}`!==p)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function CE(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const GD=pe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=nD),nn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{CE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ZD(e){if(!yE.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return CE(n)}const WD=pe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yE),nn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ZD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),KD=pe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=iD),nn.init(e,t)});function YD(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const XD=pe("$ZodJWT",(e,t)=>{nn.init(e,t),e._zod.check=n=>{YD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),AE=pe("$ZodNumber",(e,t)=>{Pt.init(e,t),e._zod.pattern=e._zod.bag.pattern??xE,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const p=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...p?{received:p}:{}}),n}}),JD=pe("$ZodNumberFormat",(e,t)=>{hD.init(e,t),AE.init(e,t)}),e6=pe("$ZodBoolean",(e,t)=>{Pt.init(e,t),e._zod.pattern=uD,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),t6=pe("$ZodNull",(e,t)=>{Pt.init(e,t),e._zod.pattern=dD,e._zod.values=new Set([null]),e._zod.parse=(n,a)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),n6=pe("$ZodAny",(e,t)=>{Pt.init(e,t),e._zod.parse=n=>n}),a6=pe("$ZodUnknown",(e,t)=>{Pt.init(e,t),e._zod.parse=n=>n}),i6=pe("$ZodNever",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),r6=pe("$ZodVoid",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;return typeof s>"u"||n.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),n}}),o6=pe("$ZodDate",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,p=s instanceof Date;return p&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...p?{received:"Invalid Date"}:{},inst:e}),n}});function Dk(e,t,n){e.issues.length&&t.issues.push(...Nr(n,e.issues)),t.value[n]=e.value}const s6=pe("$ZodArray",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const p=[];for(let f=0;f<s.length;f++){const m=s[f],h=t.element._zod.run({value:m,issues:[]},a);h instanceof Promise?p.push(h.then(c=>Dk(c,n,f))):Dk(h,n,f)}return p.length?Promise.all(p).then(()=>n):n}});function Dp(e,t,n,a,s,p){const f=n in a;if(e.issues.length){if(s&&p&&!f)return;t.issues.push(...Nr(n,e.issues))}if(!f&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?f&&(t.value[n]=void 0):t.value[n]=e.value}function EE(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=b3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function RE(e,t,n,a,s,p){const f=[],m=s.keySet,h=s.catchall._zod,c=h.def.type,x=h.optin==="optional",M=h.optout==="optional";for(const C in t){if(C==="__proto__"||m.has(C))continue;if(c==="never"){f.push(C);continue}const E=h.run({value:t[C],issues:[]},a);E instanceof Promise?e.push(E.then(R=>Dp(R,n,C,t,x,M))):Dp(E,n,C,t,x,M)}return f.length&&n.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:p}),e.length?Promise.all(e).then(()=>n):n}const l6=pe("$ZodObject",(e,t)=>{if(Pt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const m=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...m};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=mm(()=>EE(t));Mt(e._zod,"propValues",()=>{const m=t.shape,h={};for(const c in m){const x=m[c]._zod;if(x.values){h[c]??(h[c]=new Set);for(const M of x.values)h[c].add(M)}}return h});const s=Dc,p=t.catchall;let f;e._zod.parse=(m,h)=>{f??(f=a.value);const c=m.value;if(!s(c))return m.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),m;m.value={};const x=[],M=f.shape;for(const C of f.keys){const E=M[C],R=E._zod.optin==="optional",_=E._zod.optout==="optional",P=E._zod.run({value:c[C],issues:[]},h);P instanceof Promise?x.push(P.then(D=>Dp(D,m,C,c,R,_))):Dp(P,m,C,c,R,_)}return p?RE(x,c,m,h,a.value,e):x.length?Promise.all(x).then(()=>m):m}}),c6=pe("$ZodObjectJIT",(e,t)=>{l6.init(e,t);const n=e._zod.parse,a=mm(()=>EE(t)),s=C=>{const E=new AD(["shape","payload","ctx"]),R=a.value,_=B=>{const q=Pk(B);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};E.write("const input = payload.value;");const P=Object.create(null);let D=0;for(const B of R.keys)P[B]=`key_${D++}`;E.write("const newResult = {};");for(const B of R.keys){const q=P[B],G=Pk(B),ne=C[B],V=ne?._zod?.optin==="optional",U=ne?._zod?.optout==="optional";E.write(`const ${q} = ${_(B)};`),V&&U?E.write(`
13
- if (${q}.issues.length) {
14
- if (${G} in input) {
15
- payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
16
- ...iss,
17
- path: iss.path ? [${G}, ...iss.path] : [${G}]
18
- })));
19
- }
20
- }
21
-
22
- if (${q}.value === undefined) {
23
- if (${G} in input) {
24
- newResult[${G}] = undefined;
25
- }
26
- } else {
27
- newResult[${G}] = ${q}.value;
28
- }
29
-
30
- `):V?E.write(`
31
- if (${q}.issues.length) {
32
- payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
33
- ...iss,
34
- path: iss.path ? [${G}, ...iss.path] : [${G}]
35
- })));
36
- }
37
-
38
- if (${q}.value === undefined) {
39
- if (${G} in input) {
40
- newResult[${G}] = undefined;
41
- }
42
- } else {
43
- newResult[${G}] = ${q}.value;
44
- }
45
-
46
- `):E.write(`
47
- const ${q}_present = ${G} in input;
48
- if (${q}.issues.length) {
49
- payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
50
- ...iss,
51
- path: iss.path ? [${G}, ...iss.path] : [${G}]
52
- })));
53
- }
54
- if (!${q}_present && !${q}.issues.length) {
55
- payload.issues.push({
56
- code: "invalid_type",
57
- expected: "nonoptional",
58
- input: undefined,
59
- path: [${G}]
60
- });
61
- }
62
-
63
- if (${q}_present) {
64
- if (${q}.value === undefined) {
65
- newResult[${G}] = undefined;
66
- } else {
67
- newResult[${G}] = ${q}.value;
68
- }
69
- }
70
-
71
- `)}E.write("payload.value = newResult;"),E.write("return payload;");const L=E.compile();return(B,q)=>L(C,B,q)};let p;const f=Dc,m=!ob.jitless,c=m&&v3.value,x=t.catchall;let M;e._zod.parse=(C,E)=>{M??(M=a.value);const R=C.value;return f(R)?m&&c&&E?.async===!1&&E.jitless!==!0?(p||(p=s(t.shape)),C=p(C,E),x?RE([],R,C,E,M,e):C):n(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),C)}});function zk(e,t,n,a){for(const p of e)if(p.issues.length===0)return t.value=p.value,t;const s=e.filter(p=>!Ls(p));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(p=>p.issues.map(f=>Ki(f,a,Wi())))}),t)}const IE=pe("$ZodUnion",(e,t)=>{Pt.init(e,t),Mt(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),Mt(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),Mt(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),Mt(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${a.map(s=>lb(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(a,s)=>{if(n)return n(a,s);let p=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:a.value,issues:[]},s);if(h instanceof Promise)f.push(h),p=!0;else{if(h.issues.length===0)return h;f.push(h)}}return p?Promise.all(f).then(m=>zk(m,a,e,s)):zk(f,a,e,s)}}),u6=pe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,IE.init(e,t);const n=e._zod.parse;Mt(e._zod,"propValues",()=>{const s={};for(const p of t.options){const f=p._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(const[m,h]of Object.entries(f)){s[m]||(s[m]=new Set);for(const c of h)s[m].add(c)}}return s});const a=mm(()=>{const s=t.options,p=new Map;for(const f of s){const m=f._zod.propValues?.[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(p.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);p.set(h,f)}}return p});e._zod.parse=(s,p)=>{const f=s.value;if(!Dc(f))return s.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),s;const m=a.value.get(f?.[t.discriminator]);return m?m._zod.run(s,p):t.unionFallback||p.direction==="backward"?n(s,p):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(a.value.keys()),input:f,path:[t.discriminator],inst:e}),s)}}),d6=pe("$ZodIntersection",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,p=t.left._zod.run({value:s,issues:[]},a),f=t.right._zod.run({value:s,issues:[]},a);return p instanceof Promise||f instanceof Promise?Promise.all([p,f]).then(([h,c])=>Lk(n,h,c)):Lk(n,p,f)}});function Cv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Xs(e)&&Xs(t)){const n=Object.keys(t),a=Object.keys(e).filter(p=>n.indexOf(p)!==-1),s={...e,...t};for(const p of a){const f=Cv(e[p],t[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};s[p]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],p=t[a],f=Cv(s,p);if(!f.valid)return{valid:!1,mergeErrorPath:[a,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Lk(e,t,n){const a=new Map;let s;for(const m of t.issues)if(m.code==="unrecognized_keys"){s??(s=m);for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(m);for(const m of n.issues)if(m.code==="unrecognized_keys")for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(m);const p=[...a].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(p.length&&s&&e.issues.push({...s,keys:p}),Ls(e))return e;const f=Cv(t.value,n.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return e.value=f.data,e}const p6=pe("$ZodTuple",(e,t)=>{Pt.init(e,t);const n=t.items;e._zod.parse=(a,s)=>{const p=a.value;if(!Array.isArray(p))return a.issues.push({input:p,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];const f=[],m=qk(n,"optin"),h=qk(n,"optout");if(!t.rest){if(p.length<m)return a.issues.push({code:"too_small",minimum:m,inclusive:!0,input:p,inst:e,origin:"array"}),a;p.length>n.length&&a.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:p,inst:e,origin:"array"})}const c=new Array(n.length);for(let x=0;x<n.length;x++){const M=n[x]._zod.run({value:p[x],issues:[]},s);M instanceof Promise?f.push(M.then(C=>{c[x]=C})):c[x]=M}if(t.rest){let x=n.length-1;const M=p.slice(n.length);for(const C of M){x++;const E=t.rest._zod.run({value:C,issues:[]},s);E instanceof Promise?f.push(E.then(R=>Bk(R,a,x))):Bk(E,a,x)}}return f.length?Promise.all(f).then(()=>Uk(c,a,n,p,h)):Uk(c,a,n,p,h)}});function qk(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Bk(e,t,n){e.issues.length&&t.issues.push(...Nr(n,e.issues)),t.value[n]=e.value}function Uk(e,t,n,a,s){for(let p=0;p<n.length;p++){const f=e[p],m=p<a.length;if(f.issues.length){if(!m&&p>=s){t.value.length=p;break}t.issues.push(...Nr(p,f.issues))}t.value[p]=f.value}for(let p=t.value.length-1;p>=a.length&&(n[p]._zod.optout==="optional"&&t.value[p]===void 0);p--)t.value.length=p;return t}const m6=pe("$ZodRecord",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Xs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const p=[],f=t.keyType._zod.values;if(f){n.value={};const m=new Set;for(const c of f)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){m.add(typeof c=="number"?c.toString():c);const x=t.keyType._zod.run({value:c,issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(x.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:x.issues.map(E=>Ki(E,a,Wi())),input:c,path:[c],inst:e});continue}const M=x.value,C=t.valueType._zod.run({value:s[c],issues:[]},a);C instanceof Promise?p.push(C.then(E=>{E.issues.length&&n.issues.push(...Nr(c,E.issues)),n.value[M]=E.value})):(C.issues.length&&n.issues.push(...Nr(c,C.issues)),n.value[M]=C.value)}let h;for(const c in s)m.has(c)||(h=h??[],h.push(c));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const m of Reflect.ownKeys(s)){if(m==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,m))continue;let h=t.keyType._zod.run({value:m,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&xE.test(m)&&h.issues.length){const M=t.keyType._zod.run({value:Number(m),issues:[]},a);if(M instanceof Promise)throw new Error("Async schemas not supported in object keys currently");M.issues.length===0&&(h=M)}if(h.issues.length){t.mode==="loose"?n.value[m]=s[m]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(M=>Ki(M,a,Wi())),input:m,path:[m],inst:e});continue}const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?p.push(x.then(M=>{M.issues.length&&n.issues.push(...Nr(m,M.issues)),n.value[h.value]=M.value})):(x.issues.length&&n.issues.push(...Nr(m,x.issues)),n.value[h.value]=x.value)}}return p.length?Promise.all(p).then(()=>n):n}}),f6=pe("$ZodEnum",(e,t)=>{Pt.init(e,t);const n=pE(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>y3.has(typeof s)).map(s=>typeof s=="string"?Js(s):s.toString()).join("|")})$`),e._zod.parse=(s,p)=>{const f=s.value;return a.has(f)||s.issues.push({code:"invalid_value",values:n,input:f,inst:e}),s}}),h6=pe("$ZodLiteral",(e,t)=>{if(Pt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Js(a):a?Js(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const p=a.value;return n.has(p)||a.issues.push({code:"invalid_value",values:t.values,input:p,inst:e}),a}}),g6=pe("$ZodTransform",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new dE(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(f=>(n.value=f,n.fallback=!0,n));if(s instanceof Promise)throw new Gs;return n.value=s,n.fallback=!0,n}});function Fk(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const TE=pe("$ZodOptional",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${lb(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,p=t.innerType._zod.run(n,a);return p instanceof Promise?p.then(f=>Fk(f,s)):Fk(p,s)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),v6=pe("$ZodExactOptional",(e,t)=>{TE.init(e,t),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),y6=pe("$ZodNullable",(e,t)=>{Pt.init(e,t),Mt(e._zod,"optin",()=>t.innerType._zod.optin),Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${lb(n.source)}|null)$`):void 0}),Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),b6=pe("$ZodDefault",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>Hk(p,t)):Hk(s,t)}});function Hk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const S6=pe("$ZodPrefault",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),x6=pe("$ZodNonOptional",(e,t)=>{Pt.init(e,t),Mt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>$k(p,e)):$k(s,e)}});function $k(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const k6=pe("$ZodCatch",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>(n.value=p.value,p.issues.length&&(n.value=t.catchValue({...n,error:{issues:p.issues.map(f=>Ki(f,a,Wi()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(p=>Ki(p,a,Wi()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),_E=pe("$ZodPipe",(e,t)=>{Pt.init(e,t),Mt(e._zod,"values",()=>t.in._zod.values),Mt(e._zod,"optin",()=>t.in._zod.optin),Mt(e._zod,"optout",()=>t.out._zod.optout),Mt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const p=t.out._zod.run(n,a);return p instanceof Promise?p.then(f=>jd(f,t.in,a)):jd(p,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(p=>jd(p,t.out,a)):jd(s,t.out,a)}});function jd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const w6=pe("$ZodPreprocess",(e,t)=>{_E.init(e,t)}),M6=pe("$ZodReadonly",(e,t)=>{Pt.init(e,t),Mt(e._zod,"propValues",()=>t.innerType._zod.propValues),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"optin",()=>t.innerType?._zod?.optin),Mt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(Qk):Qk(s)}});function Qk(e){return e.value=Object.freeze(e.value),e}const C6=pe("$ZodLazy",(e,t)=>{Pt.init(e,t),Mt(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Mt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Mt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Mt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Mt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,a)=>e._zod.innerType._zod.run(n,a)}),A6=pe("$ZodCustom",(e,t)=>{ma.init(e,t),Pt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(p=>Vk(p,n,a,e));Vk(s,n,a,e)}});function Vk(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(zc(s))}}var Gk;class E6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function R6(){return new E6}(Gk=globalThis).__zod_globalRegistry??(Gk.__zod_globalRegistry=R6());const kc=globalThis.__zod_globalRegistry;function I6(e,t){return new e({type:"string",...je(t)})}function NE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function Zk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function T6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function _6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}function N6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}function O6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}function OE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}function P6(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}function j6(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}function D6(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}function z6(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}function L6(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}function q6(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}function B6(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}function U6(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}function F6(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}function H6(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}function $6(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}function Q6(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}function V6(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}function G6(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}function Z6(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}function W6(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...je(t)})}function K6(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}function Y6(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...je(t)})}function X6(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}function J6(e,t){return new e({type:"number",checks:[],...je(t)})}function ez(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}function tz(e,t){return new e({type:"boolean",...je(t)})}function nz(e,t){return new e({type:"null",...je(t)})}function az(e){return new e({type:"any"})}function iz(e){return new e({type:"unknown"})}function rz(e,t){return new e({type:"never",...je(t)})}function oz(e,t){return new e({type:"void",...je(t)})}function sz(e,t){return new e({type:"date",...je(t)})}function Wk(e,t){return new wE({check:"less_than",...je(t),value:e,inclusive:!1})}function ip(e,t){return new wE({check:"less_than",...je(t),value:e,inclusive:!0})}function Kk(e,t){return new ME({check:"greater_than",...je(t),value:e,inclusive:!1})}function rp(e,t){return new ME({check:"greater_than",...je(t),value:e,inclusive:!0})}function Yk(e,t){return new fD({check:"multiple_of",...je(t),value:e})}function PE(e,t){return new gD({check:"max_length",...je(t),maximum:e})}function zp(e,t){return new vD({check:"min_length",...je(t),minimum:e})}function jE(e,t){return new yD({check:"length_equals",...je(t),length:e})}function lz(e,t){return new bD({check:"string_format",format:"regex",...je(t),pattern:e})}function cz(e){return new SD({check:"string_format",format:"lowercase",...je(e)})}function uz(e){return new xD({check:"string_format",format:"uppercase",...je(e)})}function dz(e,t){return new kD({check:"string_format",format:"includes",...je(t),includes:e})}function pz(e,t){return new wD({check:"string_format",format:"starts_with",...je(t),prefix:e})}function mz(e,t){return new MD({check:"string_format",format:"ends_with",...je(t),suffix:e})}function ul(e){return new CD({check:"overwrite",tx:e})}function fz(e){return ul(t=>t.normalize(e))}function hz(){return ul(e=>e.trim())}function gz(){return ul(e=>e.toLowerCase())}function vz(){return ul(e=>e.toUpperCase())}function yz(){return ul(e=>g3(e))}function bz(e,t,n){return new e({type:"array",element:t,...je(n)})}function Sz(e,t,n){const a=je(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function xz(e,t,n){return new e({type:"custom",check:"custom",fn:t,...je(n)})}function kz(e,t){const n=wz(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(zc(s,a.value,n._zod.def));else{const p=s;p.fatal&&(p.continue=!1),p.code??(p.code="custom"),p.input??(p.input=a.value),p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),a.issues.push(zc(p))}},e(a.value,a)),t);return n}function wz(e,t){const n=new ma({check:"custom",...je(t)});return n._zod.check=e,n}function DE(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??kc,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function sn(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,p=t.seen.get(e);if(p)return p.count++,n.schemaPath.includes(e)&&(p.cycle=n.path),p.schema;const f={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,f);const m=e._zod.toJSONSchema?.();if(m)f.schema=m;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,f.schema,x);else{const C=f.schema,E=t.processors[s.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);E(e,t,C,x)}const M=e._zod.parent;M&&(f.ref||(f.ref=M),sn(M,t,x),t.seen.get(M).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(f.schema,h),t.io==="input"&&Gn(e)&&(delete f.schema.examples,delete f.schema.default),t.io==="input"&&"_prefault"in f.schema&&((a=f.schema).default??(a.default=f.schema._prefault)),delete f.schema._prefault,t.seen.get(e).schema}function zE(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const f of e.seen.entries()){const m=e.metadataRegistry.get(f[0])?.id;if(m){const h=a.get(m);if(h&&h!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(m,f[0])}}const s=f=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const M=e.external.registry.get(f[0])?.id,C=e.external.uri??(R=>R);if(M)return{ref:C(M)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${C("__shared")}#/${m}/${E}`}}if(f[1]===n)return{ref:"#"};const c=`#/${m}/`,x=f[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:c+x}},p=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:h,defId:c}=s(f);m.def={...m.schema},c&&(m.defId=c);const x=m.schema;for(const M in x)delete x[M];x.$ref=h};if(e.cycles==="throw")for(const f of e.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
72
-
73
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const m=f[1];if(t===f[0]){p(f);continue}if(e.external){const c=e.external.registry.get(f[0])?.id;if(t!==f[0]&&c){p(f);continue}}if(e.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1&&e.reused==="ref"){p(f);continue}}}function LE(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=m=>{const h=e.seen.get(m);if(h.ref===null)return;const c=h.def??h.schema,x={...c},M=h.ref;if(h.ref=null,M){a(M);const E=e.seen.get(M),R=E.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(R)):Object.assign(c,R),Object.assign(c,x),m._zod.parent===M)for(const P in c)P==="$ref"||P==="allOf"||P in x||delete c[P];if(R.$ref&&E.def)for(const P in c)P==="$ref"||P==="allOf"||P in E.def&&JSON.stringify(c[P])===JSON.stringify(E.def[P])&&delete c[P]}const C=m._zod.parent;if(C&&C!==M){a(C);const E=e.seen.get(C);if(E?.schema.$ref&&(c.$ref=E.schema.$ref,E.def))for(const R in c)R==="$ref"||R==="allOf"||R in E.def&&JSON.stringify(c[R])===JSON.stringify(E.def[R])&&delete c[R]}e.override({zodSchema:m,jsonSchema:c,path:h.path??[]})};for(const m of[...e.seen.entries()].reverse())a(m[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const m=e.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(m)}Object.assign(s,n.def??n.schema);const p=e.metadataRegistry.get(t)?.id;p!==void 0&&s.id===p&&delete s.id;const f=e.external?.defs??{};for(const m of e.seen.entries()){const h=m[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,f[h.defId]=h.def)}e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?s.$defs=f:s.definitions=f);try{const m=JSON.parse(JSON.stringify(s));return Object.defineProperty(m,"~standard",{value:{...t["~standard"],jsonSchema:{input:Lp(t,"input",e.processors),output:Lp(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Gn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Gn(a.element,n);if(a.type==="set")return Gn(a.valueType,n);if(a.type==="lazy")return Gn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Gn(a.innerType,n);if(a.type==="intersection")return Gn(a.left,n)||Gn(a.right,n);if(a.type==="record"||a.type==="map")return Gn(a.keyType,n)||Gn(a.valueType,n);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Gn(a.in,n)||Gn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Gn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Gn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Gn(s,n))return!0;return!!(a.rest&&Gn(a.rest,n))}return!1}const Mz=(e,t={})=>n=>{const a=DE({...n,processors:t});return sn(e,a),zE(a,e),LE(a,e)},Lp=(e,t,n={})=>a=>{const{libraryOptions:s,target:p}=a??{},f=DE({...s??{},target:p,io:t,processors:n});return sn(e,f),zE(f,e),LE(f,e)},Cz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Az=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:p,maximum:f,format:m,patterns:h,contentEncoding:c}=e._zod.bag;if(typeof p=="number"&&(s.minLength=p),typeof f=="number"&&(s.maxLength=f),m&&(s.format=Cz[m]??m,s.format===""&&delete s.format,m==="time"&&delete s.format),c&&(s.contentEncoding=c),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(M=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:M.source}))])}},Ez=(e,t,n,a)=>{const s=n,{minimum:p,maximum:f,format:m,multipleOf:h,exclusiveMaximum:c,exclusiveMinimum:x}=e._zod.bag;typeof m=="string"&&m.includes("int")?s.type="integer":s.type="number";const M=typeof x=="number"&&x>=(p??Number.NEGATIVE_INFINITY),C=typeof c=="number"&&c<=(f??Number.POSITIVE_INFINITY),E=t.target==="draft-04"||t.target==="openapi-3.0";M?E?(s.minimum=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x:typeof p=="number"&&(s.minimum=p),C?E?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof f=="number"&&(s.maximum=f),typeof h=="number"&&(s.multipleOf=h)},Rz=(e,t,n,a)=>{n.type="boolean"},Iz=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Tz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},_z=(e,t,n,a)=>{n.not={}},Nz=(e,t,n,a)=>{},Oz=(e,t,n,a)=>{},Pz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},jz=(e,t,n,a)=>{const s=e._zod.def,p=pE(s.entries);p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),n.enum=p},Dz=(e,t,n,a)=>{const s=e._zod.def,p=[];for(const f of s.values)if(f===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");p.push(Number(f))}else p.push(f);if(p.length!==0)if(p.length===1){const f=p[0];n.type=f===null?"null":typeof f,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[f]:n.const=f}else p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),p.every(f=>typeof f=="boolean")&&(n.type="boolean"),p.every(f=>f===null)&&(n.type="null"),n.enum=p},zz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Lz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qz=(e,t,n,a)=>{const s=n,p=e._zod.def,{minimum:f,maximum:m}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof m=="number"&&(s.maxItems=m),s.type="array",s.items=sn(p.element,t,{...a,path:[...a.path,"items"]})},Bz=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object",s.properties={};const f=p.shape;for(const c in f)s.properties[c]=sn(f[c],t,{...a,path:[...a.path,"properties",c]});const m=new Set(Object.keys(f)),h=new Set([...m].filter(c=>{const x=p.shape[c]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),p.catchall?._zod.def.type==="never"?s.additionalProperties=!1:p.catchall?p.catchall&&(s.additionalProperties=sn(p.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Uz=(e,t,n,a)=>{const s=e._zod.def,p=s.inclusive===!1,f=s.options.map((m,h)=>sn(m,t,{...a,path:[...a.path,p?"oneOf":"anyOf",h]}));p?n.oneOf=f:n.anyOf=f},Fz=(e,t,n,a)=>{const s=e._zod.def,p=sn(s.left,t,{...a,path:[...a.path,"allOf",0]}),f=sn(s.right,t,{...a,path:[...a.path,"allOf",1]}),m=c=>"allOf"in c&&Object.keys(c).length===1,h=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=h},Hz=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="array";const f=t.target==="draft-2020-12"?"prefixItems":"items",m=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",h=p.items.map((C,E)=>sn(C,t,{...a,path:[...a.path,f,E]})),c=p.rest?sn(p.rest,t,{...a,path:[...a.path,m,...t.target==="openapi-3.0"?[p.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,c&&(s.items=c)):t.target==="openapi-3.0"?(s.items={anyOf:h},c&&s.items.anyOf.push(c),s.minItems=h.length,c||(s.maxItems=h.length)):(s.items=h,c&&(s.additionalItems=c));const{minimum:x,maximum:M}=e._zod.bag;typeof x=="number"&&(s.minItems=x),typeof M=="number"&&(s.maxItems=M)},$z=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object";const f=p.keyType,h=f._zod.bag?.patterns;if(p.mode==="loose"&&h&&h.size>0){const x=sn(p.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const M of h)s.patternProperties[M.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=sn(p.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=sn(p.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const c=f._zod.values;if(c){const x=[...c].filter(M=>typeof M=="string"||typeof M=="number");x.length>0&&(s.required=x)}},Qz=(e,t,n,a)=>{const s=e._zod.def,p=sn(s.innerType,t,a),f=t.seen.get(e);t.target==="openapi-3.0"?(f.ref=s.innerType,n.nullable=!0):n.anyOf=[p,{type:"null"}]},Vz=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},Gz=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Zz=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Wz=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=f},Kz=(e,t,n,a)=>{const s=e._zod.def,p=s.in._zod.traits.has("$ZodTransform"),f=t.io==="input"?p?s.out:s.in:s.out;sn(f,t,a);const m=t.seen.get(e);m.ref=f},Yz=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.readOnly=!0},qE=(e,t,n,a)=>{const s=e._zod.def;sn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},Xz=(e,t,n,a)=>{const s=e._zod.innerType;sn(s,t,a);const p=t.seen.get(e);p.ref=s},Jz=pe("ZodISODateTime",(e,t)=>{qD.init(e,t),ln.init(e,t)});function eL(e){return W6(Jz,e)}const tL=pe("ZodISODate",(e,t)=>{BD.init(e,t),ln.init(e,t)});function nL(e){return K6(tL,e)}const aL=pe("ZodISOTime",(e,t)=>{UD.init(e,t),ln.init(e,t)});function iL(e){return Y6(aL,e)}const rL=pe("ZodISODuration",(e,t)=>{FD.init(e,t),ln.init(e,t)});function oL(e){return X6(rL,e)}const sL=(e,t)=>{gE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>T3(e,n)},flatten:{value:n=>I3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Mv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Mv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Fa=pe("ZodError",sL,{Parent:Error}),lL=ub(Fa),cL=db(Fa),uL=fm(Fa),dL=hm(Fa),pL=O3(Fa),mL=P3(Fa),fL=j3(Fa),hL=D3(Fa),gL=z3(Fa),vL=L3(Fa),yL=q3(Fa),bL=B3(Fa),Xk=new WeakMap;function tu(e,t,n){const a=Object.getPrototypeOf(e);let s=Xk.get(a);if(s||(s=new Set,Xk.set(a,s)),!s.has(t)){s.add(t);for(const p in n){const f=n[p];Object.defineProperty(a,p,{configurable:!0,enumerable:!1,get(){const m=f.bind(this);return Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m}),m},set(m){Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m})}})}}}const Lt=pe("ZodType",(e,t)=>(Pt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Lp(e,"input"),output:Lp(e,"output")}}),e.toJSONSchema=Mz(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,a)=>lL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>uL(e,n,a),e.parseAsync=async(n,a)=>cL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>dL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>pL(e,n,a),e.decode=(n,a)=>mL(e,n,a),e.encodeAsync=async(n,a)=>fL(e,n,a),e.decodeAsync=async(n,a)=>hL(e,n,a),e.safeEncode=(n,a)=>gL(e,n,a),e.safeDecode=(n,a)=>vL(e,n,a),e.safeEncodeAsync=async(n,a)=>yL(e,n,a),e.safeDecodeAsync=async(n,a)=>bL(e,n,a),tu(e,"ZodType",{check(...n){const a=this.def;return this.clone(Ur(a,{checks:[...a.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,a){return Yi(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(h8(n,a))},superRefine(n,a){return this.check(g8(n,a))},overwrite(n){return this.check(ul(n))},optional(){return nw(this)},exactOptional(){return n8(this)},nullable(){return aw(this)},nullish(){return nw(aw(this))},nonoptional(n){return l8(this,n)},array(){return w(this)},or(n){return Ye([this,n])},and(n){return KL(this,n)},transform(n){return iw(this,ZE(n))},default(n){return r8(this,n)},prefault(n){return s8(this,n)},catch(n){return u8(this,n)},pipe(n){return iw(this,n)},readonly(){return m8(this)},describe(n){const a=this.clone();return kc.add(a,{description:n}),a},meta(...n){if(n.length===0)return kc.get(this);const a=this.clone();return kc.add(a,n[0]),a},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return kc.get(e)?.description},configurable:!0}),e)),BE=pe("_ZodString",(e,t)=>{pb.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Az(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,tu(e,"_ZodString",{regex(...a){return this.check(lz(...a))},includes(...a){return this.check(dz(...a))},startsWith(...a){return this.check(pz(...a))},endsWith(...a){return this.check(mz(...a))},min(...a){return this.check(zp(...a))},max(...a){return this.check(PE(...a))},length(...a){return this.check(jE(...a))},nonempty(...a){return this.check(zp(1,...a))},lowercase(a){return this.check(cz(a))},uppercase(a){return this.check(uz(a))},trim(){return this.check(hz())},normalize(...a){return this.check(fz(...a))},toLowerCase(){return this.check(gz())},toUpperCase(){return this.check(vz())},slugify(){return this.check(yz())}})}),SL=pe("ZodString",(e,t)=>{pb.init(e,t),BE.init(e,t),e.email=n=>e.check(NE(UE,n)),e.url=n=>e.check(OE(FE,n)),e.jwt=n=>e.check(Z6(zL,n)),e.emoji=n=>e.check(P6(wL,n)),e.guid=n=>e.check(Zk(Jk,n)),e.uuid=n=>e.check(T6(Dd,n)),e.uuidv4=n=>e.check(_6(Dd,n)),e.uuidv6=n=>e.check(N6(Dd,n)),e.uuidv7=n=>e.check(O6(Dd,n)),e.nanoid=n=>e.check(j6(ML,n)),e.guid=n=>e.check(Zk(Jk,n)),e.cuid=n=>e.check(D6(CL,n)),e.cuid2=n=>e.check(z6(AL,n)),e.ulid=n=>e.check(L6(EL,n)),e.base64=n=>e.check(Q6(PL,n)),e.base64url=n=>e.check(V6(jL,n)),e.xid=n=>e.check(q6(RL,n)),e.ksuid=n=>e.check(B6(IL,n)),e.ipv4=n=>e.check(U6(TL,n)),e.ipv6=n=>e.check(F6(_L,n)),e.cidrv4=n=>e.check(H6(NL,n)),e.cidrv6=n=>e.check($6(OL,n)),e.e164=n=>e.check(G6(DL,n)),e.datetime=n=>e.check(eL(n)),e.date=n=>e.check(nL(n)),e.time=n=>e.check(iL(n)),e.duration=n=>e.check(oL(n))});function o(e){return I6(SL,e)}const ln=pe("ZodStringFormat",(e,t)=>{nn.init(e,t),BE.init(e,t)}),UE=pe("ZodEmail",(e,t)=>{TD.init(e,t),ln.init(e,t)});function xL(e){return NE(UE,e)}const Jk=pe("ZodGUID",(e,t)=>{RD.init(e,t),ln.init(e,t)}),Dd=pe("ZodUUID",(e,t)=>{ID.init(e,t),ln.init(e,t)}),FE=pe("ZodURL",(e,t)=>{_D.init(e,t),ln.init(e,t)});function kL(e){return OE(FE,e)}const wL=pe("ZodEmoji",(e,t)=>{ND.init(e,t),ln.init(e,t)}),ML=pe("ZodNanoID",(e,t)=>{OD.init(e,t),ln.init(e,t)}),CL=pe("ZodCUID",(e,t)=>{PD.init(e,t),ln.init(e,t)}),AL=pe("ZodCUID2",(e,t)=>{jD.init(e,t),ln.init(e,t)}),EL=pe("ZodULID",(e,t)=>{DD.init(e,t),ln.init(e,t)}),RL=pe("ZodXID",(e,t)=>{zD.init(e,t),ln.init(e,t)}),IL=pe("ZodKSUID",(e,t)=>{LD.init(e,t),ln.init(e,t)}),TL=pe("ZodIPv4",(e,t)=>{HD.init(e,t),ln.init(e,t)}),_L=pe("ZodIPv6",(e,t)=>{$D.init(e,t),ln.init(e,t)}),NL=pe("ZodCIDRv4",(e,t)=>{QD.init(e,t),ln.init(e,t)}),OL=pe("ZodCIDRv6",(e,t)=>{VD.init(e,t),ln.init(e,t)}),PL=pe("ZodBase64",(e,t)=>{GD.init(e,t),ln.init(e,t)}),jL=pe("ZodBase64URL",(e,t)=>{WD.init(e,t),ln.init(e,t)}),DL=pe("ZodE164",(e,t)=>{KD.init(e,t),ln.init(e,t)}),zL=pe("ZodJWT",(e,t)=>{XD.init(e,t),ln.init(e,t)}),HE=pe("ZodNumber",(e,t)=>{AE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Ez(e,a,s),tu(e,"ZodNumber",{gt(a,s){return this.check(Kk(a,s))},gte(a,s){return this.check(rp(a,s))},min(a,s){return this.check(rp(a,s))},lt(a,s){return this.check(Wk(a,s))},lte(a,s){return this.check(ip(a,s))},max(a,s){return this.check(ip(a,s))},int(a){return this.check(ew(a))},safe(a){return this.check(ew(a))},positive(a){return this.check(Kk(0,a))},nonnegative(a){return this.check(rp(0,a))},negative(a){return this.check(Wk(0,a))},nonpositive(a){return this.check(ip(0,a))},multipleOf(a,s){return this.check(Yk(a,s))},step(a,s){return this.check(Yk(a,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function l(e){return J6(HE,e)}const LL=pe("ZodNumberFormat",(e,t)=>{JD.init(e,t),HE.init(e,t)});function ew(e){return ez(LL,e)}const qL=pe("ZodBoolean",(e,t)=>{e6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Rz(e,n,a)});function A(e){return tz(qL,e)}const BL=pe("ZodNull",(e,t)=>{t6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Iz(e,n,a)});function $E(e){return nz(BL,e)}const UL=pe("ZodAny",(e,t)=>{n6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Nz()});function QE(){return az(UL)}const FL=pe("ZodUnknown",(e,t)=>{a6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Oz()});function X(){return iz(FL)}const HL=pe("ZodNever",(e,t)=>{i6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_z(e,n,a)});function $L(e){return rz(HL,e)}const QL=pe("ZodVoid",(e,t)=>{r6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Tz(e,n)});function O(e){return oz(QL,e)}const VL=pe("ZodDate",(e,t)=>{o6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Pz(e,a),e.min=(a,s)=>e.check(rp(a,s)),e.max=(a,s)=>e.check(ip(a,s));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Av(e){return sz(VL,e)}const GL=pe("ZodArray",(e,t)=>{s6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>qz(e,n,a,s),e.element=t.element,tu(e,"ZodArray",{min(n,a){return this.check(zp(n,a))},nonempty(n){return this.check(zp(1,n))},max(n,a){return this.check(PE(n,a))},length(n,a){return this.check(jE(n,a))},unwrap(){return this.element}})});function w(e,t){return bz(GL,e,t)}const VE=pe("ZodObject",(e,t)=>{c6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Bz(e,n,a,s),Mt(e,"shape",()=>t.shape),tu(e,"ZodObject",{keyof(){return N(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:X()})},loose(){return this.clone({...this._zod.def,catchall:X()})},strict(){return this.clone({...this._zod.def,catchall:$L()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return w3(this,n)},safeExtend(n){return M3(this,n)},merge(n){return C3(this,n)},pick(n){return x3(this,n)},omit(n){return k3(this,n)},partial(...n){return A3(WE,this,n[0])},required(...n){return E3(KE,this,n[0])}})});function d(e,t){const n={type:"object",shape:e??{},...je(t)};return new VE(n)}function tw(e,t){return new VE({type:"object",shape:e,catchall:X(),...je(t)})}const GE=pe("ZodUnion",(e,t)=>{IE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Uz(e,n,a,s),e.options=t.options});function Ye(e,t){return new GE({type:"union",options:e,...je(t)})}const ZL=pe("ZodDiscriminatedUnion",(e,t)=>{GE.init(e,t),u6.init(e,t)});function kt(e,t,n){return new ZL({type:"union",options:t,discriminator:e,...je(n)})}const WL=pe("ZodIntersection",(e,t)=>{d6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Fz(e,n,a,s)});function KL(e,t){return new WL({type:"intersection",left:e,right:t})}const YL=pe("ZodTuple",(e,t)=>{p6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Hz(e,n,a,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function nu(e,t,n){const a=t instanceof Pt,s=a?n:t,p=a?t:null;return new YL({type:"tuple",items:e,rest:p,...je(s)})}const Ev=pe("ZodRecord",(e,t)=>{m6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$z(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Y(e,t,n){return!t||!t._zod?new Ev({type:"record",keyType:o(),valueType:e,...je(t)}):new Ev({type:"record",keyType:e,valueType:t,...je(n)})}function XL(e,t,n){const a=Yi(e);return a._zod.values=void 0,new Ev({type:"record",keyType:a,valueType:t,...je(n)})}const Rv=pe("ZodEnum",(e,t)=>{f6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>jz(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const p={};for(const f of a)if(n.has(f))p[f]=t.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Rv({...t,checks:[],...je(s),entries:p})},e.exclude=(a,s)=>{const p={...t.entries};for(const f of a)if(n.has(f))delete p[f];else throw new Error(`Key ${f} not found in enum`);return new Rv({...t,checks:[],...je(s),entries:p})}});function N(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Rv({type:"enum",entries:n,...je(t)})}const JL=pe("ZodLiteral",(e,t)=>{h6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Dz(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new JL({type:"literal",values:Array.isArray(e)?e:[e],...je(t)})}const e8=pe("ZodTransform",(e,t)=>{g6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Lz(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new dE(e.constructor.name);n.addIssue=p=>{if(typeof p=="string")n.issues.push(zc(p,n.value,t));else{const f=p;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=n.value),f.inst??(f.inst=e),n.issues.push(zc(f))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(p=>(n.value=p,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function ZE(e){return new e8({type:"transform",transform:e})}const WE=pe("ZodOptional",(e,t)=>{TE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>qE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function nw(e){return new WE({type:"optional",innerType:e})}const t8=pe("ZodExactOptional",(e,t)=>{v6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>qE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function n8(e){return new t8({type:"optional",innerType:e})}const a8=pe("ZodNullable",(e,t)=>{y6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Qz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function aw(e){return new a8({type:"nullable",innerType:e})}const i8=pe("ZodDefault",(e,t)=>{b6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Gz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function r8(e,t){return new i8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fE(t)}})}const o8=pe("ZodPrefault",(e,t)=>{S6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Zz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function s8(e,t){return new o8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fE(t)}})}const KE=pe("ZodNonOptional",(e,t)=>{x6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Vz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function l8(e,t){return new KE({type:"nonoptional",innerType:e,...je(t)})}const c8=pe("ZodCatch",(e,t)=>{k6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Wz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function u8(e,t){return new c8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const YE=pe("ZodPipe",(e,t)=>{_E.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Kz(e,n,a,s),e.in=t.in,e.out=t.out});function iw(e,t){return new YE({type:"pipe",in:e,out:t})}const d8=pe("ZodPreprocess",(e,t)=>{YE.init(e,t),w6.init(e,t)}),p8=pe("ZodReadonly",(e,t)=>{M6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Yz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function m8(e){return new p8({type:"readonly",innerType:e})}const f8=pe("ZodLazy",(e,t)=>{C6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Xz(e,n,a,s),e.unwrap=()=>e._zod.def.getter()});function au(e){return new f8({type:"lazy",getter:e})}const mb=pe("ZodCustom",(e,t)=>{A6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zz(e,n)});function ei(e,t){return Sz(mb,(()=>!0),t)}function h8(e,t={}){return xz(mb,e,t)}function g8(e,t){return kz(e,t)}function $t(e,t={}){const n=new mb({type:"custom",check:"custom",fn:a=>a instanceof e,abort:!0,...je(t)});return n._zod.bag.Class=e,n._zod.check=a=>{a.value instanceof e||a.issues.push({code:"invalid_type",expected:e.name,input:a.value,inst:n,path:[...n._zod.def.path??[]]})},n}function v8(e,t){return new d8({type:"pipe",in:ZE(e),out:t})}const fb={custom:"custom"};var y8=["f32le","pcmu","pcma"];function b8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=~t&255,a=(n&128)!==0?-1:1,s=n>>4&7;e[t]=a*((8*(n&15)+132<<s)-132)/32768}return e}function S8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=t^85,a=(n&128)!==0?1:-1,s=n>>4&7,p=n&15;e[t]=a*(s===0?16*p+8:16*p+264<<s-1)/32768}return e}b8();S8();var x8=[{id:"overview",label:"Overview",icon:"layout-dashboard",order:-10},{id:"general",label:"General",icon:"settings",order:0},{id:"image",label:"Image",icon:"image",order:5},{id:"light",label:"Light",icon:"lightbulb",order:7},{id:"motion",label:"Motion",icon:"activity",order:10},{id:"audio",label:"Audio",icon:"mic",order:12},{id:"alarms",label:"Alarms",icon:"bell-ring",order:13},{id:"snapshot",label:"Snapshot",icon:"camera",order:15},{id:"osd",label:"OSD",icon:"type",order:18},{id:"stream-broker",label:"Stream Broker",icon:"radio",order:20},{id:"streaming",label:"Streaming",icon:"video",order:35},{id:"ptz",label:"PTZ",icon:"move",order:40},{id:"navigation",label:"Navigation",icon:"compass",order:41},{id:"consumables",label:"Consumables",icon:"recycle",order:44},{id:"pipeline",label:"Detection Pipeline",icon:"cpu",order:39},{id:"detection-pipeline",label:"Detection pipeline",icon:"cpu",order:39},{id:"zones",label:"Detection",icon:"shapes",order:38},{id:"analytics",label:"Analytics",icon:"activity",order:37},{id:"live-stats",label:"Live Stats",icon:"activity",order:39},{id:"recording",label:"Recording",icon:"circle-dot",order:40},{id:"engine",label:"Inference Engine",icon:"zap",order:41},{id:"scheduler",label:"Scheduler",icon:"list-checks",order:42},{id:"decoder",label:"Decoder",icon:"film",order:43},{id:"notifications",label:"Notifications",icon:"bell",order:50},{id:"network",label:"Network",icon:"globe",order:60},{id:"storage",label:"Storage",icon:"hard-drive",order:70},{id:"advanced",label:"Advanced",icon:"wrench",order:100}];Object.fromEntries(x8.map(e=>[e.id,e]));var on=N(["high","mid","low"]),hb=N(["pull-rtsp","pull-rtmp","pull-http","pull-flv","pull-rfc4571","push-annexb","derived"]),dl=d({width:l().int().positive(),height:l().int().positive()}),Iv=d({camStreamId:o().min(1),deviceId:l().int().nonnegative(),kind:hb,url:o().optional(),codec:o().optional(),resolution:dl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:on.optional(),metadata:Y(o(),X()).optional()}),op=N(["unassigned","idle","connecting","streaming","error"]),Tv=d({deviceId:l().int().nonnegative(),profile:on,brokerId:o(),sourceCamStreamId:o().nullable(),status:op,resolution:dl.optional(),codec:o().optional(),preBufferSec:l().nonnegative().optional(),errorMessage:o().optional()}),k8=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).readonly().optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:on.optional()});d({type:o(),url:o(),videoCodec:o().optional(),audioCodec:o().optional(),metadata:Y(o(),X()).readonly().optional()});var w8=d({type:N(["video","audio"]),data:$t(Uint8Array),pts:l(),dts:l(),keyframe:A(),codec:o()}),rw=d({data:$t(Uint8Array),width:l(),height:l(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:l()}),Vi=d({shmId:o(),slot:l().int().nonnegative(),seq:l().int().nonnegative(),width:l().int().positive(),height:l().int().positive(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),pts:l(),byteLength:l().int().nonnegative(),nodeId:o(),slotCount:l().int().positive()}),M8=N(["rgb","bgr","yuv420","gray"]),C8=d({brokerId:o(),format:M8,maxFps:l().positive().optional(),tag:o().optional()}),A8=d({subscriptionId:o(),maxFps:l().nonnegative()}),XE=N(y8),E8=d({data:$t(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),timestamp:l(),format:XE.optional()}),R8=d({brokerId:o(),tag:o().optional(),accept:w(XE).readonly().optional()}),I8=d({subscriptionId:o()}),T8=N(["idle","connecting","streaming","error","stopped"]),_8=d({status:T8,inputFps:l(),decodeFps:l(),encodedSubscribers:l(),decodedSubscribers:l(),uptimeMs:l(),bitrateKbps:l(),idrIntervalMs:l(),codec:o().optional(),totalBytes:l(),packetCount:l(),rtspClients:l(),pipeClients:l(),preBufferSec:l(),preBufferMs:l(),preBufferPackets:l(),decoderNodeId:o().nullable(),audio:d({codec:o(),sampleRate:l(),channels:l(),supported:A()}).nullable().optional(),audioMuted:A().optional(),audioMutedDropped:l().optional()}),N8=d({profile:on,brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:dl.optional()}),O8=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:Ye([Q(1),Q(2),Q(3),Q(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(QE())}),P8=d({id:o(),label:o(),icon:o(),order:l().optional()});d({tabs:w(P8).optional(),sections:w(O8)}).nullable();d({deviceId:l()}),d({deviceId:l()}),d({deviceId:l(),patch:Y(o(),X())}),d({success:Q(!0)});d({deviceId:l()}),X().nullable();function y(e,t,n){return{input:e,output:t,kind:n?.kind??"query",...n?.auth!==void 0?{auth:n.auth}:{},...n?.access!==void 0?{access:n.access}:{},...n?.caller!==void 0?{caller:n.caller}:{},timeoutMs:n?.timeoutMs}}function Gh(e,t,n){return{...y(e,t,n),systemOnly:!0}}function Ao(e){return{data:e}}var j8=d({staticDir:o()}),D8=d({version:o()}),z8={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:y(O(),j8,{auth:"admin"}),getVersion:y(O(),D8,{auth:"admin"})}},H=(function(e){return e.Camera="camera",e.Hub="hub",e.Light="light",e.Siren="siren",e.Switch="switch",e.Sensor="sensor",e.Thermostat="thermostat",e.Climate="climate",e.Button="button",e.EventEmitter="event-emitter",e.Update="update",e.Generic="generic",e.Notifier="notifier",e.Script="script",e.Automation="automation",e.Lock="lock",e.Cover="cover",e.Valve="valve",e.Humidifier="humidifier",e.WaterHeater="water-heater",e.Fan="fan",e.MediaPlayer="media-player",e.AlarmPanel="alarm-panel",e.Control="control",e.Presence="presence",e.Weather="weather",e.Vacuum="vacuum",e.LawnMower="lawn-mower",e.Container="container",e.Image="image",e.PetFeeder="pet-feeder",e})({}),da=(function(e){return e.BatteryOperated="battery-operated",e.Rebootable="rebootable",e.Resyncable="resyncable",e.NativeSnapshot="native-snapshot",e.DoorbellButton="doorbell-button",e.TwoWayAudio="two-way-audio",e.PanTiltZoom="pan-tilt-zoom",e.PtzAutotrack="ptz-autotrack",e.MotionTrigger="motion-trigger",e.LightColorRgb="light-color-rgb",e.LightColorHsv="light-color-hsv",e.LightColorMired="light-color-mired",e.ClimateDualSetpoint="climate-dual-setpoint",e.ClimateHumidity="climate-humidity",e.ClimateFanMode="climate-fan-mode",e.ClimatePreset="climate-preset",e.ClimateSwingVertical="climate-swing-vertical",e.ClimateSwingHorizontal="climate-swing-horizontal",e.CoverPositionable="cover-positionable",e.CoverTilt="cover-tilt",e.ValvePositionable="valve-positionable",e.FanSpeed="fan-speed",e.FanPreset="fan-preset",e.FanDirection="fan-direction",e.FanOscillating="fan-oscillating",e.LockPinRequired="lock-pin-required",e.LockOpen="lock-open",e.MediaPlayerSeek="media-player-seek",e.MediaPlayerVolume="media-player-volume",e.MediaPlayerMute="media-player-mute",e.MediaPlayerShuffle="media-player-shuffle",e.MediaPlayerRepeat="media-player-repeat",e.MediaPlayerSelectSource="media-player-select-source",e.MediaPlayerPlayMedia="media-player-play-media",e.MediaPlayerNext="media-player-next",e.MediaPlayerPrevious="media-player-previous",e.MediaPlayerStop="media-player-stop",e.AlarmPinRequired="alarm-pin-required",e.PresenceGps="presence-gps",e.NotifierImage="notifier-image",e.NotifierPriority="notifier-priority",e.NotifierData="notifier-data",e.NotifierActions="notifier-actions",e.NotifierRecipients="notifier-recipients",e.ScriptVariables="script-variables",e.AutomationSkipCondition="automation-skip-condition",e.VacuumHasMap="vacuum-has-map",e.VacuumHasAi="vacuum-has-ai",e.MowerHasMap="mower-has-map",e.MowerHasTargetedMowing="mower-has-targeted-mowing",e})({}),Fe=(function(e){return e.Siren="siren",e.Floodlight="floodlight",e.Spotlight="spotlight",e.PirSensor="pir-sensor",e.Chime="chime",e.Autotrack="autotrack",e.Nightvision="nightvision",e.PrivacyMask="privacy-mask",e.Doorbell="doorbell",e.BinaryHelper="binary-helper",e.MotionSensor="motion-sensor",e.ContactSensor="contact-sensor",e.LeakSensor="leak-sensor",e.SmokeSensor="smoke-sensor",e.COSensor="co-sensor",e.GasSensor="gas-sensor",e.TamperSensor="tamper-sensor",e.VibrationSensor="vibration-sensor",e.ConnectivitySensor="connectivity-sensor",e.SoundSensor="sound-sensor",e.BinarySensor="binary-sensor",e.TemperatureSensor="temperature-sensor",e.HumiditySensor="humidity-sensor",e.AmbientLightSensor="ambient-light-sensor",e.PressureSensor="pressure-sensor",e.WindSensor="wind-sensor",e.RainSensor="rain-sensor",e.UvSensor="uv-sensor",e.SolarRadiationSensor="solar-radiation-sensor",e.SoilMoistureSensor="soil-moisture-sensor",e.PowerSensor="power-sensor",e.EnergySensor="energy-sensor",e.VoltageSensor="voltage-sensor",e.CurrentSensor="current-sensor",e.AirQualitySensor="air-quality-sensor",e.BatterySensor="battery-sensor",e.NumericSensor="numeric-sensor",e.EnumSensor="enum-sensor",e.DateTimeSensor="datetime-sensor",e.GenericSensor="generic-sensor",e.NumericControl="numeric-control",e.SelectControl="select-control",e.TextControl="text-control",e.DateTimeControl="datetime-control",e.MobilePushNotifier="mobile-push-notifier",e.MessagingNotifier="messaging-notifier",e.EmailNotifier="email-notifier",e.GenericNotifier="generic-notifier",e})({}),L8=d({staticDir:o()}),q8=d({version:o()}),B8={name:"viewer-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:y(O(),L8,{auth:"admin"}),getVersion:y(O(),q8,{auth:"admin"})}},U8=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:on.optional(),sdp:o().optional()}),F8=d({key:o(),value:X()}),H8=d({source:o(),data:Y(o(),X())}),$8={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:y(d({deviceId:l()}),w(U8)),getConfigEntries:y(d({deviceId:l()}),w(F8)),setConfig:y(d({deviceId:l(),values:Y(o(),X())}),O(),{kind:"mutation"}),runAction:y(d({deviceId:l(),action:o().min(1),input:X()}),X(),{kind:"mutation"}),removeDevice:y(d({deviceId:l()}),O(),{kind:"mutation"}),getSettingsSchema:y(d({deviceId:l()}),X().nullable()),getRawState:y(d({deviceId:l()}),H8.nullable(),{auth:"protected"})}},Q8="device.state-changed";function JE(e){const t=new Map,n=new Map;let a=null;const s=(m,h)=>`${m}:${h}`,p=()=>{a||e.live?.onEvent&&(a=e.live.onEvent.subscribe({category:Q8},{onData:m=>{const h=m.data;if(!h||typeof h.deviceId!="number"||typeof h.capName!="string")return;const c=s(h.deviceId,h.capName);t.set(c,h.slice);const x=n.get(c);if(x)for(const M of x)try{M(h.slice)}catch{}}}))},f=()=>{a&&(n.size>0||(a.unsubscribe(),a=null))};return{read(m,h){return t.get(s(m,h))},async refresh(m,h){const c=await e.deviceState.getCapSlice.query({deviceId:m,capName:h}),x=s(m,h);t.set(x,c??void 0);const M=n.get(x);if(M)for(const C of M)try{C(c??void 0)}catch{}},watch(m,h,c){const x=s(m,h);let M=n.get(x);return M||(M=new Set,n.set(x,M)),M.add(c),p(),()=>{M.delete(c),M.size===0&&n.delete(x),f()}},async write(m,h,c){await e.deviceState.setCapSlice.mutate({deviceId:m,capName:h,slice:c})}}}function V8(e,t,n){const a=(s,p)=>`${s}:${p}`;return{read(s,p){return e.get(s)?.get(p)},async refresh(){},watch(s,p,f){const m=a(s,p);let h=t.get(m);return h||(h=new Set,t.set(m,h)),h.add(f),()=>{h.delete(f),h.size===0&&t.delete(m)}},async write(s,p,f){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:s,capName:p,slice:f})}}}function Ne(e,t,n){const a=G8(e)?e:JE(e);return{get value(){return a.read(t,n)},refresh(){return a.refresh(t,n)},subscribe(s){const p=a.watch(t,n,f=>{try{s(f)}catch{}});try{s(a.read(t,n))}catch{}return a.read(t,n)===void 0&&a.refresh(t,n).catch(()=>{}),p},async set(s){await a.write(t,n,s)},async patch(s){const p={...a.read(t,n),...s};await a.write(t,n,p)}}}function G8(e){return typeof e.read=="function"&&typeof e.watch=="function"}function eR(e,t,n){const a=e,s=n?.stateSource??JE(e);function p(c,x){const M=typeof c=="object"&&c!==null?c:{};return x!==void 0?{...M,deviceId:t.deviceId,nodeId:x}:{...M,deviceId:t.deviceId}}function f(c,x,M,C,E){const R=a[c]?.[x];if(!R)throw new Error(`DeviceProxy: api has no '${c}.${x}'`);const _=R;return M==="mutation"?_.mutate(C):M==="subscription"?_.subscribe(C,E):_.query(C)}function m(c,x,M,C,E,R){return f(x,M,C,p(E,t.entries.find(_=>_.capName===c)?.providerNodeId),R)}function h(c,x,M,C,E){return f(c,x,M,p(C,void 0),E)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:Ne(s,t.deviceId,"air-quality-sensor"),alarmPanel:Ne(s,t.deviceId,"alarm-panel"),ambientLightSensor:Ne(s,t.deviceId,"ambient-light-sensor"),audioMetrics:Ne(s,t.deviceId,"audio-metrics"),automationControl:Ne(s,t.deviceId,"automation-control"),battery:Ne(s,t.deviceId,"battery"),binary:Ne(s,t.deviceId,"binary"),brightness:Ne(s,t.deviceId,"brightness"),cameraStreams:Ne(s,t.deviceId,"camera-streams"),carbonMonoxide:Ne(s,t.deviceId,"carbon-monoxide"),climateControl:Ne(s,t.deviceId,"climate-control"),color:Ne(s,t.deviceId,"color"),connectivity:Ne(s,t.deviceId,"connectivity"),consumables:Ne(s,t.deviceId,"consumables"),contact:Ne(s,t.deviceId,"contact"),control:Ne(s,t.deviceId,"control"),cover:Ne(s,t.deviceId,"cover"),dayNight:Ne(s,t.deviceId,"day-night"),deviceDiscovery:Ne(s,t.deviceId,"device-discovery"),deviceStatus:Ne(s,t.deviceId,"device-status"),doorbell:Ne(s,t.deviceId,"doorbell"),enumSensor:Ne(s,t.deviceId,"enum-sensor"),eventEmitter:Ne(s,t.deviceId,"event-emitter"),fanControl:Ne(s,t.deviceId,"fan-control"),featureProbe:Ne(s,t.deviceId,"feature-probe"),flood:Ne(s,t.deviceId,"flood"),gas:Ne(s,t.deviceId,"gas"),humidifier:Ne(s,t.deviceId,"humidifier"),humiditySensor:Ne(s,t.deviceId,"humidity-sensor"),image:Ne(s,t.deviceId,"image"),imageSettings:Ne(s,t.deviceId,"image-settings"),intercom:Ne(s,t.deviceId,"intercom"),lawnMowerControl:Ne(s,t.deviceId,"lawn-mower-control"),lockControl:Ne(s,t.deviceId,"lock-control"),mediaPlayer:Ne(s,t.deviceId,"media-player"),motion:Ne(s,t.deviceId,"motion"),motionTrigger:Ne(s,t.deviceId,"motion-trigger"),motionZones:Ne(s,t.deviceId,"motion-zones"),nativeObjectDetection:Ne(s,t.deviceId,"native-object-detection"),navigation:Ne(s,t.deviceId,"navigation"),networkLink:Ne(s,t.deviceId,"network-link"),notifier:Ne(s,t.deviceId,"notifier"),numericSensor:Ne(s,t.deviceId,"numeric-sensor"),petFeeder:Ne(s,t.deviceId,"pet-feeder"),powerMeter:Ne(s,t.deviceId,"power-meter"),presence:Ne(s,t.deviceId,"presence"),pressureSensor:Ne(s,t.deviceId,"pressure-sensor"),privacyMask:Ne(s,t.deviceId,"privacy-mask"),ptzAutotrack:Ne(s,t.deviceId,"ptz-autotrack"),recordingSignal:Ne(s,t.deviceId,"recording-signal"),sceneMonitor:Ne(s,t.deviceId,"scene-monitor"),scriptRunner:Ne(s,t.deviceId,"script-runner"),smoke:Ne(s,t.deviceId,"smoke"),streamCatalog:Ne(s,t.deviceId,"stream-catalog"),streamParams:Ne(s,t.deviceId,"stream-params"),streamSignals:Ne(s,t.deviceId,"stream-signals"),switch:Ne(s,t.deviceId,"switch"),tamper:Ne(s,t.deviceId,"tamper"),temperatureSensor:Ne(s,t.deviceId,"temperature-sensor"),update:Ne(s,t.deviceId,"update"),vacuumControl:Ne(s,t.deviceId,"vacuum-control"),valve:Ne(s,t.deviceId,"valve"),vibration:Ne(s,t.deviceId,"vibration"),waterHeater:Ne(s,t.deviceId,"water-heater"),weather:Ne(s,t.deviceId,"weather"),zoneAnalytics:Ne(s,t.deviceId,"zone-analytics"),zoneRules:Ne(s,t.deviceId,"zone-rules"),zones:Ne(s,t.deviceId,"zones")},accessories:{setChildHidden:c=>m("accessories","accessories","setChildHidden","mutation",c),getStatus:c=>m("accessories","accessories","getStatus","query",c)},airQualitySensor:{getStatus:c=>m("air-quality-sensor","airQualitySensor","getStatus","query",c)},alarmPanel:{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)},ambientLightSensor:{getStatus:c=>m("ambient-light-sensor","ambientLightSensor","getStatus","query",c)},audioAnalysis:{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)},audioMetrics:{getCurrentSnapshot:c=>m("audio-metrics","audioMetrics","getCurrentSnapshot","query",c),getHistory:c=>m("audio-metrics","audioMetrics","getHistory","query",c)},automationControl:{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)},battery:{wakeForStream:c=>m("battery","battery","wakeForStream","mutation",c),getStatus:c=>m("battery","battery","getStatus","query",c)},binary:{getStatus:c=>m("binary","binary","getStatus","query",c)},brightness:{setBrightness:c=>m("brightness","brightness","setBrightness","mutation",c),getStatus:c=>m("brightness","brightness","getStatus","query",c)},button:{press:c=>m("button","button","press","mutation",c)},cameraCredentials:{getCredentials:c=>m("camera-credentials","cameraCredentials","getCredentials","query",c),getStatus:c=>m("camera-credentials","cameraCredentials","getStatus","query",c)},cameraStreams:{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)},carbonMonoxide:{getStatus:c=>m("carbon-monoxide","carbonMonoxide","getStatus","query",c)},climateControl:{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),setSwingVertical:c=>m("climate-control","climateControl","setSwingVertical","mutation",c),setSwingHorizontal:c=>m("climate-control","climateControl","setSwingHorizontal","mutation",c),getStatus:c=>m("climate-control","climateControl","getStatus","query",c)},color:{setColor:c=>m("color","color","setColor","mutation",c),getStatus:c=>m("color","color","getStatus","query",c)},connectivity:{getStatus:c=>m("connectivity","connectivity","getStatus","query",c)},consumables:{reset:c=>m("consumables","consumables","reset","mutation",c),getStatus:c=>m("consumables","consumables","getStatus","query",c)},contact:{getStatus:c=>m("contact","contact","getStatus","query",c)},control:{setValue:c=>m("control","control","setValue","mutation",c),getStatus:c=>m("control","control","getStatus","query",c)},cover:{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)},dayNight:{getOptions:c=>m("day-night","dayNight","getOptions","query",c),setSettings:c=>m("day-night","dayNight","setSettings","mutation",c),getStatus:c=>m("day-night","dayNight","getStatus","query",c)},detectionPipeline:{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)},deviceDiscovery:{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)},deviceOps:{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)},deviceStatus:{getStatus:c=>m("device-status","deviceStatus","getStatus","query",c)},doorbell:{getStatus:c=>m("doorbell","doorbell","getStatus","query",c),getDeviceSettingsContribution:c=>m("doorbell","doorbell","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("doorbell","doorbell","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("doorbell","doorbell","applyDeviceSettingsPatch","mutation",c)},enumSensor:{getStatus:c=>m("enum-sensor","enumSensor","getStatus","query",c)},eventEmitter:{getStatus:c=>m("event-emitter","eventEmitter","getStatus","query",c)},events:{getEvents:c=>m("events","events","getEvents","query",c),getEventThumbnail:c=>m("events","events","getEventThumbnail","query",c),getEventClipUrl:c=>m("events","events","getEventClipUrl","query",c)},fanControl:{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)},featureProbe:{getStatus:c=>m("feature-probe","featureProbe","getStatus","query",c)},flood:{getStatus:c=>m("flood","flood","getStatus","query",c)},gas:{getStatus:c=>m("gas","gas","getStatus","query",c)},humidifier:{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)},humiditySensor:{getStatus:c=>m("humidity-sensor","humiditySensor","getStatus","query",c)},image:{getStatus:c=>m("image","image","getStatus","query",c)},imageSettings:{getOptions:c=>m("image-settings","imageSettings","getOptions","query",c),setSettings:c=>m("image-settings","imageSettings","setSettings","mutation",c),getStatus:c=>m("image-settings","imageSettings","getStatus","query",c)},intercom:{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)},lawnMowerControl:{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)},lockControl:{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)},mediaPlayer:{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)},motion:{isDetected:c=>m("motion","motion","isDetected","query",c),getStatus:c=>m("motion","motion","getStatus","query",c)},motionDetection:{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)},motionTrigger:{setMotionTrigger:c=>m("motion-trigger","motionTrigger","setMotionTrigger","mutation",c),getStatus:c=>m("motion-trigger","motionTrigger","getStatus","query",c)},motionZones:{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)},nativeObjectDetection:{getOptions:c=>m("native-object-detection","nativeObjectDetection","getOptions","query",c),setSettings:c=>m("native-object-detection","nativeObjectDetection","setSettings","mutation",c),setEnabled:c=>m("native-object-detection","nativeObjectDetection","setEnabled","mutation",c),getStatus:c=>m("native-object-detection","nativeObjectDetection","getStatus","query",c)},navigation:{move:c=>m("navigation","navigation","move","mutation",c),stop:c=>m("navigation","navigation","stop","mutation",c),goToPoint:c=>m("navigation","navigation","goToPoint","mutation",c),listActions:c=>m("navigation","navigation","listActions","query",c),runAction:c=>m("navigation","navigation","runAction","mutation",c),playSound:c=>m("navigation","navigation","playSound","mutation",c),setLightOn:c=>m("navigation","navigation","setLightOn","mutation",c),setLightMode:c=>m("navigation","navigation","setLightMode","mutation",c),setLightLevel:c=>m("navigation","navigation","setLightLevel","mutation",c),getFeatures:c=>m("navigation","navigation","getFeatures","query",c),getStatus:c=>m("navigation","navigation","getStatus","query",c)},networkLink:{getStatus:c=>m("network-link","networkLink","getStatus","query",c)},notificationRules:{listRules:c=>m("notification-rules","notificationRules","listRules","query",c),getRule:c=>m("notification-rules","notificationRules","getRule","query",c),createRule:c=>m("notification-rules","notificationRules","createRule","mutation",c),updateRule:c=>m("notification-rules","notificationRules","updateRule","mutation",c),deleteRule:c=>m("notification-rules","notificationRules","deleteRule","mutation",c),setRuleEnabled:c=>m("notification-rules","notificationRules","setRuleEnabled","mutation",c),getClipRetentionAsks:c=>m("notification-rules","notificationRules","getClipRetentionAsks","query",c),listDeviceMutes:c=>m("notification-rules","notificationRules","listDeviceMutes","query",c),setDeviceMuted:c=>m("notification-rules","notificationRules","setDeviceMuted","mutation",c),testRule:c=>m("notification-rules","notificationRules","testRule","mutation",c),getConditionCatalog:c=>m("notification-rules","notificationRules","getConditionCatalog","query",c),getHistory:c=>m("notification-rules","notificationRules","getHistory","query",c),resolveArtifactUrl:c=>m("notification-rules","notificationRules","resolveArtifactUrl","query",c),listSnoozes:c=>m("notification-rules","notificationRules","listSnoozes","query",c),createSnooze:c=>m("notification-rules","notificationRules","createSnooze","mutation",c),cancelSnooze:c=>m("notification-rules","notificationRules","cancelSnooze","mutation",c),getAlarmConfig:c=>m("notification-rules","notificationRules","getAlarmConfig","query",c),setAlarmConfig:c=>m("notification-rules","notificationRules","setAlarmConfig","mutation",c)},notifier:{send:c=>m("notifier","notifier","send","mutation",c),cancel:c=>m("notifier","notifier","cancel","mutation",c),getStatus:c=>m("notifier","notifier","getStatus","query",c)},numericSensor:{getStatus:c=>m("numeric-sensor","numericSensor","getStatus","query",c)},osd:{setOverlay:c=>m("osd","osd","setOverlay","mutation",c),getStatus:c=>m("osd","osd","getStatus","query",c)},petFeeder:{feed:c=>m("pet-feeder","petFeeder","feed","mutation",c),cancelFeed:c=>m("pet-feeder","petFeeder","cancelFeed","mutation",c),resetDesiccant:c=>m("pet-feeder","petFeeder","resetDesiccant","mutation",c),markFoodReplenished:c=>m("pet-feeder","petFeeder","markFoodReplenished","mutation",c),callPet:c=>m("pet-feeder","petFeeder","callPet","mutation",c),playSound:c=>m("pet-feeder","petFeeder","playSound","mutation",c),setChildLock:c=>m("pet-feeder","petFeeder","setChildLock","mutation",c),setIndicatorLight:c=>m("pet-feeder","petFeeder","setIndicatorLight","mutation",c),setFeedSound:c=>m("pet-feeder","petFeeder","setFeedSound","mutation",c),setVolume:c=>m("pet-feeder","petFeeder","setVolume","mutation",c),getStatus:c=>m("pet-feeder","petFeeder","getStatus","query",c)},pipelineAnalytics:{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),listRecentTracks:c=>m("pipeline-analytics","pipelineAnalytics","listRecentTracks","query",c),listSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listSummaries","query",c),listRecentSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listRecentSummaries","query",c),getSummary:c=>m("pipeline-analytics","pipelineAnalytics","getSummary","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),listEventKinds:c=>m("pipeline-analytics","pipelineAnalytics","listEventKinds","query",c),listEventKindsBatch:c=>m("pipeline-analytics","pipelineAnalytics","listEventKindsBatch","query",c),getSensorEvents:c=>m("pipeline-analytics","pipelineAnalytics","getSensorEvents","query",c),getKeyEvents:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEvents","query",c),getKeyEventsBatch:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEventsBatch","query",c),readLongTermSeries:c=>m("pipeline-analytics","pipelineAnalytics","readLongTermSeries","query",c),getEventDensity:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensity","query",c),getEventDensityBatch:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensityBatch","query",c),pruneEventsBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",c),pruneTracksBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneTracksBefore","mutation",c),wipeAllAnalytics:c=>m("pipeline-analytics","pipelineAnalytics","wipeAllAnalytics","mutation",c),reconcileFromDisk:c=>m("pipeline-analytics","pipelineAnalytics","reconcileFromDisk","mutation",c),deleteTracks:c=>m("pipeline-analytics","pipelineAnalytics","deleteTracks","mutation",c),setTrackFlags:c=>m("pipeline-analytics","pipelineAnalytics","setTrackFlags","mutation",c),listArchivedDebugNotes:c=>m("pipeline-analytics","pipelineAnalytics","listArchivedDebugNotes","query",c),listBirthDecisions:c=>m("pipeline-analytics","pipelineAnalytics","listBirthDecisions","query",c),getEventStoreFootprint:c=>m("pipeline-analytics","pipelineAnalytics","getEventStoreFootprint","query",c),getEventMediaFootprintByKind:c=>m("pipeline-analytics","pipelineAnalytics","getEventMediaFootprintByKind","query",c),pruneEvents:c=>m("pipeline-analytics","pipelineAnalytics","pruneEvents","mutation",c),deleteDeviceEvents:c=>m("pipeline-analytics","pipelineAnalytics","deleteDeviceEvents","mutation",c),pauseForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","pauseForStorageMigration","mutation",c),resumeForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","resumeForStorageMigration","mutation",c),refreshStorageLocationsForMigration:c=>m("pipeline-analytics","pipelineAnalytics","refreshStorageLocationsForMigration","mutation",c),startStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","startStorageMigrationMove","mutation",c),getStorageMigrationMoveStatus:c=>m("pipeline-analytics","pipelineAnalytics","getStorageMigrationMoveStatus","query",c),cancelStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","cancelStorageMigrationMove","mutation",c),relocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","relocateMedia","mutation",c),countUnstampedEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","countUnstampedEventMedia","query",c),countRelocatableMedia:c=>m("pipeline-analytics","pipelineAnalytics","countRelocatableMedia","query",c),listRelocateMediaJobs:c=>m("pipeline-analytics","pipelineAnalytics","listRelocateMediaJobs","query",c),cancelRelocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","cancelRelocateMedia","mutation",c),listOpsLog:c=>m("pipeline-analytics","pipelineAnalytics","listOpsLog","query",c),reclaimDebugMedia:c=>m("pipeline-analytics","pipelineAnalytics","reclaimDebugMedia","mutation",c),getMediaReclaimStatus:c=>m("pipeline-analytics","pipelineAnalytics","getMediaReclaimStatus","query",c),getTrainingExportSummary:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportSummary","query",c),getTrainingExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportUrl","query",c),listRetrainStaging:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainStaging","query",c),listRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainFrames","query",c),selectRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","selectRetrainFrames","mutation",c),deselectRetrainFrame:c=>m("pipeline-analytics","pipelineAnalytics","deselectRetrainFrame","mutation",c),getRetrainFrameImage:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainFrameImage","query",c),proposeRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","proposeRetrainAnnotations","mutation",c),runReplayFrameProcessor:c=>m("pipeline-analytics","pipelineAnalytics","runReplayFrameProcessor","mutation",c),listRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainAnnotations","query",c),saveRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","saveRetrainAnnotations","mutation",c),completeRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","completeRetrainTrack","mutation",c),restageRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","restageRetrainTrack","mutation",c),getRetrainExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainExportUrl","query",c),getEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","getEventMedia","query",c),getTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",c),listTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","listTrackMedia","query",c),listEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","listEventMedia","query",c),searchObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","searchObjectEvents","query",c),wipeObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","wipeObjectEmbeddings","mutation",c),rebuildObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","rebuildObjectEmbeddings","mutation",c),getObjectEmbeddingRebuildStatus:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEmbeddingRebuildStatus","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)},powerMeter:{getStatus:c=>m("power-meter","powerMeter","getStatus","query",c)},presence:{getStatus:c=>m("presence","presence","getStatus","query",c)},pressureSensor:{getStatus:c=>m("pressure-sensor","pressureSensor","getStatus","query",c)},privacyMask:{getOptions:c=>m("privacy-mask","privacyMask","getOptions","query",c),setMask:c=>m("privacy-mask","privacyMask","setMask","mutation",c),setAudioEnabled:c=>m("privacy-mask","privacyMask","setAudioEnabled","mutation",c),getStatus:c=>m("privacy-mask","privacyMask","getStatus","query",c)},ptz:{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)},ptzAutotrack:{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)},reboot:{reboot:c=>m("reboot","reboot","reboot","mutation",c)},recordingSignal:{getStatus:c=>m("recording-signal","recordingSignal","getStatus","query",c)},sceneMonitor:{listScenes:c=>m("scene-monitor","sceneMonitor","listScenes","query",c),listScenesBatch:c=>m("scene-monitor","sceneMonitor","listScenesBatch","query",c),createScene:c=>m("scene-monitor","sceneMonitor","createScene","mutation",c),updateScene:c=>m("scene-monitor","sceneMonitor","updateScene","mutation",c),deleteScene:c=>m("scene-monitor","sceneMonitor","deleteScene","mutation",c),captureReference:c=>m("scene-monitor","sceneMonitor","captureReference","mutation",c),deleteReference:c=>m("scene-monitor","sceneMonitor","deleteReference","mutation",c),recheckNow:c=>m("scene-monitor","sceneMonitor","recheckNow","mutation",c),resetScene:c=>m("scene-monitor","sceneMonitor","resetScene","mutation",c),getStatus:c=>m("scene-monitor","sceneMonitor","getStatus","query",c)},scriptRunner:{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)},smoke:{getStatus:c=>m("smoke","smoke","getStatus","query",c)},snapshot:{getSnapshot:c=>m("snapshot","snapshot","getSnapshot","query",c),invalidateCache:c=>m("snapshot","snapshot","invalidateCache","mutation",c),getSnapshotOverview:c=>m("snapshot","snapshot","getSnapshotOverview","query",c),getDebugState:c=>m("snapshot","snapshot","getDebugState","query",c),getSnapshotLinks:c=>m("snapshot","snapshot","getSnapshotLinks","query",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)},streamCatalog:{getCatalog:c=>m("stream-catalog","streamCatalog","getCatalog","query",c)},streamParams:{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)},streamSignals:{listSignals:c=>m("stream-signals","streamSignals","listSignals","query",c)},switch:{setState:c=>m("switch","switch","setState","mutation",c),getStatus:c=>m("switch","switch","getStatus","query",c)},tamper:{getStatus:c=>m("tamper","tamper","getStatus","query",c)},temperatureSensor:{getStatus:c=>m("temperature-sensor","temperatureSensor","getStatus","query",c)},update:{installUpdate:c=>m("update","update","installUpdate","mutation",c),getStatus:c=>m("update","update","getStatus","query",c)},vacuumControl:{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)},valve:{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)},vibration:{getStatus:c=>m("vibration","vibration","getStatus","query",c)},videoclips:{listClips:c=>m("videoclips","videoclips","listClips","query",c),getClipPlayback:c=>m("videoclips","videoclips","getClipPlayback","query",c)},waterHeater:{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)},weather:{getStatus:c=>m("weather","weather","getStatus","query",c)},webrtcSession:{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)},zoneAnalytics:{getCurrentSnapshot:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",c),getCurrentSnapshotBatch:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshotBatch","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)},zoneRules:{listRules:c=>m("zone-rules","zoneRules","listRules","query",c),setRules:c=>m("zone-rules","zoneRules","setRules","mutation",c)},zones:{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)},addonSettings:{getDeviceSettings:c=>h("addonSettings","getDeviceSettings","query",c),updateDeviceSettings:c=>h("addonSettings","updateDeviceSettings","mutation",c)},audioAnalyzer:{detachDevice:c=>h("audioAnalyzer","detachDevice","mutation",c)},cameraPipelineConfig:{getDeviceSettingsContribution:c=>h("cameraPipelineConfig","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("cameraPipelineConfig","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("cameraPipelineConfig","applyDeviceSettingsPatch","mutation",c)},deviceAdoption:{getStatus:c=>h("deviceAdoption","getStatus","query",c)},deviceExport:{getDeviceSettingsContribution:c=>h("deviceExport","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceExport","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceExport","applyDeviceSettingsPatch","mutation",c)},deviceManager:{loadConfig:c=>h("deviceManager","loadConfig","query",c),loadRuntimeState:c=>h("deviceManager","loadRuntimeState","query",c),loadMeta:c=>h("deviceManager","loadMeta","query",c),setName:c=>h("deviceManager","setName","mutation",c),setLocation:c=>h("deviceManager","setLocation","mutation",c),setType:c=>h("deviceManager","setType","mutation",c),setIntegrationId:c=>h("deviceManager","setIntegrationId","mutation",c),setLinkDeviceId:c=>h("deviceManager","setLinkDeviceId","mutation",c),setPrimaryChildEntityId:c=>h("deviceManager","setPrimaryChildEntityId","mutation",c),setChildLayout:c=>h("deviceManager","setChildLayout","mutation",c),setDisplay:c=>h("deviceManager","setDisplay","mutation",c),getWireableFields:c=>h("deviceManager","getWireableFields","query",c),setRole:c=>h("deviceManager","setRole","mutation",c),applyInitialMeta:c=>h("deviceManager","applyInitialMeta","mutation",c),setMetadata:c=>h("deviceManager","setMetadata","mutation",c),setDisabled:c=>h("deviceManager","setDisabled","mutation",c),getDevice:c=>h("deviceManager","getDevice","query",c),getLinkedDevices:c=>h("deviceManager","getLinkedDevices","query",c),getStreamSources:c=>h("deviceManager","getStreamSources","query",c),getConfigSchema:c=>h("deviceManager","getConfigSchema","query",c),getSettingsSchema:c=>h("deviceManager","getSettingsSchema","query",c),updateConfig:c=>h("deviceManager","updateConfig","mutation",c),enable:c=>h("deviceManager","enable","mutation",c),disable:c=>h("deviceManager","disable","mutation",c),remove:c=>h("deviceManager","remove","mutation",c),getStreamProfileMap:c=>h("deviceManager","getStreamProfileMap","query",c),setStreamProfileMap:c=>h("deviceManager","setStreamProfileMap","mutation",c),probeStreams:c=>h("deviceManager","probeStreams","mutation",c),getBindings:c=>h("deviceManager","getBindings","query",c),setWrapperActive:c=>h("deviceManager","setWrapperActive","mutation",c),getDeviceSettingsAggregate:c=>h("deviceManager","getDeviceSettingsAggregate","query",c),getDeviceLiveInfoAggregate:c=>h("deviceManager","getDeviceLiveInfoAggregate","query",c),getDeviceAggregate:c=>h("deviceManager","getDeviceAggregate","query",c),runDeviceAction:c=>h("deviceManager","runDeviceAction","mutation",c),updateDeviceField:c=>h("deviceManager","updateDeviceField","mutation",c),updateDeviceFieldsBatch:c=>h("deviceManager","updateDeviceFieldsBatch","mutation",c),testField:c=>h("deviceManager","testField","mutation",c),getDeviceStatusAggregate:c=>h("deviceManager","getDeviceStatusAggregate","query",c),getDeviceSettingsContribution:c=>h("deviceManager","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceManager","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceManager","applyDeviceSettingsPatch","mutation",c)},deviceProvider:{reloadDevice:c=>h("deviceProvider","reloadDevice","mutation",c)},deviceState:{getSnapshot:c=>h("deviceState","getSnapshot","query",c),getCapSlice:c=>h("deviceState","getCapSlice","query",c),setCapSlice:c=>h("deviceState","setCapSlice","mutation",c)},faceGallery:{listRecentFaces:c=>h("faceGallery","listRecentFaces","query",c),getFaceByTrack:c=>h("faceGallery","getFaceByTrack","query",c)},networkQuality:{getDeviceStats:c=>h("networkQuality","getDeviceStats","query",c),reportClientStats:c=>h("networkQuality","reportClientStats","mutation",c)},osdManager:{getDeviceOsd:c=>h("osdManager","getDeviceOsd","query",c),getSourceCatalog:c=>h("osdManager","getSourceCatalog","query",c),setSlotBinding:c=>h("osdManager","setSlotBinding","mutation",c),clearSlotBinding:c=>h("osdManager","clearSlotBinding","mutation",c),previewSlot:c=>h("osdManager","previewSlot","mutation",c),renderDevice:c=>h("osdManager","renderDevice","mutation",c)},pipelineExecutor:{runPipeline:c=>h("pipelineExecutor","runPipeline","mutation",c),runPipelineBatch:c=>h("pipelineExecutor","runPipelineBatch","mutation",c)},pipelineOrchestrator:{assignPipeline:c=>h("pipelineOrchestrator","assignPipeline","mutation",c),unassignPipeline:c=>h("pipelineOrchestrator","unassignPipeline","mutation",c),setPipelineDevicePin:c=>h("pipelineOrchestrator","setPipelineDevicePin","mutation",c),getPipelineDevicePin:c=>h("pipelineOrchestrator","getPipelineDevicePin","query",c),getPipelineAssignment:c=>h("pipelineOrchestrator","getPipelineAssignment","query",c),getCameraMetrics:c=>h("pipelineOrchestrator","getCameraMetrics","query",c),assignAudio:c=>h("pipelineOrchestrator","assignAudio","mutation",c),unassignAudio:c=>h("pipelineOrchestrator","unassignAudio","mutation",c),getAudioAssignment:c=>h("pipelineOrchestrator","getAudioAssignment","query",c),getAudioAssignments:c=>h("pipelineOrchestrator","getAudioAssignments","query",c),getCameraSettings:c=>h("pipelineOrchestrator","getCameraSettings","query",c),setCameraStepToggle:c=>h("pipelineOrchestrator","setCameraStepToggle","mutation",c),getCameraStepOverrides:c=>h("pipelineOrchestrator","getCameraStepOverrides","query",c),setCameraStepOverride:c=>h("pipelineOrchestrator","setCameraStepOverride","mutation",c),setCameraPipelineForAgent:c=>h("pipelineOrchestrator","setCameraPipelineForAgent","mutation",c),resolvePipeline:c=>h("pipelineOrchestrator","resolvePipeline","query",c),getCameraSwitches:c=>h("pipelineOrchestrator","getCameraSwitches","query",c),setCameraSwitch:c=>h("pipelineOrchestrator","setCameraSwitch","mutation",c),getCameraStatus:c=>h("pipelineOrchestrator","getCameraStatus","query",c),getDeviceSettingsContribution:c=>h("pipelineOrchestrator","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("pipelineOrchestrator","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",c)},pipelineRunner:{detachCamera:c=>h("pipelineRunner","detachCamera","mutation",c),getCameraMetrics:c=>h("pipelineRunner","getCameraMetrics","query",c),requestOccupancyBurst:c=>h("pipelineRunner","requestOccupancyBurst","mutation",c),runDetailSubtree:c=>h("pipelineRunner","runDetailSubtree","mutation",c),parkTrackFrame:c=>h("pipelineRunner","parkTrackFrame","mutation",c),getParkedTrackFrame:c=>h("pipelineRunner","getParkedTrackFrame","query",c),releaseParkedTrackFrames:c=>h("pipelineRunner","releaseParkedTrackFrames","mutation",c)},plateGallery:{listPlates:c=>h("plateGallery","listPlates","query",c),getPlateByTrack:c=>h("plateGallery","getPlateByTrack","query",c)},recording:{getAvailability:c=>h("recording","getAvailability","query",c),getDaysWithRecordings:c=>h("recording","getDaysWithRecordings","query",c),getPlaybackManifest:c=>h("recording","getPlaybackManifest","query",c),getDeviceConfig:c=>h("recording","getDeviceConfig","query",c),locateSegment:c=>h("recording","locateSegment","query",c),readSegmentBytes:c=>h("recording","readSegmentBytes","query",c),readGopBytes:c=>h("recording","readGopBytes","query",c),readWindowBytes:c=>h("recording","readWindowBytes","query",c),setDeviceConfig:c=>h("recording","setDeviceConfig","mutation",c),rescanStorage:c=>h("recording","rescanStorage","mutation",c),pruneFootage:c=>h("recording","pruneFootage","mutation",c),deleteFootprint:c=>h("recording","deleteFootprint","mutation",c),renderGif:c=>h("recording","renderGif","mutation",c),renderClip:c=>h("recording","renderClip","mutation",c),getStatus:c=>h("recording","getStatus","query",c),getDeviceSettingsContribution:c=>h("recording","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("recording","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("recording","applyDeviceSettingsPatch","mutation",c)},recordingExport:{listExports:c=>h("recordingExport","listExports","query",c)},streamBroker:{reportStreamSignal:c=>h("streamBroker","reportStreamSignal","mutation",c),publishCameraStream:c=>h("streamBroker","publishCameraStream","mutation",c),retractCameraStream:c=>h("streamBroker","retractCameraStream","mutation",c),assignProfile:c=>h("streamBroker","assignProfile","mutation",c),unassignProfile:c=>h("streamBroker","unassignProfile","mutation",c),forgetDeviceHardware:c=>h("streamBroker","forgetDeviceHardware","mutation",c),renderPreBufferClip:c=>h("streamBroker","renderPreBufferClip","mutation",c),produceEventMedia:c=>h("streamBroker","produceEventMedia","mutation",c),restartProfile:c=>h("streamBroker","restartProfile","mutation",c),getDeviceAudioMute:c=>h("streamBroker","getDeviceAudioMute","query",c),setDeviceAudioMute:c=>h("streamBroker","setDeviceAudioMute","mutation",c),getDeviceSettingsContribution:c=>h("streamBroker","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("streamBroker","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("streamBroker","applyDeviceSettingsPatch","mutation",c)}}}var Z8=["track","summary","face","identity","plate","vehicle","scene","motion","object","audio","mosaic"];new Set(Z8);var tR=["motion","object","audio"],ow=N(tR);new Set(tR);var W8=d({codec:N(["h264","h265","copy"]),profile:N(["baseline","main","high"]).optional(),level:o().optional(),width:l().int().positive().optional(),height:l().int().positive().optional(),fps:l().positive().optional(),bitrateKbps:l().int().positive().optional(),gopFrames:l().int().positive().optional(),bf:l().int().min(0).optional(),preset:N(["ultrafast","superfast","veryfast","faster","fast","medium"]).optional(),tune:N(["zerolatency","film","animation"]).optional(),singleSlicePerFrame:A().optional()}),K8=Ye([Q("passthrough"),d({codec:N(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:l().int().positive().optional(),sampleRateHz:l().int().positive().optional(),channels:Ye([Q(1),Q(2)]).optional()})]),nR=d({video:W8,audio:K8,inputArgs:w(o()).optional(),outputArgs:w(o()).optional()}),aR={video:{codec:"h264",profile:"baseline",level:"3.1",width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:"veryfast",tune:"zerolatency"}};({...aR.video});({...aR.video});var Y8=N(["singleton","device","widget"]),sw=d({capName:o(),kind:Y8,deviceId:l().optional(),reachable:A(),latencyMs:l(),error:o().optional()}),X8=d({addonId:o(),caps:w(sw).readonly(),widgets:w(sw).readonly()}),J8=d({nodeId:o(),addons:w(X8).readonly()});d({ok:A(),degraded:A(),checkedAt:o(),nodes:w(J8).readonly(),summary:d({total:l(),reachable:l(),unreachable:l()})});var eq=N(["running","done","failed","cancelled"]),tq=N(["adopted","already-adopted","failed","cancelled"]),nq=d({childNativeId:o(),outcome:tq,parentDeviceId:l().int().nonnegative().nullable(),accessoryCount:l().int().nonnegative(),error:o().nullable()}),aq=d({jobId:o(),addonId:o(),integrationId:o(),state:eq,total:l().int().nonnegative(),processed:l().int().nonnegative(),adopted:l().int().nonnegative(),alreadyAdopted:l().int().nonnegative(),failed:l().int().nonnegative(),accessoriesCreated:l().int().nonnegative(),currentChildNativeId:o().nullable(),results:w(nq).readonly(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),iu=N(["stream-broker","object-detection","privacy-mask","device-audio","broker-audio","audio-analysis","recording","notifications"]),iq=kt("kind",[d({kind:Q("device-disabled")}),d({kind:Q("wrapper-binding"),capName:o()}),d({kind:Q("recording-config")}),d({kind:Q("notification-mute")}),d({kind:Q("camera-audio"),capName:o()}),d({kind:Q("camera-mask"),capName:o()}),d({kind:Q("broker-audio-mute")})]),rq=N(["no-provider","source-unreachable","not-configured","device-disabled"]),oq=d({id:iu,label:o(),costWhenOff:o(),available:A(),unavailableReason:rq.optional(),enabled:A(),authority:iq}),lw=d({deviceId:l().int(),switches:w(oq).readonly(),fetchedAt:l()}),iR=N(["confirmed","suppressed","exhausted-fallback"]),sq=d({id:o(),at:l().int(),deviceId:l().int(),sourceTrackId:o(),className:o(),verdict:iR,reason:o().nullable(),attempts:l().int(),deferredForMs:l().int(),decidedOnCoastedFrame:A(),birthEvidenceAvailable:A(),decidedByBirthEvidence:A(),bestScore:l().nullable(),appliedMinConfidence:l().nullable(),firstSeen:l().int().nullable(),motionOnsetAt:l().int().nullable(),birthLatencyMs:l().int().nullable(),birthIndexInBurst:l().int().nullable()}),lq=d({deviceId:l().int().optional(),since:l().int().optional(),verdict:iR.optional(),limit:l().int().min(1).max(5e3).optional()}),cq=d({id:o(),note:o(),deviceId:l().int(),sourceTrackId:o(),archivedAt:l().int(),trackStartedAt:l().int().nullable(),trackClass:o().nullable(),trackLabel:o().nullable()}),uq=d({deviceId:l().int().optional(),limit:l().int().min(1).max(1e3).optional()}),dq=N(["recording","events"]),pq=N(["prune","manual-delete","rescan","retention-run","relocate","orphan-audit"]),gb=N(["retention","quota","manual","operator","maintenance","orphaned-device"]),rR=d({id:o(),at:l(),domain:dq,op:pq,reason:gb,deviceId:l().nullable(),nodeId:o(),itemsAffected:l(),bytesReclaimed:l(),detail:o().nullable(),actor:o()}),oR=d({deviceId:l().optional(),limit:l().int().min(1).max(1e3).optional()}),sR=d({id:o(),name:o(),category:o().optional(),description:o().optional(),icon:o().optional()}),mq=["person","vehicle","animal","package"],fq=["person","vehicle","animal"],lR=d({mapping:Y(o(),N(mq)),preserveOriginal:A()}),hq=l().int().min(0).max(6),cw=/^([01]\d|2[0-3]):[0-5]\d$/,vb=N(["off","events","continuous","on-device-decision"]),gq=N(fq),uw=e=>new Set(e).size===e.length,vq=d({motion:A().optional(),audioThresholdDbfs:l().optional(),objectClasses:w(gq).min(1).refine(uw,{message:"objectClasses must not repeat a class"}).optional(),sensorDeviceIds:w(l().int().positive()).min(1).max(16).refine(uw,{message:"sensorDeviceIds must not repeat a device"}).optional()}),yq=N(["continuous","events"]),bq=vq,Sq=d({days:w(hq),start:o().regex(cw),end:o().regex(cw),mode:yq,triggers:bq.optional(),preBufferSec:l().min(0).optional(),postBufferSec:l().min(0).optional()}),xq=d({maxAgeDays:l().min(0).optional(),maxSizeGb:l().min(0).optional()}),Zh=d({enabled:A(),mode:vb.optional(),profiles:w(on).optional(),segmentSeconds:l().int().positive().optional(),bands:w(Sq).default([]),deviceDecision:A().optional(),retention:xq.optional()}).strict().refine(e=>e.deviceDecision!==!0||e.bands.length===0,{message:"deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",path:["bands"]}),cR=N(["queued","running","done","failed","cancelled"]),Lc=d({jobId:o(),state:cR,fromLocationId:o(),toLocationId:o(),deviceId:l().nullable(),entities:w(o()),filesMoved:l().int(),bytesMoved:l().int(),filesTotal:l().int().nullable(),rowsReconciled:l().int().nonnegative().optional(),rowsForgotten:l().int().nonnegative().optional(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),uR=N(["recordings","recordingsLow"]),dR=d({fromLocationId:o(),toLocationId:o(),entities:w(N(["segments"])).optional(),footageClass:uR.optional(),deviceId:l().int().optional(),profiles:w(o()).optional(),throttleMbps:l().min(1).max(1e3).optional(),sinceMs:l().int().optional()}),jr=d({leaseId:o().min(1)}),kq=dR.extend({leaseId:o().min(1)}),pR=N(["move","seal","gallery"]),mR=d({toLocationId:o(),fromLocationId:o().optional(),throttleMbps:l().min(1).max(1e3).optional(),mode:pR.optional()}),dw=d({present:A(),rows:l().int().nonnegative().nullable()}),wq=d({media:dw,retrainFrames:dw,anyPresent:A(),total:l().int().nonnegative().nullable()}).nullable(),Mq=mR.extend({leaseId:o().min(1)}),ru=N(["recordings","recordingsLow","eventMedia","backups","galleryMedia"]),yb=d({recordings:o().min(1).optional(),recordingsLow:o().min(1).optional(),eventMedia:o().min(1).optional(),backups:o().min(1).optional(),galleryMedia:o().min(1).optional()}).refine(e=>Object.keys(e).length>0,{message:"select at least one storage class"}),bb=d({recordings:o().min(1).optional(),recordingsLow:o().min(1).optional(),eventMedia:o().min(1).optional(),backups:o().min(1).optional(),galleryMedia:o().min(1).optional()}).optional(),Sb=N(["blocking","nonBlocking"]),pw=d({destinations:yb,sources:bb,throttleMbps:l().min(1).max(1e3).optional(),mode:Sb.optional()}),Cq=N(["planning","sealing","pausing","moving","draining","verifying","repointing","refreshing","resuming","done","failed","cancelled"]),Aq=N(["pipeline","recorder","analytics"]),Eq=d({filesMoved:l().int().nonnegative(),filesTotal:l().int().nonnegative().nullable(),bytesMoved:l().int().nonnegative(),rowsReconciled:l().int().nonnegative().optional(),startedAt:l(),observedAt:l()}),Rq=d({storageClass:ru,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional(),moverJobId:o().nullable(),state:cR.nullable(),error:o().nullable(),progress:Eq.nullable()}),mw=d({jobId:o(),phase:Cq,mode:Sb,destinations:yb,sources:bb,throttleMbps:l(),moves:w(Rq),pauseLeaseId:o().nullable(),pausedParticipants:w(Aq),repointed:A(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),Iq=N(["sharesDeviceWithSource","deviceIdentityUnknown","unstampedEventMediaRows","blockingOnly","noMover"]),Tq=d({code:Iq,storageClass:ru,message:o()}),_q=d({destinations:yb,sources:bb,mode:Sb,moves:w(d({storageClass:ru,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional()})),findings:w(Tq)}),Nq=N(["footage","media"]),Oq=d({lane:Nq,job:Lc,migrationJobId:o().nullable(),observedAt:l()}),Pq=d({storageClass:ru,fromLocationId:o(),toLocationId:o(),items:l().int().nonnegative().nullable(),bytes:l().int().nonnegative().nullable()}),jq=d({classes:w(ru).min(1),throttleMbps:l().min(1).max(1e3).optional()}),Dq=d({fromLocationId:o().min(1),footageClass:uR.optional()}),zq=d({segments:l().int().nonnegative(),bytes:l().int().nonnegative()}).nullable(),Lq=d({locationId:o().min(1),apply:A().optional(),deviceId:l().int().positive().optional(),profiles:w(o().min(1)).optional()}),qq=N(["location-unknown","source-writable","no-ledger","archive-unreadable","anchor-absent","anchor-unreadable","anchor-moved"]);N(["live-tail","listing-error","path-mismatch","durable-refused"]);var Bq=d({"live-tail":l().int().nonnegative(),"listing-error":l().int().nonnegative(),"path-mismatch":l().int().nonnegative(),"durable-refused":l().int().nonnegative()}),Uq=d({deviceId:l().int(),hoursWalked:l().int().nonnegative(),hoursMissing:l().int().nonnegative(),ghostSegments:l().int().nonnegative(),ghostBytes:l().int().nonnegative(),forgottenSegments:l().int().nonnegative(),orphanFiles:l().int().nonnegative()}),Fq=d({locationId:o(),applied:A(),refused:qq.nullable(),archiveSegments:l().int().nonnegative().nullable(),archiveBytes:l().int().nonnegative().nullable(),hoursClaimed:l().int().nonnegative(),hoursWalked:l().int().nonnegative(),hoursMissing:l().int().nonnegative(),listings:l().int().nonnegative(),segmentsClaimed:l().int().nonnegative(),ghostSegments:l().int().nonnegative(),ghostBytes:l().int().nonnegative(),ghostHoursWhole:l().int().nonnegative(),forgottenSegments:l().int().nonnegative(),forgottenBytes:l().int().nonnegative(),orphanFiles:l().int().nonnegative(),orphanSample:w(o()).readonly(),hoursSkipped:l().int().nonnegative(),skippedByReason:Bq,bounded:A(),byDevice:w(Uq).readonly()}),Hq=d({rows:l().int().nonnegative()}).nullable(),$q=d({toLocationId:o().min(1),fromLocationId:o().optional(),mode:pR.optional()}),Qq=N(["orphans","debug-media","ghost-ledger","done","failed","cancelled"]),Vq=d({includeDebugMedia:A().optional()}),Gq=d({jobId:o(),phase:Qq,includeDebugMedia:A(),orphansReclaimed:l().int().nonnegative(),orphanBytesReclaimed:l().int().nonnegative(),debugMediaReclaimed:l().int().nonnegative(),debugMediaBytesReclaimed:l().int().nonnegative(),ghostsForgotten:l().int().nonnegative(),ghostBytesForgotten:l().int().nonnegative(),detail:o().nullable(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),Zq=d({jobId:o().optional()}),Wq=["active","readonly","drain","disabled"],Kq=N(Wq);N(["normal","never","drain"]);var fR=o().regex(/^[a-z][a-zA-Z0-9-]*$/),Ua=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:o(),displayName:o().min(1),providerId:o().min(1),config:Y(o(),X()),nodeId:o().optional(),isSystem:A().default(!1),enabled:A().optional(),mode:Kq.optional(),capacity:d({totalBytes:l(),availableBytes:l()}).nullable().optional(),owned:d({bytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}).optional(),createdAt:l(),updatedAt:l()});d({isDefault:A().optional()});var Yq=d({locationId:o(),startedAtMs:l(),startBytes:l(),bytesRemaining:l(),drained:A(),estimatedEmptyAtMs:l().nullable()}),qi=Ye([fR,o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),Xq=N(["local-path","cap-mediated"]),Jq=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:"id must start with a lowercase letter and contain only letters, digits, or hyphens"}),displayName:o().min(1,{message:"displayName must not be empty"}),description:o().optional(),cardinality:N(["single","multi"]),access:Xq.optional(),defaultsTo:o().optional(),defaultRoot:N(["data","media","backup"]).optional()}),eB=d({inputFps:l(),outputFps:l(),avgDecodeTimeMs:l(),droppedFrames:l(),lagMs:l().optional(),effectiveFps:l().optional(),adaptiveFps:l().optional()}),fw=d({codec:o(),maxFps:l().default(0),outputFormat:N(["jpeg","rgb","bgr","yuv420","gray"]).default("jpeg"),scale:l().default(1),width:l().optional(),height:l().optional(),deviceId:l().int().nonnegative().optional(),tag:o().optional(),frameSink:N(["callback","shm"]).default("callback"),debug:A().optional()}),tB=N(["info","warn","error"]),hR=d({name:o().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/,"a channel name is dotted lower-kebab, e.g. area.thing"),description:o().min(1),defaultLevel:tB,perDevice:A()}),nB=d({channel:o().min(1),armedUntilMs:l(),deviceIds:w(l().int()).readonly().nullable()}),vm=["onnx","coreml","openvino","tflite","pt","gguf"],Es=d({url:o(),sizeMB:l(),isDirectory:A().optional(),files:w(o()).readonly().optional(),runtimes:w(N(["node","python"])).readonly().optional()}),aB=d({url:o(),filename:o(),sizeMB:l()}),iB=d({onnx:Es.optional(),coreml:Es.optional(),openvino:Es.optional(),tflite:Es.optional(),pt:Es.optional(),gguf:Es.optional()}),gR=d({family:o(),tier:o(),precision:N(["fp32","int8"]).optional(),optimization:N(["standard","fast"]).optional(),resolution:l().int().positive().optional()}),rB=["camstack","frigate","scrypted","custom"],vR=N(rB),xb=d({id:o(),name:o(),description:o(),formats:iB,inputSize:d({width:l(),height:l()}),inputChannels:l().int().positive().optional(),labels:w(sR).readonly(),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),outputProbabilities:A().optional(),preprocessMode:N(["letterbox","resize"]).optional(),postprocessor:ei().optional(),faceAlignment:A().optional(),extraFiles:w(aB).readonly().optional(),legacy:A().optional(),metrics:d({map50:l().optional(),p95LatencyMs:Y(o(),l()).optional()}).optional(),license:o().optional(),group:gR.optional(),provider:vR.optional(),classMap:lR.optional()}),oB=kt("format",[d({format:Q("openvino"),precisions:w(N(["fp16","int8"])).min(1).readonly()}),d({format:Q("coreml")})]),sB=d({id:o().regex(/^[a-zA-Z0-9._-]+$/),name:o(),labels:w(sR).readonly(),inputSize:d({width:l(),height:l()}),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),preprocessMode:N(["letterbox","resize"]).optional(),outputFormat:N(["yolo","ssd","embedding","classification","ocr","segmentation"]),faceAlignment:A().optional(),classMap:lR.optional()}),lB=d({format:N(vm),precision:N(["fp16","int8"]).optional(),sizeMB:l(),validated:A(),files:w(o()).readonly()}),cB=d({entry:xb,artifacts:w(lB).readonly()}),Wn=class extends Error{position;constructor(e,t){super(e),this.name="ExpressionParseError",this.position=t}},xo=class extends Error{constructor(e){super(e),this.name="ExpressionEvalError"}};function Zn(e,t,n){if(typeof e!="number"||!Number.isFinite(e))throw new xo(`${t}: argument ${n+1} must be a finite number`);return e}function hw(e,t,n){if(typeof e!="string")throw new xo(`${t}: argument ${n+1} must be a string`);return e}function Ma(e,t){if(!Number.isFinite(e))throw new xo(`${t}: produced a non-finite result`);return e}function zd(e,t){return e.map((n,a)=>Zn(n,t,a))}var oc=Number.POSITIVE_INFINITY,yR={min:{minArgs:1,maxArgs:oc,apply:e=>Ma(Math.min(...zd(e,"min")),"min")},max:{minArgs:1,maxArgs:oc,apply:e=>Ma(Math.max(...zd(e,"max")),"max")},abs:{minArgs:1,maxArgs:1,apply:e=>Ma(Math.abs(Zn(e[0],"abs",0)),"abs")},floor:{minArgs:1,maxArgs:1,apply:e=>Ma(Math.floor(Zn(e[0],"floor",0)),"floor")},ceil:{minArgs:1,maxArgs:1,apply:e=>Ma(Math.ceil(Zn(e[0],"ceil",0)),"ceil")},sqrt:{minArgs:1,maxArgs:1,apply:e=>Ma(Math.sqrt(Zn(e[0],"sqrt",0)),"sqrt")},round:{minArgs:1,maxArgs:2,apply:e=>{const t=Zn(e[0],"round",0),n=e.length>1?Math.trunc(Zn(e[1],"round",1)):0;if(n<0||n>100)throw new xo("round: digits must be between 0 and 100");const a=10**n;return Ma(Math.round(t*a)/a,"round")}},pow:{minArgs:2,maxArgs:2,apply:e=>Ma(Zn(e[0],"pow",0)**Zn(e[1],"pow",1),"pow")},clamp:{minArgs:3,maxArgs:3,apply:e=>{const t=Zn(e[0],"clamp",0),n=Zn(e[1],"clamp",1),a=Zn(e[2],"clamp",2);if(n>a)throw new xo("clamp: lower bound is greater than upper bound");return Ma(Math.min(a,Math.max(n,t)),"clamp")}},avg:{minArgs:1,maxArgs:oc,apply:e=>{const t=zd(e,"avg");return Ma(t.reduce((n,a)=>n+a,0)/t.length,"avg")}},sum:{minArgs:1,maxArgs:oc,apply:e=>Ma(zd(e,"sum").reduce((t,n)=>t+n,0),"sum")},coalesce:{minArgs:1,maxArgs:oc,apply:e=>{for(const t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>Ma(Zn(e[0],"age",0)-Zn(e[1],"age",1),"age")},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{const n=Zn(e[0],"convert",0),a=hw(e[1],"convert",1).trim(),s=hw(e[2],"convert",2).trim();if(t.convert){const p=t.convert(n,a,s);if(p===null)throw new xo(`convert: cannot convert '${a}' to '${s}'`);return Ma(p,"convert")}if(a===s)return n;throw new xo("convert: unit conversion table not installed")}}};Object.freeze(Object.assign(Object.create(null),yR));var bR=new Set(Object.keys(yR)),kb=2048,wb=/^[A-Za-z_][A-Za-z0-9_]*$/,uB=new Set(["now","true","false","null"]),dB=new Set(["true","false","null"]);function wc(e){return e>="0"&&e<="9"}function SR(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"}function pB(e){return SR(e)||wc(e)}function mB(e){return e===" "||e===" "||e===`
74
- `||e==="\r"||e==="\f"||e==="\v"}function fB(e){if(e.length>2048)throw new Wn(`expression too long (${e.length} > ${kb} chars)`,0);const t=[];let n=0;const a=e.length;for(;n<a;){const s=e[n];if(mB(s)){n+=1;continue}if(wc(s)){const f=n;for(;n<a&&wc(e[n]);)n+=1;if(n<a&&e[n]==="."){if(n+1>=a||!wc(e[n+1]))throw new Wn("malformed number: decimal point needs a digit",n);for(n+=1;n<a&&wc(e[n]);)n+=1}const m=e.slice(f,n),h=Number(m);if(!Number.isFinite(h))throw new Wn(`malformed number: '${m}'`,f);t.push({type:"number",value:h,pos:f});continue}if(s==="'"||s==='"'){const f=s,m=n;n+=1;let h="",c=!1;for(;n<a;){const x=e[n];if(x==="\\"){const M=n+1<a?e[n+1]:"";if(M==="\\"||M==="'"||M==='"'){h+=M,n+=2;continue}throw new Wn(`invalid string escape: '\\${M}'`,n)}if(x===f){c=!0,n+=1;break}h+=x,n+=1}if(!c)throw new Wn("unterminated string literal",m);t.push({type:"string",value:h,pos:m});continue}if(SR(s)){const f=n;for(;n<a&&pB(e[n]);)n+=1;const m=e.slice(f,n);dB.has(m)?t.push({type:"keyword",keyword:hB(m),pos:f}):t.push({type:"identifier",name:m,pos:f});continue}const p=n+1<a?e.slice(n,n+2):"";if(p==="<="||p===">="||p==="=="||p==="!="||p==="&&"||p==="||"){t.push({type:"punct",punct:p,pos:n}),n+=2;continue}if(gB(s)){t.push({type:"punct",punct:s,pos:n}),n+=1;continue}throw new Wn(`unexpected character '${s}'`,n)}return t.push({type:"eof",pos:a}),t}function hB(e){return e==="true"?"true":e==="false"?"false":"null"}function gB(e){return e==="("||e===")"||e===","||e==="?"||e===":"||e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="!"||e==="<"||e===">"}var vB={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function yB(e){return e==="&&"||e==="||"}function bB(e){return e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="=="||e==="!="||e==="<"||e==="<="||e===">"||e===">="}var SB=class{tokens;pos=0;nodeCount=0;identifiers=new Set;callees=new Set;constructor(e){this.tokens=e}parse(){const e=this.parseTernary(),t=this.peek();if(t.type!=="eof")throw new Wn("unexpected trailing input",t.pos);return{ast:e,identifiers:this.identifiers,callees:this.callees,nodeCount:this.nodeCount}}peek(){return this.tokens[this.pos]}next(){return this.tokens[this.pos++]}expectPunct(e){const t=this.peek();if(t.type!=="punct"||t.punct!==e)throw new Wn(`expected '${e}'`,t.pos);this.pos+=1}matchPunct(e){const t=this.peek();return t.type==="punct"&&t.punct===e?(this.pos+=1,!0):!1}countNode(){if(this.nodeCount+=1,this.nodeCount>256)throw new Wn("expression too complex",this.peek().pos)}parseTernary(){const e=this.parseBinary(1);if(this.matchPunct("?")){const t=this.parseTernary();this.expectPunct(":");const n=this.parseTernary();return this.countNode(),{kind:"conditional",test:e,consequent:t,alternate:n}}return e}parseBinary(e){let t=this.parseUnary();for(;;){const n=this.peek();if(n.type!=="punct")break;const a=vB[n.punct];if(a===void 0||a<e)break;const s=n.punct;this.pos+=1;const p=this.parseBinary(a+1);if(this.countNode(),yB(s))t={kind:"logical",op:s,left:t,right:p};else if(bB(s))t={kind:"binary",op:s,left:t,right:p};else throw new Wn(`unexpected operator '${s}'`,n.pos)}return t}parseUnary(){const e=this.peek();if(e.type==="punct"&&(e.punct==="!"||e.punct==="-")){const t=e.punct;this.pos+=1;const n=this.parseUnary();return this.countNode(),{kind:"unary",op:t,operand:n}}return this.parsePrimary()}parsePrimary(){const e=this.next();switch(e.type){case"number":return this.countNode(),{kind:"literal",value:e.value};case"string":return this.countNode(),{kind:"literal",value:e.value};case"keyword":return this.countNode(),{kind:"literal",value:e.keyword==="null"?null:e.keyword==="true"};case"identifier":{const t=this.peek();return t.type==="punct"&&t.punct==="("?this.parseCall(e.name,e.pos):(this.identifiers.add(e.name),this.countNode(),{kind:"identifier",name:e.name})}case"punct":if(e.punct==="("){const t=this.parseTernary();return this.expectPunct(")"),t}throw new Wn(`unexpected token '${e.punct}'`,e.pos);case"eof":throw new Wn("unexpected end of expression",e.pos)}}parseCall(e,t){if(!bR.has(e))throw new Wn(`unknown function '${e}'`,t);this.expectPunct("(");const n=[];if(!this.matchPunct(")"))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new Wn(`too many arguments to '${e}'`,t);if(!this.matchPunct(",")){this.expectPunct(")");break}}return this.callees.add(e),this.countNode(),{kind:"call",callee:e,args:n}}};function xB(e){return new SB(fB(e)).parse()}var ho=new Map;function kB(e){const t=ho.get(e);if(t!==void 0)return ho.delete(e),ho.set(e,t),t;let n;try{n={ok:!0,parsed:xB(e)}}catch(a){n={ok:!1,error:a instanceof Wn?a.message:String(a)}}if(ho.set(e,n),ho.size>256){const a=ho.keys().next().value;a!==void 0&&ho.delete(a)}return n}function wB(e){return kB(e)}function xR(e){const t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(const s of t){if(!wb.test(s))return`invalid binding name '${s}'`;if(uB.has(s))return`binding name '${s}' is reserved`;if(bR.has(s))return`binding name '${s}' shadows a builtin function`}const n=wB(e.expr);if(!n.ok)return n.error;const a=new Set(t);for(const s of n.parsed.identifiers)if(s!=="now"&&!a.has(s))return`expression references unbound identifier '${s}'`;return null}var MB=d({kind:Q("field").optional(),sourceKey:o(),cap:o(),fieldPath:o()}),CB=d({kind:Q("literal"),value:Ye([o(),l(),A(),$E()])}),AB=d({kind:Q("global"),sourceStableId:o(),cap:o(),fieldPath:o()}),kR=Ye([MB,CB,AB]);d({expr:o().min(1).max(kb),bindings:Y(o().regex(wb),kR)}).superRefine((e,t)=>{const n=xR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})});var EB=N(["eq","ne","gt","gte","lt","lte","contains","in"]),RB=d({kind:Q("condition"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),operator:EB,value:Ye([o(),l(),A(),w(Ye([o(),l()]))])}),IB=d({kind:Q("expression"),expr:o().min(1).max(kb),bindings:Y(o().regex(wb),kR)}).superRefine((e,t)=>{const n=xR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})}),sp=au(()=>kt("kind",[d({kind:Q("all"),children:w(sp)}),d({kind:Q("any"),children:w(sp)}),d({kind:Q("not"),child:sp}),RB,IB])),TB=kt("kind",[d({kind:Q("device-state"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),becomes:Ye([o(),l(),A()]).optional(),edge:A().optional(),forMs:l().int().min(0).max(864e5).optional(),debounceMs:l().int().min(0).max(6e5).optional()}),d({kind:Q("device-event"),category:o().min(1),deviceId:l().int().nonnegative().optional()}),d({kind:Q("schedule"),cron:o().min(1).max(120)}),d({kind:Q("manual")})]),_B=kt("kind",[d({kind:Q("wait"),seconds:l().min(0).max(300)}),d({kind:Q("cap"),deviceId:Ye([l().int(),d({$var:o().min(1)})]),cap:o().min(1),method:o().min(1),args:Y(o(),X()).optional()}),d({kind:Q("code"),code:o().min(1).max(2e4)})]);d({triggers:w(TB),conditions:sp.optional(),actions:w(_B)});var NB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),OB=d({addonId:o(),page:NB,bundleUrl:o()}),PB={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:y(O(),w(OB).readonly())}},jB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),DB={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:y(O(),w(jB).readonly(),{auth:"admin"})}},zB=d({method:N(["GET","POST","PUT","DELETE","PATCH"]),path:o(),access:N(["public","authenticated","admin"]).optional(),description:o().optional()}),LB=d({method:o(),path:o(),params:Y(o(),o()),query:Y(o(),o()),body:X(),headers:Y(o(),o()),user:d({id:o(),username:o(),isAdmin:A()}).optional(),scopedToken:X().optional()}),qB=d({status:l().int(),headers:Y(o(),o()),redirectUrl:o().nullable(),body:X().optional(),contentType:o().optional()}),BB={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:y(O(),w(zB)),invoke:y(LB,qB,{kind:"mutation"})},mount:{kind:"skip"}},UB=d({id:o(),label:o(),icon:o(),order:l().optional()}),FB=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:Ye([Q(1),Q(2),Q(3),Q(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(QE())}),ko=d({tabs:w(UB).optional(),sections:w(FB)}),gw=Y(o(),X()),vw=d({success:Q(!0)}),HB={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:y(d({addonId:o(),nodeId:o().optional(),overlay:Y(o(),X()).optional(),cap:o().optional()}),ko.nullable()),updateGlobalSettings:y(d({addonId:o(),nodeId:o().optional(),patch:gw}),vw,{kind:"mutation",auth:"admin"}),getIntegrationSettings:y(d({addonId:o(),nodeId:o().optional()}),ko.nullable()),getDeviceSettings:y(d({addonId:o(),deviceId:l(),nodeId:o().optional()}),ko.nullable()),updateDeviceSettings:y(d({addonId:o(),deviceId:l(),nodeId:o().optional(),patch:gw}),vw,{kind:"mutation",auth:"admin"})}},$B=N(["device-tab","dashboard","integration-detail"]),yw=N(["xs","sm","md","lg","xl"]),wR=d({remoteName:o(),exposedModule:o(),componentKey:o().optional()}),MR=d({tab:o(),subTab:o().optional(),label:o(),order:l().optional(),kind:Q("remote"),remote:wR,stableId:o(),description:o().optional(),icon:o().optional(),bundle:o(),hosts:w($B).readonly(),requires:d({deviceContext:A().default(!1),integrationContext:A().default(!1)}),preAuth:A().optional().default(!1),defaultSize:yw.default("md"),allowedSizes:w(yw).readonly().default(["sm","md","lg"]),defaultColumns:l().int().min(1).max(12).default(6),defaultRows:l().int().min(1).max(12).default(1)}),QB={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:y(O(),w(MR).readonly(),{auth:"admin"})}},VB=MR.extend({addonId:o(),bundleUrl:o()}),GB={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:y(O(),w(VB).readonly())}},ZB=N(["info","success","warning","error"]),WB=N(["active","in-progress","completed","failed","dismissed"]),KB=d({type:o(),id:o()}),Wh=d({id:o(),category:o(),severity:ZB,title:o(),message:o(),status:WB,progress:l().optional(),read:A(),createdAt:l(),updatedAt:l(),source:KB.optional(),metadata:Y(o(),X()).optional()}),YB={name:"alerts",scope:"system",mode:"singleton",methods:{emit:y(Wh,O(),{kind:"mutation"}),update:y(d({alertId:o(),patch:Wh.partial()}),O(),{kind:"mutation"}),list:y(d({unreadOnly:A().optional(),limit:l().optional()}).optional(),w(Wh).readonly()),getUnreadCount:y(O(),l()),markRead:y(d({alertId:o()}),O(),{kind:"mutation"}),markAllRead:y(O(),O(),{kind:"mutation"}),dismiss:y(d({alertId:o()}),O(),{kind:"mutation"})}},XB={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:y(d({deviceId:l()}),ei())},events:{onAudioLevel:Ao(d({deviceId:l(),rms:l(),dbfs:l()}))}},JB=N(["jpeg","rgb","bgr","yuv420","gray"]),_v=d({data:ei(),format:JB,width:l(),height:l(),timestamp:l()}),Xi=d({x:l(),y:l(),w:l(),h:l()});d({class:o(),originalClass:o(),score:l(),bbox:Xi});var bw=d({data:$t(Uint8Array),sampleRate:l(),channels:l(),timestamp:l(),deviceId:l().optional()}),e7=d({rms:l(),dbfs:l()}),Nv=d({className:o(),originalClass:o().optional(),score:l()}),t7=d({level:e7,classification:d({labels:w(Nv).readonly(),inferenceMs:l()}).optional(),timestamp:l()}),CR=d({minConfidence:l().min(0).max(1).default(.3),allowedClasses:w(o()).default([])}),n7=d({deviceId:l(),brokerId:o(),ingestNodeId:o(),settings:CR}),a7=d({attached:A(),replaced:A()}),i7=d({detached:A()}),r7=d({labels:w(Nv).readonly(),rawLabels:w(Nv).readonly().optional(),inferenceMs:l()}),o7={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:y(d({chunk:bw,settings:CR}),t7.nullable(),{kind:"mutation"}),classify:y(bw,r7,{timeoutMs:3e4}),attachDevice:y(n7,a7,{kind:"mutation"}),detachDevice:y(d({deviceId:l()}),i7,{kind:"mutation"}),isReady:y(O(),A()),dispose:y(O(),O(),{kind:"mutation"}),reprobeAudioEngine:y(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},ym=N(["f32le","s16le"]),s7=d({codec:o(),canDecode:A(),canEncode:A(),label:o().optional()}),l7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),extraData:$t(Uint8Array).optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),targetFormat:ym.optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),c7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),sourceFormat:ym.optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),bitrateKbps:l().int().positive().optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),u7=d({data:$t(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),format:ym,pts:l()}),Sw=d({data:$t(Uint8Array),codec:o(),pts:l(),frameComplete:A()}),d7=d({sessionId:o(),kind:N(["decode","encode"]),codec:o(),sourceSampleRate:l(),sourceChannels:l(),targetSampleRate:l(),targetChannels:l(),format:ym,tag:o().optional(),createdAtMs:l(),lastActivityMs:l(),framesIn:l(),framesOut:l()}),p7={name:"audio-codec",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{listSupportedCodecs:y(O(),w(s7).readonly()),canHandle:y(d({codec:o(),kind:N(["decode","encode"])}),A()),createDecodeSession:y(l7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),createEncodeSession:y(c7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),closeSession:y(d({sessionId:o(),nodeId:o().optional()}),O(),{kind:"mutation"}),pushEncodedFrame:y(d({sessionId:o(),nodeId:o().optional(),data:$t(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullPcm:y(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(u7)),pushPcm:y(d({sessionId:o(),nodeId:o().optional(),data:$t(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullEncoded:y(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(Sw)),flushEncode:y(d({sessionId:o(),nodeId:o().optional()}),w(Sw),{kind:"mutation"}),listActiveSessions:y(O(),w(d7).readonly())}},Kh=d({userId:o(),username:o(),email:o().optional(),displayName:o().optional(),isAdmin:A().default(!1)}),m7={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:y(d({username:o(),password:o()}),Kh.nullable(),{kind:"mutation"}),getLoginUrl:y(d({state:o()}),o()),handleCallback:y(Y(o(),o()),Kh,{kind:"mutation"}),validateToken:y(d({token:o()}),Kh.nullable())},mount:{kind:"skip"}},f7=d({subId:o(),displayName:o(),description:o().optional(),kind:o(),triggerSupported:A(),restoreSupported:A()}).extend({id:o(),addonId:o(),enabled:A(),retentionCount:l(),label:o().optional(),lastSuccessAt:l().optional(),lastSuccessSizeBytes:l().optional(),cron:o().optional(),nextRunAt:l().optional(),lastAttemptAt:l().optional(),lastError:o().optional()}),h7=d({id:o(),filename:o(),createdAt:l(),sizeBytes:l(),label:o().optional(),locations:w(o()).readonly()}),AR=d({id:o(),destinationId:o().optional(),label:o().optional(),createdAt:l(),sizeBytes:l(),locations:w(o()).optional()}),g7=d({path:o(),kind:N(["file","dir","symlink"]),sizeBytes:l(),mtime:l()}),v7=d({archiveVersion:Q(1),createdAt:l(),dataDir:o(),locations:w(o()),entries:w(g7),totalBytes:l(),totalFiles:l()}),y7=d({name:o(),sizeBytes:l(),fileCount:l(),present:A()}),b7=N(["queued","running","succeeded","failed","cancelled"]),S7=N(["queued","building","uploading","done"]),x7=d({id:o(),state:b7,phase:S7,destinationIds:w(o()).readonly(),label:o().optional(),requestedAt:l(),startedAt:l().optional(),finishedAt:l().optional(),stagedBytes:l(),archiveSizeBytes:l().optional(),uploadedBytes:l(),completedDestinationIds:w(o()).readonly(),failedDestinationIds:w(o()).readonly(),error:o().optional(),queuePosition:l().int().min(1).optional()}),k7=d({runId:o(),queued:A(),joined:A(),cancelled:A(),entries:w(AR).readonly()}),xw=d({id:o(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional(),lastAttemptAt:l().optional(),lastSuccessAt:l().optional(),lastError:o().optional(),nextRunAt:l().optional()}),w7={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:y(O(),w(f7).readonly(),{auth:"admin"}),trigger:y(d({destinations:w(o()).optional(),locations:w(o()).optional(),label:o().optional(),retentionCount:l().int().min(1).max(1e3).optional()}).optional(),k7,{kind:"mutation",auth:"admin"}),listRuns:y(O(),w(x7).readonly(),{auth:"admin"}),cancel:y(d({runId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),list:y(O(),w(AR).readonly(),{auth:"admin"}),listLocations:y(O(),w(y7).readonly(),{auth:"admin"}),getEntries:y(d({destinationId:o(),backupId:o()}),v7.nullable(),{auth:"admin"}),restore:y(d({destinationId:o(),backupId:o(),locations:w(o()).optional()}),O(),{kind:"mutation",auth:"admin"}),delete:y(d({destinationId:o(),backupId:o()}),O(),{kind:"mutation",auth:"admin"}),listArchives:y(d({destinationId:o()}),w(h7).readonly(),{auth:"admin"}),upsertDestinationPolicy:y(d({locationId:o(),enabled:A(),retentionCount:l().int().min(1).max(1e3),label:o().optional()}),O(),{kind:"mutation",auth:"admin"}),previewSchedule:y(d({cron:o(),count:l().int().min(1).max(20).optional()}),d({ok:A(),error:o().optional(),nextRuns:w(l()).readonly()})),listSchedules:y(O(),w(xw).readonly(),{auth:"admin"}),upsertSchedule:y(d({id:o().optional(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional()}),xw,{kind:"mutation",auth:"admin"}),deleteSchedule:y(d({id:o()}),O(),{kind:"mutation",auth:"admin"})}},M7=N(["connected","disconnected","connecting","auth-failed","unreachable","error"]),kw=d({id:o(),addonId:o(),name:o(),kind:o(),status:M7,info:Y(o(),X()),lastCheckedAt:l().nullable(),error:o().nullable()}),ww=d({brokerCount:l().int().nonnegative(),connectedCount:l().int().nonnegative()}),C7=d({addonId:o(),kinds:w(d({kind:o(),label:o()}))}),A7=d({kind:o().optional()}),Ld=d({id:o()}),E7=d({kind:o().min(1),name:o().min(1),id:o().min(1).optional(),settings:Y(o(),X())}),R7=d({id:o()}),I7=d({id:o()}),T7=kt("ok",[d({ok:Q(!0),latencyMs:l().nonnegative()}),d({ok:Q(!1),error:o()})]),lp=Y(o(),X()),_7=d({kind:o()}),N7=d({kind:o(),settings:lp}),O7=kt("ok",[d({ok:Q(!0),latencyMs:l().nonnegative().optional()}).strict(),d({ok:Q(!1),error:o()})]),P7=X().nullable(),j7=d({brokerId:o(),target:Y(o(),X()),payload:X().optional()}),D7=d({brokerId:o(),filter:Y(o(),X())}),z7=d({subscriptionId:o()}),L7=d({brokerId:o(),subscriptionId:o()}),q7=d({brokerId:o(),key:o()}),B7={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:ww,kind:"poll"},methods:{list:y(A7,w(kw)),get:y(Ld,kw.nullable()),listProviders:y(O(),w(C7),{auth:"admin"}),add:y(E7,R7,{kind:"mutation",auth:"admin"}),remove:y(I7,O(),{kind:"mutation",auth:"admin"}),testConnection:y(Ld,T7,{kind:"mutation",auth:"admin"}),getSettings:y(Ld,lp.nullable(),{auth:"admin"}),setSettings:y(d({id:o(),settings:lp}),O(),{kind:"mutation",auth:"admin"}),getBrokerConfig:y(Ld,lp.nullable(),{auth:"admin"}),getSettingsSchema:y(_7,P7,{auth:"admin"}),testSettings:y(N7,O7,{kind:"mutation",auth:"admin"}),publish:y(j7,X(),{kind:"mutation",auth:"admin"}),subscribe:y(D7,z7,{kind:"mutation",auth:"admin"}),unsubscribe:y(L7,O(),{kind:"mutation",auth:"admin"}),getState:y(q7,X().nullable()),getStatus:y(O(),ww)}},U7={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{}},ER=d({code:o().min(1),label:o().min(1),recommended:A()}),F7=d({signals:w(ER),lastFetchedAt:l()}),H7={name:"stream-signals",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(H),runtimeState:F7,durability:"session",methods:{listSignals:y(O(),w(ER).readonly())}},$7=N(["webrtc","hls","mjpeg","rtsp"]),RR=N(["mp4","gif"]),Q7=d({kind:RR,handle:o(),nodeId:o(),mime:o(),bytes:l().int(),width:l().int(),height:l().int()}),V7=d({fromTs:l(),toTs:l(),packets:l().int()}),G7=d({media:w(Q7).readonly(),coverage:V7,profile:on,video:N(["copy","encode"])}),Ov=d({brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:d({width:l().int().positive(),height:l().int().positive()}).optional()}),Z7=d({sessionId:o(),remoteAddr:o(),userAgent:o().nullish(),playing:A(),muted:A(),connectedAt:l(),lastRtpAt:l(),bytesSent:l()}),W7=d({tag:o(),subscribedAt:l(),maxFps:l(),framesDelivered:l(),framesDropped:l()}),K7=d({tag:o(),subscribedAt:l(),chunksDelivered:l()}),Y7=N(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),Pv=d({kind:Y7,label:o().optional(),media:N(["audio","video","both"]).optional(),targetCodec:o().optional(),transport:N(["passthrough","repacketize","transcode"]).optional(),remoteAddr:o().optional(),userAgent:o().optional(),userId:o().optional(),sessionId:o().optional(),extra:Y(o(),o()).optional()}).readonly(),X7=d({id:o(),channel:N(["annexb","rtp"]),attribution:Pv,subscribedAt:l(),packetsDelivered:l()}),J7=d({rtsp:w(Z7).readonly(),decoded:w(W7).readonly(),audio:w(K7).readonly(),encoded:w(X7).readonly(),pipeClients:l(),encodedSubscribers:l()});N(["reconnecting","sleeping","offline","disabled","waking"]);var e9=N(["h264","h265","copy"]),t9=N(["aac","opus","pcmu","copy","none"]),n9=d({deviceId:l().int().nonnegative(),video:e9,audio:t9.optional(),profile:on.optional(),targetResolution:d({width:l().int().positive(),height:l().int().positive()}).optional(),outputArgs:w(o()).optional(),audioEgress:A().optional(),hostname:o().optional(),tag:o().optional()}),a9=d({url:o(),videoCodec:N(["H264","H265"]),audioCodec:o(),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),pipelineKey:o()}),i9=nR.omit({inputArgs:!0,outputArgs:!0}),r9=N(["tight","relaxed"]),o9=d({deviceId:l().int().nonnegative(),source:kt("kind",[d({kind:Q("profile"),profile:on}),d({kind:Q("cam-stream"),camStreamId:o().min(1)})]),encode:i9,rateControl:r9.optional(),bitstreamFilter:N(["dump_extra","h264_mp4toannexb","hevc_mp4toannexb"]).optional(),publishLocally:A().optional(),pixelFormat:N(["yuv420p","nv12"]).optional(),decodeHwAccel:N(["auto","none","videotoolbox","vaapi","qsv","cuda"]).optional(),hostname:o().optional(),tag:o().optional()}),s9=d({url:o(),pipelineKey:o(),videoCodec:N(["H264","H265"]),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),decodeHwAccel:o().nullable(),camStreamId:o().nullable()}),l9={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{reportStreamSignal:y(d({deviceId:l().int().nonnegative(),code:o().min(1),at:l().optional()}),d({accepted:A(),reason:N(["woke","hold-extended","not-enabled","no-consumer","unknown-code"])}),{kind:"mutation"}),publishCameraStream:y(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1),kind:hb,url:o().optional(),codec:o().optional(),resolution:dl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:on.optional(),metadata:Y(o(),X()).optional(),sourceCamStreamId:o().min(1).optional(),encodeProfile:nR.optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:y(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:y(d({deviceId:l().int().nonnegative(),profile:on,camStreamId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:y(d({deviceId:l().int().nonnegative(),profile:on}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),forgetDeviceHardware:y(d({deviceId:l().int().nonnegative()}),d({derivedStreamsDeleted:w(o()).readonly(),assignmentsPurged:A(),probeSnapshotsDropped:l().int().nonnegative(),rtspTokenRowsDeleted:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),renderPreBufferClip:y(d({deviceId:l(),profile:on.optional(),aroundMs:l(),preRollSec:l().min(0).max(20).default(3),postRollSec:l().min(0).max(20).default(5),format:N(["gif","mp4"]).default("gif"),maxWidth:l().int().min(120).max(1920).default(480),fps:l().int().min(1).max(15).default(5),speed:l().min(1).max(8).default(2)}),d({base64:o(),mime:o(),bytes:l().int(),profile:on,durationMs:l()}),{kind:"mutation",auth:"admin"}),produceEventMedia:y(d({deviceId:l(),profile:on.optional(),aroundMs:l(),preSeconds:l().min(0).max(20).default(4),postSeconds:l().min(0).max(20).default(6),kinds:w(RR).min(1).default(["mp4"]),gifMaxWidth:l().int().min(120).max(1280).default(640),gifFps:l().int().min(1).max(15).default(12),gifSpeed:l().min(1).max(8).default(4),speed:l().min(1).max(8).default(4)}),G7,{kind:"mutation",auth:"admin"}),fetchEventMedia:y(d({handle:o()}),d({base64:o(),mime:o(),bytes:l().int()}).nullable(),{kind:"mutation",auth:"admin"}),listAllCameraStreams:y(O(),w(Iv).readonly()),listAllProfileSlots:y(O(),w(Tv).readonly()),getBrokerStats:y(d({brokerId:o()}),_8),probeStream:y(d({brokerId:o()}),d({probed:A(),summary:o()}),{kind:"mutation",auth:"admin"}),listClients:y(d({brokerId:o()}),J7),killClient:y(d({brokerId:o(),channel:N(["rtsp","decoded","audio"]),handle:o()}),d({killed:A()}),{kind:"mutation",auth:"admin"}),restartProfile:y(d({deviceId:l().int().nonnegative(),profile:on}),d({success:A()}),{kind:"mutation",auth:"admin"}),getStreamUrl:y(d({streamId:o(),format:$7}),d({url:o()})),getStreamWithCodec:y(n9,a9,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:y(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),acquireEgressTranscode:y(o9,s9,{kind:"mutation",auth:"admin"}),releaseEgressTranscode:y(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:y(R8,I8,{kind:"mutation"}),pullAudioChunks:y(d({subscriptionId:o(),maxCount:l().int().positive().default(8)}),w(E8).readonly()),unsubscribeAudioChunks:y(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),subscribeFrames:y(C8,A8,{kind:"mutation"}),pullFrameHandles:y(d({subscriptionId:o(),maxCount:l().int().positive().default(4)}),w(Vi).readonly()),unsubscribeFrames:y(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),setPreBufferDuration:y(d({brokerId:o(),seconds:l().min(0).max(30)}),O(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:y(d({brokerId:o()}),d({configuredSec:l(),bufferedMs:l(),packetCount:l()})),getRtspPort:y(O(),l()),getAllRtspEntries:y(d({hostname:o().optional()}),w(Ov).readonly()),getRtspEntry:y(d({brokerId:o(),hostname:o().optional()}),Ov.nullable()),regenerateRtspToken:y(d({brokerId:o()}),o().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:y(d({brokerId:o(),enabled:A()}),O(),{kind:"mutation",auth:"admin"}),isRtspEnabled:y(d({brokerId:o()}),A()),getDeviceAudioMute:y(d({deviceId:l().int()}),d({muted:A(),appliedBrokers:l().int().nonnegative()})),setDeviceAudioMute:y(d({deviceId:l().int(),muted:A()}),d({muted:A(),appliedBrokers:l().int().nonnegative()}),{kind:"mutation",auth:"admin"})},events:{onCamStreamDemand:Ao(d({deviceId:l().int().nonnegative(),camStreamId:o(),profile:on})),onCamStreamIdle:Ao(d({deviceId:l().int().nonnegative(),camStreamId:o()})),onRequestStreamSourceRefresh:Ao(d({deviceId:l().int().nonnegative(),camStreamId:o(),brokerId:o()}))}},Mw=N(["h264","h265","hevc","av1","mjpeg","vp8","vp9"]),c9=d({acceptCodecs:w(Mw).readonly().optional(),minHeight:l().int().positive().optional(),maxHeight:l().int().positive().optional(),minWidth:l().int().positive().optional(),excludeDerived:A().optional(),requireSiblingCodec:w(Mw).readonly().optional(),allowTranscode:A().optional()}).readonly(),u9=d({preferredProviders:w(o()).readonly().optional(),resolutionPreference:N(["highest","lowest"]).optional(),targetHeight:l().int().positive().optional()}).readonly(),d9=d({camStreamId:o(),codec:o().optional(),resolution:dl.optional(),transcodes:A(),reason:o()}),p9={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{getCameraStreams:y(d({deviceId:l().int().nonnegative()}),w(Iv).readonly()),getBrokerStreams:y(d({deviceId:l().int().nonnegative()}),w(Tv).readonly()),getRtspEntries:y(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(Ov).readonly()),getProfileRtspEntries:y(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(N8).readonly()),pickStream:y(d({deviceId:l().int().nonnegative(),requirements:c9,preferences:u9.optional()}),d9.nullable())},events:{onCamStreamsChanged:Ao(d({deviceId:l().int().nonnegative(),camStreams:w(Iv).readonly()})),onProfileSlotsChanged:Ao(d({deviceId:l().int().nonnegative(),profileSlots:w(Tv).readonly()}))},runtimeState:d({online:A(),slotStatuses:d({high:op.optional(),mid:op.optional(),low:op.optional()}),slotErrors:d({high:o().optional(),mid:o().optional(),low:o().optional()}),lastChangedAt:l()}),durability:"session"},m9=Ye([Q("hub"),o().min(1)]),f9=N(["stopped","starting","running","failed"]),jv=d({name:o().min(1).max(120),code:o().max(2e5),enabled:A(),placement:m9,integrationId:o().optional()}),Rs=jv.extend({id:o(),createdAt:l(),updatedAt:l(),createdBy:o(),status:f9,lastError:o().optional(),lastChangedAt:l()}),h9=d({ok:A(),error:o().optional(),line:l().optional(),column:l().optional()}),g9={name:"core-blocks",scope:"system",mode:"singleton",methods:{list:y(d({}),d({blocks:w(Rs)}),{auth:"admin"}),get:y(d({blockId:o()}),d({block:Rs.nullable()}),{auth:"admin"}),create:y(d({block:jv}),d({block:Rs}),{kind:"mutation",auth:"admin",caller:"required"}),update:y(d({blockId:o(),block:jv.partial()}),d({block:Rs}),{kind:"mutation",auth:"admin",caller:"required"}),delete:y(d({blockId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setEnabled:y(d({blockId:o(),enabled:A()}),d({block:Rs}),{kind:"mutation",auth:"admin"}),restart:y(d({blockId:o()}),d({block:Rs}),{kind:"mutation",auth:"admin"}),compile:y(d({code:o()}),h9,{kind:"mutation",auth:"admin"}),getTypeDefs:y(d({}),d({libs:w(d({filePath:o(),content:o()}))}),{auth:"admin"})}},v9=d({stepId:o(),entry:xb}),y9={name:"custom-model-registry",scope:"system",mode:"collection",internal:!0,methods:{listModels:y(O(),w(v9).readonly(),{auth:"admin"})}},Or=d({where:Y(o(),X()).optional(),whereIn:Y(o(),w(X())).optional(),whereBetween:Y(o(),nu([X(),X()])).optional(),whereNot:Y(o(),X()).optional(),whereNotIn:Y(o(),w(X())).optional(),orderBy:d({field:o(),direction:N(["asc","desc"])}).optional(),limit:l().optional(),offset:l().optional()}),qp=d({where:Y(o(),X()).optional(),whereIn:Y(o(),w(X())).optional(),whereBetween:Y(o(),nu([X(),X()])).optional(),whereNot:Y(o(),X()).optional(),whereNotIn:Y(o(),w(X())).optional()}),IR=d({as:o().min(1),field:o().min(1),op:N(["sum","min","max"])}),TR=d({count:l().int(),values:Y(o(),l().nullable())}),_R=d({id:o(),data:Y(o(),X())}),Bp=d({id:o().optional(),data:Y(o(),X())}),NR=d({name:o(),type:N(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:A().optional(),notNull:A().optional(),unique:A().optional(),defaultValue:Ye([o(),l(),A()]).optional()}),OR=d({name:o(),columns:w(o()).readonly(),unique:A().optional()}),b9={name:"settings-store",scope:"system",mode:"singleton",methods:{get:y(d({namespace:o().optional(),collection:o(),key:o()}),X()),set:y(d({namespace:o().optional(),collection:o(),key:o(),value:X()}),O(),{kind:"mutation"}),query:y(d({namespace:o().optional(),collection:o(),filter:Or.optional(),columns:w(o()).readonly().optional()}),w(_R).readonly()),upsert:y(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:Bp}),d({id:Ye([o(),l()])}),{kind:"mutation"}),insert:y(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:Y(o(),X())})}),d({id:Ye([o(),l()])}),{kind:"mutation"}),insertMany:y(d({namespace:o().optional(),collection:o(),records:w(Bp).readonly()}),d({inserted:l().int()}),{kind:"mutation"}),update:y(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),X())}),O(),{kind:"mutation"}),delete:y(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation"}),deleteWhere:y(d({namespace:o().optional(),collection:o(),filter:qp}),d({deleted:l().int()}),{kind:"mutation"}),updateWhere:y(d({namespace:o().optional(),collection:o(),filter:qp,data:Y(o(),X())}),d({updated:l().int()}),{kind:"mutation"}),count:y(d({namespace:o().optional(),collection:o(),filter:Or.optional()}),l()),aggregate:y(d({namespace:o().optional(),collection:o(),fields:w(IR).readonly(),filter:Or.optional()}),TR),histogram:y(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:Or.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly()),isEmpty:y(d({namespace:o().optional(),collection:o()}),A()),declareCollection:y(d({namespace:o().optional(),collection:o(),columns:w(NR).readonly(),indexes:w(OR).readonly().optional()}),O(),{kind:"mutation"})}},S9=d({engineId:o(),kind:N(["relational","vector"]),displayName:o()}),x9={name:"data-store-provider",scope:"system",mode:"collection",internal:!0,methods:{getEngineInfo:y(O(),S9,{auth:"admin"}),get:y(d({namespace:o().optional(),collection:o(),key:o()}),X(),{auth:"admin"}),set:y(d({namespace:o().optional(),collection:o(),key:o(),value:X()}),O(),{kind:"mutation",auth:"admin"}),query:y(d({namespace:o().optional(),collection:o(),filter:Or.optional(),columns:w(o()).readonly().optional()}),w(_R).readonly(),{auth:"admin"}),insert:y(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:Y(o(),X())})}),d({id:Ye([o(),l()])}),{kind:"mutation",auth:"admin"}),upsert:y(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:Bp}),d({id:Ye([o(),l()])}),{kind:"mutation",auth:"admin"}),insertMany:y(d({namespace:o().optional(),collection:o(),records:w(Bp).readonly()}),d({inserted:l().int()}),{kind:"mutation",auth:"admin"}),update:y(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),X())}),O(),{kind:"mutation",auth:"admin"}),delete:y(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation",auth:"admin"}),deleteWhere:y(d({namespace:o().optional(),collection:o(),filter:qp}),d({deleted:l().int()}),{kind:"mutation",auth:"admin"}),updateWhere:y(d({namespace:o().optional(),collection:o(),filter:qp,data:Y(o(),X())}),d({updated:l().int()}),{kind:"mutation",auth:"admin"}),count:y(d({namespace:o().optional(),collection:o(),filter:Or.optional()}),l(),{auth:"admin"}),aggregate:y(d({namespace:o().optional(),collection:o(),fields:w(IR).readonly(),filter:Or.optional()}),TR,{auth:"admin"}),histogram:y(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:Or.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly(),{auth:"admin"}),isEmpty:y(d({namespace:o().optional(),collection:o()}),A(),{auth:"admin"}),declareCollection:y(d({namespace:o().optional(),collection:o(),columns:w(NR).readonly(),indexes:w(OR).readonly().optional()}),O(),{kind:"mutation",auth:"admin"})}},k9=d({sessionId:o(),slotCount:l().int(),slotByteLength:l().int(),segmentBytes:l().int(),budgetMb:l().int(),framesWritten:l().int(),getFrameHits:l().int(),getFrameMisses:l().int()}),w9={name:"decoder",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{supportsCodec:y(d({codec:o()}),A()),getInfo:y(O(),d({id:o(),name:o(),isPullMode:A().optional(),priority:l().optional(),hwaccel:o().optional(),probedBestHwaccel:o().optional()})),createSession:y(fw,d({sessionId:o(),nodeId:o()})),destroySession:y(d({sessionId:o()}),O()),pushPacket:y(d({sessionId:o(),packet:w8}),O()),openStream:y(d({sessionId:o(),url:o()}),O()),pullFrames:y(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(rw)),pullHandles:y(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(Vi)),getFrame:y(d({handle:Vi}),rw.nullable()),getShmStats:y(d({sessionId:o()}),k9.nullable()),updateConfig:y(d({sessionId:o(),config:fw.partial()}),O()),getStats:y(d({sessionId:o()}),eB),listActiveSessions:y(O(),w(d({sessionId:o(),codec:o(),outputFormat:o(),createdAtMs:l()})).readonly()),reprobeHwaccel:y(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},M9={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{}},ou=d({id:o(),system:o(),uniqueId:o().optional(),raw:Y(o(),X()).optional()}),C9=N(["online","sleeping","offline","unknown"]),el=au(()=>d({childNativeId:o(),name:o(),type:N(H),status:C9,metadata:d({model:o().optional(),serialNumber:o().optional(),uid:o().optional(),rtspChannel:l().int().nonnegative().optional(),isBattery:A().optional(),isDoorbell:A().optional(),isMultifocal:A().optional(),externalLocation:o().optional(),manufacturer:o().optional(),integration:o().optional()}).default({}),alreadyAdopted:A(),adoptedDeviceId:l().int().nonnegative().nullable(),capabilities:w(o()).readonly().optional(),features:w(o()).readonly().optional(),sourceInfo:ou.optional(),children:w(el).readonly().optional()})),Cw=d({discovered:w(el),lastDiscoveryAt:l().int().nonnegative().nullable(),lastError:o().nullable()}),A9={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Hub],status:{schema:Cw,kind:"poll"},runtimeState:Cw.extend({lastFetchedAt:l().int().nonnegative()}),durability:"session",methods:{listDiscovered:y(d({deviceId:l().int().nonnegative()}),w(el).readonly()),refreshDiscovery:y(d({deviceId:l().int().nonnegative()}),w(el).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:y(d({deviceId:l().int().nonnegative(),childNativeId:o(),name:o().optional()}),d({deviceId:l().int().nonnegative(),stableId:o()}),{kind:"mutation",auth:"admin"}),releaseDevice:y(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})}},PR=d({id:o(),label:o(),isDefault:A().optional()}),E9=d({search:o().optional(),area:o().optional(),manufacturer:o().optional(),adoptedOnly:A().optional(),unadoptedOnly:A().optional()}),jR=d({integrationId:o(),page:l().int().positive().default(1),pageSize:l().int().positive().max(2e4).default(50),filter:o().optional(),filterText:E9.optional()}),DR=d({candidates:w(el).readonly(),totalCount:l().int().nonnegative(),page:l().int().positive(),pageSize:l().int().positive()}),R9=d({integrationId:o(),childNativeId:o()}),Dv=d({lastDiscoveryAt:l().int().nonnegative().nullable(),candidateCount:l().int().nonnegative(),adoptedCount:l().int().nonnegative(),lastError:o().nullable()}),I9=d({name:o().min(1).optional(),hiddenChildIds:w(o()).optional()}),zv=d({integrationId:o(),childNativeIds:w(o()).min(1),filter:o().optional(),importLocations:A().optional(),perCandidate:Y(o(),I9).optional()}),zR=d({adopted:w(d({childNativeId:o(),parentDeviceId:l().int().nonnegative(),accessoryDeviceIds:w(l().int().nonnegative()).readonly()})).readonly()}),LR=d({integrationId:o(),camDeviceId:l().int().nonnegative()}),qR=d({camDeviceId:l().int().nonnegative(),resetToSource:A().optional()}),BR=d({changed:A(),rebuiltChildren:l().int().nonnegative(),removedChildren:l().int().nonnegative().optional()}),T9={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:Dv,kind:"poll"},methods:{listCandidateFilters:y(d({integrationId:o()}),d({filters:w(PR)}),{auth:"admin"}),listCandidates:y(jR,DR,{auth:"admin"}),getCandidate:y(R9,el.nullable(),{auth:"admin"}),refresh:y(d({integrationId:o()}),Dv,{kind:"mutation",auth:"admin"}),adopt:y(zv,zR,{kind:"mutation",auth:"admin"}),release:y(LR,O(),{kind:"mutation",auth:"admin"}),resync:y(qR,BR,{kind:"mutation",auth:"admin"})}},_9=N(["unlinked","linked","error"]),N9=d({label:o(),value:o(),secret:A().optional()}),O9=d({qr:o().optional(),fields:w(N9).readonly().optional(),note:o().optional()}),Aw=d({linkState:_9,exposedDeviceCount:l(),error:o().optional(),setup:O9.optional()}),P9=o(),j9=d({deviceId:o(),exposedAs:o().optional(),capabilities:w(o()).optional()}),D9=d({deviceId:o(),capabilities:w(o()).optional()}),z9=d({deviceId:o()}),L9={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:Aw,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:y(O(),Aw),listSupportedDeviceKinds:y(O(),w(P9)),listExposedDevices:y(O(),w(j9)),exposeDevice:y(D9,O(),{kind:"mutation"}),unexposeDevice:y(z9,O(),{kind:"mutation"})}},q9=d({connected:A(),deviceCount:l(),error:o().optional()});d({externalId:o(),name:o(),type:o(),metadata:Y(o(),X()).optional()});var qs=d({stableId:o(),type:N(H),suggestedName:o(),prefilledConfig:Y(o(),X()),sourceInfo:ou.optional(),alreadyOnboarded:A().optional(),onboardedDeviceId:l().optional(),onboardedName:o().optional()}),Up=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),parentDeviceId:l().nullable(),online:A(),features:w(o()),config:Y(o(),X()),sourceInfo:ou.optional()}),Lv=d({status:N(["ok","error"]),labels:w(o()).optional(),error:o().optional()}),Ew=X(),B9={name:"device-provider",scope:"system",mode:"collection",methods:{start:y(O(),O(),{kind:"mutation"}),stop:y(O(),O(),{kind:"mutation"}),getStatus:y(O(),q9),getDevices:y(O(),w(d({id:o(),name:o(),type:o()}))),reloadDevice:y(d({stableId:o()}),d({deviceId:l()}),{kind:"mutation",timeoutMs:3*6e4}),supportsDiscovery:y(d({}),A()),discoverDevices:y(d({params:Y(o(),X()).optional()}),w(qs),{kind:"mutation",auth:"admin"}),getDiscoveryParamsSchema:y(d({}),Ew),getManualCreationType:y(d({}),d({deviceType:N(H).nullable()})),adoptDiscoveredDevice:y(d({candidate:qs}),Up,{kind:"mutation",auth:"admin"}),supportsManualCreation:y(d({}),A()),getChildCreationSchema:y(d({type:N(H)}),Ew),createDevice:y(d({type:N(H),config:Y(o(),X())}),Up,{kind:"mutation",auth:"admin"}),testCreationField:y(d({type:N(H),key:o(),value:X(),formValues:Y(o(),X()).optional()}),Lv,{kind:"mutation",auth:"admin"})}},Mb=d({childKey:o(),section:o(),order:l().optional(),collapsed:A().optional()}),U9=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional()}),Cb=d({icon:o().min(1).optional(),label:o().min(1).optional(),unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),hidden:A().optional(),perCap:Y(o(),U9).optional()}),Rw=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),icon:o().min(1).optional()}),qd=d({id:l(),stableId:o(),addonId:o(),type:N(H),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),online:A(),probed:A().optional(),features:w(o()),isCamera:A(),config:Y(o(),X()),metadata:Y(o(),X()).nullable().optional(),sourceInfo:ou.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Mb).readonly().optional(),display:Cb.optional()}),F9=d({key:o(),value:X(),description:o().optional()}),UR=N(["manual"]),FR=d({deviceId:l(),name:o(),location:o().nullable(),features:w(o()),producesTrackedEvents:A().optional()}),H9=d({deviceId:l(),mode:UR,devices:w(FR)}),Yh=d({deviceId:l(),entries:w(d({capName:o(),kind:N(["native","wrapped"]),providerAddonId:o(),providerNodeId:o(),nativeAddonId:o()}))}),$9=d({id:l(),stableId:o(),type:o(),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional()}),Q9=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),userNamed:A().optional(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),metadata:Y(o(),X()).nullable().optional(),sourceInfo:ou.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Mb).readonly().optional(),role:o().nullable().optional(),display:Cb.optional()}),V9=X().nullable(),G9=d({streamId:o(),width:l().optional(),height:l().optional(),codec:o().optional(),fps:l().optional(),bitrateKbps:l().optional()}),Z9=d({addonId:o(),stableId:o(),id:l(),type:o(),name:o(),location:o().nullable().optional(),disabled:A().optional(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),config:Y(o(),X())}),W9=d({deviceId:l()}),K9=d({deviceId:l(),data:Y(o(),X())}),Y9=N(["off","on","not-offered","unreachable"]),X9=d({deviceId:l(),switchId:iu,outcome:Y9,detail:o().optional()}),J9=d({sourceId:l(),targetId:l(),switches:w(X9).readonly(),sourceStillLive:w(iu).readonly(),swapped:A()}),eU={name:"device-manager",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{allocateDeviceId:y(d({addonId:o(),stableId:o()}),d({id:l()}),{kind:"mutation"}),migrateDevice:y(d({sourceId:l(),targetId:l()}),J9,{kind:"mutation",auth:"admin",timeoutMs:12*6e4}),registerDevice:y(Z9,O(),{kind:"mutation"}),removeDevice:y(W9,O(),{kind:"mutation"}),persistConfig:y(K9,O(),{kind:"mutation"}),loadConfig:y(d({deviceId:l()}),Y(o(),X())),loadRuntimeState:y(d({deviceId:l()}),Y(o(),X())),loadMeta:y(d({deviceId:l()}),Q9.nullable()),setName:y(d({deviceId:l(),name:o()}),O(),{kind:"mutation",auth:"admin"}),setLocation:y(d({deviceId:l(),location:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setType:y(d({deviceId:l(),type:N(H)}),O(),{kind:"mutation",auth:"admin"}),setIntegrationId:y(d({deviceId:l(),integrationId:o()}),O(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:y(d({deviceId:l(),linkDeviceId:l().nullable()}),O(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:y(d({deviceId:l(),primaryChildEntityId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setChildLayout:y(d({deviceId:l(),childLayout:w(Mb).readonly()}),O(),{kind:"mutation",auth:"admin"}),setDisplay:y(d({deviceId:l(),display:Cb.nullable()}),O(),{kind:"mutation",auth:"admin"}),getRoleDisplayDefaults:y(d({}),d({defaults:Y(o(),Rw)}),{kind:"query"}),setRoleDisplayDefaults:y(d({defaults:Y(o(),Rw)}),O(),{kind:"mutation",auth:"admin"}),getWireableFields:y(d({deviceId:l(),includeSynthesizable:A().optional()}),d({caps:w(d({cap:o(),fields:w(d({path:o(),kind:N(["string","number","boolean","enum"]),enumValues:w(o()).optional(),item:A().optional()})).readonly(),itemArray:d({path:o(),keyField:o()}).optional()})).readonly()}),{kind:"query"}),setRole:y(d({deviceId:l(),role:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),applyInitialMeta:y(d({deviceId:l(),name:o().optional(),location:o().nullable().optional(),type:N(H).optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),role:o().nullable().optional()}),O(),{kind:"mutation",auth:"admin"}),setMetadata:y(d({deviceId:l(),patch:Y(o(),X())}),O(),{kind:"mutation",auth:"admin"}),listLocations:y(O(),w(o())),addLocation:y(d({name:o()}),O(),{kind:"mutation",auth:"admin"}),removeLocation:y(d({name:o(),cascade:A().optional()}),O(),{kind:"mutation",auth:"admin"}),renameLocation:y(d({from:o(),to:o()}),d({moved:l()}),{kind:"mutation",auth:"admin"}),setDisabled:y(d({deviceId:l(),disabled:A()}),O(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:y(d({addonId:o()}),w($9)),listAll:y(d({addonId:o().optional(),projection:N(["full","slim"]).optional(),isCamera:A().optional(),deviceIds:w(l()).optional()}),w(qd)),getDevice:y(d({deviceId:l()}),qd.nullable()),getChildren:y(d({parentDeviceId:l()}),w(qd)),getChildrenBatch:y(d({parentDeviceIds:w(l()).max(256)}),Y(o(),w(qd))),getLinkedDevices:y(d({deviceId:l()}),d({mode:UR,devices:w(FR)})),getLinkedDevicesBatch:y(d({deviceIds:w(l())}),w(H9)),getStreamSources:y(d({deviceId:l()}),w(k8)),getConfigSchema:y(d({deviceId:l()}),w(F9)),getSettingsSchema:y(d({deviceId:l()}),V9),updateConfig:y(d({deviceId:l(),values:Y(o(),X())}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),enable:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),disable:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),remove:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:y(d({integrationId:o()}),d({removed:l()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:y(d({deviceId:l()}),Y(o(),o().nullable())),setStreamProfileMap:y(d({deviceId:l(),profileMap:Y(o(),o().nullable())}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:y(d({deviceId:l()}),w(G9),{kind:"mutation",auth:"admin"}),getBindings:y(d({deviceId:l()}),Yh),getBindingsBatch:y(d({deviceIds:w(l())}),w(Yh)),getAllBindings:y(d({}),w(Yh)),setWrapperActive:y(d({deviceId:l(),capName:o(),wrapperAddonId:o(),active:A()}),O(),{kind:"mutation",auth:"admin"}),listWrappersForCap:y(d({capName:o()}),w(o())),listBindableCapsForDeviceType:y(d({deviceType:o()}),w(d({capName:o(),wrappers:w(o())}))),getDeviceSettingsAggregate:y(d({deviceId:l()}),ko.nullable()),getDeviceLiveInfoAggregate:y(d({deviceId:l()}),ko.nullable()),getDeviceAggregate:y(d({deviceId:l()}),d({settings:ko.nullable(),live:ko.nullable()})),runDeviceAction:y(d({deviceId:l().int().nonnegative(),action:o().min(1),input:X()}),X(),{kind:"mutation"}),updateDeviceField:y(d({deviceId:l(),writerCapName:o(),writerAddonId:o(),key:o(),value:X()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:y(d({deviceId:l(),changes:w(d({writerCapName:o(),writerAddonId:o(),key:o(),value:X()}))}),d({success:Q(!0),failures:w(d({writerCapName:o(),writerAddonId:o(),error:o()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:y(d({addonId:o()}),w(qs),{kind:"mutation",auth:"admin"}),adoptDevice:y(d({addonId:o(),candidate:qs,integrationId:o().optional()}),Up,{kind:"mutation",auth:"admin"}),getCreationSchema:y(d({addonId:o(),type:N(H)}),X().nullable()),createDevice:y(d({addonId:o(),type:N(H),config:Y(o(),X()),integrationId:o().optional()}),Up,{kind:"mutation",auth:"admin"}),testCreationField:y(d({addonId:o(),type:N(H),key:o(),value:X(),formValues:Y(o(),X()).optional()}),Lv,{kind:"mutation",auth:"admin"}),adoptionListCandidateFilters:y(d({addonId:o(),integrationId:o()}),d({filters:w(PR)}),{auth:"admin"}),adoptionListCandidates:y(jR.extend({addonId:o()}),DR,{auth:"admin"}),adoptionRefresh:y(d({addonId:o(),integrationId:o()}),Dv,{kind:"mutation",auth:"admin"}),adoptionAdopt:y(zv.extend({addonId:o()}),zR,{kind:"mutation",auth:"admin"}),adoptionRelease:y(LR.extend({addonId:o()}),O(),{kind:"mutation",auth:"admin"}),adoptionStartJob:y(zv.extend({addonId:o()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),adoptionListJobs:y(d({addonId:o(),integrationId:o().optional()}),w(aq).readonly(),{auth:"admin"}),adoptionCancelJob:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),adoptionResync:y(qR,BR,{kind:"mutation",auth:"admin"}),discoveryProviders:y(d({}),d({providers:w(d({addonId:o(),label:o()})).readonly()}),{auth:"admin"}),discoverAllProviders:y(d({}),d({groups:w(d({addonId:o(),label:o(),candidates:w(qs).readonly(),error:o().nullable()})).readonly()}),{kind:"mutation",auth:"admin"}),discoverProvider:y(d({addonId:o(),params:Y(o(),X()).optional()}),d({candidates:w(qs).readonly()}),{kind:"mutation",auth:"admin"}),providerCreationType:y(d({addonId:o()}),d({deviceType:N(H).nullable()}),{auth:"admin"}),providerDiscoveryParamsSchema:y(d({addonId:o()}),X(),{auth:"admin"}),testField:y(d({deviceId:l(),key:o(),value:X()}),Lv,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:y(d({deviceId:l(),caps:w(o()).readonly().optional()}),Y(o(),X().nullable())),getDeviceStatusAggregateBatch:y(d({deviceIds:w(l()).readonly(),caps:w(o()).readonly().optional()}),Y(o(),Y(o(),X().nullable())))}},tU={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:y(d({deviceId:l()}),Y(o(),Y(o(),X()))),getCapSlice:y(d({deviceId:l(),capName:o()}),Y(o(),X()).nullable()),getAllSnapshots:y(d({}),Y(o(),Y(o(),Y(o(),X())))),setCapSlice:y(d({deviceId:l(),capName:o(),slice:Y(o(),X())}),O(),{kind:"mutation"})},events:{onChanged:Ao(d({deviceId:l(),capName:o(),slice:Y(o(),X())}))}},Iw=d({embedding:w(l()),inferenceMs:l()}),nU=d({modelId:o(),embeddingDim:l(),ready:A()}),aU={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:y(d({crop:$t(Uint8Array),width:l(),height:l()}),Iw,{auth:"admin"}),encodeText:y(d({text:o()}),Iw,{auth:"admin"}),getInfo:y(O(),nU,{auth:"admin"})}},iU=d({reason:o(),count:l().int().nonnegative()}),HR=d({family:o(),deviceId:l().int().positive(),variant:o().optional(),sinceMs:l(),atMs:l(),attempts:l().int().nonnegative(),succeeded:l().int().nonnegative(),reasons:w(iU).readonly()}),rU={name:"failure-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:y(O(),w(HR).readonly())},mount:{kind:"skip"}},oU=d({name:o(),path:o()}),sU=d({path:o(),entries:w(oU).readonly(),freeBytes:l(),totalBytes:l()}),lU={name:"filesystem-browse",scope:"system",mode:"singleton",internal:!0,methods:{listAllowedRoots:y(O(),w(o()).readonly(),{auth:"admin"}),browse:y(d({path:o()}),sU,{auth:"admin"}),createDir:y(d({path:o()}),d({path:o()}),{kind:"mutation",auth:"admin"})}},Ec=6e5,cU=60*6e4,uU=d({inputTokens:l(),outputTokens:l()}),dU=N(["timeout","rate-limited","auth","refusal","bad-request","unavailable","no-profile","budget-exceeded","adapter-error"]),pU=d({ok:Q(!0),text:o(),model:o(),usage:uU,truncated:A(),latencyMs:l()}),mU=d({ok:Q(!1),code:dU,message:o(),retryAfterMs:l().optional()}),cp=kt("ok",[pU,mU]),$R=d({bytes:$t(Uint8Array),mimeType:o()}),QR=d({enabled:A().default(!1),maxAttempts:l().int().min(1).max(5).default(1)}),Ab=d({addonId:o().optional(),profileId:o().optional(),consumer:o(),system:o().optional(),prompt:o(),jsonSchema:Y(o(),X()).optional(),maxTokens:l().int().positive().optional(),temperature:l().optional(),topP:l().min(0).max(1).optional(),topK:l().int().positive().optional(),timeoutMs:l().int().positive().optional(),retry:QR.optional(),requestId:o().optional()}),fU=d({url:o(),filename:o(),sizeBytes:l(),sha256:o().optional()}),bm=kt("kind",[d({kind:Q("catalog"),catalogId:o()}),d({kind:Q("url"),url:o(),sha256:o().optional(),label:o().optional(),sizeBytes:l().optional(),extraFiles:w(fU).optional()}),d({kind:Q("path"),path:o()})]),Eb=d({nodeId:o(),engine:N(["llama-cpp"]),model:bm,contextSize:l().int().default(4096),gpuLayers:l().int().default(0),threads:l().int().optional(),parallel:l().int().default(1),batchSize:l().int().positive().optional(),ubatchSize:l().int().positive().optional(),flashAttention:A().default(!1),mlock:A().default(!1),noMmap:A().default(!1),cacheTypeK:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),cacheTypeV:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),extraArgs:w(o()).default([]),autoStart:A().default(!1),idleStopMinutes:l().int().default(30)}),hU=d({phase:N(["downloading","verifying"]),file:o(),fileIndex:l().int(),fileCount:l().int(),downloadedBytes:l(),totalBytes:l().optional()}),qc=d({nodeId:o(),state:N(["stopped","downloading","starting","ready","crashed","failed"]),pid:l().optional(),port:l().optional(),modelPath:o().optional(),modelId:o().optional(),downloadProgress:l().min(0).max(1).optional(),download:hU.optional(),lastError:o().optional(),crashesInWindow:l(),memoryBytes:l().optional(),vramBytes:l().optional()}),VR=d({file:o(),sizeBytes:l(),catalogId:o().optional(),installedAt:l().optional(),path:o().optional()}),GR=d({nodeId:o(),modelsBytes:l(),freeBytes:l().optional()}),gU=Ab.extend({images:w($R).optional(),runtime:Eb,timeoutMs:l().int().positive().optional()}),vU={name:"llm-runtime",scope:"system",mode:"singleton",internal:!0,methods:{complete:y(gU,cp,{kind:"mutation",auth:"admin",timeoutMs:Ec}),ensureStarted:y(d({runtime:Eb}),qc,{kind:"mutation",auth:"admin",timeoutMs:Ec}),stop:y(d({}),O(),{kind:"mutation",auth:"admin"}),status:y(d({}),qc,{auth:"admin"}),installModel:y(d({model:bm}),O(),{kind:"mutation",auth:"admin",timeoutMs:cU}),deleteModel:y(d({file:o()}),O(),{kind:"mutation",auth:"admin"}),listLocalModels:y(d({}),w(VR),{auth:"admin"}),getDiskUsage:y(d({}),GR,{auth:"admin"})}},ZR=N(["openai-compatible","openai","anthropic","google","managed-local"]),Xh=d({id:o(),name:o(),kind:ZR,addonId:o(),enabled:A(),model:o(),baseUrl:o().optional(),apiKey:o().optional(),supportsVision:A(),temperature:l().min(0).max(2).optional(),topP:l().min(0).max(1).optional(),topK:l().int().positive().optional(),maxTokens:l().int().positive().optional(),contextLength:l().int().positive().optional(),systemPrompt:o().optional(),timeoutMs:l().int().positive().default(6e4),connectTimeoutMs:l().int().positive().default(1e4),firstTokenTimeoutMs:l().int().positive().default(12e4),idleTimeoutMs:l().int().positive().default(6e4),retry:QR.default({enabled:!1,maxAttempts:1}),toolsEnabled:A().default(!1),extraHeaders:Y(o(),o()).optional(),runtime:Eb.optional()}),yU=X(),bU=d({kind:ZR,label:o(),icon:o(),addonId:o(),configSchema:yU}),WR=Ye([d({consumer:o()}),d({purpose:N(["text","vision"])})]),SU=d({selector:WR,profileId:o()}),xU=d({day:o(),consumer:o(),profileId:o(),calls:l(),okCalls:l(),errorCalls:l(),inputTokens:l(),outputTokens:l(),avgLatencyMs:l()}),kU=d({id:o(),label:o(),family:o(),purpose:N(["text","vision"]),url:o(),sha256:o(),sizeBytes:l(),quantization:o(),minRamBytes:l(),contextSizeDefault:l().int(),mmprojUrl:o().optional()}),wU=kt("ok",[d({ok:Q(!0),model:bm,label:o(),repo:o(),quantization:o(),purpose:N(["text","vision"]),totalBytes:l(),extraFilenames:w(o())}),d({ok:Q(!1),code:o(),message:o(),candidates:w(o()).optional(),requiredBytes:l().optional()})]),MU=d({nodeId:o(),reachable:A(),status:qc.optional(),disk:GR.optional(),error:o().optional()}),CU=Ab.extend({images:w($R).min(1)}),Is=d({addonId:o(),profileId:o()}),AU={name:"llm",scope:"system",mode:"collection",internal:!1,providerKind:"ai",nodeIdMode:"data",methods:{generate:y(Ab,cp,{kind:"mutation",timeoutMs:Ec}),generateVision:y(CU,cp,{kind:"mutation",timeoutMs:Ec}),cancel:y(d({addonId:o().optional(),requestId:o()}),O(),{kind:"mutation"}),listProfileKinds:y(d({}),w(bU)),listProfiles:y(d({}),w(Xh)),upsertProfile:y(d({profile:Xh}),Xh,{kind:"mutation",auth:"admin"}),deleteProfile:y(Is,O(),{kind:"mutation",auth:"admin"}),testProfile:y(Is,cp,{kind:"mutation",auth:"admin",timeoutMs:Ec}),listModels:y(Is,w(o())),getDefaults:y(d({}),w(SU)),setDefault:y(d({selector:WR,profileId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),getUsage:y(d({since:l().optional(),until:l().optional(),consumer:o().optional(),profileId:o().optional()}),w(xU)),listModelCatalog:y(d({}),w(kU)),listRuntimeNodes:y(d({}),w(MU)),listNodeModels:y(d({nodeId:o()}),w(VR)),resolveModelRef:y(d({ref:o(),maxBytes:l().positive().optional()}),wU,{kind:"mutation",auth:"admin"}),installModel:y(d({nodeId:o(),model:bm}),O(),{kind:"mutation",auth:"admin"}),deleteModel:y(d({nodeId:o(),file:o()}),O(),{kind:"mutation",auth:"admin"}),getRuntimeStatus:y(Is,qc),startRuntime:y(Is,qc,{kind:"mutation",auth:"admin"}),stopRuntime:y(Is,O(),{kind:"mutation",auth:"admin"})}},EU=["decode","transcode","recording","streaming","detection"],RU=["measured","accounted","unattributable"],KR=d({role:N(EU),deviceId:l().int().positive().nullable(),attribution:N(RU),unit:o(),pid:l().int().positive().optional(),startedAtMs:l().optional(),cpuSeconds:l().optional(),rssBytes:l().optional()}),IU={name:"load-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:y(O(),w(KR).readonly())},mount:{kind:"skip"}},TU=d({armed:l().int().min(0),unknown:w(o()).readonly()}),_U={name:"log-channels",scope:"system",mode:"collection",internal:!0,methods:{list:y(O(),w(hR).readonly()),apply:y(d({windows:w(nB).readonly()}),TU,{kind:"mutation"})},mount:{kind:"skip"}},YR=N(["debug","info","warn","error"]),Tw=d({timestamp:Av(),level:YR,scope:w(o()),message:o(),meta:Y(o(),X()).optional(),tags:Y(o(),o()).optional()}),NU={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:y(Tw,O(),{kind:"mutation"}),query:y(d({scope:w(o()).optional(),level:YR.optional(),since:Av().optional(),until:Av().optional(),limit:l().optional(),tags:Y(o(),o()).optional()}),w(Tw).readonly())},mount:{kind:"skip"}},Rb=N(["primary","second-factor"]),OU=d({kind:Q("redirect"),id:o(),label:o(),icon:o().optional(),startUrl:o(),stage:Rb}),PU=d({kind:Q("widget"),id:o(),addonId:o(),bundle:o(),remote:wR,stage:Rb}),jU=d({kind:Q("passkey"),id:o(),label:o(),stage:Rb,rpId:o(),origin:o().nullable()}),DU=kt("kind",[OU,PU,jU]),zU={name:"login-method",scope:"system",mode:"collection",internal:!0,methods:{getLoginMethods:y(O(),w(DU).readonly())},mount:{kind:"skip"}},LU=d({total:l(),user:l(),system:l(),irq:l(),nice:l(),loadAvg:nu([l(),l(),l()]),cores:l()}),qU=d({percent:l(),totalBytes:l(),usedBytes:l(),availableBytes:l(),swapUsedBytes:l(),swapTotalBytes:l()}),BU=d({readBytes:l(),writeBytes:l(),readOps:l(),writeOps:l(),timestampMs:l()}),UU=d({rxBytes:l(),txBytes:l(),rxPackets:l(),txPackets:l(),rxErrors:l(),txErrors:l(),timestampMs:l()}),XR=d({utilization:l(),model:o(),memoryUsedBytes:l(),memoryTotalBytes:l(),temperature:l().nullable()}),FU=d({openFds:l(),threadCount:l(),activeHandles:l(),activeRequests:l()}),_w=d({avg10:l(),avg60:l(),avg300:l()}),Jh=d({some:_w,full:_w.nullable()}),Nw=d({cpu:LU,memory:qU,gpu:XR.nullable(),network:UU,disk:BU,pressure:d({cpu:Jh.nullable(),memory:Jh.nullable(),io:Jh.nullable()}),process:FU,cpuTemperature:l().nullable(),timestampMs:l()}),HU=d({path:o(),totalBytes:l(),usedBytes:l(),availableBytes:l(),percent:l()}),Ow=d({pid:l(),cpu:l(),memory:l(),privateBytes:l().optional(),sharedBytes:l().optional()}),$U=d({addonId:o(),nodeId:o(),role:N(["hub","worker"]),pid:l(),state:N(["starting","running","stopping","stopped","crashed"]),uptimeSec:l()}),QU=d({pid:l(),ppid:l(),pgid:l(),classification:N(["root","managed","system"]),addonId:o().nullable(),nodeId:o().nullable(),command:o(),cpuPercent:l(),memoryRssBytes:l(),cpuMainPercent:l().nullable(),cpuGcPercent:l().nullable(),threadCount:l().nullable(),uptimeSec:l()}),VU=d({source:N(["cgroup-v2","cgroup-v1"]),currentBytes:l(),limitBytes:l().nullable(),anonBytes:l().nullable(),fileBytes:l().nullable(),shmemBytes:l().nullable(),slabBytes:l().nullable(),gpuShmemBytes:l().nullable()}).extend({atMs:l()}),GU=d({atMs:l(),samples:l().int(),cpuMainPercent:l().nullable(),cpuMainPercentMin:l().nullable(),cpuGcPercent:l().nullable(),cpuGcPercentMin:l().nullable(),cpuLifetimePercent:l(),cpuLifetimePercentMin:l(),memoryRssBytes:l(),memoryRssBytesMin:l(),processCount:l().int(),processCountMin:l().int()}),ZU=d({key:o(),kind:N(["addon","root","unattributed"]),points:w(GU).readonly()}),WU=d({nodeId:o(),series:w(ZU).readonly(),containerMemory:w(VU).readonly(),bucketMs:l(),retainedSamples:l(),oldestAtMs:l().nullable(),cadenceMs:l(),durable:A()}),KU=d({forNodeId:o(),sinceMs:l().optional(),maxPoints:l().int().positive().optional()}),YU=d({cpuPercent:l(),memoryPercent:l(),memoryUsedMB:l(),memoryTotalMB:l(),diskPercent:l().optional(),temperature:l().optional(),gpuPercent:l().optional(),gpuMemoryPercent:l().optional()}),XU={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:y(O(),Nw),getCached:y(O(),Nw.nullable()),getCurrent:y(O(),YU),getDiskSpace:y(d({dirPath:o()}),HU),getGpuInfo:y(O(),XR.nullable()),getCpuTemperature:y(O(),l().nullable()),getProcessStats:y(d({pids:w(l())}),w(Ow)),listAddonInstances:y(O(),w($U).readonly()),getAddonStats:y(d({addonId:o()}),Ow.nullable()),listNodeProcesses:y(O(),w(QU).readonly()),getLoadSeries:y(KU,WU)}},JU=d({sourceUrl:o(),metadata:sB,targets:w(oB).min(1).readonly(),calibrationRef:o().optional(),sessionId:o().optional()}),eF={name:"model-convert",scope:"system",mode:"singleton",internal:!0,methods:{convert:y(JU,cB,{kind:"mutation",auth:"admin",timeoutMs:6e5})}},tF=d({nodeId:o(),modelId:o(),format:N(vm),entry:xb}),nF=d({ok:A(),sha256:o(),bytes:l(),path:o()}),aF={name:"model-distributor",scope:"system",mode:"singleton",internal:!0,methods:{distributeModel:y(tF,nF,{kind:"mutation",auth:"admin"})}},Fp=d({bbox:Xi,pixelCount:l(),intensity:l()}),iF=d({detected:A(),regionCount:l(),regions:w(Fp).readonly(),rawRegions:w(Fp).readonly(),frameWidth:l(),frameHeight:l(),analysisMs:l()}),rF={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{analyze:y(d({deviceId:l(),frame:_v.optional(),frameHandle:Vi.optional()}),iF,{kind:"mutation"}),removeCamera:y(d({deviceId:l()}),O(),{kind:"mutation"}),reset:y(O(),O(),{kind:"mutation"})},events:{onMotion:{data:d({deviceId:l(),detected:A(),regionCount:l()})}}},oF=N(["external","embedded"]),sF=N(["connected","disconnected","auth-failed","unreachable","tls-error"]),lF=d({id:o(),name:o(),url:o(),kind:oF,status:sF,latencyMs:l().nullable(),error:o().optional(),connectedClients:l().int().nonnegative().optional(),lastCheckedAt:l().optional()}),cF=d({url:o(),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),uF=d({name:o().min(1),url:o().regex(/^(mqtt|mqtts|ws|wss):\/\//,"URL must start with mqtt(s):// or ws(s)://"),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),dF=d({id:o()}),Bd=d({id:o()}),pF=kt("ok",[d({ok:Q(!0),latencyMs:l()}),d({ok:Q(!1),error:o()})]),mF=d({port:l().int().min(1).max(65535).default(1883),allowAnonymous:A().default(!1),username:o().optional(),password:o().optional()}),fF=d({id:o(),url:o()}),Pw=d({brokerCount:l(),embeddedRunning:A()}),hF={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Pw,kind:"poll"},methods:{listBrokers:y(O(),w(lF)),getBrokerConfig:y(Bd,cF),addBroker:y(uF,dF,{kind:"mutation"}),removeBroker:y(Bd,O(),{kind:"mutation"}),testConnection:y(Bd,pF,{kind:"mutation"}),startEmbeddedBroker:y(mF,fF,{kind:"mutation"}),stopEmbeddedBroker:y(Bd,O(),{kind:"mutation"}),getStatus:y(O(),Pw)}},Hp=d({url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),gF=d({connected:A(),endpoint:Hp.nullable(),error:o().optional()}),vF=Hp.extend({id:o(),label:o(),mode:o().optional(),sourcePort:l().optional()}),yF={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:y(O(),Hp,{kind:"mutation"}),stop:y(O(),O(),{kind:"mutation"}),getEndpoint:y(O(),Hp.nullable()),getStatus:y(O(),gF),listEndpoints:y(O(),w(vF).readonly())}},JR=N(["image","video","gif","audio","icon"]),bF=d({mediaType:JR,url:o().optional(),bytes:$t(Uint8Array).optional(),mime:o().optional(),name:o().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),Ib=N(["text","markdown","html"]),eI=N(["acknowledge","dismiss","silence","snooze","view","play","open","close","lock","unlock","arm","arm-home","arm-away","arm-night","disarm","light","alert","camera"]),SF=d({id:o(),label:o(),url:o().optional(),icon:eI.optional(),destructive:A().optional(),mode:N(["navigate","background"]).optional()}),jw=d({body:o(),title:o().optional(),format:Ib.default("text"),priority:l().int().min(1).max(5).default(3),level:o().optional(),attachments:w(bF).optional(),clickUrl:o().optional(),actions:w(SF).optional(),sound:o().optional(),ttl:l().optional(),tag:o().optional(),deviceId:l().optional(),eventId:o().optional(),metadata:Y(o(),X()).optional()}),xF=d({id:o(),label:o(),ordinal:l().int().min(1).max(5).nullable(),flags:d({critical:A().optional(),silent:A().optional(),noPush:A().optional()}).optional(),requires:w(o()).optional(),description:o().optional()}),kF=d({mediaTypes:w(JR),mode:N(["url","bytes","both"]),max:l().int().nonnegative(),maxBytes:l().int().positive().optional()}),wF=d({attachments:kF,actions:l().int().nonnegative(),actionIcons:A().optional(),levels:w(xF),format:w(Ib),clickUrl:A(),sound:A(),ttl:A(),bodyMaxLen:l().int().positive()}),MF=X(),CF=d({kind:o(),label:o(),icon:o(),addonId:o(),iconUrl:o().optional(),iconMediaType:o().optional(),configSchema:MF,supportsDiscovery:A(),caps:wF}),eg=d({id:o(),name:o(),kind:o(),addonId:o(),enabled:A(),config:Y(o(),X())}),AF=d({kind:o(),suggestedName:o(),config:Y(o(),X())}),EF=d({level:o(),format:Ib,attachmentsSent:l().int().nonnegative(),actionsSent:l().int().nonnegative(),truncated:A(),dropped:w(o())}),tI=d({success:A(),error:o().optional(),renderedAs:EF.optional()}),RF=tI,IF={name:"notification-output",scope:"system",mode:"collection",methods:{listTargetKinds:y(d({}),w(CF)),listTargets:y(d({}),w(eg)),discoverTargets:y(d({kind:o(),config:Y(o(),X()).optional()}),w(AF)),send:y(d({targetId:o(),notification:jw}),tI,{kind:"mutation"}),testTarget:y(d({targetId:o(),sample:jw.optional()}),RF,{kind:"mutation"}),upsertTarget:y(d({target:eg}),eg,{kind:"mutation"}),deleteTarget:y(d({targetId:o()}),O(),{kind:"mutation"}),setTargetEnabled:y(d({targetId:o(),enabled:A()}),O(),{kind:"mutation"})}},TF=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"},{id:"package",name:"Package"}];new Set(TF.map(e=>e.id));var _F={mapping:{person:"person",bicycle:"vehicle",car:"vehicle",motorcycle:"vehicle",airplane:"vehicle",bus:"vehicle",train:"vehicle",truck:"vehicle",boat:"vehicle",bird:"animal",cat:"animal",dog:"animal",horse:"animal",sheep:"animal",cow:"animal",elephant:"animal",bear:"animal",zebra:"animal",giraffe:"animal",suitcase:"package",backpack:"package",handbag:"package"}},NF=[{id:"speech",name:"Speech"},{id:"scream",name:"Scream / Shout"},{id:"crying",name:"Crying / Baby"},{id:"laughter",name:"Laughter"},{id:"music",name:"Music"},{id:"dog",name:"Dog"},{id:"cat",name:"Cat"},{id:"bird",name:"Bird"},{id:"animal",name:"Animal (other)"},{id:"alarm",name:"Alarm / Siren"},{id:"doorbell",name:"Doorbell / Knock"},{id:"glass_breaking",name:"Glass Breaking"},{id:"gunshot",name:"Gunshot / Explosion"},{id:"vehicle",name:"Vehicle"},{id:"siren",name:"Emergency Siren"},{id:"fire",name:"Fire / Smoke"},{id:"water",name:"Water"},{id:"wind",name:"Wind / Weather"},{id:"door",name:"Door"},{id:"footsteps",name:"Footsteps"},{id:"crowd",name:"Crowd / Chatter"},{id:"telephone",name:"Telephone"},{id:"engine",name:"Engine / Motor"},{id:"tools",name:"Tools / Construction"},{id:"silence",name:"Silence"}],OF={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"}},PF={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"}},nI=new Map;for(const[e,t]of Object.entries(OF.mapping))nI.set(e.toLowerCase(),t);for(const[e,t]of Object.entries(PF.mapping))nI.set(e.toLowerCase(),t);var Xn={motion:"#f59e0b",audio:"#06b6d4",person:"#22c55e",vehicle:"#3b82f6",animal:"#f97316",package:"#a855f7",sensor:"#8b5cf6",control:"#10b981",genericDetection:"#64748b"},jF={car:"#f59e0b",truck:"#d97706",bus:"#b45309",motorcycle:"#eab308",bicycle:"#ca8a04",airplane:"#60a5fa",boat:"#2563eb",train:"#1d4ed8",bird:"#14b8a6",dog:"#84cc16",cat:"#f97316",horse:"#a16207",sheep:"#a3a3a3",cow:"#78716c",elephant:"#6b7280",bear:"#7c2d12",zebra:"#404040",giraffe:"#d4a373"};function DF(e){return e.split(/[-_ ]/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var su=new Map;function Fr(e,t,n,a,s){su.set(e,{kind:e,parentKind:null,level:"macro",category:t,color:n,iconId:a,labelKey:`eventKind.${e}`,label:s})}function Cn(e,t,n,a,s,p){su.set(e,{kind:e,parentKind:t,level:"sub",category:n,color:a,iconId:s,labelKey:`eventKind.${e}`,label:p})}Fr("motion","motion",Xn.motion,"motion","Motion");Fr("audio","audio",Xn.audio,"audio","Audio");Fr("person","detection",Xn.person,"person","Person");Fr("vehicle","detection",Xn.vehicle,"vehicle","Vehicle");Fr("animal","detection",Xn.animal,"animal","Animal");Fr("package","package",Xn.package,"package","Package");Fr("sensor","sensor",Xn.sensor,"sensor","Sensor");Fr("control","control",Xn.control,"control","Control");for(const[e,t]of Object.entries(_F.mapping))t!=="vehicle"&&t!=="animal"||su.has(e)||Cn(e,t,"detection",jF[e]??Xn.genericDetection,e,DF(e));Cn("package-delivered","package","package",Xn.package,"package","Package delivered");Cn("package-picked-up","package","package",Xn.package,"package","Package picked up");Cn("contact","sensor","sensor","#f59e0b","door","Contact");Cn("motion-sensor","sensor","sensor",Xn.sensor,"pir","Motion sensor");Cn("smoke","sensor","sensor","#ef4444","smoke","Smoke");Cn("flood","sensor","sensor","#3b82f6","water","Water leak");Cn("gas","sensor","sensor","#ef4444","gas","Gas");Cn("carbon-monoxide","sensor","sensor","#dc2626","smoke","Carbon monoxide");Cn("vibration","sensor","sensor","#eab308","vibration","Vibration");Cn("tamper","sensor","sensor","#f97316","tamper","Tamper");Cn("presence","sensor","sensor","#22c55e","presence","Presence");Cn("enum-sensor","sensor","sensor",Xn.sensor,"generic","Sensor state");Cn("device-event","sensor","sensor","#10b981","button","Device event");Cn("lock","control","control","#0ea5e9","lock","Lock");Cn("switch","control","control",Xn.control,"switch","Switch");Cn("siren","control","control","#dc2626","siren","Siren");Cn("button","control","control","#10b981","button","Button");Cn("doorbell","control","control","#a855f7","doorbell","Doorbell");for(const e of NF){const t=`audio-${e.id}`;su.has(t)||Cn(t,"audio","audio",Xn.audio,t,e.name)}var Tb=Object.freeze(Object.fromEntries(su)),tg=d({kind:o(),label:o(),parentKind:o().nullable()}),zF=d({videoClasses:w(tg),audioKinds:w(tg),labels:w(tg)});function ng(e,t,n){return{kind:e,label:t,parentKind:n}}function LF(){const e=Object.values(Tb);return{videoClasses:e.filter(t=>t.category==="detection").map(t=>ng(t.kind,t.label,t.parentKind)),audioKinds:e.filter(t=>t.category==="audio"&&t.level==="sub").map(t=>ng(t.kind,t.label,t.parentKind)),labels:e.filter(t=>t.category==="sensor"||t.category==="control").map(t=>ng(t.kind,t.label,t.parentKind))}}Object.freeze(LF());var qF=N(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),_b=N(["home","away","night","vacation","custom_bypass"]),Dw=d({state:qF,availableModes:w(_b),requiresCode:A(),lastChangedAt:l()}),BF={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.AlarmPanel],methods:{arm:y(d({deviceId:l().int().nonnegative(),mode:_b,code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),disarm:y(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),trigger:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:Dw,kind:"push"},runtimeState:Dw,durability:"restored",volatileStateFields:["lastChangedAt"]},aI=d({x:l(),y:l()}),tl=d({kind:Q("rect"),x:l(),y:l(),width:l(),height:l()}),Sm=d({kind:Q("polygon"),points:w(aI)}),iI=d({kind:Q("grid"),gridWidth:l(),gridHeight:l(),cells:w(A())}),UF=d({kind:Q("line"),points:w(aI)});kt("kind",[tl,Sm,iI,UF]);var rI=N(["rect","polygon","grid","line"]),FF=d({min:l(),max:l()}),HF=d({width:l(),height:l()}),Nb=N(["immediate","track-end","device-event","package-event","system-event"]),Ob=N(["device-online","device-offline","device-disabled","device-enabled","device-battery-low","device-battery-normal","device-consumable-low","device-consumable-normal","stream-online","stream-offline","node-online","node-offline","node-inference-unavailable","detection-blind","addon-crash-loop","addon-update-available","server-update-available","wrapper-update-available","alarm-triggered","alarm-armed","alarm-disarmed","alarm-arming","alarm-arm-refused","addon-updated","server-updated","export-completed","backup-completed","camera-online","camera-offline","camera-disabled","camera-enabled"]),$F=new Set(["camera-online","camera-offline","camera-disabled","camera-enabled"]);Ob.options.filter(e=>!$F.has(e));var QF=d({kinds:w(Ob).min(1),deviceIds:w(l().int()).min(1).optional(),deviceTypes:w(o().min(1)).min(1).optional(),nodeIds:w(o().min(1)).min(1).optional(),packageNames:w(o().min(1)).min(1).optional()}),oI=1440,VF=d({days:w(l().int().min(0).max(6)).min(1),startMinute:l().int().min(0).max(1439),endMinute:l().int().min(0).max(1439)}),xm=d({windows:w(VF).min(1),timezone:o().optional(),invert:A().optional()}),GF=d({values:w(o().min(1)),maxDistance:l().int().min(0).max(3).default(1)}),ZF=d({zoneId:o().optional(),className:o().optional(),op:N(["became-occupied","became-free",">=","<="]).default("became-occupied"),count:l().int().min(0).default(1),sustainSeconds:l().int().min(0).max(3600).default(15)}),WF=d({labels:w(o().min(1)).min(1).optional(),dbThreshold:l().min(-96).max(0).optional(),hitPercent:l().int().min(1).max(100).default(60),samplingSeconds:l().int().min(1).max(300).default(10),confirmHits:l().int().min(1).max(20).optional(),confirmWindowSec:l().int().min(1).max(60).optional()}),KF=N(["enter","exit","any"]),YF=d({ids:w(o().min(1)).min(1),match:N(["any","all"]).default("any")}),XF=kt("kind",[d({kind:Q("wait"),seconds:l().min(0).max(300)}),d({kind:Q("cap"),deviceId:l().int(),cap:o().min(1),method:o().min(1),args:Y(o(),X()).optional()})]),JF=d({name:o().min(1).max(120),enabled:A(),minDelaySec:l().int().min(0).max(86400).optional(),actions:w(XF).min(1)}),eH=d({id:o().min(1).max(64),label:o().min(1).max(40),sequence:o().min(1).max(120),icon:eI.optional(),destructive:A().optional()}),tH=d({onTrigger:w(JF).optional(),buttons:w(eH).max(8).optional()}),nH=d({deviceId:l().int(),states:w(o().min(1)).min(1)}),aH=d({sceneId:o().min(1),deviceId:l().int().optional(),requiredState:N(["matched","diverged"]),latched:A().optional()}),Pb=d({deviceState:nH.optional(),scene:aH.optional(),devices:w(l()).optional(),classes:w(o().min(1)).optional(),classesExclude:w(o().min(1)).optional(),minConfidence:l().min(0).max(1).optional(),zones:YF.optional(),zonesExclude:w(o().min(1)).optional(),crossing:KF.optional(),labelEquals:w(o().min(1)).optional(),identities:w(o().min(1)).optional(),plates:GF.optional(),identitiesExclude:w(o().min(1)).optional(),minImportance:l().min(0).max(1).optional(),minDwellSeconds:l().min(0).optional(),source:N(["pipeline","onboard","sensor","audio","any"]).optional(),minLabelConfidence:l().min(0).max(1).optional(),eventTypeTokens:w(o().min(1)).optional(),sensorKinds:w(o().min(1)).optional(),packagePhase:N(["delivered","picked-up","both"]).optional(),systemEvent:QF.optional(),customZones:w(Sm).optional(),occupancy:ZF.optional(),audio:WF.optional()}),sI=d({targetId:o().min(1),params:Y(o(),X()).optional()}),iH=N(["cropped","full","boxed"]),lI=d({attach:N(["best","best-matching","keyFrame","none"]).default("best"),frame:iH.optional(),zoneCrop:A().optional(),gif:A().optional(),clip:A().optional(),clipPreRollSec:l().int().min(0).max(30).optional(),clipPostRollSec:l().int().min(0).max(30).optional(),clipSpeed:l().min(1).max(8).optional(),profile:on.optional()}),rH=N(["shared","per-class"]),cI=d({cooldownSec:l().int().min(0).max(86400).default(60),scope:N(["rule","rule-device"]).default("rule-device"),granularity:rH.optional()}),oH=1e3,sH=2e4,lH=8e3,cH=d({op:N([">=",">","<=","<","=="]),count:l().int().min(0).max(1e3)}),uH=d({enabled:A().default(!1),profileId:o().optional(),prompt:o().max(1e3).optional(),expect:cH.optional(),timeoutMs:l().int().min(oH).max(sH).default(lH),onTimeout:N(["fire","suppress"]).default("fire"),maxImagePx:l().int().min(64).max(2048).default(448)}),$p=d({name:o().min(1).max(200),enabled:A().default(!0),delivery:Nb,conditions:Pb.default({}),schedule:xm.optional(),targets:w(sI),targetUsers:w(o()).optional(),media:lI.default({attach:"best"}),throttle:cI.default({cooldownSec:60,scope:"rule-device"}),template:d({title:o().max(500).optional(),body:o().max(2e3).optional()}).optional(),priority:l().int().min(1).max(5).default(3),ownerUserId:o().optional(),snoozeAllowGlobal:A().optional(),snoozeOptions:w(l().int().min(1).max(oI)).max(4).optional(),actions:tH.optional(),confirm:uH.optional(),waitForEnhancement:A().optional(),groupIdleSec:l().int().min(0).max(600).optional()}),dH=$p.partial().extend({disabledTargetIds:w(o()).optional(),enabled:A().optional(),conditions:Pb.optional(),media:lI.optional(),throttle:cI.optional(),priority:l().int().min(1).max(5).optional()}),Ud=$p.extend({id:o(),createdBy:o(),createdAt:l(),updatedAt:l(),disabledTargetIds:w(o()).default([])}),pH=d({recordId:o(),recordKind:N(["object-event","track","device-event","package-event","system-event"]),deviceId:l(),timestamp:l(),wouldFire:A(),failedCondition:o().optional(),className:o().optional(),label:o().optional()}),uI=d({id:o(),group:N(["scope","class","zones","quality","label","schedule","device","package","occupancy","audio","system"]),label:o(),valueType:N(["deviceIdList","stringList","number01","number","sourceSelect","zoneSelection","zoneIdList","schedule","plateMatcher","packagePhase","crossingSelect","polygonDraw","occupancy","audio","deviceState","scene","systemEvent"]),operator:N(["in","notIn","anyOf","allOf","gte","fuzzyIn","withinSchedule"]),appliesTo:w(Nb),phase:o(),description:o().optional(),options:w(d({value:o(),label:o(),hint:o().optional()})).readonly().optional()}),dI=N(["pending","sent","dead"]),mH=N(["object-event","track-end","device-event","package-event","system-event"]),fH=d({className:o(),label:o().optional(),confidence:l().optional(),zones:w(o()),timestamp:l(),systemEvent:d({kind:Ob,subject:o(),title:o(),body:o(),data:Y(o(),X())}).optional()}),hH=d({id:o(),ruleId:o(),ruleName:o(),delivery:Nb,targetId:o(),deviceId:l(),recordKind:mH,recordId:o(),trackId:o().optional(),status:dI,attempts:l().int(),createdAt:l(),updatedAt:l(),error:o().optional(),subject:fH,artifactIds:w(o().min(1)).optional()}),gH=d({ruleId:o().optional(),deviceId:l().optional(),status:dI.optional(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100)}),pI=N(["rule","device","all"]),vH=d({scope:pI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),durationMinutes:l().int().min(1).max(oI),global:A().optional(),summary:A().optional()}),zw=d({id:o(),userId:o(),scope:pI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),startedAt:l(),expiresAt:l(),global:A(),summary:A(),digestSentAt:l().optional()});d({snoozeId:o(),targetId:o(),ruleId:o(),ruleName:o(),deviceId:l().int(),count:l().int(),firstAt:l(),lastAt:l()});var mI=d({exitDelaySec:l().int().min(0).max(600),entryDelaySec:l().int().min(0).max(600),triggeredDurationSec:l().int().min(0).max(3600),announceArm:A(),announceTargets:w(o().min(1)).max(16)}),yH=mI.partial(),bH=N(["muted","detection-off","offline"]),SH=d({deviceId:l().int(),reason:bH}),xH=d({mode:_b,ruleCount:l().int().min(0),allDevices:A(),deviceIds:w(l().int()),skippedDevices:w(SH).default([])}),Lw=d({deviceId:l().int().nullable(),settings:mI,coverage:w(xH)}),kH=d({deviceId:l().int().nonnegative().optional(),seconds:l().min(0).max(60),profile:on.optional(),ruleId:o(),ruleName:o(),reason:N(["window","occupancy"])}),wH=d({rulesLoaded:A(),asks:w(kH).readonly()}),MH={name:"notification-rules",scope:"system",mode:"singleton",methods:{listRules:y(d({}),d({rules:w(Ud)}),{auth:"admin"}),getRule:y(d({ruleId:o()}),d({rule:Ud.nullable()}),{auth:"admin"}),createRule:y(d({rule:$p}),d({rule:Ud}),{kind:"mutation",auth:"admin",caller:"required"}),updateRule:y(d({ruleId:o(),patch:dH}),d({rule:Ud}),{kind:"mutation",auth:"admin",caller:"required"}),deleteRule:y(d({ruleId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setRuleEnabled:y(d({ruleId:o(),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getClipRetentionAsks:y(d({}),wH,{auth:"admin"}),listDeviceMutes:y(d({}),d({mutedDeviceIds:w(l().int()).readonly()}),{auth:"admin"}),setDeviceMuted:y(d({deviceId:l().int(),muted:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),testRule:y(d({rule:$p,lookbackMinutes:l().int().min(1).max(1440).default(60)}),d({results:w(pH)}),{kind:"mutation",auth:"admin"}),getConditionCatalog:y(d({}),d({catalog:w(uI),taxonomy:zF.optional()})),getHistory:y(d({filter:gH.default({limit:100})}),d({entries:w(hH)}),{auth:"admin"}),resolveArtifactUrl:y(d({artifactId:o().min(1)}),d({url:o().nullable()}),{auth:"admin"}),listSnoozes:y(d({}),d({snoozes:w(zw)}),{caller:"required"}),createSnooze:y(d({snooze:vH}),d({snooze:zw}),{kind:"mutation",caller:"required"}),cancelSnooze:y(d({snoozeId:o()}),d({success:Q(!0)}),{kind:"mutation",caller:"required"}),getAlarmConfig:y(d({}),Lw,{auth:"admin"}),setAlarmConfig:y(d({patch:yH}),Lw,{kind:"mutation",auth:"admin"})}},up=N(["view","create","delete"]),fI=Ye([Q("*"),w(o())]),hI=Y(o(),Ye([Q("*"),w(o())])),CH=N(["device","system"]),AH=kt("kind",[d({kind:Q("all")}),d({kind:Q("ids"),ids:w(l().int()).min(1)}),d({kind:Q("types"),types:w(N(H)).min(1)}),d({kind:Q("locations"),locations:w(o().min(1)).min(1)})]),EH=d({type:Q("device"),selector:AH,access:w(up).min(1),includeLinked:A().optional()});function RH(e){if(e===null||typeof e!="object"||Array.isArray(e)||Reflect.get(e,"type")!=="device"||Reflect.get(e,"selector")!==void 0)return e;const t=Reflect.get(e,"targets");return Array.isArray(t)?{type:"device",selector:{kind:"ids",ids:t.map(n=>typeof n=="string"?Number(n):n).filter(n=>typeof n=="number"&&Number.isInteger(n))},access:Reflect.get(e,"access")}:e}var Ra=v8(RH,kt("type",[d({type:Q("category"),target:CH,access:w(up).min(1)}),d({type:Q("capability"),target:o(),access:w(up).min(1)}),d({type:Q("addon"),target:o(),access:w(up).min(1)}),EH]));d({id:o(),username:o(),passwordHash:o(),isAdmin:A().default(!1),allowedProviders:fI,allowedDevices:hI,scopes:w(Ra).default([]),createdAt:l(),updatedAt:l()});d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:fI,allowedDevices:hI,tokenHash:o(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()});d({id:o(),userId:o(),name:o(),tokenHash:o(),tokenPrefix:o(),scopes:w(Ra),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()});var IH=d({integrationId:o(),displayName:o(),requestedScopes:w(Ra),allowedRedirectPrefixes:w(o()).min(1),allowedPrivateHostPaths:w(o()).optional(),requiresPkce:A().optional(),hubUrl:o().optional(),refreshTokenTtlSec:Ye([l().int().positive(),Q("never")]).optional()}),TH={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:y(O(),IH,{auth:"admin"})}},_H=d({handle:Vi,cropFrameSpace:d({x:l(),y:l(),w:l(),h:l()})});d({crop:d({left:l(),top:l(),width:l().positive(),height:l().positive()}).optional(),content:d({width:l().int().positive(),height:l().int().positive()}),fit:N(["stretch","contain"]),format:N(["rgb","gray","jpeg"])});var NH=d({registryId:o().min(1),id:o().min(1),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","gray"]),timestamp:l(),capturedAt:l().optional()}),qv=N(["onnx","coreml","openvino","tflite","pt","gguf"]),Bc=N(["detector","cropper","classifier","refiner","audio-classifier"]),ca=d({runtime:N(["node","python"]),backend:o(),format:qv,device:o().optional()}),OH=d({id:o(),label:o(),description:o().optional()}),PH=d({engine:ca,devices:w(OH).readonly(),defaultDevice:o()}),Bv=au(()=>d({addonId:o(),addonName:o(),slot:Bc,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),enabled:A(),modelId:o(),children:w(Bv).readonly(),group:o().optional(),settings:Y(o(),X()).optional()})),Qp=au(()=>d({addonId:o(),enabled:A(),modelId:o(),children:w(Qp).readonly(),settings:Y(o(),X()).optional()})),ag=d({id:o(),name:o(),createdAt:o(),updatedAt:o(),engine:ca,steps:w(Qp).readonly()}),jH=d({id:o(),name:o(),formats:Y(o(),d({downloaded:A(),sizeMB:l()})),group:gR.optional(),legacy:A().optional(),provider:vR.optional()}),DH=ei(),zH=d({id:o(),name:o(),slot:Bc,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),childSlots:w(Bc).readonly(),models:w(jH).readonly(),defaultModelId:o(),defaultModelIdByFormat:Y(o(),o()).optional(),enabledByDefault:A().optional(),backfillIntoExistingOverrides:A().optional(),defaultConfidence:l(),group:o().optional(),configSchema:w(DH).readonly().optional()}),LH=d({id:Bc,label:o(),priority:l(),parentSlot:Bc.nullable(),addons:w(zH).readonly()}),qH=d({availableEngines:w(PH).readonly(),selectedEngine:ca,slots:w(LH).readonly()}),BH=d({runtimeId:N(["onnx","openvino","coreml","edgetpu"]).nullable(),device:o().nullable(),state:N(["idle","installing","verifying","ready","failed"]),progress:l().optional(),error:o().optional(),nextRetryAt:l().optional(),configIssues:w(o()).optional()}),Eo=au(()=>d({addonId:o(),modelId:o().optional(),enabled:A().default(!0),children:w(Eo).optional(),settings:Y(o(),X()).optional(),jumpDeviceKey:o().optional()})),UH=d({addonId:o(),chosen:o(),running:o(),format:o()}),FH=d({addonId:o(),kind:N(["unknown-addon","no-format-build"]),detail:o()}),HH=d({ok:A(),issues:w(FH).readonly(),substitutions:w(UH).readonly(),format:o()}),$H=d({filename:o(),stepIds:w(o()).readonly().optional()}),QH=d({base64:o(),filename:o()}),VH=d({filename:o(),sizeKb:l()}),GH=d({base64:o()}),ZH=d({id:o(),name:o(),description:o(),available:A(),rawLabels:w(o()).readonly().optional()}),WH=d({activeBackend:o(),availableBackends:w(ZH).readonly(),sampleRate:l(),chunkDurationMs:l()}),KH=d({filePath:o(),sizeMB:l(),durationMs:l()}),YH=d({success:A(),error:o().optional(),frame:ei().optional()}),XH=ei(),JH=ei(),e$=ei(),t$=ei(),n$=ei(),Uv=ei(),a$={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:y(O(),w(ca)),getSelectedEngine:y(O(),ca),getDefaultSteps:y(ca,w(Bv)),getEngineProvisioning:y(d({nodeId:o()}),BH),getVideoPipelineSteps:y(O(),Y(o(),d({modelId:o(),settings:Y(o(),X()).readonly()}))),setVideoPipelineSteps:y(d({steps:Y(o(),d({modelId:o(),settings:Y(o(),X()).readonly()}))}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),clearDeviceOverrides:y(d({nodeId:o()}),d({success:Q(!0),clearedDevices:l()}),{kind:"mutation",auth:"admin"}),getInferenceDeviceHealth:y(d({nodeId:o()}),d({unhealthy:w(d({deviceKey:o(),state:N(["failed","backoff"]),since:l(),deaths:l(),lastError:o()})).readonly()})),rearmInferenceDevice:y(d({nodeId:o(),deviceKey:o()}),d({rearmed:A()}),{kind:"mutation",auth:"admin"}),getSchema:y(O(),qH),getGlobalSteps:y(O(),w(Bv).readonly().nullable()),getGlobalPipelineConfig:y(O(),XH),getOrchestratorConfigSchema:y(O(),JH),validatePipeline:y(d({steps:w(Eo)}),HH),listTemplates:y(O(),w(ag).readonly()),saveTemplate:y(d({name:o(),steps:w(Qp).readonly(),engine:ca}),ag,{kind:"mutation"}),updateTemplate:y(d({id:o(),name:o().optional(),steps:w(Qp).readonly().optional()}),ag,{kind:"mutation"}),deleteTemplate:y(d({id:o()}),O(),{kind:"mutation"}),getCapabilities:y(O(),t$),getAddonModels:y(d({addonId:o()}),n$),downloadModel:y(d({addonId:o(),modelId:o(),format:qv}),KH,{kind:"mutation"}),deleteModel:y(d({addonId:o(),modelId:o(),format:qv}),d({success:Q(!0)}),{kind:"mutation"}),runPipeline:y(d({engine:ca.optional(),steps:w(Eo).min(1),frame:_v.optional(),frameRef:NH.optional(),frameHandle:Vi.optional(),imageBase64:o().optional(),image:$t(Uint8Array).optional(),referenceImage:o().optional(),deviceId:l().optional(),sessionId:o().optional(),plane:N(["full","frame"]).optional(),deviceKey:o().optional(),nativeCropRef:_H.optional()}),Uv,{kind:"mutation"}),runPipelineBatch:y(d({engine:ca.optional(),steps:w(Eo).min(1),frames:w(_v).min(1).max(255),deviceId:l().optional(),sessionId:o().optional(),frameId:l().int().nonnegative().optional(),deviceKey:o().optional()}),d({results:w(Uv).readonly()}),{kind:"mutation"}),cacheFrameInPool:y(d({data:$t(Uint8Array),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","bgr","gray"])}),d({frameId:l(),width:l(),height:l()}),{kind:"mutation"}),inferCached:y(d({stepId:o(),frameId:l().int()}),Y(o(),X()),{kind:"mutation"}),uncacheFrame:y(d({frameId:l().int()}),O(),{kind:"mutation"}),getEffectiveTuning:y(O(),d({batchMode:o(),windowMs:l(),maxBatchSize:l(),concurrency:l()})),listLoadedEngines:y(O(),w(d({engineKey:o(),engine:ca,modelsLoaded:w(o()).readonly(),inUseByCameras:w(l()).readonly(),kind:N(["runtime","warm-override","device-pool"]),poolPid:l().nullable(),idleMs:l().nullable(),idleTtlMs:l().nullable()})).readonly()),spinEngine:y(d({engine:ca}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),killEngine:y(d({engine:ca,force:A().optional()}),d({success:A(),reason:o().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:y(O(),w($H).readonly()),getReferenceImage:y(d({filename:o()}),QH.nullable()),getReferenceAudioFiles:y(O(),w(VH).readonly()),getReferenceAudio:y(d({filename:o()}),GH.nullable()),getAudioCapabilities:y(O(),WH),runAudioTest:y(d({addonId:o(),modelId:o(),filename:o().optional(),settings:Y(o(),X()).optional()}),YH,{kind:"mutation"}),getDetectionConfigSchema:y(O(),e$)}},i$=N(["include","exclude"]),So=d({id:o(),name:o().optional(),zoneIds:w(o()).min(1).readonly(),mode:i$,classFilter:w(o()).readonly().optional(),overlapThreshold:l().min(0).max(1).optional(),bboxInclusionPct:l().min(0).max(100).optional(),preferMask:A().optional(),enabled:A().default(!0)});w(So).readonly();var r$=N(["polygon","tripwire"]),o$=d({x:l(),y:l()}),Bs=d({id:o(),name:o(),kind:r$.default("polygon"),polygon:w(o$).readonly(),color:o().default("#3b82f6")}),s$={name:"zones",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{listZones:y(d({deviceId:l()}),w(Bs).readonly()),addZone:y(d({deviceId:l(),zone:Bs}),O(),{kind:"mutation",auth:"admin"}),removeZone:y(d({deviceId:l(),zoneId:o()}),O(),{kind:"mutation",auth:"admin"}),updateZone:y(d({deviceId:l(),zone:Bs}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({zones:w(Bs).readonly()}),durability:"restored"},jb=N(["new","entered","left","moving","idle"]),l$=N(["motion","object","audio"]),c$=kt("kind",[tl,Sm]),u$=N(["motion","audio","person","vehicle","animal","door","pir","smoke","water","button","package","generic"]),d$=N(["motion","audio","detection","sensor","control","custom","package"]),p$=N(["macro","sub"]),gI=d({kind:o(),labelKey:o(),label:o(),color:o(),iconId:o(),icon:u$,category:d$,parentKind:o().nullable(),level:p$,source:d({capName:o(),deviceId:l()})}),m$=d({deviceId:l(),kinds:w(gI).readonly()}),f$=d({id:o(),deviceId:l(),sourceDeviceId:l(),kind:o(),value:Y(o(),X()).nullable(),timestamp:l()}),vI=d({x:l(),y:l(),timestamp:l(),bbox:Xi,source:N(["frame","recovery"]).optional(),score:l().optional()}),h$=d({timestamp:l(),position:vI,mediaId:l().int()}),g$=d({minX:l(),minY:l(),maxX:l(),maxY:l()}),yI=N(["full","slim"]),v$=d({label:o(),peakScore:l(),count:l(),firstAt:l(),lastAt:l()}),Db=N(["pipeline","sensor","audio"]),zb=N(["none","staging","trained"]),Lb={markForTrain:A().optional(),debug:A().optional(),debugNote:o().max(500).optional(),favourited:A().optional()},bI={retrainStatus:zb.optional()},y$=d(Lb),b$=d({trackId:o(),markForTrain:A(),debug:A(),debugNote:o(),favourited:A(),retrainStatus:zb});Ye([Q(1),Q(2)]);var qw=d({stepId:o(),modelId:o().optional(),decidedAt:l(),identityId:o().optional()}),qb={label:o().optional(),labelScore:l().optional(),labelMeta:qw.optional(),subLabel:o().optional(),subLabelScore:l().optional(),subLabelMeta:qw.optional()},S$=d({deviceId:l(),tracks:l().int(),files:l().int(),bytes:l().int()}),x$=d({generatedAt:l(),trackCount:l().int(),fileCount:l().int(),byteCount:l().int(),truncated:A(),devices:w(S$).readonly()}),dp=d({trackId:o(),deviceId:l(),className:o(),...qb,producingDeviceName:o().optional(),source:Db.optional(),firstSeen:l(),lastSeen:l(),positions:w(vI).readonly(),snapshots:w(h$).readonly(),zonesVisited:w(o()).readonly(),zoneNames:w(o()).readonly().optional(),classes:w(o()).readonly().optional(),totalDistance:l(),state:jb,active:A(),importance:l().optional(),bestEventId:o().optional(),importanceReason:o().optional(),audioLabels:w(v$).readonly().optional(),envelope:g$.optional(),hasFace:A().optional(),hasEmbeddedFace:A().optional(),hasRider:A().optional(),previewMissReason:o().optional(),...Lb,...bI}),Bb={id:l().int(),deviceId:l(),timestamp:l()},k$=d({...Bb,kind:Q("motion"),regionCount:l(),regions:w(d({bbox:Xi,pixelCount:l(),intensity:l()})).readonly().optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaUrl:o().optional(),durationMs:l().nullable().optional(),edges:w(l()).readonly().optional()}),Ub=N(["pipeline","onboard"]),w$=N(["enter","exit"]),M$=d({direction:w$,zoneId:o(),zoneName:o().optional()}),C$=d({zoneId:o(),zoneName:o().optional(),overlapPct:l()}),SI=d({...Bb,kind:Q("object"),source:Ub.optional(),frameId:o().optional(),idempotencyKey:o().optional(),trackId:o().optional(),className:o(),...qb,confidence:l().optional(),bbox:Xi.optional(),zones:w(o()).readonly().optional(),zoneOverlaps:w(C$).readonly().optional(),spawnRefused:o().optional(),state:jb.optional(),zoneCrossing:M$.optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaId:l().int().optional(),keyFrameMediaId:l().int().optional(),mediaUrl:o().optional(),importance:l().optional()}),A$=d({...Bb,kind:Q("audio"),rms:l(),dbfs:l(),classification:d({className:o(),originalClass:o().optional(),score:l()}).optional(),mediaUrl:o().optional()}),nl=N(["crop","thumbnail","snapshot","firstFrame","lastFrame","fullFrame","fullFrameBoxed","faceCrop","plateCrop","keyFrame","keyFrameSmall","thumbnailSmall","sceneFrame"]),E$=d({mediaId:l().int(),kind:nl,sizeBytes:l(),timestamp:l()}),Fv=E$.extend({url:o(),base64:o()}),Bw=Fv.omit({base64:!0}),R$=N(["person","vehicle","animal","package","face","plate"]),I$=N(["subject","model_error"]),T$=N(["operator","assist"]),xI=d({x:l(),y:l(),w:l(),h:l()}),Hv=d({id:o(),trackId:o(),deviceId:l(),mediaKey:o(),bbox:xI,macroClass:R$,label:o().optional(),subLabel:o().optional(),kind:I$,source:T$,assistModelId:o().optional(),assistScore:l().optional(),exportedInBatch:o().optional(),createdAt:l()}),kI=Hv.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),_$=d({trackId:o(),deviceId:l(),className:o(),label:o().optional(),firstSeen:l(),lastSeen:l(),frameCount:l().int(),annotationCount:l().int()}),N$=d({mediaId:l().int(),kind:nl,timestamp:l(),sizeBytes:l().int(),copied:A()}),wI=d({frameId:o(),deviceId:l(),trackId:o(),sourceMediaId:l().int(),sourceKind:nl,sizeBytes:l().int(),width:l().int(),height:l().int(),copiedAt:l()}),O$=N(["source-missing","unreadable-image","write-failed"]),P$=d({copied:w(wI).readonly(),refused:w(d({sourceMediaId:l().int(),reason:O$})).readonly()}),j$=d({candidates:w(N$).readonly(),copies:w(wI).readonly(),autoPickMediaId:l().int().optional()}),D$=kt("kind",[d({kind:Q("package"),zone:xI.optional()}),d({kind:Q("objects"),modelId:o(),minScore:l().optional()})]),z$=kt("kind",[d({kind:Q("proposed"),modelId:o(),stepId:o(),minScore:l(),proposals:w(kI).readonly(),belowThreshold:l().int()}),d({kind:Q("refused"),reason:o(),detail:o().optional()})]),Uw=d({trackId:o(),retrainStatus:zb,changed:A(),reason:N(["unknown-track","no-frames-copied","not-staging","not-trained","unchanged"]).optional()}),MI=1e3,CI=5e3,$v=d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(CI).default(MI),projection:N(["full","slim"]).optional()}),L$=$v.extend({classFilter:o().optional()}),q$=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(1e3).default(200),cursor:o().optional(),projection:yI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Db).optional()}),AI=d({id:o(),deviceId:l(),openedAt:l(),lastActiveAt:l(),sealedAt:l().nullable(),memberCount:l().int().nonnegative(),groupShotMediaId:l().int().nullable()}),B$=d({deviceIds:w(l()).min(1),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(200).default(50),classes:w(o().min(1).max(60)).max(40).optional()}),U$=d({trackId:o(),className:o().nullable(),role:N(["primary","sibling","child"]).nullable(),joinedAt:l(),label:o().optional(),subLabel:o().optional()}),F$=d({summary:AI,members:w(U$).readonly()}),EI=d({summary:AI,classes:w(d({className:o().nullable(),count:l().int().positive()})).readonly()}),H$=d({summaries:w(EI).readonly()}),$$=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100),cursor:o().optional(),classes:w(o().min(1).max(60)).max(40).optional()}),Q$=d({summaries:w(EI).readonly(),nextCursor:o().nullable()}),V$=d({tracks:w(dp).readonly(),nextCursor:o().nullable()}),RI=50,II=200,G$=d({deviceId:l(),since:l(),until:l(),limit:l().int().min(1).max(II).default(RI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),TI=d({id:o(),trackId:o(),timestamp:l(),className:o(),...qb,importance:l(),bestEventId:o(),windowMs:l().optional(),...Lb,...bI}),Z$=d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),limit:l().int().min(1).max(II).default(RI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),W$=d({deviceId:l(),events:w(TI).readonly()}),_I=d({bucketStart:l(),motion:l().int(),object:l().int(),audio:l().int(),audioDbfs:l().optional()}),K$=d({deviceId:l(),read:N(["read","unreadable"]),buckets:w(_I).readonly()});d({trackId:o(),className:o(),confidence:l(),bbox:Xi,zones:w(o()).readonly(),state:jb});var Y$=tw({id:o(),kind:N(["first-level","detail"]),macroClass:o(),score:l(),bbox:d({x:l(),y:l(),width:l(),height:l()}),labels:w(tw({label:o(),score:l()})).readonly(),parentId:o().optional()}),X$=SI.extend({score:l()}),J$=d({text:o(),deviceId:l().optional(),since:l().optional(),until:l().optional(),classFilter:o().optional(),limit:l().default(50),minScore:l().min(0).max(1).default(.2)}),Fw=d({tracks:l().int(),events:l().int(),media:l().int(),faces:l().int(),plates:l().int(),embeddings:l().int()}),eQ=d({mediaDropped:l().int(),tracks:l().int(),events:l().int()}),tQ=d({deviceId:l(),rows:l().int(),bytes:l().int()}),nQ=d({totalRows:l().int(),totalBytes:l().int(),devices:w(tQ).readonly()}),aQ=d({kind:nl,rows:l().int(),bytes:l().int()}),iQ=d({totalRows:l().int(),totalBytes:l().int(),kinds:w(aQ).readonly(),unaccountedRows:l().int(),unaccountedBytes:l().int()}),Hw=d({motion:l().int(),object:l().int(),audio:l().int()}),rQ=d({deviceId:l().optional(),since:l().optional(),until:l().optional(),maxTracks:l().int().positive().optional(),executeOnNodeId:o().optional(),pacingMs:l().int().nonnegative().optional()}),oQ=d({deleted:l()}),sQ=d({started:A(),alreadyRunning:A()}),lQ=d({running:A(),scanned:l(),rebuilt:l(),missingKeyFrame:l(),missingBbox:l(),notRunnable:l(),noCapableNode:l(),failed:l(),complete:A().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable(),error:o().nullable()}),cQ=d({started:A(),alreadyRunning:A()}),uQ=d({mode:N(["report","reclaim"]).default("report"),scopes:w(N(["motion-still","track-filmstrip"])).min(1).optional(),deviceIds:w(l().int()).min(1).optional(),restart:A().optional(),pageSize:l().int().min(50).max(5e3).optional(),maxRowsPerDevice:l().int().min(1).max(5e5).optional(),maxReclaimPerDevice:l().int().min(1).max(5e5).optional(),maxBytesPerRun:l().int().min(1).optional(),budgetMinutes:l().int().min(1).max(720).optional(),throttleBytesPerSec:l().int().min(64*1024).optional(),graceMinutes:l().int().min(1).max(10080).optional()}),dQ=d({running:A(),mode:N(["report","reclaim"]).nullable(),totalExamined:l(),totalEligible:l(),totalReclaimed:l(),totalBytesReclaimed:l(),totalRefused:l(),devicesDone:l(),complete:A().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable(),error:o().nullable()}),pQ=d({timestamp:l(),frame:Uv}),mQ=d({className:o(),firstSeenMs:l(),lastSeenMs:l(),bbox:Xi,framesMatched:l().int()}),fQ=d({tracks:w(mQ).readonly()}),hQ=N(["motion","audio-dbfs","battery","occupancy"]),gQ=d({scope:o(),bucketStart:l().int(),samples:l().int().nonnegative(),sum:l(),min:l(),max:l()}),vQ={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:y(d({deviceId:l()}),w(dp).readonly()),getTrack:y(d({deviceId:l(),trackId:o()}),dp.nullable()),listTracks:y(d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().optional(),zone:c$.optional(),projection:yI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Db).optional()}),w(dp).readonly()),listRecentTracks:y(q$,V$),listSummaries:y(B$,H$),listRecentSummaries:y($$,Q$),getSummary:y(d({id:o()}),F$.nullable()),clearTracks:y(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getMotionEvents:y($v,w(k$).readonly()),getObjectEvents:y(L$,w(SI).readonly()),getAudioEvents:y($v,w(A$).readonly()),listEventKinds:y(d({deviceId:l()}),w(gI).readonly()),listEventKindsBatch:y(d({deviceIds:w(l()).min(1).max(200)}),w(m$).readonly()),getSensorEvents:y(d({deviceId:l(),since:l().optional(),until:l().optional(),kinds:w(o()).optional(),limit:l().int().min(1).max(CI).default(MI)}),w(f$).readonly()),getKeyEvents:y(G$,w(TI).readonly()),getKeyEventsBatch:y(Z$,w(W$).readonly()),readLongTermSeries:y(d({deviceId:l(),series:hQ,scope:o().optional(),from:l(),to:l(),limit:l().int().positive().optional()}),w(gQ).readonly()),getEventDensity:y(d({deviceId:l(),since:l(),until:l(),bucketMs:l().int().positive()}),w(_I).readonly()),getEventDensityBatch:y(d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),bucketMs:l().int().positive()}),w(K$).readonly()),pruneEventsBefore:y(d({deviceId:l(),cutoffMs:l()}),d({motion:l().int(),object:l().int(),audio:l().int()}),{kind:"mutation",auth:"admin"}),pruneTracksBefore:y(d({deviceId:l(),cutoffMs:l()}),Fw,{kind:"mutation",auth:"admin"}),wipeAllAnalytics:y(d({deviceId:l()}),Fw,{kind:"mutation",auth:"admin"}),reconcileFromDisk:y(d({deviceId:l()}),eQ,{kind:"mutation",auth:"admin"}),deleteTracks:y(d({deviceId:l(),trackIds:w(o()).min(1)}),d({deleted:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),setTrackFlags:y(d({deviceId:l(),trackId:o(),flags:y$}),b$,{kind:"mutation"}),listArchivedDebugNotes:y(uq,w(cq).readonly(),{kind:"query"}),listBirthDecisions:y(lq,w(sq).readonly(),{kind:"query"}),getEventStoreFootprint:y(d({}),nQ,{kind:"query",auth:"admin"}),getEventMediaFootprintByKind:y(d({deviceId:l().int().optional()}),iQ,{kind:"query",auth:"admin"}),pruneEvents:y(d({olderThanMs:l(),reason:gb.optional()}),Hw,{kind:"mutation",auth:"admin"}),deleteDeviceEvents:y(d({deviceId:l()}),Hw,{kind:"mutation",auth:"admin"}),pauseForStorageMigration:y(jr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:y(jr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:y(jr,d({refreshed:Q(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:y(Mq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:y(d({jobId:o()}),Lc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateMedia:y(mR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),countUnstampedEventMedia:y(d({}),wq,{auth:"admin"}),countRelocatableMedia:y($q,Hq,{kind:"query",auth:"admin"}),listRelocateMediaJobs:y(d({}),w(Lc).readonly(),{kind:"query",auth:"admin"}),cancelRelocateMedia:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),listOpsLog:y(oR,w(rR).readonly(),{kind:"query",auth:"admin"}),reclaimDebugMedia:y(uQ,cQ,{kind:"mutation",auth:"admin"}),getMediaReclaimStatus:y(d({}),dQ,{kind:"query",auth:"admin"}),getTrainingExportSummary:y(d({deviceIds:w(l()).optional()}),x$,{kind:"query",auth:"admin"}),getTrainingExportUrl:y(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),listRetrainStaging:y(d({deviceIds:w(l()).optional(),limit:l().int().min(1).max(500).optional()}),w(_$).readonly(),{kind:"query",auth:"admin"}),listRetrainFrames:y(d({trackId:o()}),j$,{kind:"query",auth:"admin"}),selectRetrainFrames:y(d({deviceId:l(),trackId:o(),mediaIds:w(l().int()).min(1)}),P$,{kind:"mutation",auth:"admin"}),deselectRetrainFrame:y(d({deviceId:l(),trackId:o(),frameId:o()}),d({removed:A(),removedAnnotations:l().int()}),{kind:"mutation",auth:"admin"}),getRetrainFrameImage:y(d({frameId:o()}),d({base64:o(),width:l().int(),height:l().int()}),{kind:"query",auth:"admin"}),proposeRetrainAnnotations:y(d({deviceId:l(),trackId:o(),frameId:o(),subject:D$,nodeId:o().optional()}),z$,{kind:"mutation",auth:"admin"}),runReplayFrameProcessor:y(d({deviceId:l(),source:Ub,zones:w(Bs).readonly().optional(),detectionRules:w(So).readonly().optional(),zoneMembershipMinOverlap:l().min(0).max(1).optional(),frames:w(pQ).min(1)}),fQ,{kind:"mutation",auth:"admin"}),listRetrainAnnotations:y(d({trackId:o()}),w(Hv).readonly(),{kind:"query",auth:"admin"}),saveRetrainAnnotations:y(d({deviceId:l(),trackId:o(),frameId:o(),annotations:w(kI)}),w(Hv).readonly(),{kind:"mutation",auth:"admin"}),completeRetrainTrack:y(d({deviceId:l(),trackId:o()}),Uw,{kind:"mutation",auth:"admin"}),restageRetrainTrack:y(d({deviceId:l(),trackId:o()}),Uw,{kind:"mutation",auth:"admin"}),getRetrainExportUrl:y(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),getEventMedia:y(d({ownerType:ow,eventId:l().int(),kind:nl.optional(),deviceId:l()}),w(Fv).readonly()),getTrackMedia:y(d({trackId:o(),kinds:w(nl).optional(),deviceId:l()}),w(Fv).readonly()),listTrackMedia:y(d({trackId:o(),deviceId:l()}),w(Bw).readonly()),listEventMedia:y(d({ownerType:ow,eventId:l().int(),deviceId:l()}),w(Bw).readonly()),searchObjectEvents:y(J$,w(X$).readonly()),wipeObjectEmbeddings:y(d({}),oQ,{kind:"mutation",auth:"admin"}),rebuildObjectEmbeddings:y(rQ,sQ,{kind:"mutation",auth:"admin"}),getObjectEmbeddingRebuildStatus:y(d({}),lQ)},events:{onFrameTracked:{data:d({deviceId:l(),timestamp:l(),frameWidth:l(),frameHeight:l(),detections:w(Y$).readonly()})},onTrackStarted:{data:d({deviceId:l(),trackId:o(),className:o()})},onTrackEnded:{data:d({deviceId:l(),trackId:o(),className:o(),durationMs:l()})},onDetectionEvent:{data:d({deviceId:l(),kind:l$,eventId:o(),timestamp:l()})}}};d({activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()});var Fb=d({detectionMode:N(["disabled","always-on","on-motion"]),configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceTimeMs:l(),droppedFrames:l(),phase:N(["idle","watching","active"])}),yQ=Fb.extend({deviceId:l()}),Rc=d({x:l(),y:l(),w:l(),h:l()}),bQ=d({bytes:$t(Uint8Array).optional(),jpeg:o().optional(),jpegBytes:$t(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),tier:N(["native","ram-fullframe"]).optional()}),$w=N(["keyFrame","thumbnail"]),SQ=N(["handle-gone","encode-failed"]),xQ=kt("parked",[d({parked:Q(!0),nodeId:o(),width:l().int().positive(),height:l().int().positive(),bytes:l().int().nonnegative(),replaced:A()}),d({parked:Q(!1),nodeId:o(),reason:SQ,handleAgeMs:l().nullable(),detail:o().optional()})]),kQ=d({jpeg:o().optional(),jpegBytes:$t(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),timestamp:l(),parkedAt:l()}),wQ=d({bbox:Rc,className:o()}),NI=d({stepId:o(),className:o(),score:l(),bbox:Rc.optional(),embedding:o().optional(),embeddingMagnitude:l().optional(),embeddingModelId:o().optional(),label:o().optional(),labelTier:Ye([Q(1),Q(2)]).optional(),labelModelId:o().optional(),alignedCropJpeg:o().optional(),nativeFaceShortSidePx:l().optional()}),MQ=N(["unknown-step","model-not-servable","unreadable-frame","execution-failed"]),CQ=kt("kind",[d({kind:Q("ran"),nodeId:o(),modelId:o(),details:w(NI)}),d({kind:Q("refused"),nodeId:o(),reason:MQ,detail:o()})]),Qw={min:0,default:3e4},Vw={min:0,max:6e5},Gw={min:5e3,max:6e5},ig={min:1,max:30,default:4},rg={min:1,max:30,default:10},og={min:0,max:300,default:300},sg={min:1,max:10,default:4},lg={min:0,max:30,default:12},Hb=N(["onboard","analyzer","device-activity"]),AQ=w(Hb),EQ=w(Ub),RQ=d({deviceId:l(),detected:A(),source:Hb.default("analyzer"),regions:w(Fp).readonly().optional()}),IQ=kt("kind",[d({kind:Q("local-broker")}),d({kind:Q("remote-restream"),ownerNodeId:o(),ownerReachableHost:o().optional(),hubHostnameOverride:o().optional()})]).describe("Per-camera frame-source mode for the runner (P2c)"),TQ=d({deviceKey:o(),weight:l().positive().default(1),maxSessions:l().int().positive().nullable().default(null)}),_Q=d({deviceId:l(),detectionMode:N(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:N(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:l().min(Qw.min).default(Qw.default),maxSessionHoldMs:l().min(Vw.min).max(Vw.max).optional(),audioMotionWindowMs:l().min(Gw.min).max(Gw.max).optional(),motionFps:l().min(ig.min).max(ig.max).default(ig.default),detectionFps:l().min(rg.min).max(rg.max).default(rg.default),motionStreamId:o(),detectionStreamId:o(),motionSources:AQ.default(["analyzer"]),detectionSources:EQ.default(["pipeline"]),pipelineEnabled:A().default(!0),steps:w(Eo).readonly().optional(),audio:d({modelId:o().optional(),enabled:A()}).nullable().optional(),zones:w(Bs).readonly().default([]),onboardMotionDrivesAnalyzer:A().default(!0),preRollInferenceEnabled:A().default(!0),preRollInferenceFrames:l().min(lg.min).max(lg.max).default(lg.default),occupancyRecheckEnabled:A().default(!0),occupancyRecheckSec:l().min(og.min).max(og.max).default(og.default),occupancyRecheckFrames:l().min(sg.min).max(sg.max).default(sg.default),frameSource:IQ.default({kind:"local-broker"}),deviceKey:o().optional(),inferenceDevices:w(TQ).readonly().optional()}),OI=d({nodeId:o(),attachedCameras:l(),activeCameras:l(),avgInferenceFps:l(),avgInferenceTimeMs:l(),queueDepthTotal:l(),devices:w(d({deviceKey:o(),backend:o(),attachedCameras:l(),queueDepthTotal:l()})).default([]),hardware:d({hasGpu:A(),inferenceBackend:o().optional(),cpuCores:l().optional()})}),Zw=d({framesDecoded:l(),framesAdmitted:l(),framesDroppedPixelFree:l(),viewsMaterialized:l(),viewsSkipped:l(),workerToRunnerBytes:l(),runnerToPoolRawBytes:l(),runnerToPoolJpegBytes:l(),onDemandFullFrameRequests:l(),onDemandCropRequests:l(),nativeHits:l(),nativeMisses:l(),tileHits:l(),tileMisses:l(),fallbackHits:l(),fallbackMisses:l(),retainedWritesAvoided:l(),residentRefs:l(),residentBytes:l(),releases:l(),evictions:l(),staleMisses:l()}),NQ=d({node:Zw,cameras:w(Zw.extend({deviceId:l()}))}),OQ=d({nodeId:o(),activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l(),frameLazy:NQ.optional()}),PQ=N(["not-attached","battery-asleep","not-watching","already-bursting"]),jQ={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:y(_Q,d({success:Q(!0)}),{kind:"mutation"}),detachCamera:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation"}),reportMotion:y(RQ,d({success:Q(!0)}),{kind:"mutation"}),getLocalLoad:y(O(),OI),getLocalMetrics:y(O(),OQ),getCameraMetrics:y(d({deviceId:l()}),Fb.nullable()),getAllCameraMetrics:y(O(),w(yQ).readonly()),getLocalCameras:y(O(),w(l()).readonly()),requestOccupancyBurst:y(d({deviceId:l(),frames:l().int().positive().optional(),reason:o()}),d({started:A(),refusedBecause:PQ.optional()}),{auth:"admin",kind:"mutation"}),getNativeCrop:y(d({handle:Vi,bbox:Rc,maxWidth:l().int().positive().optional(),acceptJpegBytes:A().optional(),encodeJpeg:A().optional()}),bQ.nullable()),runDetailSubtree:y(d({deviceId:l(),frameHandle:Vi.optional(),frameJpeg:o().optional(),cropJpeg:o().optional(),parent:wQ,steps:w(o()).optional()}),d({details:w(NI)}).nullable(),{kind:"mutation"}),runStatelessStep:y(d({stepId:o(),modelId:o(),frameJpeg:o(),bbox:Rc,className:o(),sourceDeviceId:l()}),CQ,{kind:"mutation"}),parkTrackFrame:y(d({deviceId:l(),trackId:o(),kind:$w,handle:Vi,bbox:Rc,maxWidth:l().int().positive().optional(),timestamp:l()}),xQ,{kind:"mutation"}),getParkedTrackFrame:y(d({deviceId:l(),trackId:o(),kind:$w,acceptJpegBytes:A().optional()}),kQ.nullable()),releaseParkedTrackFrames:y(d({deviceId:l(),trackId:o()}),d({released:l().int().nonnegative()}),{kind:"mutation"})}},pp=d({engine:ca.optional(),steps:w(Eo).readonly(),audio:d({engine:ca.optional(),modelId:o().optional(),enabled:A(),settings:Y(o(),X()).readonly().optional()}).nullable().optional()}),cg=d({id:o(),name:o(),description:o().optional(),config:pp,createdAt:o(),updatedAt:o()}),$b=d({modelId:o().optional(),settings:Y(o(),X()).optional(),jumpDeviceKey:o().optional()}),Ww=d({maxCameras:l().int().nonnegative().nullable().default(null),detectWeight:l().positive().optional(),detect:A().optional(),decode:A().optional(),audio:A().optional(),ingest:A().optional(),decodeBudgetMb:l().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).optional(),reachableHost:o().optional(),inferenceDevices:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),$b).optional()})).optional()}),PI=d({steps:w(Eo).readonly(),audio:d({modelId:o(),enabled:A()}).nullable()}),Qv=d({modelId:o().optional(),settings:Y(o(),X()).readonly().optional()}),DQ=d({pinnedAgentNodeId:o().optional(),stepToggles:Y(o(),A()).optional(),stepOverridesByDevice:Y(o(),Y(o(),Y(o(),Qv))).optional(),pipelineByAgent:Y(o(),PI).optional()}),Kw=d({deviceId:l(),agentNodeId:o(),pinned:A(),reason:N(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:l()}),zQ=d({nodeId:o(),online:A(),load:OI,score:l(),decodeHwaccel:o().nullable()}),LQ=d({totalAgents:l(),onlineAgents:l(),totalCameras:l(),attachedCameras:l(),activeCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()}),qQ=Y(o(),o()),BQ=d({ownerNodeId:o(),reachableHost:o().optional(),configIssue:o().optional()}),UQ=d({camStreamId:o(),codec:o(),width:l(),height:l(),fps:l(),kind:o()}),FQ=d({streams:w(UQ).readonly()}),HQ=d({detectionNodeId:o().nullable(),decoderNodeId:o().nullable(),audioNodeId:o().nullable(),sourceNodeId:o().nullable(),pinned:d({detection:A(),decoder:A(),audio:A()}),reasons:d({detection:o().optional(),decoder:o().optional(),audio:o().optional()})}),$Q=d({profile:o(),status:o(),codec:o(),width:l(),height:l(),subscribers:l(),inFps:l(),outFps:l()}),QQ=d({profiles:w($Q).readonly(),webrtcSessions:l(),rtspRestream:A()}),VQ=d({framesWritten:l(),getFrameHits:l(),getFrameMisses:l(),budgetMb:l()}),GQ=d({nodeId:o(),formats:w(o()).readonly(),sessionCount:l(),shm:VQ}),ZQ=d({enabled:A(),fps:l()}),WQ=N(["idle","installing","verifying","ready","failed"]),KQ=d({state:WQ,error:o().optional()}),YQ=N(["idle","watching","active"]),XQ=d({nodeId:o(),engine:d({backend:o(),device:o()}),phase:YQ,configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceMs:l(),provisioning:KQ}),JQ=d({nodeId:o(),enabled:A()}),eV=vb,tV=d({mode:eV,active:A(),storageBytes:l()}),nV=N(["source","broker","detection","recording","switches"]),aV=N(["timeout","error","partial"]),iV=d({stage:nV,reason:aV,elapsedMs:l()}),Yw=d({state:N(["idle","running","done","error"]),total:l().int().nonnegative(),completed:l().int().nonnegative(),currentDeviceId:l().int().nullable(),failed:w(l().int()).readonly(),mediaDropped:l().int().nonnegative(),tracks:l().int().nonnegative(),events:l().int().nonnegative(),startedAtMs:l().int().nullable(),finishedAtMs:l().int().nullable(),error:o().nullable()}),Xw=d({deviceId:l(),assignment:HQ,source:FQ,broker:QQ.nullable(),decoder:GQ.nullable(),motion:ZQ.nullable(),detection:XQ.nullable(),audio:JQ.nullable(),recording:tV.nullable(),switchedOff:w(iu).readonly(),degraded:w(iV).readonly(),fetchedAt:l()}),rV=["disabled","unavailable","cannot-host-camera-root","accelerator-preferred"],oV=N(rV),sV=d({key:o(),backend:o(),device:o(),format:N(vm),available:A(),enabled:A(),weight:l(),maxSessions:l().nullable(),defaultModelId:o(),steps:Y(o(),$b).optional(),exclusion:oV.nullable()}),lV=d({nodeId:o(),reachable:A(),devices:w(sV).readonly()}),cV={name:"pipeline-orchestrator",scope:"system",mode:"singleton",nodeIdMode:"data",exposesDeviceSettings:!0,methods:{pauseForStorageMigration:y(jr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:y(jr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),assignPipeline:y(d({deviceId:l(),agentNodeId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setPipelineDevicePin:y(d({deviceId:l(),deviceKey:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getPipelineDevicePin:y(d({deviceId:l()}),d({deviceKey:o().nullable()})),rebalance:y(O(),d({migrated:l()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:y(O(),w(Kw).readonly()),getPipelineAssignment:y(d({deviceId:l()}),Kw.nullable()),getAgentLoad:y(O(),w(zQ).readonly()),getGlobalMetrics:y(O(),LQ),getCameraMetrics:y(d({deviceId:l()}),Fb.nullable()),getCapabilityBindings:y(d({nodeId:o()}),qQ),setCapabilityBinding:y(d({nodeId:o(),capName:o(),addonId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getIngestOwner:y(O(),BQ),assignAudio:y(d({deviceId:l(),nodeId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:y(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:y(d({deviceId:l()}),d({nodeId:o(),pinned:A(),assignedAt:l()}).nullable()),getAudioNodeLoad:y(O(),w(d({nodeId:o(),deviceCount:l()}))),getAudioAssignments:y(O(),w(d({deviceId:l(),nodeId:o(),pinned:A(),assignedAt:l()}))),getAgentSettings:y(d({agentNodeId:o()}),Ww.nullable()),listAgentSettings:y(O(),w(d({nodeId:o(),settings:Ww})).readonly()),removeAgentSettings:y(d({agentNodeId:o()}),d({success:A(),removed:A()}),{kind:"mutation",auth:"admin"}),setAgentMaxCameras:y(d({agentNodeId:o(),maxCameras:l().int().nonnegative().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentDetectWeight:y(d({agentNodeId:o(),detectWeight:l().positive().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentCapabilities:y(d({agentNodeId:o(),detect:A().nullable().optional(),audio:A().nullable().optional(),ingest:A().nullable().optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentDecodeLimits:y(d({agentNodeId:o(),decodeBudgetMb:l().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).nullable().optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentReachableHost:y(d({agentNodeId:o(),reachableHost:o().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentInferenceDevices:y(d({agentNodeId:o(),inferenceDevices:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),$b).optional()}))}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getNodeInferenceDevices:y(d({nodeId:o()}),lV),resetNodePipelineDefaults:y(d({agentNodeId:o()}),d({success:Q(!0),effectiveModelId:o().nullable(),clearedCameraOverrides:l()}),{kind:"mutation",auth:"admin"}),getCameraSettings:y(d({deviceId:l()}),DQ.nullable()),setCameraStepToggle:y(d({deviceId:l(),addonId:o(),enabled:A().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:y(d({deviceId:l()}),Y(o(),Y(o(),Y(o(),Qv))).nullable()),setCameraStepOverride:y(d({deviceId:l(),agentNodeId:o(),deviceKey:o(),addonId:o(),patch:Qv.nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:y(d({deviceId:l(),agentNodeId:o(),pipeline:PI.nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:y(d({deviceId:l(),agentNodeId:o().optional()}),pp),getCameraSwitches:y(d({deviceId:l()}),lw),setCameraSwitch:y(d({deviceId:l(),switchId:iu,enabled:A()}),lw,{kind:"mutation",auth:"admin"}),getCameraStatus:y(d({deviceId:l()}),Xw),getCameraStatuses:y(d({deviceIds:w(l()).optional()}),w(Xw).readonly()),reconcileFromDisk:y(O(),Yw,{kind:"mutation",auth:"admin"}),getReconcileFromDiskStatus:y(O(),Yw,{auth:"admin"}),listTemplates:y(O(),w(cg).readonly()),saveTemplate:y(d({name:o(),description:o().optional(),config:pp}),cg,{kind:"mutation",auth:"admin"}),updateTemplate:y(d({id:o(),name:o().optional(),description:o().optional(),config:pp.optional()}),cg,{kind:"mutation",auth:"admin"}),deleteTemplate:y(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"})}},uV={motion:"motion",audio:"audio",person:"person",vehicle:"vehicle",animal:"animal",package:"package",door:"door",pir:"pir",smoke:"smoke",water:"water",button:"button",generic:"generic",gas:"smoke",vibration:"generic",tamper:"generic",presence:"person",lock:"generic",siren:"generic",switch:"generic",doorbell:"button"};function dV(e){return uV[e]??"generic"}var pV={contact:"contact",motion:"motion-sensor",smoke:"smoke",flood:"flood",gas:"gas","carbon-monoxide":"carbon-monoxide",vibration:"vibration",tamper:"tamper",presence:"presence","enum-sensor":"enum-sensor","event-emitter":"device-event","lock-control":"lock",switch:"switch",button:"button",doorbell:"doorbell"};function mV(e,t){const n=Tb[t];if(n===void 0)throw new Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:dV(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(pV).map(([e,t])=>[e,mV(e,t)])));var fV=N(["workspace","baked","data-root"]),hV=N(["idle","checking","staging","pending-restart","awaiting-confirmation"]),gV=N(["in-sync","behind-patch","behind-series","ahead","unknown"]),vV=d({state:gV,seedVersion:o().nullable(),contractVersion:o().nullable(),contractSource:N(["registry","running"]).nullable(),message:o()}),yV=N(["docker","electron","native","contradictory","unknown"]),bV=d({fact:N(["dockerenv-file","proc-1-cgroup","platform","electron-app-version-env"]),mode:N(["observed","declared"]),holds:A(),detail:o()}),SV=d({kind:yV,evidence:w(bV),currentVersion:o().nullable()}),xV=d({fromVersion:o(),toVersion:o().nullable(),atMs:l(),reason:o()}),kV=d({packageName:o(),runningVersion:o().nullable(),nodeRuntimeVersion:o().nullable(),activeVersion:o().nullable(),previousVersion:o().nullable(),seedVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),bootMode:fV,updateState:hV,pendingVersion:o().nullable(),rolledBack:xV.nullable(),stateFileCorrupt:A(),lastCheckedAtMs:l().nullable(),imageContract:vV.optional(),wrapper:SV.optional()}),wV=d({packageName:o(),runningVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),checkedAtMs:l(),error:o().nullable()}),ug=d({accepted:A(),targetVersion:o().nullable(),restarting:A(),message:o()}),MV={name:"server-management",scope:"system",mode:"singleton",methods:{getServerPackageStatus:y(O(),kV,{auth:"admin"}),checkServerUpdate:y(O(),wV,{kind:"mutation",auth:"admin"}),applyServerUpdate:y(d({version:o().optional()}),ug,{kind:"mutation",auth:"admin",timeoutMs:16*6e4}),rollbackServerUpdate:y(O(),ug,{kind:"mutation",auth:"admin"}),restartServer:y(O(),ug,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},Us=xL(),CV=d({to:Ye([Us,w(Us).min(1)]),cc:w(Us).optional(),bcc:w(Us).optional(),from:o().optional(),replyTo:o().optional(),subject:o(),text:o(),html:o().optional()}),AV=d({messageId:o(),accepted:w(Us).default([]),rejected:w(Us).default([])}),Jw=d({ready:A(),host:o(),error:o().optional(),lastVerifiedAt:l().optional()}),EV={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:y(CV,AV,{kind:"mutation",auth:"admin",access:"create"}),verify:y(O(),Jw,{kind:"mutation",auth:"admin",access:"view"}),getStatus:y(O(),Jw,{auth:"admin"})}},RV=d({base64:o(),contentType:o()}),IV=d({lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),lastBytes:l().nullable(),lastStreamId:o().nullable()}),TV={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:y(d({deviceId:l(),streamId:o().optional(),force:A().optional()}),RV.nullable()),invalidateCache:y(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getSnapshotOverview:Gh(d({deviceIds:w(l()).min(1).max(200)}),w(d({deviceId:l(),lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),etag:o().nullable()}))),getDebugState:Gh(d({deviceId:l()}),d({battery:d({sleeping:A(),lastUpdated:l(),lastContactAt:l().optional()}).nullable(),state:d({isBattery:A(),reason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable()}),frame:d({capturedAt:l().nullable(),ageMs:l().nullable()}),waking:A()})),getSnapshotLinks:Gh(d({targets:w(d({deviceId:l(),width:l().int().positive().optional()})).min(1).max(200)}),w(d({deviceId:l(),url:o().nullable(),capturedAt:l().nullable(),ageMs:l().nullable(),expiresAt:l().nullable(),width:l().nullable(),neverCaptured:A(),sleeping:A(),stateReason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable(),battery:A()})))},status:{schema:IV,kind:"poll"}},eM=d({userId:o(),username:o(),isAdmin:A(),provider:o(),email:o().optional(),displayName:o().optional(),hubUrl:o().optional(),scopes:w(Ra).optional(),redirectUri:o().optional(),integrationId:o().optional(),jti:o().optional(),codeChallenge:o().optional(),sessionId:o().optional(),refreshTtl:Ye([l().int().positive(),Q("never")]).optional()}),_V={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:y(d({claims:eM,ttlSec:Ye([l().int().positive(),Q("never")]).optional()}),d({token:o()}),{auth:"admin"}),verifyBridgeToken:y(d({token:o()}),eM.nullable(),{auth:"admin"})}},NV=kt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:X(),nodeLocal:A(),shouldSaveDiskSpace:Q(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:X(),nodeLocal:A(),shouldSaveDiskSpace:Q(!1),minFreePercent:Q(null)})]),OV={name:"storage",scope:"system",mode:"singleton",methods:{resolve:y(d({location:qi,relativePath:o()}),o()),write:y(d({location:qi,relativePath:o(),data:$t(Uint8Array)}),O(),{kind:"mutation"}),read:y(d({location:qi,relativePath:o()}),$t(Uint8Array)),exists:y(d({location:qi,relativePath:o()}),A()),list:y(d({location:qi,prefix:o().optional()}),w(o()).readonly()),delete:y(d({location:qi,relativePath:o()}),O(),{kind:"mutation"}),getAvailableSpace:y(d({location:qi}),l().nullable()),beginUpload:y(d({location:qi,relativePath:o(),sizeBytes:l().optional()}),d({uploadId:o()}),{kind:"mutation"}),writeChunk:y(d({uploadId:o(),offset:l(),data:$t(Uint8Array)}),O(),{kind:"mutation"}),finalizeUpload:y(d({uploadId:o()}),O(),{kind:"mutation"}),abortUpload:y(d({uploadId:o()}),O(),{kind:"mutation"}),beginDownload:y(d({location:qi,relativePath:o()}),d({downloadId:o(),sizeBytes:l()}),{kind:"mutation"}),readChunk:y(d({downloadId:o(),offset:l(),length:l()}),$t(Uint8Array)),endDownload:y(d({downloadId:o()}),O(),{kind:"mutation"}),listLocations:y(d({type:fR.optional()}),w(Ua).readonly()),listLocationDeclarations:y(O(),w(Jq).readonly()),upsertLocation:y(Ua.omit({createdAt:!0,updatedAt:!0}),Ua,{kind:"mutation",auth:"admin"}),deleteLocation:y(d({id:o(),force:A().optional()}),O(),{kind:"mutation",auth:"admin"}),listDrainProgress:y(O(),w(Yq).readonly()),testLocation:y(d({id:o()}),d({ok:A(),error:o().optional()}),{auth:"admin"}),listProviders:y(O(),w(NV).readonly()),testConfig:y(d({providerId:o(),locationId:o().optional(),config:Y(o(),X())}),d({ok:A(),error:o().optional()}),{auth:"admin"})}},PV=d({bytes:l().int().nonnegative()}),jV=d({reclaimedBytes:l().int().nonnegative(),exhausted:A()}),DV={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:y(d({locationId:o()}),PV,{auth:"admin"}),evict:y(d({locationId:o(),targetBytes:l().int().positive()}),jV,{kind:"mutation",auth:"admin"})}},zV={name:"storage-migration",scope:"system",mode:"singleton",methods:{plan:y(pw,_q,{auth:"admin"}),start:y(pw,d({jobId:o()}),{kind:"mutation",auth:"admin"}),status:y(d({jobId:o().optional()}),mw.nullable(),{auth:"admin"}),cancel:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),movers:y(d({}),w(Oq).readonly(),{auth:"admin"}),residue:y(d({}),w(Pq).readonly(),{auth:"admin"}),drain:y(jq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStart:y(Vq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStatus:y(Zq,Gq.nullable(),{auth:"admin"}),cleanupCancel:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),history:y(d({}),w(mw).readonly(),{auth:"admin"})}},LV=d({locationId:o(),ownedBytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}),qV={name:"storage-occupancy",scope:"system",mode:"collection",internal:!0,methods:{getOccupancy:y(d({locationIds:w(o()).readonly()}),w(LV).readonly(),{auth:"admin"})}},BV=kt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:X(),nodeLocal:A(),shouldSaveDiskSpace:Q(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:X(),nodeLocal:A(),shouldSaveDiskSpace:Q(!1),minFreePercent:Q(null)})]),UV=d({ok:A(),error:o().optional()}),FV=d({location:Ua,relativePath:o(),sizeBytes:l().optional()}),HV=d({uploadId:o()}),$V=d({uploadId:o(),offset:l(),data:$t(Uint8Array)}),QV=d({uploadId:o()}),VV=d({uploadId:o()}),GV=d({location:Ua,relativePath:o()}),ZV=d({downloadId:o(),sizeBytes:l()}),WV=d({downloadId:o(),offset:l(),length:l()}),KV=d({downloadId:o()}),YV={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:y(O(),BV,{auth:"admin"}),testLocation:y(d({config:Y(o(),X())}),UV,{auth:"admin"}),resolve:y(d({location:Ua,relativePath:o()}),o(),{auth:"admin"}),write:y(d({location:Ua,relativePath:o(),data:$t(Uint8Array)}),O(),{kind:"mutation",auth:"admin"}),read:y(d({location:Ua,relativePath:o()}),$t(Uint8Array),{auth:"admin"}),exists:y(d({location:Ua,relativePath:o()}),A(),{auth:"admin"}),list:y(d({location:Ua,prefix:o().optional()}),w(o()).readonly(),{auth:"admin"}),delete:y(d({location:Ua,relativePath:o()}),O(),{kind:"mutation",auth:"admin"}),getAvailableSpace:y(d({location:Ua}),l().nullable(),{auth:"admin"}),beginUpload:y(FV,HV,{kind:"mutation",auth:"admin"}),writeChunk:y($V,O(),{kind:"mutation",auth:"admin"}),finalizeUpload:y(QV,O(),{kind:"mutation",auth:"admin"}),abortUpload:y(VV,O(),{kind:"mutation",auth:"admin"}),beginDownload:y(GV,ZV,{kind:"mutation",auth:"admin"}),readChunk:y(WV,$t(Uint8Array),{auth:"admin"}),endDownload:y(KV,O(),{kind:"mutation",auth:"admin"})}},XV=X().nullable(),Vv=Y(o(),X()),tM=d({sessionId:o(),profileId:o(),label:o(),cols:l().int().positive(),rows:l().int().positive(),startedAt:l()}),JV=d({profileId:o(),label:o(),description:o().optional(),executable:o().optional(),args:w(o()).readonly().optional(),cwd:o().optional(),environment:w(o()).readonly().optional(),settingsSchema:XV.optional()}),sc=d({instanceId:o(),cameraStableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),enabled:A(),executable:o(),args:w(o()).readonly(),cwd:o(),environment:w(o()).readonly(),profileSettings:Vv}),eG=d({stableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),adoptable:A()}),tG=kt("kind",[d({seq:l().int().positive(),kind:Q("data"),data:o()}),d({seq:l().int().positive(),kind:Q("exit"),exitCode:l().int(),signal:l().int().optional()})]),nG=d({cursor:l().int().nonnegative(),reset:A(),snapshot:o().optional(),events:w(tG).readonly()}),aG={name:"terminal-session",scope:"system",mode:"singleton",methods:{listProfiles:y(O(),w(JV).readonly(),{auth:"admin"}),listInstances:y(O(),w(sc).readonly(),{auth:"admin"}),createInstance:y(d({targetNodeId:o().min(1),profileId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:Vv.optional()}),sc,{kind:"mutation",auth:"admin"}),updateInstance:y(d({instanceId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:Vv.optional()}),sc,{kind:"mutation",auth:"admin"}),deleteInstance:y(d({instanceId:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),setInstanceEnabled:y(d({instanceId:o().min(1),enabled:A()}),sc,{kind:"mutation",auth:"admin"}),listLegacyCameras:y(O(),w(eG).readonly(),{auth:"admin"}),adoptLegacyMonitor:y(d({stableId:o().min(1),name:o().trim().min(1).max(160).optional()}),sc,{kind:"mutation",auth:"admin"}),listSessions:y(O(),w(tM).readonly(),{auth:"admin"}),openSession:y(d({profileId:o(),cols:l().int().positive(),rows:l().int().positive(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional()}),tM,{kind:"mutation",auth:"admin"}),resize:y(d({sessionId:o(),cols:l().int().positive(),rows:l().int().positive()}),O(),{kind:"mutation",auth:"admin"}),pullOutput:y(d({sessionId:o(),afterSeq:l().int().nonnegative(),waitMs:l().int().min(0).max(2e3).default(0),waitForOutput:A().optional()}),nG,{kind:"mutation",auth:"admin",timeoutMs:15e3}),writeInput:y(d({sessionId:o(),data:o().max(64*1024)}),O(),{kind:"mutation",auth:"admin"}),close:y(d({sessionId:o()}),O(),{kind:"mutation",auth:"admin"})}},iG=d({urls:Ye([o(),w(o())]),username:o().optional(),credential:o().optional()}),rG={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:y(O(),w(iG).readonly())}},oG=d({credentialId:o(),label:o(),createdAt:l(),lastUsedAt:l().nullable(),transports:w(o()).default([])}),sG={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:y(d({userId:o(),username:o()}),d({optionsJSON:Y(o(),X())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:y(d({userId:o(),response:Y(o(),X()),label:o()}),d({success:Q(!0),credentialId:o()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:y(d({userId:o().optional()}),d({optionsJSON:Y(o(),X())}),{kind:"mutation",access:"view",auth:"admin"}),finishAuthentication:y(d({userId:o(),response:Y(o(),X())}),d({verified:A()}),{kind:"mutation",access:"view",auth:"admin"}),beginDiscoverableAuthentication:y(d({}),d({optionsJSON:Y(o(),X())}),{kind:"mutation",access:"view",auth:"admin"}),finishDiscoverableAuthentication:y(d({response:Y(o(),X())}),d({verified:A(),userId:o().nullable()}),{kind:"mutation",access:"view",auth:"admin"}),listPasskeys:y(d({userId:o()}),w(oG),{auth:"admin"}),removePasskey:y(d({userId:o(),credentialId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getSecondFactorPreference:y(d({userId:o()}),d({enabled:A()}),{auth:"admin"}),setSecondFactorPreference:y(d({userId:o(),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"})}},jI=N(["cosine","dot","euclidean"]),lu=Y(o(),Ye([o(),l(),A()])),DI=d({equals:Y(o(),Ye([o(),l(),A()])).optional(),between:Y(o(),nu([l(),l()])).optional()}),lG=d({id:o(),vector:o(),metadata:lu}),cG=d({id:o(),score:l(),metadata:lu}),uG=d({index:o(),dim:l().int().positive(),metric:jI.default("cosine")}),dG=d({index:o(),items:w(lG)}),pG=d({upserted:l(),rejected:l()}),mG=d({index:o(),vector:o(),topK:l().int().positive(),minScore:l().optional(),filter:DI.optional()}),fG=d({matches:w(cG),scanned:l(),truncated:A(),effectiveTopK:l().int().positive()}),hG=d({index:o(),ids:w(o())}),gG=d({index:o(),filter:DI}),nM=d({deleted:l()}),vG=d({index:o(),ids:w(o())}),yG=d({items:w(d({id:o(),metadata:lu}))}),bG=d({index:o(),ids:w(o())}),SG=d({items:w(d({id:o(),vector:o(),metadata:lu}))}),xG=d({index:o(),cursor:l().int().nonnegative().default(0),limit:l().int().positive()}),kG=d({items:w(d({id:o(),metadata:lu})),nextCursor:l().int().nonnegative().nullable()}),wG=d({index:o()}),MG=d({backend:o(),count:l(),dim:l(),metric:jI,bytes:l().optional(),exact:A()}),CG={name:"vector-store",scope:"system",mode:"singleton",internal:!0,methods:{declareIndex:y(uG,O(),{kind:"mutation",auth:"admin"}),upsert:y(dG,pG,{kind:"mutation",auth:"admin"}),query:y(mG,fG,{auth:"admin"}),getByIds:y(vG,yG,{auth:"admin"}),fetchByIds:y(bG,SG,{auth:"admin"}),scan:y(xG,kG,{auth:"admin"}),deleteByIds:y(hG,nM,{kind:"mutation",auth:"admin"}),deleteByFilter:y(gG,nM,{kind:"mutation",auth:"admin"}),stats:y(wG,MG,{auth:"admin"})}},AG=d({id:o(),source:o(),kind:N(["motion","object","audio","native"]),timeRange:d({startMs:l(),endMs:l()}),labels:w(o()).max(3).optional(),thumbnail:o().optional(),stillAtMs:l().optional(),eventIds:w(o()).optional(),eventCount:l().int().nonnegative().optional(),holes:w(d({startMs:l(),endMs:l()})).optional()}),EG=d({playbackUrl:o(),playbackEndpoints:w(o()).optional(),token:o().optional()}),RG={name:"videoclips",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{listClips:y(d({deviceId:l(),since:l(),until:l(),limit:l().int().positive().optional()}),w(AG).readonly(),{kind:"query",auth:"admin"}),getClipPlayback:y(d({deviceId:l(),clipId:o()}),EG,{kind:"query",auth:"admin"})}},aM=d({viewportWidth:l().int().positive().optional(),viewportHeight:l().int().positive().optional(),devicePixelRatio:l().positive().optional(),downlinkMbps:l().nonnegative().optional(),prefersTier:o().optional()}).partial(),mp=kt("kind",[d({kind:Q("adaptive")}),d({kind:Q("profile"),profile:on}),d({kind:Q("cam-stream"),camStreamId:o().min(1)})]),IG=d({id:o(),label:o(),target:mp,codec:o().nullable(),resolution:d({width:l(),height:l()}).nullable(),status:N(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:l().nullable(),decodeFps:l().nullable(),bitrateKbps:l().nullable()}),TG={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[H.Camera],methods:{listStreams:y(d({deviceId:l().int().nonnegative()}),w(IG)),createSession:y(d({deviceId:l().int().nonnegative(),target:mp,hints:aM.optional(),relayOnly:A().optional(),consumerAttribution:Pv.optional()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation"}),handleOffer:y(d({deviceId:l().int().nonnegative(),target:mp.optional(),sdpOffer:o(),sessionId:o().optional(),relayOnly:A().optional(),nonTrickle:A().optional(),disableTurn:A().optional(),disableIpv6:A().optional(),consumerAttribution:Pv.optional(),hints:aM.optional()}),d({sessionId:o(),sdpAnswer:o()}),{kind:"mutation"}),handleAnswer:y(d({deviceId:l().int().nonnegative(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation"}),addIceCandidate:y(d({deviceId:l().int().nonnegative(),sessionId:o(),candidate:o(),sdpMid:o().nullable().optional(),sdpMLineIndex:l().int().nullable().optional()}),O(),{kind:"mutation"}),getIceCandidates:y(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({candidates:w(d({candidate:o(),sdpMid:o().nullable(),sdpMLineIndex:l().int().nullable()})),done:A()}),{kind:"query"}),closeSession:y(d({deviceId:l().int().nonnegative(),sessionId:o()}),O(),{kind:"mutation"}),hasAdaptiveBitrate:y(d({deviceId:l().int().nonnegative(),profile:on}),A()),getSessionState:y(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({pendingRenegotiation:d({target:mp,epoch:l()}).nullable(),alive:A()}))},mount:{kind:"server-provided"}},_G=d({childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()}),NG={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Hub,H.Switch,H.Light,H.Sensor,H.Thermostat,H.Cover,H.Lock,H.Fan,H.MediaPlayer,H.AlarmPanel,H.Generic],methods:{setChildHidden:y(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative(),hidden:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onAccessoriesChanged:{data:d({deviceId:l(),childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:l(),childDeviceId:l(),hidden:A()})}},status:{schema:_G,kind:"command-driven"}},OG=N(["install","update","uninstall","restart"]),zI=N(["queued","fetching","staged","validating","applying","restarting","applied","done","failed","skipped"]),PG=N(["framework","addon"]),jG=d({tsMs:l(),nodeId:o(),packageName:o(),phase:zI,message:o()}),DG=d({taskId:o(),nodeId:o(),packageName:o(),fromVersion:o().nullable(),toVersion:o(),target:PG,phase:zI,stagedPath:o().nullable(),attempts:l(),steps:w(jG),error:o().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable()}),zG=N(["running","completed","failed","partially-failed","cancelled"]),LG=N(["single","bulk","cluster"]),iM=d({jobId:o(),kind:OG,createdAtMs:l(),createdBy:o(),scope:LG,tasks:w(DG),state:zG,schemaVersion:Q(1)}),rM=N(["debug","info","warn","error"]),Gv=N(["off","latest","beta"]),LI=N(["off","latest","beta","inherit"]),qG=d({id:o(),name:o().optional(),version:o().optional(),description:o().optional(),icon:o().optional(),color:o().optional(),capabilities:w(X()).readonly().optional(),packageName:o(),packageVersion:o(),packageDisplayName:o().optional(),bundle:d({displayName:o(),description:o().optional(),icon:o().optional()}).optional(),protected:A().optional(),removable:A().optional()}),BG=d({pid:l().optional(),mode:o(),state:o()}),UG=d({phase:N(["pending","healthy","failed"]),retryCount:l(),firstFailureAt:l().nullable(),lastAttemptAt:l().nullable(),lastError:d({message:o(),stack:o().optional()}).nullable(),nextRetryAt:l().nullable(),alertEmitted:A(),retrying:A(),inGracePeriod:A()}),FG=d({manifest:qG,declaration:X().optional(),source:o(),installSource:o().optional(),process:BG.optional(),hasBackup:A().optional(),health:UG.nullable().optional()}),HG=d({name:o(),version:o(),dir:o(),installSource:o().optional()}),$G=d({name:o(),currentVersion:o(),latestVersion:o(),category:N(["addon","core"]),requiresRestart:A(),isSystem:A()}),QG=d({version:o(),publishedAt:o(),deprecated:o().optional(),distTags:w(o()).readonly()}),VG=d({name:o(),version:o(),description:o(),keywords:w(o()).readonly(),publishedAt:o(),author:o(),installed:A(),installedVersion:o().optional()}),GG=d({channel:Gv,intervalSeconds:l(),updateCheckIntervalSeconds:l()}),ZG=LI,WG=X(),oM=X(),KG=X(),YG=N(["queued","updating","done","done-pending-restart","failed"]),XG=d({name:o(),isSystem:A(),fromVersion:o(),toVersion:o(),status:YG,error:o().optional(),startedAtMs:l().optional(),completedAtMs:l().optional()}),JG=N(["regular","system","restarting","finalizing"]);d({id:o(),nodeId:o(),startedAtMs:l(),completedAtMs:l().optional(),total:l(),completed:l(),failed:l(),current:o().nullable(),phase:JG,cancelled:A(),items:w(XG).readonly()});var eZ=d({packageName:o(),currentVersion:o(),latestVersion:o().nullable(),hasUpdate:A(),description:o().optional(),buildId:o().nullable()}),tZ=d({timestamp:o(),level:o(),message:o(),scope:o().optional()}),nZ=X(),aZ=d({addonId:o().min(1),action:o().min(1),input:X()}),iZ={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:y(O(),w(FG).readonly()),getLogs:y(d({addonId:o(),limit:l().min(1).max(500).default(100),level:rM.optional()}),w(nZ)),listPackages:y(O(),w(HG).readonly()),installPackage:y(d({packageName:o(),version:o().optional()}),oM,{kind:"mutation",auth:"admin"}),installFromWorkspace:y(d({packageName:o()}),oM,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:y(O(),A()),listWorkspacePackages:y(O(),w(X()).readonly()),uninstallPackage:y(d({packageName:o()}),X(),{kind:"mutation",auth:"admin"}),reloadPackages:y(O(),KG,{kind:"mutation",auth:"admin"}),searchAvailable:y(d({query:o().optional()}),w(VG)),listUpdates:y(d({nodeId:o().optional()}),w($G).readonly(),{auth:"admin"}),updatePackage:y(d({name:o().min(1),version:o().optional(),nodeId:o().optional()}),X(),{kind:"mutation",auth:"admin"}),rollbackPackage:y(d({name:o().min(1)}),d({rolledBackTo:o().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:y(d({nodeId:o().optional()}),X(),{kind:"mutation",auth:"admin"}),restartServer:y(d({confirm:Q(!0)}),X(),{kind:"mutation",auth:"admin"}),getLastRestart:y(O(),d({kind:N(["framework-update","manual","system","framework-bulk-update"]),packageName:o().optional(),fromVersion:o().optional(),toVersion:o().optional(),requestedBy:o().optional(),requestedAt:l()}).nullable(),{auth:"admin"}),listFrameworkPackages:y(O(),w(eZ).readonly(),{auth:"admin"}),listCapabilityProviders:y(d({capName:o().min(1)}),w(d({addonId:o(),mode:N(["singleton","collection"]),isActive:A()})).readonly()),setCapabilityProviderEnabled:y(d({capName:o().min(1),addonId:o().min(1),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getVersions:y(d({name:o()}),w(QG).readonly()),restartAddon:y(d({addonId:o()}),WG,{kind:"mutation",auth:"admin"}),retryLoad:y(d({packageName:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:y(O(),GG,{auth:"admin"}),setAutoUpdateSettings:y(d({channel:Gv,intervalSeconds:l().min(300).max(86400).optional(),updateCheckIntervalSeconds:l().min(900).max(604800).optional()}),X(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:y(d({addonId:o()}),ZG,{auth:"admin"}),setAddonAutoUpdate:y(d({addonId:o(),channel:LI}),X(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:y(d({channel:Gv}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),custom:y(aZ,X(),{kind:"mutation"}),startJob:y(d({kind:N(["install","update","uninstall","restart"]),targets:w(d({name:o().min(1),version:o().min(1)})).min(1),nodeIds:w(o()).optional()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),getJob:y(d({jobId:o()}),iM.nullable(),{auth:"admin"}),listJobs:y(d({activeOnly:A().optional()}),w(iM),{auth:"admin"}),cancelJob:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),onAddonLogs:y(d({addonId:o(),level:rM.optional()}),tZ,{kind:"subscription"})},mount:{kind:"server-provided"}},sM=d({co2Ppm:l().min(0).optional(),vocPpb:l().min(0).optional(),pm25:l().min(0).optional(),pm10:l().min(0).optional(),aqi:l().optional(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),rZ={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:sM,kind:"push"},runtimeState:sM,durability:"restored",volatileStateFields:["lastFetchedAt"]},lM=d({lux:l().min(0),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),oZ={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:lM,kind:"push"},runtimeState:lM,durability:"restored",volatileStateFields:["lastFetchedAt"]},sZ=d({className:o(),hits:l().int().nonnegative(),avgScore:l().min(0).max(1),peakScore:l().min(0).max(1)}),cM=d({ts:l().int(),windowSec:l().int().positive(),level:d({rms:l(),dbfs:l()}),peakDbfs:l(),avgDbfs:l(),current:d({className:o(),score:l().min(0).max(1),timestamp:l().int()}).nullable(),byClass:w(sZ).readonly()}),lZ=d({ts:l().int(),dbfs:l().nullable(),peakDbfs:l(),avgDbfs:l(),topClass:o().nullable(),topScore:l().min(0).max(1).nullable()}),cZ=d({points:w(lZ).readonly(),effectiveSampleEveryMs:l().int().positive(),windowMsActual:l().int().nonnegative()}),uZ={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getCurrentSnapshot:y(d({deviceId:l()}),cM.nullable()),getHistory:y(d({deviceId:l(),windowSec:l().int().positive().optional(),sampleEveryMs:l().int().positive().optional()}),cZ)},runtimeState:cM,durability:"session"},uM=d({enabled:A(),isRunning:A(),lastTriggeredAt:l(),lastError:o().nullable(),lastChangedAt:l()}),dZ={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Automation],methods:{enable:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),disable:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),trigger:y(d({deviceId:l().int().nonnegative(),skipCondition:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:uM,kind:"push"},runtimeState:uM,durability:"session"},dg=d({percentage:l().min(0).max(100).nullable(),charging:N(["dc","solar","none","unknown"]),sleeping:A(),lastUpdated:l(),lastContactAt:l().optional(),binary:A().optional()}),pZ={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Button,H.Switch],methods:{wakeForStream:y(d({deviceId:l(),timeoutMs:l().int().min(500).max(3e4).default(8e3)}),d({awoke:A(),durationMs:l()}),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:dg})}},status:{schema:dg,kind:"push",empty:{percentage:0,charging:"unknown",sleeping:!1,lastUpdated:0}},runtimeState:dg,durability:"restored",volatileStateFields:["lastUpdated"]},dM=d({on:A(),lastChangedAt:l()}),mZ={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:dM,kind:"push"},runtimeState:dM,durability:"restored",volatileStateFields:["lastChangedAt"]},pM=d({percentage:l().min(0).max(100),lastChangedAt:l()}),fZ={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light],methods:{setBrightness:y(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},events:{onBrightnessChanged:{data:d({deviceId:l(),percentage:l().min(0).max(100),lastChangedAt:l()})}},status:{schema:pM,kind:"command-driven"},runtimeState:pM,durability:"session"},hZ={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Button],methods:{press:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})}},gZ=d({host:o(),port:l().int().positive().optional(),onvifPort:l().int().positive().optional(),rtspPort:l().int().positive().optional(),https:A().optional(),username:o().optional(),password:o().optional(),onvifProfile:o().optional()}),vZ=d({host:o(),port:l().int().positive().nullable(),onvifPort:l().int().positive().nullable(),rtspPort:l().int().positive().nullable(),https:A().nullable(),hasUsername:A(),hasPassword:A(),onvifProfile:o().nullable()}),yZ={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getCredentials:y(d({deviceId:l()}),gZ.nullable(),{kind:"query",auth:"admin"})},status:{schema:vZ,kind:"command-driven"}},mM=d({detected:A(),lastChangedAt:l()}),bZ={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:mM,kind:"push"},runtimeState:mM,durability:"restored",volatileStateFields:["lastChangedAt"]},Zv=N(["off","heat","cool","auto","heat_cool","fan_only","dry"]),fM=d({mode:Zv,availableModes:w(Zv),fanMode:o(),availableFanModes:w(o()),preset:o(),availablePresets:w(o()),target:l().nullable(),targetHigh:l().nullable(),targetLow:l().nullable(),targetHumidity:l().min(0).max(100).nullable(),currentTemp:l().nullable(),currentHumidity:l().min(0).max(100).nullable(),swingVertical:A().nullable(),swingHorizontal:A().nullable(),lastFetchedAt:l()}),SZ={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Thermostat,H.Climate],methods:{setMode:y(d({deviceId:l().int().nonnegative(),mode:Zv}),O(),{kind:"mutation",auth:"protected"}),setFanMode:y(d({deviceId:l().int().nonnegative(),fanMode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setPreset:y(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setTarget:y(d({deviceId:l().int().nonnegative(),target:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetRange:y(d({deviceId:l().int().nonnegative(),targetLow:l(),targetHigh:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:y(d({deviceId:l().int().nonnegative(),targetHumidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setSwingVertical:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setSwingHorizontal:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:fM,kind:"push"},runtimeState:fM,durability:"session"},Qb=d({r:l().int().min(0).max(255),g:l().int().min(0).max(255),b:l().int().min(0).max(255)}),Vb=d({h:l().min(0).max(360),s:l().min(0).max(100),v:l().min(0).max(100)}),xZ=kt("mode",[d({mode:Q("rgb"),rgb:Qb}),d({mode:Q("hsv"),hsv:Vb}),d({mode:Q("mired"),mireds:l().int().min(50).max(1e3)})]),hM=d({mode:N(["rgb","hsv","mired"]),rgb:Qb.optional(),hsv:Vb.optional(),mireds:l().int().optional(),lastChangedAt:l()}),kZ={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light],methods:{setColor:y(d({deviceId:l().int().nonnegative(),color:xZ}),O(),{kind:"mutation",auth:"protected"})},events:{onColorChanged:{data:d({deviceId:l(),mode:N(["rgb","hsv","mired"]),rgb:Qb.optional(),hsv:Vb.optional(),mireds:l().int().optional(),lastChangedAt:l()})}},status:{schema:hM,kind:"command-driven"},runtimeState:hM,durability:"session"},wZ=kt("outcome",[d({outcome:Q("validated"),latencyMs:l().nonnegative().optional(),detail:o().optional()}).strict(),d({outcome:Q("rejected"),error:o()}).strict(),d({outcome:Q("inconclusive"),error:o()}).strict()]),MZ=d({settings:Y(o(),X())}),CZ=d({label:o()}),AZ={name:"connection-test",scope:"system",mode:"collection",methods:{testSettings:y(MZ,wZ,{kind:"mutation",auth:"admin"}),describeTest:y(O(),CZ,{auth:"admin"})}},gM=d({connected:A(),lastChangedAt:l()}),EZ={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:gM,kind:"push"},runtimeState:gM,durability:"restored",volatileStateFields:["lastChangedAt"]},qI=d({key:o().min(1),label:o().min(1),level:l().min(0).max(100).nullable(),status:N(["ok","replace"]).nullable(),lastResetAt:l().nullable(),resettable:A()}),vM=d({items:w(qI),lastChangedAt:l()}),RZ={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(H),deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:y(d({deviceId:l().int().nonnegative(),key:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},status:{schema:vM,kind:"push",empty:{items:[],lastChangedAt:0},itemArray:{path:"items",keyField:"key",labelField:"label",itemSchema:qI,emptyItem:{key:"",label:"",level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:vM.extend({lastFetchedAt:l()}),durability:"session"},yM=d({entryOpen:A(),lastChangedAt:l()}),IZ={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:yM,kind:"push"},runtimeState:yM,durability:"restored",volatileStateFields:["lastChangedAt"]},TZ=N(["numeric","select","text","datetime"]),bM=d({kind:TZ,value:Ye([l(),o()]),options:w(o()),lastChangedAt:l(),unit:o().optional(),min:l().optional(),max:l().optional(),step:l().optional(),precision:l().int().min(0).max(10).optional(),format:N(["date","time","datetime"]).optional()}),_Z=kt("kind",[d({kind:Q("numeric"),value:l()}),d({kind:Q("select"),value:o().min(1)}),d({kind:Q("text"),value:o()}),d({kind:Q("datetime"),value:o().min(1)})]),NZ={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Control],methods:{setValue:y(d({deviceId:l().int().nonnegative(),control:_Z}),O(),{kind:"mutation",auth:"protected"})},status:{schema:bM,kind:"push"},runtimeState:bM,durability:"session"},OZ=N(["open","opening","closing","closed","stopped"]),SM=d({state:OZ,position:l().min(0).max(100).nullable(),tiltPosition:l().min(0).max(100).nullable(),lastChangedAt:l()}),PZ={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Cover],methods:{open:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:y(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setTiltPosition:y(d({deviceId:l().int().nonnegative(),tiltPosition:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:SM,kind:"push"},runtimeState:SM,durability:"restored",volatileStateFields:["lastChangedAt"]},Gb=N(["auto","day","night","schedule"]),xM=d({min:l(),max:l(),step:l()}),kM=d({mode:Gb,sensitivity:l().optional(),switchDelaySec:l().optional(),lastFetchedAt:l()}),jZ=d({modes:w(Gb),supportsSensitivity:A(),sensitivity:xM.optional(),supportsSwitchDelay:A(),switchDelaySec:xM.optional()}),DZ=d({mode:Gb.optional(),sensitivity:l().optional(),switchDelaySec:l().optional()}),zZ={name:"day-night",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"day-night",tab:"image"}},methods:{getOptions:y(d({deviceId:l()}),jZ),setSettings:y(d({deviceId:l(),settings:DZ}),O(),{kind:"mutation",auth:"admin"})},status:{schema:kM,kind:"poll"},runtimeState:kM,durability:"restored",volatileStateFields:["lastFetchedAt"]},pg=d({online:A(),lastChangedAt:l()}),LZ={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:pg})}},status:{schema:pg,kind:"push"},runtimeState:pg,durability:"restored",volatileStateFields:["lastChangedAt"]},wM=d({lastPressedAt:l().nullable(),pressCountSinceStart:l()}),qZ=d({deviceId:l(),timestamp:l()}),BZ={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[H.Button,H.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:qZ}},status:{schema:wM,kind:"push"},runtimeState:wM,durability:"restored"},UZ=N(["date","time","datetime"]),MM=d({value:o(),format:UZ.optional(),lastFetchedAt:l()}),FZ={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:MM,kind:"push"},runtimeState:MM,durability:"restored",volatileStateFields:["lastFetchedAt"]},BI=d({deviceId:l(),eventType:o(),data:Y(o(),X()).nullable(),timestamp:l(),seq:l()}),CM=d({eventTypes:w(o()),lastEvent:BI.nullable(),eventCountSinceStart:l()}),HZ={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.EventEmitter],methods:{},events:{onEvent:{data:BI}},status:{schema:CM,kind:"push"},runtimeState:CM,durability:"session"},$Z=d({id:o(),type:o(),timestamp:l(),label:o().optional(),thumbnailUrl:o().optional(),clipUrl:o().optional(),metadata:Y(o(),X()).optional()}),QZ={name:"events",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getEvents:y(d({deviceId:l(),from:l().optional(),to:l().optional(),limit:l().optional()}),w($Z)),getEventThumbnail:y(d({deviceId:l(),eventId:o()}),d({base64:o(),contentType:o()}).nullable()),getEventClipUrl:y(d({deviceId:l(),eventId:o()}),o().nullable())}},AM=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),VZ=d({id:o(),source:N(["detected","photo"]),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),GZ=d({sampleId:o(),enrolledAt:l().int(),deviceId:l().int().optional(),source:N(["detected","photo"]),mediaId:l().int().optional(),comparable:A(),selfMean:l().nullable(),bestForeign:d({identityId:o(),name:o(),score:l()}).optional(),suspicion:l()}),ZZ=d({identityId:o(),name:o(),modelId:o(),totalSamples:l().int(),comparableSamples:l().int(),flagged:l().int(),flagThreshold:l(),rows:w(GZ).readonly()}),EM=d({faceId:o(),deviceId:l().int(),trackId:o(),timestamp:l().int(),recognizedIdentityId:o().optional(),identityName:o().optional(),assigned:A(),base64:o().optional(),cropUrl:o().optional(),faceBbox:Xi.optional(),keyFrameMediaId:l().int().optional(),bestMatchScore:l().optional(),nativeFaceShortSidePx:l().optional(),suggestedIdentityId:o().optional(),suggestedMatchScore:l().optional()}),WZ=N(["unassigned","recognized","identified","all"]),KZ=N(["timestamp","suggestionConfidence"]),YZ=N(["asc","desc"]),XZ=d({faceIds:w(o()).readonly(),representativeFaceId:o(),size:l().int(),cohesion:l()}),JZ=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),eW={name:"face-gallery",scope:"system",mode:"singleton",methods:{listIdentities:y(d({includeCrops:A().optional()}).optional(),w(AM).readonly()),createIdentity:y(d({name:o().min(1)}),AM,{kind:"mutation",auth:"admin"}),renameIdentity:y(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteIdentity:y(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listIdentitySamples:y(d({identityId:o()}),w(VZ).readonly()),auditIdentitySamples:y(d({identityId:o().min(1)}),ZZ,{auth:"admin"}),removeSample:y(d({identityId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),listRecentFaces:y(d({deviceId:l().int().optional(),deviceIds:w(l().int()).optional(),limit:l().int().positive().optional(),filter:WZ.optional(),since:l().int().optional(),until:l().int().optional(),sortBy:KZ.optional(),sortDirection:YZ.optional(),includeCrops:A().optional()}).optional(),w(EM).readonly()),getFaceByTrack:y(d({deviceId:l().int(),trackId:o()}),EM.nullable()),getFaceMedia:y(d({faceId:o()}),w(JZ).readonly()),assignFace:y(d({faceId:o(),identityId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignFace:y(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),deleteFace:y(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),assignFaces:y(d({faceIds:w(o()).min(1),identityId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignFaces:y(d({faceIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),suggestFaceClusters:y(d({threshold:l().min(0).max(1).optional(),minClusterSize:l().int().min(2).optional(),maxClusters:l().int().positive().optional(),limit:l().int().positive().optional(),maxFacesScanned:l().int().positive().optional()}).optional(),w(XZ).readonly())}},UI=N(["forward","reverse"]),RM=d({percentage:l().min(0).max(100).nullable(),percentageStep:l().positive().optional(),preset:o(),availablePresets:w(o()),direction:UI.nullable(),oscillating:A().nullable(),lastChangedAt:l()}),tW={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Fan],methods:{setPercentage:y(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setPreset:y(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setDirection:y(d({deviceId:l().int().nonnegative(),direction:UI}),O(),{kind:"mutation",auth:"protected"}),setOscillating:y(d({deviceId:l().int().nonnegative(),oscillating:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:RM,kind:"push"},runtimeState:RM,durability:"session"},mg=d({flags:Y(o(),X()),deviceType:o().nullable(),model:o().nullable(),channelCount:l().nullable(),lastProbedAt:l(),lastFetchedAt:l()}),nW={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:d({deviceId:l(),status:mg})}},status:{schema:mg,kind:"push"},runtimeState:mg,durability:"session"},IM=d({flooded:A(),lastChangedAt:l()}),aW={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:IM,kind:"push"},runtimeState:IM,durability:"restored",volatileStateFields:["lastChangedAt"]},TM=d({detected:A(),lastChangedAt:l()}),iW={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:TM,kind:"push"},runtimeState:TM,durability:"restored",volatileStateFields:["lastChangedAt"]},_M=d({on:A(),currentHumidity:l().min(0).max(100).nullable(),targetHumidity:l().min(0).max(100).nullable(),mode:o().nullable(),availableModes:w(o()),action:o().nullable(),minHumidity:l().nullable(),maxHumidity:l().nullable(),lastChangedAt:l()}),rW={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Humidifier],methods:{setOn:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:y(d({deviceId:l().int().nonnegative(),humidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMode:y(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:_M,kind:"push"},runtimeState:_M,durability:"session"},NM=d({percent:l().min(0).max(100),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),oW={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor,H.Thermostat],methods:{},status:{schema:NM,kind:"push"},runtimeState:NM,durability:"restored",volatileStateFields:["lastFetchedAt"]},OM=d({url:o().nullable(),lastUpdated:l().nullable()}),sW={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Image],methods:{},status:{schema:OM,kind:"push"},runtimeState:OM,durability:"session"},Zb=N(["0","90","180","270"]),Wb=N(["auto","manual"]),Kb=N(["auto","manual"]),Yb=N(["off","blc","wdr","hlc"]),lc=d({min:l(),max:l(),step:l()}),PM=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Zb.optional(),whiteBalance:Wb.optional(),warmth:l().optional(),exposureMode:Kb.optional(),backlightMode:Yb.optional(),lastFetchedAt:l()}),lW=d({supportsBrightness:A(),brightness:lc.optional(),supportsContrast:A(),contrast:lc.optional(),supportsSaturation:A(),saturation:lc.optional(),supportsSharpness:A(),sharpness:lc.optional(),supportsMirror:A(),supportsFlip:A(),rotateOptions:w(Zb),whiteBalanceModes:w(Wb),supportsWarmth:A(),warmth:lc.optional(),exposureModes:w(Kb),backlightModes:w(Yb)}),cW=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Zb.optional(),whiteBalance:Wb.optional(),warmth:l().optional(),exposureMode:Kb.optional(),backlightMode:Yb.optional()}),uW={name:"image-settings",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"image-settings",tab:"image"}},methods:{getOptions:y(d({deviceId:l()}),lW),setSettings:y(d({deviceId:l(),settings:cW}),O(),{kind:"mutation",auth:"admin"})},status:{schema:PM,kind:"poll"},runtimeState:PM,durability:"restored",volatileStateFields:["lastFetchedAt"]},jM=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),X()).readonly(),createdAt:l(),updatedAt:l(),processState:o()}),fg=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),X()).readonly(),createdAt:l(),updatedAt:l()}),dW=d({addonId:o(),name:o(),description:o(),iconUrl:o().nullable(),color:o(),instanceMode:o(),mode:N(["standalone","account","broker"]),discoveryMode:o(),kind:N(["device-adoption","device-provider"]),brokerKind:o().nullable(),supportsLocationImport:A(),canTest:A(),existingInstances:w(d({id:o(),name:o()})),canAdd:A()}),pW=N(["validated","rejected","inconclusive","unsupported"]),mW=d({success:A(),error:o().optional(),status:pW.optional(),testedBy:o().nullable().optional(),latencyMs:l().nonnegative().optional(),detail:o().optional()}),fW=d({addonId:o(),name:o(),enabled:A().optional(),info:Y(o(),X()).optional(),settings:Y(o(),X()).optional(),skipRestart:A().optional()}),hW=d({id:o(),name:o().optional(),enabled:A().optional(),info:Y(o(),X()).optional()}),gW=d({success:A(),deletedId:o()}),vW={name:"integrations",scope:"system",mode:"singleton",methods:{list:y(O(),w(jM)),get:y(d({id:o()}),jM),getByAddonId:y(d({addonId:o()}),fg.nullable()),create:y(fW,fg,{kind:"mutation",auth:"admin"}),update:y(hW,fg,{kind:"mutation",auth:"admin"}),delete:y(d({id:o()}),gW,{kind:"mutation",auth:"admin"}),getSettings:y(d({id:o()}),Y(o(),X()),{auth:"admin"}),setSettings:y(d({id:o(),settings:Y(o(),X())}),d({success:A()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:y(O(),w(dW),{auth:"admin"}),testConnection:y(d({addonId:o(),settings:Y(o(),X())}),mW,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},yW=d({codecs:w(o()),sampleRate:l(),duplex:N(["half","full"]),maxBacklogMs:l()}),hg=d({talking:A(),lastSessionAt:l().nullable(),ability:yW.nullable()}),bW=N(["opus","s16le","g711ulaw","g711alaw"]),SW={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{startSession:y(d({deviceId:l()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation",auth:"protected"}),handleAnswer:y(d({deviceId:l(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation",auth:"protected"}),stopSession:y(d({deviceId:l(),sessionId:o()}),O(),{kind:"mutation",auth:"protected"}),startTalkSession:y(d({deviceId:l()}),d({sessionId:o()}),{kind:"mutation",auth:"protected"}),pushTalkAudio:y(d({deviceId:l(),audioBase64:o(),codec:bW.optional(),sampleRate:l().int().positive().optional(),channels:l().int().positive().optional(),sequenceNumber:l().int()}),d({accepted:A()}),{kind:"mutation",auth:"protected"}),endTalkSession:y(d({deviceId:l()}),O(),{kind:"mutation",auth:"protected"})},events:{onStatusChanged:{data:d({deviceId:l(),status:hg})}},status:{schema:hg,kind:"command-driven"},runtimeState:hg,durability:"session"},xW=N(["idle","mowing","paused","docked","error"]),kW=N(["info","warning","error"]),DM=d({activity:xW,batteryLevel:l().min(0).max(100).nullable(),progressPercent:l().min(0).max(100).nullable(),currentCode:l().nullable(),currentCodeLabel:o().nullable(),severity:kW,lastChangedAt:l()}),wW={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.LawnMower],methods:{startMowing:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),dock:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:DM,kind:"push"},runtimeState:DM,durability:"session"},MW=N(["lan","wifi","docker","vpn","loopback","other"]),FI=d({name:o(),family:N(["IPv4","IPv6"]),address:o(),cidr:o(),netmask:o(),internal:A(),mac:o(),kind:MW,preferred:A(),plausible:A(),plausibleReason:o()}),CW=d({interfaces:w(FI).readonly(),probedAt:l()}),AW=FI.nullable(),EW=d({label:o(),baseUrl:o(),kind:N(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:N(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:A(),plausibleReason:o(),priority:l()}),RW=N(["server-config","server-env","caller-hint","default"]),IW=d({port:l().int().min(1).max(65535),source:RW}),TW=d({endpoints:w(EW).readonly(),localPort:IW}),zM=d({baseUrl:o().nullable(),resolved:o().nullable()}),LM=d({baseUrls:w(o()).readonly(),resolved:w(o()).readonly()}),gg=d({addresses:w(o()).readonly()}),Fd=d({mode:N(["generated","uploaded","disabled"]),leafFingerprintSha256:o().nullable(),caFingerprintSha256:o().nullable(),validTo:o().nullable(),sans:w(o()),caCertPem:o().nullable(),reissueError:o().nullable(),restartRequired:A()}),_W={name:"local-network",scope:"system",mode:"singleton",methods:{list:y(O(),CW),getPreferred:y(O(),AW),getConnectionEndpoints:y(d({port:l().int().min(1).max(65535).optional(),includeLoopback:A().optional(),ipv4Only:A().optional(),scheme:N(["http","https"]).optional()}),TW),getNotificationEndpoint:y(O(),zM),setNotificationEndpoint:y(d({baseUrl:o().nullable()}),zM,{kind:"mutation"}),getViewerEndpoints:y(O(),LM),setViewerEndpoints:y(d({baseUrls:w(o()).readonly()}),LM,{kind:"mutation"}),getAllowedAddresses:y(O(),gg),setAllowedAddresses:y(gg,d({success:Q(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:y(O(),gg,{kind:"mutation"}),getTlsStatus:y(O(),Fd),regenerateCertificate:y(d({reason:o().optional()}),Fd,{kind:"mutation",auth:"admin"}),uploadCertificate:y(d({certPem:o().min(1),keyPem:o().min(1),caPem:o().optional()}),Fd,{kind:"mutation",auth:"admin"}),downloadCa:y(O(),d({pem:o()})),revertToGeneratedCertificate:y(O(),Fd,{kind:"mutation",auth:"admin"})},mount:{kind:"hub-only"}},NW=N(["locked","unlocked","locking","unlocking","jammed"]),qM=d({state:NW,lastChangedAt:l()}),OW={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Lock],methods:{lock:y(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),unlock:y(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),open:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:qM,kind:"push"},runtimeState:qM,durability:"restored",volatileStateFields:["lastChangedAt"]},PW=N(["off","on","idle","playing","paused","buffering","standby"]),HI=N(["off","all","one"]),jW=d({type:o(),title:o(),artist:o().optional(),album:o().optional(),imageUrl:o().optional()}),BM=d({state:PW,volumeLevel:l().min(0).max(100).nullable(),isMuted:A().nullable(),source:o(),availableSources:w(o()),currentMedia:jW.nullable(),positionMs:l().int().nonnegative().nullable(),durationMs:l().int().nonnegative().nullable(),shuffle:A().nullable(),repeat:HI.nullable(),lastChangedAt:l()}),DW={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.MediaPlayer],methods:{play:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),next:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),previous:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),seek:y(d({deviceId:l().int().nonnegative(),positionMs:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setVolume:y(d({deviceId:l().int().nonnegative(),volumeLevel:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMute:y(d({deviceId:l().int().nonnegative(),muted:A()}),O(),{kind:"mutation",auth:"protected"}),setShuffle:y(d({deviceId:l().int().nonnegative(),shuffle:A()}),O(),{kind:"mutation",auth:"protected"}),setRepeat:y(d({deviceId:l().int().nonnegative(),repeat:HI}),O(),{kind:"mutation",auth:"protected"}),selectSource:y(d({deviceId:l().int().nonnegative(),source:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),playMedia:y(d({deviceId:l().int().nonnegative(),mediaId:o().min(1),mediaType:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:BM,kind:"push"},runtimeState:BM,durability:"session"},zW=d({id:o(),label:o(),scope:N(["mesh","public"]),url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),LW=d({id:o(),hostname:o(),magicDns:o(),addresses:w(o()).readonly(),os:o().optional(),online:A(),lastSeenMs:l(),isSelf:A(),connection:N(["direct","relay","idle"]),relay:o().nullable(),lastHandshakeMs:l(),rxBytes:l(),txBytes:l(),tags:w(o()).readonly(),exitNodeOption:A(),advertisedRoutes:w(o()).readonly(),userLogin:o().nullable(),keyExpiry:l().nullable()}),qW=d({joined:A(),meshIp:o(),magicDnsHostname:o(),peerCount:l(),endpoints:w(zW).readonly(),error:o().optional(),tenantName:o(),magicDnsSuffix:o(),userLogin:o().nullable(),controlPlaneUrl:o(),keyExpiry:l().nullable(),daemonSocket:o().optional(),daemonCliPath:o().optional()}),BW={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:y(O(),qW),join:y(d({authKey:o().min(8),hostname:o().optional()}),d({joined:Q(!0)}),{kind:"mutation"}),startLogin:y(d({hostname:o().optional()}),d({loginUrl:o()}),{kind:"mutation"}),leave:y(O(),d({left:Q(!0)}),{kind:"mutation"}),logout:y(O(),d({loggedOut:Q(!0)}),{kind:"mutation"}),listPeers:y(O(),d({peers:w(LW).readonly()})),testConnection:y(d({authKey:o().optional()}),d({ok:A(),tenant:o().optional(),daemonVersion:o().optional(),error:o().optional()}),{kind:"mutation"})}},UM=d({detected:A(),lastDetectedAt:l().nullable(),autoClearAfterMs:l().nullable()}),UW=d({deviceId:l(),detected:A(),timestamp:l(),source:Hb,regions:w(Fp).readonly().optional()}),FW={name:"motion",scope:"device",mode:"singleton",deviceNative:!0,deviceTypes:[H.Camera,H.Sensor],methods:{isDetected:y(d({deviceId:l()}),A())},events:{onMotionChanged:{data:UW}},status:{schema:UM,kind:"push"},runtimeState:UM,durability:"session"},$I=d({enabled:A(),lastChangedAt:l()}),HW=$I.extend({lastFetchedAt:l()}),$W={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light,H.Siren,H.Switch],methods:{setMotionTrigger:y(d({deviceId:l().int().nonnegative(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:d({deviceId:l(),enabled:A(),lastChangedAt:l()})}},status:{schema:$I,kind:"command-driven"},runtimeState:HW,durability:"session"},QI=d({id:l(),enabled:A(),shape:iI}),FM=d({enabled:A(),sensitivity:l(),regions:w(QI),lastFetchedAt:l()}),QW=d({maxRegions:l(),supportedShapes:w(rI),grid:HF,sensitivity:d({min:l(),max:l(),step:l()})}),VW=d({enabled:A().optional(),sensitivity:l().optional(),regions:w(QI).optional()}),GW={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:y(d({deviceId:l()}),QW),setZone:y(d({deviceId:l(),patch:VW}),O(),{kind:"mutation",auth:"admin"})},status:{schema:FM,kind:"poll"},runtimeState:FM,durability:"restored",volatileStateFields:["lastFetchedAt"]},Vp=N(["person","vehicle","animal","face","package","other"]),VI=d({class:Vp,timestamp:l(),confidence:l().min(0).max(1).optional()}),GI=d({lastByClass:XL(Vp,VI.nullable()),supportedClasses:w(Vp).readonly(),enabled:A()}),ZW=N(["boxed","while-streaming","flag-only"]),WW=d({supportedClasses:w(Vp).readonly(),geometry:ZW}),KW=d({enabled:A().optional()}),YW=GI.extend({lastFetchedAt:l()}),XW={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getOptions:y(d({deviceId:l()}),WW),setSettings:y(d({deviceId:l(),settings:KW}),O(),{kind:"mutation",auth:"admin"}),setEnabled:y(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:d({deviceId:l(),detection:VI})}},status:{schema:GI,kind:"push"},runtimeState:YW,durability:"restored",volatileStateFields:["lastFetchedAt"]},JW=d({pan:l().min(-1).max(1).optional(),tilt:l().min(-1).max(1).optional(),speed:l().min(0).max(1).optional()}),eK=N(["goHome","locate","spotClean","findPet","personFollow","stop","startClean","pauseClean","dockWash","autoEmpty","flashOn","flashOff"]),tK=N(["action","sound"]),nK=d({id:o(),kind:tK,label:o(),icon:o(),soundId:l().int().optional(),enabled:A()}),aK=d({x:l(),y:l()}),iK=d({move:A(),stop:A(),goToPoint:A(),runAction:A(),playSound:A(),light:A(),lightMode:A()}),ZI=N(["auto","manual"]),rK=N(["idle","cleaning","spot","following","goto","returning","paused","unknown"]),Wv=d({mode:rK,following:A(),flash:A(),lightMode:ZI,lightLevel:l().min(40).max(100),lastChangedAt:l()}),oK=Wv.extend({lastFetchedAt:l()}),sK={name:"navigation",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/navigation-panel",tab:"navigation",topTab:!0,label:"Navigation",order:0}},methods:{move:y(JW.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:y(d({deviceId:l()}),O(),{kind:"mutation"}),goToPoint:y(aK.extend({deviceId:l()}),O(),{kind:"mutation"}),listActions:y(d({deviceId:l()}),w(nK)),runAction:y(d({deviceId:l(),actionId:eK}),O(),{kind:"mutation"}),playSound:y(d({deviceId:l(),soundId:l().int()}),O(),{kind:"mutation"}),setLightOn:y(d({deviceId:l(),on:A()}),O(),{kind:"mutation"}),setLightMode:y(d({deviceId:l(),mode:ZI,level:l().min(40).max(100).optional()}),O(),{kind:"mutation"}),setLightLevel:y(d({deviceId:l(),level:l().min(40).max(100)}),O(),{kind:"mutation"}),getFeatures:y(d({deviceId:l()}),iK)},events:{onStatusChanged:{data:d({deviceId:l(),status:Wv})}},status:{schema:Wv,kind:"push"},runtimeState:oK,durability:"session"},lK=["wifi","ethernet","cellular","unknown"],vg=d({type:N(lK),signalPercent:l().min(0).max(100).nullable(),rssiDbm:l().optional(),ssid:o().optional(),lastUpdated:l()}),cK={type:"unknown",signalPercent:null,lastUpdated:0},uK={name:"network-link",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Button,H.Switch,H.Light,H.Lock,H.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:vg})}},status:{schema:vg,kind:"push",empty:cK},runtimeState:vg,durability:"restored",volatileStateFields:["lastUpdated"]},dK=d({nominalBitrateKbps:l(),observedBitrateKbps:l(),peakBitrateKbps:l(),packetLossPercent:l(),lastUpdated:l()}),pK=d({rttMs:l(),jitterMs:l(),estimatedBandwidthKbps:l(),packetLossPercent:l().min(0).max(100),lastUpdated:l()}),HM=d({deviceId:l(),streams:Y(o(),dK),client:pK.optional()}),mK={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:y(d({deviceId:l()}),HM.nullable()),getAllStats:y(O(),w(HM).readonly()),reportClientStats:y(d({deviceId:l(),rttMs:l().min(0).max(6e4),jitterMs:l().min(0).max(1e4),estimatedBandwidthKbps:l().min(0).max(1e6),packetLossPercent:l().min(0).max(100)}),O(),{kind:"mutation"})},mount:{kind:"server-provided"}},fK=d({addonId:o(),capabilities:w(o()).readonly(),status:o()}),hK=d({pid:l(),name:o(),state:o(),cpuPercent:l(),memoryRss:l(),uptimeSeconds:l(),services:w(fK).readonly(),groupId:o().optional()}),gK=d({id:o(),status:o(),cpuPercent:l(),memoryRss:l()}),vK=d({category:o(),total:l(),healthy:l(),addons:w(gK).readonly()}),yK=d({name:o(),version:o()}),bK=d({id:o(),name:o(),hostname:o(),platform:o(),arch:o(),cpuModel:o().nullable(),cpuCores:l(),memoryMB:l(),engines:w(o()).readonly(),isHub:A(),isOnline:A(),cpuPercent:l(),memoryPercent:l(),uptime:l(),lastSeen:o(),localIps:w(o()).readonly(),addons:w(d({id:o(),capabilities:w(o()).readonly(),status:o()})).readonly(),processes:w(hK).readonly(),categories:w(vK).readonly(),rootPackage:yK.nullable()}),SK=d({callerAddonId:o(),providerAddonId:o(),capName:o(),callsPerMin:l(),lastCallAtMs:l()}),xK=d({nodeId:o(),name:o(),version:o(),status:o(),synced:A()}),kK=d({hubVersion:o(),nodes:w(xK)}),yg=d({nodeId:o(),addonId:o()}),wK=d({id:o(),status:o(),version:o().optional(),packageName:o().optional()}),cc=d({success:A()}),MK=d({success:A(),reason:o().optional()}),CK=d({restarted:w(o()).readonly(),failed:w(o()).readonly()}),AK=d({nodeId:o(),name:o()}),EK={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:y(O(),w(bK).readonly(),{auth:"admin"}),deployAddon:y(yg,cc,{kind:"mutation",auth:"admin"}),undeployAddon:y(yg,cc,{kind:"mutation",auth:"admin"}),restartAddon:y(yg,cc,{kind:"mutation",auth:"admin"}),restartProcess:y(d({nodeId:o(),processName:o()}),MK,{kind:"mutation",auth:"admin"}),restartNode:y(d({nodeId:o()}),CK,{kind:"mutation",auth:"admin"}),shutdownNode:y(d({nodeId:o()}),cc,{kind:"mutation",auth:"admin"}),renameNode:y(d({nodeId:o(),name:o().min(1).max(64)}),AK,{kind:"mutation",auth:"admin"}),clusterAddonStatus:y(O(),Y(o(),kK),{auth:"admin"}),getCapUsageGraph:y(d({windowSeconds:l().int().positive().max(300).default(60)}),w(SK).readonly(),{auth:"admin"}),getNodeAddons:y(d({nodeId:o()}),w(wK).readonly(),{auth:"admin"}),setProcessLogLevel:y(d({nodeId:o(),level:o()}),cc,{kind:"mutation",auth:"admin"}),executeQuery:y(d({nodeId:o(),addonId:o(),queryName:o(),params:Y(o(),X()).optional()}),X(),{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},RK=N(["min","low","normal","high"]),IK=d({id:o().min(1),title:o().min(1),uri:kL().optional(),destructive:A().optional()}),TK=d({image:A(),priority:A(),data:A(),actions:A(),recipients:A()}),$M=d({lastSentAt:l(),lastError:o().nullable(),queueDepth:l().int().nonnegative(),supports:TK}),_K=d({deviceId:l().int().nonnegative(),title:o().optional(),body:o().min(1),image:o().optional(),priority:RK.optional(),channel:o().optional(),recipients:w(o()).optional(),actions:w(IK).optional(),data:Y(o(),X()).optional()}),NK=d({notificationId:o(),acceptedAt:l()}),OK={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Notifier],methods:{send:y(_K,NK,{kind:"mutation",auth:"admin"}),cancel:y(d({deviceId:l().int().nonnegative(),notificationId:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},events:{onSent:{data:d({deviceId:l(),notificationId:o(),success:A(),error:o().nullable(),acceptedAt:l()})}},status:{schema:$M,kind:"command-driven"},runtimeState:$M,durability:"session"},QM=d({value:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional(),lastFetchedAt:l()}),PK={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:QM,kind:"push"},runtimeState:QM,durability:"restored",volatileStateFields:["lastFetchedAt"]},WI=N(["text","timestamp","watermark"]),Kv=N(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),jK=d({id:o(),kind:WI,enabled:A(),text:o().optional(),position:Kv.optional(),availablePositions:w(Kv).readonly(),readOnly:A().optional()}),VM=d({overlays:w(jK).readonly()}),DK=d({enabled:A().optional(),text:o().optional(),position:Kv.optional()}).partial(),zK={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{setOverlay:y(d({deviceId:l(),overlayId:o(),patch:DK}),O(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:d({deviceId:l(),status:VM})}},status:{schema:VM,kind:"command-driven"},settings:{bindings:[{kind:"array",statusPath:"overlays",idField:"id",method:"setOverlay",idArg:"overlayId",patchArg:"patch",sectionId:"osd",sectionTitle:"Video overlays",itemFields:{enabled:{label:e=>`${String(e.id)} enabled`,kind:"boolean"},text:{label:e=>`${String(e.id)} text`,kind:"text",when:e=>e.kind!=="timestamp"&&!e.readOnly},position:{label:e=>`${String(e.id)} position`,kind:"select",options:e=>e.availablePositions??[],when:e=>Array.isArray(e.availablePositions)&&e.availablePositions.length>0}}}]}},LK=kt("kind",[d({kind:Q("static"),text:o().max(64)}),d({kind:Q("clock"),pattern:o().min(1).max(32).default("HH:mm"),timezone:o().min(1).max(64).optional()}),d({kind:Q("device-state"),deviceId:l().int().optional(),capName:o().min(1).max(64),valuePath:o().min(1).max(64)}),d({kind:Q("latest-recognition"),recognition:N(["person","plate"])})]),Yv=d({enabled:A().default(!0),source:LK,template:o().max(96).default("${value}"),maxCharacters:l().int().min(4).max(64).optional(),maxDecimals:l().int().min(0).max(4).default(1),unitLabel:o().max(8).optional(),valueMap:Y(o(),o()).optional(),schedule:xm.optional(),conditions:Pb.optional(),fallbackText:o().max(64).default("")}),GM=d({slotId:o(),kind:WI,readOnly:A(),cameraEnabled:A(),cameraText:o().optional(),binding:Yv.nullable()}),qK=N(["written","unchanged","gated","unreadable","disabled","unbound","failed"]),bg=d({slotId:o(),outcome:qK,text:o(),reason:o().optional()}),BK=N(["number","boolean","string","enum"]),UK=d({deviceId:l().int(),deviceName:o(),capName:o(),valuePath:o(),label:o(),valueType:BK,enumValues:w(o()).readonly().optional()}),FK={name:"osd-manager",scope:"system",mode:"singleton",methods:{getDeviceOsd:y(d({deviceId:l().int()}),d({supported:A(),slots:w(GM)}),{auth:"admin"}),getSourceCatalog:y(d({deviceId:l().int()}),d({sources:w(UK)}),{auth:"admin"}),getConditionSupport:y(d({}),d({supported:w(o()),catalog:w(uI)}),{auth:"admin"}),setSlotBinding:y(d({deviceId:l().int(),slotId:o().min(1),binding:Yv}),d({slot:GM,render:bg}),{kind:"mutation",auth:"admin"}),clearSlotBinding:y(d({deviceId:l().int(),slotId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),copyDeviceConfiguration:y(d({sourceDeviceId:l().int(),targetDeviceId:l().int()}),d({copied:l().int().nonnegative(),skipped:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),previewSlot:y(d({deviceId:l().int(),slotId:o().min(1),binding:Yv.optional()}),bg,{kind:"mutation",auth:"admin"}),renderDevice:y(d({deviceId:l().int()}),d({results:w(bg)}),{kind:"mutation",auth:"admin"})}},KI=4,Xb=200,HK=N(["normal","offline","on_batteries"]),Sg=l().int().min(4).max(200),ZM=d({foodLevel:l().nullable(),food1:l().nullable(),food2:l().nullable(),lowFood:A(),batteryPower:l().min(0).max(100).nullable(),desiccantLeftDays:l().nullable(),feeding:A(),status:HK.nullable(),error:o().nullable(),errorCode:l().nullable(),isDualHopper:A(),childLock:A(),indicatorLight:A(),feedSound:A(),volume:l(),lastFetchedAt:l()}),$K={name:"pet-feeder",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.PetFeeder],methods:{feed:y(d({deviceId:l().int().nonnegative(),grams:Sg.optional(),hopper1:Sg.optional(),hopper2:Sg.optional()}),O(),{kind:"mutation",auth:"protected"}),cancelFeed:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),resetDesiccant:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),markFoodReplenished:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),callPet:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),playSound:y(d({deviceId:l().int().nonnegative(),soundId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setChildLock:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setIndicatorLight:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setFeedSound:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setVolume:y(d({deviceId:l().int().nonnegative(),level:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:ZM,kind:"poll"},runtimeState:ZM,durability:"session"},WM=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),QK=d({id:o(),text:o(),score:l(),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),xg=d({plateId:o(),deviceId:l().int(),trackId:o(),timestamp:l().int(),text:o(),score:l(),corrected:A(),recognizedVehicleId:o().optional(),vehicleName:o().optional(),assigned:A(),plateBbox:Xi.optional(),keyFrameMediaId:l().int().optional(),base64:o().optional(),cropUrl:o().optional()}),VK=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),GK=d({plateIds:w(o()).readonly(),representativePlateId:o(),representativeText:o(),size:l().int(),cohesion:l()}),ZK={name:"plate-gallery",scope:"system",mode:"singleton",methods:{listPlates:y(d({deviceId:l().int().optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}).optional(),w(xg).readonly()),getPlateByTrack:y(d({deviceId:l().int(),trackId:o()}),xg.nullable()),getPlateMedia:y(d({plateId:o()}),w(VK).readonly()),searchPlates:y(d({text:o().min(1),maxDistance:l().int().min(0).optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}),w(xg).readonly()),suggestPlateClusters:y(d({maxDistance:l().int().min(0).optional(),minClusterSize:l().int().min(2).optional(),limit:l().int().positive().optional()}).optional(),w(GK).readonly()),correctPlateText:y(d({plateId:o(),text:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deletePlate:y(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicles:y(d({includeCrops:A().optional()}).optional(),w(WM).readonly()),createVehicle:y(d({name:o().min(1)}),WM,{kind:"mutation",auth:"admin"}),renameVehicle:y(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteVehicle:y(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicleSamples:y(d({vehicleId:o()}),w(QK).readonly()),removeVehicleSample:y(d({vehicleId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlate:y(d({plateId:o(),vehicleId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignPlate:y(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlates:y(d({plateIds:w(o()).min(1),vehicleId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignPlates:y(d({plateIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"})}},YI=N(vm),WK=N(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),KK=d({preferred:w(o()).readonly(),rationale:o()}),Xv=N(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),YK=d({encoder:Xv,codec:N(["H264","H265"]),family:N(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:A(),reason:o().optional()});d({encoders:w(YK).readonly(),defaultH264:Xv,defaultH265:Xv,probedAt:l()});d({methods:w(o()).readonly(),probedAt:l()});var XK=N(["darwin","linux","win32"]),JK=N(["arm64","x64"]),eY=d({type:N(["nvidia","amd","intel","apple"]),name:o(),memoryMB:l().optional()}),tY=d({type:N(["apple-ane","intel-npu"])}),nY=d({type:Q("coral-edgetpu"),bus:o().optional()}),XI=d({platform:XK,arch:JK,cpuModel:o(),cpuCores:l(),totalRAM_MB:l(),availableRAM_MB:l(),gpu:eY.nullable(),npu:tY.nullable(),coral:nY.nullable().optional()}),KM=d({runtime:N(["node","python"]),backend:o(),format:N(["onnx","coreml","openvino","tflite"]),score:l(),reason:o(),available:A()}),aY=d({key:o(),backend:o(),device:o(),format:YI,runtime:Q("python"),score:l(),available:A()}),iY=d({hardware:XI,scores:w(KM).readonly(),bestScore:KM,pythonPath:o().nullable(),devices:w(aY).readonly()}),rY=d({modelId:o(),name:o(),minRAM_MB:l(),accuracyScore:l(),formats:w(o()).readonly()}),oY=d({modelId:o(),runtime:N(["node","python"]),backend:o(),format:YI,reason:o()}),sY={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:y(O(),iY),getHardware:y(O(),XI),resolveInferenceConfig:y(d({requirements:w(rY).readonly()}),oY),resolveHwAccel:y(d({prefer:WK}),KK)}},YM=d({watts:l().optional(),kwhTotal:l().optional(),volts:l().optional(),amps:l().optional(),va:l().optional(),powerFactor:l().min(0).max(1).optional(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),lY={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:YM,kind:"push"},runtimeState:YM,durability:"restored",volatileStateFields:["lastFetchedAt"]},cY=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),accuracyMeters:l().nonnegative()}),XM=d({state:o(),location:o().nullable(),gps:cY.nullable(),batteryPercent:l().min(0).max(100).nullable(),lastChangedAt:l()}),uY={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Presence],methods:{},status:{schema:XM,kind:"push"},runtimeState:XM,durability:"restored",volatileStateFields:["lastChangedAt"]},JM=d({hpa:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),dY={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:JM,kind:"push"},runtimeState:JM,durability:"restored",volatileStateFields:["lastFetchedAt"]},pY=kt("kind",[tl,Sm]),JI=d({id:l(),enabled:A(),shape:pY}),e2=d({enabled:A(),regions:w(JI).nullable(),audioEnabled:A().nullable(),lastFetchedAt:l()}),mY=d({maxRegions:l(),supportedShapes:w(rI),polygonVertices:FF.optional(),supportsAudioMute:A()}),fY=d({enabled:A().optional(),regions:w(JI).optional()}),hY={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:y(d({deviceId:l()}),mY),setMask:y(d({deviceId:l(),patch:fY}),O(),{kind:"mutation",auth:"admin"}),setAudioEnabled:y(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:e2,kind:"poll"},runtimeState:e2,durability:"restored",volatileStateFields:["lastFetchedAt"]},gY=d({id:o(),name:o()}),eT=d({pan:l(),tilt:l(),zoom:l()}),t2=d({pan:l().optional(),tilt:l().optional(),zoom:l().optional(),speed:l().optional()}),vY=eT.extend({autofocus:A()}),yY=d({hasPan:A(),hasTilt:A(),hasZoom:A(),supportsPresets:A(),maxPresets:l().optional(),hasAutofocus:A()}),bY={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:y(t2.extend({deviceId:l()}),O(),{kind:"mutation"}),continuousMove:y(t2.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:y(d({deviceId:l()}),O(),{kind:"mutation"}),getPresets:y(d({deviceId:l()}),w(gY)),goToPreset:y(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation"}),savePreset:y(d({deviceId:l(),presetId:o(),name:o()}),O(),{kind:"mutation",auth:"admin"}),deletePreset:y(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation",auth:"admin"}),getOptions:y(d({deviceId:l()}),yY),goHome:y(d({deviceId:l()}),O(),{kind:"mutation"}),getPosition:y(d({deviceId:l()}),eT),setAutofocus:y(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"})},status:{schema:vY,kind:"command-driven"}},SY=o().describe("Vendor target string (people/vehicle/pet); empty = camera default"),Jv=d({targetType:SY,stopDelaySeconds:l().int().min(0).max(300),disappearDelaySeconds:l().int().min(0).max(300)}),xY=d({value:o(),label:o()}),fp=d({enabled:A(),lastChangedAt:l(),currentSettings:Jv.nullable(),supportedTargetTypes:w(xY)}),kY=fp.extend({lastFetchedAt:l()}),wY={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:y(d({deviceId:l()}),fp),setEnabled:y(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"}),getSettings:y(d({deviceId:l()}),Jv.nullable()),setSettings:y(d({deviceId:l(),settings:Jv.partial()}),O(),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:fp})}},status:{schema:fp,kind:"command-driven"},runtimeState:kY,durability:"session"},MY={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Switch],methods:{reboot:y(d({deviceId:l().int().nonnegative()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"})}},n2=d({deviceId:l(),enabled:A(),activeMode:vb,nodeId:o(),storageBytes:l()}),tT=d({profile:o(),startMs:l(),endMs:l()}),CY=d({deviceId:l(),ranges:w(tT),profilesWithFootage:w(o())}),AY=d({deviceId:l(),days:w(l())}),EY=d({deviceId:l(),read:N(["read","unreadable"]),ranges:w(tT).readonly(),profilesWithFootage:w(o()).readonly()}),RY=d({deviceId:l(),read:N(["read","unreadable"]),days:w(l()).readonly()}),IY=d({deviceId:l(),localMasterPath:o().nullable(),playbackUrl:o().nullable(),playbackEndpoints:w(o())}),TY=d({deviceId:l(),usedBytes:l(),oldestMs:l().nullable().optional(),segments:l().optional(),residentBytes:l().optional(),residentOldestMs:l().nullable().optional()}),_Y=d({locationId:o().nullable(),locationIds:w(o()).optional(),root:o().optional(),usedBytes:l(),availableBytes:l().nullable(),totalBytes:l().nullable()}),NY=d({nodeId:o(),totalUsedBytes:l(),devices:w(TY),devicesRead:N(["archive","unavailable"]).optional(),locations:w(_Y).optional()}),OY=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o(),bytes:l(),files:l().int()}),PY=N(["unassigned","target-not-writable","below-threshold","no-headroom"]),jY=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o().nullable(),bytes:l(),reason:PY}),a2=d({moves:w(OY),skipped:w(jY),bytesToMove:l(),jobIds:w(o())}),i2=d({throttleMbps:l().min(1).max(1e3).optional(),minMoveGb:l().min(0).optional()}),DY=d({deviceId:l().int(),profile:o(),locationId:o()}),zY=d({deviceId:l().int(),locationId:o()}),LY=d({assignments:w(DY),pins:w(zY),defaultLocations:Y(o(),o())}),qY=d({deviceId:l().int(),locationId:o().nullable()}),BY=kt("kind",[d({kind:Q("segment"),startMs:l(),durMs:l(),bytes:l()}),d({kind:Q("gap"),nearestEdgeMs:l().nullable(),prevEndMs:l().nullable().optional()})]),UY=d({data:$t(Uint8Array)}),FY=d({data:$t(Uint8Array),gopStartMs:l(),gopDurMs:l()}),HY=kt("kind",[d({kind:Q("ok"),data:$t(Uint8Array),gopStartMs:l(),gopDurMs:l(),reachesRequestedEnd:A()}),d({kind:Q("spans-multiple-segments"),segmentEndMs:l()})]),$Y={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:n2,kind:"command-driven"},methods:{getAvailability:y(d({deviceId:l(),fromMs:l(),toMs:l(),profile:o().optional()}),CY,{kind:"query",auth:"protected"}),getAvailabilityBatch:y(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l()}),w(EY).readonly(),{kind:"query",auth:"protected"}),getDaysWithRecordings:y(d({deviceId:l(),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),AY,{kind:"query",auth:"protected"}),getDaysWithRecordingsBatch:y(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),w(RY).readonly(),{kind:"query",auth:"protected"}),getPlaybackManifest:y(d({deviceId:l(),fromMs:l(),toMs:l()}),IY,{kind:"query",auth:"protected"}),getStorageUsage:y(d({}),NY,{kind:"query",auth:"admin"}),getDeviceConfig:y(d({deviceId:l()}),Zh,{kind:"query",auth:"admin"}),locateSegment:y(d({deviceId:l(),profile:o(),epochMs:l()}),BY,{kind:"query",auth:"admin"}),readSegmentBytes:y(d({deviceId:l(),profile:o(),startMs:l()}),UY,{kind:"query",auth:"admin"}),readGopBytes:y(d({deviceId:l(),profile:o(),startMs:l(),epochMs:l()}),FY,{kind:"query",auth:"admin"}),readWindowBytes:y(d({deviceId:l(),profile:o(),startMs:l(),fromMs:l(),toMs:l()}),HY,{kind:"query",auth:"admin"}),setDeviceConfig:y(d({deviceId:l(),config:Zh}),Zh,{kind:"mutation",auth:"admin"}),rescanStorage:y(d({deviceId:l()}),n2,{kind:"mutation",auth:"admin"}),pruneFootage:y(d({deviceId:l(),reason:gb.optional()}),d({floorMs:l().nullable(),deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),deleteFootprint:y(d({deviceId:l(),fromMs:l().optional(),toMs:l().optional()}),d({deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),listOpsLog:y(oR,w(rR).readonly(),{kind:"query",auth:"admin"}),renderGif:y(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(2),postRollSec:l().min(0).max(30).default(5),maxWidth:l().int().min(120).max(1280).default(480),fps:l().int().min(1).max(15).default(5)}),d({gifBase64:o(),fromMs:l(),toMs:l()}),{kind:"mutation",auth:"admin"}),renderClip:y(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(3),postRollSec:l().min(0).max(30).default(7),maxWidth:l().int().min(160).max(1920).default(640)}),d({clipBase64:o(),mime:o(),fromMs:l(),toMs:l(),bytes:l().int()}),{kind:"mutation",auth:"admin"}),pauseForStorageMigration:y(jr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:y(jr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:y(jr,d({refreshed:Q(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:y(kq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:y(d({jobId:o()}),Lc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateFootage:y(dR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),listRelocateJobs:y(d({}),w(Lc).readonly(),{kind:"query",auth:"admin"}),getRelocateResidue:y(Dq,zq,{kind:"query",auth:"admin"}),reconcileLedgerAgainstDisk:y(Lq,Fq,{kind:"mutation",auth:"admin"}),cancelRelocateJob:y(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),planStorageRebalance:y(i2,a2,{kind:"query",auth:"admin"}),startStorageRebalance:y(i2,a2,{kind:"mutation",auth:"admin"}),getPlacement:y(d({}),LY,{kind:"query",auth:"admin"}),setDevicePlacement:y(qY,d({ok:Q(!0)}),{kind:"mutation",auth:"admin"})}},QY=l().min(.25).max(32),VY=d({fromSec:l().nonnegative(),toSec:l().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:"dense range must have toSec > fromSec"}),GY=d({everyMs:l().int().positive(),ranges:w(VY).min(1).max(200)}),ZY=d({everyMs:l().int().positive(),outputFps:l().int().min(1).max(60).optional(),dense:GY.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:fb.custom,message:"dense.everyMs must be strictly smaller than the base everyMs",path:["dense","everyMs"]})}),nT=d({speed:QY.optional(),timelapse:ZY.optional(),includeAudio:A(),maxLifeMs:l().int().positive(),deleteAfterDownload:A(),title:o().max(200).optional(),notifyTargetIds:w(o().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:fb.custom,message:"speed and timelapse are mutually exclusive",path:["timelapse"]})}),WY=N(["queued","rendering","ready","failed","expired","deleted"]),uc=d({id:o(),deviceId:l(),profile:o(),fromMs:l(),toMs:l(),options:nT,state:WY,progressPct:l().nullable(),fileBytes:l().nullable(),expiresAt:l(),deleteAfterDownload:A(),downloadedAt:l().nullable(),createdAt:l(),createdBy:o(),error:o().nullable()}),KY=d({url:o(),endpoints:w(o())}),YY=d({base64:o(),contentType:o(),name:o(),bytes:l().int().nonnegative()}),XY={name:"recording-export",scope:"system",mode:"singleton",methods:{createExport:y(d({deviceId:l(),profile:o().optional(),profiles:w(o()).min(1).optional(),fromMs:l(),toMs:l(),options:nT}).superRefine((e,t)=>{(e.profiles!==void 0&&e.profiles.length>0?e.profiles:e.profile!==void 0?[e.profile]:[]).length<1&&t.addIssue({code:fb.custom,message:"pass profiles[] (min 1) or legacy profile",path:["profiles"]})}),uc,{kind:"mutation",auth:"protected"}),listExports:y(d({deviceId:l().optional()}),w(uc),{kind:"query",auth:"protected"}),getExport:y(d({exportId:o()}),uc,{kind:"query",auth:"protected"}),cancelExport:y(d({exportId:o()}),uc,{kind:"mutation",auth:"protected"}),deleteExport:y(d({exportId:o()}),uc,{kind:"mutation",auth:"protected"}),getDownloadUrl:y(d({exportId:o()}),KY,{kind:"query",auth:"protected"}),readExportBytes:y(d({exportId:o()}),YY,{kind:"query",auth:"protected"})}},ey=d({active:A(),reason:o(),lastChangedAt:l()}),JY=ey.extend({lastFetchedAt:l()}),eX={name:"recording-signal",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getStatus:y(d({deviceId:l()}),ey)},status:{schema:ey,kind:"push",empty:{active:!1,reason:"unknown",lastChangedAt:0}},runtimeState:JY,durability:"session"},Ic=o(),aT=N(["skip","judge-anyway"]),tX=N(["matched","diverged","unknown"]),nX=N(["no-reference-for-condition","view-shifted","no-vision-profile","encoder-model-changed","no-snapshot"]),aX=d({embedding:w(l()),modelId:o(),condition:Ic,capturedAt:l(),thumbnailMediaId:l().int().optional(),anchorEmbedding:w(l()).optional()}),iX=d({id:o(),label:o(),references:w(aX),textPrompts:w(o()).optional(),referenceCount:l(),currentlyMatched:A()}),ty=kt("mode",[d({mode:Q("similarity"),threshold:l().min(0).max(1),hysteresisCount:l().int().positive()}),d({mode:Q("llm"),prompt:o(),profileId:o().optional(),hysteresisCount:l().int().positive()})]),rX=.85,oX="skip",sX=8e3,iT=d({enabled:A().default(!1),prompt:o().min(1).max(1e3),profileId:o().optional(),timeoutMs:l().int().min(1e3).max(2e4).default(sX),maxImagePx:l().int().min(64).max(2048).default(448),onTimeout:N(["flip","hold"]).default("hold")}),rT=d({id:o(),label:o(),roi:tl,enabled:A(),triggerMode:N(["periodic","on-motion","both"]),checkIntervalSec:l().optional(),check:ty,states:w(iX),currentStateId:o().nullable(),lastCheckedAt:l().nullable(),lastConfidence:l().nullable(),currentCondition:Ic.nullable(),availability:N(["ok","unavailable"]),unavailableReason:o().nullable(),baselineStateId:o().nullable(),emit:N(["latched","live"]).default("latched"),verdict:tX,latched:A(),armedAt:l(),divergedAt:l().nullable(),restoredAt:l().nullable(),quietSeconds:l().int().min(0).max(3600).default(60),minObservationSpacingSec:l().int().min(0).max(3600).default(120),confirm:iT.optional(),anchorThreshold:l().min(0).max(1).default(rX),autoRestore:A().default(!1),onUncoveredCondition:aT.default(oX),suspendedCondition:Ic.nullable().default(null),unavailable:nX.nullable(),coveredConditions:w(Ic)}),hp=d({monitors:w(rT),lastFetchedAt:l()}),lX=d({deviceId:l(),status:hp.nullable()}),cX={name:"scene-monitor",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{listScenes:y(d({deviceId:l()}),hp),listScenesBatch:y(d({deviceIds:w(l()).min(1).max(200)}),w(lX).readonly()),createScene:y(d({deviceId:l(),label:o(),roi:tl,check:ty,triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional()}),rT,{kind:"mutation",auth:"admin"}),updateScene:y(d({deviceId:l(),monitorId:o(),patch:d({label:o().optional(),roi:tl.optional(),enabled:A().optional(),triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional(),check:ty.optional(),emit:N(["latched","live"]).optional(),quietSeconds:l().int().min(0).max(3600).optional(),minObservationSpacingSec:l().int().min(0).max(3600).optional(),anchorThreshold:l().min(0).max(1).optional(),autoRestore:A().optional(),onUncoveredCondition:aT.optional(),confirm:iT.nullable().optional()})}),O(),{kind:"mutation",auth:"admin"}),deleteScene:y(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),captureReference:y(d({deviceId:l(),monitorId:o(),stateId:o().optional(),label:o().optional(),condition:Ic.optional()}),d({stateId:o(),referenceCount:l()}),{kind:"mutation",auth:"admin"}),deleteReference:y(d({deviceId:l(),monitorId:o(),stateId:o(),index:l()}),O(),{kind:"mutation",auth:"admin"}),recheckNow:y(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),resetScene:y(d({deviceId:l(),monitorId:o(),recapture:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:hp,kind:"push"},runtimeState:hp,durability:"session"},r2=d({isRunning:A(),lastRunAt:l(),lastRunSuccess:A().nullable(),lastError:o().nullable(),lastChangedAt:l()}),uX={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Script],methods:{run:y(d({deviceId:l().int().nonnegative(),variables:Y(o(),X()).optional()}),O(),{kind:"mutation",auth:"admin"}),stop:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:r2,kind:"push"},runtimeState:r2,durability:"session"},o2=d({detected:A(),lastChangedAt:l()}),dX={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:o2,kind:"push"},runtimeState:o2,durability:"restored",volatileStateFields:["lastChangedAt"]},oT=d({camStreamId:o().min(1),kind:hb,url:o().optional(),codec:o().optional(),resolution:dl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:on.optional(),metadata:Y(o(),X()).optional()}),pX=d({descriptors:w(oT),lastFetchedAt:l()}),mX={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getCatalog:y(d({deviceId:l().int().nonnegative()}),w(oT).readonly())},runtimeState:pX,durability:"restored",volatileStateFields:["lastFetchedAt"]},fX=N(["main","sub","ext"]),kg=d({width:l(),height:l(),codec:N(["h264","h265"]),framerate:l(),bitrate:l(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional(),audio:A().optional()}),s2=d({main:kg.optional(),sub:kg.optional(),ext:kg.optional(),lastFetchedAt:l()}),wg=d({resolutions:w(d({width:l(),height:l()})),codecs:w(N(["h264","h265"])),framerates:w(l()),bitrates:w(l()),bitrateRange:nu([l(),l()]).optional(),supportsBitrateMode:A(),supportsEncoderProfile:A(),supportsGop:A(),gop:d({min:l(),max:l(),step:l()}).optional()}),hX=d({main:wg.optional(),sub:wg.optional(),ext:wg.optional()}),gX=d({width:l().optional(),height:l().optional(),codec:N(["h264","h265"]).optional(),framerate:l().optional(),bitrate:l().optional(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional()}),vX={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:y(d({deviceId:l()}),hX),setProfile:y(d({deviceId:l(),profile:fX,patch:gX}),O(),{kind:"mutation",auth:"admin"}),getConfigSchema:y(d({deviceId:l()}),X().nullable())},status:{schema:s2,kind:"poll"},runtimeState:s2,durability:"restored",volatileStateFields:["lastFetchedAt"]},l2=d({on:A(),lastChangedAt:l()}),yX={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Switch,H.Siren,H.Light],methods:{setState:y(d({deviceId:l(),on:A()}),O(),{kind:"mutation",auth:"protected"})},events:{onStateChanged:{data:d({deviceId:l(),on:A(),lastChangedAt:l()})}},status:{schema:l2,kind:"command-driven"},runtimeState:l2,durability:"restored",volatileStateFields:["lastChangedAt"],settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},c2=d({streaming:A(),notifications:A(),objectDetection:A(),remoteAccess:A(),agentCluster:A(),smartHome:A(),recordings:A(),backup:A(),repl:A()}),bX=d({status:Q("ok"),uptime:l()}),SX=d({name:o(),address:o(),family:o(),internal:A()}),xX=N(["operator-set","derived-from-ip"]),kX=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),source:xX,updatedAt:l(),label:o().optional()}),Mg=d({location:kX.nullable(),derivationAttemptedAt:l().nullable(),derivationError:o().nullable()}),wX=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180)}).nullable(),MX=N(["http","ws","mesh","unknown"]),sT=d({http:l(),ws:l(),mesh:l(),unknown:l()}),CX=d({plane:MX,procedure:o(),userAgent:o(),ip:o(),principal:o(),calls:l(),subscriptions:l(),perMin:l()}),AX=d({procedure:o(),calls:l(),planes:sT,subscriptions:l(),perMin:l()}),EX=d({armed:A(),elapsedMs:l(),windowMs:l(),armedUntilMs:l(),httpRequests:l(),batchedRequests:l(),procedureCalls:l(),planes:sT,planesExplainTotal:A(),wsConnections:l(),wsMessages:l(),subscriptions:l(),subscriptionStops:l(),distinctGroups:l(),unattributedCalls:l(),procedures:w(AX).readonly(),groups:w(CX).readonly()}),RX=EX.extend({persisted:A()}),Jb=N(["debug","info","warn","error"]),lT=N(["request-census"]),IX=N(["cluster","node","component"]),TX=N(["default","cluster","node","component"]),_X=d({scope:IX,nodeId:o().nullable(),component:o().nullable(),level:Jb.nullable()}),NX=d({level:Jb,levelSource:TX}),OX=d({layers:w(_X).readonly()}),PX=d({id:lT,armed:A(),armedUntilMs:l(),remainingMs:l(),persisted:A()}),jX=d({id:lT,armMs:l().int().min(0),reportEveryMs:l().int().positive().optional()}),DX=d({channel:o(),armed:A(),armedUntilMs:l(),remainingMs:l(),deviceIds:w(l().int()).readonly().nullable()}),zX=d({channel:o().min(1),armMs:l().int().min(0),deviceIds:w(l().int()).readonly().nullable().optional()}),LX=d({level:Jb.nullable().optional(),diagnostics:w(jX).readonly().optional(),channels:w(zX).readonly().optional(),opsLogRetentionDays:l().int().min(0).max(3650).optional()}),qX=KR.extend({addonId:o()}),BX=HR.extend({addonId:o()}),UX=d({scopeNodeId:o().optional(),scopeComponent:o().optional()}),FX=d({scopeNodeId:o().optional(),scopeComponent:o().optional(),patch:LX}),u2=d({scopeNodeId:o().nullable(),scopeComponent:o().nullable(),effective:NX,explicit:OX,activeWindows:w(PX).readonly(),channels:w(hR).readonly(),activeChannels:w(DX).readonly(),opsLogRetentionDays:l().int().min(0),persisted:A()}),HX={name:"system",scope:"system",mode:"singleton",methods:{info:y(O(),c2),health:y(O(),bX),featureFlags:y(O(),c2),networkAddresses:y(O(),w(SX).readonly()),getRetentionConfig:y(O(),X().nullable(),{auth:"admin"}),setRetentionConfig:y(Y(o(),X()),$E(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:y(O(),O(),{kind:"mutation",auth:"admin"}),getSiteLocation:y(O(),Mg),setSiteLocation:y(wX,Mg,{kind:"mutation",auth:"admin"}),detectSiteLocation:y(O(),Mg,{kind:"mutation",auth:"admin"}),getRequestCensus:y(O(),RX,{auth:"admin"}),getLoadContributions:y(O(),w(qX).readonly(),{auth:"admin"}),getFailureContributions:y(O(),w(BX).readonly(),{auth:"admin"}),getLoggingSettings:y(UX,u2,{auth:"admin"}),setLoggingSettings:y(FX,u2,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},d2=d({tampered:A(),lastChangedAt:l()}),$X={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:d2,kind:"push"},runtimeState:d2,durability:"restored",volatileStateFields:["lastChangedAt"]},p2=d({celsius:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),QX={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor,H.Thermostat],methods:{},status:{schema:p2,kind:"push"},runtimeState:p2,durability:"restored",volatileStateFields:["lastFetchedAt"]},VX=d({title:o(),message:o(),severity:N(["info","warning","critical"]),duration:l().optional(),action:d({label:o(),url:o()}).optional()}),GX={name:"toast",scope:"system",mode:"singleton",methods:{onToast:y(O(),VX,{kind:"subscription"})},mount:{kind:"server-provided"}},m2=d({currentVersion:o().nullable(),availableVersion:o().nullable(),updatable:A(),state:o().nullable(),inProgress:A()}),ZX={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Update],methods:{installUpdate:y(O(),O(),{kind:"mutation",auth:"admin"})},status:{schema:m2,kind:"poll"},runtimeState:m2,durability:"session"},Cg=d({id:o(),username:o(),isAdmin:A().default(!1),allowedProviders:Ye([w(o()),Q("*")]),allowedDevices:Y(o(),Ye([w(o()),Q("*")])),scopes:w(Ra).default([]),totpEnabled:A().default(!1),createdAt:l(),updatedAt:l()}),WX=d({username:o(),password:o().min(6),isAdmin:A().default(!1),allowedProviders:Ye([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),Ye([w(o()),Q("*")])).optional(),scopes:w(Ra).optional()}),KX=d({id:o(),isAdmin:A().optional(),allowedProviders:Ye([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),Ye([w(o()),Q("*")])).optional(),scopes:w(Ra).optional()}),ny=d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:Ye([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),Ye([w(o()),Q("*")])).optional(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()}),YX=d({label:o(),isAdmin:A().default(!1),allowedProviders:Ye([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),Ye([w(o()),Q("*")])).optional()}),XX=d({token:o(),record:ny}),ay=d({id:o(),userId:o(),name:o(),tokenPrefix:o(),scopes:w(Ra),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()}),JX=d({userId:o(),name:o(),scopes:w(Ra),expiresAt:l().optional()}),eJ=d({token:o(),record:ay}),tJ=d({id:o(),userId:o(),username:o(),integrationId:o(),scopes:w(Ra),createdAt:l(),lastUsedAt:l(),revokedAt:l().nullable()}),nJ=d({secret:o(),otpauthUrl:o()}),aJ=d({enabled:A(),confirmedAt:l().nullable()}),iJ={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:y(O(),w(Cg),{auth:"admin"}),createUser:y(WX,Cg,{kind:"mutation",auth:"admin",access:"create"}),updateUser:y(KX,d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:y(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:y(d({id:o(),newPassword:o().min(6)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:y(d({userId:o(),scopes:w(Ra)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:y(d({username:o(),password:o()}),Cg.extend({passwordHash:o()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:y(O(),w(ny),{auth:"admin"}),createApiKey:y(YX,XX,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:y(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:y(d({token:o()}),ny.nullable(),{kind:"mutation",access:"view"}),createScopedToken:y(JX,eJ,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:y(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:y(d({token:o()}),ay.nullable(),{access:"view"}),listScopedTokens:y(d({userId:o()}),w(ay),{auth:"admin"}),setupTotp:y(d({userId:o()}),nJ,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:y(d({userId:o(),code:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:y(d({userId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:y(d({userId:o()}),aJ,{auth:"admin"}),verifyTotp:y(d({userId:o(),code:o()}),d({valid:A()}),{kind:"mutation",access:"view"}),oauthIssueCode:y(d({integrationId:o(),userId:o(),username:o(),scopes:w(Ra),redirectUri:o(),hubUrl:o(),codeChallenge:o().optional(),refreshTtlSec:Ye([l().int().positive(),Q("never")]).optional()}),d({code:o()}),{kind:"mutation",access:"create"}),oauthExchangeCode:y(d({code:o(),redirectUri:o(),codeVerifier:o().optional()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:y(d({refreshToken:o()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:y(d({token:o()}),d({userId:o(),username:o(),scopes:w(Ra)}).nullable(),{access:"view"}),listOauthSessions:y(O(),w(tJ),{auth:"admin"}),revokeOauthSession:y(d({id:o()}),d({success:A()}),{kind:"mutation",auth:"admin",access:"delete"})}},rJ=N(["idle","cleaning","paused","returning","docked","drying","error"]),Hd=d({level:l().min(0).max(100).nullable(),status:N(["ok","low","full"]).nullable()}),f2=d({state:rJ,batteryLevel:l().min(0).max(100).nullable(),fanSpeed:o().nullable(),availableFanSpeeds:w(o()),cleanWater:Hd.nullable(),dirtyWater:Hd.nullable(),detergent:Hd.nullable(),dustBin:Hd.nullable(),progressPercent:l().min(0).max(100).nullable(),errorCode:l().nullable(),errorLabel:o().nullable(),lastChangedAt:l()}),oJ={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Vacuum],methods:{start:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),returnToBase:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),locate:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setFanSpeed:y(d({deviceId:l().int().nonnegative(),speed:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:f2,kind:"push"},runtimeState:f2,durability:"session"},sJ=N(["open","opening","closing","closed","stopped"]),h2=d({state:sJ,position:l().min(0).max(100).nullable(),lastChangedAt:l()}),lJ={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Valve],methods:{open:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:y(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:y(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:h2,kind:"push"},runtimeState:h2,durability:"session"},g2=d({detected:A(),lastChangedAt:l()}),cJ={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:g2,kind:"push"},runtimeState:g2,durability:"restored",volatileStateFields:["lastChangedAt"]},v2=d({currentTemp:l().nullable(),targetTemp:l().nullable(),operationMode:o().nullable(),availableModes:w(o()),away:A().nullable(),minTemp:l().nullable(),maxTemp:l().nullable(),lastChangedAt:l()}),uJ={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.WaterHeater],methods:{setTargetTemp:y(d({deviceId:l().int().nonnegative(),temp:l().finite()}),O(),{kind:"mutation",auth:"protected"}),setOperationMode:y(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setAway:y(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:v2,kind:"push"},runtimeState:v2,durability:"session"},y2=d({condition:o().nullable(),temperature:l().nullable(),temperatureUnit:o().nullable(),humidity:l().min(0).max(100).nullable(),pressure:l().nullable(),pressureUnit:o().nullable(),windSpeed:l().nullable(),windSpeedUnit:o().nullable(),windBearing:l().nullable(),lastFetchedAt:l()}),dJ={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Weather],methods:{},status:{schema:y2,kind:"push"},runtimeState:y2,durability:"session"},iy=d({totalObjects:l().int().nonnegative(),byClass:Y(o(),l().int().nonnegative()),standingObjects:l().int().nonnegative().optional(),transientObjects:l().int().nonnegative().optional()}),pJ=iy.extend({zoneId:o(),zoneName:o(),trackIds:w(o()).readonly()}),mJ=d({id:o(),className:o(),bbox:d({x:l(),y:l(),w:l(),h:l()}),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),firstSeenAt:l().int(),becameStationaryAt:l().int(),lastConfirmedAt:l().int(),label:o().optional(),keyFrameMediaId:l().int().optional()}),ry=d({ts:l().int(),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),zones:w(pJ).readonly(),frame:iy,unzoned:iy,stationaryObjects:w(mJ).readonly().optional()}),fJ=d({deviceId:l(),read:N(["read","unreadable"]),snapshot:ry.nullable()}),hJ=N(["minute","5min","hour"]),Ag=d({from:l().int(),to:l().int(),resolution:hJ}),Eg=d({ts:l().int(),count:l().int().nonnegative()}),gJ={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getCurrentSnapshot:y(d({deviceId:l()}),ry.nullable()),getCurrentSnapshotBatch:y(d({deviceIds:w(l()).min(1).max(200)}),w(fJ).readonly()),getZoneHistory:y(d({deviceId:l(),zoneId:o(),className:o().optional()}).extend(Ag.shape),w(Eg).readonly()),getCameraHistory:y(d({deviceId:l(),className:o().optional()}).extend(Ag.shape),w(Eg).readonly()),getUnzonedHistory:y(d({deviceId:l(),className:o().optional()}).extend(Ag.shape),w(Eg).readonly())},runtimeState:ry,durability:"session"},b2=N(["motion","detection","package"]),vJ={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{listRules:y(d({deviceId:l(),stage:b2}),w(So).readonly()),setRules:y(d({deviceId:l(),stage:b2,rules:w(So).readonly()}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({motion:w(So).readonly(),detection:w(So).readonly(),package:w(So).readonly()}),durability:"restored"};Fe.Siren,Fe.Floodlight,Fe.Spotlight,Fe.PirSensor,Fe.Chime,Fe.Autotrack,Fe.Nightvision,Fe.PrivacyMask;var yJ={[H.Cover]:"cover",[H.Valve]:"valve",[H.Humidifier]:"humidifier",[H.WaterHeater]:"water-heater",[H.Camera]:"dummy",[H.Hub]:"dummy",[H.Switch]:"switch",[H.Siren]:"switch",[H.Light]:"light",[H.Fan]:"fan",[H.Sensor]:"sensor",[H.Thermostat]:"thermostat",[H.Climate]:"climate",[H.Button]:"button",[H.EventEmitter]:"dummy",[H.Update]:"update",[H.Generic]:"dummy",[H.Notifier]:"dummy",[H.Script]:"script",[H.Automation]:"automation",[H.Lock]:"lock",[H.MediaPlayer]:"media-player",[H.AlarmPanel]:"alarm",[H.Control]:"control",[H.Presence]:"sensor",[H.Weather]:"weather",[H.Vacuum]:"vacuum",[H.LawnMower]:"lawn-mower",[H.Container]:"dummy",[H.Image]:"image",[H.PetFeeder]:"pet-feeder"};new Set(Object.values(H));da.BatteryOperated;var bJ="device.state-changed",SJ="capability.binding-changed",xJ="device.registered",kJ="device.unregistered",wJ="device.updated",MJ=class{api;stateMirror=new Map;bindings=new Map;devices=new Map;handleListeners=new Map;globalStateListeners=new Set;capListeners=new Map;deviceListeners=new Map;addedListeners=new Set;removedListeners=new Set;pendingWaits=new Set;stateSource;bridges=[];initialized=!1;initPromise=null;constructor(e){this.api=e,this.stateSource=V8(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const t=(p,f)=>Number.isFinite(e)?new Promise((m,h)=>{const c=setTimeout(()=>h(new Error(`SystemMirror.init: '${f}' timed out after ${e}ms`)),e);p.then(x=>{clearTimeout(c),m(x)},x=>{clearTimeout(c),h(x)})}):p,[n,a,s]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),"deviceManager.getAllBindings"),t(this.api.deviceState.getAllSnapshots.query({}),"deviceState.getAllSnapshots"),t(this.api.deviceManager.listAll.query({}),"deviceManager.listAll")]);for(const p of n)this.bindings.set(p.deviceId,p);for(const[p,f]of Object.entries(a)){const m=Number(p);if(!Number.isFinite(m))continue;const h=new Map;for(const[c,x]of Object.entries(f))h.set(c,x);this.stateMirror.set(m,h)}for(const p of s)this.devices.set(p.id,p);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 e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){const t=this.bindings.get(e);return t?eR(this.api,t,{stateSource:this.stateSource}):null}getDeviceByName(e){for(const t of this.devices.values())if(t.name===e)return this.getDeviceById(t.id);return null}getDeviceByStableId(e){for(const t of this.devices.values())if(t.stableId===e)return this.getDeviceById(t.id);return null}getDevicesByAddon(e){return this.query({addonId:e})}getDevicesByType(e){return this.query({type:e})}getDeviceInfo(e){return this.devices.get(e)??null}getAllDevices(){const e=[];for(const t of this.bindings.keys()){const n=this.getDeviceById(t);n&&e.push(n)}return e}filterByCap(e){return this.query({caps:e})}query(e={}){const t=[];for(const[n,a]of this.bindings){const s=this.devices.get(n);if(e.id!==void 0&&!$d(n,e.id)||e.stableId!==void 0&&(!s||!$d(s.stableId,e.stableId))||e.addonId!==void 0&&(!s||!$d(s.addonId,e.addonId))||e.type!==void 0&&(!s||!$d(s.type,e.type)))continue;if(e.caps!==void 0){const f=Rg(e.caps),m=new Set(a.entries.map(h=>h.capName));if(!f.every(h=>m.has(h)))continue}if(e.anyCap!==void 0){const f=Rg(e.anyCap),m=new Set(a.entries.map(h=>h.capName));if(!f.some(h=>m.has(h)))continue}if(e.name!==void 0&&(!s||!CJ(s.name,e.name))||e.online!==void 0&&(!s||s.online!==e.online))continue;if(e.parentDeviceId!==void 0){if(!s)continue;const f=e.parentDeviceId;if((s.parentDeviceId??null)!==f)continue}if(e.feature!==void 0&&(!s||!Rg(e.feature).every(f=>s.features.includes(f)))||e.isCamera!==void 0&&(!s||s.isCamera!==e.isCamera))continue;const p=this.getDeviceById(n);if(p){if(e.where&&s){if(!e.where(s,p))continue}else if(e.where&&!s)continue;t.push(p)}}return t}whereState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);if(!p||!t(p,a))continue;const f=this.getDeviceById(a);f&&n.push(f)}return n}mapState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);p&&n.push(t(p,a))}return n}findState(e,t){for(const[n,a]of this.stateMirror){const s=a.get(e);if(s&&t(s,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(const n of this.bindings.values())n.entries.some(a=>a.capName===e)&&t++;return t}countByState(e,t){let n=0;for(const[a,s]of this.stateMirror){const p=s.get(e);p&&t(p,a)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,a=3e4){return new Promise((s,p)=>{const m=(()=>{const x=this.stateMirror.get(e)?.get(t);return x&&n(x)?x:null})();if(m){s(m);return}let h=null;const c=this.listenDevice(e,(x,M,C)=>{M===t&&C&&n(C)&&(h&&clearTimeout(h),c(),s(C))});Number.isFinite(a)&&(h=setTimeout(()=>{c(),p(new Error(`waitForState timed out after ${a}ms (deviceId=${e}, capName=${t})`))},a))})}waitForDevice(e,t=3e4){return new Promise((n,a)=>{const s=this.getDeviceById(e);if(s){n(s);return}let p=null;const f=this.onDeviceAdded(m=>{if(m!==e)return;const h=this.getDeviceById(m);h&&(p&&clearTimeout(p),f(),n(h))});Number.isFinite(t)&&(p=setTimeout(()=>{f(),a(new Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(const n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,a={}){const s=this.filterByCap(e),p=Math.max(1,a.parallelism??s.length),f=[];for(let m=0;m<s.length;m+=p){const h=s.slice(m,m+p),c=await Promise.allSettled(h.map(async x=>{const M=x[e];if(!M||typeof M[t]!="function")throw new Error(`device '${x.deviceId}' does not expose '${e}.${t}'`);return await M[t](n)}));for(let x=0;x<c.length;x++){const M=h[x],C=c[x];C.status==="fulfilled"?f.push({deviceId:M.deviceId,ok:!0,result:C.value}):f.push({deviceId:M.deviceId,ok:!1,error:C.reason})}}return f}summary(){const e={},t={},n={};let a=0,s=0;for(const p of this.bindings.values())for(const f of p.entries)e[f.capName]=(e[f.capName]??0)+1;for(const p of this.devices.values())t[p.addonId]=(t[p.addonId]??0)+1,n[p.type]=(n[p.type]??0)+1,p.online?a++:s++;return{totalDevices:this.bindings.size,online:a,offline:s,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){const t=a=>{const s=this.devices.get(a)??null,p=this.bindings.get(a)??null,f={},m=this.stateMirror.get(a);if(m)for(const[h,c]of m)f[h]={...c};return{deviceId:a,info:s,binding:p?{...p,entries:p.entries.map(h=>({...h}))}:null,state:f}};if(e!==void 0)return t(e);const n=[];for(const a of this.bindings.keys())n.push(t(a));return n}getRawMirror(){return this.stateMirror}getSystemState(){const e=new Map;for(const[t,n]of this.stateMirror){const a=new Map;for(const[s,p]of n)a.set(s,{...p});e.set(t,a)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;const e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:bJ},{onData:t=>{const n=t.data;!n||typeof n.deviceId!="number"||typeof n.capName!="string"||this.applyStateUpdate(n.deviceId,n.capName,n.slice)}})),this.bridges.push(e.subscribe({category:SJ},{onData:t=>{const n=t.data,a=typeof n?.deviceId=="number"?n.deviceId:n?.source?.type==="device"&&typeof n.source.id=="number"?n.source.id:null;a!==null&&this.refreshBinding(a)}})),this.bridges.push(e.subscribe({category:xJ},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"added")}})),this.bridges.push(e.subscribe({category:kJ},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.applyDeviceRemoval(n.deviceId)}})),this.bridges.push(e.subscribe({category:wJ},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"updated")}}))}applyStateUpdate(e,t,n){let a=this.stateMirror.get(e);a||(a=new Map,this.stateMirror.set(e,a)),n===void 0?a.delete(t):a.set(t,n);const s=`${e}:${t}`,p=this.handleListeners.get(s);if(p)for(const h of p)try{h(n)}catch{}for(const h of this.globalStateListeners)try{h(e,t,n)}catch{}const f=this.capListeners.get(t);if(f)for(const h of f)try{h(e,n)}catch{}const m=this.deviceListeners.get(e);if(m)for(const h of m)try{h(e,t,n)}catch{}}applyDeviceRemoval(e){const t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(const n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{const t=await this.api.deviceManager.getBindings.query({deviceId:e});if(t.entries.length>0){this.bindings.set(e,t);return}if(await this.api.deviceManager.getDevice.query({deviceId:e})===null){this.applyDeviceRemoval(e);return}this.bindings.set(e,t)}catch{}}async refreshDeviceMetadata(e,t){try{const n=await this.api.deviceManager.getDevice.query({deviceId:e});if(!n)return;const a=!this.devices.has(e);if(this.devices.set(e,n),t==="added"&&a){await this.refreshBinding(e);for(const s of this.addedListeners)try{s(e,n)}catch{}}}catch{}}};function $d(e,t){return Array.isArray(t)?t.includes(e):e===t}function Rg(e){return Array.isArray(e)?e:[e]}function CJ(e,t){return typeof t=="string"?e===t:t instanceof RegExp?t.test(e):"exact"in t?e===t.exact:"contains"in t?e.toLowerCase().includes(t.contains.toLowerCase()):!1}var AJ=[NG,PB,DB,BB,HB,GB,QB,iZ,z8,rZ,BF,YB,oZ,XB,o7,p7,uZ,m7,dZ,w7,pZ,mZ,fZ,B7,hZ,yZ,U7,p9,bZ,SZ,kZ,AZ,EZ,RZ,IZ,NZ,g9,PZ,y9,x9,zZ,w9,M9,T9,A9,L9,eU,$8,B9,tU,LZ,BZ,aU,FZ,HZ,QZ,eW,rU,tW,nW,lU,aW,iW,rW,oW,sW,uW,vW,SW,wW,AU,vU,IU,_W,OW,_U,NU,zU,DW,BW,XU,eF,aF,FW,rF,$W,GW,hF,XW,sK,yF,uK,mK,EK,IF,MH,OK,PK,TH,zK,FK,$K,vQ,a$,cV,jQ,ZK,sY,lY,uY,dY,hY,bY,wY,MY,$Y,XY,eX,cX,uX,MV,b9,dX,EV,TV,_V,OV,DV,zV,qV,YV,l9,mX,vX,H7,yX,HX,$X,QX,aG,GX,rG,ZX,iJ,sG,oJ,lJ,CG,cJ,RG,B8,uJ,dJ,TG,gJ,vJ,s$];function S2(e){const t=e;function n(a,s,p,f,m){const h=t[a]?.[s];if(!h)throw new Error(`SystemProxy: api has no '${a}.${s}'`);const c=h;return p==="mutation"?c.mutate(f):p==="subscription"?c.subscribe(f,m):c.query(f)}return{addonPages:{listPages:a=>n("addonPages","listPages","query",a)},addons:{list:a=>n("addons","list","query",a),getLogs:a=>n("addons","getLogs","query",a),listPackages:a=>n("addons","listPackages","query",a),installPackage:a=>n("addons","installPackage","mutation",a),installFromWorkspace:a=>n("addons","installFromWorkspace","mutation",a),isWorkspaceAvailable:a=>n("addons","isWorkspaceAvailable","query",a),listWorkspacePackages:a=>n("addons","listWorkspacePackages","query",a),uninstallPackage:a=>n("addons","uninstallPackage","mutation",a),reloadPackages:a=>n("addons","reloadPackages","mutation",a),searchAvailable:a=>n("addons","searchAvailable","query",a),listUpdates:a=>n("addons","listUpdates","query",a),updatePackage:a=>n("addons","updatePackage","mutation",a),rollbackPackage:a=>n("addons","rollbackPackage","mutation",a),forceRefresh:a=>n("addons","forceRefresh","mutation",a),restartServer:a=>n("addons","restartServer","mutation",a),getLastRestart:a=>n("addons","getLastRestart","query",a),listFrameworkPackages:a=>n("addons","listFrameworkPackages","query",a),listCapabilityProviders:a=>n("addons","listCapabilityProviders","query",a),setCapabilityProviderEnabled:a=>n("addons","setCapabilityProviderEnabled","mutation",a),getVersions:a=>n("addons","getVersions","query",a),restartAddon:a=>n("addons","restartAddon","mutation",a),retryLoad:a=>n("addons","retryLoad","mutation",a),getAutoUpdateSettings:a=>n("addons","getAutoUpdateSettings","query",a),setAutoUpdateSettings:a=>n("addons","setAutoUpdateSettings","mutation",a),getAddonAutoUpdate:a=>n("addons","getAddonAutoUpdate","query",a),setAddonAutoUpdate:a=>n("addons","setAddonAutoUpdate","mutation",a),applyAutoUpdateToAll:a=>n("addons","applyAutoUpdateToAll","mutation",a),custom:a=>n("addons","custom","mutation",a),startJob:a=>n("addons","startJob","mutation",a),getJob:a=>n("addons","getJob","query",a),listJobs:a=>n("addons","listJobs","query",a),cancelJob:a=>n("addons","cancelJob","mutation",a),onAddonLogs:(a,s)=>n("addons","onAddonLogs","subscription",a,s)},addonSettings:{getGlobalSettings:a=>n("addonSettings","getGlobalSettings","query",a),updateGlobalSettings:a=>n("addonSettings","updateGlobalSettings","mutation",a),getIntegrationSettings:a=>n("addonSettings","getIntegrationSettings","query",a)},addonWidgets:{listWidgets:a=>n("addonWidgets","listWidgets","query",a)},alerts:{emit:a=>n("alerts","emit","mutation",a),update:a=>n("alerts","update","mutation",a),list:a=>n("alerts","list","query",a),getUnreadCount:a=>n("alerts","getUnreadCount","query",a),markRead:a=>n("alerts","markRead","mutation",a),markAllRead:a=>n("alerts","markAllRead","mutation",a),dismiss:a=>n("alerts","dismiss","mutation",a)},audioAnalyzer:{analyseChunk:a=>n("audioAnalyzer","analyseChunk","mutation",a),classify:a=>n("audioAnalyzer","classify","query",a),attachDevice:a=>n("audioAnalyzer","attachDevice","mutation",a),isReady:a=>n("audioAnalyzer","isReady","query",a),dispose:a=>n("audioAnalyzer","dispose","mutation",a),reprobeAudioEngine:a=>n("audioAnalyzer","reprobeAudioEngine","mutation",a)},audioCodec:{listSupportedCodecs:a=>n("audioCodec","listSupportedCodecs","query",a),canHandle:a=>n("audioCodec","canHandle","query",a),createDecodeSession:a=>n("audioCodec","createDecodeSession","mutation",a),createEncodeSession:a=>n("audioCodec","createEncodeSession","mutation",a),closeSession:a=>n("audioCodec","closeSession","mutation",a),pushEncodedFrame:a=>n("audioCodec","pushEncodedFrame","mutation",a),pullPcm:a=>n("audioCodec","pullPcm","query",a),pushPcm:a=>n("audioCodec","pushPcm","mutation",a),pullEncoded:a=>n("audioCodec","pullEncoded","query",a),flushEncode:a=>n("audioCodec","flushEncode","mutation",a),listActiveSessions:a=>n("audioCodec","listActiveSessions","query",a)},backup:{listDestinations:a=>n("backup","listDestinations","query",a),trigger:a=>n("backup","trigger","mutation",a),listRuns:a=>n("backup","listRuns","query",a),cancel:a=>n("backup","cancel","mutation",a),list:a=>n("backup","list","query",a),listLocations:a=>n("backup","listLocations","query",a),getEntries:a=>n("backup","getEntries","query",a),restore:a=>n("backup","restore","mutation",a),delete:a=>n("backup","delete","mutation",a),listArchives:a=>n("backup","listArchives","query",a),upsertDestinationPolicy:a=>n("backup","upsertDestinationPolicy","mutation",a),previewSchedule:a=>n("backup","previewSchedule","query",a),listSchedules:a=>n("backup","listSchedules","query",a),upsertSchedule:a=>n("backup","upsertSchedule","mutation",a),deleteSchedule:a=>n("backup","deleteSchedule","mutation",a)},broker:{list:a=>n("broker","list","query",a),get:a=>n("broker","get","query",a),listProviders:a=>n("broker","listProviders","query",a),add:a=>n("broker","add","mutation",a),remove:a=>n("broker","remove","mutation",a),testConnection:a=>n("broker","testConnection","mutation",a),getSettings:a=>n("broker","getSettings","query",a),setSettings:a=>n("broker","setSettings","mutation",a),getBrokerConfig:a=>n("broker","getBrokerConfig","query",a),getSettingsSchema:a=>n("broker","getSettingsSchema","query",a),testSettings:a=>n("broker","testSettings","mutation",a),publish:a=>n("broker","publish","mutation",a),subscribe:a=>n("broker","subscribe","mutation",a),unsubscribe:a=>n("broker","unsubscribe","mutation",a),getState:a=>n("broker","getState","query",a),getStatus:a=>n("broker","getStatus","query",a)},connectionTest:{testSettings:a=>n("connectionTest","testSettings","mutation",a),describeTest:a=>n("connectionTest","describeTest","query",a)},coreBlocks:{list:a=>n("coreBlocks","list","query",a),get:a=>n("coreBlocks","get","query",a),create:a=>n("coreBlocks","create","mutation",a),update:a=>n("coreBlocks","update","mutation",a),delete:a=>n("coreBlocks","delete","mutation",a),setEnabled:a=>n("coreBlocks","setEnabled","mutation",a),restart:a=>n("coreBlocks","restart","mutation",a),compile:a=>n("coreBlocks","compile","mutation",a),getTypeDefs:a=>n("coreBlocks","getTypeDefs","query",a)},decoder:{supportsCodec:a=>n("decoder","supportsCodec","query",a),getInfo:a=>n("decoder","getInfo","query",a),createSession:a=>n("decoder","createSession","query",a),destroySession:a=>n("decoder","destroySession","query",a),pushPacket:a=>n("decoder","pushPacket","query",a),openStream:a=>n("decoder","openStream","query",a),pullFrames:a=>n("decoder","pullFrames","query",a),pullHandles:a=>n("decoder","pullHandles","query",a),getFrame:a=>n("decoder","getFrame","query",a),getShmStats:a=>n("decoder","getShmStats","query",a),updateConfig:a=>n("decoder","updateConfig","query",a),getStats:a=>n("decoder","getStats","query",a),listActiveSessions:a=>n("decoder","listActiveSessions","query",a),reprobeHwaccel:a=>n("decoder","reprobeHwaccel","mutation",a)},deviceAdoption:{listCandidateFilters:a=>n("deviceAdoption","listCandidateFilters","query",a),listCandidates:a=>n("deviceAdoption","listCandidates","query",a),getCandidate:a=>n("deviceAdoption","getCandidate","query",a),refresh:a=>n("deviceAdoption","refresh","mutation",a),adopt:a=>n("deviceAdoption","adopt","mutation",a),release:a=>n("deviceAdoption","release","mutation",a),resync:a=>n("deviceAdoption","resync","mutation",a)},deviceExport:{getStatus:a=>n("deviceExport","getStatus","query",a),listSupportedDeviceKinds:a=>n("deviceExport","listSupportedDeviceKinds","query",a),listExposedDevices:a=>n("deviceExport","listExposedDevices","query",a),exposeDevice:a=>n("deviceExport","exposeDevice","mutation",a),unexposeDevice:a=>n("deviceExport","unexposeDevice","mutation",a)},deviceManager:{allocateDeviceId:a=>n("deviceManager","allocateDeviceId","mutation",a),migrateDevice:a=>n("deviceManager","migrateDevice","mutation",a),registerDevice:a=>n("deviceManager","registerDevice","mutation",a),removeDevice:a=>n("deviceManager","removeDevice","mutation",a),persistConfig:a=>n("deviceManager","persistConfig","mutation",a),getRoleDisplayDefaults:a=>n("deviceManager","getRoleDisplayDefaults","query",a),setRoleDisplayDefaults:a=>n("deviceManager","setRoleDisplayDefaults","mutation",a),listLocations:a=>n("deviceManager","listLocations","query",a),addLocation:a=>n("deviceManager","addLocation","mutation",a),removeLocation:a=>n("deviceManager","removeLocation","mutation",a),renameLocation:a=>n("deviceManager","renameLocation","mutation",a),listPersistedByAddon:a=>n("deviceManager","listPersistedByAddon","query",a),listAll:a=>n("deviceManager","listAll","query",a),getChildren:a=>n("deviceManager","getChildren","query",a),getChildrenBatch:a=>n("deviceManager","getChildrenBatch","query",a),getLinkedDevicesBatch:a=>n("deviceManager","getLinkedDevicesBatch","query",a),removeByIntegration:a=>n("deviceManager","removeByIntegration","mutation",a),getBindingsBatch:a=>n("deviceManager","getBindingsBatch","query",a),getAllBindings:a=>n("deviceManager","getAllBindings","query",a),listWrappersForCap:a=>n("deviceManager","listWrappersForCap","query",a),listBindableCapsForDeviceType:a=>n("deviceManager","listBindableCapsForDeviceType","query",a),discoverDevices:a=>n("deviceManager","discoverDevices","mutation",a),adoptDevice:a=>n("deviceManager","adoptDevice","mutation",a),getCreationSchema:a=>n("deviceManager","getCreationSchema","query",a),createDevice:a=>n("deviceManager","createDevice","mutation",a),testCreationField:a=>n("deviceManager","testCreationField","mutation",a),adoptionListCandidateFilters:a=>n("deviceManager","adoptionListCandidateFilters","query",a),adoptionListCandidates:a=>n("deviceManager","adoptionListCandidates","query",a),adoptionRefresh:a=>n("deviceManager","adoptionRefresh","mutation",a),adoptionAdopt:a=>n("deviceManager","adoptionAdopt","mutation",a),adoptionRelease:a=>n("deviceManager","adoptionRelease","mutation",a),adoptionStartJob:a=>n("deviceManager","adoptionStartJob","mutation",a),adoptionListJobs:a=>n("deviceManager","adoptionListJobs","query",a),adoptionCancelJob:a=>n("deviceManager","adoptionCancelJob","mutation",a),adoptionResync:a=>n("deviceManager","adoptionResync","mutation",a),discoveryProviders:a=>n("deviceManager","discoveryProviders","query",a),discoverAllProviders:a=>n("deviceManager","discoverAllProviders","mutation",a),discoverProvider:a=>n("deviceManager","discoverProvider","mutation",a),providerCreationType:a=>n("deviceManager","providerCreationType","query",a),providerDiscoveryParamsSchema:a=>n("deviceManager","providerDiscoveryParamsSchema","query",a),getDeviceStatusAggregateBatch:a=>n("deviceManager","getDeviceStatusAggregateBatch","query",a)},deviceProvider:{start:a=>n("deviceProvider","start","mutation",a),stop:a=>n("deviceProvider","stop","mutation",a),getStatus:a=>n("deviceProvider","getStatus","query",a),getDevices:a=>n("deviceProvider","getDevices","query",a),supportsDiscovery:a=>n("deviceProvider","supportsDiscovery","query",a),discoverDevices:a=>n("deviceProvider","discoverDevices","mutation",a),getDiscoveryParamsSchema:a=>n("deviceProvider","getDiscoveryParamsSchema","query",a),getManualCreationType:a=>n("deviceProvider","getManualCreationType","query",a),adoptDiscoveredDevice:a=>n("deviceProvider","adoptDiscoveredDevice","mutation",a),supportsManualCreation:a=>n("deviceProvider","supportsManualCreation","query",a),getChildCreationSchema:a=>n("deviceProvider","getChildCreationSchema","query",a),createDevice:a=>n("deviceProvider","createDevice","mutation",a),testCreationField:a=>n("deviceProvider","testCreationField","mutation",a)},deviceState:{getAllSnapshots:a=>n("deviceState","getAllSnapshots","query",a)},faceGallery:{listIdentities:a=>n("faceGallery","listIdentities","query",a),createIdentity:a=>n("faceGallery","createIdentity","mutation",a),renameIdentity:a=>n("faceGallery","renameIdentity","mutation",a),deleteIdentity:a=>n("faceGallery","deleteIdentity","mutation",a),listIdentitySamples:a=>n("faceGallery","listIdentitySamples","query",a),auditIdentitySamples:a=>n("faceGallery","auditIdentitySamples","query",a),removeSample:a=>n("faceGallery","removeSample","mutation",a),getFaceMedia:a=>n("faceGallery","getFaceMedia","query",a),assignFace:a=>n("faceGallery","assignFace","mutation",a),unassignFace:a=>n("faceGallery","unassignFace","mutation",a),deleteFace:a=>n("faceGallery","deleteFace","mutation",a),assignFaces:a=>n("faceGallery","assignFaces","mutation",a),unassignFaces:a=>n("faceGallery","unassignFaces","mutation",a),suggestFaceClusters:a=>n("faceGallery","suggestFaceClusters","query",a)},integrations:{list:a=>n("integrations","list","query",a),get:a=>n("integrations","get","query",a),getByAddonId:a=>n("integrations","getByAddonId","query",a),create:a=>n("integrations","create","mutation",a),update:a=>n("integrations","update","mutation",a),delete:a=>n("integrations","delete","mutation",a),getSettings:a=>n("integrations","getSettings","query",a),setSettings:a=>n("integrations","setSettings","mutation",a),getAvailableTypes:a=>n("integrations","getAvailableTypes","query",a),testConnection:a=>n("integrations","testConnection","mutation",a)},llm:{generate:a=>n("llm","generate","mutation",a),generateVision:a=>n("llm","generateVision","mutation",a),cancel:a=>n("llm","cancel","mutation",a),listProfileKinds:a=>n("llm","listProfileKinds","query",a),listProfiles:a=>n("llm","listProfiles","query",a),upsertProfile:a=>n("llm","upsertProfile","mutation",a),deleteProfile:a=>n("llm","deleteProfile","mutation",a),testProfile:a=>n("llm","testProfile","mutation",a),listModels:a=>n("llm","listModels","query",a),getDefaults:a=>n("llm","getDefaults","query",a),setDefault:a=>n("llm","setDefault","mutation",a),getUsage:a=>n("llm","getUsage","query",a),listModelCatalog:a=>n("llm","listModelCatalog","query",a),listRuntimeNodes:a=>n("llm","listRuntimeNodes","query",a),listNodeModels:a=>n("llm","listNodeModels","query",a),resolveModelRef:a=>n("llm","resolveModelRef","mutation",a),installModel:a=>n("llm","installModel","mutation",a),deleteModel:a=>n("llm","deleteModel","mutation",a),getRuntimeStatus:a=>n("llm","getRuntimeStatus","query",a),startRuntime:a=>n("llm","startRuntime","mutation",a),stopRuntime:a=>n("llm","stopRuntime","mutation",a)},localNetwork:{list:a=>n("localNetwork","list","query",a),getPreferred:a=>n("localNetwork","getPreferred","query",a),getConnectionEndpoints:a=>n("localNetwork","getConnectionEndpoints","query",a),getNotificationEndpoint:a=>n("localNetwork","getNotificationEndpoint","query",a),setNotificationEndpoint:a=>n("localNetwork","setNotificationEndpoint","mutation",a),getViewerEndpoints:a=>n("localNetwork","getViewerEndpoints","query",a),setViewerEndpoints:a=>n("localNetwork","setViewerEndpoints","mutation",a),getAllowedAddresses:a=>n("localNetwork","getAllowedAddresses","query",a),setAllowedAddresses:a=>n("localNetwork","setAllowedAddresses","mutation",a),resetAllowlistToBestMatch:a=>n("localNetwork","resetAllowlistToBestMatch","mutation",a),getTlsStatus:a=>n("localNetwork","getTlsStatus","query",a),regenerateCertificate:a=>n("localNetwork","regenerateCertificate","mutation",a),uploadCertificate:a=>n("localNetwork","uploadCertificate","mutation",a),downloadCa:a=>n("localNetwork","downloadCa","query",a),revertToGeneratedCertificate:a=>n("localNetwork","revertToGeneratedCertificate","mutation",a)},meshNetwork:{getStatus:a=>n("meshNetwork","getStatus","query",a),join:a=>n("meshNetwork","join","mutation",a),startLogin:a=>n("meshNetwork","startLogin","mutation",a),leave:a=>n("meshNetwork","leave","mutation",a),logout:a=>n("meshNetwork","logout","mutation",a),listPeers:a=>n("meshNetwork","listPeers","query",a),testConnection:a=>n("meshNetwork","testConnection","mutation",a)},metricsProvider:{collectSnapshot:a=>n("metricsProvider","collectSnapshot","query",a),getCached:a=>n("metricsProvider","getCached","query",a),getCurrent:a=>n("metricsProvider","getCurrent","query",a),getDiskSpace:a=>n("metricsProvider","getDiskSpace","query",a),getGpuInfo:a=>n("metricsProvider","getGpuInfo","query",a),getCpuTemperature:a=>n("metricsProvider","getCpuTemperature","query",a),getProcessStats:a=>n("metricsProvider","getProcessStats","query",a),listAddonInstances:a=>n("metricsProvider","listAddonInstances","query",a),getAddonStats:a=>n("metricsProvider","getAddonStats","query",a),listNodeProcesses:a=>n("metricsProvider","listNodeProcesses","query",a),getLoadSeries:a=>n("metricsProvider","getLoadSeries","query",a)},mqttBroker:{listBrokers:a=>n("mqttBroker","listBrokers","query",a),getBrokerConfig:a=>n("mqttBroker","getBrokerConfig","query",a),addBroker:a=>n("mqttBroker","addBroker","mutation",a),removeBroker:a=>n("mqttBroker","removeBroker","mutation",a),testConnection:a=>n("mqttBroker","testConnection","mutation",a),startEmbeddedBroker:a=>n("mqttBroker","startEmbeddedBroker","mutation",a),stopEmbeddedBroker:a=>n("mqttBroker","stopEmbeddedBroker","mutation",a),getStatus:a=>n("mqttBroker","getStatus","query",a)},networkAccess:{start:a=>n("networkAccess","start","mutation",a),stop:a=>n("networkAccess","stop","mutation",a),getEndpoint:a=>n("networkAccess","getEndpoint","query",a),getStatus:a=>n("networkAccess","getStatus","query",a),listEndpoints:a=>n("networkAccess","listEndpoints","query",a)},networkQuality:{getAllStats:a=>n("networkQuality","getAllStats","query",a)},nodes:{topology:a=>n("nodes","topology","query",a),deployAddon:a=>n("nodes","deployAddon","mutation",a),undeployAddon:a=>n("nodes","undeployAddon","mutation",a),restartAddon:a=>n("nodes","restartAddon","mutation",a),restartProcess:a=>n("nodes","restartProcess","mutation",a),restartNode:a=>n("nodes","restartNode","mutation",a),shutdownNode:a=>n("nodes","shutdownNode","mutation",a),renameNode:a=>n("nodes","renameNode","mutation",a),clusterAddonStatus:a=>n("nodes","clusterAddonStatus","query",a),getCapUsageGraph:a=>n("nodes","getCapUsageGraph","query",a),getNodeAddons:a=>n("nodes","getNodeAddons","query",a),setProcessLogLevel:a=>n("nodes","setProcessLogLevel","mutation",a),executeQuery:a=>n("nodes","executeQuery","mutation",a)},notificationOutput:{listTargetKinds:a=>n("notificationOutput","listTargetKinds","query",a),listTargets:a=>n("notificationOutput","listTargets","query",a),discoverTargets:a=>n("notificationOutput","discoverTargets","query",a),send:a=>n("notificationOutput","send","mutation",a),testTarget:a=>n("notificationOutput","testTarget","mutation",a),upsertTarget:a=>n("notificationOutput","upsertTarget","mutation",a),deleteTarget:a=>n("notificationOutput","deleteTarget","mutation",a),setTargetEnabled:a=>n("notificationOutput","setTargetEnabled","mutation",a)},osdManager:{getConditionSupport:a=>n("osdManager","getConditionSupport","query",a),copyDeviceConfiguration:a=>n("osdManager","copyDeviceConfiguration","mutation",a)},pipelineExecutor:{getAvailableEngines:a=>n("pipelineExecutor","getAvailableEngines","query",a),getSelectedEngine:a=>n("pipelineExecutor","getSelectedEngine","query",a),getDefaultSteps:a=>n("pipelineExecutor","getDefaultSteps","query",a),getEngineProvisioning:a=>n("pipelineExecutor","getEngineProvisioning","query",a),getVideoPipelineSteps:a=>n("pipelineExecutor","getVideoPipelineSteps","query",a),setVideoPipelineSteps:a=>n("pipelineExecutor","setVideoPipelineSteps","mutation",a),clearDeviceOverrides:a=>n("pipelineExecutor","clearDeviceOverrides","mutation",a),getInferenceDeviceHealth:a=>n("pipelineExecutor","getInferenceDeviceHealth","query",a),rearmInferenceDevice:a=>n("pipelineExecutor","rearmInferenceDevice","mutation",a),getSchema:a=>n("pipelineExecutor","getSchema","query",a),getGlobalSteps:a=>n("pipelineExecutor","getGlobalSteps","query",a),getGlobalPipelineConfig:a=>n("pipelineExecutor","getGlobalPipelineConfig","query",a),getOrchestratorConfigSchema:a=>n("pipelineExecutor","getOrchestratorConfigSchema","query",a),validatePipeline:a=>n("pipelineExecutor","validatePipeline","query",a),listTemplates:a=>n("pipelineExecutor","listTemplates","query",a),saveTemplate:a=>n("pipelineExecutor","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineExecutor","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineExecutor","deleteTemplate","mutation",a),getCapabilities:a=>n("pipelineExecutor","getCapabilities","query",a),getAddonModels:a=>n("pipelineExecutor","getAddonModels","query",a),downloadModel:a=>n("pipelineExecutor","downloadModel","mutation",a),deleteModel:a=>n("pipelineExecutor","deleteModel","mutation",a),cacheFrameInPool:a=>n("pipelineExecutor","cacheFrameInPool","mutation",a),inferCached:a=>n("pipelineExecutor","inferCached","mutation",a),uncacheFrame:a=>n("pipelineExecutor","uncacheFrame","mutation",a),getEffectiveTuning:a=>n("pipelineExecutor","getEffectiveTuning","query",a),listLoadedEngines:a=>n("pipelineExecutor","listLoadedEngines","query",a),spinEngine:a=>n("pipelineExecutor","spinEngine","mutation",a),killEngine:a=>n("pipelineExecutor","killEngine","mutation",a),listReferenceImages:a=>n("pipelineExecutor","listReferenceImages","query",a),getReferenceImage:a=>n("pipelineExecutor","getReferenceImage","query",a),getReferenceAudioFiles:a=>n("pipelineExecutor","getReferenceAudioFiles","query",a),getReferenceAudio:a=>n("pipelineExecutor","getReferenceAudio","query",a),getAudioCapabilities:a=>n("pipelineExecutor","getAudioCapabilities","query",a),runAudioTest:a=>n("pipelineExecutor","runAudioTest","mutation",a),getDetectionConfigSchema:a=>n("pipelineExecutor","getDetectionConfigSchema","query",a)},pipelineOrchestrator:{pauseForStorageMigration:a=>n("pipelineOrchestrator","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("pipelineOrchestrator","resumeForStorageMigration","mutation",a),rebalance:a=>n("pipelineOrchestrator","rebalance","mutation",a),getPipelineAssignments:a=>n("pipelineOrchestrator","getPipelineAssignments","query",a),getAgentLoad:a=>n("pipelineOrchestrator","getAgentLoad","query",a),getGlobalMetrics:a=>n("pipelineOrchestrator","getGlobalMetrics","query",a),getCapabilityBindings:a=>n("pipelineOrchestrator","getCapabilityBindings","query",a),setCapabilityBinding:a=>n("pipelineOrchestrator","setCapabilityBinding","mutation",a),getIngestOwner:a=>n("pipelineOrchestrator","getIngestOwner","query",a),getAudioNodeLoad:a=>n("pipelineOrchestrator","getAudioNodeLoad","query",a),getAgentSettings:a=>n("pipelineOrchestrator","getAgentSettings","query",a),listAgentSettings:a=>n("pipelineOrchestrator","listAgentSettings","query",a),removeAgentSettings:a=>n("pipelineOrchestrator","removeAgentSettings","mutation",a),setAgentMaxCameras:a=>n("pipelineOrchestrator","setAgentMaxCameras","mutation",a),setAgentDetectWeight:a=>n("pipelineOrchestrator","setAgentDetectWeight","mutation",a),setAgentCapabilities:a=>n("pipelineOrchestrator","setAgentCapabilities","mutation",a),setAgentDecodeLimits:a=>n("pipelineOrchestrator","setAgentDecodeLimits","mutation",a),setAgentReachableHost:a=>n("pipelineOrchestrator","setAgentReachableHost","mutation",a),setAgentInferenceDevices:a=>n("pipelineOrchestrator","setAgentInferenceDevices","mutation",a),getNodeInferenceDevices:a=>n("pipelineOrchestrator","getNodeInferenceDevices","query",a),resetNodePipelineDefaults:a=>n("pipelineOrchestrator","resetNodePipelineDefaults","mutation",a),getCameraStatuses:a=>n("pipelineOrchestrator","getCameraStatuses","query",a),reconcileFromDisk:a=>n("pipelineOrchestrator","reconcileFromDisk","mutation",a),getReconcileFromDiskStatus:a=>n("pipelineOrchestrator","getReconcileFromDiskStatus","query",a),listTemplates:a=>n("pipelineOrchestrator","listTemplates","query",a),saveTemplate:a=>n("pipelineOrchestrator","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineOrchestrator","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineOrchestrator","deleteTemplate","mutation",a)},pipelineRunner:{attachCamera:a=>n("pipelineRunner","attachCamera","mutation",a),reportMotion:a=>n("pipelineRunner","reportMotion","mutation",a),getLocalLoad:a=>n("pipelineRunner","getLocalLoad","query",a),getLocalMetrics:a=>n("pipelineRunner","getLocalMetrics","query",a),getAllCameraMetrics:a=>n("pipelineRunner","getAllCameraMetrics","query",a),getLocalCameras:a=>n("pipelineRunner","getLocalCameras","query",a),getNativeCrop:a=>n("pipelineRunner","getNativeCrop","query",a),runStatelessStep:a=>n("pipelineRunner","runStatelessStep","mutation",a)},plateGallery:{getPlateMedia:a=>n("plateGallery","getPlateMedia","query",a),searchPlates:a=>n("plateGallery","searchPlates","query",a),suggestPlateClusters:a=>n("plateGallery","suggestPlateClusters","query",a),correctPlateText:a=>n("plateGallery","correctPlateText","mutation",a),deletePlate:a=>n("plateGallery","deletePlate","mutation",a),listVehicles:a=>n("plateGallery","listVehicles","query",a),createVehicle:a=>n("plateGallery","createVehicle","mutation",a),renameVehicle:a=>n("plateGallery","renameVehicle","mutation",a),deleteVehicle:a=>n("plateGallery","deleteVehicle","mutation",a),listVehicleSamples:a=>n("plateGallery","listVehicleSamples","query",a),removeVehicleSample:a=>n("plateGallery","removeVehicleSample","mutation",a),assignPlate:a=>n("plateGallery","assignPlate","mutation",a),unassignPlate:a=>n("plateGallery","unassignPlate","mutation",a),assignPlates:a=>n("plateGallery","assignPlates","mutation",a),unassignPlates:a=>n("plateGallery","unassignPlates","mutation",a)},recording:{getAvailabilityBatch:a=>n("recording","getAvailabilityBatch","query",a),getDaysWithRecordingsBatch:a=>n("recording","getDaysWithRecordingsBatch","query",a),getStorageUsage:a=>n("recording","getStorageUsage","query",a),listOpsLog:a=>n("recording","listOpsLog","query",a),pauseForStorageMigration:a=>n("recording","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("recording","resumeForStorageMigration","mutation",a),refreshStorageLocationsForMigration:a=>n("recording","refreshStorageLocationsForMigration","mutation",a),startStorageMigrationMove:a=>n("recording","startStorageMigrationMove","mutation",a),getStorageMigrationMoveStatus:a=>n("recording","getStorageMigrationMoveStatus","query",a),cancelStorageMigrationMove:a=>n("recording","cancelStorageMigrationMove","mutation",a),relocateFootage:a=>n("recording","relocateFootage","mutation",a),listRelocateJobs:a=>n("recording","listRelocateJobs","query",a),getRelocateResidue:a=>n("recording","getRelocateResidue","query",a),reconcileLedgerAgainstDisk:a=>n("recording","reconcileLedgerAgainstDisk","mutation",a),cancelRelocateJob:a=>n("recording","cancelRelocateJob","mutation",a),planStorageRebalance:a=>n("recording","planStorageRebalance","query",a),startStorageRebalance:a=>n("recording","startStorageRebalance","mutation",a),getPlacement:a=>n("recording","getPlacement","query",a),setDevicePlacement:a=>n("recording","setDevicePlacement","mutation",a)},recordingExport:{createExport:a=>n("recordingExport","createExport","mutation",a),getExport:a=>n("recordingExport","getExport","query",a),cancelExport:a=>n("recordingExport","cancelExport","mutation",a),deleteExport:a=>n("recordingExport","deleteExport","mutation",a),getDownloadUrl:a=>n("recordingExport","getDownloadUrl","query",a),readExportBytes:a=>n("recordingExport","readExportBytes","query",a)},serverManagement:{getServerPackageStatus:a=>n("serverManagement","getServerPackageStatus","query",a),checkServerUpdate:a=>n("serverManagement","checkServerUpdate","mutation",a),applyServerUpdate:a=>n("serverManagement","applyServerUpdate","mutation",a),rollbackServerUpdate:a=>n("serverManagement","rollbackServerUpdate","mutation",a),restartServer:a=>n("serverManagement","restartServer","mutation",a)},settingsStore:{get:a=>n("settingsStore","get","query",a),set:a=>n("settingsStore","set","mutation",a),query:a=>n("settingsStore","query","query",a),upsert:a=>n("settingsStore","upsert","mutation",a),insert:a=>n("settingsStore","insert","mutation",a),insertMany:a=>n("settingsStore","insertMany","mutation",a),update:a=>n("settingsStore","update","mutation",a),delete:a=>n("settingsStore","delete","mutation",a),deleteWhere:a=>n("settingsStore","deleteWhere","mutation",a),updateWhere:a=>n("settingsStore","updateWhere","mutation",a),count:a=>n("settingsStore","count","query",a),aggregate:a=>n("settingsStore","aggregate","query",a),histogram:a=>n("settingsStore","histogram","query",a),isEmpty:a=>n("settingsStore","isEmpty","query",a),declareCollection:a=>n("settingsStore","declareCollection","mutation",a)},storage:{resolve:a=>n("storage","resolve","query",a),write:a=>n("storage","write","mutation",a),read:a=>n("storage","read","query",a),exists:a=>n("storage","exists","query",a),list:a=>n("storage","list","query",a),delete:a=>n("storage","delete","mutation",a),getAvailableSpace:a=>n("storage","getAvailableSpace","query",a),beginUpload:a=>n("storage","beginUpload","mutation",a),writeChunk:a=>n("storage","writeChunk","mutation",a),finalizeUpload:a=>n("storage","finalizeUpload","mutation",a),abortUpload:a=>n("storage","abortUpload","mutation",a),beginDownload:a=>n("storage","beginDownload","mutation",a),readChunk:a=>n("storage","readChunk","query",a),endDownload:a=>n("storage","endDownload","mutation",a),listLocations:a=>n("storage","listLocations","query",a),listLocationDeclarations:a=>n("storage","listLocationDeclarations","query",a),upsertLocation:a=>n("storage","upsertLocation","mutation",a),deleteLocation:a=>n("storage","deleteLocation","mutation",a),listDrainProgress:a=>n("storage","listDrainProgress","query",a),testLocation:a=>n("storage","testLocation","query",a),listProviders:a=>n("storage","listProviders","query",a),testConfig:a=>n("storage","testConfig","query",a)},storageMigration:{plan:a=>n("storageMigration","plan","query",a),start:a=>n("storageMigration","start","mutation",a),status:a=>n("storageMigration","status","query",a),cancel:a=>n("storageMigration","cancel","mutation",a),movers:a=>n("storageMigration","movers","query",a),residue:a=>n("storageMigration","residue","query",a),drain:a=>n("storageMigration","drain","mutation",a),cleanupStart:a=>n("storageMigration","cleanupStart","mutation",a),cleanupStatus:a=>n("storageMigration","cleanupStatus","query",a),cleanupCancel:a=>n("storageMigration","cleanupCancel","mutation",a),history:a=>n("storageMigration","history","query",a)},streamBroker:{fetchEventMedia:a=>n("streamBroker","fetchEventMedia","mutation",a),listAllCameraStreams:a=>n("streamBroker","listAllCameraStreams","query",a),listAllProfileSlots:a=>n("streamBroker","listAllProfileSlots","query",a),getBrokerStats:a=>n("streamBroker","getBrokerStats","query",a),probeStream:a=>n("streamBroker","probeStream","mutation",a),listClients:a=>n("streamBroker","listClients","query",a),killClient:a=>n("streamBroker","killClient","mutation",a),getStreamUrl:a=>n("streamBroker","getStreamUrl","query",a),getStreamWithCodec:a=>n("streamBroker","getStreamWithCodec","mutation",a),releaseStreamWithCodec:a=>n("streamBroker","releaseStreamWithCodec","mutation",a),acquireEgressTranscode:a=>n("streamBroker","acquireEgressTranscode","mutation",a),releaseEgressTranscode:a=>n("streamBroker","releaseEgressTranscode","mutation",a),subscribeAudioChunks:a=>n("streamBroker","subscribeAudioChunks","mutation",a),pullAudioChunks:a=>n("streamBroker","pullAudioChunks","query",a),unsubscribeAudioChunks:a=>n("streamBroker","unsubscribeAudioChunks","mutation",a),subscribeFrames:a=>n("streamBroker","subscribeFrames","mutation",a),pullFrameHandles:a=>n("streamBroker","pullFrameHandles","query",a),unsubscribeFrames:a=>n("streamBroker","unsubscribeFrames","mutation",a),setPreBufferDuration:a=>n("streamBroker","setPreBufferDuration","mutation",a),getPreBufferInfo:a=>n("streamBroker","getPreBufferInfo","query",a),getRtspPort:a=>n("streamBroker","getRtspPort","query",a),getAllRtspEntries:a=>n("streamBroker","getAllRtspEntries","query",a),getRtspEntry:a=>n("streamBroker","getRtspEntry","query",a),regenerateRtspToken:a=>n("streamBroker","regenerateRtspToken","mutation",a),setRtspEnabled:a=>n("streamBroker","setRtspEnabled","mutation",a),isRtspEnabled:a=>n("streamBroker","isRtspEnabled","query",a)},system:{info:a=>n("system","info","query",a),health:a=>n("system","health","query",a),featureFlags:a=>n("system","featureFlags","query",a),networkAddresses:a=>n("system","networkAddresses","query",a),getRetentionConfig:a=>n("system","getRetentionConfig","query",a),setRetentionConfig:a=>n("system","setRetentionConfig","mutation",a),forceRetentionCleanup:a=>n("system","forceRetentionCleanup","mutation",a),getSiteLocation:a=>n("system","getSiteLocation","query",a),setSiteLocation:a=>n("system","setSiteLocation","mutation",a),detectSiteLocation:a=>n("system","detectSiteLocation","mutation",a),getRequestCensus:a=>n("system","getRequestCensus","query",a),getLoadContributions:a=>n("system","getLoadContributions","query",a),getFailureContributions:a=>n("system","getFailureContributions","query",a),getLoggingSettings:a=>n("system","getLoggingSettings","query",a),setLoggingSettings:a=>n("system","setLoggingSettings","mutation",a)},terminalSession:{listProfiles:a=>n("terminalSession","listProfiles","query",a),listInstances:a=>n("terminalSession","listInstances","query",a),createInstance:a=>n("terminalSession","createInstance","mutation",a),updateInstance:a=>n("terminalSession","updateInstance","mutation",a),deleteInstance:a=>n("terminalSession","deleteInstance","mutation",a),setInstanceEnabled:a=>n("terminalSession","setInstanceEnabled","mutation",a),listLegacyCameras:a=>n("terminalSession","listLegacyCameras","query",a),adoptLegacyMonitor:a=>n("terminalSession","adoptLegacyMonitor","mutation",a),listSessions:a=>n("terminalSession","listSessions","query",a),openSession:a=>n("terminalSession","openSession","mutation",a),resize:a=>n("terminalSession","resize","mutation",a),pullOutput:a=>n("terminalSession","pullOutput","mutation",a),writeInput:a=>n("terminalSession","writeInput","mutation",a),close:a=>n("terminalSession","close","mutation",a)},toast:{onToast:(a,s)=>n("toast","onToast","subscription",a,s)},turnProvider:{getTurnServers:a=>n("turnProvider","getTurnServers","query",a)},userManagement:{listUsers:a=>n("userManagement","listUsers","query",a),createUser:a=>n("userManagement","createUser","mutation",a),updateUser:a=>n("userManagement","updateUser","mutation",a),deleteUser:a=>n("userManagement","deleteUser","mutation",a),resetPassword:a=>n("userManagement","resetPassword","mutation",a),setUserScopes:a=>n("userManagement","setUserScopes","mutation",a),validateCredentials:a=>n("userManagement","validateCredentials","mutation",a),listApiKeys:a=>n("userManagement","listApiKeys","query",a),createApiKey:a=>n("userManagement","createApiKey","mutation",a),revokeApiKey:a=>n("userManagement","revokeApiKey","mutation",a),validateApiKey:a=>n("userManagement","validateApiKey","mutation",a),createScopedToken:a=>n("userManagement","createScopedToken","mutation",a),revokeScopedToken:a=>n("userManagement","revokeScopedToken","mutation",a),validateScopedToken:a=>n("userManagement","validateScopedToken","query",a),listScopedTokens:a=>n("userManagement","listScopedTokens","query",a),setupTotp:a=>n("userManagement","setupTotp","mutation",a),confirmTotp:a=>n("userManagement","confirmTotp","mutation",a),disableTotp:a=>n("userManagement","disableTotp","mutation",a),getTotpStatus:a=>n("userManagement","getTotpStatus","query",a),verifyTotp:a=>n("userManagement","verifyTotp","mutation",a),oauthIssueCode:a=>n("userManagement","oauthIssueCode","mutation",a),oauthExchangeCode:a=>n("userManagement","oauthExchangeCode","mutation",a),oauthRefresh:a=>n("userManagement","oauthRefresh","mutation",a),oauthVerifyAccessToken:a=>n("userManagement","oauthVerifyAccessToken","query",a),listOauthSessions:a=>n("userManagement","listOauthSessions","query",a),revokeOauthSession:a=>n("userManagement","revokeOauthSession","mutation",a)}}}var EJ=["devices","classes"];new Set(EJ);var cT=d({title:o().max(500).optional(),body:o().max(2e3).optional()}),uT=o().min(1).max(200),dT=w(l()).min(1),pT=l().int().min(2).max(3600),mT=l().int().min(1).max(60),fT=w(sI).min(1),hT=l().int().min(1).max(5),RJ=.1,gT=l().min(RJ).max(3600),vT=l().min(0).max(60),yT=o().max(200),bT=N(["image","gif"]),ST=w(o().min(1).max(40)).max(20),IJ=d({name:uT,enabled:A().default(!0),deviceIds:dT,schedule:xm,cadenceSec:pT.default(15),framerate:mT.default(10),denseCadenceSec:gT.optional(),minDwellSec:vT.optional(),targets:fT,template:cT.optional(),previewText:yT.optional(),previewMode:bT.default("image"),reportClasses:ST.optional(),priority:hT.default(3)});d({name:uT.optional(),enabled:A().optional(),deviceIds:dT.optional(),schedule:xm.optional(),cadenceSec:pT.optional(),framerate:mT.optional(),denseCadenceSec:gT.optional(),minDwellSec:vT.optional(),targets:fT.optional(),template:cT.nullable().optional(),previewText:yT.optional(),previewMode:bT.optional(),reportClasses:ST.optional(),priority:hT.optional()});IJ.extend({id:o(),ownerUserId:o().optional(),lastGeneratedAt:l().optional(),generatedByDevice:Y(o(),l()).optional(),createdBy:o(),createdAt:l(),updatedAt:l()});var TJ=[{stepId:"face-embedding",label:"Face recognition model",defaultModelId:"arcface-r100",indexName:"the enrolled face gallery",options:[{id:"arcface-r100",label:"ArcFace (ResNet34)"},{id:"auraface-r100",label:"AuraFace R100"},{id:"inception-resnet-v1",label:"Inception ResNet V1"}]},{stepId:"clip-embedding",label:"Semantic search model",defaultModelId:"mobileclip-s1",indexName:"the object semantic-search index",options:[{id:"mobileclip-s1",label:"MobileCLIP S1"},{id:"mobileclip-s2",label:"MobileCLIP S2"}]}];Object.freeze(Object.fromEntries(TJ.map(e=>[e.stepId,e.defaultModelId])));o().min(1);var _J=[{stepId:"face-embedding",key:"minLandmarkFaceSize",label:"Min face size for recognition (detection px)",description:"Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",type:"slider",min:0,max:64,step:2,default:24}];function NJ(e,t){return`clusterStepSetting:${e}:${t}`}var OJ=l().finite();function PJ(e){const t={};for(const n of _J){const a=OJ.safeParse(e[NJ(n.stepId,n.key)]),s=a.success?a.data:n.default,p=t[n.stepId]??{};t[n.stepId]={...p,[n.key]:s}}return t}PJ({});d({paddingRatio:l().min(0).max(4),square:A()});var jJ=N(["all","inferred"]);d({holdFrames:l().int().min(1).max(64),budgetMb:l().int().min(0).max(4096),activityMs:l().int().min(0).max(12e4),admission:jJ,tileBudgetMb:l().int().min(0).max(1024),sceneBudgetMb:l().int().min(0).max(1024)});var x2={"°C":{dimension:"temperature",factor:1,offset:0},"°F":{dimension:"temperature",factor:5/9,offset:-160/9},K:{dimension:"temperature",factor:1,offset:-273.15},hPa:{dimension:"pressure",factor:1,offset:0},kPa:{dimension:"pressure",factor:10,offset:0},Pa:{dimension:"pressure",factor:.01,offset:0},mbar:{dimension:"pressure",factor:1,offset:0},bar:{dimension:"pressure",factor:1e3,offset:0},inHg:{dimension:"pressure",factor:33.8639,offset:0},mmHg:{dimension:"pressure",factor:1.33322,offset:0},psi:{dimension:"pressure",factor:68.9476,offset:0},"m/s":{dimension:"speed",factor:1,offset:0},"km/h":{dimension:"speed",factor:1/3.6,offset:0},mph:{dimension:"speed",factor:.44704,offset:0},kn:{dimension:"speed",factor:.514444,offset:0},"mm/h":{dimension:"precipitation-rate",factor:1,offset:0},"in/h":{dimension:"precipitation-rate",factor:25.4,offset:0},m:{dimension:"length",factor:1,offset:0},mm:{dimension:"length",factor:.001,offset:0},cm:{dimension:"length",factor:.01,offset:0},km:{dimension:"length",factor:1e3,offset:0},in:{dimension:"length",factor:.0254,offset:0},ft:{dimension:"length",factor:.3048,offset:0},mi:{dimension:"length",factor:1609.344,offset:0},lx:{dimension:"illuminance",factor:1,offset:0},"W/m²":{dimension:"irradiance",factor:1,offset:0},W:{dimension:"power",factor:1,offset:0},kW:{dimension:"power",factor:1e3,offset:0},VA:{dimension:"apparent-power",factor:1,offset:0},Wh:{dimension:"energy",factor:1,offset:0},kWh:{dimension:"energy",factor:1e3,offset:0},MWh:{dimension:"energy",factor:1e6,offset:0},V:{dimension:"voltage",factor:1,offset:0},mV:{dimension:"voltage",factor:.001,offset:0},A:{dimension:"current",factor:1,offset:0},mA:{dimension:"current",factor:.001,offset:0},ppm:{dimension:"concentration-volume",factor:1,offset:0},ppb:{dimension:"concentration-volume",factor:.001,offset:0},"µg/m³":{dimension:"concentration-mass",factor:1,offset:0},"mg/m³":{dimension:"concentration-mass",factor:1e3,offset:0},kg:{dimension:"mass",factor:1,offset:0},g:{dimension:"mass",factor:.001,offset:0},lb:{dimension:"mass",factor:.453592,offset:0},oz:{dimension:"mass",factor:.0283495,offset:0},"%":{dimension:"percentage",factor:1,offset:0}};function oy(e){return Object.hasOwn(x2,e)?x2[e]:void 0}function k2(e){return oy(e)?.dimension}function DJ(e,t){return e*t.factor+t.offset}function zJ(e,t){return(e-t.offset)/t.factor}function LJ(e,t,n){if(t===n)return e;const a=oy(t);if(!a)return;const s=oy(n);if(s&&a.dimension===s.dimension)return zJ(DJ(e,a),s)}function qJ(e,t){if(e===t)return!0;const n=k2(e);return n===void 0?!1:n===k2(t)}var BJ=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},xT=class{constructor(t){this.generateIdentifier=t,this.kv=new BJ}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},UJ=class extends xT{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),super.register(t,n.identifier)):super.register(t,n)}getAllowedProps(t){return this.classToAllowedProps.get(t)}};function FJ(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function HJ(e,t){const n=FJ(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function al(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function gp(e,t){return e.indexOf(t)!==-1}function w2(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var $J=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return HJ(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}},QJ=e=>Object.prototype.toString.call(e).slice(8,-1),kT=e=>typeof e>"u",VJ=e=>e===null,Uc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,sy=e=>Uc(e)&&Object.keys(e).length===0,Lr=e=>Array.isArray(e),GJ=e=>typeof e=="string",ZJ=e=>typeof e=="number"&&!isNaN(e),WJ=e=>typeof e=="boolean",KJ=e=>e instanceof RegExp,Fc=e=>e instanceof Map,Hc=e=>e instanceof Set,wT=e=>QJ(e)==="Symbol",YJ=e=>e instanceof Date&&!isNaN(e.valueOf()),MT=e=>e instanceof Error,M2=e=>typeof e=="number"&&isNaN(e),XJ=e=>WJ(e)||VJ(e)||kT(e)||ZJ(e)||GJ(e)||wT(e),JJ=e=>typeof e=="bigint",eee=e=>e===1/0||e===-1/0,tee=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),nee=e=>e instanceof URL,ly=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Ig=e=>e.map(String).map(ly).join("."),Tc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function si(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var CT=[si(kT,"undefined",()=>null,()=>{}),si(JJ,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),si(YJ,"Date",e=>e.toISOString(),e=>new Date(e)),si(MT,"Error",(e,t)=>{const n={name:e.name,message:e.message};return"cause"in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n},(e,t)=>{const n=new Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n}),si(KJ,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),si(Hc,"set",e=>[...e.values()],e=>new Set(e)),si(Fc,"map",e=>[...e.entries()],e=>new Map(e)),si(e=>M2(e)||eee(e),"number",e=>M2(e)?"NaN":e>0?"Infinity":"-Infinity",Number),si(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),si(nee,"URL",e=>e.toString(),e=>new URL(e))];function km(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var AT=km((e,t)=>wT(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const a=n.symbolRegistry.getValue(t[1]);if(!a)throw new Error("Trying to deserialize unknown symbol");return a}),aee=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),ET=km(tee,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=aee[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function RT(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var IT=km(RT,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const a={};return n.forEach(s=>{a[s]=e[s]}),a},(e,t,n)=>{const a=n.classRegistry.getValue(t[1]);if(!a)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(a.prototype),e)}),TT=km((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const a=n.customTransformerRegistry.findByName(t[1]);if(!a)throw new Error("Trying to deserialize unknown custom value");return a.deserialize(e)}),iee=[IT,AT,TT,ET],C2=(e,t)=>{const n=w2(iee,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=w2(CT,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},_T={};CT.forEach(e=>{_T[e.annotation]=e});var ree=(e,t,n)=>{if(Lr(t))switch(t[0]){case"symbol":return AT.untransform(e,t,n);case"class":return IT.untransform(e,t,n);case"custom":return TT.untransform(e,t,n);case"typed-array":return ET.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=_T[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Fs=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function NT(e){if(gp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(gp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(gp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var oee=(e,t)=>{NT(t);for(let n=0;n<t.length;n++){const a=t[n];if(Hc(e))e=Fs(e,+a);else if(Fc(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Fs(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},cy=(e,t,n)=>{if(NT(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Lr(a)){const m=+f;a=a[m]}else if(Uc(a))a=a[f];else if(Hc(a)){const m=+f;a=Fs(a,m)}else if(Fc(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=Fs(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if(Lr(a)?a[+s]=n(a[+s]):Uc(a)&&(a[s]=n(a[s])),Hc(a)){const p=Fs(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(Fc(a)){const p=+t[t.length-2],f=Fs(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},OT=e=>e<1;function uy(e,t,n,a=[]){if(!e)return;const s=OT(n);if(!Lr(e)){al(e,(m,h)=>uy(m,t,n,[...a,...Tc(h,s)]));return}const[p,f]=e;f&&al(f,(m,h)=>{uy(m,t,n,[...a,...Tc(h,s)])}),t(p,a)}function see(e,t,n,a){return uy(t,(s,p)=>{e=cy(e,p,f=>ree(f,s,a))},n),e}function lee(e,t,n){const a=OT(n);function s(p,f){const m=oee(e,Tc(f,a));p.map(h=>Tc(h,a)).forEach(h=>{e=cy(e,h,()=>m)})}if(Lr(t)){const[p,f]=t;p.forEach(m=>{e=cy(e,Tc(m,a),()=>e)}),f&&al(f,s)}else al(t,s);return e}var cee=(e,t)=>Uc(e)||Lr(e)||Fc(e)||Hc(e)||MT(e)||RT(e,t);function uee(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function dee(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(Ig):n[Ig(p)]=f.map(Ig)}),a?sy(n)?[a]:[a,n]:sy(n)?void 0:n}var PT=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=XJ(e);if(!m){uee(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!cee(e,n)){const E=C2(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(gp(p,e))return{transformedValue:null};const h=C2(e,n),c=h?.value??e,x=Lr(c)?[]:{},M={};al(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=PT(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,Lr(_.annotations)?M[ly(R)]=_.annotations:Uc(_.annotations)&&al(_.annotations,(P,D)=>{M[ly(R)+"."+D]=P})});const C=sy(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function jT(e){return Object.prototype.toString.call(e).slice(8,-1)}function A2(e){return jT(e)==="Array"}function pee(e){if(jT(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function mee(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dy(e,t={}){if(A2(e))return e.map(s=>dy(s,t));if(!pee(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||A2(t.props)&&!t.props.includes(p))return s;const f=e[p];return mee(s,p,dy(f,t),e,t.nonenumerable),s},{})}var St=class{constructor({dedupe:t=!1}={}){this.classRegistry=new UJ,this.symbolRegistry=new xT(n=>n.description??""),this.customTransformerRegistry=new $J,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,a=PT(t,n,this,this.dedupe),s={json:a.transformedValue};a.annotations&&(s.meta={...s.meta,values:a.annotations});const p=dee(n,this.dedupe);return p&&(s.meta={...s.meta,referentialEqualities:p}),s.meta&&(s.meta.v=1),s}deserialize(t,n){const{json:a,meta:s}=t;let p=n?.inPlace?a:dy(a);return s?.values&&(p=see(p,s.values,s.v??0,this)),s?.referentialEqualities&&(p=lee(p,s.referentialEqualities,s.v??0)),p}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t),{inPlace:!0})}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}};St.defaultInstance=new St;St.serialize=St.defaultInstance.serialize.bind(St.defaultInstance);St.deserialize=St.defaultInstance.deserialize.bind(St.defaultInstance);St.stringify=St.defaultInstance.stringify.bind(St.defaultInstance);St.parse=St.defaultInstance.parse.bind(St.defaultInstance);St.registerClass=St.defaultInstance.registerClass.bind(St.defaultInstance);St.registerSymbol=St.defaultInstance.registerSymbol.bind(St.defaultInstance);St.registerCustom=St.defaultInstance.registerCustom.bind(St.defaultInstance);St.allowErrorProps=St.defaultInstance.allowErrorProps.bind(St.defaultInstance);St.serialize;St.deserialize;St.stringify;St.parse;St.registerClass;St.registerCustom;St.registerSymbol;St.allowErrorProps;var fee=1e4,hee=6e3,gee=2e3,vee=3e4,yee=class{_serverUrl;useWs;baseRetryMs;maxRetryMs;onConnectionChange;token;_trpcClient;_wsClient=null;_eventSubs=new Map;mirror=null;mirrorInit=null;connected=!1;connectedPromise=null;_systemProxy;_connectionVersion=0;_wsEpoch=0;connectionListeners=new Set;constructor(t){this._serverUrl=t.serverUrl.replace(/\/+$/,""),this.token=t.token;const n=typeof window<"u";this.useWs=t.useWebSocket??n,this.onConnectionChange=t.onConnectionChange,this.baseRetryMs=t.retryDelayMs??gee,this.maxRetryMs=t.maxRetryDelayMs??vee,this._trpcClient=this.buildTrpcClient(),this._systemProxy=S2(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(t){return this.connectionListeners.add(t),()=>{this.connectionListeners.delete(t)}}emitConnectionEvent(t){try{this.onConnectionChange?.(t)}catch{}for(const n of this.connectionListeners)try{n(t,this._connectionVersion)}catch{}}async awaitConnected(t){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;const n=t??15e3;this.connectedPromise=(async()=>{const a=this._trpcClient.auth.me.query();Number.isFinite(n)?await new Promise((s,p)=>{const f=setTimeout(()=>p(new Error(`System.awaitConnected: probe timed out after ${n}ms`)),n);a.then(()=>{clearTimeout(f),s()},m=>{clearTimeout(f),p(m instanceof Error?m:new Error(String(m)))})}):await a,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(t){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;const n=new MJ(this._trpcClient);return this.mirror=n,this.mirrorInit=(async()=>{await this.awaitConnected(t),await n.init(t)})().finally(()=>{this.mirrorInit=null}),this.mirrorInit}async awaitReady(){if(!this.mirror?.isReady())return this.mirrorInit?this.mirrorInit:this.init()}isReady(){return this.mirror?.isReady()??!1}isConnected(){return this.connected}reconnect(){this.useWs&&(this._wsEpoch+=1,this.emitConnectionEvent("connecting"),this._wsClient?.close(),this.disposeMirror(),this.resetEventSubs(),this.connected=!1,this.connectedPromise=null,this._trpcClient=this.buildTrpcClient(),this._systemProxy=S2(this._trpcClient))}switchServerUrl(t){const n=t.replace(/\/+$/,"");n!==this._serverUrl&&(this._serverUrl=n,this.reconnect())}async raceConnectionEndpoints(t){const n=t?.perCandidateTimeoutMs??1500,a=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),s=a?.port?Number(a.port):a?.protocol==="https:"?443:80,p=a?.protocol==="https:"?"https":"http",f=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!f)return{winner:this._serverUrl,switched:!1};let m;try{m=(await f.query({port:s,ipv4Only:t?.ipv4Only,scheme:p})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(m.length===0)return{winner:this._serverUrl,switched:!1};const h=await bee(m.map(c=>c.baseUrl),n);return!h||h===this._serverUrl?{winner:h??this._serverUrl,switched:!1}:(this.switchServerUrl(h),{winner:h,switched:!0})}close(){this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._wsClient?.close()}disposeMirror(){this.mirror?.dispose(),this.mirror=null,this.mirrorInit=null}async login(t,n){const a=await this._trpcClient.auth.login.mutate({username:t,password:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a,p=s.token,f=s.requiresTotp===!0||Array.isArray(s.secondFactors)&&s.secondFactors.length>0;typeof p=="string"&&!f&&this.setToken(p)}return a}async loginVerifyTotp(t,n){const a=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:t,code:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async loginBeginPasskey(t){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:t})}async loginVerifyPasskey(t,n){const a=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:t,response:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(t){const n=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:t});if(typeof n=="object"&&n!==null&&"token"in n){const a=n,s=a.requiresTotp===!0||Array.isArray(a.secondFactors)&&a.secondFactors.length>0;typeof a.token=="string"&&!s&&this.setToken(a.token)}return n}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(t){return await this._trpcClient.auth.changeOwnPassword.mutate(t)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(t){return await this._trpcClient.auth.confirmOwnTotp.mutate(t)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(t){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(t)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(t){return await this._trpcClient.auth.removeOwnPasskey.mutate(t)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(t){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(t)}setToken(t){this.token=t}listDevices(t){return this.mirror?(t?this.mirror.query(t):this.mirror.getAllDevices()).map(n=>this.attachBinding(n)):[]}getDeviceInfo(t){return this.mirror?.getDeviceInfo(t)??null}listDeviceInfos(t){const n=this.mirror;if(!n)return[];const a=t?n.query(t):n.getAllDevices(),s=[];for(const p of a){const f=n.getDeviceInfo(p.deviceId);f&&s.push(f)}return s}getDevice(t){const n=this.mirror?.getDeviceById(t)??null;return n?this.attachBinding(n):null}getDeviceByName(t){const n=this.mirror?.getDeviceByName(t)??null;return n?this.attachBinding(n):null}getDeviceByStableId(t){const n=this.mirror?.getDeviceByStableId(t)??null;return n?this.attachBinding(n):null}async waitForDevice(t,n){this.mirror||await this.init();const a=await this.mirror.waitForDevice(t,n??3e4);return this.attachBinding(a)}onDeviceAdded(t){if(!this.mirror)throw new Error("System.onDeviceAdded: call init() before subscribing");return this.mirror.onDeviceAdded(t)}onDeviceRemoved(t){if(!this.mirror)throw new Error("System.onDeviceRemoved: call init() before subscribing");return this.mirror.onDeviceRemoved(t)}attachBinding(t){const n=this.lookupBinding(t.deviceId);if(n===t.binding)return t;const a=t;return a.binding=n,t}lookupBinding(t){return this.mirror?this.mirror.getDeviceById(t)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(t,n){const a=n;let s=this._eventSubs.get(t);if(s===void 0){const f=new Set,m=this._trpcClient.live.onEvent.subscribe({category:t},{onData:h=>{for(const c of[...f])try{c(h)}catch{}}});s={listeners:f,unsubscribe:()=>{try{m.unsubscribe()}catch{}}},this._eventSubs.set(t,s)}s.listeners.add(a);let p=!1;return()=>{if(p)return;p=!0;const f=this._eventSubs.get(t);f!==void 0&&(f.listeners.delete(a),f.listeners.size===0&&(f.unsubscribe(),this._eventSubs.delete(t)))}}resetEventSubs(){for(const t of this._eventSubs.values())t.unsubscribe();this._eventSubs.clear()}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){const t=()=>{const n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),n};if(this.useWs){const n=this._serverUrl.replace(/^http/,"ws")+"/trpc",a=this.baseRetryMs,s=this.maxRetryMs,p=this._wsEpoch;return this._wsClient=r3({url:n,connectionParams:()=>({token:this.token}),retryDelayMs:f=>Math.min(a*Math.pow(2,f),s),keepAlive:{enabled:!0,intervalMs:fee,pongTimeoutMs:hee},onOpen:()=>{p===this._wsEpoch&&(this._connectionVersion+=1,this.emitConnectionEvent("connected"))},onClose:()=>{p===this._wsEpoch&&this.emitConnectionEvent("disconnected")}}),wv({links:[o3({client:this._wsClient,transformer:St})]})}return this._wsClient=null,wv({links:[Qj({url:`${this._serverUrl}/trpc`,headers:t,transformer:St})]})}};function wm(e){return new yee(e)}async function bee(e,t){if(e.length===0)return null;if(typeof fetch!="function")return e[0]??null;const n=typeof window<"u"&&typeof window.location<"u"&&window.location.protocol==="https:"?e.filter(p=>p.toLowerCase().startsWith("https://")):e;if(n.length===0)return null;const a=n.map(()=>new AbortController),s=n.map(async(p,f)=>{const m=a[f],h=setTimeout(()=>m.abort(),t);try{const c=await fetch(`${p.replace(/\/+$/,"")}/trpc/health`,{method:"GET",signal:m.signal,credentials:"omit"});if(!c.ok)throw new Error(`${c.status}`);return p}finally{clearTimeout(h)}});try{const p=await Promise.any(s);for(const f of a)try{f.abort()}catch{}return p}catch{return null}}var See=(function(e){return e.Motion="motion",e.Person="person",e.Vehicle="vehicle",e.Animal="animal",e.Audio="audio",e.Face="face",e.Plate="plate",e.Package="package",e.Doorbell="doorbell",e.Sensor="sensor",e})({}),xee=["animal","dog_cat","dog","cat","horse","sheep","cow","elephant","bear","zebra","giraffe","mouse","rabbit","deer","lion","tiger","bird","eagle","owl","pigeon","fish","whale","dolphin","snake","turtle","lizard"],kee=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],wee=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],Mee=["face","eyes","nose","mouth","ears","eyebrows","left_eye","right_eye","pupil","iris","eyelid","eye_corner","upper_lip","lower_lip","teeth","chin","cheek","forehead","jaw","glasses","sunglasses","facial_hair","beard","mustache","facial_landmark","facial_keypoint"],Cee=["plate","license_plate","front_plate","rear_plate","motorcycle_plate","temporary_plate","dealer_plate","licensePlate","plate_number","plate_character","plate_digit","plate_letter","plate_symbol","plate_region","plate_country_identifier","plate_frame","plate_bolt","plate_sticker","plate_validation_tag","damaged_plate","obscured_plate","dirty_plate"],Aee=["motion","movement","other"],Eee=["package","packet"],Ree=["audio"],Iee=["speech","scream","babbling","yell","bellow","whoop","whispering","laughter","snicker","crying","cry","sigh","singing","choir","chant","mantra","child_singing","rapping","humming","groan","grunt","whistling","breathing","wheeze","snoring","gasp","pant","snort","cough","throat_clearing","sneeze","sniff","cheering","applause","chatter","crowd","children_playing","bark","yip","howl","bow-wow","growling","whimper_dog","purr","meow","hiss","caterwaul","pets","livestock","doorbell","ding-dong","door","slam","knock","alarm","telephone","music","dog","dogs"],Tee=["doorbell","ring"],_ee=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...xee.reduce((e,t)=>({...e,[t]:"animal"}),{}),...kee.reduce((e,t)=>({...e,[t]:"person"}),{}),...wee.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...Aee.reduce((e,t)=>({...e,[t]:"motion"}),{}),...Eee.reduce((e,t)=>({...e,[t]:"package"}),{}),...Mee.reduce((e,t)=>({...e,[t]:"face"}),{}),...Cee.reduce((e,t)=>({...e,[t]:"plate"}),{}),...Ree.reduce((e,t)=>({...e,[t]:"audio"}),{}),...Iee.reduce((e,t)=>({...e,[t]:"audio"}),{}),...Tee.reduce((e,t)=>({...e,[t]:"doorbell"}),{}),..._ee.reduce((e,t)=>({...e,[t]:"sensor"}),{})});var Nee=Object.values(See),Oee=Nee.filter(e=>e!=="motion");[...Oee];var Pee=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(Pee);var jee=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(jee);var T=nb();const wn=JP(T),Dee=XP({__proto__:null,default:wn},[T]);T.createContext(null);var jo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zee=class extends jo{#t;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},e0=new zee,Lee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},qee=class{#t=Lee;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},wo=new qee;function Bee(e){setTimeout(e,0)}var Uee=typeof window>"u"||"Deno"in globalThis;function Hn(){}function Fee(e,t){return typeof e=="function"?e(t):e}function py(e){return typeof e=="number"&&e>=0&&e!==1/0}function DT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dr(e,t){return typeof e=="function"?e(t):e}function Aa(e,t){return typeof e=="function"?e(t):e}function E2(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:p,queryKey:f,stale:m}=e;if(f){if(a){if(t.queryHash!==t0(f,t.options))return!1}else if(!$c(t.queryKey,f))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof m=="boolean"&&t.isStale()!==m||s&&s!==t.state.fetchStatus||p&&!p(t))}function R2(e,t){const{exact:n,status:a,predicate:s,mutationKey:p}=e;if(p){if(!t.options.mutationKey)return!1;if(n){if(qr(t.options.mutationKey)!==qr(p))return!1}else if(!$c(t.options.mutationKey,p))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function t0(e,t){return(t?.queryKeyHashFn||qr)(e)}function qr(e){return JSON.stringify(e,(t,n)=>my(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>$c(e[n],t[n])):!1}var Hee=Object.prototype.hasOwnProperty;function n0(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=I2(e)&&I2(t);if(!a&&!(my(e)&&my(t)))return t;const p=(a?e:Object.keys(e)).length,f=a?t:Object.keys(t),m=f.length,h=a?new Array(m):{};let c=0;for(let x=0;x<m;x++){const M=a?x:f[x],C=e[M],E=t[M];if(C===E){h[M]=C,(a?x<p:Hee.call(e,M))&&c++;continue}if(C===null||E===null||typeof C!="object"||typeof E!="object"){h[M]=E;continue}const R=n0(C,E,n+1);h[M]=R,R===C&&c++}return p===m&&c===p?e:h}function Qc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function I2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function my(e){if(!T2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!T2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function T2(e){return Object.prototype.toString.call(e)==="[object Object]"}function $ee(e){return new Promise(t=>{wo.setTimeout(t,e)})}function fy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?n0(e,t):t}function Qee(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function Vee(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Ea=Symbol();function zT(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ea?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function a0(e,t){return typeof e=="function"?e(...t):!!e}function Gee(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Vc=(()=>{let e=()=>Uee;return{isServer(){return e()},setIsServer(t){e=t}}})();function hy(){let e,t;const n=new Promise((s,p)=>{e=s,t=p});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var Zee=Bee;function Wee(){let e=[],t=0,n=m=>{m()},a=m=>{m()},s=Zee;const p=m=>{t?e.push(m):s(()=>{n(m)})},f=()=>{const m=e;e=[],m.length&&s(()=>{a(()=>{m.forEach(h=>{n(h)})})})};return{batch:m=>{let h;t++;try{h=m()}finally{t--,t||f()}return h},batchCalls:m=>(...h)=>{p(()=>{m(...h)})},schedule:p,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{a=m},setScheduler:m=>{s=m}}}var pn=Wee(),Kee=class extends jo{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},Gp=new Kee;function Yee(e){return Math.min(1e3*2**e,3e4)}function LT(e){return(e??"online")==="online"?Gp.isOnline():!0}var gy=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function qT(e){let t=!1,n=0,a;const s=hy(),p=()=>s.status!=="pending",f=_=>{if(!p()){const P=new gy(_);C(P),e.onCancel?.(P)}},m=()=>{t=!0},h=()=>{t=!1},c=()=>e0.isFocused()&&(e.networkMode==="always"||Gp.isOnline())&&e.canRun(),x=()=>LT(e.networkMode)&&e.canRun(),M=_=>{p()||(a?.(),s.resolve(_))},C=_=>{p()||(a?.(),s.reject(_))},E=()=>new Promise(_=>{a=P=>{(p()||c())&&_(P)},e.onPause?.()}).then(()=>{a=void 0,p()||e.onContinue?.()}),R=()=>{if(p())return;let _;const P=n===0?e.initialPromise:void 0;try{_=P??e.fn()}catch(D){_=Promise.reject(D)}Promise.resolve(_).then(M).catch(D=>{if(p())return;const L=e.retry??(Vc.isServer()?0:3),B=e.retryDelay??Yee,q=typeof B=="function"?B(n,D):B,G=L===!0||typeof L=="number"&&n<L||typeof L=="function"&&L(n,D);if(t||!G){C(D);return}n++,e.onFail?.(n,D),$ee(q).then(()=>c()?void 0:E()).then(()=>{t?C(D):R()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(a?.(),s),cancelRetry:m,continueRetry:h,canStart:x,start:()=>(x()?R():E().then(R),s)}}var BT=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),py(this.gcTime)&&(this.#t=wo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vc.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(wo.clearTimeout(this.#t),this.#t=void 0)}};function Xee(e){return{onFetch:(t,n)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,p=t.state.data?.pages||[],f=t.state.data?.pageParams||[];let m={pages:[],pageParams:[]},h=0;const c=async()=>{let x=!1;const M=R=>{Gee(R,()=>t.signal,()=>x=!0)},C=zT(t.options,t.fetchOptions),E=async(R,_,P)=>{if(x)return Promise.reject(t.signal.reason);if(_==null&&R.pages.length)return Promise.resolve(R);const L=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:_,direction:P?"backward":"forward",meta:t.options.meta};return M(ne),ne})(),B=await C(L),{maxPages:q}=t.options,G=P?Vee:Qee;return{pages:G(R.pages,B,q),pageParams:G(R.pageParams,_,q)}};if(s&&p.length){const R=s==="backward",_=R?UT:vy,P={pages:p,pageParams:f},D=_(a,P);m=await E(P,D,R)}else{const R=e??p.length;do{const _=h===0?f[0]??a.initialPageParam:vy(a,m);if(h>0&&_==null)break;m=await E(m,_),h++}while(h<R)}return m};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function vy(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function UT(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Jee(e,t){return t?vy(e,t)!=null:!1}function ete(e,t){return!t||!e.getPreviousPageParam?!1:UT(e,t)!=null}var tte=class extends BT{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=N2(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=N2(this.options);t.data!==void 0&&(this.setState(_2(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=fy(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Hn).catch(Hn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Aa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ea||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Dr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!DT(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(c=>c.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const h=zT(this.options,t),x=(()=>{const M={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(M),M})();return this.#o=!1,this.options.persister?this.options.persister(h,x,this):h(x)},f=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return a(h),h})();(this.#t==="infinite"?Xee(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#l({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=qT({initialPromise:t?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof gy&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(h,c)=>{this.#l({type:"failed",failureCount:h,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#a.config.onSuccess?.(h,this),this.#a.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof gy){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#a.config.onError?.(h,this),this.#a.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...FT(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,..._2(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?a:void 0,a;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function FT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cu=class extends jo{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#s=hy(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#a=void 0;#i;#r;#s;#o;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),O2(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yy(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yy(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Aa(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#e.setOptions(this.options),t._defaulted&&!Qc(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&P2(this.#e,n,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==n||Aa(this.options.enabled,this.#e)!==Aa(t.enabled,this.#e)||Dr(this.options.staleTime,this.#e)!==Dr(t.staleTime,this.#e))&&this.#g();const s=this.#v();a&&(this.#e!==n||Aa(this.options.enabled,this.#e)!==Aa(t.enabled,this.#e)||s!==this.#c)&&this.#y(s)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return ate(this,n)&&(this.#a=n,this.#r=this.options,this.#i=this.#e.state),n}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(n,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#p(e){this.#k();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Hn)),t}#g(){this.#S();const e=Dr(this.options.staleTime,this.#e);if(Vc.isServer()||this.#a.isStale||!py(e))return;const n=DT(this.#a.dataUpdatedAt,e)+1;this.#d=wo.setTimeout(()=>{this.#a.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#c=e,!(Vc.isServer()||Aa(this.options.enabled,this.#e)===!1||!py(this.#c)||this.#c===0)&&(this.#f=wo.setInterval(()=>{(this.options.refetchIntervalInBackground||e0.isFocused())&&this.#p()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(wo.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(wo.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#e,a=this.options,s=this.#a,p=this.#i,f=this.#r,h=e!==n?e.state:this.#n,{state:c}=e;let x={...c},M=!1,C;if(t._optimisticResults){const U=this.hasListeners(),me=!U&&O2(e,t),Me=U&&P2(e,n,t,a);(me||Me)&&(x={...x,...FT(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:E,errorUpdatedAt:R,status:_}=x;C=x.data;let P=!1;if(t.placeholderData!==void 0&&C===void 0&&_==="pending"){let U;s?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(U=s.data,P=!0):U=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,U!==void 0&&(_="success",C=fy(s?.data,U,t),M=!0)}if(t.select&&C!==void 0&&!P)if(s&&C===p?.data&&t.select===this.#u)C=this.#l;else try{this.#u=t.select,C=t.select(C),C=fy(s?.data,C,t),this.#l=C,this.#o=null}catch(U){this.#o=U}this.#o&&(E=this.#o,C=this.#l,R=Date.now(),_="error");const D=x.fetchStatus==="fetching",L=_==="pending",B=_==="error",q=L&&D,G=C!==void 0,V={status:_,fetchStatus:x.fetchStatus,isPending:L,isSuccess:_==="success",isError:B,isInitialLoading:q,isLoading:q,data:C,dataUpdatedAt:x.dataUpdatedAt,error:E,errorUpdatedAt:R,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:x.dataUpdateCount>h.dataUpdateCount||x.errorUpdateCount>h.errorUpdateCount,isFetching:D,isRefetching:D&&!L,isLoadingError:B&&!G,isPaused:x.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:B&&G,isStale:i0(e,t),refetch:this.refetch,promise:this.#s,isEnabled:Aa(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const U=V.data!==void 0,me=V.status==="error"&&!U,Me=Ee=>{me?Ee.reject(V.error):U&&Ee.resolve(V.data)},Ce=()=>{const Ee=this.#s=V.promise=hy();Me(Ee)},Ae=this.#s;switch(Ae.status){case"pending":e.queryHash===n.queryHash&&Me(Ae);break;case"fulfilled":(me||V.data!==Ae.value)&&Ce();break;case"rejected":(!me||V.error!==Ae.reason)&&Ce();break}}return V}updateResult(){const e=this.#a,t=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#e),Qc(t,e))return;this.#a=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!this.#h.size)return!0;const p=new Set(s??this.#h);return this.options.throwOnError&&p.add("error"),Object.keys(this.#a).some(f=>{const m=f;return this.#a[m]!==e[m]&&p.has(m)})};this.#w({listeners:n()})}#k(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function nte(e,t){return Aa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Aa(t.retryOnMount,e)===!1)}function O2(e,t){return nte(e,t)||e.state.data!==void 0&&yy(e,t,t.refetchOnMount)}function yy(e,t,n){if(Aa(t.enabled,e)!==!1&&Dr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&i0(e,t)}return!1}function P2(e,t,n,a){return(e!==t||Aa(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&i0(e,n)}function i0(e,t){return Aa(t.enabled,e)!==!1&&e.isStaleByTime(Dr(t.staleTime,e))}function ate(e,t){return!Qc(e.getCurrentResult(),t)}var HT=class extends cu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,a=super.createResult(e,t),{isFetching:s,isRefetching:p,isError:f,isRefetchError:m}=a,h=n.fetchMeta?.fetchMore?.direction,c=f&&h==="forward",x=s&&h==="forward",M=f&&h==="backward",C=s&&h==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Jee(t,n.data),hasPreviousPage:ete(t,n.data),isFetchNextPageError:c,isFetchingNextPage:x,isFetchPreviousPageError:M,isFetchingPreviousPage:C,isRefetchError:m&&!c&&!M,isRefetching:p&&!x&&!C}}},ite=class extends BT{#t;#e;#n;#a;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||$T(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=qT({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(p,f)=>{this.#i({type:"failed",failureCount:p,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",s=!this.#a.canStart();try{if(a)t();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const f=await this.options.onMutate?.(e,n);f!==this.state.context&&this.#i({type:"pending",context:f,variables:e,isPaused:s})}const p=await this.#a.start();return await this.#n.config.onSuccess?.(p,e,this.state.context,this,n),await this.options.onSuccess?.(p,e,this.state.context,n),await this.#n.config.onSettled?.(p,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(p,null,e,this.state.context,n),this.#i({type:"success",data:p}),p}catch(p){try{await this.#n.config.onError?.(p,e,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onError?.(p,e,this.state.context,n)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,p,this.state.variables,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,p,e,this.state.context,n)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:p}),p}finally{this.#n.runNext(this)}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),pn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function $T(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rte=class extends jo{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const a=new ite({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(a),a}add(e){this.#t.add(e);const t=Qd(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Qd(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const a=n.indexOf(e);a!==-1&&n.splice(a,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Qd(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(s=>s.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Qd(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>R2(t,n))}findAll(e={}){return this.getAll().filter(t=>R2(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Hn))))}};function Qd(e){return e.options.scope?.id}var ote=class extends jo{#t;#e=void 0;#n;#a;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),Qc(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&qr(n.mutationKey)!==qr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#r(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#r()}mutate(t,n){return this.#a=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??$T();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){pn.batch(()=>{if(this.#a&&this.hasListeners()){const n=this.#e.variables,a=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#a.onSuccess?.(t.data,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(t.data,null,n,a,s)}catch(p){Promise.reject(p)}}else if(t?.type==="error"){try{this.#a.onError?.(t.error,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(void 0,t.error,n,a,s)}catch(p){Promise.reject(p)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function j2(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function ste(e,t,n){const a=e.slice(0);return a[t]=n,a}var lte=class extends jo{#t;#e;#n;#a;#i;#r;#s;#o;#u;#l=[];constructor(e,t,n){super(),this.#t=e,this.#a=n,this.#n=[],this.#i=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#h(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#a=t,pn.batch(()=>{const n=this.#i,a=this.#c(this.#n);a.forEach(x=>x.observer.setOptions(x.defaultedQueryOptions));const s=a.map(x=>x.observer),p=s.map(x=>x.getCurrentResult()),f=n.length!==s.length,m=s.some((x,M)=>x!==n[M]),h=f||m,c=h?!0:p.some((x,M)=>{const C=this.#e[M];return!C||!Qc(x,C)});!h&&!c||(h&&(this.#l=a,this.#i=s),this.#e=p,this.hasListeners()&&(h&&(j2(n,s).forEach(x=>{x.destroy()}),j2(s,n).forEach(x=>{x.subscribe(M=>{this.#h(x,M)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){const n=this.#c(e),a=n.map(p=>p.observer.getOptimisticResult(p.defaultedQueryOptions)),s=n.map(p=>p.defaultedQueryOptions.queryHash);return[a,p=>this.#d(p??a,t,s),()=>this.#m(a,n)]}#m(e,t){return t.map((n,a)=>{const s=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,p=>{t.forEach(f=>{f.observer.trackProp(p)})})})}#d(e,t,n){if(t){const a=this.#u,s=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((p,f)=>p!==a[f]));return(!this.#r||this.#e!==this.#o||s||t!==this.#s)&&(this.#s=t,this.#o=this.#e,n!==void 0&&(this.#u=n),this.#r=n0(this.#r,t(e))),this.#r}return e}#f(){return this.#a?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#e[t]?.data===void 0)}#c(e){const t=new Map;this.#i.forEach(a=>{const s=a.options.queryHash;if(!s)return;const p=t.get(s);p?p.push(a):t.set(s,[a])});const n=[];return e.forEach(a=>{const s=this.#t.defaultQueryOptions(a),f=t.get(s.queryHash)?.shift()??new cu(this.#t,s);n.push({defaultedQueryOptions:s,observer:f})}),n}#h(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=ste(this.#e,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#m(this.#e,this.#l),t=this.#f(),n=this.#r,a=t?n:this.#d(e,this.#a?.combine);(t||n!==a)&&pn.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},cte=class extends jo{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,s=t.queryHash??t0(a,t);let p=this.get(s);return p||(p=new tte({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(p)),p}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>E2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>E2(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},QT=class{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e={}){this.#t=e.queryCache||new cte,this.#e=e.mutationCache||new rte,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=e0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=Gp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),p=this.#t.get(a.queryHash)?.state.data,f=Fee(t,p);if(f!==void 0)return this.#t.build(this,a).setData(f,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return pn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=pn.batch(()=>this.#t.findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(Hn).catch(Hn)}invalidateQueries(e,t={}){return pn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=pn.batch(()=>this.#t.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let p=s.fetch(void 0,n);return n.throwOnError||(p=p.catch(Hn)),s.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(a).then(Hn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Hn).catch(Hn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Hn).catch(Hn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Gp.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#a.set(qr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(a=>{$c(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(a=>{$c(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=t0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ea&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},VT=T.createContext(void 0),uu=e=>{const t=T.useContext(VT);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},GT=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(VT.Provider,{value:e,children:t})),ZT=T.createContext(!1),WT=()=>T.useContext(ZT);ZT.Provider;function ute(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dte=T.createContext(ute()),KT=()=>T.useContext(dte),YT=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?a0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},XT=e=>{T.useEffect(()=>{e.clearReset()},[e])},JT=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||a0(n,[e.error,a])),r0=(e,t)=>t.state.data===void 0,e_=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pte=(e,t)=>e.isLoading&&e.isFetching&&!t,by=(e,t)=>e?.suspense&&t.isPending,Sy=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function t_({queries:e,...t},n){const a=uu(n),s=WT(),p=KT(),f=T.useMemo(()=>e.map(_=>{const P=a.defaultQueryOptions(_);return P._optimisticResults=s?"isRestoring":"optimistic",P}),[e,a,s]);f.forEach(_=>{e_(_);const P=a.getQueryCache().get(_.queryHash);YT(_,p,P)}),XT(p);const[m]=T.useState(()=>new lte(a,f,t)),[h,c,x]=m.getOptimisticResult(f,t.combine),M=!s&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(_=>M?m.subscribe(pn.batchCalls(_)):Hn,[m,M]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setQueries(f,t)},[f,t,m]);const E=h.some((_,P)=>by(f[P],_))?h.flatMap((_,P)=>{const D=f[P];if(D&&by(D,_)){const L=new cu(a,D);return Sy(D,L,p)}return[]}):[];if(E.length>0)throw Promise.all(E);const R=h.find((_,P)=>{const D=f[P];return D&&JT({result:_,errorResetBoundary:p,throwOnError:D.throwOnError,query:a.getQueryCache().get(D.queryHash),suspense:D.suspense})});if(R?.error)throw R.error;return c(x())}function Mm(e,t,n){const a=WT(),s=KT(),p=uu(n),f=p.defaultQueryOptions(e);p.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const m=p.getQueryCache().get(f.queryHash),h=e.subscribed!==!1;f._optimisticResults=a?"isRestoring":h?"optimistic":void 0,e_(f),YT(f,s,m),XT(s);const c=!p.getQueryCache().get(f.queryHash),[x]=T.useState(()=>new t(p,f)),M=x.getOptimisticResult(f),C=!a&&h;if(T.useSyncExternalStore(T.useCallback(E=>{const R=C?x.subscribe(pn.batchCalls(E)):Hn;return x.updateResult(),R},[x,C]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),T.useEffect(()=>{x.setOptions(f)},[f,x]),by(f,M))throw Sy(f,x,s);if(JT({result:M,errorResetBoundary:s,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw M.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(f,M),f.experimental_prefetchInRender&&!Vc.isServer()&&pte(M,a)&&(c?Sy(f,x,s):m?.promise)?.catch(Hn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?M:x.trackResult(M)}function mte(e,t){return Mm(e,cu,t)}function fte(e,t){return Mm({...e,enabled:!0,suspense:!0,throwOnError:r0,placeholderData:void 0},cu,t)}function hte(e,t){return Mm({...e,enabled:!0,suspense:!0,throwOnError:r0},HT,t)}function gte(e,t){return t_({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:r0,enabled:!0,placeholderData:void 0}))},t)}function vte(e,t){const n=uu(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function yte(e,t){const n=uu(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function bte(e,t){const n=uu(t),[a]=T.useState(()=>new ote(n,e));T.useEffect(()=>{a.setOptions(e)},[a,e]);const s=T.useSyncExternalStore(T.useCallback(f=>a.subscribe(pn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p=T.useCallback((f,m)=>{a.mutate(f,m).catch(Hn)},[a]);if(s.error&&a0(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:p,mutateAsync:s.mutate}}function Ste(e,t){return Mm(e,HT,t)}var xte=Object.create,n_=Object.defineProperty,kte=Object.getOwnPropertyDescriptor,a_=Object.getOwnPropertyNames,wte=Object.getPrototypeOf,Mte=Object.prototype.hasOwnProperty,Hr=(e,t)=>function(){return t||(0,e[a_(e)[0]])((t={exports:{}}).exports,t),t.exports},Cte=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=a_(t),p=0,f=s.length,m;p<f;p++)m=s[p],!Mte.call(e,m)&&m!==n&&n_(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=kte(t,m))||a.enumerable});return e},Do=(e,t,n)=>(n=e!=null?xte(wte(e)):{},Cte(t||!e||!e.__esModule?n_(n,"default",{value:e,enumerable:!0}):n,e)),Ate=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(a,s){if(a==null)return{};var p={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(s.includes(f))continue;p[f]=a[f]}return p}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ete=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=Ate();function a(s,p){if(s==null)return{};var f,m,h=n(s,p);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(m=0;m<c.length;m++)f=c[m],p.includes(f)||{}.propertyIsEnumerable.call(s,f)&&(h[f]=s[f])}return h}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),i_=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Rte=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=i_().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ite=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=i_().default,a=Rte();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Tte=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Ite();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),du=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Tte();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),_te=Do(Ete(),1),D2=Do(du(),1);const Nte=["cursor","direction"];function di(e,t,n){const a=e.flatMap(s=>s.split("."));if(!t&&(!n||n==="any"))return a.length?[a]:[];if(n==="infinite"&&_o(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:p}=t,f=(0,_te.default)(t,Nte);return[a,{input:f,type:"infinite"}]}return[a,(0,D2.default)((0,D2.default)({},typeof t<"u"&&t!==Ea&&{input:t}),n&&n!=="any"&&{type:n})]}function vp(e){return di(e,void 0,"any")}function Ote(e){return dm(({path:t,args:n})=>{var a;const s=[...t],p=s.pop();if(p==="useMutation")return e[p](s,...n);if(p==="_def")return{path:s};const[f,...m]=n,h=(a=m[0])!==null&&a!==void 0?a:{};return e[p](s,f,h)})}var Tg;const Pte=["client","ssrContext","ssrState","abortOnUnmount"],jte=(Tg=T.createContext)===null||Tg===void 0?void 0:Tg.call(Dee,null),Dte=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function zte(e){return dm(t=>{const n=[...t.path],a=n.pop(),s=[...t.args],p=s.shift(),f=Dte(a),m=di(n,p,f);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,m,s[0]),queryOptions:()=>e.queryOptions(n,m,...s),fetch:()=>e.fetchQuery(m,...s),fetchInfinite:()=>e.fetchInfiniteQuery(m,s[0]),prefetch:()=>e.prefetchQuery(m,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(m,s[0]),ensureData:()=>e.ensureQueryData(m,...s),invalidate:()=>e.invalidateQueries(m,...s),reset:()=>e.resetQueries(m,...s),refetch:()=>e.refetchQueries(m,...s),cancel:()=>e.cancelQuery(m,...s),setData:()=>{e.setQueryData(m,s[0],s[1])},setQueriesData:()=>e.setQueriesData(m,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(m,s[0],s[1])},getData:()=>e.getQueryData(m),getInfiniteData:()=>e.getInfiniteQueryData(m),setMutationDefaults:()=>e.setMutationDefaults(vp(n),p),getMutationDefaults:()=>e.getMutationDefaults(vp(n)),isMutating:()=>e.isMutating({mutationKey:vp(n)})}[a]()})}function Lte(e){const t=cE(e.client),n=zte(e);return ab(a=>{const s=a;return s==="client"?t:Pte.includes(s)?e[s]:n[a]})}var qte=Do(du(),1);function z2(e){const t=e instanceof pm?e:rb(e);return dm(n=>{const a=n.path,s=a.join("."),[p,f]=n.args;return(0,qte.default)({queryKey:di(a,p,"query"),queryFn:()=>t.query(s,p,f?.trpc)},f)})}var _g=Do(du(),1);function Kn(e,t,n){var a;const s=e[0];let p=(a=e[1])===null||a===void 0?void 0:a.input;if(n){var f;p=(0,_g.default)((0,_g.default)((0,_g.default)({},(f=p)!==null&&f!==void 0?f:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.join("."),p,t?.trpc]}var Bte=Hr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ute=Do(Bte(),1);function xy(e){return{path:e.path.join(".")}}function dc(e){const t=xy(e);return T.useMemo(()=>t,[t])}async function r_(e,t,n){const s=t.getQueryCache().build(t,{queryKey:n});s.setState({data:[],status:"success"});const p=[];var f=!1,m=!1,h;try{for(var c=(0,Ute.default)(e),x;f=!(x=await c.next()).done;f=!1){const M=x.value;p.push(M),s.setState({data:[...p]})}}catch(M){m=!0,h=M}finally{try{f&&c.return!=null&&await c.return()}finally{if(m)throw h}}return p}var It=Do(du(),1);function Fte(e){const{client:t,queryClient:n}=e,a=t instanceof pm?t:rb(t);return{infiniteQueryOptions:(s,p,f)=>{var m,h;const c=((m=p[1])===null||m===void 0?void 0:m.input)===Ea,x=async M=>{var C;const E=(0,It.default)((0,It.default)({},f),{},{trpc:(0,It.default)((0,It.default)({},f?.trpc),!(f==null||(C=f.trpc)===null||C===void 0)&&C.abortOnUnmount?{signal:M.signal}:{signal:null})});return await a.query(...Kn(p,E,{direction:M.direction,pageParam:M.pageParam}))};return Object.assign((0,It.default)((0,It.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:c?Ea:x,initialPageParam:(h=f?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:xy({path:s})})},queryOptions:(s,p,f)=>{var m;const h=((m=p[1])===null||m===void 0?void 0:m.input)===Ea,c=async x=>{var M;const C=(0,It.default)((0,It.default)({},f),{},{trpc:(0,It.default)((0,It.default)({},f?.trpc),!(f==null||(M=f.trpc)===null||M===void 0)&&M.abortOnUnmount?{signal:x.signal}:{signal:null})}),E=await a.query(...Kn(p,C));return ZA(E)?r_(E,n,p):E};return Object.assign((0,It.default)((0,It.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:h?Ea:c}),{trpc:xy({path:s})})},fetchQuery:(s,p)=>n.fetchQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...Kn(s,p))})),fetchInfiniteQuery:(s,p)=>{var f;return n.fetchInfiniteQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...Kn(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},prefetchQuery:(s,p)=>n.prefetchQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...Kn(s,p))})),prefetchInfiniteQuery:(s,p)=>{var f;return n.prefetchInfiniteQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...Kn(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},ensureQueryData:(s,p)=>n.ensureQueryData((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...Kn(s,p))})),invalidateQueries:(s,p,f)=>n.invalidateQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),resetQueries:(s,p,f)=>n.resetQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),refetchQueries:(s,p,f)=>n.refetchQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),cancelQuery:(s,p)=>n.cancelQueries({queryKey:s},p),setQueryData:(s,p,f)=>n.setQueryData(s,p,f),setQueriesData:(s,p,f,m)=>n.setQueriesData((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f,m),getQueryData:s=>n.getQueryData(s),setInfiniteQueryData:(s,p,f)=>n.setQueryData(s,p,f),getInfiniteQueryData:s=>n.getQueryData(s),setMutationDefaults:(s,p)=>{const f=s[0],m=h=>a.mutation(...Kn([f,{input:h}],e));return n.setMutationDefaults(s,typeof p=="function"?p({canonicalMutationFn:m}):p)},getMutationDefaults:s=>n.getMutationDefaults(s),isMutating:s=>n.isMutating((0,It.default)((0,It.default)({},s),{},{exact:!0}))}}var _e=Do(du());const L2=(e,t)=>new Proxy(e,{get(a,s){return t(s),a[s]}});function Hte(e){var t,n;const a=(t=void 0)!==null&&t!==void 0?t:G=>G.originalFn(),s=(n=void 0)!==null&&n!==void 0?n:jte,p=wv,f=G=>{var ne;const{abortOnUnmount:V=!1,queryClient:U,ssrContext:me}=G,[Me,Ce]=T.useState((ne=G.ssrState)!==null&&ne!==void 0?ne:!1),Ae=G.client instanceof pm?G.client:rb(G.client),Ee=T.useMemo(()=>Fte({client:Ae,queryClient:U}),[Ae,U]),re=T.useMemo(()=>(0,_e.default)({abortOnUnmount:V,queryClient:U,client:Ae,ssrContext:me??null,ssrState:Me},Ee),[V,Ae,Ee,U,me,Me]);return T.useEffect(()=>{Ce(Te=>Te?"mounted":!1)},[]),v.jsx(s.Provider,{value:re,children:G.children})};function m(){const G=T.useContext(s);if(!G)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return G}function h(G,ne){var V;const{queryClient:U,ssrState:me}=m();return me&&me!=="mounted"&&((V=U.getQueryCache().find({queryKey:G}))===null||V===void 0?void 0:V.state.status)==="error"?(0,_e.default)({retryOnMount:!1},ne):ne}function c(G,ne,V){var U,me,Me,Ce,Ae;const Ee=m(),{abortOnUnmount:re,client:Te,ssrState:$,queryClient:ue,prefetchQuery:ke}=Ee,Ie=di(G,ne,"query"),ge=ue.getQueryDefaults(Ie),z=ne===Ea;typeof window>"u"&&$==="prepass"&&(V==null||(U=V.trpc)===null||U===void 0?void 0:U.ssr)!==!1&&((me=V?.enabled)!==null&&me!==void 0?me:ge?.enabled)!==!1&&!z&&!ue.getQueryCache().find({queryKey:Ie})&&ke(Ie,V);const ae=h(Ie,(0,_e.default)((0,_e.default)({},ge),V)),de=(Me=(Ce=V==null||(Ae=V.trpc)===null||Ae===void 0?void 0:Ae.abortOnUnmount)!==null&&Ce!==void 0?Ce:void 0)!==null&&Me!==void 0?Me:re,Se=mte((0,_e.default)((0,_e.default)({},ae),{},{queryKey:Ie,queryFn:z?ne:async J=>{const he=(0,_e.default)((0,_e.default)({},ae),{},{trpc:(0,_e.default)((0,_e.default)({},ae?.trpc),de?{signal:J.signal}:{signal:null})}),De=await Te.query(...Kn(Ie,he));return ZA(De)?r_(De,ue,Ie):De}}),ue);return Se.trpc=dc({path:G}),Se}function x(G,ne,V){var U,me,Me;const Ce=m(),Ae=di(G,ne,"query"),Ee=ne===Ea,re=(U=(me=V==null||(Me=V.trpc)===null||Me===void 0?void 0:Me.abortOnUnmount)!==null&&me!==void 0?me:void 0)!==null&&U!==void 0?U:Ce.abortOnUnmount;vte((0,_e.default)((0,_e.default)({},V),{},{queryKey:Ae,queryFn:Ee?ne:Te=>{const $={trpc:(0,_e.default)((0,_e.default)({},V?.trpc),re?{signal:Te.signal}:{})};return Ce.client.query(...Kn(Ae,$))}}))}function M(G,ne,V){var U,me,Me;const Ce=m(),Ae=di(G,ne,"query"),Ee=(U=(me=V==null||(Me=V.trpc)===null||Me===void 0?void 0:Me.abortOnUnmount)!==null&&me!==void 0?me:void 0)!==null&&U!==void 0?U:Ce.abortOnUnmount,re=fte((0,_e.default)((0,_e.default)({},V),{},{queryKey:Ae,queryFn:Te=>{const $=(0,_e.default)((0,_e.default)({},V),{},{trpc:(0,_e.default)((0,_e.default)({},V?.trpc),Ee?{signal:Te.signal}:{signal:null})});return Ce.client.query(...Kn(Ae,$))}}),Ce.queryClient);return re.trpc=dc({path:G}),[re.data,re]}function C(G,ne){const{client:V,queryClient:U}=m(),me=vp(G),Me=U.defaultMutationOptions(U.getMutationDefaults(me)),Ce=bte((0,_e.default)((0,_e.default)({},ne),{},{mutationKey:me,mutationFn:Ae=>V.mutation(...Kn([G,{input:Ae}],ne)),onSuccess(...Ae){var Ee,re;return a({originalFn:()=>{var $,ue,ke;return($=ne==null||(ue=ne.onSuccess)===null||ue===void 0?void 0:ue.call(ne,...Ae))!==null&&$!==void 0?$:Me==null||(ke=Me.onSuccess)===null||ke===void 0?void 0:ke.call(Me,...Ae)},queryClient:U,meta:(Ee=(re=ne?.meta)!==null&&re!==void 0?re:Me?.meta)!==null&&Ee!==void 0?Ee:{}})}}),U);return Ce.trpc=dc({path:G}),Ce}const E={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};function _(G,ne,V){var U;const me=(U=V?.enabled)!==null&&U!==void 0?U:ne!==Ea,Me=qr(di(G,ne,"any")),{client:Ce}=m(),Ae=T.useRef(V);T.useEffect(()=>{Ae.current=V});const[Ee]=T.useState(new Set([])),re=T.useCallback(z=>{Ee.add(z)},[Ee]),Te=T.useRef(null),$=T.useCallback(z=>{const ae=ke.current,de=ke.current=z(ae);let Se=!1;for(const J of Ee)if(ae[J]!==de[J]){Se=!0;break}Se&&ge(L2(de,re))},[re,Ee]),ue=T.useCallback(()=>{var z;if((z=Te.current)===null||z===void 0||z.unsubscribe(),!me){$(()=>(0,_e.default)((0,_e.default)({},E),{},{reset:ue}));return}$(()=>(0,_e.default)((0,_e.default)({},R),{},{reset:ue}));const ae=Ce.subscription(G.join("."),ne??void 0,{onStarted:()=>{var de,Se;(de=(Se=Ae.current).onStarted)===null||de===void 0||de.call(Se),$(J=>(0,_e.default)((0,_e.default)({},J),{},{status:"pending",error:null}))},onData:de=>{var Se,J;(Se=(J=Ae.current).onData)===null||Se===void 0||Se.call(J,de),$(he=>(0,_e.default)((0,_e.default)({},he),{},{status:"pending",data:de,error:null}))},onError:de=>{var Se,J;(Se=(J=Ae.current).onError)===null||Se===void 0||Se.call(J,de),$(he=>(0,_e.default)((0,_e.default)({},he),{},{status:"error",error:de}))},onConnectionStateChange:de=>{$(Se=>{switch(de.state){case"idle":return(0,_e.default)((0,_e.default)({},Se),{},{status:de.state,error:null,data:void 0});case"connecting":return(0,_e.default)((0,_e.default)({},Se),{},{error:de.error,status:de.state});case"pending":return Se}})},onComplete:()=>{var de,Se;(de=(Se=Ae.current).onComplete)===null||de===void 0||de.call(Se),$(J=>(0,_e.default)((0,_e.default)({},J),{},{status:"idle",error:null,data:void 0}))}});Te.current=ae},[Ce,Me,me,$]);T.useEffect(()=>(ue(),()=>{var z;(z=Te.current)===null||z===void 0||z.unsubscribe()}),[ue]);const ke=T.useRef(me?(0,_e.default)((0,_e.default)({},R),{},{reset:ue}):(0,_e.default)((0,_e.default)({},E),{},{reset:ue})),[Ie,ge]=T.useState(L2(ke.current,re));return Ie}function P(G,ne,V){var U,me,Me,Ce,Ae;const{client:Ee,ssrState:re,prefetchInfiniteQuery:Te,queryClient:$,abortOnUnmount:ue}=m(),ke=di(G,ne,"infinite"),Ie=$.getQueryDefaults(ke),ge=ne===Ea;typeof window>"u"&&re==="prepass"&&(V==null||(U=V.trpc)===null||U===void 0?void 0:U.ssr)!==!1&&((me=V?.enabled)!==null&&me!==void 0?me:Ie?.enabled)!==!1&&!ge&&!$.getQueryCache().find({queryKey:ke})&&Te(ke,(0,_e.default)((0,_e.default)({},Ie),V));const z=h(ke,(0,_e.default)((0,_e.default)({},Ie),V)),ae=(Me=V==null||(Ce=V.trpc)===null||Ce===void 0?void 0:Ce.abortOnUnmount)!==null&&Me!==void 0?Me:ue,de=Ste((0,_e.default)((0,_e.default)({},z),{},{initialPageParam:(Ae=V.initialCursor)!==null&&Ae!==void 0?Ae:null,persister:V.persister,queryKey:ke,queryFn:ge?ne:Se=>{var J;const he=(0,_e.default)((0,_e.default)({},z),{},{trpc:(0,_e.default)((0,_e.default)({},z?.trpc),ae?{signal:Se.signal}:{signal:null})});return Ee.query(...Kn(ke,he,{pageParam:(J=Se.pageParam)!==null&&J!==void 0?J:V.initialCursor,direction:Se.direction}))}}),$);return de.trpc=dc({path:G}),de}function D(G,ne,V){var U,me,Me;const Ce=m(),Ae=di(G,ne,"infinite"),Ee=Ce.queryClient.getQueryDefaults(Ae),re=ne===Ea,Te=h(Ae,(0,_e.default)((0,_e.default)({},Ee),V)),$=(U=V==null||(me=V.trpc)===null||me===void 0?void 0:me.abortOnUnmount)!==null&&U!==void 0?U:Ce.abortOnUnmount;yte((0,_e.default)((0,_e.default)({},V),{},{initialPageParam:(Me=V.initialCursor)!==null&&Me!==void 0?Me:null,queryKey:Ae,queryFn:re?ne:ue=>{var ke;const Ie=(0,_e.default)((0,_e.default)({},Te),{},{trpc:(0,_e.default)((0,_e.default)({},Te?.trpc),$?{signal:ue.signal}:{})});return Ce.client.query(...Kn(Ae,Ie,{pageParam:(ke=ue.pageParam)!==null&&ke!==void 0?ke:V.initialCursor,direction:ue.direction}))}}))}function L(G,ne,V){var U,me,Me;const Ce=m(),Ae=di(G,ne,"infinite"),Ee=Ce.queryClient.getQueryDefaults(Ae),re=h(Ae,(0,_e.default)((0,_e.default)({},Ee),V)),Te=(U=V==null||(me=V.trpc)===null||me===void 0?void 0:me.abortOnUnmount)!==null&&U!==void 0?U:Ce.abortOnUnmount,$=hte((0,_e.default)((0,_e.default)({},V),{},{initialPageParam:(Me=V.initialCursor)!==null&&Me!==void 0?Me:null,queryKey:Ae,queryFn:ue=>{var ke;const Ie=(0,_e.default)((0,_e.default)({},re),{},{trpc:(0,_e.default)((0,_e.default)({},re?.trpc),Te?{signal:ue.signal}:{})});return Ce.client.query(...Kn(Ae,Ie,{pageParam:(ke=ue.pageParam)!==null&&ke!==void 0?ke:V.initialCursor,direction:ue.direction}))}}),Ce.queryClient);return $.trpc=dc({path:G}),[$.data,$]}return{Provider:f,createClient:p,useContext:m,useUtils:m,useQuery:c,usePrefetchQuery:x,useSuspenseQuery:M,useQueries:(G,ne)=>{const{ssrState:V,queryClient:U,prefetchQuery:me,client:Me}=m(),Ce=z2(Me),Ae=G(Ce);if(typeof window>"u"&&V==="prepass")for(const re of Ae){var Ee;const Te=re;((Ee=Te.trpc)===null||Ee===void 0?void 0:Ee.ssr)!==!1&&!U.getQueryCache().find({queryKey:Te.queryKey})&&me(Te.queryKey,Te)}return t_({queries:Ae.map(re=>(0,_e.default)((0,_e.default)({},re),{},{queryKey:re.queryKey})),combine:ne?.combine},U)},useSuspenseQueries:G=>{const{queryClient:ne,client:V}=m(),U=z2(V),me=G(U),Me=gte({queries:me.map(Ce=>(0,_e.default)((0,_e.default)({},Ce),{},{queryFn:Ce.queryFn,queryKey:Ce.queryKey}))},ne);return[Me.map(Ce=>Ce.data),Me]},useMutation:C,useSubscription:_,useInfiniteQuery:P,usePrefetchInfiniteQuery:D,useSuspenseInfiniteQuery:L}}function $te(e){const t=Ote(e);return ab(n=>n==="useContext"||n==="useUtils"?()=>{const a=e.useUtils();return T.useMemo(()=>Lte(a),[a])}:e.hasOwnProperty(n)?e[n]:t[n])}function Qte(e){const t=Hte();return $te(t)}HA();var Ng={};var o_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();var Vte=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Gte=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());var q2=e=>{const t=Gte(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Zte={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Wte=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Kte=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...Zte,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:o_("lucide",s),...!p&&!Wte(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));var W=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Kte,{ref:p,iconNode:t,className:o_(`lucide-${Vte(q2(e))}`,`lucide-${e}`,a),...s}));return n.displayName=q2(e),n};var s_=W("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var Yte=W("air-vent",[["path",{d:"M18 17.5a2.5 2.5 0 1 1-4 2.03V12",key:"yd12zl"}],["path",{d:"M6 12H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"larmp2"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"M6.6 15.572A2 2 0 1 0 10 17v-5",key:"1x1kqn"}]]);var Xte=W("alarm-smoke",[["path",{d:"M11 21c0-2.5 2-2.5 2-5",key:"1sicvv"}],["path",{d:"M16 21c0-2.5 2-2.5 2-5",key:"1o3eny"}],["path",{d:"m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8",key:"1bvca4"}],["path",{d:"M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z",key:"x3qr1j"}],["path",{d:"M6 21c0-2.5 2-2.5 2-5",key:"i3w1gp"}]]);W("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);W("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);W("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);W("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);W("arrow-up-to-line",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]);W("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var Jte=W("baby",[["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"11xh7x"}],["path",{d:"M9 12h.01",key:"157uk2"}]]);var ky=W("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var ene=W("bath",[["path",{d:"M10 4 8 6",key:"1rru8s"}],["path",{d:"M17 19v2",key:"ts1sot"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M7 19v2",key:"12npes"}],["path",{d:"M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5",key:"14ym8i"}]]);W("battery-full",[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);W("battery-low",[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);var Zp=W("battery-medium",[["path",{d:"M10 14v-4",key:"suye4c"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);var tne=W("battery-warning",[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]]);W("battery",[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);var Og=W("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]);var Wp=W("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var B2=W("bike",[["circle",{cx:"18.5",cy:"17.5",r:"3.5",key:"15x4ox"}],["circle",{cx:"5.5",cy:"17.5",r:"3.5",key:"1noe27"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["path",{d:"M12 17.5V14l-3-3 4-3 2 3h2",key:"1npguv"}]]);var U2=W("bird",[["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20",key:"oj1oa8"}],["path",{d:"m20 7 2 .5-2 .5",key:"12nv4d"}],["path",{d:"M10 18v3",key:"1yea0a"}],["path",{d:"M14 17.75V21",key:"1pymcb"}],["path",{d:"M7 18a6 6 0 0 0 3.84-10.61",key:"1npnn0"}]]);var nne=W("blinds",[["path",{d:"M3 3h18",key:"o7r712"}],["path",{d:"M20 7H8",key:"gd2fo2"}],["path",{d:"M20 11H8",key:"1ynp89"}],["path",{d:"M10 19h10",key:"19hjk5"}],["path",{d:"M8 15h12",key:"1yqzne"}],["path",{d:"M4 3v14",key:"fggqzn"}],["circle",{cx:"4",cy:"19",r:"2",key:"p3m9r0"}]]);var ane=W("bone",[["path",{d:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",key:"w610uw"}]]);var ine=W("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var F2=W("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);W("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);var rne=W("bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);var one=W("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var Pg=W("car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);W("cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]);var H2=W("cat",[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]);var l_=W("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var zo=W("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);W("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var sne=W("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Cm=W("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);W("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);W("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);W("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);W("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var lne=W("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var c_=W("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);W("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);W("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);W("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var cne=W("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);W("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var $2=W("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var une=W("cloud-fog",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 17H7",key:"pygtm1"}],["path",{d:"M17 21H9",key:"1u2q02"}]]);var dne=W("cloud-lightning",[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]]);var u_=W("cloud-rain",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]);var Q2=W("cloud-snow",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]]);var d_=W("cloud-sun",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]]);var pne=W("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);var mne=W("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]);W("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);W("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);W("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var p_=W("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);W("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var V2=W("dog",[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]]);var fne=W("door-closed",[["path",{d:"M10 12h.01",key:"1kxr2c"}],["path",{d:"M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14",key:"36qu9e"}],["path",{d:"M2 20h20",key:"owomy5"}]]);var il=W("door-open",[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]]);var m_=W("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var o0=W("droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);var pl=W("droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);W("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);W("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var hne=W("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);W("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var Kp=W("fan",[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]);var gne=W("feather",[["path",{d:"M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z",key:"18jl4k"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.5 15H9",key:"1oz8nu"}]]);W("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);var Yp=W("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]);var vne=W("flashlight",[["path",{d:"M12 13v1",key:"176q98"}],["path",{d:"M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z",key:"17vh7j"}],["path",{d:"M6 6h12",key:"n6hhss"}]]);var yne=W("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var f_=W("footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);W("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);W("gamepad-2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]);var yp=W("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);W("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);var bne=W("hammer",[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]);W("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var Sne=W("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);var Am=W("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);var h_=W("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);var xne=W("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);W("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);W("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var kne=W("laugh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z",key:"b2q4dd"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);W("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var wne=W("leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);var Em=W("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);W("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var Mne=W("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);var Cne=W("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var s0=W("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);W("locate-fixed",[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var wy=W("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);var pu=W("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var Ane=W("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);var Ene=W("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);W("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);var g_=W("megaphone",[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]);W("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var v_=W("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);var Oge=W("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);W("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);W("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var Rne=W("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var l0=W("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var y_=W("mouse-pointer-click",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);var Ine=W("move-horizontal",[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]]);var Tne=W("move-vertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);W("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var b_=W("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);var _ne=W("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var Nne=W("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);var One=W("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var mu=W("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);var Ca=W("paw-print",[["circle",{cx:"11",cy:"4",r:"2",key:"vol9p0"}],["circle",{cx:"18",cy:"8",r:"2",key:"17gozi"}],["circle",{cx:"20",cy:"16",r:"2",key:"1v9bxh"}],["path",{d:"M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z",key:"1ydw1z"}]]);W("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var Pne=W("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);var jne=W("pipette",[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]);var Dne=W("plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);var Lo=W("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);W("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);W("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]);W("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var fu=W("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);W("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);var S_=W("radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);var zne=W("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var c0=W("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var Lne=W("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);W("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var qne=W("sailboat",[["path",{d:"M10 2v15",key:"1qf71f"}],["path",{d:"M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z",key:"1pxcvx"}],["path",{d:"M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z",key:"5oog16"}]]);W("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);W("scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);var Bne=W("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);W("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);W("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);W("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);W("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var Rm=W("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var Une=W("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var Fne=W("shield-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);var Hne=W("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);W("ship",[["path",{d:"M12 10.189V14",key:"1p8cqu"}],["path",{d:"M12 2v3",key:"qbqxhf"}],["path",{d:"M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6",key:"qpkstq"}],["path",{d:"M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76",key:"7tigtc"}],["path",{d:"M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"1924j5"}]]);var Xp=W("siren",[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6",key:"pcx96s"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z",key:"1b4s83"}],["path",{d:"M21 12h1",key:"jtio3y"}],["path",{d:"M18.5 4.5 18 5",key:"g5sp9y"}],["path",{d:"M2 12h1",key:"1uaihz"}],["path",{d:"M12 2v1",key:"11qlp1"}],["path",{d:"m4.929 4.929.707.707",key:"1i51kw"}],["path",{d:"M12 12v6",key:"3ahymv"}]]);var $ne=W("skip-back",[["path",{d:"M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z",key:"15892j"}],["path",{d:"M3 20V4",key:"1ptbpl"}]]);var Qne=W("skip-forward",[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]);var u0=W("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var Vne=W("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var x_=W("snowflake",[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]]);var k_=W("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var Gne=W("sprout",[["path",{d:"M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3",key:"139s4v"}],["path",{d:"M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4",key:"1dlkgp"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var hu=W("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);W("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var Zne=W("sun-medium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);var w_=W("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var Wne=W("sunrise",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);W("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);var M_=W("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);W("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var Im=W("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var My=W("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);var Kne=W("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);var Yne=W("tractor",[["path",{d:"m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20",key:"she1j9"}],["path",{d:"M16 18h-5",key:"bq60fd"}],["path",{d:"M18 5a1 1 0 0 0-1 1v5.573",key:"1kv8ia"}],["path",{d:"M3 4h8.129a1 1 0 0 1 .99.863L13 11.246",key:"1q1ert"}],["path",{d:"M4 11V4",key:"9ft8pt"}],["path",{d:"M7 15h.01",key:"k5ht0j"}],["path",{d:"M8 10.1V4",key:"1jgyzo"}],["circle",{cx:"18",cy:"18",r:"2",key:"1emm8v"}],["circle",{cx:"7",cy:"15",r:"5",key:"ddtuc"}]]);var Xne=W("train-front",[["path",{d:"M8 3.1V7a4 4 0 0 0 8 0V3.1",key:"1v71zp"}],["path",{d:"m9 15-1-1",key:"1yrq24"}],["path",{d:"m15 15 1-1",key:"1t0d6s"}],["path",{d:"M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z",key:"1p0hjs"}],["path",{d:"m8 19-2 3",key:"13i0xs"}],["path",{d:"m16 19 2 3",key:"xo31yx"}]]);var Jne=W("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);W("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);W("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var rl=W("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var eae=W("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);var tae=W("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);W("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]);W("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var nae=W("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var aae=W("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var iae=W("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var G2=W("utensils-crossed",[["path",{d:"m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8",key:"n7qcjb"}],["path",{d:"M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7",key:"d0u48b"}],["path",{d:"m2.1 21.8 6.4-6.3",key:"yn04lh"}],["path",{d:"m19 5-7 7",key:"194lzd"}]]);var C_=W("vibrate",[["path",{d:"m2 8 2 2-2 2 2 2-2 2",key:"sv1b1"}],["path",{d:"m22 8-2 2 2 2-2 2 2 2",key:"101i4y"}],["rect",{width:"8",height:"14",x:"8",y:"5",rx:"1",key:"1oyrl4"}]]);var gu=W("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);var A_=W("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var rae=W("waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);var Z2=W("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var oae=W("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var Gi=W("wind",[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]]);var sae=W("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);W("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);var lae=W("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Pr=W("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var cae=W("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var uae=W("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),E_=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,b=E_??Qte();typeof globalThis<"u"&&!E_&&(globalThis.__camstackTrpcReact=b);function hi(e,t){if(typeof globalThis>"u")return T.createContext(t);const n=globalThis.__camstackSharedContexts,a=n??new Map;n||(globalThis.__camstackSharedContexts=a);const s=a.get(e);if(s)return s;const p=T.createContext(t);return a.set(e,p),p}var R_=hi("camstack:system",null);function I_({system:e,children:t}){return v.jsx(R_.Provider,{value:e,children:t})}function dae(){const e=T.useContext(R_);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function mi(e,t){const n=dae(),a=T.useRef(t);a.current=t;const[s,p]=T.useState(n.connectionVersion);T.useEffect(()=>n.subscribeConnectionEvents((f,m)=>{f==="connected"&&p(m)}),[n]),T.useEffect(()=>n.subscribeEvent(e,f=>{a.current(f)}),[n,e,s])}b.accessories.setChildHidden.useMutation;b.accessories.getStatus.useQuery;b.addonPages.listPages.useQuery;b.addons.list.useQuery;b.addons.getLogs.useQuery;b.addons.listPackages.useQuery;b.addons.installPackage.useMutation;b.addons.installFromWorkspace.useMutation;b.addons.isWorkspaceAvailable.useQuery;b.addons.listWorkspacePackages.useQuery;b.addons.uninstallPackage.useMutation;b.addons.reloadPackages.useMutation;b.addons.searchAvailable.useQuery;b.addons.listUpdates.useQuery;b.addons.updatePackage.useMutation;b.addons.rollbackPackage.useMutation;b.addons.forceRefresh.useMutation;b.addons.restartServer.useMutation;b.addons.getLastRestart.useQuery;b.addons.listFrameworkPackages.useQuery;b.addons.listCapabilityProviders.useQuery;b.addons.setCapabilityProviderEnabled.useMutation;b.addons.getVersions.useQuery;b.addons.restartAddon.useMutation;b.addons.retryLoad.useMutation;b.addons.getAutoUpdateSettings.useQuery;b.addons.setAutoUpdateSettings.useMutation;b.addons.getAddonAutoUpdate.useQuery;b.addons.setAddonAutoUpdate.useMutation;b.addons.applyAutoUpdateToAll.useMutation;b.addons.custom.useMutation;b.addons.startJob.useMutation;b.addons.getJob.useQuery;b.addons.listJobs.useQuery;b.addons.cancelJob.useMutation;b.addons.onAddonLogs.useSubscription;b.addonSettings.getGlobalSettings.useQuery;b.addonSettings.updateGlobalSettings.useMutation;b.addonSettings.getIntegrationSettings.useQuery;b.addonSettings.getDeviceSettings.useQuery;b.addonSettings.updateDeviceSettings.useMutation;b.addonWidgets.listWidgets.useQuery;b.airQualitySensor.getStatus.useQuery;b.alarmPanel.arm.useMutation;b.alarmPanel.disarm.useMutation;b.alarmPanel.trigger.useMutation;b.alarmPanel.getStatus.useQuery;b.alerts.emit.useMutation;b.alerts.update.useMutation;b.alerts.list.useQuery;b.alerts.getUnreadCount.useQuery;b.alerts.markRead.useMutation;b.alerts.markAllRead.useMutation;b.alerts.dismiss.useMutation;b.ambientLightSensor.getStatus.useQuery;b.audioAnalysis.resolveDeviceSettings.useQuery;b.audioAnalysis.getDeviceSettingsContribution.useQuery;b.audioAnalysis.getDeviceLiveContribution.useQuery;b.audioAnalysis.applyDeviceSettingsPatch.useMutation;b.audioAnalyzer.analyseChunk.useMutation;b.audioAnalyzer.classify.useQuery;b.audioAnalyzer.isReady.useQuery;b.audioAnalyzer.dispose.useMutation;b.audioAnalyzer.reprobeAudioEngine.useMutation;b.audioCodec.listSupportedCodecs.useQuery;b.audioCodec.canHandle.useQuery;b.audioCodec.createDecodeSession.useMutation;b.audioCodec.createEncodeSession.useMutation;b.audioCodec.closeSession.useMutation;b.audioCodec.pushEncodedFrame.useMutation;b.audioCodec.pullPcm.useQuery;b.audioCodec.pushPcm.useMutation;b.audioCodec.pullEncoded.useQuery;b.audioCodec.flushEncode.useMutation;b.audioCodec.listActiveSessions.useQuery;b.audioMetrics.getCurrentSnapshot.useQuery;b.audioMetrics.getHistory.useQuery;b.automationControl.enable.useMutation;b.automationControl.disable.useMutation;b.automationControl.trigger.useMutation;b.automationControl.getStatus.useQuery;b.backup.listDestinations.useQuery;b.backup.trigger.useMutation;b.backup.list.useQuery;b.backup.listLocations.useQuery;b.backup.getEntries.useQuery;b.backup.restore.useMutation;b.backup.delete.useMutation;b.backup.listArchives.useQuery;b.backup.upsertDestinationPolicy.useMutation;b.backup.previewSchedule.useQuery;b.backup.listSchedules.useQuery;b.backup.upsertSchedule.useMutation;b.backup.deleteSchedule.useMutation;b.battery.wakeForStream.useMutation;b.battery.getStatus.useQuery;b.binary.getStatus.useQuery;b.brightness.setBrightness.useMutation;b.brightness.getStatus.useQuery;b.broker.list.useQuery;b.broker.get.useQuery;b.broker.listProviders.useQuery;b.broker.add.useMutation;b.broker.remove.useMutation;b.broker.testConnection.useMutation;b.broker.getSettings.useQuery;b.broker.setSettings.useMutation;b.broker.getBrokerConfig.useQuery;b.broker.getSettingsSchema.useQuery;b.broker.testSettings.useMutation;b.broker.publish.useMutation;b.broker.subscribe.useMutation;b.broker.unsubscribe.useMutation;b.broker.getState.useQuery;b.broker.getStatus.useQuery;b.button.press.useMutation;b.cameraCredentials.getCredentials.useQuery;b.cameraCredentials.getStatus.useQuery;b.cameraPipelineConfig.getDeviceSettingsContribution.useQuery;b.cameraPipelineConfig.getDeviceLiveContribution.useQuery;b.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation;b.cameraStreams.getCameraStreams.useQuery;b.cameraStreams.getBrokerStreams.useQuery;b.cameraStreams.getRtspEntries.useQuery;b.cameraStreams.getProfileRtspEntries.useQuery;b.cameraStreams.pickStream.useQuery;b.carbonMonoxide.getStatus.useQuery;b.climateControl.setMode.useMutation;b.climateControl.setFanMode.useMutation;b.climateControl.setPreset.useMutation;b.climateControl.setTarget.useMutation;b.climateControl.setTargetRange.useMutation;b.climateControl.setTargetHumidity.useMutation;b.climateControl.setSwingVertical.useMutation;b.climateControl.setSwingHorizontal.useMutation;b.climateControl.getStatus.useQuery;b.color.setColor.useMutation;b.color.getStatus.useQuery;b.connectionTest.testSettings.useMutation;b.connectionTest.describeTest.useQuery;b.connectivity.getStatus.useQuery;b.consumables.reset.useMutation;b.consumables.getStatus.useQuery;b.contact.getStatus.useQuery;b.control.setValue.useMutation;b.control.getStatus.useQuery;b.coreBlocks.list.useQuery;b.coreBlocks.get.useQuery;b.coreBlocks.create.useMutation;b.coreBlocks.update.useMutation;b.coreBlocks.delete.useMutation;b.coreBlocks.setEnabled.useMutation;b.coreBlocks.restart.useMutation;b.coreBlocks.compile.useMutation;b.coreBlocks.getTypeDefs.useQuery;b.cover.open.useMutation;b.cover.close.useMutation;b.cover.stop.useMutation;b.cover.setPosition.useMutation;b.cover.setTiltPosition.useMutation;b.cover.getStatus.useQuery;b.dayNight.getOptions.useQuery;b.dayNight.setSettings.useMutation;b.dayNight.getStatus.useQuery;b.decoder.supportsCodec.useQuery;b.decoder.getInfo.useQuery;b.decoder.createSession.useQuery;b.decoder.destroySession.useQuery;b.decoder.pushPacket.useQuery;b.decoder.openStream.useQuery;b.decoder.pullFrames.useQuery;b.decoder.pullHandles.useQuery;b.decoder.getFrame.useQuery;b.decoder.getShmStats.useQuery;b.decoder.updateConfig.useQuery;b.decoder.getStats.useQuery;b.decoder.listActiveSessions.useQuery;b.decoder.reprobeHwaccel.useMutation;b.detectionPipeline.getDeviceSettingsContribution.useQuery;b.detectionPipeline.getDeviceLiveContribution.useQuery;b.detectionPipeline.applyDeviceSettingsPatch.useMutation;b.deviceAdoption.listCandidateFilters.useQuery;b.deviceAdoption.listCandidates.useQuery;b.deviceAdoption.getCandidate.useQuery;b.deviceAdoption.refresh.useMutation;b.deviceAdoption.adopt.useMutation;b.deviceAdoption.release.useMutation;b.deviceAdoption.resync.useMutation;b.deviceAdoption.getStatus.useQuery;b.deviceDiscovery.listDiscovered.useQuery;b.deviceDiscovery.refreshDiscovery.useMutation;b.deviceDiscovery.adoptDevice.useMutation;b.deviceDiscovery.releaseDevice.useMutation;b.deviceDiscovery.getStatus.useQuery;b.deviceExport.getStatus.useQuery;b.deviceExport.listSupportedDeviceKinds.useQuery;b.deviceExport.listExposedDevices.useQuery;b.deviceExport.exposeDevice.useMutation;b.deviceExport.unexposeDevice.useMutation;b.deviceExport.getDeviceSettingsContribution.useQuery;b.deviceExport.getDeviceLiveContribution.useQuery;b.deviceExport.applyDeviceSettingsPatch.useMutation;b.deviceManager.allocateDeviceId.useMutation;b.deviceManager.registerDevice.useMutation;b.deviceManager.removeDevice.useMutation;b.deviceManager.persistConfig.useMutation;b.deviceManager.loadConfig.useQuery;b.deviceManager.loadRuntimeState.useQuery;b.deviceManager.loadMeta.useQuery;b.deviceManager.setName.useMutation;b.deviceManager.setLocation.useMutation;b.deviceManager.setType.useMutation;b.deviceManager.setIntegrationId.useMutation;b.deviceManager.setLinkDeviceId.useMutation;b.deviceManager.setPrimaryChildEntityId.useMutation;b.deviceManager.setChildLayout.useMutation;b.deviceManager.setDisplay.useMutation;var T_=b.deviceManager.getRoleDisplayDefaults.useQuery;b.deviceManager.setRoleDisplayDefaults.useMutation;b.deviceManager.getWireableFields.useQuery;b.deviceManager.setRole.useMutation;b.deviceManager.applyInitialMeta.useMutation;b.deviceManager.setMetadata.useMutation;b.deviceManager.listLocations.useQuery;b.deviceManager.addLocation.useMutation;b.deviceManager.removeLocation.useMutation;b.deviceManager.renameLocation.useMutation;b.deviceManager.setDisabled.useMutation;b.deviceManager.listPersistedByAddon.useQuery;b.deviceManager.listAll.useQuery;var __=b.deviceManager.getDevice.useQuery;b.deviceManager.getChildren.useQuery;b.deviceManager.getChildrenBatch.useQuery;b.deviceManager.getLinkedDevices.useQuery;b.deviceManager.getLinkedDevicesBatch.useQuery;b.deviceManager.getStreamSources.useQuery;b.deviceManager.getConfigSchema.useQuery;b.deviceManager.getSettingsSchema.useQuery;b.deviceManager.updateConfig.useMutation;b.deviceManager.enable.useMutation;b.deviceManager.disable.useMutation;b.deviceManager.remove.useMutation;b.deviceManager.removeByIntegration.useMutation;b.deviceManager.getStreamProfileMap.useQuery;b.deviceManager.setStreamProfileMap.useMutation;b.deviceManager.probeStreams.useMutation;b.deviceManager.getBindings.useQuery;b.deviceManager.getBindingsBatch.useQuery;b.deviceManager.getAllBindings.useQuery;b.deviceManager.setWrapperActive.useMutation;b.deviceManager.listWrappersForCap.useQuery;b.deviceManager.listBindableCapsForDeviceType.useQuery;b.deviceManager.getDeviceSettingsAggregate.useQuery;b.deviceManager.getDeviceLiveInfoAggregate.useQuery;b.deviceManager.getDeviceAggregate.useQuery;b.deviceManager.runDeviceAction.useMutation;b.deviceManager.updateDeviceField.useMutation;b.deviceManager.updateDeviceFieldsBatch.useMutation;b.deviceManager.discoverDevices.useMutation;b.deviceManager.adoptDevice.useMutation;b.deviceManager.getCreationSchema.useQuery;b.deviceManager.createDevice.useMutation;b.deviceManager.testCreationField.useMutation;b.deviceManager.adoptionListCandidateFilters.useQuery;b.deviceManager.adoptionListCandidates.useQuery;b.deviceManager.adoptionRefresh.useMutation;b.deviceManager.adoptionAdopt.useMutation;b.deviceManager.adoptionRelease.useMutation;b.deviceManager.adoptionStartJob.useMutation;b.deviceManager.adoptionListJobs.useQuery;b.deviceManager.adoptionCancelJob.useMutation;b.deviceManager.adoptionResync.useMutation;b.deviceManager.discoveryProviders.useQuery;b.deviceManager.discoverAllProviders.useMutation;b.deviceManager.discoverProvider.useMutation;b.deviceManager.providerCreationType.useQuery;b.deviceManager.providerDiscoveryParamsSchema.useQuery;b.deviceManager.testField.useMutation;b.deviceManager.getDeviceStatusAggregate.useQuery;b.deviceManager.getDeviceStatusAggregateBatch.useQuery;b.deviceManager.getDeviceSettingsContribution.useQuery;b.deviceManager.getDeviceLiveContribution.useQuery;b.deviceManager.applyDeviceSettingsPatch.useMutation;b.deviceOps.getStreamSources.useQuery;b.deviceOps.getConfigEntries.useQuery;b.deviceOps.setConfig.useMutation;b.deviceOps.runAction.useMutation;b.deviceOps.removeDevice.useMutation;b.deviceOps.getSettingsSchema.useQuery;b.deviceOps.getRawState.useQuery;b.deviceProvider.start.useMutation;b.deviceProvider.stop.useMutation;b.deviceProvider.getStatus.useQuery;b.deviceProvider.getDevices.useQuery;b.deviceProvider.supportsDiscovery.useQuery;b.deviceProvider.discoverDevices.useMutation;b.deviceProvider.getDiscoveryParamsSchema.useQuery;b.deviceProvider.getManualCreationType.useQuery;b.deviceProvider.adoptDiscoveredDevice.useMutation;b.deviceProvider.supportsManualCreation.useQuery;b.deviceProvider.getChildCreationSchema.useQuery;b.deviceProvider.createDevice.useMutation;b.deviceProvider.testCreationField.useMutation;b.deviceState.getSnapshot.useQuery;b.deviceState.getCapSlice.useQuery;b.deviceState.getAllSnapshots.useQuery;b.deviceState.setCapSlice.useMutation;b.deviceStatus.getStatus.useQuery;b.doorbell.getStatus.useQuery;b.doorbell.getDeviceSettingsContribution.useQuery;b.doorbell.getDeviceLiveContribution.useQuery;b.doorbell.applyDeviceSettingsPatch.useMutation;b.enumSensor.getStatus.useQuery;b.eventEmitter.getStatus.useQuery;b.events.getEvents.useQuery;b.events.getEventThumbnail.useQuery;b.events.getEventClipUrl.useQuery;b.faceGallery.listIdentities.useQuery;b.faceGallery.createIdentity.useMutation;b.faceGallery.renameIdentity.useMutation;b.faceGallery.deleteIdentity.useMutation;b.faceGallery.listIdentitySamples.useQuery;b.faceGallery.removeSample.useMutation;b.faceGallery.listRecentFaces.useQuery;b.faceGallery.getFaceByTrack.useQuery;b.faceGallery.getFaceMedia.useQuery;b.faceGallery.assignFace.useMutation;b.faceGallery.unassignFace.useMutation;b.faceGallery.deleteFace.useMutation;b.faceGallery.assignFaces.useMutation;b.faceGallery.unassignFaces.useMutation;b.faceGallery.suggestFaceClusters.useQuery;b.fanControl.setPercentage.useMutation;b.fanControl.setPreset.useMutation;b.fanControl.setDirection.useMutation;b.fanControl.setOscillating.useMutation;b.fanControl.getStatus.useQuery;b.featureProbe.getStatus.useQuery;b.flood.getStatus.useQuery;b.gas.getStatus.useQuery;b.humidifier.setOn.useMutation;b.humidifier.setTargetHumidity.useMutation;b.humidifier.setMode.useMutation;b.humidifier.getStatus.useQuery;b.humiditySensor.getStatus.useQuery;b.image.getStatus.useQuery;b.imageSettings.getOptions.useQuery;b.imageSettings.setSettings.useMutation;b.imageSettings.getStatus.useQuery;b.integrations.list.useQuery;b.integrations.get.useQuery;b.integrations.getByAddonId.useQuery;b.integrations.create.useMutation;b.integrations.update.useMutation;b.integrations.delete.useMutation;b.integrations.getSettings.useQuery;b.integrations.setSettings.useMutation;b.integrations.getAvailableTypes.useQuery;b.integrations.testConnection.useMutation;var pae=b.intercom.startSession.useMutation,mae=b.intercom.handleAnswer.useMutation,fae=b.intercom.stopSession.useMutation;b.intercom.startTalkSession.useMutation;b.intercom.pushTalkAudio.useMutation;b.intercom.endTalkSession.useMutation;b.intercom.getStatus.useQuery;b.lawnMowerControl.startMowing.useMutation;b.lawnMowerControl.pause.useMutation;b.lawnMowerControl.dock.useMutation;b.lawnMowerControl.getStatus.useQuery;b.llm.generate.useMutation;b.llm.generateVision.useMutation;b.llm.cancel.useMutation;b.llm.listProfileKinds.useQuery;b.llm.listProfiles.useQuery;b.llm.upsertProfile.useMutation;b.llm.deleteProfile.useMutation;b.llm.testProfile.useMutation;b.llm.listModels.useQuery;b.llm.getDefaults.useQuery;b.llm.setDefault.useMutation;b.llm.getUsage.useQuery;b.llm.listModelCatalog.useQuery;b.llm.listRuntimeNodes.useQuery;b.llm.listNodeModels.useQuery;b.llm.resolveModelRef.useMutation;b.llm.installModel.useMutation;b.llm.deleteModel.useMutation;b.llm.getRuntimeStatus.useQuery;b.llm.startRuntime.useMutation;b.llm.stopRuntime.useMutation;b.localNetwork.list.useQuery;b.localNetwork.getPreferred.useQuery;b.localNetwork.getConnectionEndpoints.useQuery;b.localNetwork.getNotificationEndpoint.useQuery;b.localNetwork.setNotificationEndpoint.useMutation;b.localNetwork.getViewerEndpoints.useQuery;b.localNetwork.setViewerEndpoints.useMutation;b.localNetwork.getAllowedAddresses.useQuery;b.localNetwork.setAllowedAddresses.useMutation;b.localNetwork.resetAllowlistToBestMatch.useMutation;b.localNetwork.getTlsStatus.useQuery;b.localNetwork.regenerateCertificate.useMutation;b.localNetwork.uploadCertificate.useMutation;b.localNetwork.downloadCa.useQuery;b.localNetwork.revertToGeneratedCertificate.useMutation;b.lockControl.lock.useMutation;b.lockControl.unlock.useMutation;b.lockControl.open.useMutation;b.lockControl.getStatus.useQuery;b.mediaPlayer.play.useMutation;b.mediaPlayer.pause.useMutation;b.mediaPlayer.stop.useMutation;b.mediaPlayer.next.useMutation;b.mediaPlayer.previous.useMutation;b.mediaPlayer.seek.useMutation;b.mediaPlayer.setVolume.useMutation;b.mediaPlayer.setMute.useMutation;b.mediaPlayer.setShuffle.useMutation;b.mediaPlayer.setRepeat.useMutation;b.mediaPlayer.selectSource.useMutation;b.mediaPlayer.playMedia.useMutation;b.mediaPlayer.getStatus.useQuery;b.meshNetwork.getStatus.useQuery;b.meshNetwork.join.useMutation;b.meshNetwork.startLogin.useMutation;b.meshNetwork.leave.useMutation;b.meshNetwork.logout.useMutation;b.meshNetwork.listPeers.useQuery;b.meshNetwork.testConnection.useMutation;b.metricsProvider.collectSnapshot.useQuery;b.metricsProvider.getCached.useQuery;b.metricsProvider.getCurrent.useQuery;b.metricsProvider.getDiskSpace.useQuery;b.metricsProvider.getGpuInfo.useQuery;b.metricsProvider.getCpuTemperature.useQuery;b.metricsProvider.getProcessStats.useQuery;b.metricsProvider.listAddonInstances.useQuery;b.metricsProvider.getAddonStats.useQuery;b.metricsProvider.listNodeProcesses.useQuery;b.metricsProvider.getLoadSeries.useQuery;b.metricsProvider.dumpHeapSnapshot.useMutation;b.motion.isDetected.useQuery;b.motion.getStatus.useQuery;b.motionDetection.analyze.useMutation;b.motionDetection.removeCamera.useMutation;b.motionDetection.reset.useMutation;b.motionDetection.getDeviceSettingsContribution.useQuery;b.motionDetection.getDeviceLiveContribution.useQuery;b.motionDetection.applyDeviceSettingsPatch.useMutation;b.motionTrigger.setMotionTrigger.useMutation;b.motionTrigger.getStatus.useQuery;b.motionZones.getOptions.useQuery;b.motionZones.setZone.useMutation;b.motionZones.getStatus.useQuery;b.mqttBroker.listBrokers.useQuery;b.mqttBroker.getBrokerConfig.useQuery;b.mqttBroker.addBroker.useMutation;b.mqttBroker.removeBroker.useMutation;b.mqttBroker.testConnection.useMutation;b.mqttBroker.startEmbeddedBroker.useMutation;b.mqttBroker.stopEmbeddedBroker.useMutation;b.mqttBroker.getStatus.useQuery;b.nativeObjectDetection.setEnabled.useMutation;b.nativeObjectDetection.getStatus.useQuery;b.networkAccess.start.useMutation;b.networkAccess.stop.useMutation;b.networkAccess.getEndpoint.useQuery;b.networkAccess.getStatus.useQuery;b.networkAccess.listEndpoints.useQuery;b.networkQuality.getDeviceStats.useQuery;b.networkQuality.getAllStats.useQuery;b.networkQuality.reportClientStats.useMutation;b.nodes.topology.useQuery;b.nodes.deployAddon.useMutation;b.nodes.undeployAddon.useMutation;b.nodes.restartAddon.useMutation;b.nodes.restartProcess.useMutation;b.nodes.restartNode.useMutation;b.nodes.shutdownNode.useMutation;b.nodes.renameNode.useMutation;b.nodes.clusterAddonStatus.useQuery;b.nodes.getCapUsageGraph.useQuery;b.nodes.getNodeAddons.useQuery;b.nodes.setProcessLogLevel.useMutation;b.nodes.executeQuery.useMutation;b.notificationOutput.listTargetKinds.useQuery;b.notificationOutput.listTargets.useQuery;b.notificationOutput.discoverTargets.useQuery;b.notificationOutput.send.useMutation;b.notificationOutput.testTarget.useMutation;b.notificationOutput.upsertTarget.useMutation;b.notificationOutput.deleteTarget.useMutation;b.notificationOutput.setTargetEnabled.useMutation;b.notificationRules.listRules.useQuery;b.notificationRules.getRule.useQuery;b.notificationRules.createRule.useMutation;b.notificationRules.updateRule.useMutation;b.notificationRules.deleteRule.useMutation;b.notificationRules.setRuleEnabled.useMutation;b.notificationRules.listDeviceMutes.useQuery;b.notificationRules.setDeviceMuted.useMutation;b.notificationRules.testRule.useMutation;b.notificationRules.getConditionCatalog.useQuery;b.notificationRules.getHistory.useQuery;b.notificationRules.resolveArtifactUrl.useQuery;b.notificationRules.listSnoozes.useQuery;b.notificationRules.createSnooze.useMutation;b.notificationRules.cancelSnooze.useMutation;b.notificationRules.getAlarmConfig.useQuery;b.notificationRules.setAlarmConfig.useMutation;b.notifier.send.useMutation;b.notifier.cancel.useMutation;b.notifier.getStatus.useQuery;b.numericSensor.getStatus.useQuery;b.osd.setOverlay.useMutation;b.osd.getStatus.useQuery;b.osdManager.getDeviceOsd.useQuery;b.osdManager.getSourceCatalog.useQuery;b.osdManager.getConditionSupport.useQuery;b.osdManager.setSlotBinding.useMutation;b.osdManager.clearSlotBinding.useMutation;b.osdManager.copyDeviceConfiguration.useMutation;b.osdManager.previewSlot.useMutation;b.osdManager.renderDevice.useMutation;b.petFeeder.feed.useMutation;b.petFeeder.cancelFeed.useMutation;b.petFeeder.resetDesiccant.useMutation;b.petFeeder.markFoodReplenished.useMutation;b.petFeeder.callPet.useMutation;b.petFeeder.playSound.useMutation;b.petFeeder.setChildLock.useMutation;b.petFeeder.setIndicatorLight.useMutation;b.petFeeder.setFeedSound.useMutation;b.petFeeder.setVolume.useMutation;b.petFeeder.getStatus.useQuery;b.pipelineAnalytics.getActiveTracks.useQuery;b.pipelineAnalytics.getTrack.useQuery;b.pipelineAnalytics.listTracks.useQuery;b.pipelineAnalytics.listRecentTracks.useQuery;b.pipelineAnalytics.clearTracks.useMutation;b.pipelineAnalytics.getMotionEvents.useQuery;b.pipelineAnalytics.getObjectEvents.useQuery;b.pipelineAnalytics.getAudioEvents.useQuery;b.pipelineAnalytics.listEventKinds.useQuery;b.pipelineAnalytics.listEventKindsBatch.useQuery;b.pipelineAnalytics.getSensorEvents.useQuery;b.pipelineAnalytics.getKeyEvents.useQuery;b.pipelineAnalytics.getKeyEventsBatch.useQuery;b.pipelineAnalytics.getEventDensity.useQuery;b.pipelineAnalytics.getEventDensityBatch.useQuery;b.pipelineAnalytics.pruneEventsBefore.useMutation;b.pipelineAnalytics.pruneTracksBefore.useMutation;b.pipelineAnalytics.wipeAllAnalytics.useMutation;b.pipelineAnalytics.reconcileFromDisk.useMutation;b.pipelineAnalytics.deleteTracks.useMutation;b.pipelineAnalytics.setTrackFlags.useMutation;b.pipelineAnalytics.getEventStoreFootprint.useQuery;b.pipelineAnalytics.getEventMediaFootprintByKind.useQuery;b.pipelineAnalytics.pruneEvents.useMutation;b.pipelineAnalytics.deleteDeviceEvents.useMutation;b.pipelineAnalytics.pauseForStorageMigration.useMutation;b.pipelineAnalytics.resumeForStorageMigration.useMutation;b.pipelineAnalytics.refreshStorageLocationsForMigration.useMutation;b.pipelineAnalytics.startStorageMigrationMove.useMutation;b.pipelineAnalytics.getStorageMigrationMoveStatus.useQuery;b.pipelineAnalytics.cancelStorageMigrationMove.useMutation;b.pipelineAnalytics.relocateMedia.useMutation;b.pipelineAnalytics.countUnstampedEventMedia.useQuery;b.pipelineAnalytics.countRelocatableMedia.useQuery;b.pipelineAnalytics.listRelocateMediaJobs.useQuery;b.pipelineAnalytics.cancelRelocateMedia.useMutation;b.pipelineAnalytics.listOpsLog.useQuery;b.pipelineAnalytics.reclaimDebugMedia.useMutation;b.pipelineAnalytics.getMediaReclaimStatus.useQuery;b.pipelineAnalytics.getTrainingExportSummary.useQuery;b.pipelineAnalytics.getTrainingExportUrl.useQuery;b.pipelineAnalytics.listRetrainStaging.useQuery;b.pipelineAnalytics.listRetrainFrames.useQuery;b.pipelineAnalytics.selectRetrainFrames.useMutation;b.pipelineAnalytics.deselectRetrainFrame.useMutation;b.pipelineAnalytics.getRetrainFrameImage.useQuery;b.pipelineAnalytics.proposeRetrainAnnotations.useMutation;b.pipelineAnalytics.runReplayFrameProcessor.useMutation;b.pipelineAnalytics.listRetrainAnnotations.useQuery;b.pipelineAnalytics.saveRetrainAnnotations.useMutation;b.pipelineAnalytics.completeRetrainTrack.useMutation;b.pipelineAnalytics.restageRetrainTrack.useMutation;b.pipelineAnalytics.getRetrainExportUrl.useQuery;b.pipelineAnalytics.getEventMedia.useQuery;b.pipelineAnalytics.getTrackMedia.useQuery;b.pipelineAnalytics.listTrackMedia.useQuery;b.pipelineAnalytics.listEventMedia.useQuery;b.pipelineAnalytics.searchObjectEvents.useQuery;b.pipelineAnalytics.wipeObjectEmbeddings.useMutation;b.pipelineAnalytics.rebuildObjectEmbeddings.useMutation;b.pipelineAnalytics.getObjectEmbeddingRebuildStatus.useQuery;b.pipelineAnalytics.getDeviceSettingsContribution.useQuery;b.pipelineAnalytics.getDeviceLiveContribution.useQuery;b.pipelineAnalytics.applyDeviceSettingsPatch.useMutation;b.pipelineExecutor.getAvailableEngines.useQuery;b.pipelineExecutor.getSelectedEngine.useQuery;b.pipelineExecutor.getDefaultSteps.useQuery;b.pipelineExecutor.getEngineProvisioning.useQuery;b.pipelineExecutor.getVideoPipelineSteps.useQuery;b.pipelineExecutor.setVideoPipelineSteps.useMutation;b.pipelineExecutor.clearDeviceOverrides.useMutation;b.pipelineExecutor.getInferenceDeviceHealth.useQuery;b.pipelineExecutor.rearmInferenceDevice.useMutation;b.pipelineExecutor.getSchema.useQuery;b.pipelineExecutor.getGlobalSteps.useQuery;b.pipelineExecutor.getGlobalPipelineConfig.useQuery;b.pipelineExecutor.getOrchestratorConfigSchema.useQuery;b.pipelineExecutor.validatePipeline.useQuery;b.pipelineExecutor.listTemplates.useQuery;b.pipelineExecutor.saveTemplate.useMutation;b.pipelineExecutor.updateTemplate.useMutation;b.pipelineExecutor.deleteTemplate.useMutation;b.pipelineExecutor.getCapabilities.useQuery;b.pipelineExecutor.getAddonModels.useQuery;b.pipelineExecutor.downloadModel.useMutation;b.pipelineExecutor.deleteModel.useMutation;b.pipelineExecutor.runPipeline.useMutation;b.pipelineExecutor.runPipelineBatch.useMutation;b.pipelineExecutor.cacheFrameInPool.useMutation;b.pipelineExecutor.inferCached.useMutation;b.pipelineExecutor.uncacheFrame.useMutation;b.pipelineExecutor.getEffectiveTuning.useQuery;b.pipelineExecutor.listLoadedEngines.useQuery;b.pipelineExecutor.spinEngine.useMutation;b.pipelineExecutor.killEngine.useMutation;b.pipelineExecutor.listReferenceImages.useQuery;b.pipelineExecutor.getReferenceImage.useQuery;b.pipelineExecutor.getReferenceAudioFiles.useQuery;b.pipelineExecutor.getReferenceAudio.useQuery;b.pipelineExecutor.getAudioCapabilities.useQuery;b.pipelineExecutor.runAudioTest.useMutation;b.pipelineExecutor.getDetectionConfigSchema.useQuery;b.pipelineOrchestrator.pauseForStorageMigration.useMutation;b.pipelineOrchestrator.resumeForStorageMigration.useMutation;b.pipelineOrchestrator.assignPipeline.useMutation;b.pipelineOrchestrator.unassignPipeline.useMutation;b.pipelineOrchestrator.setPipelineDevicePin.useMutation;b.pipelineOrchestrator.getPipelineDevicePin.useQuery;b.pipelineOrchestrator.rebalance.useMutation;b.pipelineOrchestrator.getPipelineAssignments.useQuery;b.pipelineOrchestrator.getPipelineAssignment.useQuery;b.pipelineOrchestrator.getAgentLoad.useQuery;b.pipelineOrchestrator.getGlobalMetrics.useQuery;b.pipelineOrchestrator.getCameraMetrics.useQuery;b.pipelineOrchestrator.getCapabilityBindings.useQuery;b.pipelineOrchestrator.setCapabilityBinding.useMutation;b.pipelineOrchestrator.getIngestOwner.useQuery;b.pipelineOrchestrator.assignAudio.useMutation;b.pipelineOrchestrator.unassignAudio.useMutation;b.pipelineOrchestrator.getAudioAssignment.useQuery;b.pipelineOrchestrator.getAudioNodeLoad.useQuery;b.pipelineOrchestrator.getAudioAssignments.useQuery;b.pipelineOrchestrator.getAgentSettings.useQuery;b.pipelineOrchestrator.listAgentSettings.useQuery;b.pipelineOrchestrator.removeAgentSettings.useMutation;b.pipelineOrchestrator.setAgentMaxCameras.useMutation;b.pipelineOrchestrator.setAgentDetectWeight.useMutation;b.pipelineOrchestrator.setAgentCapabilities.useMutation;b.pipelineOrchestrator.setAgentReachableHost.useMutation;b.pipelineOrchestrator.setAgentInferenceDevices.useMutation;b.pipelineOrchestrator.getNodeInferenceDevices.useQuery;b.pipelineOrchestrator.resetNodePipelineDefaults.useMutation;b.pipelineOrchestrator.getCameraSettings.useQuery;b.pipelineOrchestrator.setCameraStepToggle.useMutation;b.pipelineOrchestrator.getCameraStepOverrides.useQuery;b.pipelineOrchestrator.setCameraStepOverride.useMutation;b.pipelineOrchestrator.setCameraPipelineForAgent.useMutation;b.pipelineOrchestrator.resolvePipeline.useQuery;b.pipelineOrchestrator.getCameraSwitches.useQuery;b.pipelineOrchestrator.setCameraSwitch.useMutation;b.pipelineOrchestrator.getCameraStatus.useQuery;b.pipelineOrchestrator.getCameraStatuses.useQuery;b.pipelineOrchestrator.reconcileFromDisk.useMutation;b.pipelineOrchestrator.getReconcileFromDiskStatus.useQuery;b.pipelineOrchestrator.listTemplates.useQuery;b.pipelineOrchestrator.saveTemplate.useMutation;b.pipelineOrchestrator.updateTemplate.useMutation;b.pipelineOrchestrator.deleteTemplate.useMutation;b.pipelineOrchestrator.getDeviceSettingsContribution.useQuery;b.pipelineOrchestrator.getDeviceLiveContribution.useQuery;b.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation;b.pipelineRunner.attachCamera.useMutation;b.pipelineRunner.detachCamera.useMutation;b.pipelineRunner.reportMotion.useMutation;b.pipelineRunner.getLocalLoad.useQuery;b.pipelineRunner.getLocalMetrics.useQuery;b.pipelineRunner.getCameraMetrics.useQuery;b.pipelineRunner.getAllCameraMetrics.useQuery;b.pipelineRunner.getLocalCameras.useQuery;b.pipelineRunner.getNativeCrop.useQuery;b.pipelineRunner.runDetailSubtree.useMutation;b.pipelineRunner.runStatelessStep.useMutation;b.plateGallery.listPlates.useQuery;b.plateGallery.getPlateByTrack.useQuery;b.plateGallery.getPlateMedia.useQuery;b.plateGallery.searchPlates.useQuery;b.plateGallery.suggestPlateClusters.useQuery;b.plateGallery.correctPlateText.useMutation;b.plateGallery.deletePlate.useMutation;b.plateGallery.listVehicles.useQuery;b.plateGallery.createVehicle.useMutation;b.plateGallery.renameVehicle.useMutation;b.plateGallery.deleteVehicle.useMutation;b.plateGallery.listVehicleSamples.useQuery;b.plateGallery.removeVehicleSample.useMutation;b.plateGallery.assignPlate.useMutation;b.plateGallery.unassignPlate.useMutation;b.plateGallery.assignPlates.useMutation;b.plateGallery.unassignPlates.useMutation;b.powerMeter.getStatus.useQuery;b.presence.getStatus.useQuery;b.pressureSensor.getStatus.useQuery;b.privacyMask.getOptions.useQuery;b.privacyMask.setMask.useMutation;b.privacyMask.setAudioEnabled.useMutation;b.privacyMask.getStatus.useQuery;b.ptz.move.useMutation;b.ptz.continuousMove.useMutation;b.ptz.stop.useMutation;b.ptz.getPresets.useQuery;b.ptz.goToPreset.useMutation;b.ptz.savePreset.useMutation;b.ptz.deletePreset.useMutation;b.ptz.getOptions.useQuery;b.ptz.goHome.useMutation;b.ptz.getPosition.useQuery;b.ptz.setAutofocus.useMutation;b.ptz.getStatus.useQuery;b.ptzAutotrack.getStatus.useQuery;b.ptzAutotrack.setEnabled.useMutation;b.ptzAutotrack.getSettings.useQuery;b.ptzAutotrack.setSettings.useMutation;b.reboot.reboot.useMutation;b.recording.getAvailability.useQuery;b.recording.getAvailabilityBatch.useQuery;b.recording.getDaysWithRecordings.useQuery;b.recording.getDaysWithRecordingsBatch.useQuery;b.recording.getPlaybackManifest.useQuery;b.recording.getStorageUsage.useQuery;b.recording.getDeviceConfig.useQuery;b.recording.locateSegment.useQuery;b.recording.readSegmentBytes.useQuery;b.recording.readGopBytes.useQuery;b.recording.readWindowBytes.useQuery;b.recording.setDeviceConfig.useMutation;b.recording.rescanStorage.useMutation;b.recording.pruneFootage.useMutation;b.recording.deleteFootprint.useMutation;b.recording.listOpsLog.useQuery;b.recording.renderGif.useMutation;b.recording.renderClip.useMutation;b.recording.pauseForStorageMigration.useMutation;b.recording.resumeForStorageMigration.useMutation;b.recording.refreshStorageLocationsForMigration.useMutation;b.recording.startStorageMigrationMove.useMutation;b.recording.getStorageMigrationMoveStatus.useQuery;b.recording.cancelStorageMigrationMove.useMutation;b.recording.relocateFootage.useMutation;b.recording.listRelocateJobs.useQuery;b.recording.getRelocateResidue.useQuery;b.recording.reconcileLedgerAgainstDisk.useMutation;b.recording.cancelRelocateJob.useMutation;b.recording.planStorageRebalance.useQuery;b.recording.startStorageRebalance.useMutation;b.recording.getPlacement.useQuery;b.recording.setDevicePlacement.useMutation;b.recording.getStatus.useQuery;b.recording.getDeviceSettingsContribution.useQuery;b.recording.getDeviceLiveContribution.useQuery;b.recording.applyDeviceSettingsPatch.useMutation;b.recordingExport.createExport.useMutation;b.recordingExport.listExports.useQuery;b.recordingExport.getExport.useQuery;b.recordingExport.cancelExport.useMutation;b.recordingExport.deleteExport.useMutation;b.recordingExport.getDownloadUrl.useQuery;b.recordingExport.readExportBytes.useQuery;b.sceneMonitor.listScenes.useQuery;b.sceneMonitor.listScenesBatch.useQuery;b.sceneMonitor.createScene.useMutation;b.sceneMonitor.updateScene.useMutation;b.sceneMonitor.deleteScene.useMutation;b.sceneMonitor.captureReference.useMutation;b.sceneMonitor.deleteReference.useMutation;b.sceneMonitor.recheckNow.useMutation;b.sceneMonitor.resetScene.useMutation;b.sceneMonitor.getStatus.useQuery;b.scriptRunner.run.useMutation;b.scriptRunner.stop.useMutation;b.scriptRunner.getStatus.useQuery;b.serverManagement.getServerPackageStatus.useQuery;b.serverManagement.checkServerUpdate.useMutation;b.serverManagement.applyServerUpdate.useMutation;b.serverManagement.rollbackServerUpdate.useMutation;b.serverManagement.restartServer.useMutation;b.settingsStore.get.useQuery;b.settingsStore.set.useMutation;b.settingsStore.query.useQuery;b.settingsStore.insert.useMutation;b.settingsStore.insertMany.useMutation;b.settingsStore.update.useMutation;b.settingsStore.delete.useMutation;b.settingsStore.deleteWhere.useMutation;b.settingsStore.updateWhere.useMutation;b.settingsStore.count.useQuery;b.settingsStore.aggregate.useQuery;b.settingsStore.histogram.useQuery;b.settingsStore.isEmpty.useQuery;b.settingsStore.declareCollection.useMutation;b.smoke.getStatus.useQuery;b.snapshot.getSnapshot.useQuery;b.snapshot.invalidateCache.useMutation;b.snapshot.getSnapshotOverview.useQuery;b.snapshot.getDebugState.useQuery;b.snapshot.getSnapshotLinks.useQuery;b.snapshot.getStatus.useQuery;b.snapshot.getDeviceSettingsContribution.useQuery;b.snapshot.getDeviceLiveContribution.useQuery;b.snapshot.applyDeviceSettingsPatch.useMutation;b.storage.resolve.useQuery;b.storage.write.useMutation;b.storage.read.useQuery;b.storage.exists.useQuery;b.storage.list.useQuery;b.storage.delete.useMutation;b.storage.getAvailableSpace.useQuery;b.storage.beginUpload.useMutation;b.storage.writeChunk.useMutation;b.storage.finalizeUpload.useMutation;b.storage.abortUpload.useMutation;b.storage.beginDownload.useMutation;b.storage.readChunk.useQuery;b.storage.endDownload.useMutation;b.storage.listLocations.useQuery;b.storage.getDefaultLocation.useQuery;b.storage.listLocationDeclarations.useQuery;b.storage.upsertLocation.useMutation;b.storage.deleteLocation.useMutation;b.storage.testLocation.useQuery;b.storage.listProviders.useQuery;b.storage.testConfig.useQuery;b.storageMigration.plan.useQuery;b.storageMigration.start.useMutation;b.storageMigration.status.useQuery;b.storageMigration.cancel.useMutation;b.storageMigration.movers.useQuery;b.storageMigration.residue.useQuery;b.storageMigration.drain.useMutation;b.storageMigration.cleanupStart.useMutation;b.storageMigration.cleanupStatus.useQuery;b.storageMigration.cleanupCancel.useMutation;b.storageMigration.history.useQuery;b.streamBroker.publishCameraStream.useMutation;b.streamBroker.retractCameraStream.useMutation;b.streamBroker.assignProfile.useMutation;b.streamBroker.unassignProfile.useMutation;b.streamBroker.renderPreBufferClip.useMutation;b.streamBroker.produceEventMedia.useMutation;b.streamBroker.fetchEventMedia.useMutation;b.streamBroker.listAllCameraStreams.useQuery;b.streamBroker.listAllProfileSlots.useQuery;b.streamBroker.getBrokerStats.useQuery;b.streamBroker.probeStream.useMutation;b.streamBroker.listClients.useQuery;b.streamBroker.killClient.useMutation;b.streamBroker.restartProfile.useMutation;b.streamBroker.getStreamUrl.useQuery;b.streamBroker.getStreamWithCodec.useMutation;b.streamBroker.releaseStreamWithCodec.useMutation;b.streamBroker.acquireEgressTranscode.useMutation;b.streamBroker.releaseEgressTranscode.useMutation;b.streamBroker.subscribeAudioChunks.useMutation;b.streamBroker.pullAudioChunks.useQuery;b.streamBroker.unsubscribeAudioChunks.useMutation;b.streamBroker.subscribeFrames.useMutation;b.streamBroker.pullFrameHandles.useQuery;b.streamBroker.unsubscribeFrames.useMutation;b.streamBroker.setPreBufferDuration.useMutation;b.streamBroker.getPreBufferInfo.useQuery;b.streamBroker.getRtspPort.useQuery;b.streamBroker.getAllRtspEntries.useQuery;b.streamBroker.getRtspEntry.useQuery;b.streamBroker.regenerateRtspToken.useMutation;b.streamBroker.setRtspEnabled.useMutation;b.streamBroker.isRtspEnabled.useQuery;b.streamBroker.getDeviceAudioMute.useQuery;b.streamBroker.setDeviceAudioMute.useMutation;b.streamBroker.getDeviceSettingsContribution.useQuery;b.streamBroker.getDeviceLiveContribution.useQuery;b.streamBroker.applyDeviceSettingsPatch.useMutation;b.streamCatalog.getCatalog.useQuery;b.streamParams.getOptions.useQuery;b.streamParams.setProfile.useMutation;b.streamParams.getConfigSchema.useQuery;b.streamParams.getStatus.useQuery;b.switch.setState.useMutation;b.switch.getStatus.useQuery;b.system.info.useQuery;b.system.health.useQuery;b.system.featureFlags.useQuery;b.system.networkAddresses.useQuery;b.system.getRetentionConfig.useQuery;b.system.setRetentionConfig.useMutation;b.system.forceRetentionCleanup.useMutation;b.system.getSiteLocation.useQuery;b.system.setSiteLocation.useMutation;b.system.detectSiteLocation.useMutation;b.system.getRequestCensus.useQuery;b.system.getLoadContributions.useQuery;b.system.getFailureContributions.useQuery;b.system.getLoggingSettings.useQuery;b.system.setLoggingSettings.useMutation;b.tamper.getStatus.useQuery;b.temperatureSensor.getStatus.useQuery;b.terminalSession.listProfiles.useQuery;b.terminalSession.listInstances.useQuery;b.terminalSession.createInstance.useMutation;b.terminalSession.updateInstance.useMutation;b.terminalSession.deleteInstance.useMutation;b.terminalSession.setInstanceEnabled.useMutation;b.terminalSession.listLegacyCameras.useQuery;b.terminalSession.adoptLegacyMonitor.useMutation;b.terminalSession.listSessions.useQuery;b.terminalSession.openSession.useMutation;b.terminalSession.resize.useMutation;b.terminalSession.pullOutput.useMutation;b.terminalSession.writeInput.useMutation;b.terminalSession.close.useMutation;b.toast.onToast.useSubscription;b.turnProvider.getTurnServers.useQuery;b.update.installUpdate.useMutation;b.update.getStatus.useQuery;b.userManagement.listUsers.useQuery;b.userManagement.createUser.useMutation;b.userManagement.updateUser.useMutation;b.userManagement.deleteUser.useMutation;b.userManagement.resetPassword.useMutation;b.userManagement.setUserScopes.useMutation;b.userManagement.validateCredentials.useMutation;b.userManagement.listApiKeys.useQuery;b.userManagement.createApiKey.useMutation;b.userManagement.revokeApiKey.useMutation;b.userManagement.validateApiKey.useMutation;b.userManagement.createScopedToken.useMutation;b.userManagement.revokeScopedToken.useMutation;b.userManagement.validateScopedToken.useQuery;b.userManagement.listScopedTokens.useQuery;b.userManagement.setupTotp.useMutation;b.userManagement.confirmTotp.useMutation;b.userManagement.disableTotp.useMutation;b.userManagement.getTotpStatus.useQuery;b.userManagement.verifyTotp.useMutation;b.userManagement.oauthIssueCode.useMutation;b.userManagement.oauthExchangeCode.useMutation;b.userManagement.oauthRefresh.useMutation;b.userManagement.oauthVerifyAccessToken.useQuery;b.userManagement.listOauthSessions.useQuery;b.userManagement.revokeOauthSession.useMutation;b.vacuumControl.start.useMutation;b.vacuumControl.pause.useMutation;b.vacuumControl.stop.useMutation;b.vacuumControl.returnToBase.useMutation;b.vacuumControl.locate.useMutation;b.vacuumControl.setFanSpeed.useMutation;b.vacuumControl.getStatus.useQuery;b.valve.open.useMutation;b.valve.close.useMutation;b.valve.stop.useMutation;b.valve.setPosition.useMutation;b.valve.getStatus.useQuery;b.vibration.getStatus.useQuery;b.videoclips.listClips.useQuery;b.videoclips.getClipPlayback.useQuery;b.waterHeater.setTargetTemp.useMutation;b.waterHeater.setOperationMode.useMutation;b.waterHeater.setAway.useMutation;b.waterHeater.getStatus.useQuery;b.weather.getStatus.useQuery;b.webrtcSession.listStreams.useQuery;b.webrtcSession.createSession.useMutation;b.webrtcSession.handleOffer.useMutation;b.webrtcSession.handleAnswer.useMutation;b.webrtcSession.addIceCandidate.useMutation;b.webrtcSession.getIceCandidates.useQuery;b.webrtcSession.closeSession.useMutation;b.webrtcSession.hasAdaptiveBitrate.useQuery;b.webrtcSession.getSessionState.useQuery;b.zoneAnalytics.getCurrentSnapshot.useQuery;b.zoneAnalytics.getCurrentSnapshotBatch.useQuery;b.zoneAnalytics.getZoneHistory.useQuery;b.zoneAnalytics.getCameraHistory.useQuery;b.zoneAnalytics.getUnzonedHistory.useQuery;b.zoneRules.listRules.useQuery;b.zoneRules.setRules.useMutation;b.zones.listZones.useQuery;b.zones.addZone.useMutation;b.zones.removeZone.useMutation;b.zones.updateZone.useMutation;hi("camstack:custom-field-renderers",{});var W2={motion:s_,audio:gu,person:aae,vehicle:Pg,animal:Ca,package:One,sensor:zne,control:u0,car:Pg,truck:eae,bus:rne,motorcycle:B2,bicycle:B2,airplane:Dne,boat:qne,train:Xne,bird:U2,cat:H2,dog:V2,horse:Ca,sheep:Ca,cow:Ca,elephant:Ca,bear:Ca,zebra:Ca,giraffe:Ca,door:il,pir:S_,smoke:Yp,water:o0,gas:Gi,vibration:C_,tamper:Rm,presence:nae,generic:M_,lock:pu,siren:Xp,switch:Kne,doorbell:Og,button:c_,"audio-speech":v_,"audio-scream":g_,"audio-crying":Jte,"audio-laughter":kne,"audio-music":b_,"audio-dog":V2,"audio-cat":H2,"audio-bird":U2,"audio-animal":Ca,"audio-alarm":Og,"audio-doorbell":Og,"audio-glass_breaking":rl,"audio-gunshot":p_,"audio-vehicle":Pg,"audio-siren":Xp,"audio-fire":Yp,"audio-water":pl,"audio-wind":Gi,"audio-door":il,"audio-footsteps":f_,"audio-crowd":iae,"audio-telephone":Pne,"audio-engine":mne,"audio-tools":bne,"audio-silence":A_};function K2(e){return Object.hasOwn(W2,e)?W2[e]:e.startsWith("audio-")?gu:M_}hi("camstack:confirm-dialog",null);hi("camstack:device-context",null);var hae="FEDERATION_DEBUG",Cy=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),$r=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function N_(){return $r}function O_(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function gae(){try{if(N_()&&window.localStorage)return!!localStorage.getItem(hae)}catch{return!1}return!1}function Ay(){return typeof process<"u"&&Ng&&Ng.FEDERATION_DEBUG?!!Ng.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:gae()}var vae="[ Federation Runtime ]",P_=function(...e){return e.length?e.reduce((t,n)=>n?t?`${t}:${n}`:n:t,""):""},Ey=(e,t)=>{if("getPublicPath"in e){let n;return e.getPublicPath.startsWith("function")?n=new Function("return "+e.getPublicPath)()():n=new Function(e.getPublicPath)(),`${n}${t}`}else return"publicPath"in e?!N_()&&!O_()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},j_=e=>{console.warn(`${vae}: ${e}`)};function D_(e){try{return JSON.stringify(e,null,2)}catch{return""}}var jg=(e,t)=>{if(!e)return t;const a=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const p=s.slice(1);return p.endsWith("/")?p.slice(0,-1):p}return s})(e);return a?a.endsWith("/")?`${a}${t}`:`${a}/${t}`:t};function yae(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function bae(e,t={}){const{remotes:n={},overrides:a={},version:s}=t;let p;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&s?yae(s):e.metaData.publicPath:e.metaData.getPublicPath,m=Object.keys(a);let h={};Object.keys(n).length||(h=e.remotes?.reduce((L,B)=>{let q;const G=B.federationContainerName;return m.includes(G)?q=a[G]:"version"in B?q=B.version:q=B.entry,L[G]={matchedVersion:q},L},{})||{}),Object.keys(n).forEach(L=>h[L]={matchedVersion:m.includes(L)?a[L]:n[L]});const{remoteEntry:{path:c,name:x,type:M},types:C={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:E},globalName:R,ssrRemoteEntry:_}=e.metaData,{exposes:P}=e;let D={version:s||"",buildVersion:E,globalName:R,remoteEntry:jg(c,x),remoteEntryType:M,remoteTypes:jg(C.path,C.name),remoteTypesZip:C.zip||"",remoteTypesAPI:C.api||"",remotesInfo:h,shared:e?.shared.map(L=>({assets:L.assets,sharedName:L.name,version:L.version,usedExports:L.referenceExports||[]})),modules:P?.map(L=>({moduleName:L.name,modulePath:L.path,assets:L.assets}))};if("publicPath"in e.metaData?(p={...D,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(p.ssrPublicPath=e.metaData.ssrPublicPath)):p={...D,getPublicPath:f()},_){const L=jg(_.path,_.name);p.ssrRemoteEntry=L,p.ssrRemoteEntryType=_.type||"commonjs-module"}return p}function z_(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Sae="[ Module Federation ]",pc=console,xae=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function kae(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
75
- `),n=t.filter(a=>!xae.some(s=>a.includes(s)));return n.length?`Stack trace:
76
- ${n.slice(0,5).join(`
77
- `)}`:void 0}catch{return}}var L_=class{constructor(e,t=pc){this.prefix=e,this.delegate=t??pc}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??pc}emit(e,t){const n=this.delegate,a=Ay()?kae():void 0,s=a?[...t,a]:t,p=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const f of p){const m=n[f];if(typeof m=="function"){m.call(n,this.prefix,...s);return}}for(const f of p){const m=pc[f];if(typeof m=="function"){m.call(pc,this.prefix,...s);return}}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){Ay()&&this.emit("debug",e)}};function wae(e){return new L_(e)}function Mae(e){const t=new L_(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Mae(Sae);async function q_(e,t){try{return await e()}catch(n){j_(n);return}}function Ry(e,t){const n=/^(https?:)?\/\//i;return e.replace(n,"").replace(/\/$/,"")===t.replace(n,"").replace(/\/$/,"")}function B_(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("script");for(let c=0;c<p.length;c++){const x=p[c],M=x.getAttribute("src");if(M&&Ry(M,e.url)){t=x,n=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=c?.type==="module"?"module":"text/javascript";let x;e.createScriptHook&&(x=e.createScriptHook(e.url,e.attrs),x instanceof HTMLScriptElement?t=x:typeof x=="object"&&("script"in x&&x.script&&(t=x.script),"timeout"in x&&x.timeout&&(a=x.timeout))),t.src||(t.src=e.url),c&&!x&&Object.keys(c).forEach(M=>{t&&(M==="async"||M==="defer"?t[M]=c[M]:t.getAttribute(M)||t.setAttribute(M,c[M]))})}let f=null;const m=typeof window<"u"?c=>{if(c.filename&&Ry(c.filename,e.url)){const x=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);x.name="ScriptExecutionError",f=x}}:null;m&&window.addEventListener("error",m);const h=async(c,x)=>{clearTimeout(s),m&&window.removeEventListener("error",m);const M=()=>{if(x?.type==="error"){const C=new Error(x?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);C.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(C)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,q_(()=>{const{needDeleteScript:C=!0}=e;C&&t?.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const C=c(x);if(C instanceof Promise){const E=await C;return M(),E}return M(),C}M()};return t.onerror=h.bind(null,t.onerror),t.onload=h.bind(null,t.onload),s=setTimeout(()=>{h(null,{type:"error",isTimeout:!0})},a),{script:t,needAttach:n}}function Cae(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("link");for(let m=0;m<p.length;m++){const h=p[m],c=h.getAttribute("href"),x=h.getAttribute("rel");if(c&&Ry(c,e.url)&&x===e.attrs.rel){t=h,n=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let m,h=!0;const c=e.attrs;e.createLinkHook&&(m=e.createLinkHook(e.url,c),m instanceof HTMLLinkElement?(t=m,h=!1):typeof m=="object"&&("link"in m&&m.link&&(t=m.link,h=!1),"timeout"in m&&m.timeout&&(a=m.timeout))),c&&h&&Object.keys(c).forEach(x=>{t&&!t.getAttribute(x)&&t.setAttribute(x,c[x])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};const f=(m,h)=>{s&&clearTimeout(s);const c=()=>{if(h?.type==="error"){const x=new Error(h?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);x.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(x)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,q_(()=>{const{needDeleteLink:x=!0}=e;x&&t?.parentNode&&t.parentNode.removeChild(t)}),m)){const x=m(h);return c(),x}c()};return t.onerror=f.bind(null,t.onerror),t.onload=f.bind(null,t.onload),s=setTimeout(()=>{f(null,{type:"error",isTimeout:!0})},a),{link:t,needAttach:n}}function Aae(e,t){const{attrs:n={},createScriptHook:a}=t;return new Promise((s,p)=>{const{script:f,needAttach:m}=B_({url:e,cb:s,onErrorCallback:p,attrs:{fetchpriority:"high",...n},createScriptHook:a,needDeleteScript:!0});m&&document.head.appendChild(f)})}var Vd=new Map;function js(e){if(!e)throw new Error("import specifier is required");if(Vd.has(e))return Vd.get(e);const t=new Function("name","return import(name)")(e).then(n=>n).catch(n=>{throw console.error(`Error importing module ${e}:`,n),Vd.delete(e),n});return Vd.set(e,t),t}var U_=async()=>{const e=await js("node-fetch");return e.default||e},Eae=async(e,t,n)=>{const s=await((p,f)=>n.lifecycle.fetch.emit(p,f))(e,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await U_():fetch)(e,t||{}):s},Rae=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,n,a)=>{if(a?.createScriptHook){const m=a.createScriptHook(e);m&&typeof m=="object"&&"url"in m&&(e=m.url)}let s;try{s=new URL(e)}catch(m){console.error("Error constructing URL:",m),t(new Error(`Invalid URL: ${m}`));return}const p=async()=>a?.fetch?(m,h)=>Eae(m,h,a):typeof fetch>"u"?U_():fetch,f=async(m,h)=>{try{const c=await(await m(h.href)).text(),[x,M]=await Promise.all([js("path"),js("vm")]),C={exports:{},module:{exports:{}}},E=h.pathname.split("/").slice(0,-1).join("/"),R=x.basename(h.pathname),_=new M.Script(`(function(exports, module, require, __dirname, __filename) {${c}
78
- })`,{filename:R,importModuleDynamically:M.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??js});let P;P=(await js("node:module")).createRequire(h.protocol==="file:"||h.protocol==="node:"?h.href:x.join(process.cwd(),"__mf_require_base__.js")),_.runInThisContext()(C.exports,C.module,P,E,R);const D=C.module.exports||C.exports;if(n&&D&&n.globalName){t(void 0,D[n.globalName]||D);return}t(void 0,D)}catch(c){t(c instanceof Error?c:new Error(`Script execution error: ${c}`))}};p().then(async m=>{if(n?.type==="esm"||n?.type==="module")return Iy(s.href,{fetch:m,vm:await js("vm")}).then(async h=>{await h.evaluate(),t(void 0,h.namespace)}).catch(h=>{t(h instanceof Error?h:new Error(`Script execution error: ${h}`))});f(m,s)}).catch(m=>{t(m)})}:(e,t,n,a)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},Iae=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((n,a)=>{Rae(e,(s,p)=>{if(s)a(s);else{const f=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[f]=p)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},Dg=new Map;async function Iy(e,t){if(Dg.has(e))return Dg.get(e);const{fetch:n,vm:a}=t,s=await(await n(e)).text(),p=new a.SourceTextModule(s,{importModuleDynamically:async(f,m)=>{const h=new URL(f,e).href;return Iy(h,t)}});return Dg.set(e,p),await p.link(async f=>{const m=new URL(f,e).href;return await Iy(m,t)}),p}var Tae=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,F_=(e,t,n,a)=>{const s=[`${[t[e]]} #${e}`];return n&&s.push(`args: ${JSON.stringify(n)}`),s.push(Tae(e)),a&&s.push(`Original Error Message:
79
- ${a}`),s.join(`
80
- `)};function _ae(e,t,n,a,s,p){return a(F_(e,t,n,s))}var Mo="[ Federation Runtime ]",Ty=wae(Mo);function Qi(e,t,n,a,s){e||Xt(t)}function Xt(e,t,n,a,s){if(t!==void 0)return _ae(e,t,n??{},f=>{throw new Error(`${Mo}: ${f}`)},a);const p=e;throw p instanceof Error?(p.message.startsWith(Mo)||(p.message=`${Mo}: ${p.message}`),p):new Error(`${Mo}: ${p}`)}function Gc(e){e instanceof Error&&(e.message.startsWith(Mo)||(e.message=`${Mo}: ${e.message}`)),Ty.warn(e)}function Nae(e,t){return e.findIndex(n=>n===t)===-1&&e.push(t),e}function Jp(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function d0(e){return typeof e.entry<"u"}function H_(e){return!e.entry.includes(".json")}function p0(e){return e&&typeof e=="object"}var Oae=Object.prototype.toString;function Pae(e){return Oae.call(e)==="[object Object]"}function $_(e){return Array.isArray(e)?e:[e]}function Q_(e){const t={url:"",type:"global",globalName:""};return $r||O_()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}var jae=(e,t)=>{let n;return e.endsWith("/")?n=e.slice(0,-1):n=e,t.startsWith(".")&&(t=t.slice(1)),n=n+t,n},zn=typeof globalThis=="object"?globalThis:window,Ya=(()=>{try{return document.defaultView}catch{return zn}})(),Zc=Ya;function bp(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Sp(e,t){return Object.hasOwnProperty.call(e,t)}Sp(zn,"__GLOBAL_LOADING_REMOTE_ENTRY__")||bp(zn,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var Hs=zn.__GLOBAL_LOADING_REMOTE_ENTRY__;function V_(e){Sp(e,"__VMOK__")&&!Sp(e,"__FEDERATION__")&&bp(e,"__FEDERATION__",e.__VMOK__),Sp(e,"__FEDERATION__")||(bp(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),bp(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}V_(zn);V_(Ya);function Dae(e,t=Ay()){t&&(zn.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,zn.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.5.1")}function ol(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const n=Object.keys(e);for(const a of n){const[s,p]=a.split(":"),f=`${s}:${t}`,m=e[f];if(m)return{value:m,key:f}}return{value:void 0,key:t}}}else Xt(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Y2=()=>Ya.__FEDERATION__.moduleInfo,zae=(e,t)=>{const n=ol(t,Jp(e)).value;if(n&&!n.version&&"version"in e&&e.version&&(n.version=e.version),n)return n;if("version"in e&&e.version){const{version:a,...s}=e,p=Jp(s),f=ol(Ya.__FEDERATION__.moduleInfo,p).value;if(f?.version===a)return f}},xp=e=>zae(e,Ya.__FEDERATION__.moduleInfo),X2=(e,t)=>{const n=Jp(e);return Ya.__FEDERATION__.moduleInfo[n]=t,Ya.__FEDERATION__.moduleInfo},Lae=e=>(Ya.__FEDERATION__.moduleInfo={...Ya.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const n of t)delete Ya.__FEDERATION__.moduleInfo[n]}),m0=(e,t)=>{const n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:zn[n]}},qae=()=>Ya.__FEDERATION__.__GLOBAL_PLUGIN__,Bae=e=>zn.__FEDERATION__.__PRELOADED_MAP__.get(e),Uae=e=>zn.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),J2="[0-9A-Za-z-]+",f0=`(?:\\+(${J2}(?:\\.${J2})*))`,_c="0|[1-9]\\d*",kp="[0-9]+",G_="\\d*[a-zA-Z-][a-zA-Z0-9-]*",eC=`(?:${kp}|${G_})`,Fae=`(?:-?(${eC}(?:\\.${eC})*))`,tC=`(?:${_c}|${G_})`,Z_=`(?:-(${tC}(?:\\.${tC})*))`,zg=`${_c}|x|X|\\*`,sl=`[v=\\s]*(${zg})(?:\\.(${zg})(?:\\.(${zg})(?:${Z_})?${f0}?)?)?`,Hae=`^\\s*(${sl})\\s+-\\s+(${sl})\\s*$`,$ae=`[v=\\s]*${`(${kp})\\.(${kp})\\.(${kp})`}${Fae}?${f0}?`,h0="((?:<|>)?=?)",Qae=`(\\s*)${h0}\\s*(${$ae}|${sl})`,W_="(?:~>?)",Vae=`(\\s*)${W_}\\s+`,K_="(?:\\^)",Gae=`(\\s*)${K_}\\s+`,Zae="(<|>)?=?\\s*\\*",Wae=`^${K_}${sl}$`,Kae=`v?${`(${_c})\\.(${_c})\\.(${_c})`}${Z_}?${f0}?`,Yae=`^${W_}${sl}$`,Xae=`^${h0}\\s*${sl}$`,Jae=`^${h0}\\s*(${Kae})$|^$`,eie="^\\s*>=\\s*0.0.0\\s*$";function gi(e){return new RegExp(e)}function Yn(e){return!e||e.toLowerCase()==="x"||e==="*"}function Y_(...e){return t=>e.reduce((n,a)=>a(n),t)}function nC(e){return e.match(gi(Jae))}function aC(e,t,n,a){const s=`${e}.${t}.${n}`;return a?`${s}-${a}`:s}function tie(e){return e.replace(gi(Hae),(t,n,a,s,p,f,m,h,c,x,M,C)=>(Yn(a)?n="":Yn(s)?n=`>=${a}.0.0`:Yn(p)?n=`>=${a}.${s}.0`:n=`>=${n}`,Yn(c)?h="":Yn(x)?h=`<${Number(c)+1}.0.0-0`:Yn(M)?h=`<${c}.${Number(x)+1}.0-0`:C?h=`<=${c}.${x}.${M}-${C}`:h=`<=${h}`,`${n} ${h}`.trim()))}function nie(e){return e.replace(gi(Qae),"$1$2$3")}function aie(e){return e.replace(gi(Vae),"$1~")}function iie(e){return e.replace(gi(Gae),"$1^")}function rie(e){return e.trim().split(/\s+/).map(t=>t.replace(gi(Wae),(n,a,s,p,f)=>Yn(a)?"":Yn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Yn(p)?a==="0"?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.0 <${Number(a)+1}.0.0-0`:f?a==="0"?s==="0"?`>=${a}.${s}.${p}-${f} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p}-${f} <${Number(a)+1}.0.0-0`:a==="0"?s==="0"?`>=${a}.${s}.${p} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${Number(a)+1}.0.0-0`)).join(" ")}function oie(e){return e.trim().split(/\s+/).map(t=>t.replace(gi(Yae),(n,a,s,p,f)=>Yn(a)?"":Yn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Yn(p)?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:f?`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`)).join(" ")}function sie(e){return e.split(/\s+/).map(t=>t.trim().replace(gi(Xae),(n,a,s,p,f,m)=>{const h=Yn(s),c=h||Yn(p),x=c||Yn(f);return a==="="&&x&&(a=""),m="",h?a===">"||a==="<"?"<0.0.0-0":"*":a&&x?(c&&(p=0),f=0,a===">"?(a=">=",c?(s=Number(s)+1,p=0,f=0):(p=Number(p)+1,f=0)):a==="<="&&(a="<",c?s=Number(s)+1:p=Number(p)+1),a==="<"&&(m="-0"),`${a+s}.${p}.${f}${m}`):c?`>=${s}.0.0${m} <${Number(s)+1}.0.0-0`:x?`>=${s}.${p}.0${m} <${s}.${Number(p)+1}.0-0`:n})).join(" ")}function lie(e){return e.trim().replace(gi(Zae),"")}function cie(e){return e.trim().replace(gi(eie),"")}function wp(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function uie(e,t){const{preRelease:n}=e,{preRelease:a}=t;if(n===void 0&&a)return 1;if(n&&a===void 0)return-1;if(n===void 0&&a===void 0)return 0;for(let s=0,p=n.length;s<=p;s++){const f=n[s],m=a[s];if(f!==m)return f===void 0&&m===void 0?0:f?m?wp(f,m):-1:1}return 0}function Gd(e,t){return wp(e.major,t.major)||wp(e.minor,t.minor)||wp(e.patch,t.patch)||uie(e,t)}function Lg(e,t){return e.version===t.version}function die(e,t){switch(e.operator){case"":case"=":return Lg(e,t);case">":return Gd(e,t)<0;case">=":return Lg(e,t)||Gd(e,t)<0;case"<":return Gd(e,t)>0;case"<=":return Lg(e,t)||Gd(e,t)>0;case void 0:return!0;default:return!1}}function pie(e){return Y_(rie,oie,sie,lie)(e)}function mie(e){return Y_(tie,nie,aie,iie)(e.trim()).split(/\s+/).join(" ")}function Mc(e,t){if(!e)return!1;const n=nC(e);if(!n)return!1;const[,a,,s,p,f,m]=n,h={operator:a,version:aC(s,p,f,m),major:s,minor:p,patch:f,preRelease:m?.split(".")},c=t.split("||");for(const x of c){const M=x.trim();if(!M||M==="*"||M==="x")return!0;try{const C=mie(M);if(!C.trim())return!0;const E=C.split(" ").map(P=>pie(P)).join(" ");if(!E.trim())return!0;const R=E.split(/\s+/).map(P=>cie(P)).filter(Boolean);if(R.length===0)continue;let _=!0;for(const P of R){const D=nC(P);if(!D){_=!1;break}const[,L,,B,q,G,ne]=D;if(!die({operator:L,version:aC(B,q,G,ne),major:B,minor:q,patch:G,preRelease:ne?.split(".")},h)){_=!1;break}}if(_)return!0}catch(C){console.error(`[semver] Error processing range part "${M}":`,C);continue}}return!1}var Tm="default",fie="global";function hie(e,t,n,a){let s;return"get"in e?s=e.get:"lib"in e?s=()=>Promise.resolve(e.lib):s=()=>Promise.resolve(()=>{Xt(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Xt(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:s,loaded:e?.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??a)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Cy.UNKNOWN,useIn:[]}:void 0}}function X_(e,t){const n=t.shared||{},a=t.name,s=Object.keys(n).reduce((f,m)=>{const h=$_(n[m]);return f[m]=f[m]||[],h.forEach(c=>{f[m].push(hie(c,a,m,t.shareStrategy))}),f},{}),p={...e.shared};return Object.keys(s).forEach(f=>{p[f]?s[f].forEach(m=>{p[f].find(h=>h.version===m.version)||p[f].push(m)}):p[f]=s[f]}),{allShareInfos:p,newShareInfos:s}}function Wc(e,t){if(!e)return!1;const{status:n,mode:a}=e;return n===Cy.NO_USE?!1:n===Cy.CALCULATED?!0:a==="runtime-infer"?t?vie(e,t):!0:!1}function Ro(e,t){const n=a=>{if(!Number.isNaN(Number(a))){const s=a.split(".");let p=a;for(let f=0;f<3-s.length;f++)p+=".0";return p}return a};return!!Mc(n(e),`<=${n(t)}`)}var Kc=(e,t)=>{const n=t||function(a,s){return Ro(a,s)};return Object.keys(e).reduce((a,s)=>!a||n(a,s)||a==="0"?s:a,0)},em=e=>!!e.loaded||typeof e.lib=="function",gie=e=>!!e.loading,vie=(e,t)=>{if(!e||!t)return!1;const{usedExports:n}=e;return n?!!t.every(a=>n.includes(a)):!1};function yie(e,t,n,a){const s=e[t][n];let p="",f=Wc(a);const m=function(h,c){return f?s[h].treeShaking?s[c].treeShaking?!em(s[h].treeShaking)&&Ro(h,c):!1:!0:!em(s[h])&&Ro(h,c)};if(f){if(p=Kc(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:Kc(e[t][n],m),useTreesShaking:f}}var Ts=e=>em(e)||gie(e);function bie(e,t,n,a){const s=e[t][n];let p="",f=Wc(a);const m=function(h,c){if(f){if(!s[h].treeShaking)return!0;if(!s[c].treeShaking)return!1;if(Ts(s[c].treeShaking))return Ts(s[h].treeShaking)?!!Ro(h,c):!0;if(Ts(s[h].treeShaking))return!1}return Ts(s[c])?Ts(s[h])?!!Ro(h,c):!0:Ts(s[h])?!1:Ro(h,c)};if(f){if(p=Kc(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:Kc(e[t][n],m),useTreesShaking:f}}function Sie(e){return e==="loaded-first"?bie:yie}function Mp(e,t,n,a){if(!e)return;const{shareConfig:s,scope:p=Tm,strategy:f,treeShaking:m}=n,h=Array.isArray(p)?p:[p];for(const c of h)if(s&&e[c]&&e[c][t]){const{requiredVersion:x}=s,{version:M,useTreesShaking:C}=Sie(f)(e,c,t,m),E=()=>{const _=e[c][t][M];if(s.singleton){if(typeof x=="string"&&!Mc(M,x)){const P=`Version ${M} from ${M&&_.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${x})`;s.strictVersion?Xt(P):Gc(P)}return{shared:_,useTreesShaking:C}}else{if(x===!1||x==="*")return{shared:_,useTreesShaking:C};if(Mc(M,x))return{shared:_,useTreesShaking:C};const P=Wc(m);if(P){for(const[D,L]of Object.entries(e[c][t]))if(Wc(L.treeShaking,m?.usedExports)&&Mc(D,x))return{shared:L,useTreesShaking:P}}for(const[D,L]of Object.entries(e[c][t]))if(Mc(D,x))return{shared:L,useTreesShaking:!1}}},R={shareScopeMap:e,scope:c,pkgName:t,version:M,GlobalFederation:Zc.__FEDERATION__,shareInfo:n,resolver:E};return(a.emit(R)||R).resolver()}}function J_(){return Zc.__FEDERATION__.__SHARE__}function iC(e){const{pkgName:t,extraOptions:n,shareInfos:a}=e,s=h=>{if(!h)return;const c={};return h.forEach(M=>{c[M.version]=M}),c[Kc(c,function(M,C){return!em(c[M])&&Ro(M,C)})]},p=n?.resolver??s,f=h=>h!==null&&typeof h=="object"&&!Array.isArray(h),m=(...h)=>{const c={};for(const x of h)if(x)for(const[M,C]of Object.entries(x)){const E=c[M];f(E)&&f(C)?c[M]=m(E,C):C!==void 0&&(c[M]=C)}return c};return m(p(a[t]),n?.customShareInfo)}var _s=(e,t)=>{e.useIn||(e.useIn=[]),Nae(e.useIn,t)};function Zd(e,t){return t&&e.treeShaking?e.treeShaking:e}function g0(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function rC(e,t){for(const n of e){const a=t.startsWith(n.name);let s=t.replace(n.name,"");if(a){if(s.startsWith("/")){const m=n.name;return s=`.${s}`,{pkgNameOrAlias:m,expose:s,remote:n}}else if(s==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const p=n.alias&&t.startsWith(n.alias);let f=n.alias&&t.replace(n.alias,"");if(n.alias&&p){if(f&&f.startsWith("/")){const m=n.alias;return f=`.${f}`,{pkgNameOrAlias:m,expose:f,remote:n}}else if(f==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function xie(e,t){for(const n of e)if(t===n.name||n.alias&&t===n.alias)return n}var eN="RUNTIME-001",tN="RUNTIME-002",nN="RUNTIME-003",aN="RUNTIME-004",iN="RUNTIME-005",_y="RUNTIME-006",rN="RUNTIME-007",oN="RUNTIME-008",kie="RUNTIME-009",sN="RUNTIME-010",lN="RUNTIME-011",wie="RUNTIME-012",cN="RUNTIME-013",uN="RUNTIME-014",dN="RUNTIME-015",pa={[eN]:"Failed to get remoteEntry exports.",[tN]:'The remote entry interface does not contain "init"',[nN]:"Failed to get manifest.",[aN]:"Failed to locate remote.",[iN]:"Invalid loadShareSync function call from bundler runtime",[_y]:"Invalid loadShareSync function call from runtime",[rN]:"Failed to get remote snapshot.",[oN]:"Failed to load script resources.",[kie]:"Please call createInstance first.",[sN]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[lN]:"The remoteEntry URL is missing from the remote snapshot.",[wie]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',[cN]:"The manifest is not a valid Module Federation manifest.",[uN]:"The remote does not expose the requested module.",[dN]:"Remote container initialization failed."};({...pa});var pN=".then(callbacks[0]).catch(callbacks[1])";async function Mie({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${pN}`)([n,a]):import(e).then(n).catch(a)}catch(s){Xt(`Failed to load ESM entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}async function Cie({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof __system_context__>"u"?System.import(e).then(n).catch(a):new Function("callbacks",`System.import("${e}")${pN}`)([n,a])}catch(s){Xt(`Failed to load SystemJS entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}function mN(e,t,n){const{remoteEntryKey:a,entryExports:s}=m0(e,t);return s||Xt(eN,pa,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:a}),s}async function Aie({name:e,globalName:t,entry:n,remoteInfo:a,loaderHook:s,getEntryUrl:p,resourceContext:f}){const{entryExports:m}=m0(e,t);if(m)return m;const h=p?p(n):n;return Aae(h,{attrs:{},createScriptHook:(c,x)=>{const M=s.lifecycle.createScript.emit({url:c,attrs:x,remoteInfo:a,resourceContext:f?{...f,url:c}:void 0});if(M&&(M instanceof HTMLScriptElement||"script"in M||"timeout"in M))return M}}).then(()=>mN(e,t,n),c=>{const x=c instanceof Error?c.message:String(c);Xt(oN,pa,{remoteName:e,resourceUrl:h},x)})}async function Eie({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:a,resourceContext:s}){const{entry:p,entryGlobalName:f,name:m,type:h}=e;switch(h){case"esm":case"module":return Mie({entry:p,remoteEntryExports:t});case"system":return Cie({entry:p,remoteEntryExports:t});default:return Aie({entry:p,globalName:f,name:m,remoteInfo:e,loaderHook:n,getEntryUrl:a,resourceContext:s})}}async function Rie({remoteInfo:e,loaderHook:t,resourceContext:n}){const{entry:a,entryGlobalName:s,name:p,type:f}=e,{entryExports:m}=m0(p,s);return m||Iae(a,{attrs:{name:p,globalName:s,type:f},loaderHook:{createScriptHook:(h,c={})=>{const x=t.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:e,resourceContext:n?{...n,url:h}:void 0});if(x&&"url"in x)return x}}}).then(()=>mN(p,s,a)).catch(h=>{Xt(`Failed to load Node.js entry for remote "${p}" from "${a}". ${h instanceof Error?h.message:String(h)}`)})}function Ny(e){const{entry:t,name:n}=e;return P_(n,t)}async function v0(e){const{origin:t,remoteEntryExports:n,remoteInfo:a,getEntryUrl:s,resourceContext:p,_inErrorHandling:f=!1}=e,m=Ny(a);if(n)return n;if(!Hs[m]){const h=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;Hs[m]=h.emit({origin:t,loaderHook:c,remoteInfo:a,remoteEntryExports:n}).then(x=>x||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":$r)?Eie({remoteInfo:a,remoteEntryExports:n,loaderHook:c,getEntryUrl:s,resourceContext:p}):Rie({remoteInfo:a,loaderHook:c,resourceContext:p}))).then(async x=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:x}),x)).catch(async x=>{const M=Ny(a),C=x instanceof Error&&x.message.includes("ScriptExecutionError");if(x instanceof Error&&x.message.includes("RUNTIME-008")&&!C&&!f){const E=_=>v0({..._,_inErrorHandling:!0}),R=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:E,origin:t,remoteInfo:a,remoteEntryExports:n,globalLoading:Hs,uniqueKey:M});if(R)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:R,recovered:!0}),R}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,error:x}),x})}return Hs[m]}function $s(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function Iie(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Tie(e,t){const n=qae(),a=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(s=>{e?.find(p=>p.name!==s.name)&&e.push(s)}),e&&e.length>0&&e.forEach(s=>{a.forEach(p=>{p.applyPlugin(s,t)})}),e}function _ie(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Zi(e){const t={};for(const[n,a]of Object.entries(e.shared)){const s=a[0];s&&(t[n]={version:s.version,singleton:s.shareConfig?.singleton,requiredVersion:s.shareConfig?.requiredVersion===!1?!1:s.shareConfig?.requiredVersion,eager:s.eager,strictVersion:s.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(_ie)??[],shared:t}}}function fN(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Nie(e,t){return t.map(n=>{const a=xie(e,n.nameOrAlias);return Qi(a,`Unable to preload ${n.nameOrAlias} as it is not included in ${!a&&D_({remoteInfo:a,remotes:e})}`),{remote:a,preloadConfig:fN(n)}})}function Oie(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function y0(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function Io(e,t,n,a){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:a}}async function Pie(e,t,n,a){const s=e.moduleCache.get(n.name),p=n.entry;if(s?.remoteEntryExports)return Io(a,p,"cached");try{if(!await v0({origin:e,remoteInfo:n,remoteEntryExports:s?.remoteEntryExports,resourceContext:{...a,url:p}}))throw new Error(`Failed to load remoteEntry "${p}".`);return Io(a,p,"success")}catch(f){return Io(a,p,y0(f)?"timeout":"error",f)}}function qg({host:e,remoteInfo:t,url:n,attrs:a,context:s,needDeleteLink:p}){return new Promise(f=>{const{link:m,needAttach:h}=Cae({url:n,cb:()=>{f(Io(s,n,h?"success":"cached"))},onErrorCallback:c=>{f(Io(s,n,y0(c)?"timeout":"error",c))},attrs:a,createLinkHook:(c,x)=>{const M=e.loaderHook.lifecycle.createLink.emit({url:c,attrs:x,remoteInfo:t,resourceContext:{...s,url:c}});return M instanceof HTMLLinkElement,M},needDeleteLink:p});h&&document.head.appendChild(m)})}function jie({host:e,remoteInfo:t,url:n,attrs:a,context:s}){return new Promise(p=>{const{script:f,needAttach:m}=B_({url:n,cb:()=>{p(Io(s,n,m?"success":"cached"))},onErrorCallback:h=>{p(Io(s,n,y0(h)?"timeout":"error",h))},attrs:a,createScriptHook:(h,c)=>{const x=e.loaderHook.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:t,resourceContext:{...s,url:h}});return x instanceof HTMLScriptElement,x},needDeleteScript:!0});m&&document.head.appendChild(f)})}function mc(e,t){return{...e,resourceType:t}}function hN(e,t,n,a=!0,s={initiator:"preloadRemote",id:e.name}){const{cssAssets:p,jsAssetsWithoutEntry:f,entryAssets:m}=n,h=[];if(t.options.inBrowser){if(m.forEach(c=>{const{moduleInfo:x}=c;h.push(Pie(t,e,x,mc(s,"remoteEntry")))}),a){const c={rel:"preload",as:"style"};p.forEach(x=>{h.push(qg({host:t,remoteInfo:e,url:x,attrs:c,context:mc(s,"css")}))})}else{const c={rel:"stylesheet",type:"text/css"};p.forEach(x=>{h.push(qg({host:t,remoteInfo:e,url:x,attrs:c,needDeleteLink:!1,context:mc(s,"css")}))})}if(a){const c={rel:"preload",as:"script"};f.forEach(x=>{h.push(qg({host:t,remoteInfo:e,url:x,attrs:c,context:mc(s,"js")}))})}else{const c={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};f.forEach(x=>{h.push(jie({host:t,remoteInfo:e,url:x,attrs:c,context:mc(s,"js")}))})}}return Promise.all(h)}function Die(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(n=>n.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function zie(e,t,n){const a=t,s=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];s.length||s.push("default"),s.forEach(f=>{a[f]||(a[f]={})});const p={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?s:e.shareScope||"default"};return Object.defineProperty(p,"shareScopeMap",{value:a,enumerable:!1}),{remoteEntryInitOptions:p,shareScope:a[s[0]],initScope:n??[]}}var gN=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await v0({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:g0(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return Qi(t,`remoteEntryExports is undefined
81
- ${D_(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,a){const s=await this.getEntry(a);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,cached:!0,origin:this.host}),p}return s}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:p,shareScope:f,initScope:m}=zie(this.remoteInfo,this.host.shareScopeMap,n),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:f,remoteEntryInitOptions:p,initScope:m,remoteInfo:this.remoteInfo,origin:this.host});typeof s?.init>"u"&&Xt(tN,pa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Zi(this.host.options));try{await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions)}catch(c){Xt(dN,pa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${c}`,Zi(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,origin:this.host}),p}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,n,a){const{loadFactory:s=!0}=n||{loadFactory:!0},p=await this.init(e,a,void 0,t);this.lib=p,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,origin:this.host});let f;try{const c=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:p,expose:t,moduleInfo:this.remoteInfo});f=typeof c=="function"?c:void 0,f||(f=await p.get(t)),f||Xt(uN,pa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Die(a)},void 0,Zi(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,moduleFactory:f,origin:this.host})}catch(c){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,error:c,origin:this.host}),c}const m=jae(this.remoteInfo.name,t),h=this.wraperFactory(f,m);if(!s)return h;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,origin:this.host});try{const c=await h();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,exposeModule:c,origin:this.host}),c}catch(c){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,error:c,origin:this.host}),c}}wraperFactory(e,t){function n(a,s){a&&typeof a=="object"&&Object.isExtensible(a)&&!Object.getOwnPropertyDescriptor(a,Symbol.for("mf_module_id"))&&Object.defineProperty(a,Symbol.for("mf_module_id"),{value:s,enumerable:!1})}return()=>{const a=e();return a instanceof Promise?a.then(s=>(n(s,t),s)):(n(a,t),a)}}},ua=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function n(...a){return t.remove(n),e.apply(null,a)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{const a=n(...e);a!==void 0&&(t=a)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},Mn=class extends ua{emit(...e){let t;const n=Array.from(this.listeners);if(n.length>0){let a=0;const s=p=>p===!1?!1:a<n.length?Promise.resolve(n[a++].apply(null,e)).then(f=>f===void 0||e.length===1&&f===e[0]?s(p):s(f)):p;t=s()}return Promise.resolve(t)}};function vN(e,t){if(!p0(t))return!1;if(e!==t){for(const n in e)if(!(n in t))return!1}return!0}var Zs=class extends ua{constructor(e){super(),this.onerror=Xt,this.type=e}emit(e){p0(e)||Xt(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const n=t(e);if(n===void 0)continue;if(vN(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){Gc(n),this.onerror(n)}return e}},zr=class extends ua{constructor(e){super(),this.onerror=Xt,this.type=e}emit(e){p0(e)||Xt(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let n=0;const a=p=>(Gc(p),this.onerror(p),e),s=p=>{if(p!==void 0&&vN(e,p))e=p;else if(p!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(s,a)}catch(f){return a(f)}return e};return Promise.resolve(s(e))}return Promise.resolve(e)}},Ws=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Qi(Pae(e),"Plugin configuration is invalid.");const n=e.name;Qi(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach(a=>{const s=e[a];s&&this.lifecycle[a].on(s)}))}removePlugin(e){Qi(e,"A name is required.");const t=this.registerPlugins[e];Qi(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(t[n])})}};function yN(e,t){const n=Q_(t);n.url||Xt(lN,pa,{remoteName:e.name});let a=Ey(t,n.url);!$r&&!a.startsWith("http")&&(a=`https:${a}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=a,e.version=t.version,e.buildVersion=t.buildVersion}function Lie(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:n,expose:a,origin:s,remoteInfo:p,id:f}=e;if(!d0(t)||!H_(t)){const{remoteSnapshot:m,globalSnapshot:h}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:g0(t.name,a)});yN(p,m);const c={remote:t,preloadConfig:{nameOrAlias:n,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},x=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:c,remoteInfo:p,remote:t,remoteSnapshot:m,globalSnapshot:h});return x&&hN(p,s,x,!1,{initiator:"loadRemote",id:f}).catch(()=>{}),{...e,remoteSnapshot:m}}return e}}}function qie(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function bN(e,t,n,a,s={},p){const{value:f}=ol(e,Jp(t)),m=p||f;if(m&&!z_(m)&&(n(m,t,a),m.remotesInfo)){const h=Object.keys(m.remotesInfo);for(const c of h){if(s[c])continue;s[c]=!0;const x=qie(c),M=m.remotesInfo[c];bN(e,{name:x.name,version:M.matchedVersion},n,!1,s,void 0)}}}var Bg=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function Bie(e,t,n,a,s){const p=[],f=[],m=[],h=new Set,c=new Set,{options:x}=e,{preloadConfig:M}=t,{depsRemote:C}=M;if(bN(a,n,(R,_,P)=>{let D;if(P)D=M;else if(Array.isArray(C)){const ne=C.find(V=>V.nameOrAlias===_.name||V.nameOrAlias===_.alias);if(!ne)return;D=fN(ne)}else if(C===!0)D=M;else return;const L=Ey(R,Q_(R).url);L&&m.push({name:_.name,moduleInfo:{name:_.name,entry:L,type:"remoteEntryType"in R?R.remoteEntryType:"global",entryGlobalName:"globalName"in R?R.globalName:_.name,shareScope:"",version:"version"in R?R.version:void 0},url:L});let B="modules"in R?R.modules:[];const q=Oie(D.exposes);q.length&&"modules"in R&&(B=R?.modules?.reduce((ne,V)=>(q?.indexOf(V.moduleName)!==-1&&ne.push(V),ne),[]));function G(ne){const V=ne.map(U=>Ey(R,U));return D.filter?V.filter(D.filter):V}if(B){const ne=B.length;for(let V=0;V<ne;V++){const U=B[V],me=`${_.name}/${U.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:U.moduleName==="."?_.name:me,name:_.name,remoteSnapshot:R,preloadConfig:D,remote:_,origin:e}),!Bae(me)&&(D.resourceCategory==="all"?(p.push(...G(U.assets.css.async)),p.push(...G(U.assets.css.sync)),f.push(...G(U.assets.js.async)),f.push(...G(U.assets.js.sync))):D.resourceCategory==="sync"&&(p.push(...G(U.assets.css.sync)),f.push(...G(U.assets.js.sync))),Uae(me))}}},!0,{},s),s.shared&&s.shared.length>0){const R=(_,P)=>{const{shared:D}=Mp(e.shareScopeMap,P.sharedName,_,e.sharedHandler.hooks.lifecycle.resolveShare)||{};D&&typeof D.lib=="function"&&(P.assets.js.sync.forEach(L=>{h.add(L)}),P.assets.css.sync.forEach(L=>{c.add(L)}))};s.shared.forEach(_=>{const P=x.shared?.[_.sharedName];if(!P)return;const D=_.version?P.find(L=>L.version===_.version):P;D&&$_(D).forEach(L=>{R(L,_)})})}const E=f.filter(R=>!h.has(R)&&!Bg("script",R));return{cssAssets:p.filter(R=>!c.has(R)&&!Bg("link",R)),jsAssetsWithoutEntry:E,entryAssets:m.filter(R=>!Bg("script",R.url))}}var Uie=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:n,remoteInfo:a,remote:s,globalSnapshot:p,remoteSnapshot:f}=e;return $r?d0(s)&&H_(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:a.name,entry:s.entry,type:a.type||"global",entryGlobalName:"",shareScope:""}}]}:(yN(a,f),Bie(t,n,a,p,f)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function SN(e,t){const n=xp({name:t.name,version:t.options.version}),a=n&&"remotesInfo"in n&&n.remotesInfo&&ol(n.remotesInfo,e.name).value;return a&&a.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Y2(),remoteSnapshot:xp({name:e.name,version:a.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Y2(),remoteSnapshot:xp({name:e.name,version:"version"in e?e.version:void 0})}}var Fie=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Ws({beforeLoadRemoteSnapshot:new Mn("beforeLoadRemoteSnapshot"),loadSnapshot:new zr("loadGlobalSnapshot"),loadRemoteSnapshot:new zr("loadRemoteSnapshot"),afterLoadSnapshot:new zr("afterLoadSnapshot")}),this.manifestLoading=Zc.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n="loadRemote"}){const{options:a}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:a,moduleInfo:e,origin:this.HostInstance});let s=xp({name:this.HostInstance.options.name,version:this.HostInstance.options.version});s||(s={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Lae({[this.HostInstance.options.name]:s})),s&&"remotesInfo"in s&&!ol(s.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(s.remotesInfo={...s?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:a,moduleInfo:e,hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m});let x,M;if(h)if(z_(h)){const C=$r?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",E=await this.loadManifestSnapshot(C,e,{},{initiator:n,id:t||e.name}),R=X2({...e,entry:C},E);x=E,M=R}else{const{remoteSnapshot:C}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});x=C,M=c}else if(d0(e)){const C=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),E=X2(e,C);x=C,M=E}else Xt(rN,pa,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,Zi(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:a,moduleInfo:e,remoteSnapshot:x}),{remoteSnapshot:x,globalSnapshot:M}}getGlobalRemoteInfo(e){return SN(e,this.HostInstance)}async getManifestJson(e,t,n,a){return(async()=>{const p=$s(t);let f=this.manifestCache.get(e);if(f)return f;try{let h=await this.loaderHook.lifecycle.fetch.emit(e,{},p,a?{...a,url:e,resourceType:"manifest"}:void 0);(!h||!(h instanceof Response))&&(h=await fetch(e,{})),f=await h.json()}catch(h){f=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),f||(delete this.manifestLoading[e],Xt(nN,pa,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,Zi(this.HostInstance.options)))}const m=[!f.metaData&&"metaData",!f.exposes&&"exposes",!f.shared&&"shared"].filter(Boolean);return m.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${m.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),m.length>0&&Xt(cN,pa,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:m.join(",")},void 0,Zi(this.HostInstance.options)),this.manifestCache.set(e,f),f})()}async loadManifestSnapshot(e,t,n,a){const s=async()=>{const p=await this.getManifestJson(e,t,n,a),f=bae(p,{version:e}),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:p,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return m};return this.manifestLoading[e]||(this.manifestLoading[e]=s().then(p=>p)),this.manifestLoading[e]}},Hie=class{constructor(e){this.hooks=new Ws({beforeRegisterShare:new Zs("beforeRegisterShare"),afterResolve:new zr("afterResolve"),beforeLoadShare:new zr("beforeLoadShare"),loadShare:new Mn,afterLoadShare:new ua("afterLoadShare"),errorLoadShare:new ua("errorLoadShare"),resolveShare:new Zs("resolveShare"),initContainerShareScopeMap:new Zs("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:a}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:a,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(s){Gc(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:a,recovered:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:a,recovered:s})}catch(p){Gc(p)}}registerShared(e,t){const{newShareInfos:n,allShareInfos:a}=X_(e,t);return Object.keys(n).forEach(s=>{n[s].forEach(p=>{p.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:s,shared:p}),this.shareScopeMap[f]?.[s]||this.setShared({pkgName:s,lib:p.lib,get:p.get,loaded:p.loaded||!!p.lib,shared:p,from:t.name})})})}),{newShareInfos:n,allShareInfos:a}}async loadShare(e,t){const{host:n}=this,a=iC({pkgName:e,extraOptions:t,shareInfos:n.options.shared});let s=a;try{a?.scope&&await Promise.all(a.scope.map(async h=>{await Promise.all(this.initializeSharing(h,{strategy:a.strategy}))})),s=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:a,shared:n.options.shared,origin:n})).shareInfo,Qi(s,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const p=s,{shared:f,useTreesShaking:m}=Mp(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(f){const h=Zd(f,m);if(h.lib)return _s(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),h.lib;if(h.loading&&!h.loaded){const c=await h.loading;return h.loaded=!0,h.lib||(h.lib=c),_s(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),c}else{const x=(async()=>{const C=await h.get();return _s(h,n.options.name),h.loaded=!0,h.lib=C,C})();this.setShared({pkgName:e,loaded:!1,shared:f,from:n.options.name,lib:null,loading:x,treeShaking:m?h:void 0});const M=await x;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),M}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,recovered:!0}),!1;const h=Wc(p.treeShaking),c=Zd(p,h),M=(async()=>{const E=await c.get();c.lib=E,c.loaded=!0,_s(c,n.options.name);const{shared:R,useTreesShaking:_}=Mp(this.shareScopeMap,e,p,this.hooks.lifecycle.resolveShare)||{};if(R){const P=Zd(R,_);P.lib=E,P.loaded=!0,R.from=p.from}return E})();this.setShared({pkgName:e,loaded:!1,shared:p,from:n.options.name,lib:null,loading:M,treeShaking:h?c:void 0});const C=await M;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:p}),C}}catch(p){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:p}),p}}initializeSharing(e=Tm,t){const{host:n}=this,a=t?.from,s=t?.strategy;let p=t?.initScope;const f=[];if(a!=="build"){const{initTokens:C}=this;p||(p=[]);let E=C[e];if(E||(E=C[e]={from:this.host.name}),p.indexOf(E)>=0)return f;p.push(E)}const m=this.shareScopeMap,h=n.options.name;m[e]||(m[e]={});const c=m[e],x=(C,E)=>{const{version:R,eager:_}=E;c[C]=c[C]||{};const P=c[C],D=P[R]&&Zd(P[R]),L=!!(D&&("eager"in D&&D.eager||"shareConfig"in D&&D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!_!=!L?_:h>P[R].from))&&(P[R]=E)},M=async C=>{const{module:E}=await n.remoteHandler.getRemoteModuleAndOptions({id:C});let R;try{R=await E.getEntry()}catch(_){if(R=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:C,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:E.remoteInfo,origin:n}),!R)return}finally{R?.init&&!E.initing&&(E.remoteEntryExports=R,await E.init(void 0,void 0,p))}};return Object.keys(n.options.shared).forEach(C=>{n.options.shared[C].forEach(E=>{E.scope.includes(e)&&x(C,E)})}),(n.options.shareStrategy==="version-first"||s==="version-first")&&n.options.remotes.forEach(C=>{C.shareScope===e&&f.push(M(C.name))}),f}loadShareSync(e,t){const{host:n}=this,a=iC({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{a?.scope&&a.scope.forEach(p=>{this.initializeSharing(p,{strategy:a.strategy})});const{shared:s}=Mp(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){if(typeof s.lib=="function")return _s(s,n.options.name),s.loaded||(s.loaded=!0,s.from===n.options.name&&(a.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),s.lib;if(typeof s.get=="function"){const p=s.get();if(!(p instanceof Promise))return _s(s,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:p,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),p}}if(a.lib)return a.loaded||(a.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib;if(a.get){const p=a.get();return p instanceof Promise&&Xt(t?.from==="build"?iN:_y,pa,{hostName:n.options.name,sharedPkgName:e},void 0,Zi(n.options)),a.lib=p,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:a.lib,shared:a}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib}Xt(_y,pa,{hostName:n.options.name,sharedPkgName:e},void 0,Zi(n.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,error:s}),s}}initShareScopeMap(e,t,n={}){const{host:a}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:a.options,origin:a,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:a,loading:s,loaded:p,get:f,treeShaking:m}){const{version:h,scope:c="default",...x}=t,M=Array.isArray(c)?c:[c],C=E=>{const R=(P,D,L)=>{L&&!P[D]&&(P[D]=L)},_=m?E.treeShaking:E;R(_,"loaded",p),R(_,"loading",s),R(_,"get",f)};M.forEach(E=>{this.shareScopeMap[E]||(this.shareScopeMap[E]={}),this.shareScopeMap[E][e]||(this.shareScopeMap[E][e]={}),this.shareScopeMap[E][e][h]||(this.shareScopeMap[E][e][h]={version:h,scope:[E],...x,lib:a});const R=this.shareScopeMap[E][e][h];C(R),n&&R.from!==n&&(R.from=n)})}_setGlobalShareScopeMap(e){const t=J_(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},$ie=class{constructor(e){this.hooks=new Ws({beforeRegisterRemote:new Zs("beforeRegisterRemote"),registerRemote:new Zs("registerRemote"),beforeRequest:new zr("beforeRequest"),afterMatchRemote:new Mn("afterMatchRemote"),onLoad:new Mn("onLoad"),afterLoadRemote:new Mn("afterLoadRemote"),handlePreloadModule:new ua("handlePreloadModule"),errorLoadRemote:new Mn("errorLoadRemote"),beforePreloadRemote:new Mn("beforePreloadRemote"),generatePreloadAssets:new Mn("generatePreloadAssets"),afterPreloadRemote:new Mn("afterPreloadRemote"),loadEntry:new Mn}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((n,a)=>(this.registerRemote(a,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,t){const{remote:n,expose:a}=t,{name:s,alias:p}=n;if(this.idToRemoteMap[e]={name:n.name,expose:a},p&&e.startsWith(s)){const f=e.replace(s,p);this.idToRemoteMap[f]={name:n.name,expose:a};return}if(p&&e.startsWith(p)){const f=e.replace(p,s);this.idToRemoteMap[f]={name:n.name,expose:a}}}async loadRemote(e,t){const{host:n}=this,a=rC(n.options.remotes,e);let s=e,p=a?.expose,f=a?$s(a.remote):void 0,m;try{const{loadFactory:h=!0}=t||{loadFactory:!0},{module:c,moduleOptions:x,remoteMatchInfo:M}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:C,remote:E,expose:R,id:_,remoteSnapshot:P}=M;s=_,p=R,f=$s(E);const D=await c.get(_,R,t,P),L=await this.hooks.lifecycle.onLoad.emit({id:_,pkgNameOrAlias:C,expose:R,exposeModule:h?D:void 0,exposeModuleFactory:h?void 0:D,remote:E,options:x,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,M),m={id:s,expose:p,remote:f,options:t,origin:n},typeof L=="function"?L:D}catch(h){const{from:c="runtime"}=t||{from:"runtime"};let x;try{x=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:c,lifecycle:"onLoad",expose:p,remote:f,origin:n})}catch(M){throw m={id:s,expose:p,remote:f,options:t,error:M,origin:n},M}if(!x)throw m={id:s,expose:p,remote:f,options:t,error:h,origin:n},h;return m={id:s,expose:p,remote:f,options:t,error:h,origin:n,recovered:!0},x}finally{m&&await this.hooks.lifecycle.afterLoadRemote.emit(m)}}async preloadRemote(e){const{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const a=Nie(t.options.remotes,e),s=m=>{const{preloadConfig:h,remote:c}=m,x=h.exposes||[];return x.length?x.map(M=>({ops:{...m,preloadConfig:{...h,exposes:[M]}},id:g0(c.name,M)})):[{ops:m,id:`${c.name}/*`}]};let p;await Promise.all(a.flatMap(s).map(async m=>{const{ops:h,id:c}=m,{remote:x,preloadConfig:M}=h,C=$s(x);try{const{globalSnapshot:E,remoteSnapshot:R}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:x,id:c,initiator:"preloadRemote"}),_=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:h,remote:x,remoteInfo:C,globalSnapshot:E,remoteSnapshot:R});if(!_)return;const P=await hN(C,t,_,!0,{initiator:"preloadRemote",id:c});n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:P})}catch(E){n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:[{url:C.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(C.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:c,error:E}]})}}));const f=n.flatMap(m=>m.results.filter(h=>h.status==="error"||h.status==="timeout"));if(f.length>0&&(p=new Error(`preloadRemote failed to load ${f.length} resource(s).`),Object.assign(p,{results:n,failedResults:f})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:p}),p)throw p}registerRemotes(e,t){const{host:n}=this;e.forEach(a=>{this.registerRemote(a,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:n}=e;let a;try{a=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(E){if(a=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:"runtime",error:E,lifecycle:"beforeRequest"}),!a)throw E}const{id:s}=a,p=rC(t.options.remotes,s);if(!p)try{Xt(aN,pa,{hostName:t.options.name,requestId:s},void 0,Zi(t.options))}catch(E){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:s,options:t.options,error:E,origin:t}),E}const{remote:f}=p,m=$s(f);await this.hooks.lifecycle.afterMatchRemote.emit({id:s,...p,options:t.options,remoteInfo:m,origin:t});const h=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:s,...p,options:t.options,origin:t,remoteInfo:m}),{remote:c,expose:x}=h;Qi(c&&x,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${s}.`);let M=t.moduleCache.get(c.name);const C={host:t,remoteInfo:m};return M||(M=new gN(C),t.moduleCache.set(c.name,M)),{module:M,moduleOptions:C,remoteMatchInfo:h}}registerRemote(e,t,n){const{host:a}=this,s=()=>{if(e.alias){const f=t.find(m=>e.alias&&(m.name.startsWith(e.alias)||m.alias?.startsWith(e.alias)));Qi(!f,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${f&&f.name} name or alias`)}"entry"in e&&$r&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Tm),e.type||(e.type=fie)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:a});const p=t.find(f=>f.name===e.name);if(!p)s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a});else{const f=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n?.force&&(this.removeRemote(p),s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a}),j_(f.join(" ")))}}removeRemote(e){try{const{host:t}=this,{name:n}=e,a=t.options.remotes.findIndex(p=>p.name===n);a!==-1&&t.options.remotes.splice(a,1);const s=t.moduleCache.get(e.name);if(s){const p=s.remoteInfo,f=p.entryGlobalName;zn[f]&&(Object.getOwnPropertyDescriptor(zn,f)?.configurable?delete zn[f]:zn[f]=void 0);const m=Ny(s.remoteInfo);Hs[m]&&delete Hs[m],t.snapshotHandler.manifestCache.delete(p.entry);let h=p.buildVersion?P_(p.name,p.buildVersion):p.name;const c=zn.__FEDERATION__.__INSTANCES__.findIndex(M=>p.buildVersion?M.options.id===h:M.name===h);if(c!==-1){const M=zn.__FEDERATION__.__INSTANCES__[c];h=M.options.id||h;const C=J_();let E=!0;const R=[];Object.keys(C).forEach(_=>{const P=C[_];P&&Object.keys(P).forEach(D=>{const L=P[D];L&&Object.keys(L).forEach(B=>{const q=L[B];q&&Object.keys(q).forEach(G=>{const ne=q[G];ne&&typeof ne=="object"&&ne.from===p.name&&(ne.loaded||ne.loading?(ne.useIn=ne.useIn.filter(V=>V!==p.name),ne.useIn.length?E=!1:R.push([_,D,B,G])):R.push([_,D,B,G]))})})})}),E&&(M.shareScopeMap={},delete C[h]),R.forEach(([_,P,D,L])=>{delete C[_]?.[P]?.[D]?.[L]}),zn.__FEDERATION__.__INSTANCES__.splice(c,1)}const{hostGlobalSnapshot:x}=SN(e,t);if(x){const M=x&&"remotesInfo"in x&&x.remotesInfo&&ol(x.remotesInfo,e.name).key;M&&(delete x.remotesInfo[M],Zc.__FEDERATION__.__MANIFEST_LOADING__[M]&&delete Zc.__FEDERATION__.__MANIFEST_LOADING__[M])}t.moduleCache.delete(e.name)}}catch(t){Ty.error(`removeRemote failed: ${t instanceof Error?t.message:String(t)}`)}}},Qie=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Vie=class{constructor(e){this.hooks=new Ws({beforeInit:new Zs("beforeInit"),init:new ua,beforeInitContainer:new zr("beforeInitContainer"),initContainer:new zr("initContainer")}),this.version="2.5.1",this.moduleCache=new Map,this.loaderHook=new Ws({getModuleInfo:new ua,createScript:new ua,createLink:new ua,fetch:new Mn,loadEntryError:new Mn,afterLoadEntry:new Mn("afterLoadEntry"),beforeInitRemote:new Mn("beforeInitRemote"),afterInitRemote:new Mn("afterInitRemote"),beforeGetExpose:new Mn("beforeGetExpose"),afterGetExpose:new Mn("afterGetExpose"),beforeExecuteFactory:new Mn("beforeExecuteFactory"),afterExecuteFactory:new Mn("afterExecuteFactory"),getModuleFactory:new Mn}),this.bridgeHook=new Ws({beforeBridgeRender:new ua,afterBridgeRender:new ua,beforeBridgeDestroy:new ua,afterBridgeDestroy:new ua});const t=Qie?[Lie(),Uie()]:[],n={id:Iie(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:$r};this.name=e.name,this.options=n,this.snapshotHandler=new Fie(this),this.sharedHandler=new Hie(this),this.remoteHandler=new $ie(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&Xt(F_(sN,pa)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=Tm,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){const a=$s({name:e,entry:t}),s=new gN({host:this,remoteInfo:a});return s.remoteEntryExports=n,this.moduleCache.set(e,s),s}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){const{allShareInfos:n}=X_(e,t),{userOptions:a,options:s}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),p=this.remoteHandler.formatAndRegisterRemote(s,a),{allShareInfos:f}=this.sharedHandler.registerShared(s,a),m=[...s.plugins];a.plugins&&a.plugins.forEach(c=>{m.includes(c)||m.push(c)});const h={...e,...t,plugins:m,remotes:p,shared:f,id:a.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:h}),h}registerPlugins(e){const t=Tie(e,this);this.options.plugins=this.options.plugins.reduce((n,a)=>(a&&n&&!n.find(s=>s.name===a.name)&&n.push(a),n),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Dae(Vie);hi("camstack:widget-registry",null);function Pge({title:e,icon:t,headerRight:n,collapsible:a=!1,defaultOpen:s=!0,bodyClassName:p="p-3",children:f}){const[m,h]=T.useState(s),c=!a||m,x=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground",children:[t,e]}),a?m?v.jsx(zo,{className:"h-3.5 w-3.5 text-foreground-subtle"}):v.jsx(sne,{className:"h-3.5 w-3.5 text-foreground-subtle"}):n]}),M=`px-4 py-2 flex items-center justify-between ${c?"border-b border-border":""}`;return v.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[a?v.jsx("button",{type:"button",onClick:()=>h(C=>!C),className:`w-full text-left ${M}`,children:x}):v.jsx("div",{className:M,children:x}),c?v.jsx("div",{className:p,children:f}):null]})}var Gie="capability.binding-changed";function vu(e,t){const[n,a]=T.useState(null);return T.useEffect(()=>{if(t===null){a(null);return}let s=!1;const p=async()=>{try{const m=await e.deviceManager.getBindings.query({deviceId:t});s||a(m)}catch{s||a(m=>m)}};p();const f=e.live?.onEvent.subscribe({category:Gie},{onData:m=>{const h=m.data?.source;if(!h){p();return}h.type==="device"&&h.id===t&&p()}});return()=>{s=!0,f?.unsubscribe()}},[e,t]),T.useMemo(()=>n?eR(e,n):null,[e,n])}function To(e){const t=T.useCallback(a=>e?e.subscribe(()=>a()):()=>{},[e]),n=T.useCallback(()=>e?.value,[e]);return T.useSyncExternalStore(t,n,n)}function vt(e){const t=vu(e.trpc,e.deviceId),n=To(t!==null?e.slice(t):void 0),a=t!==null?e.cap(t):void 0,s=To(t!==null?t.state.deviceStatus:void 0),p=s?.online??!0,f=p?null:s?.lastChangedAt??null;return{dev:t,cap:a,slice:n,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&a!==void 0&&n!==void 0&&p,online:p,offlineSince:f}}function Zie(e){if(e==null||typeof e!="object")return null;const t=Reflect.get(e,"data");if(t!=null&&typeof t=="object"){const n=Reflect.get(t,"capRouteReason");if(typeof n=="string")return n}return null}function jge(e){const t=Zie(e);return t!==null?t==="no-provider"||t==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}function xN(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=xN(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function kN(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=xN(e))&&(a&&(a+=" "),a+=t);return a}var Wie=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},Kie=(e,t)=>({classGroupId:e,validator:t}),wN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tm="-",oC=[],Yie="arbitrary..",Xie=e=>{const t=ere(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Jie(f);const m=f.split(tm);return MN(m,m[0]===""&&m.length>1?1:0,t)},getConflictingClassGroupIds:(f,m)=>{if(m){const h=a[f],c=n[f];return h?c?Wie(c,h):h:c||oC}return n[f]||oC}}},MN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=MN(e,t+1,s);if(h)return h}const p=n.validators;if(p===null)return;const f=t===0?e.join(tm):e.slice(t).join(tm),m=p.length;for(let h=0;h<m;h++){const c=p[h];if(c.validator(f))return c.classGroupId}},Jie=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?Yie+a:void 0})(),ere=e=>{const{theme:t,classGroups:n}=e;return tre(n,t)},tre=(e,t)=>{const n=wN();for(const a in e){const s=e[a];b0(s,n,a,t)}return n},b0=(e,t,n,a)=>{const s=e.length;for(let p=0;p<s;p++){const f=e[p];nre(f,t,n,a)}},nre=(e,t,n,a)=>{if(typeof e=="string"){are(e,t,n);return}if(typeof e=="function"){ire(e,t,n,a);return}rre(e,t,n,a)},are=(e,t,n)=>{const a=e===""?t:CN(t,e);a.classGroupId=n},ire=(e,t,n,a)=>{if(ore(e)){b0(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Kie(n,e))},rre=(e,t,n,a)=>{const s=Object.entries(e),p=s.length;for(let f=0;f<p;f++){const[m,h]=s[f];b0(h,CN(t,m),n,a)}},CN=(e,t)=>{let n=e;const a=t.split(tm),s=a.length;for(let p=0;p<s;p++){const f=a[p];let m=n.nextPart.get(f);m||(m=wN(),n.nextPart.set(f,m)),n=m}return n},ore=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,sre=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(p,f)=>{n[p]=f,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(p){let f=n[p];if(f!==void 0)return f;if((f=a[p])!==void 0)return s(p,f),f},set(p,f){p in n?n[p]=f:s(p,f)}}},Oy="!",sC=":",lre=[],lC=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),cre=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const p=[];let f=0,m=0,h=0,c;const x=s.length;for(let _=0;_<x;_++){const P=s[_];if(f===0&&m===0){if(P===sC){p.push(s.slice(h,_)),h=_+1;continue}if(P==="/"){c=_;continue}}P==="["?f++:P==="]"?f--:P==="("?m++:P===")"&&m--}const M=p.length===0?s:s.slice(h);let C=M,E=!1;M.endsWith(Oy)?(C=M.slice(0,-1),E=!0):M.startsWith(Oy)&&(C=M.slice(1),E=!0);const R=c&&c>h?c-h:void 0;return lC(p,E,C,R)};if(t){const s=t+sC,p=a;a=f=>f.startsWith(s)?p(f.slice(s.length)):lC(lre,!1,f,void 0,!0)}if(n){const s=a;a=p=>n({className:p,parseClassName:s})}return a},ure=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let p=0;p<n.length;p++){const f=n[p],m=f[0]==="[",h=t.has(f);m||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(f)):s.push(f)}return s.length>0&&(s.sort(),a.push(...s)),a}},dre=e=>({cache:sre(e.cacheSize),parseClassName:cre(e),sortModifiers:ure(e),postfixLookupClassGroupIds:pre(e),...Xie(e)}),pre=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)t[n[a]]=!0;return t},mre=/\s+/,fre=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:p,postfixLookupClassGroupIds:f}=t,m=[],h=e.trim().split(mre);let c="";for(let x=h.length-1;x>=0;x-=1){const M=h[x],{isExternal:C,modifiers:E,hasImportantModifier:R,baseClassName:_,maybePostfixModifierPosition:P}=n(M);if(C){c=M+(c.length>0?" "+c:c);continue}let D=!!P,L;if(D){L=a(_.substring(0,P));const V=L&&f[L]?a(_):void 0;V&&V!==L&&(L=V,D=!1)}else L=a(_);if(!L){if(!D){c=M+(c.length>0?" "+c:c);continue}if(L=a(_),!L){c=M+(c.length>0?" "+c:c);continue}D=!1}const B=E.length===0?"":E.length===1?E[0]:p(E).join(":"),q=R?B+Oy:B,G=q+L;if(m.indexOf(G)>-1)continue;m.push(G);const ne=s(L,D);for(let V=0;V<ne.length;++V){const U=ne[V];m.push(q+U)}c=M+(c.length>0?" "+c:c)}return c},hre=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=AN(n))&&(s&&(s+=" "),s+=a);return s},AN=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=AN(e[a]))&&(n&&(n+=" "),n+=t);return n},gre=(e,...t)=>{let n,a,s,p;const f=h=>(n=dre(t.reduce((c,x)=>x(c),e())),a=n.cache.get,s=n.cache.set,p=m,m(h)),m=h=>{const c=a(h);if(c)return c;const x=fre(h,n);return s(h,x),x};return p=f,(...h)=>p(hre(...h))},vre=[],In=e=>{const t=n=>n[e]||vre;return t.isThemeGetter=!0,t},EN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,RN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yre=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sre=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rr=e=>yre.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),li=e=>!!e&&Number.isInteger(Number(e)),Ug=e=>e.endsWith("%")&&ut(e.slice(0,-1)),Bi=e=>bre.test(e),IN=()=>!0,Mre=e=>Sre.test(e)&&!xre.test(e),S0=()=>!1,Cre=e=>kre.test(e),Are=e=>wre.test(e),Ere=e=>!Oe(e)&&!Pe(e),Rre=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ire=e=>Qr(e,NN,S0),Oe=e=>EN.test(e),go=e=>Qr(e,ON,Mre),cC=e=>Qr(e,zre,ut),Tre=e=>Qr(e,jN,IN),_re=e=>Qr(e,PN,S0),uC=e=>Qr(e,TN,S0),Nre=e=>Qr(e,_N,Are),Wd=e=>Qr(e,DN,Cre),Pe=e=>RN.test(e),fc=e=>qo(e,ON),Ore=e=>qo(e,PN),dC=e=>qo(e,TN),Pre=e=>qo(e,NN),jre=e=>qo(e,_N),Kd=e=>qo(e,DN,!0),Dre=e=>qo(e,jN,!0),Qr=(e,t,n)=>{const a=EN.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},qo=(e,t,n=!1)=>{const a=RN.exec(e);return a?a[1]?t(a[1]):n:!1},TN=e=>e==="position"||e==="percentage",_N=e=>e==="image"||e==="url",NN=e=>e==="length"||e==="size"||e==="bg-size",ON=e=>e==="length",zre=e=>e==="number",PN=e=>e==="family-name",jN=e=>e==="number"||e==="weight",DN=e=>e==="shadow",Lre=()=>{const e=In("color"),t=In("font"),n=In("text"),a=In("font-weight"),s=In("tracking"),p=In("leading"),f=In("breakpoint"),m=In("container"),h=In("spacing"),c=In("radius"),x=In("shadow"),M=In("inset-shadow"),C=In("text-shadow"),E=In("drop-shadow"),R=In("blur"),_=In("perspective"),P=In("aspect"),D=In("ease"),L=In("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...q(),Pe,Oe],ne=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],U=()=>[Pe,Oe,h],me=()=>[Rr,"full","auto",...U()],Me=()=>[li,"none","subgrid",Pe,Oe],Ce=()=>["auto",{span:["full",li,Pe,Oe]},li,Pe,Oe],Ae=()=>[li,"auto",Pe,Oe],Ee=()=>["auto","min","max","fr",Pe,Oe],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Te=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...U()],ue=()=>[Rr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ke=()=>[Rr,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Ie=()=>[Rr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],ge=()=>[e,Pe,Oe],z=()=>[...q(),dC,uC,{position:[Pe,Oe]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",Pre,Ire,{size:[Pe,Oe]}],Se=()=>[Ug,fc,go],J=()=>["","none","full",c,Pe,Oe],he=()=>["",ut,fc,go],De=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[ut,Ug,dC,uC],Qe=()=>["","none",R,Pe,Oe],ct=()=>["none",ut,Pe,Oe],Je=()=>["none",ut,Pe,Oe],et=()=>[ut,Pe,Oe],$e=()=>[Rr,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bi],breakpoint:[Bi],color:[IN],container:[Bi],"drop-shadow":[Bi],ease:["in","out","in-out"],font:[Ere],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bi],shadow:[Bi],spacing:["px",ut],text:[Bi],"text-shadow":[Bi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rr,Oe,Pe,P]}],container:["container"],"container-type":[{"@container":["","normal","size",Pe,Oe]}],"container-named":[Rre],columns:[{columns:[ut,Oe,Pe,m]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:ne()}],"overflow-x":[{"overflow-x":ne()}],"overflow-y":[{"overflow-y":ne()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:me()}],"inset-x":[{"inset-x":me()}],"inset-y":[{"inset-y":me()}],start:[{"inset-s":me(),start:me()}],end:[{"inset-e":me(),end:me()}],"inset-bs":[{"inset-bs":me()}],"inset-be":[{"inset-be":me()}],top:[{top:me()}],right:[{right:me()}],bottom:[{bottom:me()}],left:[{left:me()}],visibility:["visible","invisible","collapse"],z:[{z:[li,"auto",Pe,Oe]}],basis:[{basis:[Rr,"full","auto",m,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,Rr,"auto","initial","none",Oe]}],grow:[{grow:["",ut,Pe,Oe]}],shrink:[{shrink:["",ut,Pe,Oe]}],order:[{order:[li,"first","last","none",Pe,Oe]}],"grid-cols":[{"grid-cols":Me()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":Me()}],"row-start-end":[{row:Ce()}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...Te(),"normal"]}],"justify-self":[{"justify-self":["auto",...Te()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...Te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Te(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...Te(),"baseline"]}],"place-self":[{"place-self":["auto",...Te()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ue()}],"inline-size":[{inline:["auto",...ke()]}],"min-inline-size":[{"min-inline":["auto",...ke()]}],"max-inline-size":[{"max-inline":["none",...ke()]}],"block-size":[{block:["auto",...Ie()]}],"min-block-size":[{"min-block":["auto",...Ie()]}],"max-block-size":[{"max-block":["none",...Ie()]}],w:[{w:[m,"screen",...ue()]}],"min-w":[{"min-w":[m,"screen","none",...ue()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...ue()]}],h:[{h:["screen","lh",...ue()]}],"min-h":[{"min-h":["screen","lh","none",...ue()]}],"max-h":[{"max-h":["screen","lh",...ue()]}],"font-size":[{text:["base",n,fc,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Dre,Tre]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ug,Oe]}],"font-family":[{font:[Ore,_re,t]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Pe,Oe]}],"line-clamp":[{"line-clamp":[ut,"none",Pe,cC]}],leading:[{leading:[p,...U()]}],"list-image":[{"list-image":["none",Pe,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ge()}],"text-color":[{text:ge()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",Pe,go]}],"text-decoration-color":[{decoration:ge()}],"underline-offset":[{"underline-offset":[ut,"auto",Pe,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[li,Pe,Oe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},li,Pe,Oe],radial:["",Pe,Oe],conic:[li,Pe,Oe]},jre,Nre]}],"bg-color":[{bg:ge()}],"gradient-from-pos":[{from:Se()}],"gradient-via-pos":[{via:Se()}],"gradient-to-pos":[{to:Se()}],"gradient-from":[{from:ge()}],"gradient-via":[{via:ge()}],"gradient-to":[{to:ge()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:ge()}],"border-color-x":[{"border-x":ge()}],"border-color-y":[{"border-y":ge()}],"border-color-s":[{"border-s":ge()}],"border-color-e":[{"border-e":ge()}],"border-color-bs":[{"border-bs":ge()}],"border-color-be":[{"border-be":ge()}],"border-color-t":[{"border-t":ge()}],"border-color-r":[{"border-r":ge()}],"border-color-b":[{"border-b":ge()}],"border-color-l":[{"border-l":ge()}],"divide-color":[{divide:ge()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,Pe,Oe]}],"outline-w":[{outline:["",ut,fc,go]}],"outline-color":[{outline:ge()}],shadow:[{shadow:["","none",x,Kd,Wd]}],"shadow-color":[{shadow:ge()}],"inset-shadow":[{"inset-shadow":["none",M,Kd,Wd]}],"inset-shadow-color":[{"inset-shadow":ge()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ge()}],"ring-offset-w":[{"ring-offset":[ut,go]}],"ring-offset-color":[{"ring-offset":ge()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":ge()}],"text-shadow":[{"text-shadow":["none",C,Kd,Wd]}],"text-shadow-color":[{"text-shadow":ge()}],opacity:[{opacity:[ut,Pe,Oe]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":ge()}],"mask-image-linear-to-color":[{"mask-linear-to":ge()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":ge()}],"mask-image-t-to-color":[{"mask-t-to":ge()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":ge()}],"mask-image-r-to-color":[{"mask-r-to":ge()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":ge()}],"mask-image-b-to-color":[{"mask-b-to":ge()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":ge()}],"mask-image-l-to-color":[{"mask-l-to":ge()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":ge()}],"mask-image-x-to-color":[{"mask-x-to":ge()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":ge()}],"mask-image-y-to-color":[{"mask-y-to":ge()}],"mask-image-radial":[{"mask-radial":[Pe,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":ge()}],"mask-image-radial-to-color":[{"mask-radial-to":ge()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":q()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":ge()}],"mask-image-conic-to-color":[{"mask-conic-to":ge()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Oe]}],filter:[{filter:["","none",Pe,Oe]}],blur:[{blur:Qe()}],brightness:[{brightness:[ut,Pe,Oe]}],contrast:[{contrast:[ut,Pe,Oe]}],"drop-shadow":[{"drop-shadow":["","none",E,Kd,Wd]}],"drop-shadow-color":[{"drop-shadow":ge()}],grayscale:[{grayscale:["",ut,Pe,Oe]}],"hue-rotate":[{"hue-rotate":[ut,Pe,Oe]}],invert:[{invert:["",ut,Pe,Oe]}],saturate:[{saturate:[ut,Pe,Oe]}],sepia:[{sepia:["",ut,Pe,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Oe]}],"backdrop-blur":[{"backdrop-blur":Qe()}],"backdrop-brightness":[{"backdrop-brightness":[ut,Pe,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[ut,Pe,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,Pe,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,Pe,Oe]}],"backdrop-invert":[{"backdrop-invert":["",ut,Pe,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[ut,Pe,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[ut,Pe,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,Pe,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",Pe,Oe]}],ease:[{ease:["linear","initial",D,Pe,Oe]}],delay:[{delay:[ut,Pe,Oe]}],animate:[{animate:["none",L,Pe,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Pe,Oe]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:Je()}],"scale-x":[{"scale-x":Je()}],"scale-y":[{"scale-y":Je()}],"scale-z":[{"scale-z":Je()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[Pe,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$e()}],"translate-x":[{"translate-x":$e()}],"translate-y":[{"translate-y":$e()}],"translate-z":[{"translate-z":$e()}],"translate-none":["translate-none"],zoom:[{zoom:[li,Pe,Oe]}],accent:[{accent:ge()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ge()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ge()}],"scrollbar-track-color":[{"scrollbar-track":ge()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Oe]}],fill:[{fill:["none",...ge()]}],"stroke-w":[{stroke:[ut,fc,go,cC]}],stroke:[{stroke:["none",...ge()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qre=gre(Lre);function oe(...e){return qre(kN(e))}hi("camstack:vod-playback",{request:null,play:()=>{},clear:()=>{}});hi("camstack:recorded-playback",{bindControlChannel:null,channelOpen:!1,mode:"live",positionMs:null,send:()=>!1});T.lazy(()=>Ys(()=>import("./MotionZonesSettings-DNdnFHso-BcC-Qswj.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings}))),T.lazy(()=>Ys(()=>import("./PrivacyMaskSettings-DNSLc6ww-DTaiq5jX.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));var Bre=Object.defineProperty,nm=Object.getOwnPropertySymbols,zN=Object.prototype.hasOwnProperty,LN=Object.prototype.propertyIsEnumerable,pC=(e,t,n)=>t in e?Bre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Py=(e,t)=>{for(var n in t||(t={}))zN.call(t,n)&&pC(e,n,t[n]);if(nm)for(var n of nm(t))LN.call(t,n)&&pC(e,n,t[n]);return e},jy=(e,t)=>{var n={};for(var a in e)zN.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&nm)for(var a of nm(e))t.indexOf(a)<0&&LN.call(e,a)&&(n[a]=e[a]);return n};var No;(e=>{const t=class gt{constructor(h,c,x,M){if(this.version=h,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],h<gt.MIN_VERSION||h>gt.MAX_VERSION)throw new RangeError("Version value out of range");if(M<-1||M>7)throw new RangeError("Mask value out of range");this.size=h*4+17;let C=[];for(let R=0;R<this.size;R++)C.push(!1);for(let R=0;R<this.size;R++)this.modules.push(C.slice()),this.isFunction.push(C.slice());this.drawFunctionPatterns();const E=this.addEccAndInterleave(x);if(this.drawCodewords(E),M==-1){let R=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const P=this.getPenaltyScore();P<R&&(M=_,R=P),this.applyMask(_)}}s(0<=M&&M<=7),this.mask=M,this.applyMask(M),this.drawFormatBits(M),this.isFunction=[]}static encodeText(h,c){const x=e.QrSegment.makeSegments(h);return gt.encodeSegments(x,c)}static encodeBinary(h,c){const x=e.QrSegment.makeBytes(h);return gt.encodeSegments([x],c)}static encodeSegments(h,c,x=1,M=40,C=-1,E=!0){if(!(gt.MIN_VERSION<=x&&x<=M&&M<=gt.MAX_VERSION)||C<-1||C>7)throw new RangeError("Invalid value");let R,_;for(R=x;;R++){const B=gt.getNumDataCodewords(R,c)*8,q=f.getTotalBits(h,R);if(q<=B){_=q;break}if(R>=M)throw new RangeError("Data too long")}for(const B of[gt.Ecc.MEDIUM,gt.Ecc.QUARTILE,gt.Ecc.HIGH])E&&_<=gt.getNumDataCodewords(R,B)*8&&(c=B);let P=[];for(const B of h){n(B.mode.modeBits,4,P),n(B.numChars,B.mode.numCharCountBits(R),P);for(const q of B.getData())P.push(q)}s(P.length==_);const D=gt.getNumDataCodewords(R,c)*8;s(P.length<=D),n(0,Math.min(4,D-P.length),P),n(0,(8-P.length%8)%8,P),s(P.length%8==0);for(let B=236;P.length<D;B^=253)n(B,8,P);let L=[];for(;L.length*8<P.length;)L.push(0);return P.forEach((B,q)=>L[q>>>3]|=B<<7-(q&7)),new gt(R,c,L,C)}getModule(h,c){return 0<=h&&h<this.size&&0<=c&&c<this.size&&this.modules[c][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let x=0;x<this.size;x++)this.setFunctionModule(6,x,x%2==0),this.setFunctionModule(x,6,x%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),c=h.length;for(let x=0;x<c;x++)for(let M=0;M<c;M++)x==0&&M==0||x==0&&M==c-1||x==c-1&&M==0||this.drawAlignmentPattern(h[x],h[M]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const c=this.errorCorrectionLevel.formatBits<<3|h;let x=c;for(let C=0;C<10;C++)x=x<<1^(x>>>9)*1335;const M=(c<<10|x)^21522;s(M>>>15==0);for(let C=0;C<=5;C++)this.setFunctionModule(8,C,a(M,C));this.setFunctionModule(8,7,a(M,6)),this.setFunctionModule(8,8,a(M,7)),this.setFunctionModule(7,8,a(M,8));for(let C=9;C<15;C++)this.setFunctionModule(14-C,8,a(M,C));for(let C=0;C<8;C++)this.setFunctionModule(this.size-1-C,8,a(M,C));for(let C=8;C<15;C++)this.setFunctionModule(8,this.size-15+C,a(M,C));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let x=0;x<12;x++)h=h<<1^(h>>>11)*7973;const c=this.version<<12|h;s(c>>>18==0);for(let x=0;x<18;x++){const M=a(c,x),C=this.size-11+x%3,E=Math.floor(x/3);this.setFunctionModule(C,E,M),this.setFunctionModule(E,C,M)}}drawFinderPattern(h,c){for(let x=-4;x<=4;x++)for(let M=-4;M<=4;M++){const C=Math.max(Math.abs(M),Math.abs(x)),E=h+M,R=c+x;0<=E&&E<this.size&&0<=R&&R<this.size&&this.setFunctionModule(E,R,C!=2&&C!=4)}}drawAlignmentPattern(h,c){for(let x=-2;x<=2;x++)for(let M=-2;M<=2;M++)this.setFunctionModule(h+M,c+x,Math.max(Math.abs(M),Math.abs(x))!=1)}setFunctionModule(h,c,x){this.modules[c][h]=x,this.isFunction[c][h]=!0}addEccAndInterleave(h){const c=this.version,x=this.errorCorrectionLevel;if(h.length!=gt.getNumDataCodewords(c,x))throw new RangeError("Invalid argument");const M=gt.NUM_ERROR_CORRECTION_BLOCKS[x.ordinal][c],C=gt.ECC_CODEWORDS_PER_BLOCK[x.ordinal][c],E=Math.floor(gt.getNumRawDataModules(c)/8),R=M-E%M,_=Math.floor(E/M);let P=[];const D=gt.reedSolomonComputeDivisor(C);for(let B=0,q=0;B<M;B++){let G=h.slice(q,q+_-C+(B<R?0:1));q+=G.length;const ne=gt.reedSolomonComputeRemainder(G,D);B<R&&G.push(0),P.push(G.concat(ne))}let L=[];for(let B=0;B<P[0].length;B++)P.forEach((q,G)=>{(B!=_-C||G>=R)&&L.push(q[B])});return s(L.length==E),L}drawCodewords(h){if(h.length!=Math.floor(gt.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let x=this.size-1;x>=1;x-=2){x==6&&(x=5);for(let M=0;M<this.size;M++)for(let C=0;C<2;C++){const E=x-C,R=(x+1&2)==0?this.size-1-M:M;!this.isFunction[R][E]&&c<h.length*8&&(this.modules[R][E]=a(h[c>>>3],7-(c&7)),c++)}}s(c==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let x=0;x<this.size;x++){let M;switch(h){case 0:M=(x+c)%2==0;break;case 1:M=c%2==0;break;case 2:M=x%3==0;break;case 3:M=(x+c)%3==0;break;case 4:M=(Math.floor(x/3)+Math.floor(c/2))%2==0;break;case 5:M=x*c%2+x*c%3==0;break;case 6:M=(x*c%2+x*c%3)%2==0;break;case 7:M=((x+c)%2+x*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][x]&&M&&(this.modules[c][x]=!this.modules[c][x])}}getPenaltyScore(){let h=0;for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let P=0;P<this.size;P++)this.modules[C][P]==E?(R++,R==5?h+=gt.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*gt.PENALTY_N3),E=this.modules[C][P],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*gt.PENALTY_N3}for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let P=0;P<this.size;P++)this.modules[P][C]==E?(R++,R==5?h+=gt.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*gt.PENALTY_N3),E=this.modules[P][C],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*gt.PENALTY_N3}for(let C=0;C<this.size-1;C++)for(let E=0;E<this.size-1;E++){const R=this.modules[C][E];R==this.modules[C][E+1]&&R==this.modules[C+1][E]&&R==this.modules[C+1][E+1]&&(h+=gt.PENALTY_N2)}let c=0;for(const C of this.modules)c=C.reduce((E,R)=>E+(R?1:0),c);const x=this.size*this.size,M=Math.ceil(Math.abs(c*20-x*10)/x)-1;return s(0<=M&&M<=9),h+=M*gt.PENALTY_N4,s(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let x=[6];for(let M=this.size-7;x.length<h;M-=c)x.splice(1,0,M);return x}}static getNumRawDataModules(h){if(h<gt.MIN_VERSION||h>gt.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*h+128)*h+64;if(h>=2){const x=Math.floor(h/7)+2;c-=(25*x-10)*x-55,h>=7&&(c-=36)}return s(208<=c&&c<=29648),c}static getNumDataCodewords(h,c){return Math.floor(gt.getNumRawDataModules(h)/8)-gt.ECC_CODEWORDS_PER_BLOCK[c.ordinal][h]*gt.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let c=[];for(let M=0;M<h-1;M++)c.push(0);c.push(1);let x=1;for(let M=0;M<h;M++){for(let C=0;C<c.length;C++)c[C]=gt.reedSolomonMultiply(c[C],x),C+1<c.length&&(c[C]^=c[C+1]);x=gt.reedSolomonMultiply(x,2)}return c}static reedSolomonComputeRemainder(h,c){let x=c.map(M=>0);for(const M of h){const C=M^x.shift();x.push(0),c.forEach((E,R)=>x[R]^=gt.reedSolomonMultiply(E,C))}return x}static reedSolomonMultiply(h,c){if(h>>>8||c>>>8)throw new RangeError("Byte out of range");let x=0;for(let M=7;M>=0;M--)x=x<<1^(x>>>7)*285,x^=(c>>>M&1)*h;return s(x>>>8==0),x}finderPenaltyCountPatterns(h){const c=h[1];s(c<=this.size*3);const x=c>0&&h[2]==c&&h[3]==c*3&&h[4]==c&&h[5]==c;return(x&&h[0]>=c*4&&h[6]>=c?1:0)+(x&&h[6]>=c*4&&h[0]>=c?1:0)}finderPenaltyTerminateAndCount(h,c,x){return h&&(this.finderPenaltyAddHistory(c,x),c=0),c+=this.size,this.finderPenaltyAddHistory(c,x),this.finderPenaltyCountPatterns(x)}finderPenaltyAddHistory(h,c){c[0]==0&&(h+=this.size),c.pop(),c.unshift(h)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(m,h,c){if(h<0||h>31||m>>>h)throw new RangeError("Value out of range");for(let x=h-1;x>=0;x--)c.push(m>>>x&1)}function a(m,h){return(m>>>h&1)!=0}function s(m){if(!m)throw new Error("Assertion error")}const p=class dn{constructor(h,c,x){if(this.mode=h,this.numChars=c,this.bitData=x,c<0)throw new RangeError("Invalid argument");this.bitData=x.slice()}static makeBytes(h){let c=[];for(const x of h)n(x,8,c);return new dn(dn.Mode.BYTE,h.length,c)}static makeNumeric(h){if(!dn.isNumeric(h))throw new RangeError("String contains non-numeric characters");let c=[];for(let x=0;x<h.length;){const M=Math.min(h.length-x,3);n(parseInt(h.substring(x,x+M),10),M*3+1,c),x+=M}return new dn(dn.Mode.NUMERIC,h.length,c)}static makeAlphanumeric(h){if(!dn.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],x;for(x=0;x+2<=h.length;x+=2){let M=dn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x))*45;M+=dn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x+1)),n(M,11,c)}return x<h.length&&n(dn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x)),6,c),new dn(dn.Mode.ALPHANUMERIC,h.length,c)}static makeSegments(h){return h==""?[]:dn.isNumeric(h)?[dn.makeNumeric(h)]:dn.isAlphanumeric(h)?[dn.makeAlphanumeric(h)]:[dn.makeBytes(dn.toUtf8ByteArray(h))]}static makeEci(h){let c=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)n(h,8,c);else if(h<16384)n(2,2,c),n(h,14,c);else if(h<1e6)n(6,3,c),n(h,21,c);else throw new RangeError("ECI assignment value out of range");return new dn(dn.Mode.ECI,0,c)}static isNumeric(h){return dn.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return dn.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,c){let x=0;for(const M of h){const C=M.mode.numCharCountBits(c);if(M.numChars>=1<<C)return 1/0;x+=4+C+M.bitData.length}return x}static toUtf8ByteArray(h){h=encodeURI(h);let c=[];for(let x=0;x<h.length;x++)h.charAt(x)!="%"?c.push(h.charCodeAt(x)):(c.push(parseInt(h.substring(x+1,x+3),16)),x+=2);return c}};p.NUMERIC_REGEX=/^[0-9]*$/,p.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,p.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=p;e.QrSegment=p})(No||(No={}));(e=>{(t=>{const n=class{constructor(s,p){this.ordinal=s,this.formatBits=p}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(No||(No={}));(e=>{(t=>{const n=class{constructor(s,p){this.modeBits=s,this.numBitsCharCount=p}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(No||(No={}));var Qs=No;var Ure={L:Qs.QrCode.Ecc.LOW,M:Qs.QrCode.Ecc.MEDIUM,Q:Qs.QrCode.Ecc.QUARTILE,H:Qs.QrCode.Ecc.HIGH},qN=128,BN="L",UN="#FFFFFF",FN="#000000",HN=!1,$N=1,Fre=4,Hre=0,$re=.1;function QN(e,t=0){const n=[];return e.forEach(function(a,s){let p=null;a.forEach(function(f,m){if(!f&&p!==null){n.push(`M${p+t} ${s+t}h${m-p}v1H${p+t}z`),p=null;return}if(m===a.length-1){if(!f)return;p===null?n.push(`M${m+t},${s+t} h1v1H${m+t}z`):n.push(`M${p+t},${s+t} h${m+1-p}v1H${p+t}z`);return}f&&p===null&&(p=m)})}),n.join("")}function VN(e,t){return e.slice().map((n,a)=>a<t.y||a>=t.y+t.h?n:n.map((s,p)=>p<t.x||p>=t.x+t.w?s:!1))}function Qre(e,t,n,a){if(a==null)return null;const s=e.length+n*2,p=Math.floor(t*$re),f=s/t,m=(a.width||p)*f,h=(a.height||p)*f,c=a.x==null?e.length/2-m/2:a.x*f,x=a.y==null?e.length/2-h/2:a.y*f,M=a.opacity==null?1:a.opacity;let C=null;if(a.excavate){let R=Math.floor(c),_=Math.floor(x);C={x:R,y:_,w:Math.ceil(m+c-R),h:Math.ceil(h+x-_)}}const E=a.crossOrigin;return{x:c,y:x,h,w:m,excavation:C,opacity:M,crossOrigin:E}}function Vre(e,t){return t!=null?Math.max(Math.floor(t),0):e?Fre:Hre}function GN({value:e,level:t,minVersion:n,includeMargin:a,marginSize:s,imageSettings:p,size:f,boostLevel:m}){let h=wn.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((R,_)=>(R.push(...Qs.QrSegment.makeSegments(_)),R),[]);return Qs.QrCode.encodeSegments(E,Ure[t],n,void 0,void 0,m)},[e,t,n,m]);const{cells:c,margin:x,numCells:M,calculatedImageSettings:C}=wn.useMemo(()=>{let E=h.getModules();const R=Vre(a,s);return{cells:E,margin:R,numCells:E.length+R*2,calculatedImageSettings:Qre(E,f,R,p)}},[h,f,p,a,s]);return{qrcode:h,margin:x,cells:c,numCells:M,calculatedImageSettings:C}}var Gre=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Zre=wn.forwardRef(function(t,n){const a=t,{value:s,size:p=qN,level:f=BN,bgColor:m=UN,fgColor:h=FN,includeMargin:c=HN,minVersion:x=$N,boostLevel:M,marginSize:C,imageSettings:E}=a,R=jy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:_}=R,P=jy(R,["style"]),D=E?.src,L=wn.useRef(null),B=wn.useRef(null),q=wn.useCallback(Ee=>{L.current=Ee,typeof n=="function"?n(Ee):n&&(n.current=Ee)},[n]),[G,ne]=wn.useState(!1),{margin:V,cells:U,numCells:me,calculatedImageSettings:Me}=GN({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:C,imageSettings:E,size:p});wn.useEffect(()=>{if(L.current!=null){const Ee=L.current,re=Ee.getContext("2d");if(!re)return;let Te=U;const $=B.current,ue=Me!=null&&$!==null&&$.complete&&$.naturalHeight!==0&&$.naturalWidth!==0;ue&&Me.excavation!=null&&(Te=VN(U,Me.excavation));const ke=window.devicePixelRatio||1;Ee.height=Ee.width=p*ke;const Ie=p/me*ke;re.scale(Ie,Ie),re.fillStyle=m,re.fillRect(0,0,me,me),re.fillStyle=h,Gre?re.fill(new Path2D(QN(Te,V))):U.forEach(function(ge,z){ge.forEach(function(ae,de){ae&&re.fillRect(de+V,z+V,1,1)})}),Me&&(re.globalAlpha=Me.opacity),ue&&re.drawImage($,Me.x+V,Me.y+V,Me.w,Me.h)}}),wn.useEffect(()=>{ne(!1)},[D]);const Ce=Py({height:p,width:p},_);let Ae=null;return D!=null&&(Ae=wn.createElement("img",{src:D,key:D,style:{display:"none"},onLoad:()=>{ne(!0)},ref:B,crossOrigin:Me?.crossOrigin})),wn.createElement(wn.Fragment,null,wn.createElement("canvas",Py({style:Ce,height:p,width:p,ref:q,role:"img"},P)),Ae)});Zre.displayName="QRCodeCanvas";var Wre=wn.forwardRef(function(t,n){const a=t,{value:s,size:p=qN,level:f=BN,bgColor:m=UN,fgColor:h=FN,includeMargin:c=HN,minVersion:x=$N,boostLevel:M,title:C,marginSize:E,imageSettings:R}=a,_=jy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:P,cells:D,numCells:L,calculatedImageSettings:B}=GN({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:E,imageSettings:R,size:p});let q=D,G=null;R!=null&&B!=null&&(B.excavation!=null&&(q=VN(D,B.excavation)),G=wn.createElement("image",{href:R.src,height:B.h,width:B.w,x:B.x+P,y:B.y+P,preserveAspectRatio:"none",opacity:B.opacity,crossOrigin:B.crossOrigin}));const ne=QN(q,P);return wn.createElement("svg",Py({height:p,width:p,viewBox:`0 0 ${L} ${L}`,ref:n,role:"img"},_),!!C&&wn.createElement("title",null,C),wn.createElement("path",{fill:m,d:`M0,0 h${L}v${L}H0z`,shapeRendering:"crispEdges"}),wn.createElement("path",{fill:h,d:ne,shapeRendering:"crispEdges"}),G)});Wre.displayName="QRCodeSVG";var mC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fC=kN,Bo=(e,t)=>n=>{var a;if(t?.variants==null)return fC(e,n?.class,n?.className);const{variants:s,defaultVariants:p}=t,f=Object.keys(s).map(h=>{const c=n?.[h],x=p?.[h];if(c===null)return null;const M=mC(c)||mC(x);return s[h][M]}),m=n&&Object.entries(n).reduce((h,c)=>{let[x,M]=c;return M===void 0||(h[x]=M),h},{});return fC(e,f,t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,c)=>{let{class:x,className:M,...C}=c;return Object.entries(C).every(E=>{let[R,_]=E;return Array.isArray(_)?_.includes({...p,...m}[R]):{...p,...m}[R]===_})?[...h,x,M]:h},[]),n?.class,n?.className)},Kre=Bo("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent text-foreground hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),Dy=T.forwardRef(({className:e,variant:t,size:n,...a},s)=>v.jsx("button",{ref:s,className:oe(Kre({variant:t,size:n}),e),...a}));Dy.displayName="Button";var Yre=Bo("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),Xre=T.forwardRef(({className:e,variant:t,size:n,icon:a,...s},p)=>v.jsx("button",{ref:p,className:oe(Yre({variant:t,size:n}),e),...s,children:v.jsx(a,{className:"h-4 w-4"})}));Xre.displayName="IconButton";var Jre=Bo("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),eoe=T.forwardRef(({className:e,variant:t,style:n,...a},s)=>v.jsx("span",{ref:s,className:oe(Jre({variant:t,styleVariant:n}),e),...a}));eoe.displayName="Badge";var toe=Bo("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),noe=T.forwardRef(({className:e,variant:t,...n},a)=>v.jsx("div",{ref:a,className:oe(toe({variant:t}),e),...n}));noe.displayName="Card";var aoe=T.forwardRef(({className:e,...t},n)=>v.jsx("label",{ref:n,className:oe("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...t}));aoe.displayName="Label";var ioe=Bo("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),roe=T.forwardRef(({className:e,orientation:t,...n},a)=>v.jsx("div",{ref:a,role:"separator",className:oe(ioe({orientation:t}),e),...n}));roe.displayName="Separator";var ooe=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oe("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...t}));ooe.displayName="Skeleton";var hC=Bo("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),soe=T.forwardRef(({className:e,state:t,leftSlot:n,rightSlot:a,...s},p)=>n||a?v.jsxs("div",{className:"relative flex items-center w-full",children:[n&&v.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),v.jsx("input",{ref:p,className:oe(hC({state:t}),n?"pl-7":"",a?"pr-7":"",e),...s}),a&&v.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:a})]}):v.jsx("input",{ref:p,className:oe(hC({state:t}),e),...s}));soe.displayName="Input";var loe=T.forwardRef(({className:e,options:t,disabled:n,...a},s)=>v.jsxs("div",{className:"relative w-full",children:[v.jsx("select",{ref:s,disabled:n,className:oe("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary","disabled:opacity-50 disabled:cursor-not-allowed",e),...a,children:t.map(p=>v.jsx("option",{value:p.value,children:p.label},p.value))}),v.jsx("div",{className:oe("absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",n===!0?"opacity-50":""),children:v.jsx(zo,{className:"h-3.5 w-3.5"})})]}));loe.displayName="Select";var coe=T.forwardRef(({className:e,...t},n)=>v.jsx("input",{ref:n,type:"checkbox",className:oe("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...t}));coe.displayName="Checkbox";var uoe=T.forwardRef(({className:e,checked:t,onCheckedChange:n,label:a,...s},p)=>v.jsxs("button",{ref:p,role:"switch","aria-checked":t,type:"button",onClick:()=>n(!t),className:oe("inline-flex items-center gap-2",e),...s,children:[v.jsx("span",{className:oe("w-8 h-4 rounded-full transition-colors",t?"bg-primary":"bg-surface-hover"),children:v.jsx("span",{className:oe("block w-3.5 h-3.5 rounded-full bg-white transition-transform",t?"translate-x-4":"translate-x-0.5")})}),a&&v.jsx("span",{className:"text-xs text-foreground",children:a})]}));uoe.displayName="Switch";var ZN=T.createContext(null);function doe(){const e=T.useContext(ZN);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function WN({children:e,open:t,onOpenChange:n}){const[a,s]=T.useState(!1),p=t??a,f=T.useId(),m=T.useCallback(h=>{n?.(h),t===void 0&&s(h)},[t,n]);return v.jsx(ZN.Provider,{value:{open:p,setOpen:m,contentId:f},children:e})}var poe=Bo("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 m-0 w-[calc(100vw-2rem)] bg-background-elevated text-foreground border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] [&:not([open])]:hidden",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},scroll:{content:"overflow-y-auto",body:"flex flex-col overflow-hidden"},placement:{center:"","sheet-on-mobile":"bottom-0 left-0 right-0 top-auto w-full max-w-full translate-x-0 translate-y-0 rounded-b-none max-h-[92dvh] pb-[calc(1rem+env(safe-area-inset-bottom))] md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-lg md:bottom-auto md:pb-4 md:max-h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))]"}},compoundVariants:[{placement:"sheet-on-mobile",width:"sm",class:"md:w-[calc(100vw-2rem)] md:max-w-sm"},{placement:"sheet-on-mobile",width:"md",class:"md:w-[calc(100vw-2rem)] md:max-w-md"},{placement:"sheet-on-mobile",width:"lg",class:"md:w-[calc(100vw-2rem)] md:max-w-lg"},{scroll:"body",placement:"sheet-on-mobile",class:"h-[92dvh] md:h-auto"},{scroll:"body",placement:"center",class:"h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] md:h-auto"}],defaultVariants:{width:"md",placement:"center",scroll:"content"}}),x0=T.forwardRef(({className:e,width:t,placement:n,scroll:a,children:s,...p},f)=>{const{open:m,setOpen:h,contentId:c}=doe(),x=T.useRef(null),M=f??x;T.useEffect(()=>{const E=M.current;E&&(m&&!E.open&&E.showModal(),!m&&E.open&&E.close())},[m,M]);const C=E=>{E.target===E.currentTarget&&h(!1)};return v.jsx("dialog",{ref:M,id:c,className:oe(poe({width:t,placement:n,scroll:a}),e),onClick:C,onClose:()=>h(!1),...p,children:s})});x0.displayName="DialogContent";function moe({className:e,...t}){return v.jsx("div",{className:oe("flex flex-col gap-1 mb-3 shrink-0",e),...t})}function foe({className:e,...t}){return v.jsx("div",{className:oe("flex justify-end gap-2 mt-4 shrink-0",e),...t})}function hoe({className:e,...t}){return v.jsx("h2",{className:oe("text-sm font-semibold text-foreground",e),...t})}function goe({className:e,...t}){return v.jsx("p",{className:oe("text-xs text-foreground-muted",e),...t})}T.createContext(null);T.createContext(null);T.createContext(null);T.createContext(null);var voe=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:oe("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...t}));voe.displayName="ScrollArea";var Fg={baseDelayMs:1500,maxDelayMs:15e3,maxAttempts:40};function yoe(e,t=Math.random){if(e>=Fg.maxAttempts)return{kind:"exhausted",attempts:e};const n=Math.min(Fg.maxDelayMs,Fg.baseDelayMs*2**e);return{kind:"retry",delayMs:Math.round(n*(.8+t()*.4))}}var boe="/adaptive-probe",Soe=2500;function KN(e){return e>=8?"high":e>=2.5?"mid":"low"}function xoe(e){const{downlinkMbps:t,...n}=e;return n}function gC(e){return KN(e)!=="low"}function vC(e){if(e===void 0||e==="")return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!=="http:"&&t.protocol!=="https:"?null:t.origin}function koe(e,t){return vC(e)??vC(t)}function woe(e){const t=e.downlinkMbps===void 0?"none":KN(e.downlinkMbps);return[e.phase,e.viewportWidth??"-",e.viewportHeight??"-",e.devicePixelRatio??"-",t,e.prefersTier??"-",e.probeOrigin??"unreachable"].join("|")}async function Moe(e,t){const n=e.replace(/\/+$/,""),a=new AbortController,s=setTimeout(()=>a.abort(),Soe),p=t.now();try{const f=await t.fetchImpl(`${n}${boe}`,{signal:a.signal});if(!f.ok)return null;const m=await f.arrayBuffer(),h=Math.max(1,t.now()-p);return m.byteLength<1024?null:m.byteLength*8/h/1e3}catch{return null}finally{clearTimeout(s)}}function vo(e,t){e.muted=t;const n=e.srcObject;if(n instanceof MediaStream)for(const a of n.getAudioTracks())a.enabled=!t}function Coe(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function Aoe(e,t,n){let f=0;for(let m=0;m<8;m++)for(let h=0;h<8;h++){const c=Math.min(t-1,Math.floor((h+.5)/8*t)),x=Math.min(n-1,Math.floor((m+.5)/8*n)),{data:M}=e.getImageData(c,x,1,1);.2126*(M[0]??0)+.7152*(M[1]??0)+.0722*(M[2]??0)>12&&f++}return f<=1}function Hg(e){const t={};if(typeof window<"u"){const n=window.devicePixelRatio||1;if(e){const a=e.getBoundingClientRect();a.width>0&&a.height>0&&(t.viewportWidth=Math.round(a.width*n),t.viewportHeight=Math.round(a.height*n))}t.viewportWidth===void 0&&(t.viewportWidth=Math.round(window.innerWidth*n),t.viewportHeight=Math.round(window.innerHeight*n)),t.devicePixelRatio=n}return t}var hc=null,Eoe=3e4;function Cp(e){return koe(e,typeof window<"u"?window.location.origin:void 0)}async function gc(e){const t=Cp(e);if(t===null)return;if(hc&&hc.origin===t&&Date.now()-hc.at<Eoe)return hc.mbps;const n=await Moe(t,{fetchImpl:(a,s)=>fetch(a,s),now:()=>Date.now()});if(!(n===null||!Number.isFinite(n)))return hc={origin:t,mbps:n,at:Date.now()},n}function yC(e,t,n,a){const s={...e,...n!==void 0?{downlinkMbps:n}:{},...t};return a?xoe(s):s}var Roe=8e3;function YN({serverUrl:e,streamKey:t,label:n,autoPlay:a=!0,muted:s=!0,showControls:p=!0,showStats:f=!1,onPlaybackStats:m,onClientNetworkSample:h,onConnectTiming:c,className:x="",onStateChange:M,onError:C,onReconnectAttempt:E,overlay:R,createSession:_,sendAnswer:P,handleOffer:D,getIceServers:L,addIceCandidate:B,getIceCandidates:q,closeSession:G,getSessionState:ne,reoffer:V,posterUrl:U,hintsOverride:me,onAdaptiveHints:Me,reconnectSignal:Ce,onControlChannel:Ae,onVideoElement:Ee}){const re=T.useRef(null),Te=T.useRef(null),$=T.useRef(null),ue=T.useRef(new Set),ke=T.useRef(null),Ie=T.useRef(null),ge=T.useRef(0),z=T.useRef(!0),ae=T.useRef(Ae);ae.current=Ae;const de=T.useRef(Ee);de.current=Ee,T.useEffect(()=>(de.current?.(re.current),()=>de.current?.(null)),[]);const Se=T.useRef(Me);Se.current=Me;const J=T.useRef(null),he=T.useCallback((le,Le,Xe)=>{const Ct=Se.current;if(!Ct)return;const Ke={phase:le,probeOrigin:Xe,...Le},Nt=woe(Ke);Nt!==J.current&&(J.current=Nt,Ct(Ke))},[]),De=T.useRef(null),se=T.useRef(null),be=T.useRef(0),Qe=T.useRef(!1),ct=T.useRef(!1),Je=T.useRef(async()=>{}),[et,$e]=T.useState("idle"),[we,Ve]=T.useState(""),[lt,dt]=T.useState(s),Tt=T.useRef(lt);Tt.current=lt;const[ot,mn]=T.useState(!1),[Jt,Ln]=T.useState(!1),en=Coe(),[$n,fa]=T.useState(!0),Ia=T.useRef(null),Jn=T.useRef(!1);(P||_)&&(Jn.current=!0);const We=Jn.current,Tn=T.useRef(!1);D&&(Tn.current=!0);const qn=Tn.current,[Ta,vi]=T.useState(!1),An=T.useRef(null),[ha,Nn]=T.useState(null),[Uo,Gr]=T.useState(!1),Ji=T.useCallback(()=>{const le=re.current;if(!(!le||le.readyState<2||!le.videoWidth||!le.videoHeight))try{const Le=document.createElement("canvas");Le.width=le.videoWidth,Le.height=le.videoHeight;const Xe=Le.getContext("2d");if(!Xe||(Xe.drawImage(le,0,0),Aoe(Xe,Le.width,Le.height)))return;An.current=Le.toDataURL("image/jpeg",.6)}catch{}},[]),Qt=T.useCallback(le=>{$e(le),le==="playing"&&vi(!0),M?.(le)},[M]),ve=T.useCallback(()=>{if(ke.current?.abort(),ke.current=null,Ie.current&&(clearTimeout(Ie.current),Ie.current=null),se.current&&(clearTimeout(se.current),se.current=null),De.current=null,ct.current=!1,be.current=0,$.current&&($.current.close(),$.current=null),G&&ue.current.size>0){for(const le of ue.current)G(le).catch(()=>{});ue.current.clear()}},[G]),Re=T.useCallback(()=>{ke.current?.abort(),ke.current=null,Ie.current&&(clearTimeout(Ie.current),Ie.current=null),se.current&&(clearTimeout(se.current),se.current=null),De.current=null,ct.current=!1,be.current=0},[]),mt=1e3,qt=T.useCallback(le=>{if(!ne||!V)return;se.current&&(clearTimeout(se.current),se.current=null);const Le=async()=>{if(z.current&&De.current===le){if(!ct.current)try{const{pendingRenegotiation:Xe}=await ne(le);if(z.current&&De.current===le&&Xe&&Xe.epoch>be.current&&!ct.current){be.current=Xe.epoch,await Je.current(le,Xe.target);return}}catch{}!z.current||De.current!==le||(se.current=setTimeout(()=>{Le()},mt))}};se.current=setTimeout(()=>{Le()},mt)},[ne,V]),Bn=T.useCallback(async(le=!1,Le=le)=>{if(!z.current||!_||!P)return;const Xe=le?$.current:null,Ct=le?new Set(ue.current):null;le?Re():ve(),Qt("connecting");const Ke=new AbortController;ke.current=Ke;try{const Nt=Le?void 0:gc(e),Be=yC(Hg(Te.current),me,Le?await gc(e):void 0,!Le);he(Le?"probe-climb":"cold-start",Be,Cp(e));const{sessionId:at,sdpOffer:Zt,iceServers:Wt}=await _(Be);if(ue.current.add(at),Nt!==void 0&&Nt.then(it=>{it===void 0||!gC(it)||!z.current||Ke.signal.aborted||Qe.current||(Qe.current=!0,Bn(!0,!0))}),!z.current||Ke.signal.aborted){G?.(at).catch(()=>{}),ue.current.delete(at);return}const Ue=new RTCPeerConnection({iceServers:[...Wt??[],{urls:"stun:stun.l.google.com:19302"}]});le||($.current=Ue);const At=new MediaStream;let wt=!1;const Ot=()=>{if(!(wt||!z.current)){if(wt=!0,$.current=Ue,re.current&&(re.current.srcObject=At,vo(re.current,Tt.current),re.current.play().catch(()=>{})),Xe&&Xe!==Ue)try{Xe.close()}catch{}if(Ct)for(const it of Ct)ue.current.delete(it),G?.(it).catch(()=>{})}};Ue.ontrack=it=>{if(console.debug("[WebRTC] ontrack",it.track.kind,it.track.readyState),At.addTrack(it.track),le){Ot();return}re.current&&(re.current.srcObject=At,vo(re.current,Tt.current),re.current.play().catch(()=>{}))},Ue.oniceconnectionstatechange=()=>{if(!z.current)return;const it=Ue.iceConnectionState;if(console.debug("[WebRTC] ICE state:",it),it==="connected"||it==="completed")ge.current=0,le&&Ot(),Qt("playing"),re.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),re.current.play().catch(()=>{}));else if(it==="failed"||it==="disconnected"||it==="closed"){if(le&&!wt)try{Ue.close()}catch{}Qt("disconnected"),$a()}},Ue.onicecandidateerror=it=>{console.debug("[WebRTC] ICE candidate error:",it)},console.debug("[WebRTC] Setting remote description (server offer)..."),await Ue.setRemoteDescription({type:"offer",sdp:Zt});const ea=await Ue.createAnswer();if(await Ue.setLocalDescription(ea),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await bC(Ue),!z.current)return;const an=(Ue.localDescription?.sdp??"").split(`
82
- `).filter(it=>it.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:an,sessionId:at.slice(0,8)}),await P(at,Ue.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const Bt=Ue,Qn=()=>{const it=Bt.connectionState;if(it==="closed"||it==="failed")return;const fn=re.current;fn&&fn.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${Bt.iceConnectionState})`)};setTimeout(Qn,3e3),setTimeout(Qn,8e3)}catch(Nt){if(!z.current)return;const Be=Nt instanceof Error?Nt.message:String(Nt);Ve(Be),Qt("error"),C?.(Be),$a()}},[e,t,_,P,ve,Re,G,Qt,C,me,he]),Zr=T.useCallback(async()=>{if(z.current){ve(),Qt("connecting");try{const le=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});$.current=le,le.addTransceiver("video",{direction:"recvonly"}),le.addTransceiver("audio",{direction:"recvonly"});const Le=new MediaStream;le.ontrack=Be=>{Le.addTrack(Be.track),re.current&&(re.current.srcObject=Le,vo(re.current,Tt.current),re.current.play().catch(()=>{}))},le.oniceconnectionstatechange=()=>{if(!z.current)return;const Be=le.iceConnectionState;Be==="connected"||Be==="completed"?(ge.current=0,Qt("playing"),re.current?.paused&&re.current.play().catch(()=>{})):(Be==="failed"||Be==="disconnected"||Be==="closed")&&(Qt("disconnected"),$a())};const Xe=await le.createOffer();if(await le.setLocalDescription(Xe),await bC(le),!z.current)return;const Ct=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,Ke=await fetch(Ct,{method:"POST",headers:{"Content-Type":"application/sdp"},body:le.localDescription?.sdp??""});if(!Ke.ok)throw new Error(`WHEP ${Ke.status}: ${Ke.statusText}`);const Nt=await Ke.text();await le.setRemoteDescription({type:"answer",sdp:Nt})}catch(le){if(!z.current)return;const Le=le instanceof Error?le.message:String(le);Ve(Le),Qt("error"),C?.(Le),$a()}}},[e,t,ve,Qt,C]),Fo=T.useCallback(async(le=!1,Le=le)=>{if(!z.current||!D)return;const Xe=le?$.current:null,Ct=le?new Set(ue.current):null;le?Re():ve(),Qt("connecting");const Ke=new AbortController;ke.current=Ke;const Nt=performance.now(),Be=()=>Math.round(performance.now()-Nt),at={};try{const Zt=Le?void 0:gc(e),Wt=await L?.();if(at.iceServersMs=Be(),!z.current||Ke.signal.aborted)return;const Ue=new RTCPeerConnection({iceServers:[...Wt??[],{urls:"stun:stun.l.google.com:19302"}]});le||($.current=Ue);const At=new MediaStream;let wt=!1;const Ot=()=>{if(!(wt||!z.current)){if(wt=!0,$.current=Ue,re.current&&(re.current.srcObject=At,vo(re.current,Tt.current),re.current.play().catch(()=>{})),Xe&&Xe!==Ue)try{Xe.close()}catch{}if(Ct)for(const pt of Ct)ue.current.delete(pt),G?.(pt).catch(()=>{})}};Ue.ontrack=pt=>{if(at.firstTrackMs===void 0&&(at.firstTrackMs=Be()),console.debug("[WebRTC] ontrack (client-offer)",pt.track.kind,pt.track.readyState),At.addTrack(pt.track),le){Ot();return}re.current&&(re.current.srcObject=At,vo(re.current,Tt.current),re.current.play().catch(()=>{}))};let ea=!1;Ue.oniceconnectionstatechange=()=>{if(!z.current)return;const pt=Ue.iceConnectionState;if(console.debug("[WebRTC] ICE state (client-offer):",pt),pt==="connected"||pt==="completed"){if(!ea){ea=!0,at.iceConnectedMs=Be(),console.info("[WebRTC timing] client-offer connected",{streamKey:t,...at}),c?.({...at});const na=re.current;na&&"requestVideoFrameCallback"in na&&(na.requestVideoFrameCallback(()=>{at.firstFrameMs=Be(),console.info("[WebRTC timing] first decoded frame",{streamKey:t,firstFrameMs:at.firstFrameMs}),c?.({...at})}),setTimeout(()=>{z.current&&at.firstFrameMs===void 0&&(console.warn("[WebRTC timing] NO decoded frame (stalled)",{streamKey:t,sinceIceConnectedMs:Be()-(at.iceConnectedMs??0),iceConnectedMs:at.iceConnectedMs,firstTrackMs:at.firstTrackMs}),Ho.current("no decoded frame after connect"),$a())},Roe))}ge.current=0,le&&Ot(),Qt("playing"),re.current?.paused&&re.current.play().catch(()=>{})}else if(pt==="failed"||pt==="disconnected"||pt==="closed"){if(le&&!wt)try{Ue.close()}catch{}Qt("disconnected"),$a()}};let an=null;const Bt=[];if(Ue.onicecandidate=pt=>{if(!pt.candidate)return;const na=pt.candidate.toJSON();an&&B?B(an,na).catch(()=>{}):Bt.push(na)},Ue.addTransceiver("video",{direction:"recvonly"}),Ue.addTransceiver("audio",{direction:"recvonly"}),ae.current){const pt=Ue.createDataChannel("camstack-control");ae.current(pt)}const Qn=await Ue.createOffer();if(at.offerCreatedMs=Be(),await Ue.setLocalDescription(Qn),at.localSetMs=Be(),!z.current||Ke.signal.aborted)return;const it=Le?await gc(e):void 0,fn=yC(Hg(Te.current),me,it,!Le);he(Le?"probe-climb":"cold-start",fn,Cp(e));const _a=Be(),{sessionId:ta,sdpAnswer:tt}=await D(Ue.localDescription?.sdp??Qn.sdp??"",void 0,fn);if(at.signalingRttMs=Be()-_a,an=ta,ue.current.add(ta),Zt!==void 0&&Zt.then(pt=>{pt===void 0||!gC(pt)||!z.current||Ke.signal.aborted||Qe.current||(Qe.current=!0,Fo(!0,!0))}),De.current=ta,!z.current||Ke.signal.aborted){G?.(ta).catch(()=>{}),ue.current.delete(ta);return}if(B)for(const pt of Bt)B(ta,pt).catch(()=>{});if(Bt.length=0,await Ue.setRemoteDescription({type:"answer",sdp:tt}),at.answerSetMs=Be(),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:ta.slice(0,8)}),q){const pt=new Set,na=Date.now(),Kr=async()=>{if(!(!z.current||Ke.signal.aborted)&&!(Ue.connectionState==="closed"||Ue.signalingState==="closed")){try{const{candidates:ti,done:Vo}=await q(ta);for(const xi of ti){const Yr=xi.candidate??"";Yr&&!pt.has(Yr)&&(pt.add(Yr),Ue.addIceCandidate(new RTCIceCandidate(xi)).catch(()=>{}))}const ir=Ue.iceConnectionState;if(Vo||Date.now()-na>1e4||ir==="connected"||ir==="completed")return}catch{}setTimeout(()=>{Kr()},200)}};Kr()}qt(ta)}catch(Zt){if(!z.current)return;const Wt=Zt instanceof Error?Zt.message:String(Zt);Ve(Wt),Qt("error"),C?.(Wt),$a()}},[e,D,L,B,q,G,ve,Re,Qt,C,qt,me,he]);Je.current=T.useCallback(async(le,Le)=>{const Xe=V;if(!z.current||!Xe)return;const Ct=$.current;ct.current=!0;try{let Ke=function(){if(Zt||!z.current){Ot();return}Zt=!0,$.current=Be,re.current&&(re.current.srcObject=at,re.current.play().catch(()=>{})),Ct&&Ct!==Be&&Ct.close(),Ot()};const Nt=await L?.();if(!z.current)return;const Be=new RTCPeerConnection({iceServers:[...Nt??[],{urls:"stun:stun.l.google.com:19302"}]}),at=new MediaStream;let Zt=!1,Wt=!1,Ue=null,At,wt;const Ot=()=>{wt!==void 0&&(clearTimeout(wt),wt=void 0);const tt=Ue;if(Ue=null,!!tt){At!==void 0&&typeof tt.cancelVideoFrameCallback=="function"&&tt.cancelVideoFrameCallback(At),tt.removeEventListener("loadeddata",Ke);try{tt.srcObject=null}catch{}tt.remove()}},ea=()=>{if(Wt||Zt||!z.current)return;if(Wt=!0,typeof document>"u"){Ke();return}const tt=document.createElement("video");tt.muted=!0,tt.playsInline=!0,tt.autoplay=!0,tt.style.cssText="position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",tt.srcObject=at,Ue=tt,(Te.current??document.body).appendChild(tt),tt.play().catch(()=>{}),typeof tt.requestVideoFrameCallback=="function"&&(At=tt.requestVideoFrameCallback(()=>Ke())),tt.addEventListener("loadeddata",Ke,{once:!0}),wt=setTimeout(()=>Ke(),1800)};Be.ontrack=tt=>{console.debug("[WebRTC] ontrack (reoffer)",tt.track.kind,tt.track.readyState),at.addTrack(tt.track),ea()},Be.oniceconnectionstatechange=()=>{if(!z.current)return;const tt=Be.iceConnectionState;console.debug("[WebRTC] ICE state (reoffer):",tt),tt==="connected"||tt==="completed"?(ge.current=0,ea(),Qt("playing"),re.current?.paused&&re.current.play().catch(()=>{})):(tt==="failed"||tt==="closed")&&(Ot(),!Zt&&tt==="failed"&&Be.close(),Qt("disconnected"),$a())};let an=null;const Bt=[];if(Be.onicecandidate=tt=>{if(!tt.candidate)return;const pt=tt.candidate.toJSON();an&&B?B(an,pt).catch(()=>{}):Bt.push(pt)},Be.addTransceiver("video",{direction:"recvonly"}),Be.addTransceiver("audio",{direction:"recvonly"}),ae.current){const tt=Be.createDataChannel("camstack-control");ae.current(tt)}const Qn=await Be.createOffer();if(await Be.setLocalDescription(Qn),!z.current){Be.close();return}const it=await gc(e),fn={...Hg(Te.current),...it!==void 0?{downlinkMbps:it}:{},...me};he("renegotiate",fn,Cp(e));const{sessionId:_a,sdpAnswer:ta}=await Xe(le,Be.localDescription?.sdp??Qn.sdp??"",Le,fn);if(!z.current){Be.close();return}if(an=_a,ue.current.add(_a),De.current=_a,B)for(const tt of Bt)B(_a,tt).catch(()=>{});if(Bt.length=0,await Be.setRemoteDescription({type:"answer",sdp:ta}),q){const tt=new Set,pt=Date.now(),na=async()=>{if(z.current&&!(Be.connectionState==="closed"||Be.signalingState==="closed")){try{const{candidates:Kr,done:ti}=await q(_a);for(const ir of Kr){const xi=ir.candidate??"";xi&&!tt.has(xi)&&(tt.add(xi),Be.addIceCandidate(new RTCIceCandidate(ir)).catch(()=>{}))}const Vo=Be.iceConnectionState;if(ti||Date.now()-pt>1e4||Vo==="connected"||Vo==="completed")return}catch{}setTimeout(()=>{na()},200)}};na()}qt(_a)}catch(Ke){console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll",Ke instanceof Error?Ke.message:String(Ke)),qt(le)}finally{ct.current=!1}},[e,V,L,B,q,Qt,qt,me,he]);const Ha=qn?Fo:We?Bn:Zr,er=T.useRef(()=>{}),Su=T.useRef(E);Su.current=E;const Ho=T.useRef(()=>{});Ho.current=le=>{console.warn("[WebRTC] hard error",{streamKey:t,msg:le}),Ve(le),C?.(le),Qt("error")},er.current=Ha;const $a=T.useCallback(()=>{if(!z.current)return;const le=ge.current,Le=yoe(le);if(Su.current?.(Le),Le.kind==="exhausted"){Ho.current(`reconnect attempts exhausted (${Le.attempts})`);return}ge.current+=1,Ie.current=setTimeout(()=>{z.current&&er.current()},Le.delayMs)},[]);T.useEffect(()=>(z.current=!0,ge.current=0,a&&Ha(),()=>{z.current=!1,ve()}),[]);const ml=T.useRef(!1);T.useEffect(()=>{if(a){if(qn){if(!D)return}else if(We){if(!_||!P)return}else return;ml.current||$.current||(ml.current=!0,Ha())}},[a,qn,We,D,_,P,Ha]);const $o=()=>{ge.current=0,Ha()},Qo=()=>{if(ge.current=0,$.current&&qn){Fo(!0);return}if($.current&&We){Bn(!0);return}Ha()},fl=T.useRef(e),hl=T.useRef(t);T.useEffect(()=>{const le=fl.current!==e,Le=hl.current!==t;if(fl.current=e,hl.current=t,!(!le&&!Le)&&z.current){if(ge.current=0,Qe.current=!1,le){ve(),Ha();return}Qo()}},[e,t]);const Qa=T.useRef(Ce);T.useEffect(()=>{Qa.current!==Ce&&(Qa.current=Ce,z.current&&Qo())},[Ce]);const En=()=>{if(re.current){const le=!re.current.muted;vo(re.current,le),dt(le)}},Un=async()=>{if(Te.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(Te.current.requestFullscreen){await Te.current.requestFullscreen();return}const le=re.current;le?.webkitEnterFullscreen&&le.webkitEnterFullscreen()}catch(le){console.warn(`Fullscreen toggle failed: ${le instanceof Error?le.message:le}`)}},tr=async()=>{const le=re.current;if(le)try{if(typeof le.webkitSetPresentationMode=="function"){le.webkitSetPresentationMode(le.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture");return}document.pictureInPictureElement?await document.exitPictureInPicture():await le.requestPictureInPicture()}catch(Le){console.warn(`PiP toggle failed: ${Le instanceof Error?Le.message:String(Le)}`)}},gl=()=>{if(!re.current)return;const le=document.createElement("canvas");le.width=re.current.videoWidth||1280,le.height=re.current.videoHeight||720;const Le=le.getContext("2d");if(!Le)return;Le.drawImage(re.current,0,0);const Xe=document.createElement("a");Xe.download=`${t.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,Xe.href=le.toDataURL("image/jpeg",.92),Xe.click()};T.useEffect(()=>{const le=()=>mn(!!document.fullscreenElement);document.addEventListener("fullscreenchange",le);const Le=re.current;return Le?.addEventListener("webkitbeginfullscreen",le),Le?.addEventListener("webkitendfullscreen",le),()=>{document.removeEventListener("fullscreenchange",le),Le?.removeEventListener("webkitbeginfullscreen",le),Le?.removeEventListener("webkitendfullscreen",le)}},[]),T.useEffect(()=>{const le=re.current,Le=typeof document<"u"&&document.pictureInPictureEnabled===!0,Xe=le!==null&&typeof le.webkitSetPresentationMode=="function";Ln(Le||Xe)},[]);const[xu,ku]=T.useState(""),yi=T.useRef(null);T.useEffect(()=>{if(!f){ku(""),yi.current=null;return}const le=async()=>{const Xe=$.current;if(Xe)try{const Ct=await Xe.getStats();let Ke=0,Nt=0,Be=0,at=0,Zt=0,Wt=0;Ct.forEach(wt=>{const Ot=wt;Ot.type==="inbound-rtp"&&(Ot.kind??Ot.mediaType)==="video"?(Ke=Ot.bytesReceived??0,Nt=Ot.timestamp,Be=Ot.framesPerSecond??0,at=Ot.frameWidth??0,Zt=Ot.frameHeight??0):Ot.type==="candidate-pair"&&Ot.nominated&&typeof Ot.currentRoundTripTime=="number"&&(Wt=Ot.currentRoundTripTime)});let Ue=0;yi.current&&Nt>yi.current.ts&&(Ue=Math.round((Ke-yi.current.bytes)*8/(Nt-yi.current.ts))),yi.current={bytes:Ke,ts:Nt};const At=[];at&&Zt&&At.push(`${at}×${Zt}`),Be&&At.push(`${Math.round(Be)}fps`),Ue>0&&At.push(`${Ue} kbps`),Wt&&At.push(`${Math.round(Wt*1e3)}ms`),ku(At.join(" · "))}catch{}};le();const Le=setInterval(()=>{le()},1e3);return()=>clearInterval(Le)},[f]);const bi=T.useRef(null);T.useEffect(()=>{if(!h){bi.current=null;return}const le=async()=>{const Xe=$.current;if(Xe)try{const Ct=await Xe.getStats();let Ke=0,Nt=0,Be=0,at=0,Zt=0,Wt=0;Ct.forEach(an=>{const Bt=an;Bt.type==="inbound-rtp"&&(Bt.kind??Bt.mediaType)==="video"?(Ke=Bt.packetsLost??0,Nt=Bt.packetsReceived??0,Be=Bt.bytesReceived??0,at=Bt.timestamp,Zt=Bt.jitter??0):Bt.type==="candidate-pair"&&Bt.nominated&&typeof Bt.currentRoundTripTime=="number"&&(Wt=Bt.currentRoundTripTime)});const Ue=bi.current;if(bi.current={lost:Ke,recv:Nt,bytes:Be,ts:at},!Ue||at<=Ue.ts)return;const At=Math.max(0,Ke-Ue.lost),wt=At+Math.max(0,Nt-Ue.recv),Ot=wt>0?Math.min(100,At/wt*100):0,ea=Math.max(0,Math.round((Be-Ue.bytes)*8/(at-Ue.ts)));h({rttMs:Math.round(Wt*1e3),jitterMs:Math.round(Zt*1e3),estimatedBandwidthKbps:ea,packetLossPercent:Ot})}catch{}},Le=setInterval(()=>{le()},2e3);return()=>clearInterval(Le)},[h]);const Wr=T.useRef(null);T.useEffect(()=>{if(!m){Wr.current=null;return}const le=async()=>{const Xe=$.current,Ct=re.current;if(Xe)try{const Ke=await Xe.getStats();let Nt=0,Be=0,at=0,Zt=0,Wt=0,Ue=0,At=0,wt=0;Ke.forEach(Qn=>{const it=Qn;it.type==="inbound-rtp"&&(it.kind??it.mediaType)==="video"&&(Nt=it.framesReceived??0,Be=it.framesDecoded??0,at=it.framesDropped??0,Zt=it.framesPerSecond??0,Wt=it.freezeCount??0,Ue=it.totalFreezesDuration??0,At=it.jitterBufferDelay??0,wt=it.jitterBufferEmittedCount??0)});const Ot=Ct?.currentTime??0,ea=Date.now(),an=Wr.current,Bt=wt>0?Math.round(At/wt*1e3):0;an&&m({dRecv:Nt-an.recv,dDec:Be-an.dec,dDrop:at-an.drop,fps:Math.round(Zt),dFreeze:Wt-an.freeze,freezeTotalMs:Math.round(Ue*1e3),avgJitterMs:Bt,dCtMs:Math.round((Ot-an.ct)*1e3),dtMs:ea-an.ts,readyState:Ct?.readyState??-1}),Wr.current={recv:Nt,dec:Be,drop:at,freeze:Wt,ct:Ot,ts:ea}}catch{}};le();const Le=setInterval(()=>{le()},5e3);return()=>clearInterval(Le)},[m]),T.useEffect(()=>{dt(s);const le=re.current;le&&(vo(le,s),s||le.play().catch(()=>{}))},[s]);const Si=()=>{en||(fa(!0),Ia.current&&clearTimeout(Ia.current),Ia.current=setTimeout(()=>fa(!1),3e3))},nr=()=>{fa(le=>!le),Ia.current&&clearTimeout(Ia.current)};T.useEffect(()=>{if(et==="playing"){Ji();const le=setInterval(Ji,2e3);return()=>clearInterval(le)}Ta&&An.current&&Nn(An.current)},[et,Ta,Ji]),T.useEffect(()=>{if(et!=="playing"){Gr(!1);return}const le=re.current;if(!le)return;let Le=!1;const Xe=()=>{Le||Gr(!0)};let Ct;typeof le.requestVideoFrameCallback=="function"&&(Ct=le.requestVideoFrameCallback(()=>Xe())),le.addEventListener("loadeddata",Xe,{once:!0});const Ke=setTimeout(Xe,12e3);return()=>{Le=!0,clearTimeout(Ke),Ct!==void 0&&typeof le.cancelVideoFrameCallback=="function"&&le.cancelVideoFrameCallback(Ct),le.removeEventListener("loadeddata",Xe)}},[et]);const ga=Ta&&ha?ha:U??null,ar=!Uo&&ga!==null;return v.jsxs("div",{ref:Te,className:`relative isolate bg-black overflow-hidden group ${x}`,onMouseMove:Si,onMouseEnter:Si,onTouchStart:nr,children:[v.jsx("video",{ref:re,autoPlay:a,muted:lt,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),ar&&ga&&v.jsx("img",{src:ga,alt:"",className:"absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"}),n&&et==="playing"&&v.jsx("div",{className:"absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium",children:n}),f&&xu&&v.jsx("div",{className:"absolute top-2 right-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-mono",children:xu}),R,p&&!ga&&et==="connecting"&&v.jsxs("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[v.jsx("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})}),v.jsx("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),p&&!ga&&(et==="error"||et==="disconnected")&&v.jsxs("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[v.jsx("svg",{className:"h-6 w-6 text-red-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("path",{d:"M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36",strokeLinecap:"round"})}),v.jsx("span",{className:"text-xs text-red-400 text-center px-4",children:et==="error"?we||"Connection failed":"Disconnected"}),v.jsx("button",{onClick:$o,className:"mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors",children:"Reconnect"})]}),p&&ga&&(et==="connecting"||et==="disconnected")&&v.jsx("div",{className:"absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55",children:v.jsx("svg",{className:"h-3.5 w-3.5 text-white/90 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})})}),p&&ga&&et==="error"&&v.jsx("button",{onClick:$o,title:we||"Reconnect",className:"absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M23 4v6h-6M1 20v-6h6"}),v.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}),p&&et!=="idle"&&et!=="error"&&v.jsxs("div",{className:`absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${en||$n?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Yd,{onClick:En,title:lt?"Unmute":"Mute",children:lt?v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),v.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})})}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Yd,{onClick:gl,title:"Take snapshot",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("path",{d:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"}),v.jsx("circle",{cx:"12",cy:"13",r:"4"})]})}),Jt&&v.jsx(Yd,{onClick:tr,title:"Picture-in-Picture",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4"}),v.jsx("rect",{width:"10",height:"7",x:"12",y:"13",rx:"2"})]})}),v.jsx(Yd,{onClick:Un,title:ot?"Exit fullscreen":"Fullscreen",children:ot?v.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:v.jsx("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}):v.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:v.jsx("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})})})]})]})]})}function Yd({onClick:e,title:t,children:n}){return v.jsx("button",{onClick:e,title:t,className:"rounded-full p-1.5 min-w-[44px] min-h-[44px] flex items-center justify-center text-white/80 hover:text-white hover:bg-white/20 active:bg-white/30 transition-colors",children:n})}async function bC(e){if(e.iceGatheringState!=="complete")return new Promise(t=>{let n=!1,a;const s=()=>{n||(n=!0,a&&clearInterval(a),e.removeEventListener("icegatheringstatechange",p),t())},p=()=>{e.iceGatheringState==="complete"&&s()};e.addEventListener("icegatheringstatechange",p);const f=Date.now();a=setInterval(()=>{const m=e.localDescription?.sdp??"";/ typ host/.test(m)&&Date.now()-f>=600&&s()},100),setTimeout(s,2500)})}var $g=["day","ir"],Ioe={day:"Daylight",ir:"Night (IR)",night:"Night",dawn:"Dawn",dusk:"Dusk"};function Ap(e){return Ioe[e]??e}function Lge(e){const t=new Set(e.coveredConditions),n=$g.map(f=>`${Ap(f)} ${t.has(f)?"✓":"✗"}`),a=[...t].filter(f=>!$g.some(m=>m===f));for(const f of a)n.push(`${Ap(f)} ✓`);const s=$g.filter(f=>!t.has(f));if(s.length===0)return n.join(" · ");if(t.size===0)return`${n.join(" · ")} — nothing captured yet, so this scene is not watching.`;const p=s.map(f=>Ap(f).toLowerCase()).join(" and ");return e.onUncoveredCondition==="judge-anyway"?`${n.join(" · ")} — ${p} judged against the references you do have.`:`${n.join(" · ")} — optional; checks in ${p} are skipped.`}function Toe(e){if(e.suspendedCondition===null)return null;const t=Ap(e.suspendedCondition).toLowerCase();return`Paused — nothing was captured in ${t}, so checks are on hold until the light changes back. Capture ${t} if you want it watched around the clock.`}var _oe={"no-reference-for-condition":"can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.","view-shifted":"can’t tell — the camera view has moved since the reference was captured. Re-capture it.","no-vision-profile":"can’t tell — the vision model is unreachable, so the change is on hold.","encoder-model-changed":"can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.","no-snapshot":"can’t tell — this camera did not return a frame."};function qge(e,t){if(e.states.length===0)return"Not armed yet — capture the initial state to start watching.";if(e.verdict==="unknown")return e.unavailable!==null?_oe[e.unavailable]:"can’t tell right now.";const n=e.verdict==="diverged"?e.divergedAt:e.armedAt,a=n!==null?` for ${Ooe(Math.max(0,t-n))}`:"";if(e.latched)return e.verdict==="diverged"?`CHANGED${a} — press Reset when you have dealt with it.`:`Back to normal, but still flagged as changed${a}. Press Reset to clear it.`;const s=Toe(e);return s!==null?s:e.verdict==="diverged"?`CHANGED${a}`:`Normal${a}`}function Bge(e){return e.states.length===0?{text:"Not armed",tone:"unknown"}:e.latched?{text:"Changed",tone:"alarm"}:e.suspendedCondition!==null?{text:"Paused",tone:"unknown"}:e.verdict==="unknown"?{text:"Can’t tell",tone:"unknown"}:e.verdict==="diverged"?{text:"Changed",tone:"alarm"}:{text:"Normal",tone:"ok"}}var Noe=.4;function Uge(e){return e.width*e.height>Noe}function Ooe(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<48?`${a}h`:`${Math.floor(a/24)}d`}var Fge="text-[10px] text-foreground-subtle",Poe={face:"#a855f7",plate:"#ec4899"};Object.freeze({...Object.fromEntries(Object.values(Tb).filter(e=>e.category==="detection"||e.kind==="motion").map(e=>[e.kind,e.color])),...Poe});var joe=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},XN=class{constructor(e){this.generateIdentifier=e,this.kv=new joe}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},Doe=class extends XN{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function zoe(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Loe(e,t){const n=zoe(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function ll(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function Ep(e,t){return e.indexOf(t)!==-1}function SC(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var qoe=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Loe(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Boe=e=>Object.prototype.toString.call(e).slice(8,-1),JN=e=>typeof e>"u",Uoe=e=>e===null,Yc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,zy=e=>Yc(e)&&Object.keys(e).length===0,Br=e=>Array.isArray(e),Foe=e=>typeof e=="string",Hoe=e=>typeof e=="number"&&!isNaN(e),$oe=e=>typeof e=="boolean",Qoe=e=>e instanceof RegExp,Xc=e=>e instanceof Map,Jc=e=>e instanceof Set,e4=e=>Boe(e)==="Symbol",Voe=e=>e instanceof Date&&!isNaN(e.valueOf()),t4=e=>e instanceof Error,xC=e=>typeof e=="number"&&isNaN(e),Goe=e=>$oe(e)||Uoe(e)||JN(e)||Hoe(e)||Foe(e)||e4(e),Zoe=e=>typeof e=="bigint",Woe=e=>e===1/0||e===-1/0,Koe=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Yoe=e=>e instanceof URL,Ly=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Qg=e=>e.map(String).map(Ly).join("."),Nc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function ci(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var n4=[ci(JN,"undefined",()=>null,()=>{}),ci(Zoe,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ci(Voe,"Date",e=>e.toISOString(),e=>new Date(e)),ci(t4,"Error",(e,t)=>{const n={name:e.name,message:e.message};return"cause"in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n},(e,t)=>{const n=new Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n}),ci(Qoe,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ci(Jc,"set",e=>[...e.values()],e=>new Set(e)),ci(Xc,"map",e=>[...e.entries()],e=>new Map(e)),ci(e=>xC(e)||Woe(e),"number",e=>xC(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ci(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ci(Yoe,"URL",e=>e.toString(),e=>new URL(e))];function _m(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var a4=_m((e,t)=>e4(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const a=n.symbolRegistry.getValue(t[1]);if(!a)throw new Error("Trying to deserialize unknown symbol");return a}),Xoe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),i4=_m(Koe,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Xoe[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function r4(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var o4=_m(r4,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const a={};return n.forEach(s=>{a[s]=e[s]}),a},(e,t,n)=>{const a=n.classRegistry.getValue(t[1]);if(!a)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(a.prototype),e)}),s4=_m((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const a=n.customTransformerRegistry.findByName(t[1]);if(!a)throw new Error("Trying to deserialize unknown custom value");return a.deserialize(e)}),Joe=[o4,a4,s4,i4],kC=(e,t)=>{const n=SC(Joe,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=SC(n4,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},l4={};n4.forEach(e=>{l4[e.annotation]=e});var ese=(e,t,n)=>{if(Br(t))switch(t[0]){case"symbol":return a4.untransform(e,t,n);case"class":return o4.untransform(e,t,n);case"custom":return s4.untransform(e,t,n);case"typed-array":return i4.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=l4[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Vs=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function c4(e){if(Ep(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ep(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ep(e,"constructor"))throw new Error("constructor is not allowed as a property")}var tse=(e,t)=>{c4(t);for(let n=0;n<t.length;n++){const a=t[n];if(Jc(e))e=Vs(e,+a);else if(Xc(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Vs(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},qy=(e,t,n)=>{if(c4(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Br(a)){const m=+f;a=a[m]}else if(Yc(a))a=a[f];else if(Jc(a)){const m=+f;a=Vs(a,m)}else if(Xc(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=Vs(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if(Br(a)?a[+s]=n(a[+s]):Yc(a)&&(a[s]=n(a[s])),Jc(a)){const p=Vs(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(Xc(a)){const p=+t[t.length-2],f=Vs(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},u4=e=>e<1;function By(e,t,n,a=[]){if(!e)return;const s=u4(n);if(!Br(e)){ll(e,(m,h)=>By(m,t,n,[...a,...Nc(h,s)]));return}const[p,f]=e;f&&ll(f,(m,h)=>{By(m,t,n,[...a,...Nc(h,s)])}),t(p,a)}function nse(e,t,n,a){return By(t,(s,p)=>{e=qy(e,p,f=>ese(f,s,a))},n),e}function ase(e,t,n){const a=u4(n);function s(p,f){const m=tse(e,Nc(f,a));p.map(h=>Nc(h,a)).forEach(h=>{e=qy(e,h,()=>m)})}if(Br(t)){const[p,f]=t;p.forEach(m=>{e=qy(e,Nc(m,a),()=>e)}),f&&ll(f,s)}else ll(t,s);return e}var ise=(e,t)=>Yc(e)||Br(e)||Xc(e)||Jc(e)||t4(e)||r4(e,t);function rse(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function ose(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(Qg):n[Qg(p)]=f.map(Qg)}),a?zy(n)?[a]:[a,n]:zy(n)?void 0:n}var d4=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=Goe(e);if(!m){rse(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!ise(e,n)){const E=kC(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(Ep(p,e))return{transformedValue:null};const h=kC(e,n),c=h?.value??e,x=Br(c)?[]:{},M={};ll(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=d4(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,Br(_.annotations)?M[Ly(R)]=_.annotations:Yc(_.annotations)&&ll(_.annotations,(P,D)=>{M[Ly(R)+"."+D]=P})});const C=zy(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function p4(e){return Object.prototype.toString.call(e).slice(8,-1)}function wC(e){return p4(e)==="Array"}function sse(e){if(p4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function lse(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Uy(e,t={}){if(wC(e))return e.map(s=>Uy(s,t));if(!sse(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||wC(t.props)&&!t.props.includes(p))return s;const f=e[p];return lse(s,p,Uy(f,t),e,t.nonenumerable),s},{})}var Gt=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Doe,this.symbolRegistry=new XN(t=>t.description??""),this.customTransformerRegistry=new qoe,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=d4(e,t,this,this.dedupe),a={json:n.transformedValue};n.annotations&&(a.meta={...a.meta,values:n.annotations});const s=ose(t,this.dedupe);return s&&(a.meta={...a.meta,referentialEqualities:s}),a.meta&&(a.meta.v=1),a}deserialize(e,t){const{json:n,meta:a}=e;let s=t?.inPlace?n:Uy(n);return a?.values&&(s=nse(s,a.values,a.v??0,this)),a?.referentialEqualities&&(s=ase(s,a.referentialEqualities,a.v??0)),s}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Gt.defaultInstance=new Gt;Gt.serialize=Gt.defaultInstance.serialize.bind(Gt.defaultInstance);Gt.deserialize=Gt.defaultInstance.deserialize.bind(Gt.defaultInstance);Gt.stringify=Gt.defaultInstance.stringify.bind(Gt.defaultInstance);Gt.parse=Gt.defaultInstance.parse.bind(Gt.defaultInstance);Gt.registerClass=Gt.defaultInstance.registerClass.bind(Gt.defaultInstance);Gt.registerSymbol=Gt.defaultInstance.registerSymbol.bind(Gt.defaultInstance);Gt.registerCustom=Gt.defaultInstance.registerCustom.bind(Gt.defaultInstance);Gt.allowErrorProps=Gt.defaultInstance.allowErrorProps.bind(Gt.defaultInstance);T.createContext(null);Ze.AddonStarted+"",Ze.AddonInstalled+"",Ze.AddonRestarted+"",Ze.AddonUpdated+"",Ze.AddonStopped+"",Ze.AddonUninstalled+"",Ze.AddonCrashed+"",Ze.AddonError+"",Ze.DetectionPhaseTransition+"",Ze.DetectionResult+"",Ze.DetectionEvent+"",Ze.DetectionCameraNative+"",Ze.ProviderMotion+"",Ze.MotionOnMotionChanged+"",Ze.MotionAnalysis+"",Ze.MotionZonesRaw+"",Ze.ProviderDetection+"",Ze.PipelineAudioInferenceResult+"",Ze.AgentOnline+"",Ze.AgentOffline+"",Ze.DeviceRegistered+"",Ze.DeviceUnregistered+"",Ze.DeviceStateChanged+"",Ze.EventEmitted+"";var cse=Object.freeze([...new Set(Object.values(Ze))].toSorted()),use=Object.freeze([Ze.PipelineCameraMetricsSnapshot,Ze.PipelineRunnerLoadSnapshot,Ze.PipelineEngineMetricsSnapshot,Ze.PipelineInferenceResult,Ze.PipelineTrace,Ze.PipelineProgress,Ze.StreamBrokerMetricsSnapshot,Ze.MetricsNodeResourcesSnapshot,Ze.MetricsNodeProcessesSnapshot,Ze.ClusterTopologySnapshot,Ze.MotionAnalysis,Ze.MotionZonesRaw,Ze.DetectionResult,Ze.PipelineAudioInferenceResult,Ze.PlatformProbePhase,Ze.BenchmarkProgress,Ze.ModelDownloadProgress]),dse=new Set(use);Object.freeze(cse.filter(e=>!dse.has(e)));Object.freeze([...new Set(AJ.filter(e=>e.scope==="device").map(e=>e.name))].toSorted());function m4({value:e,unit:t,onDelta:n}){return v.jsxs("div",{className:"flex h-8 w-full overflow-hidden rounded-lg border border-border bg-surface",children:[v.jsx("button",{type:"button","aria-label":"Decrement",className:"w-9 shrink-0 bg-surface-hover text-base text-foreground",onClick:()=>n(-1),children:"−"}),v.jsxs("span",{className:"flex flex-1 items-center justify-center gap-0.5 border-x border-border/60 text-sm",children:[e,t?v.jsx("span",{"data-unit":!0,className:"text-[11px] text-foreground-subtle",children:t}):null]}),v.jsx("button",{type:"button","aria-label":"Increment",className:"w-9 shrink-0 bg-surface-hover text-base text-foreground",onClick:()=>n(1),children:"+"})]})}function pse({on:e,targetLabel:t,onConfirm:n}){const a=T.useRef(null),s=T.useRef(!1);return v.jsxs("div",{className:oe("relative h-12 w-full rounded-full border flex items-center",e?"bg-emerald-50 border-emerald-200 pl-4":"bg-amber-50 border-amber-200 justify-end pr-4"),children:[v.jsx("span",{className:"text-xs font-semibold opacity-60",children:t}),v.jsx("span",{"data-testid":"slide-thumb",className:"absolute top-1 left-1 h-10 w-14 rounded-[19px] bg-surface shadow flex items-center justify-center",onPointerDown:p=>{p.currentTarget.setPointerCapture?.(p.pointerId),a.current=p.clientX,s.current=!1},onPointerMove:p=>{a.current!==null&&Math.abs(p.clientX-a.current)>40&&(s.current=!0)},onPointerUp:()=>{s.current&&n(),s.current=!1,a.current=null},onPointerCancel:()=>{s.current=!1,a.current=null}})]})}var mse=2,MC=270,fse=315;function hse(e){const t=(e-135+360)%360;return t>MC?t<=fse?1:0:t/MC}function Rp({fraction:e,color:t,knobTopPx:n,onDragFraction:a}){const s=-135+e*270,p=T.useRef(null),[f,m]=T.useState(!1),h=a!==void 0,c=n??mse,x=E=>{a!==void 0&&(E.preventDefault(),E.stopPropagation(),E.currentTarget.setPointerCapture?.(E.pointerId),m(!0))},M=E=>{if(a===void 0||!f)return;const R=p.current;if(R===null)return;const _=R.getBoundingClientRect(),P=_.left+_.width/2,D=_.top+_.height/2;a(hse(Math.atan2(E.clientY-D,E.clientX-P)*180/Math.PI))},C=E=>{a!==void 0&&(E.currentTarget.releasePointerCapture?.(E.pointerId),m(!1))};return v.jsx("div",{ref:p,className:"absolute inset-0",style:{transform:`rotate(${s}deg)`},children:v.jsx("div",{className:oe("absolute left-1/2 h-5 w-5 -translate-x-1/2 rounded-full bg-white shadow",h&&(f?"cursor-grabbing":"cursor-grab")),style:{top:c,border:`3px solid ${t}`},...h?{onPointerDown:x,onPointerMove:M,onPointerUp:C,onPointerCancel:C}:{}})})}function Fy({fraction:e,color:t}){return v.jsxs("div",{className:"relative h-2 w-full rounded-full bg-border",children:[v.jsx("div",{className:"absolute left-0 top-0 h-2 rounded-full",style:{width:`${e*100}%`,background:t??"var(--color-primary)"}}),v.jsx("div",{className:"absolute -top-1 h-4 w-4 rounded-full bg-white shadow",style:{left:`calc(${e*100}% - 8px)`}})]})}var Ui=150,Ip=64,gse=Ui/2,Hy=2*Math.PI*Ip,Vg=Hy*(270/360);function f4({fraction:e,color:t,children:n,onDragFraction:a}){const s=Math.min(1,Math.max(0,e)),p=Ui/2,f=Ui/2,m=Hy-Vg,h=s*Vg;return v.jsxs("div",{className:"relative",style:{width:Ui,height:Ui},children:[v.jsxs("svg",{width:Ui,height:Ui,viewBox:`0 0 ${Ui} ${Ui}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:p,cy:f,r:Ip,fill:"none",stroke:"var(--color-border)",strokeWidth:11,strokeDasharray:`${Vg} ${m}`,strokeLinecap:"round"}),v.jsx("circle",{cx:p,cy:f,r:Ip,fill:"none",stroke:t,strokeWidth:11,strokeDasharray:`${h} ${Hy-h}`,strokeLinecap:"round"})]}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Rp,{fraction:s,color:t,knobTopPx:gse-Ip-10,...a!==void 0?{onDragFraction:a}:{}})}),v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none",children:n})]})}function k0({on:e,busy:t,onToggle:n}){const a={transform:e?"translateX(30px)":"translateX(3px)"};return v.jsx("button",{type:"button","aria-pressed":e,title:e?"Turn off":"Turn on",disabled:t,onClick:s=>{s.stopPropagation(),n()},className:oe("relative inline-flex h-8 w-16 items-center rounded-full border transition-colors flex-shrink-0",e?"bg-success/30 border-success/50":"bg-surface-hover border-border",t&&"opacity-60 cursor-not-allowed"),children:v.jsx("span",{className:oe("absolute h-6 w-6 rounded-full transition-all",e?"bg-success":"bg-foreground-subtle"),style:a})})}function vse({trpc:e,deviceId:t}){const n=vu(e,t),a=n!==null?n.button:void 0;if(a===void 0)return null;const s=()=>{a.press({deviceId:t})};return v.jsxs("button",{type:"button","aria-label":"Press",title:"Press",onClick:p=>{p.stopPropagation(),s()},className:oe("inline-flex h-5 items-center gap-1 rounded px-1.5 text-xs","bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"),children:[v.jsx(y_,{className:"h-3 w-3"}),v.jsx("span",{children:"Press"})]})}function yse({trpc:e,deviceId:t}){const n=vu(e,t),a=n!==null?n.button:void 0;if(a===void 0)return null;const s=()=>{a.press({deviceId:t})};return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx("button",{type:"button","aria-label":"Press button",onClick:s,className:oe("inline-flex h-14 w-14 items-center justify-center rounded-full","bg-primary text-primary-foreground hover:bg-primary/90 transition-colors","shadow-md"),children:v.jsx(y_,{className:"h-6 w-6"})}),v.jsx("span",{className:"text-sm font-medium text-foreground",children:"Press"})]})}var bse=4e3;function CC(e){if(e!==void 0)return e!==null&&typeof e=="object"&&"lastChangedAt"in e&&typeof e.lastChangedAt=="number"?e.lastChangedAt:e}function zt(e,t){const n=t?.enabled!==!1,a=t?.timeoutMs??bse,[s,p]=T.useState(void 0),f=T.useRef(void 0),m=T.useRef(void 0),h=T.useRef(!1),c=T.useRef(void 0),x=T.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0),f.current=void 0,h.current=!1,m.current=void 0,p(void 0)},[]);T.useEffect(()=>{if(!n||!h.current)return;const C=CC(e),E=m.current;C!==void 0&&C!==E&&x()}),T.useEffect(()=>()=>{c.current!==void 0&&clearTimeout(c.current)},[]);const M=T.useCallback(C=>{if(!n)return;c.current!==void 0&&(clearTimeout(c.current),c.current=void 0);const E=f.current??e;if(E!==void 0){const R={...E,...C};f.current=R,p(R)}m.current=CC(e),h.current=!0,c.current=setTimeout(x,a)},[n,e,x,a]);return n?{display:s!==void 0?s:e,applyOptimistic:M}:{display:e,applyOptimistic:()=>{}}}function Sse(e){return e instanceof Error?e.message:String(e)}function xse({trpc:e,deviceId:t,layout:n,optimistic:a,features:s}){const{cap:p,slice:f,available:m}=vt({trpc:e,deviceId:t,cap:$=>$.lockControl,slice:$=>$.state.lockControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:a??!0}),[x,M]=T.useState(null),[C,E]=T.useState(!1),[R,_]=T.useState(null);if(h===void 0)return null;const P=h.state==="locked"||h.state==="locking",D=!m||h.state==="jammed",L=s?.includes(da.LockOpen)===!0,B=n==="compact",q=()=>{c({state:"locking"}),p?.lock({})},G=()=>{c({state:"unlocking"}),p?.unlock({})},ne=()=>{p?.open({})},V=()=>{if(!D){if(!P){q();return}if(B){_(null),M("unlock");return}G()}},U=()=>{if(!D){if(B){_(null),M("open");return}ne()}},me=()=>{C||M(null)},Me=async()=>{if(!(C||x===null)){_(null),E(!0);try{x==="unlock"?(c({state:"unlocking"}),await p?.unlock({})):await p?.open({}),M(null)}catch($){_(Sse($))}finally{E(!1)}}},Ce=P?"Unlock":"Lock",Ae=x==="open"?"Open door?":"Unlock device?",Ee=x==="open"?"This will release the latch and open the door.":"This will unlock the device.",re=x==="open"?"Confirm open":"Confirm unlock",Te=x==="open"?v.jsx(il,{className:"h-4 w-4 text-amber-400"}):v.jsx(wy,{className:"h-4 w-4 text-amber-400"});return v.jsxs("div",{className:oe("inline-flex items-center",n==="full"?"gap-2":"gap-1"),children:[v.jsxs("button",{type:"button","aria-label":Ce,title:h.state==="jammed"?"Jammed":Ce,disabled:D,onClick:$=>{$.stopPropagation(),V()},className:oe("inline-flex items-center justify-center rounded transition-colors",n==="full"?"h-7 gap-1.5 px-2 text-xs":"h-5 w-5",P?"text-success":"text-warning",D&&"opacity-40 cursor-not-allowed","hover:bg-surface-hover"),children:[P?v.jsx(pu,{className:"h-3.5 w-3.5"}):v.jsx(wy,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:h.state})]}),L&&v.jsxs("button",{type:"button","aria-label":"Open door",title:"Open door",disabled:D,onClick:$=>{$.stopPropagation(),U()},className:oe("inline-flex items-center justify-center rounded transition-colors",n==="full"?"h-7 gap-1.5 px-2 text-xs":"h-5 w-5","text-foreground-muted",D&&"opacity-40 cursor-not-allowed","hover:bg-surface-hover"),children:[v.jsx(il,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:"Open"})]}),B&&v.jsx(WN,{open:x!==null,onOpenChange:$=>{$||me()},children:v.jsxs(x0,{width:"sm",onClick:$=>$.stopPropagation(),children:[v.jsxs(moe,{children:[v.jsxs(hoe,{className:"flex items-center gap-2",children:[Te,Ae]}),v.jsx(goe,{children:Ee})]}),R!==null&&v.jsx("div",{className:"mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10 text-xs text-danger",children:R}),v.jsxs(foe,{children:[v.jsx(Dy,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:()=>me(),children:"Cancel"}),v.jsxs(Dy,{type:"button",variant:"danger",size:"sm","aria-label":re,disabled:C,onClick:()=>{Me()},children:[C&&v.jsx(s0,{className:"h-3.5 w-3.5 animate-spin"}),re]})]})]})})]})}function w0({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:R=>R.switch,slice:R=>R.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),[h,c]=T.useState(!1);if(f===void 0)return null;const x=f.on===!0,M=h||!p,C={transform:x?"translateX(14px)":"translateX(2px)"},E=async()=>{if(M||!a)return;const R=!x;m({on:R}),c(!0);try{await a.setState({on:R})}finally{c(!1)}};return v.jsx("button",{type:"button","aria-pressed":x,title:x?"Turn off":"Turn on",disabled:M,onClick:R=>{R.stopPropagation(),E()},className:oe("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",x?"bg-success/30 border-success/50":"bg-surface-hover border-border",M&&"opacity-60"),children:v.jsx("span",{className:oe("absolute h-3 w-3 rounded-full transition-all",x?"bg-success":"bg-foreground-subtle"),style:C})})}function kse({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:x=>x.brightness,slice:x=>x.state.brightness}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(m===void 0)return null;const c=!f;return v.jsxs("label",{className:oe("flex items-center gap-2 text-xs text-foreground-subtle",n==="compact"&&"min-w-[140px]"),children:[v.jsx("input",{"aria-label":"Brightness",type:"range",min:0,max:100,step:1,value:m.percentage,disabled:c,onChange:x=>{const M=Number(x.target.value);h({percentage:M}),c||s?.setBrightness({percentage:M})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[m.percentage,"%"]})]})}function wse({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=vt({trpc:e,deviceId:t,cap:_=>_.fanControl,slice:_=>_.state.fanControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=n??[],C=M.includes("fan-speed"),E=M.includes("fan-preset"),R=f?.percentageStep!=null&&f.percentageStep>0?f.percentageStep:1;return v.jsxs("div",{className:oe("inline-flex items-center gap-2",a==="full"&&"flex-col items-stretch"),children:[C&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("input",{"aria-label":"Fan speed",type:"range",min:0,max:100,step:R,value:h.percentage??0,disabled:x,onChange:_=>{const P=Number(_.target.value),D=Math.min(100,Math.max(0,Math.round(P/R)*R));c({percentage:D}),x||p?.setPercentage({percentage:D})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.percentage??"—","%"]})]}),E&&h.availablePresets.length>0&&v.jsx("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:v.jsxs("select",{"aria-label":"Fan preset",value:h.preset,disabled:x,onChange:_=>{const P=_.target.value;!x&&P&&(c({preset:P}),p?.setPreset({preset:P}))},className:"bg-surface border border-border rounded px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(_=>v.jsx("option",{value:_,children:_},_))]})})]})}var M0={heat:"border-amber-400 bg-amber-50 dark:bg-amber-950",cool:"border-blue-400 bg-blue-50 dark:bg-blue-950",auto:"border-purple-400 bg-purple-50 dark:bg-purple-950",heat_cool:"border-fuchsia-400 bg-fuchsia-50 dark:bg-fuchsia-950",fan_only:"border-slate-400 bg-slate-50 dark:bg-slate-950",dry:"border-cyan-400 bg-cyan-50 dark:bg-cyan-950",off:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900"},h4={heat:"text-amber-600 dark:text-amber-400",cool:"text-blue-600 dark:text-blue-400",auto:"text-purple-600 dark:text-purple-400",heat_cool:"text-fuchsia-600 dark:text-fuchsia-400",fan_only:"text-slate-600 dark:text-slate-400",dry:"text-cyan-600 dark:text-cyan-400",off:"text-foreground"},Mse={heat:"bg-amber-400 text-amber-950",cool:"bg-blue-400 text-blue-950",auto:"bg-purple-400 text-purple-950",heat_cool:"bg-fuchsia-400 text-fuchsia-950",fan_only:"bg-slate-400 text-slate-950",dry:"bg-cyan-400 text-cyan-950",off:"bg-zinc-300 text-zinc-700"};function Cse({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=vt({trpc:e,deviceId:t,cap:E=>E.climateControl,slice:E=>E.state.climateControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(p===void 0||h===void 0)return null;const x=!m;if(a==="compact")return v.jsxs("div",{"data-mode":h.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:oe("text-xs tabular-nums font-medium",h4[h.mode]),children:h.target!==null?v.jsxs(v.Fragment,{children:[h.target,"°",h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",h.currentTemp,"°)"]})]}):h.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}):null}),h.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;c({target:R}),p.setTarget({target:R})}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;c({target:R}),p.setTarget({target:R})}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:h.mode,disabled:x,onChange:E=>{E.stopPropagation();const R=E.target.value;x||(c({mode:R}),p.setMode({mode:R}))},className:oe("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",x&&"opacity-40 cursor-not-allowed"),children:h.availableModes.map(E=>v.jsx("option",{value:E,children:E},E))})]});const M=h.mode==="heat_cool"||h.targetLow!==null&&h.targetHigh!==null,C=!M&&h.target!==null;return v.jsxs("div",{"data-mode":h.mode,className:oe("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",M0[h.mode],"flex-col items-stretch gap-3"),children:[v.jsxs("div",{className:"inline-flex items-center gap-1 text-xs tabular-nums",children:[h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}),C&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-foreground-subtle",children:"→"}),v.jsxs("span",{className:"font-medium",children:[h.target,"°"]}),v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;c({target:R}),p.setTarget({target:R})}},className:oe("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;c({target:R}),p.setTarget({target:R})}},className:oe("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",x&&"opacity-40 cursor-not-allowed"),children:"+"})]})]}),v.jsx("div",{className:"inline-flex items-center gap-0.5 rounded bg-surface-subtle p-0.5",children:h.availableModes.map(E=>v.jsx("button",{type:"button","aria-label":E,disabled:x,onClick:R=>{R.stopPropagation(),x||(c({mode:E}),p.setMode({mode:E}))},className:oe("rounded px-1.5 py-0.5 text-xs transition-colors",E===h.mode?Mse[E]:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:E},E))}),M&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"Low"}),v.jsx("input",{"aria-label":"Target low",type:"number",step:.5,value:h.targetLow??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetHigh??R;c({targetLow:R}),p.setTargetRange({targetLow:R,targetHigh:_})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]}),v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"High"}),v.jsx("input",{"aria-label":"Target high",type:"number",step:.5,value:h.targetHigh??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetLow??R;c({targetHigh:R}),p.setTargetRange({targetLow:_,targetHigh:R})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]})]}),h.availableFanModes.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Fan"}),v.jsxs("select",{"aria-label":"Fan mode",value:h.fanMode,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({fanMode:R}),p.setFanMode({fanMode:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableFanModes.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.availablePresets.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Preset",value:h.preset,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({preset:R}),p.setPreset({preset:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.targetHumidity!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Humidity"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:0,max:100,step:1,value:h.targetHumidity,disabled:x,onChange:E=>{const R=Number(E.target.value);c({targetHumidity:R}),x||p.setTargetHumidity({targetHumidity:R})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.targetHumidity,"%"]})]})]})}var Ase={playing:"border-green-400 bg-green-50 dark:bg-green-950",paused:"border-amber-400 bg-amber-50 dark:bg-amber-950",buffering:"border-blue-400 bg-blue-50 dark:bg-blue-950",on:"border-slate-400 bg-slate-50 dark:bg-slate-950",idle:"border-slate-400 bg-slate-50 dark:bg-slate-950",off:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900",standby:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900"},Ese={playing:"bg-green-500",paused:"bg-amber-400",buffering:"bg-blue-400",on:"bg-slate-400",idle:"bg-slate-400",off:"bg-zinc-300",standby:"bg-zinc-300"},g4=["off","all","one"];function Rse(e){return g4.includes(e)}var Ise={off:"Off",all:"All",one:"One"};function Tse(e){return e==="playing"||e==="buffering"?"pause":"play"}function _se({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=vt({trpc:e,deviceId:t,cap:C=>C.mediaPlayer,slice:C=>C.state.mediaPlayer}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=Tse(h.state);return v.jsxs("div",{"data-state":h.state,className:oe("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",Ase[h.state],a==="full"&&"flex-col items-stretch gap-3"),children:[v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("span",{role:"status","aria-label":h.state,className:oe("inline-block h-2 w-2 rounded-full flex-shrink-0",Ese[h.state])}),v.jsx("button",{type:"button","aria-label":M==="play"?"Play":"Pause",disabled:x,onClick:C=>{C.stopPropagation(),!x&&(M==="play"?(c({state:"playing"}),p?.play({})):(c({state:"paused"}),p?.pause({})))},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:M==="play"?"▶":"⏸"})]}),a==="full"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Previous",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.previous({})},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"⏮"}),v.jsx("button",{type:"button","aria-label":"Next",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.next({})},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"⏭"})]}),h.volumeLevel!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Vol"}),v.jsx("input",{"aria-label":"Volume",type:"range",min:0,max:100,step:1,value:h.volumeLevel,disabled:x,onChange:C=>{const E=Number(C.target.value);c({volumeLevel:E}),x||p?.setVolume({volumeLevel:E})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.volumeLevel,"%"]})]}),h.isMuted!==null&&v.jsx("button",{type:"button","aria-label":h.isMuted?"Unmute":"Mute",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.isMuted!==null){const E=!h.isMuted;c({isMuted:E}),p?.setMute({muted:E})}},className:oe("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors",h.isMuted?"bg-amber-400 text-amber-950":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:h.isMuted?"🔇":"🔊"}),h.availableSources.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Source"}),v.jsxs("select",{"aria-label":"Source",value:h.source,disabled:x,onChange:C=>{const E=C.target.value;!x&&E&&(c({source:E}),p?.selectSource({source:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableSources.map(C=>v.jsx("option",{value:C,children:C},C))]})]}),h.shuffle!==null&&v.jsx("button",{type:"button","aria-label":"Shuffle",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.shuffle!==null){const E=!h.shuffle;c({shuffle:E}),p?.setShuffle({shuffle:E})}},className:oe("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors",h.shuffle?"bg-green-400 text-green-950":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:"⇌ Shuffle"}),h.repeat!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Repeat"}),v.jsx("select",{"aria-label":"Repeat",value:h.repeat,disabled:x,onChange:C=>{const E=C.target.value;!x&&Rse(E)&&(c({repeat:E}),p?.setRepeat({repeat:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:g4.map(C=>v.jsx("option",{value:C,children:Ise[C]},C))})]})]})]})}function Oc(e,t){return t!==void 0?e.toFixed(t):Number.isInteger(e)?String(e):e.toFixed(1)}var Nse=/^(\d{4})-(\d{2})-(\d{2})/,Ose=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function Pse(e,t){const n=Nse.exec(e);if(n===null)return e;const a=Number(n[1]),s=Number(n[2]),p=Number(n[3]),f=new Date(a,s-1,p);if(Number.isNaN(f.getTime()))return e;try{return f.toLocaleDateString(t)}catch{return e}}function jse(e,t){const n=Ose.exec(e);if(n===null)return e;const a=new Date(1970,0,1,Number(n[1]),Number(n[2]),n[3]!==void 0?Number(n[3]):0);if(Number.isNaN(a.getTime()))return e;try{return a.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}catch{return e}}function Dse(e,t){const n=e.includes("T")?e:e.replace(" ","T"),a=new Date(n);if(Number.isNaN(a.getTime()))return e;try{return a.toLocaleString(t,{dateStyle:"medium",timeStyle:"short"})}catch{return e}}function C0(e,t,n){return e===""?e:t==="date"?Pse(e,n):t==="time"?jse(e,n):Dse(e,n)}function zse(e){return e.slice(0,10)}function Lse(e){return e.slice(0,5)}function qse(e){return(e.includes("T")?e:e.replace(" ","T")).slice(0,16)}function Bse({value:e,busy:t,onCommit:n,unit:a,min:s,max:p,step:f,precision:m}){const[h,c]=T.useState(Oc(e,m)),x=Number(h),M=h!==""&&!Number.isNaN(x),C=f??1,E=_=>{let P=_;return s!==void 0&&(P=Math.max(s,P)),p!==void 0&&(P=Math.min(p,P)),P},R=()=>{!t&&M&&n(E(x))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Decrement",disabled:t,onClick:_=>{if(_.stopPropagation(),!t){const P=E(e-C);c(Oc(P,m)),n(P)}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("input",{"aria-label":"Numeric value",type:"number",disabled:t,value:h,onChange:_=>{c(_.target.value);const P=Number(_.target.value);_.target.value!==""&&!Number.isNaN(P)&&(t||n(E(P)))},onBlur:R,onKeyDown:_=>{_.key==="Enter"&&R()},className:oe("w-16 rounded border border-border bg-surface px-1 py-0.5 text-xs tabular-nums text-center",t&&"opacity-40 cursor-not-allowed")}),a!==void 0&&v.jsx("span",{className:"text-foreground-subtle text-xs",children:a}),v.jsx("button",{type:"button","aria-label":"Increment",disabled:t,onClick:_=>{if(_.stopPropagation(),!t){const P=E(e+C);c(Oc(P,m)),n(P)}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:"+"})]})}function Use({value:e,busy:t,onCommit:n}){const[a,s]=T.useState(e);return v.jsx("input",{type:"text",disabled:t,value:a,onChange:p=>s(p.target.value),onBlur:()=>{t||n(a)},onKeyDown:p=>{p.key==="Enter"&&!t&&n(a)},className:oe("rounded border border-border bg-surface px-2 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}function Fse({slice:e,busy:t,setValueFn:n,layout:a}){switch(e.kind){case"numeric":return v.jsx(Bse,{value:typeof e.value=="number"?e.value:Number(e.value),busy:t,onCommit:s=>{n({control:{kind:"numeric",value:s}})},unit:e.unit,min:e.min,max:e.max,step:e.step,precision:e.precision});case"select":return v.jsx("select",{"aria-label":"Control value",disabled:t,value:String(e.value),onChange:s=>{s.stopPropagation(),t||n({control:{kind:"select",value:s.target.value}})},className:oe("w-full max-w-full min-w-0 truncate rounded border border-border bg-surface px-1 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed"),children:e.options.map(s=>v.jsx("option",{value:s,children:s},s))});case"text":return v.jsx(Use,{value:String(e.value),busy:t,onCommit:s=>{n({control:{kind:"text",value:s}})}});case"datetime":{const s=String(e.value),p=e.format??"datetime";return a==="compact"?s===""?v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground-subtle",children:"—"}):v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground",children:C0(s,p)}):v.jsx("input",{type:p==="date"?"date":p==="time"?"time":"datetime-local","aria-label":"Control value",disabled:t,value:p==="date"?zse(s):p==="time"?Lse(s):qse(s),onChange:f=>{f.stopPropagation(),t||n({control:{kind:"datetime",value:f.target.value}})},className:oe("rounded border border-border bg-surface px-1 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}default:return null}}function v4({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=vt({trpc:e,deviceId:t,cap:C=>C.control,slice:C=>C.state.control}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=C=>{!x&&p&&(c({value:C.control.value}),p.setValue(C))};return v.jsx("div",{"data-kind":h.kind,className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-border px-2 py-1 transition-colors",children:v.jsx(Fse,{slice:h,busy:x,setValueFn:M,layout:a})})}var Hse=e=>e;function y4(e){const t=e.capName!==void 0?e.display?.perCap?.[e.capName]:void 0,n=t?.precision??e.display?.precision??e.roleDefault?.precision??e.slicePrecision,a=e.sliceUnit??e.canonicalUnit,s=t?.unit??e.display?.unit??e.roleDefault?.unit;return s!==void 0&&a!==void 0&&s!==a&&qJ(a,s)?{unit:s,precision:n,toDisplayValue:p=>LJ(p,a,s)??p}:{unit:a??"",precision:n,toDisplayValue:Hse}}var b4={kind:"binary",field:"on",onLabel:"Low",offLabel:"Normal"};function S4(e){return e==="battery-sensor"}function x4(e,t){if(!w4(e))return!1;const n=e[t];if(typeof n!="number")return!1;const a=e.lastFetchedAt;return!(n===0&&a===0)}var k4={"temperature-sensor":{kind:"numeric",field:"celsius",canonicalUnit:"°C",getSliceHandle:e=>e.temperatureSensor},"humidity-sensor":{kind:"numeric",field:"percent",canonicalUnit:"%",getSliceHandle:e=>e.humiditySensor},"ambient-light-sensor":{kind:"numeric",field:"lux",canonicalUnit:"lx",getSliceHandle:e=>e.ambientLightSensor},"pressure-sensor":{kind:"numeric",field:"hpa",canonicalUnit:"hPa",getSliceHandle:e=>e.pressureSensor},"numeric-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"wind-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"rain-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"uv-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"solar-radiation-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"soil-moisture-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"power-sensor":{kind:"numeric",field:"watts",canonicalUnit:"W",getSliceHandle:e=>e.powerMeter},"energy-sensor":{kind:"numeric",field:"kwhTotal",canonicalUnit:"kWh",getSliceHandle:e=>e.powerMeter},"voltage-sensor":{kind:"numeric",field:"volts",canonicalUnit:"V",getSliceHandle:e=>e.powerMeter},"current-sensor":{kind:"numeric",field:"amps",canonicalUnit:"A",getSliceHandle:e=>e.powerMeter},"battery-sensor":{kind:"numeric",field:"value",canonicalUnit:"%",getSliceHandle:e=>e.numericSensor},"generic-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"motion-sensor":{kind:"binary",field:"detected",onLabel:"Detected",offLabel:"Clear",getSliceHandle:e=>e.motion},"pir-sensor":{kind:"binary",field:"detected",onLabel:"Detected",offLabel:"Clear",getSliceHandle:e=>e.motion},"contact-sensor":{kind:"binary",field:"entryOpen",onLabel:"Open",offLabel:"Closed",getSliceHandle:e=>e.contact},"smoke-sensor":{kind:"binary",field:"detected",onLabel:"Smoke!",offLabel:"Clear",getSliceHandle:e=>e.smoke},"leak-sensor":{kind:"binary",field:"flooded",onLabel:"Leak!",offLabel:"Dry",getSliceHandle:e=>e.flood},"co-sensor":{kind:"binary",field:"detected",onLabel:"CO!",offLabel:"Clear",getSliceHandle:e=>e.carbonMonoxide},"binary-sensor":{kind:"binary",field:"on",onLabel:"On",offLabel:"Off",getSliceHandle:e=>e.binary},presence:{kind:"presence",getSliceHandle:e=>e.presence},"enum-sensor":{kind:"string",getSliceHandle:e=>e.enumSensor},"datetime-sensor":{kind:"datetime",format:"datetime",getSliceHandle:e=>e.enumSensor}};function w4(e){return typeof e=="object"&&e!==null}function $se(e){return typeof e=="object"&&e!==null}function Qse(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function Pc(e){return typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string"}function M4(e){if(typeof e!="object"||e===null)return;const t=e.format;if(t==="date"||t==="time"||t==="datetime")return t}function Vse(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}function Gse({trpc:e,device:t}){const n=t.role!=null?k4[t.role]:void 0,a=S4(t.role),{data:s}=T_({},{staleTime:6e4}),p=vu(e,t.id),f=To(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=To(p!==null&&n?.kind==="numeric"?p.state.enumSensor:void 0),h=To(p!==null&&a?p.state.binary:void 0),c=a&&n?.kind==="numeric"&&!x4(f,n.field)&&h!==void 0,x=c?b4:n,M=c?h:f;if(x===void 0||M===void 0)return null;if(x.kind==="numeric"){if(!w4(M))return null;const E=M[x.field];if(typeof E!="number")return null;const R=M.lastFetchedAt,_=E===0&&R===0;if(_&&Pc(m)&&m.value!=="")return v.jsx("span",{className:oe("inline-flex items-baseline text-xs text-foreground"),children:m.value});if(_)return null;const P=M,D=typeof P.unit=="string"?P.unit:void 0,L=typeof P.precision=="number"?P.precision:void 0,B=y4({display:t.display,capName:t.role==="numeric-sensor"?"numeric-sensor":void 0,roleDefault:t.role!=null?s?.defaults[t.role]:void 0,sliceUnit:D,slicePrecision:L,canonicalUnit:x.canonicalUnit}),q=B.unit,G=Oc(B.toDisplayValue(E),B.precision);return v.jsxs("span",{className:oe("inline-flex items-baseline gap-0.5 tabular-nums text-xs text-foreground"),children:[v.jsx("span",{children:G}),q&&v.jsx("span",{className:"text-foreground-subtle",children:q})]})}if(x.kind==="binary"){if(!$se(M))return null;const R=!!M[x.field],_=R?x.onLabel:x.offLabel;return v.jsx("span",{className:oe("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",R?"bg-warning/15 text-warning":"bg-surface-subtle text-foreground-subtle"),children:_})}if(x.kind==="string")return!Pc(M)||M.value===""?null:v.jsx("span",{className:oe("inline-flex items-baseline text-xs text-foreground"),children:M.value});if(x.kind==="datetime"){if(!Pc(M)||M.value==="")return null;const E=M4(M)??x.format,R=C0(M.value,E);return v.jsx("span",{className:oe("inline-flex items-baseline text-xs text-foreground"),children:R})}if(!Qse(M))return null;const C=Vse(M.state);return v.jsx("span",{className:oe("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",M.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:C})}function Nm(e){switch(e){case"opening":return{up:"accent",stop:"neutral",down:"neutral"};case"closing":return{up:"neutral",stop:"neutral",down:"accent"};case"open":return{up:"filled",stop:"neutral",down:"neutral"};case"closed":return{up:"neutral",stop:"neutral",down:"filled"};default:return{up:"neutral",stop:"neutral",down:"neutral"}}}function Zse(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Gg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",Zse(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Wse({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:M=>M.cover,slice:M=>M.state.cover}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=Nm(f?.state),c=!p,x=(M,C)=>{c||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Gg,{label:"Open",busy:c,variant:h.up,onClick:()=>x(a?.open,{state:"opening"}),children:v.jsx(Cm,{className:"h-3.5 w-3.5"})}),v.jsx(Gg,{label:"Stop",busy:c,variant:h.stop,onClick:()=>x(a?.stop,{state:"stopped"}),children:v.jsx(hu,{className:"h-3 w-3"})}),v.jsx(Gg,{label:"Close",busy:c,variant:h.down,onClick:()=>x(a?.close,{state:"closing"}),children:v.jsx(zo,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.position!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle ml-1",children:[f.position,"%"]})]})}function Zg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n==="accent"&&"bg-primary text-primary-foreground hover:bg-primary/90",n==="filled"&&"bg-primary/15 text-primary",t&&"opacity-40 cursor-not-allowed"),children:s})}function C4(){return v.jsxs(v.Fragment,{children:[v.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-px bg-white/60"}),v.jsx("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-1/2 h-px -translate-y-px bg-white/60"})]})}function Kse({position:e,interactive:t,onSetPosition:n}){const a=(1-e/100)*100,s=T.useRef(null),p=T.useRef(!1),f=T.useRef(null),m=C=>{const E=s.current;if(E===null)return e;const R=E.getBoundingClientRect();if(R.height<=0)return e;const _=(C-R.top)/R.height,P=Math.round(100-_*100);return Math.min(100,Math.max(0,P))},h=C=>{if(n===void 0)return;const E=m(C);f.current!==E&&(f.current=E,n(E))},c=C=>{t&&(C.stopPropagation(),C.preventDefault(),p.current=!0,f.current=null,C.currentTarget.setPointerCapture(C.pointerId),h(C.clientY))},x=C=>{!t||!p.current||(C.stopPropagation(),h(C.clientY))},M=C=>{!t||!p.current||(C.stopPropagation(),p.current=!1,f.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))};return v.jsxs("div",{ref:s,"data-testid":"cover-window",...t?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e}:{"aria-hidden":"true"},onPointerDown:t?c:void 0,onPointerMove:t?x:void 0,onPointerUp:t?M:void 0,onPointerCancel:t?M:void 0,className:oe("relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0",t&&"cursor-ns-resize touch-none select-none"),style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.5)"},children:[v.jsx(C4,{}),v.jsx("div",{className:"absolute inset-x-0 top-0 transition-all duration-200",style:{height:`${a}%`,background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)",borderBottom:a>0?"1px solid #9aa":"none"}}),v.jsxs("div",{"data-testid":"cover-lever",className:oe("absolute inset-x-0 h-4 flex items-center justify-center gap-1 z-10 transition-all duration-200",t&&"cursor-grab active:cursor-grabbing"),style:{top:`calc(${a}% - 8px)`},children:[v.jsx("div",{className:"absolute -inset-x-1.5 h-full rounded-lg bg-slate-600 shadow-md"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsxs("span",{"data-testid":"cover-position-pct",className:"absolute left-full ml-2 text-xs font-semibold text-foreground tabular-nums whitespace-nowrap",children:[e,"%"]})]})]})}function Yse({isOpen:e}){return v.jsxs("div",{"data-testid":"cover-window","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.5)"},children:[v.jsx(C4,{}),!e&&v.jsx("div",{className:"absolute inset-0",style:{background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)"}})]})}function Xse({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:L=>L.cover,slice:L=>L.state.cover}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(da.CoverPositionable),M=(n??[]).includes(da.CoverTilt),C=Nm(m?.state),E=m?.position??null,R=E!==null,_=m?.state==="open"||m?.state==="opening",P=(L,B)=>{c||!L||(B!==void 0&&h(B),L({}))},D=L=>{c||(h({position:L}),s?.setPosition({position:L}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[R?v.jsx(Kse,{position:E,interactive:x,onSetPosition:x?D:void 0}):v.jsx(Yse,{isOpen:_}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:"text-3xl font-semibold capitalize text-foreground",children:m?.state??"—"})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Zg,{label:"Open",busy:c,variant:C.up,onClick:()=>P(s?.open,{state:"opening"}),children:v.jsx(Cm,{className:"h-5 w-5"})}),v.jsx(Zg,{label:"Stop",busy:c,variant:C.stop,onClick:()=>P(s?.stop,{state:"stopped"}),children:v.jsx(hu,{className:"h-4 w-4"})}),v.jsx(Zg,{label:"Close",busy:c,variant:C.down,onClick:()=>P(s?.close,{state:"closing"}),children:v.jsx(zo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange:L=>{D(Number(L.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&E!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]}),M&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Tilt"}),v.jsx("input",{"aria-label":"Tilt position",type:"range",min:0,max:100,step:1,value:m?.tiltPosition??0,disabled:c,className:"flex-1",onChange:L=>{const B=Number(L.target.value);h({tiltPosition:B}),c||s?.setTiltPosition({tiltPosition:B})}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[m?.tiltPosition??"—","%"]})]})]})}function Jse(e){return v.jsx("span",{className:"text-foreground-subtle text-xs select-none","aria-hidden":"true",children:"—"})}function ele(e){return v.jsx("div",{className:"rounded border border-border bg-surface-subtle px-3 py-2 text-xs text-foreground-subtle",children:"Controls coming soon"})}function tle(e){return{id:e.id,stableId:e.stableId,addonId:e.addonId,type:e.type,name:e.name,online:e.online,disabled:e.disabled,parentDeviceId:e.parentDeviceId,role:e.role??void 0,features:e.features}}function nle({trpc:e,deviceId:t}){const{data:n}=__({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(Gse,{trpc:e,device:tle(n)})}function ale(e){return typeof e=="object"&&e!==null}function ile(e){return typeof e=="object"&&e!==null}function rle(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function ole(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}var sle={low:"bg-danger",medium:"bg-warning",high:"bg-success"};function lle(e){return e<=20?"low":e<=50?"medium":"high"}function cle({percent:e}){const t=Math.min(100,Math.max(0,e)),n=lle(t);return v.jsx("div",{"data-testid":"battery-bar","data-band":n,className:"h-2 w-24 overflow-hidden rounded-full bg-border",children:v.jsx("div",{className:oe("h-full rounded-full transition-all",sle[n]),style:{width:`${t}%`}})})}function ule({trpc:e,device:t}){const n=t.role!=null?k4[t.role]:void 0,a=S4(t.role),{data:s}=T_({},{staleTime:6e4}),p=vu(e,t.id),f=To(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=To(p!==null&&a?p.state.binary:void 0),h=a&&n?.kind==="numeric"&&!x4(f,n.field)&&m!==void 0,c=h?b4:n,x=h?m:f;if(c===void 0||x===void 0)return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});if(c.kind==="numeric"){if(!ale(x))return null;const C=x[c.field];if(typeof C!="number")return null;const E=x,R=typeof E.unit=="string"?E.unit:void 0,_=typeof E.precision=="number"?E.precision:void 0,P=y4({display:t.display,capName:t.role==="numeric-sensor"?"numeric-sensor":void 0,roleDefault:t.role!=null?s?.defaults[t.role]:void 0,sliceUnit:R,slicePrecision:_,canonicalUnit:c.canonicalUnit}),D=P.unit;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:Oc(P.toDisplayValue(C),P.precision)}),D&&v.jsx("span",{className:"text-base text-foreground-subtle",children:D})]}),a&&v.jsx(cle,{percent:C}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="binary"){if(!ile(x))return null;const E=!!x[c.field],R=E?c.onLabel:c.offLabel;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:oe("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",E?"bg-warning/15 text-warning":"bg-surface-subtle text-foreground-subtle"),children:R}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="datetime"){if(!Pc(x))return null;if(x.value==="")return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});const C=M4(x)??c.format;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:C0(x.value,C)}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="string")return!Pc(x)||x.value===""?null:v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-xl font-semibold text-foreground",children:x.value}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]});if(!rle(x))return null;const M=ole(x.state);return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:oe("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",x.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:M}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}function dle({trpc:e,deviceId:t}){const{data:n}=__({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(ule,{trpc:e,device:n})}function A4(e){return e===void 0||e.inProgress?!1:e.availableVersion!==null&&e.currentVersion!==null&&e.availableVersion!==e.currentVersion}function E4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.update,slice:n=>n.state.update})}function ple({trpc:e,deviceId:t}){const{cap:n,slice:a}=E4(e,t);return n===void 0?null:a?.inProgress?v.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-foreground-subtle",children:[v.jsx(s0,{className:"h-3.5 w-3.5 animate-spin"}),"Updating…"]}):A4(a)?v.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-warning/15 px-1.5 py-0.5 text-[10px] font-medium text-warning",children:[v.jsx(m_,{className:"h-3 w-3"}),"Update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[v.jsx(l_,{className:"h-3 w-3 text-success"}),a?.currentVersion??"Up to date"]})}function mle({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=E4(e,t);if(n===void 0)return null;const p=a?.inProgress===!0,f=A4(a),m=a?.currentVersion??"—",h=()=>{!s||n===void 0||!f||n.installUpdate({})};return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-baseline gap-1.5",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:m}),f&&a?.availableVersion!=null&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-base text-foreground-subtle",children:"→"}),v.jsx("span",{className:"text-base font-medium text-warning tabular-nums",children:a.availableVersion})]})]}),p?v.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-sm font-medium text-foreground-subtle",children:[v.jsx(s0,{className:"h-4 w-4 animate-spin"}),"Installing…"]}):f?v.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),h()},disabled:!s,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[v.jsx(m_,{className:"h-4 w-4"}),"Install update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded bg-success/15 px-3 py-1 text-sm font-medium text-success",children:[v.jsx(l_,{className:"h-4 w-4"}),"Up to date"]}),a?.state!=null&&a.state!==""&&v.jsx("span",{className:"text-[10px] text-foreground-subtle",children:a.state})]})}function fle(e){switch(e){case"cleaning":return{label:"Cleaning",tone:"text-primary"};case"paused":return{label:"Paused",tone:"text-warning"};case"returning":return{label:"Returning",tone:"text-primary"};case"docked":return{label:"Docked",tone:"text-success"};case"drying":return{label:"Drying",tone:"text-warning"};case"idle":return{label:"Idle",tone:"text-foreground-subtle"};case"error":return{label:"Error",tone:"text-destructive"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function R4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.vacuumControl,slice:n=>n.state.vacuumControl})}function Wg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground",t&&"opacity-40 cursor-not-allowed"),children:s})}function hle(e){switch(e){case"cleaning":return{glow:"bg-primary/15",accent:"text-primary",docked:!1,active:!0};case"returning":return{glow:"bg-primary/10",accent:"text-primary",docked:!1,active:!0};case"docked":return{glow:"bg-success/10",accent:"text-success",docked:!0,active:!1};case"drying":return{glow:"bg-warning/10",accent:"text-warning",docked:!0,active:!1};case"paused":return{glow:"bg-warning/10",accent:"text-warning",docked:!1,active:!1};case"error":return{glow:"bg-destructive/10",accent:"text-destructive",docked:!1,active:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1}}}var gle=`
83
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
84
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
85
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
86
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
87
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
88
- @keyframes rg-spin { to { transform:rotate(360deg) } }
89
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
90
- `;function vle({state:e,batteryLevel:t}){const n=hle(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:gle}),v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",n.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-20 h-20",fill:"none",children:[n.docked&&v.jsx("rect",{x:"34",y:"80",width:"32",height:"8",rx:"2",fill:"currentColor",opacity:"0.35",className:oe(a&&"rg-a"),style:a?{animation:"rg-pulse 1.2s ease-in-out infinite"}:void 0}),n.active&&v.jsx("circle",{cx:"50",cy:"50",r:"44",stroke:"currentColor",strokeWidth:"2",opacity:"0.4",className:"animate-ping",style:{transformOrigin:"center"}}),v.jsxs("g",{className:oe((s||p)&&"rg-a"),style:f,children:[v.jsx("circle",{cx:"50",cy:"50",r:"34",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("path",{d:"M 24 42 A 34 34 0 0 1 76 42",stroke:"currentColor",strokeWidth:"3",opacity:"0.55",strokeLinecap:"round"}),v.jsxs("g",{className:oe(n.active&&"rg-a"),style:n.active?{animation:"rg-spin 3s linear infinite",transformBox:"fill-box",transformOrigin:"center"}:void 0,children:[v.jsx("circle",{cx:"50",cy:"50",r:"9",fill:"currentColor",fillOpacity:"0.25",stroke:"currentColor",strokeWidth:"2"}),v.jsx("circle",{cx:"50",cy:"43",r:"2.4",fill:"currentColor"})]})]}),s&&v.jsxs("g",{fill:"currentColor",fontFamily:"sans-serif",fontWeight:"700",children:[v.jsx("text",{x:"64",y:"30",fontSize:"13",opacity:"0.7",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out infinite"},children:"z"}),v.jsx("text",{x:"73",y:"23",fontSize:"10",opacity:"0.6",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out .7s infinite"},children:"z"}),v.jsx("text",{x:"80",y:"17",fontSize:"8",opacity:"0.5",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out 1.4s infinite"},children:"z"})]}),a&&v.jsx("path",{d:"M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z",fill:"#fbbf24",stroke:"#f59e0b",strokeWidth:"1",className:"rg-a",style:{animation:"rg-spark 1s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}})]})})]})}function I4({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(Zp,{className:"h-3.5 w-3.5"}),e,"%"]})}function yle(e){switch(e){case"cleanWater":return!0;case"detergent":return!0;case"dirtyWater":return!1;case"dustBin":return!1;default:return e}}function ble(e,t){const n=yle(e);return t.level!==null?n?t.level<=15?"warning":"ok":t.level>=85?"warning":"ok":t.status!==null?n?t.status==="low"?"warning":"ok":t.status==="full"?"warning":"ok":"ok"}function Sle(e){switch(e){case"cleanWater":return{label:"Clean water",icon:v.jsx(o0,{className:"h-3.5 w-3.5"})};case"dirtyWater":return{label:"Dirty water",icon:v.jsx(pl,{className:"h-3.5 w-3.5"})};case"detergent":return{label:"Detergent",icon:v.jsx(yne,{className:"h-3.5 w-3.5"})};case"dustBin":return{label:"Dust bin",icon:v.jsx(Jne,{className:"h-3.5 w-3.5"})};default:return e}}function xle({kind:e,tank:t}){if(t===null)return null;const n=Sle(e),a=ble(e,t)==="warning";return t.level!==null?v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:oe("inline-flex items-center gap-1 w-24 shrink-0",a?"text-warning":"text-foreground-subtle"),children:[n.icon,n.label]}),v.jsx("span",{className:"relative h-1.5 flex-1 overflow-hidden rounded-full bg-surface-hover",children:v.jsx("span",{className:oe("absolute inset-y-0 left-0 rounded-full transition-all",a?"bg-warning":"bg-primary"),style:{width:`${t.level}%`}})}),v.jsxs("span",{className:oe("tabular-nums w-9 text-right",a?"text-warning":"text-foreground-subtle"),children:[t.level,"%"]})]}):t.status!==null?v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:oe("inline-flex items-center gap-1 w-24 shrink-0",a?"text-warning":"text-foreground-subtle"),children:[n.icon,n.label]}),v.jsx("span",{className:oe("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium",a?"bg-warning/15 text-warning":"bg-primary/15 text-foreground-subtle"),children:t.status})]}):v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:"inline-flex items-center gap-1 w-24 shrink-0 text-foreground-subtle",children:[n.icon,n.label]}),v.jsx("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium bg-surface-hover text-foreground-subtle",children:"—"})]})}function kle({cleanWater:e,dirtyWater:t,detergent:n,dustBin:a}){const s=[["cleanWater",e],["dirtyWater",t],["detergent",n],["dustBin",a]];return s.some(([,p])=>p!==null)?v.jsx("div",{className:"grid grid-cols-1 gap-x-6 gap-y-2 rounded-md border border-border bg-surface-hover/40 p-3 sm:grid-cols-2",children:s.map(([p,f])=>v.jsx(xle,{kind:p,tank:f},p))}):null}function wle({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=R4(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=f==="cleaning",h=c=>{p||c===void 0||c({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Wg,{label:"Start",busy:p,active:m,onClick:()=>h(n.start),children:v.jsx(Lo,{className:"h-3 w-3"})}),v.jsx(Wg,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(mu,{className:"h-3 w-3"})}),v.jsx(Wg,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>h(n.returnToBase),children:v.jsx(Am,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(I4,{level:a.batteryLevel})})]})}function vc({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground hover:bg-primary/90",t&&"opacity-40 cursor-not-allowed"),children:s})}function Mle({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=R4(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=fle(f),h=a?.availableFanSpeeds??[],c=M=>{p||M===void 0||M({})},x=M=>{p||M===""||n.setFanSpeed({speed:M})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(vle,{state:f,batteryLevel:a?.batteryLevel??null}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:oe("text-3xl font-semibold",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(I4,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-1.5 flex-1 rounded bg-surface-hover overflow-hidden",children:v.jsx("div",{className:"h-full bg-primary transition-[width] duration-500",style:{width:`${Math.max(0,Math.min(100,a.progressPercent))}%`}})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[Math.round(a.progressPercent),"%"]})]}),a?.errorCode!=null&&a.errorCode!==0&&v.jsxs("div",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:[v.jsx(rl,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:a.errorLabel??`Error ${a.errorCode}`})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vc,{label:"Start",busy:p,active:f==="cleaning",onClick:()=>c(n.start),children:v.jsx(Lo,{className:"h-5 w-5"})}),v.jsx(vc,{label:"Pause",busy:p,active:f==="paused",onClick:()=>c(n.pause),children:v.jsx(mu,{className:"h-5 w-5"})}),v.jsx(vc,{label:"Stop",busy:p,active:!1,onClick:()=>c(n.stop),children:v.jsx(hu,{className:"h-4 w-4"})}),v.jsx(vc,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>c(n.returnToBase),children:v.jsx(Am,{className:"h-5 w-5"})}),v.jsx(vc,{label:"Locate",busy:p,active:!1,onClick:()=>c(n.locate),children:v.jsx(g_,{className:"h-5 w-5"})})]})]})]}),h.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16 shrink-0",children:"Fan speed"}),v.jsxs("select",{"aria-label":"Fan speed",value:a?.fanSpeed??"",disabled:p,onChange:M=>{x(M.target.value)},onClick:M=>{M.stopPropagation()},className:"flex-1 rounded border border-border bg-surface px-2 py-1 text-foreground disabled:opacity-50",children:[a?.fanSpeed==null&&v.jsx("option",{value:"",children:"—"}),h.map(M=>v.jsx("option",{value:M,children:M},M))]})]}),v.jsx(kle,{cleanWater:a?.cleanWater??null,dirtyWater:a?.dirtyWater??null,detergent:a?.detergent??null,dustBin:a?.dustBin??null})]})}function Cle(e){switch(e){case"mowing":return{label:"Mowing",tone:"text-primary"};case"paused":return{label:"Paused",tone:"text-warning"};case"docked":return{label:"Docked",tone:"text-success"};case"idle":return{label:"Idle",tone:"text-foreground-subtle"};case"error":return{label:"Error",tone:"text-destructive"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function T4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.lawnMowerControl,slice:n=>n.state.lawnMowerControl})}function Ale(e){switch(e){case"mowing":return{glow:"bg-primary/15",accent:"text-primary",docked:!1,active:!0};case"docked":return{glow:"bg-success/10",accent:"text-success",docked:!0,active:!1};case"paused":return{glow:"bg-warning/10",accent:"text-warning",docked:!1,active:!1};case"error":return{glow:"bg-destructive/10",accent:"text-destructive",docked:!1,active:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1}}}var Ele=`
91
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
92
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
93
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
94
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
95
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
96
- @keyframes rg-spin { to { transform:rotate(360deg) } }
97
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
98
- `;function Rle({activity:e,batteryLevel:t}){const n=Ale(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-emerald-700/40 to-emerald-900/30 overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:Ele}),v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",n.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-20 h-20",fill:"none",children:[n.docked&&v.jsx("rect",{x:"30",y:"78",width:"40",height:"9",rx:"2",fill:"currentColor",opacity:"0.35",className:oe(a&&"rg-a"),style:a?{animation:"rg-pulse 1.2s ease-in-out infinite"}:void 0}),n.active&&v.jsxs("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.5",children:[v.jsx("line",{x1:"18",y1:"36",x2:"10",y2:"36",className:"animate-pulse"}),v.jsx("line",{x1:"18",y1:"50",x2:"6",y2:"50",className:"animate-pulse"}),v.jsx("line",{x1:"18",y1:"64",x2:"10",y2:"64",className:"animate-pulse"})]}),v.jsxs("g",{className:oe((s||p)&&"rg-a"),style:f,children:[v.jsx("rect",{x:"28",y:"34",width:"44",height:"34",rx:"8",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("line",{x1:"34",y1:"60",x2:"66",y2:"60",stroke:"currentColor",strokeWidth:"2",opacity:"0.5"}),v.jsxs("g",{className:oe(n.active&&"rg-a"),style:n.active?{animation:"rg-spin 0.9s linear infinite",transformBox:"fill-box",transformOrigin:"center"}:void 0,children:[v.jsx("circle",{cx:"50",cy:"48",r:"5",stroke:"currentColor",strokeWidth:"2",opacity:"0.6"}),v.jsx("line",{x1:"45",y1:"48",x2:"55",y2:"48",stroke:"currentColor",strokeWidth:"2",opacity:"0.7"})]}),v.jsx("circle",{cx:"34",cy:"68",r:"6",fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2"}),v.jsx("circle",{cx:"66",cy:"68",r:"6",fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2"})]}),s&&v.jsxs("g",{fill:"currentColor",fontFamily:"sans-serif",fontWeight:"700",children:[v.jsx("text",{x:"64",y:"30",fontSize:"13",opacity:"0.7",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out infinite"},children:"z"}),v.jsx("text",{x:"73",y:"23",fontSize:"10",opacity:"0.6",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out .7s infinite"},children:"z"}),v.jsx("text",{x:"80",y:"17",fontSize:"8",opacity:"0.5",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out 1.4s infinite"},children:"z"})]}),a&&v.jsx("path",{d:"M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z",fill:"#fbbf24",stroke:"#f59e0b",strokeWidth:"1",className:"rg-a",style:{animation:"rg-spark 1s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}})]})})]})}function Ile(e){switch(e){case"error":return"text-destructive";case"warning":return"text-warning";case"info":return"text-foreground-subtle"}}function Tle({percent:e}){return v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-1.5 flex-1 rounded bg-surface-hover overflow-hidden",children:v.jsx("div",{className:"h-full bg-primary transition-[width] duration-500",style:{width:`${Math.max(0,Math.min(100,e))}%`}})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[Math.round(e),"%"]})]})}function _le({code:e,label:t,severity:n}){return v.jsxs("div",{className:oe("inline-flex items-center gap-1 text-xs",Ile(n)),children:[n!=="info"&&v.jsx(rl,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:t??`Code ${e}`})]})}function _4({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(Zp,{className:"h-3.5 w-3.5"}),e,"%"]})}function Kg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground",t&&"opacity-40 cursor-not-allowed"),children:s})}function Nle({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=T4(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=h=>{p||h===void 0||h({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Kg,{label:"Mow",busy:p,active:f==="mowing",onClick:()=>m(n.startMowing),children:v.jsx(Lo,{className:"h-3 w-3"})}),v.jsx(Kg,{label:"Pause",busy:p,active:f==="paused",onClick:()=>m(n.pause),children:v.jsx(mu,{className:"h-3 w-3"})}),v.jsx(Kg,{label:"Dock",busy:p,active:f==="docked",onClick:()=>m(n.dock),children:v.jsx(Am,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(_4,{level:a.batteryLevel})})]})}function Yg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground hover:bg-primary/90",t&&"opacity-40 cursor-not-allowed"),children:s})}function Ole({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=T4(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=Cle(f),h=c=>{p||c===void 0||c({})};return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Rle,{activity:f,batteryLevel:a?.batteryLevel??null}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:oe("text-3xl font-semibold",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(_4,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsx(Tle,{percent:a.progressPercent}),a?.currentCode!=null&&v.jsx(_le,{code:a.currentCode,label:a.currentCodeLabel,severity:a.severity}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yg,{label:"Start mowing",busy:p,active:f==="mowing",onClick:()=>h(n.startMowing),children:v.jsx(Lo,{className:"h-5 w-5"})}),v.jsx(Yg,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(mu,{className:"h-5 w-5"})}),v.jsx(Yg,{label:"Dock",busy:p,active:f==="docked",onClick:()=>h(n.dock),children:v.jsx(Am,{className:"h-5 w-5"})})]})]})]})})}function Ple(e){switch(e){case"open":return{label:"Open",tone:"text-primary"};case"opening":return{label:"Opening",tone:"text-primary"};case"closing":return{label:"Closing",tone:"text-warning"};case"closed":return{label:"Closed",tone:"text-foreground-subtle"};case"stopped":return{label:"Stopped",tone:"text-warning"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function N4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.valve,slice:n=>n.state.valve})}function O4(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Xg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",O4(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function jle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=N4(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=Nm(f?.state),x=(M,C)=>{h||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Xg,{label:"Open",busy:h,variant:c.up,onClick:()=>x(a.open,{state:"opening"}),children:v.jsx(Cm,{className:"h-3.5 w-3.5"})}),v.jsx(Xg,{label:"Stop",busy:h,variant:c.stop,onClick:()=>x(a.stop,{state:"stopped"}),children:v.jsx(hu,{className:"h-3 w-3"})}),v.jsx(Xg,{label:"Close",busy:h,variant:c.down,onClick:()=>x(a.close,{state:"closing"}),children:v.jsx(zo,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.position!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle ml-1",children:[f.position,"%"]})]})}function Dle(e){switch(e){case"open":return{glow:"bg-primary/15",accent:"text-primary",flowing:!0,active:!1};case"opening":return{glow:"bg-primary/10",accent:"text-primary",flowing:!0,active:!0};case"closing":return{glow:"bg-warning/10",accent:"text-warning",flowing:!1,active:!0};case"closed":return{glow:"bg-transparent",accent:"text-foreground-subtle",flowing:!1,active:!1};case"stopped":return{glow:"bg-warning/10",accent:"text-warning",flowing:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",flowing:!1,active:!1}}}function zle(e){switch(e){case"open":return 0;case"opening":return 0;case"closed":return 1;case"closing":return 1;case"stopped":return 1;case void 0:return 1}}function Lle({state:e,position:t,interactive:n,onSetPosition:a}){const s=Dle(e),p=t!==null?1-t/100:zle(e),f=41+p*8,m=-90*(1-p),h=T.useRef(null),c=T.useRef(!1),x=T.useRef(null),M=P=>{const D=t??0,L=h.current;if(L===null)return D;const B=L.getBoundingClientRect();if(B.height<=0)return D;const q=(P-B.top)/B.height,G=Math.round(100-q*100);return Math.min(100,Math.max(0,G))},C=P=>{if(a===void 0)return;const D=M(P);x.current!==D&&(x.current=D,a(D))},E=P=>{n&&(P.stopPropagation(),P.preventDefault(),c.current=!0,x.current=null,P.currentTarget.setPointerCapture(P.pointerId),C(P.clientY))},R=P=>{!n||!c.current||(P.stopPropagation(),C(P.clientY))},_=P=>{!n||!c.current||(P.stopPropagation(),c.current=!1,x.current=null,P.currentTarget.hasPointerCapture(P.pointerId)&&P.currentTarget.releasePointerCapture(P.pointerId))};return v.jsxs("div",{ref:h,"data-testid":"valve-graphic",...n?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t??0}:{"aria-hidden":"true"},onPointerDown:n?E:void 0,onPointerMove:n?R:void 0,onPointerUp:n?_:void 0,onPointerCancel:n?_:void 0,className:oe("relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",n&&"cursor-ns-resize touch-none select-none"),style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",s.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",s.accent),"aria-hidden":"true",children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("rect",{x:"40",y:"4",width:"20",height:"92",rx:"3",fill:"currentColor",fillOpacity:"0.06",stroke:"currentColor",strokeWidth:"2.5"}),s.flowing&&v.jsx("line",{x1:"50",y1:"8",x2:"50",y2:"92",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"4 8",opacity:"0.5",className:"animate-pulse"}),s.active&&v.jsx("circle",{cx:"50",cy:"50",r:"22",stroke:"currentColor",strokeWidth:"2",opacity:"0.4",className:"animate-ping",style:{transformOrigin:"center"}}),v.jsx("circle",{cx:"50",cy:"50",r:"17",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("rect",{x:"43",y:f,width:"14",height:"6",rx:"1.5",fill:"currentColor",fillOpacity:"0.55",className:"transition-all duration-200"}),v.jsx("line",{x1:"50",y1:"33",x2:"50",y2:"22",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),v.jsx("g",{style:{transform:`rotate(${m}deg)`,transformOrigin:"50px 20px",transition:"transform 200ms"},children:v.jsx("rect",{x:"34",y:"17",width:"32",height:"6",rx:"3",fill:"currentColor",fillOpacity:"0.7"})})]})})]})}function Jg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:oe("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",O4(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function qle({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=N4(e,t),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(da.ValvePositionable),M=Nm(m?.state),C=Ple(m?.state),E=m?.position??null,R=E!==null,_=(D,L)=>{c||!D||(L!==void 0&&h(L),D({}))},P=D=>{c||(h({position:D}),s.setPosition({position:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Lle,{state:m?.state,position:E,interactive:x&&R,onSetPosition:x&&R?P:void 0}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:oe("text-3xl font-semibold",C.tone),children:C.label})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Jg,{label:"Open",busy:c,variant:M.up,onClick:()=>_(s.open,{state:"opening"}),children:v.jsx(Cm,{className:"h-5 w-5"})}),v.jsx(Jg,{label:"Stop",busy:c,variant:M.stop,onClick:()=>_(s.stop,{state:"stopped"}),children:v.jsx(hu,{className:"h-4 w-4"})}),v.jsx(Jg,{label:"Close",busy:c,variant:M.down,onClick:()=>_(s.close,{state:"closing"}),children:v.jsx(zo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange:D=>{P(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&R&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]})]})}function Ble(e,t){switch(t){case"humidifying":return{glow:"bg-primary/15",accent:"text-primary",misting:!0};case"drying":return{glow:"bg-warning/10",accent:"text-warning",misting:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1};case"off":return{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1};default:return e?{glow:"bg-primary/10",accent:"text-primary",misting:!0}:{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1}}}function P4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.humidifier,slice:n=>n.state.humidifier})}function Ule({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=P4(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=f?.on??!1,x=()=>{h||(m({on:!c}),a.setOn({on:!c}))};return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":c?"Turn off":"Turn on",title:c?"Turn off":"Turn on",disabled:h,onClick:M=>{M.stopPropagation(),x()},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-xs transition-colors",c?"bg-primary text-primary-foreground":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:v.jsx(fu,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.targetHumidity!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[f.currentHumidity!==null&&v.jsxs(v.Fragment,{children:[f.currentHumidity,"%",v.jsx("span",{className:"mx-0.5",children:"→"})]}),f.targetHumidity,"%"]})]})}function Fle({fillPct:e,tint:t}){const n=82-Math.min(100,Math.max(0,e))/100*56,a=`humidifier-droplet-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"humidifier-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:a,children:v.jsx("path",{d:"M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z"})})}),t.misting&&v.jsxs("g",{className:"animate-pulse",opacity:"0.55",children:[v.jsx("line",{x1:"42",y1:"20",x2:"42",y2:"8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"}),v.jsx("line",{x1:"50",y1:"18",x2:"50",y2:"4",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"}),v.jsx("line",{x1:"58",y1:"20",x2:"58",y2:"8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"})]}),v.jsx("path",{d:"M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z",fill:"currentColor",fillOpacity:"0.08",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{clipPath:`url(#${a})`,children:v.jsx("rect",{x:"28",y:n,width:"44",height:"60",fill:"currentColor",fillOpacity:"0.4",className:"transition-all duration-300"})}),v.jsx("circle",{cx:"43",cy:"56",r:"3",fill:"currentColor",fillOpacity:"0.5"})]})})]})}function Hle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=P4(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Ble(f.on,f.action),x=f.minHumidity??0,M=f.maxHumidity??100,C=f.targetHumidity,E=f.currentHumidity,R=E??C??0,_=()=>{h||(m({on:!f.on}),a.setOn({on:!f.on}))},P=D=>{h||(m({targetHumidity:D}),a.setTargetHumidity({humidity:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Fle,{fillPct:R,tint:c}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:C!==null?C:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"target"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Current: ",E!==null?`${E}%`:"—",f.action!==null&&v.jsxs("span",{className:"ml-2 capitalize",children:["· ",f.action]})]}),v.jsxs("button",{type:"button","aria-label":f.on?"Turn off":"Turn on",disabled:h,onClick:D=>{D.stopPropagation(),_()},className:oe("inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors",f.on?"bg-primary text-primary-foreground":"border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:[v.jsx(fu,{className:"h-4 w-4"}),f.on?"On":"Off"]})]})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Target"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:x,max:M,step:1,value:C??x,disabled:h,className:"flex-1",onChange:D=>{P(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[C??"—","%"]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Mode",value:f.mode??"",disabled:h,onChange:D=>{D.stopPropagation();const L=f.availableModes.find(B=>B===D.target.value);!h&&L!==void 0&&(m({mode:L}),a.setMode({mode:L}))},className:oe("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",h&&"opacity-40 cursor-not-allowed"),children:f.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function $le(e){switch(e){case"heating":return{glow:"bg-warning/10",accent:"text-warning",heating:!0};case"idle":return{glow:"bg-primary/10",accent:"text-primary",heating:!1};case"off":return{glow:"bg-transparent",accent:"text-foreground-subtle",heating:!1}}}function Qle(e,t,n){return e===null||e==="off"?"off":t!==null&&n!==null&&t<n?"heating":"idle"}function j4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.waterHeater,slice:n=>n.state.waterHeater})}function Vle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s}=j4(e,t),{display:p}=zt(s,{enabled:n??!0});return a===void 0||p===void 0?null:v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsxs("span",{className:"tabular-nums",children:[p.currentTemp!==null&&v.jsxs(v.Fragment,{children:[p.currentTemp,"°",v.jsx("span",{className:"mx-0.5",children:"→"})]}),p.targetTemp!==null?`${p.targetTemp}°`:"—"]}),p.operationMode!==null&&v.jsxs("span",{className:"capitalize text-foreground-subtle/80",children:["· ",p.operationMode.replace(/_/g," ")]})]})}function Gle({fillPct:e,tint:t}){const n=86-Math.min(100,Math.max(0,e))/100*68,a=`water-heater-tank-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"water-heater-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:a,children:v.jsx("rect",{x:"30",y:"18",width:"40",height:"68",rx:"14"})})}),v.jsx("g",{clipPath:`url(#${a})`,children:v.jsx("rect",{x:"28",y:n,width:"44",height:"72",fill:"currentColor",fillOpacity:"0.32",className:"transition-all duration-300"})}),v.jsx("rect",{x:"30",y:"18",width:"40",height:"68",rx:"14",fill:"currentColor",fillOpacity:"0.06",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("line",{x1:"50",y1:"18",x2:"50",y2:"8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),v.jsx("rect",{x:"40",y:"6",width:"20",height:"5",rx:"2",fill:"currentColor",fillOpacity:"0.6"}),v.jsx("g",{className:t.heating?"animate-pulse":void 0,opacity:t.heating?.9:.35,children:v.jsx("path",{d:"M38 74 q4 -6 8 0 q4 6 8 0 q4 -6 8 0",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"none"})}),v.jsx("circle",{cx:"62",cy:"34",r:"3.5",stroke:"currentColor",strokeWidth:"2",fill:t.heating?"currentColor":"none",fillOpacity:"0.6"})]})})]})}function Zle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=j4(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Qle(f.operationMode,f.currentTemp,f.targetTemp),x=$le(c),M=f.currentTemp,C=f.targetTemp,E=f.minTemp,R=f.maxTemp,_=M!==null&&C!==null&&C>0?Math.min(100,M/C*100):M!==null&&R!==null&&R>0?Math.min(100,M/R*100):50,P=B=>{let q=B;return E!==null&&(q=Math.max(E,q)),R!==null&&(q=Math.min(R,q)),q},D=B=>{if(h||C===null)return;const q=P(C+B);m({targetTemp:q}),a.setTargetTemp({temp:q})},L=()=>{h||f.away===null||(m({away:!f.away}),a.setAway({on:!f.away}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Gle,{fillPct:_,tint:x}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:M!==null?M:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"°"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Target: ",C!==null?`${C}°`:"—",v.jsxs("span",{className:"ml-2 capitalize",children:["· ",c]})]}),C!==null&&v.jsx("div",{className:"w-[180px]",children:v.jsx(m4,{value:C,unit:"°",onDelta:D})})]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Operation mode",value:f.operationMode??"",disabled:h,onChange:B=>{B.stopPropagation();const q=f.availableModes.find(G=>G===B.target.value);!h&&q!==void 0&&(m({operationMode:q}),a.setOperationMode({mode:q}))},className:oe("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",h&&"opacity-40 cursor-not-allowed"),children:f.availableModes.map(B=>v.jsx("option",{value:B,children:B},B))}),f.away!==null&&v.jsxs("button",{type:"button","aria-label":f.away?"Disable away mode":"Enable away mode",disabled:h,onClick:B=>{B.stopPropagation(),L()},className:oe("inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors",f.away?"bg-primary text-primary-foreground":"border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:[v.jsx(fu,{className:"h-4 w-4"}),"Away ",f.away?"on":"off"]})]})}function D4(e){switch(e){case"sunny":return{label:"Sunny",glyph:"sun"};case"clear-night":return{label:"Clear night",glyph:"clear-night"};case"partlycloudy":return{label:"Partly cloudy",glyph:"partly-cloudy"};case"cloudy":return{label:"Cloudy",glyph:"cloudy"};case"rainy":return{label:"Rainy",glyph:"rain"};case"pouring":return{label:"Pouring",glyph:"rain"};case"snowy":return{label:"Snowy",glyph:"snow"};case"snowy-rainy":return{label:"Sleet",glyph:"snow"};case"lightning":return{label:"Lightning",glyph:"lightning"};case"lightning-rainy":return{label:"Thunderstorm",glyph:"lightning"};case"fog":return{label:"Fog",glyph:"fog"};case"windy":return{label:"Windy",glyph:"wind"};case"windy-variant":return{label:"Windy",glyph:"wind"};case"hail":return{label:"Hail",glyph:"hail"};case"exceptional":return{label:"Exceptional",glyph:"cloudy"};case null:return{label:"Unknown",glyph:"cloudy"};default:return{label:e,glyph:"cloudy"}}}function z4(e){switch(e){case"sunny":return{glow:"bg-warning/15",accent:"text-warning"};case"clear-night":return{glow:"bg-primary/10",accent:"text-primary"};case"partlycloudy":return{glow:"bg-warning/10",accent:"text-warning"};case"cloudy":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"rainy":case"pouring":return{glow:"bg-primary/15",accent:"text-primary"};case"snowy":case"snowy-rainy":return{glow:"bg-primary/10",accent:"text-primary"};case"lightning":case"lightning-rainy":return{glow:"bg-warning/20",accent:"text-warning"};case"fog":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"windy":case"windy-variant":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"hail":return{glow:"bg-primary/10",accent:"text-primary"};default:return{glow:"bg-transparent",accent:"text-foreground-subtle"}}}function Wle(e){const t="h-4 w-4";switch(e){case"sun":return v.jsx(w_,{className:t});case"clear-night":return v.jsx(l0,{className:t});case"partly-cloudy":return v.jsx(d_,{className:t});case"cloudy":return v.jsx(pne,{className:t});case"rain":return v.jsx(u_,{className:t});case"snow":return v.jsx(Q2,{className:t});case"lightning":return v.jsx(dne,{className:t});case"fog":return v.jsx(une,{className:t});case"wind":return v.jsx(Gi,{className:t});case"hail":return v.jsx(Q2,{className:t});default:return null}}function L4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.weather,slice:n=>n.state.weather})}function Kle(e,t){return e===null?"—":`${Math.round(e)}${t??"°"}`}function Yle({trpc:e,deviceId:t}){const{slice:n}=L4(e,t);if(n===void 0)return null;const a=D4(n.condition);return v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsx("span",{className:oe("inline-flex",z4(n.condition).accent),title:a.label,"aria-label":a.label,children:Wle(a.glyph)}),v.jsx("span",{className:"tabular-nums",children:Kle(n.temperature,n.temperatureUnit)})]})}function Xle({glyph:e,tint:t}){const n=T.useId();return v.jsxs("div",{"data-testid":"weather-scene","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:oe("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsx("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none","data-glyph":e,children:Jle(e,n)})})]})}function yo({cx:e,cy:t,scale:n=1}){return v.jsx("g",{transform:`translate(${e} ${t}) scale(${n})`,children:v.jsx("path",{d:"M-22 8 a13 13 0 0 1 4 -25 a16 16 0 0 1 30 4 a11 11 0 0 1 -2 21 Z",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5",strokeLinejoin:"round"})})}function Jle(e,t){switch(e){case"sun":return v.jsxs("g",{children:[v.jsx("circle",{cx:"50",cy:"48",r:"16",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[0,45,90,135,180,225,270,315].map(n=>{const a=n*Math.PI/180;return v.jsx("line",{x1:50+Math.cos(a)*22,y1:48+Math.sin(a)*22,x2:50+Math.cos(a)*30,y2:48+Math.sin(a)*30},`${t}-ray-${n}`)})})]});case"clear-night":return v.jsxs("g",{children:[v.jsx("path",{d:"M62 30 a22 22 0 1 0 8 38 a18 18 0 0 1 -8 -38 Z",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("circle",{cx:"34",cy:"32",r:"1.6",fill:"currentColor"}),v.jsx("circle",{cx:"28",cy:"48",r:"1.2",fill:"currentColor"}),v.jsx("circle",{cx:"40",cy:"62",r:"1.4",fill:"currentColor"})]});case"partly-cloudy":return v.jsxs("g",{children:[v.jsx("circle",{cx:"38",cy:"38",r:"12",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[200,240,300].map(n=>{const a=n*Math.PI/180;return v.jsx("line",{x1:38+Math.cos(a)*16,y1:38+Math.sin(a)*16,x2:38+Math.cos(a)*22,y2:38+Math.sin(a)*22},`${t}-pcray-${n}`)})}),v.jsx(yo,{cx:58,cy:60})]});case"cloudy":return v.jsxs("g",{children:[v.jsx(yo,{cx:40,cy:44,scale:.9}),v.jsx(yo,{cx:62,cy:58})]});case"rain":return v.jsxs("g",{children:[v.jsx(yo,{cx:50,cy:42}),v.jsxs("g",{className:"animate-pulse",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",opacity:"0.7",children:[v.jsx("line",{x1:"38",y1:"62",x2:"34",y2:"78"}),v.jsx("line",{x1:"50",y1:"62",x2:"46",y2:"80"}),v.jsx("line",{x1:"62",y1:"62",x2:"58",y2:"78"})]})]});case"snow":return v.jsxs("g",{children:[v.jsx(yo,{cx:50,cy:42}),v.jsxs("g",{fill:"currentColor",opacity:"0.8",className:"animate-pulse",children:[v.jsx("circle",{cx:"38",cy:"70",r:"2.5"}),v.jsx("circle",{cx:"50",cy:"76",r:"2.5"}),v.jsx("circle",{cx:"62",cy:"70",r:"2.5"})]})]});case"lightning":return v.jsxs("g",{children:[v.jsx(yo,{cx:50,cy:40}),v.jsx("path",{d:"M52 58 L42 74 L50 74 L46 88 L62 68 L53 68 L58 58 Z",fill:"currentColor",fillOpacity:"0.85",className:"animate-pulse"})]});case"fog":return v.jsxs("g",{stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",opacity:"0.6",children:[v.jsx("line",{x1:"26",y1:"40",x2:"74",y2:"40"}),v.jsx("line",{x1:"30",y1:"52",x2:"70",y2:"52"}),v.jsx("line",{x1:"24",y1:"64",x2:"68",y2:"64"}),v.jsx("line",{x1:"32",y1:"76",x2:"76",y2:"76"})]});case"wind":return v.jsxs("g",{stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"none",opacity:"0.75",children:[v.jsx("path",{d:"M22 42 H60 a7 7 0 1 0 -7 -7"}),v.jsx("path",{d:"M22 56 H72 a7 7 0 1 1 -7 7"}),v.jsx("path",{d:"M22 70 H52 a6 6 0 1 0 -6 -6"})]});case"hail":return v.jsxs("g",{children:[v.jsx(yo,{cx:50,cy:42}),v.jsxs("g",{fill:"currentColor",opacity:"0.85",className:"animate-pulse",children:[v.jsx("circle",{cx:"40",cy:"70",r:"3"}),v.jsx("circle",{cx:"52",cy:"78",r:"3"}),v.jsx("circle",{cx:"62",cy:"68",r:"3"})]})]});default:return null}}function ev({icon:e,label:t,value:n}){return v.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground-subtle",title:t,children:[v.jsx("span",{className:"inline-flex text-foreground-subtle","aria-hidden":"true",children:e}),v.jsx("span",{className:"tabular-nums text-foreground",children:n})]})}function ece({trpc:e,deviceId:t}){const{slice:n}=L4(e,t);if(n===void 0)return null;const a=D4(n.condition),s=z4(n.condition),p=n.temperatureUnit??"°";return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Xle,{glyph:a.glyph,tint:s}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:n.temperature!==null?Math.round(n.temperature):"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:p}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-2 capitalize",children:a.label})]}),v.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.humidity!==null&&v.jsx(ev,{icon:v.jsx(pl,{className:"h-3.5 w-3.5"}),label:"Humidity",value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&v.jsx(ev,{icon:n.windBearing!==null?v.jsx(_ne,{className:"h-3.5 w-3.5",style:{transform:`rotate(${n.windBearing}deg)`}}):v.jsx(Gi,{className:"h-3.5 w-3.5"}),label:"Wind",value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??""}`.trim()}),n.pressure!==null&&v.jsx(ev,{icon:v.jsx(yp,{className:"h-3.5 w-3.5"}),label:"Pressure",value:`${Math.round(n.pressure)} ${n.pressureUnit??""}`.trim()})]})]})]})})}function q4(e,t){return vt({trpc:e,deviceId:t,cap:n=>n.image,slice:n=>n.state.image})}var AC=1,EC=6,RC=.5;function B4({url:e,alt:t,open:n,onOpenChange:a}){const[s,p]=T.useState(1);T.useEffect(()=>{n&&p(1)},[n,e]);const f=T.useCallback(()=>p(c=>Math.min(EC,c+RC)),[]),m=T.useCallback(()=>p(c=>Math.max(AC,c-RC)),[]),h=T.useCallback(()=>p(1),[]);return v.jsx(WN,{open:n,onOpenChange:a,children:v.jsxs(x0,{width:"lg",className:"max-w-5xl p-6",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[v.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:t}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Xd,{label:"Zoom out",disabled:s<=AC,onClick:m,children:v.jsx(uae,{className:"h-4 w-4"})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle w-10 text-center",children:[Math.round(s*100),"%"]}),v.jsx(Xd,{label:"Zoom in",disabled:s>=EC,onClick:f,children:v.jsx(cae,{className:"h-4 w-4"})}),v.jsx(Xd,{label:"Reset zoom",disabled:s===1,onClick:h,children:v.jsx(Lne,{className:"h-4 w-4"})}),v.jsx(Xd,{label:"Close",onClick:()=>a(!1),children:v.jsx(lae,{className:"h-4 w-4"})})]})]}),v.jsx("div",{className:"max-h-[78vh] overflow-auto rounded border border-border bg-gradient-to-b from-surface-hover to-surface p-6",children:v.jsx("img",{src:e,alt:t,style:{width:`${s*100}%`,maxWidth:"none"},className:"mx-auto block h-auto transition-[width] duration-150"})})]})})}function Xd({label:e,disabled:t,onClick:n,children:a}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:"inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:a})}function tce({trpc:e,deviceId:t}){const{slice:n}=q4(e,t),[a,s]=T.useState(!1);if(n===void 0)return null;const p=n.url;return p===null?v.jsx("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded bg-surface-hover text-foreground-subtle",title:"No image",children:v.jsx(h_,{className:"h-4 w-4","aria-hidden":"true"})}):v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",title:"View image",onClick:f=>{f.stopPropagation(),s(!0)},className:"inline-flex items-center justify-center rounded ring-offset-1 hover:ring-2 hover:ring-primary/50 transition",children:v.jsx("img",{src:p,alt:"Image",className:"h-7 w-7 rounded object-cover"})}),v.jsx(B4,{url:p,alt:"Image",open:a,onOpenChange:s})]})}function nce({trpc:e,deviceId:t,deviceName:n}){const{slice:a}=q4(e,t),[s,p]=T.useState(!1),[f,m]=T.useState(!1),h=a?.url??null;return T.useEffect(()=>{p(!1)},[h]),a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex w-full items-center justify-center overflow-hidden rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface",children:a.url!==null&&!s?v.jsx("button",{type:"button",title:"View image",onClick:()=>m(!0),className:"flex w-full cursor-zoom-in items-center justify-center",children:v.jsx("img",{src:a.url,alt:n??"Image",onError:()=>p(!0),className:"max-h-72 w-full object-contain"})}):v.jsxs("div",{"data-testid":"image-placeholder",className:"flex h-48 w-full flex-col items-center justify-center gap-2 text-foreground-subtle",children:[v.jsx(h_,{className:"h-8 w-8","aria-hidden":"true"}),v.jsx("span",{className:"text-xs",children:"No image"})]})}),h!==null&&!s&&v.jsx(B4,{url:h,alt:n??"Image",open:f,onOpenChange:m})]})}var Jd=20,IC=9,U4="#f59e0b",F4="#ef4444";function jc(e){return Math.min(Xb,Math.max(KI,e))}var ace=`
99
- @keyframes pf-eat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(2px)} }
100
- @keyframes pf-pulse { 0%,100%{opacity:.55} 50%{opacity:1} }
101
- @media (prefers-reduced-motion: reduce) {
102
- .pf-eat, .pf-pulse { animation: none !important; }
103
- }
104
- `;function H4({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:q=>q.petFeeder,slice:q=>q.state.petFeeder}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0}),[c,x]=T.useState(Jd),[M,C]=T.useState(Jd),[E,R]=T.useState(Jd);if(s===void 0||m===void 0)return null;const _=!f,P=m.error&&m.error!=="no_error"?m.error:null,D=m.status==="offline",L=m.status==="on_batteries";if(n==="compact")return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[(P!==null||D)&&v.jsx("span",{className:"inline-flex items-center text-destructive",title:P??"Offline","aria-label":P??"Offline",children:D?v.jsx(Z2,{className:"h-3.5 w-3.5","aria-hidden":!0}):v.jsx(rl,{className:"h-3.5 w-3.5","aria-hidden":!0})}),v.jsxs("span",{className:oe("inline-flex items-center gap-1 text-xs tabular-nums font-medium",m.lowFood?"text-destructive":"text-foreground"),children:[v.jsx(G2,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.foodLevel??"—",v.jsx("span",{className:"text-foreground-subtle",children:"g"})]}),m.batteryPower!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 text-xs tabular-nums text-foreground-subtle",children:[v.jsx(Zp,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.batteryPower,"%"]}),v.jsxs("button",{type:"button","aria-label":"Feed now",disabled:_||m.feeding,onClick:q=>{q.stopPropagation(),!(_||m.feeding)&&(h({feeding:!0}),s.feed({grams:Jd}))},className:oe("inline-flex items-center gap-1 rounded-md border border-border bg-surface px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-surface-hover",(_||m.feeding)&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Ca,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feed"]})]});const B=q=>{_||m.feeding||(h({feeding:!0}),s.feed({grams:jc(q)}))};return v.jsxs("div",{className:"relative flex flex-col items-stretch gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4",children:[v.jsx("style",{children:ace}),v.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3",children:[v.jsx(ice,{grams:m.foodLevel,low:m.lowFood,eating:m.feeding}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-bold leading-none tabular-nums",style:{color:m.lowFood?F4:U4},children:m.foodLevel??"—"}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:"g in bowl"})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-subtle",children:[m.batteryPower!==null&&v.jsx(_C,{icon:v.jsx(Zp,{className:"h-3.5 w-3.5"}),label:`${m.batteryPower}%`}),m.desiccantLeftDays!==null&&v.jsx(_C,{icon:v.jsx(Gi,{className:"h-3.5 w-3.5"}),label:`${m.desiccantLeftDays}d desiccant`}),L&&v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-amber-500",children:[v.jsx(tne,{className:"h-3.5 w-3.5","aria-hidden":!0}),"On battery"]}),D?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(Z2,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Offline"]}):m.feeding?v.jsxs("span",{className:"pf-pulse inline-flex items-center gap-1 font-medium text-amber-500",style:{animation:"pf-pulse 1.2s ease-in-out infinite"},children:[v.jsx(Ca,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feeding…"]}):m.lowFood?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(ky,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Low food"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-success",children:[v.jsx(lne,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Ready"]})]})]})]}),P!==null&&v.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs font-medium text-destructive",children:[v.jsx(rl,{className:"mt-px h-4 w-4 shrink-0","aria-hidden":!0}),v.jsx("span",{className:"min-w-0 break-words",children:P})]}),m.isDualHopper?v.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[v.jsx(tv,{label:"Hopper 1",grams:M,busy:_||m.feeding,onGrams:C,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper1:jc(M)}))}}),v.jsx(tv,{label:"Hopper 2",grams:E,busy:_||m.feeding,onGrams:R,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper2:jc(E)}))}})]}):v.jsx(tv,{label:"Manual feed",grams:c,busy:_||m.feeding,onGrams:x,onFeed:()=>B(c)}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(nv,{icon:v.jsx(Ca,{className:"h-4 w-4"}),label:"Call pet",busy:_,onClick:()=>{s.callPet({})}}),v.jsx(nv,{icon:v.jsx(c0,{className:"h-4 w-4"}),label:"Reset desiccant",busy:_,onClick:()=>{s.resetDesiccant({})}}),v.jsx(nv,{icon:v.jsx(G2,{className:"h-4 w-4"}),label:"Mark refilled",busy:_,onClick:()=>{s.markFoodReplenished({})}})]}),m.feeding&&v.jsxs("button",{type:"button",disabled:_,onClick:()=>{h({feeding:!1}),s.cancelFeed({})},className:oe("flex items-center justify-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-2 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20",_&&"opacity-40 cursor-not-allowed"),children:[v.jsx(ky,{className:"h-4 w-4","aria-hidden":!0}),"Cancel feed"]}),v.jsx(TC,{label:"Settings",children:v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(av,{icon:v.jsx(pu,{className:"h-4 w-4"}),label:"Child lock",on:m.childLock,busy:_,onToggle:q=>{h({childLock:q}),s.setChildLock({on:q})}}),v.jsx(av,{icon:v.jsx(Em,{className:"h-4 w-4"}),label:"Light",on:m.indicatorLight,busy:_,onToggle:q=>{h({indicatorLight:q}),s.setIndicatorLight({on:q})}}),v.jsx(av,{icon:v.jsx(Wp,{className:"h-4 w-4"}),label:"Feed sound",on:m.feedSound,busy:_,onToggle:q=>{h({feedSound:q}),s.setFeedSound({on:q})}})]})}),v.jsx(TC,{label:"Volume",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(gu,{className:"h-4 w-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),v.jsx(am,{label:"Decrease volume",symbol:"−",disabled:_||m.volume<=0,onClick:()=>{const q=Math.max(0,m.volume-1);h({volume:q}),s.setVolume({level:q})}}),v.jsx("span",{className:"w-6 text-center text-lg font-semibold tabular-nums text-foreground",children:m.volume}),v.jsx(am,{label:"Increase volume",symbol:"+",disabled:_||m.volume>=IC,onClick:()=>{const q=Math.min(IC,m.volume+1);h({volume:q}),s.setVolume({level:q})}})]})})]})}function TC({label:e,children:t}){return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),t]})}function _C({icon:e,label:t}){return v.jsxs("span",{className:"inline-flex items-center gap-1 tabular-nums",children:[v.jsx("span",{className:"text-foreground-subtle",children:e}),t]})}function ice({grams:e,low:t,eating:n}){const a=Math.min(1,Math.max(0,(e??0)/Xb)),s=t?F4:U4,p=52-a*24;return v.jsxs("svg",{width:72,height:72,viewBox:"0 0 72 72",role:"img","aria-label":e===null?"Food level unknown":`${e} grams in bowl`,className:"shrink-0",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:"pf-bowl-clip",children:v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z"})})}),v.jsxs("g",{clipPath:"url(#pf-bowl-clip)",className:n?"pf-eat":void 0,style:n?{animation:"pf-eat 1.1s ease-in-out infinite"}:void 0,children:[v.jsx("rect",{x:"14",y:p,width:"44",height:"34",fill:s,opacity:.9}),v.jsx("ellipse",{cx:"36",cy:p,rx:"22",ry:"4",fill:s})]}),v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"text-border"}),v.jsx("rect",{x:"11",y:"22",width:"50",height:"6",rx:"3",fill:"currentColor",className:"text-border"})]})}function tv({label:e,grams:t,busy:n,onGrams:a,onFeed:s}){return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-1",children:[v.jsx(am,{label:`Decrease ${e} portion`,symbol:"−",disabled:n||t<=KI,onClick:()=>a(jc(t-1))}),v.jsxs("span",{className:"w-12 text-center text-sm font-semibold tabular-nums text-foreground",children:[t,v.jsx("span",{className:"text-xs text-foreground-subtle",children:"g"})]}),v.jsx(am,{label:`Increase ${e} portion`,symbol:"+",disabled:n||t>=Xb,onClick:()=>a(jc(t+1))})]}),v.jsxs("button",{type:"button",disabled:n,onClick:s,className:oe("flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-amber-400 px-2 py-2 text-sm font-semibold text-amber-950 transition-colors hover:bg-amber-300 active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Ca,{className:"h-4 w-4","aria-hidden":!0}),"Feed"]})]})]})}function am({label:e,symbol:t,disabled:n,onClick:a}){return v.jsx("button",{type:"button","aria-label":e,disabled:n,onClick:a,className:oe("flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-base leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:t})}function nv({icon:e,label:t,busy:n,onClick:a}){return v.jsxs("button",{type:"button",disabled:n,onClick:a,className:oe("flex flex-col items-center justify-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-2 text-[11px] font-medium text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground",n&&"opacity-40 cursor-not-allowed"),children:[e,t]})}function av({icon:e,label:t,on:n,busy:a,onToggle:s}){return v.jsxs("button",{type:"button","aria-label":t,"aria-pressed":n,disabled:a,onClick:()=>{a||s(!n)},className:oe("flex flex-col items-center justify-center gap-1 rounded-lg border px-1 py-2 text-[11px] font-medium transition-colors",n?"border-transparent bg-indigo-400 text-indigo-950 shadow-sm":"border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground",a&&"opacity-40 cursor-not-allowed"),children:[e,t]})}function rce({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})}function oce({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}var iv={cool:"Cool",heat:"Heat",auto:"Auto",heat_cool:"Heat·Cool",fan_only:"Fan",dry:"Dry",off:"Off"},sce={cool:x_,heat:Yp,auto:k_,heat_cool:Im,fan_only:Kp,dry:pl,off:fu},lce={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#a1a1aa"},cce=16,uce=30;function NC(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}function dce(e){switch(e){case"turbo":return Pr;case"quiet":return gne;case"sleep":return l0;case"eco":return wne;case"8c_heat":return x_;case"none":return ky;default:return k_}}function pce(e){switch(e){case"high":return 1;case"medium_high":return 1.3;case"medium":return 1.6;case"medium_low":return 1.9;case"low":return 2.2;default:return 1.8}}var mce=`
105
- @keyframes acv-fall { 0%{transform:translateY(-1.75rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(7.5rem);opacity:0} }
106
- @keyframes acv-rise { 0%{transform:translateY(7.5rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(-1.75rem);opacity:0} }
107
- @keyframes acv-sway { 0%,100%{transform:translateX(-9%)} 50%{transform:translateX(9%)} }
108
- @keyframes acv-swing-h { 0%,100%{transform:translateX(-22%)} 50%{transform:translateX(22%)} }
109
- @keyframes acv-swing-v { 0%,100%{transform:translateY(-22%)} 50%{transform:translateY(22%)} }
110
- @keyframes acv-spin { to { transform:rotate(360deg) } }
111
- @keyframes acv-glow { 0%,100%{opacity:.35;transform:scale(1)} 50%{opacity:.6;transform:scale(1.06)} }
112
- @media (prefers-reduced-motion: reduce) {
113
- .acv-streak, .acv-fan, .acv-sway-wrap, .acv-glow, .acv-swing { animation: none !important; }
114
- }
115
- `;function $4({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:L=>L.climateControl,slice:L=>L.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f;if(n==="compact")return v.jsxs("div",{"data-mode":m.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:oe("text-xs tabular-nums font-medium",h4[m.mode]),children:m.target!==null?v.jsxs(v.Fragment,{children:[m.target,"°",m.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",m.currentTemp,"°)"]})]}):m.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[m.currentTemp,"°"]}):null}),m.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:c,onClick:L=>{if(L.stopPropagation(),!c&&m.target!==null){const B=m.target-1;h({target:B}),s.setTarget({target:B})}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",c&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:c,onClick:L=>{if(L.stopPropagation(),!c&&m.target!==null){const B=m.target+1;h({target:B}),s.setTarget({target:B})}},className:oe("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",c&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:c,onChange:L=>{L.stopPropagation();const B=m.availableModes.find(q=>q===L.target.value);!c&&B&&(h({mode:B}),s.setMode({mode:B}))},className:oe("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(L=>v.jsx("option",{value:L,children:iv[L]},L))})]});const x=lce[m.mode],M=m.mode!=="off",C=dce(m.preset),E=m.preset==="turbo",R=Math.max(.55,pce(m.fanMode)*(E?.6:1)),_=m.swingVertical!==null,P=m.swingHorizontal!==null,D=M&&(m.swingVertical===!0||m.swingHorizontal===!0);return v.jsxs("div",{"data-mode":m.mode,className:oe("relative flex flex-col items-stretch gap-2.5 overflow-hidden rounded-lg border p-3 transition-colors",M0[m.mode]),children:[v.jsx("style",{children:mce}),v.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center gap-1 overflow-hidden rounded-lg border border-border/50 bg-surface/30 px-3 py-3",children:[v.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-60",children:v.jsx(gce,{mode:m.mode,accent:x,periodSec:R,swaying:D})}),v.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-surface/50 via-transparent to-surface/50"}),M&&v.jsx("span",{"aria-hidden":!0,className:"acv-glow pointer-events-none absolute left-1/2 top-1/2 h-16 w-16 -translate-x-1/2 -translate-y-1/2 rounded-full blur-2xl",style:{background:x,animation:"acv-glow 3.2s ease-in-out infinite"}}),v.jsxs("div",{className:"relative z-10 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide",style:{color:x},children:[v.jsx(OC,{mode:m.mode,className:"h-3.5 w-3.5"}),iv[m.mode],m.currentTemp!==null&&v.jsxs("span",{className:"normal-case text-foreground-subtle",children:["· ",m.currentTemp,"° now"]}),m.currentHumidity!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 normal-case text-foreground-subtle",children:[v.jsx(pl,{className:"h-3 w-3"}),m.currentHumidity,"%"]})]}),m.target!==null?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative z-10 flex items-center gap-3",children:[v.jsx(PC,{label:"Decrease target",symbol:"−",disabled:c,onClick:()=>{if(c||m.target===null)return;const L=m.target-1;h({target:L}),s.setTarget({target:L})}}),v.jsxs("div",{className:"flex items-baseline gap-0.5",children:[v.jsx("span",{className:"text-4xl font-bold leading-none tabular-nums",style:{color:x},children:m.target}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]}),v.jsx(PC,{label:"Increase target",symbol:"+",disabled:c,onClick:()=>{if(c||m.target===null)return;const L=m.target+1;h({target:L}),s.setTarget({target:L})}})]}),v.jsx("div",{className:"relative z-10 w-36",children:v.jsx(hce,{value:m.target,min:cce,max:uce,accent:x})})]}):v.jsxs("div",{className:"relative z-10 flex items-baseline gap-0.5",children:[v.jsx("span",{className:"text-4xl font-bold leading-none tabular-nums text-foreground",children:m.currentTemp??"—"}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]})]}),v.jsxs("div",{className:"relative z-10 grid grid-cols-3 gap-2",children:[v.jsx(rv,{label:"Mode",icon:v.jsx("span",{style:{color:x},className:"flex",children:v.jsx(OC,{mode:m.mode,className:"h-4 w-4"})}),value:m.mode,options:m.availableModes.map(L=>({value:L,label:iv[L]})),disabled:c,onChange:L=>{const B=m.availableModes.find(q=>q===L);B&&(h({mode:B}),s.setMode({mode:B}))}}),m.availableFanModes.length>0&&v.jsx(rv,{label:"Fan",icon:v.jsx(Gi,{className:"h-4 w-4 text-sky-500"}),value:m.fanMode,options:m.availableFanModes.map(L=>({value:L,label:NC(L)})),disabled:c,onChange:L=>{h({fanMode:L}),s.setFanMode({fanMode:L})}}),m.availablePresets.length>0&&v.jsx(rv,{label:"Preset",icon:v.jsx(C,{className:"h-4 w-4 text-emerald-500"}),value:m.preset,options:m.availablePresets.map(L=>({value:L,label:NC(L)})),disabled:c,onChange:L=>{h({preset:L}),s.setPreset({preset:L})}})]}),(_||P)&&v.jsx(fce,{label:"Swing",children:v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[_&&v.jsx(jC,{axis:"vertical",on:m.swingVertical??!1,busy:c,onToggle:L=>{h({swingVertical:L}),s.setSwingVertical({on:L})}}),P&&v.jsx(jC,{axis:"horizontal",on:m.swingHorizontal??!1,busy:c,onToggle:L=>{h({swingHorizontal:L}),s.setSwingHorizontal({on:L})}})]})})]})}function fce({label:e,children:t}){return v.jsxs("div",{className:"relative z-10 flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),t]})}function OC({mode:e,className:t}){const n=sce[e];return v.jsx(n,{className:t,"aria-hidden":!0})}function rv({label:e,icon:t,value:n,options:a,disabled:s,onChange:p}){return v.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),v.jsxs("div",{className:oe("flex items-center gap-1 overflow-hidden rounded-lg border border-border/60 bg-surface-subtle px-1.5 py-1.5",s&&"opacity-40"),children:[v.jsx("span",{className:"flex shrink-0",children:t}),v.jsx("select",{"aria-label":e,value:n,disabled:s,onChange:f=>{f.stopPropagation(),s||p(f.target.value)},className:"min-w-0 flex-1 cursor-pointer appearance-none truncate bg-transparent text-xs font-medium text-foreground outline-none",children:a.map(f=>v.jsx("option",{value:f.value,children:f.label},f.value))}),v.jsx(zo,{className:"h-3 w-3 shrink-0 text-foreground-subtle"})]})]})}function PC({label:e,symbol:t,disabled:n,onClick:a}){return v.jsx("button",{type:"button","aria-label":e,disabled:n,onClick:a,className:oe("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-lg leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:t})}function hce({value:e,min:t,max:n,accent:a}){const s=`${Math.min(1,Math.max(0,(e-t)/(n-t)))*100}%`;return v.jsxs("div",{className:"mt-2 w-full",children:[v.jsxs("div",{className:"relative h-1.5 w-full rounded-full bg-surface-subtle",children:[v.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:s,background:a}}),v.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-surface shadow",style:{left:s,background:a}})]}),v.jsxs("div",{className:"mt-0.5 flex justify-between text-[9px] tabular-nums text-foreground-subtle",children:[v.jsxs("span",{children:[t,"°"]}),v.jsxs("span",{children:[n,"°"]})]})]})}function gce({mode:e,accent:t,periodSec:n,swaying:a}){const s=[0,1,2,3,4,5],p=e==="heat",f=e==="dry";return v.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:e==="off"?v.jsx("div",{className:"flex h-full items-center justify-center gap-2 opacity-30",children:s.map(m=>v.jsx("span",{className:"h-8 w-1 rounded-full bg-foreground-subtle opacity-40"},m))}):e==="fan_only"?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx(vce,{color:t,periodSec:Math.max(.5,n*.7),size:56})}):v.jsx("div",{className:oe("acv-sway-wrap absolute inset-0",a&&"acv-sway"),style:a?{animation:"acv-sway 2.6s ease-in-out infinite"}:void 0,children:s.map(m=>v.jsx("span",{className:"acv-streak absolute rounded-full",style:{left:`${8+m*15}%`,width:f?"0.4rem":"0.3rem",height:f?"0.4rem":"1.9rem",background:t,boxShadow:`0 0 6px ${t}`,animationName:p?"acv-rise":"acv-fall",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${n}s`,animationDelay:`${m%3*(n/3)+m*.05}s`}},m))})})}function vce({color:e,periodSec:t,size:n}){return v.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"acv-fan",style:{animation:`acv-spin ${t}s linear infinite`,transformOrigin:"50% 50%"},"aria-hidden":!0,children:[[0,120,240].map(a=>v.jsx("path",{d:"M50 50 C 58 30, 78 26, 84 12 C 66 20, 54 34, 50 50 Z",fill:e,opacity:.85,transform:`rotate(${a} 50 50)`},a)),v.jsx("circle",{cx:"50",cy:"50",r:"7",fill:e})]})}function jC({axis:e,on:t,busy:n,onToggle:a}){const s=e==="vertical"?"Vertical":"Horizontal",p=e==="vertical"?Tne:Ine,f=e==="vertical"?"acv-swing-v":"acv-swing-h";return v.jsxs("button",{type:"button","aria-label":`${s} swing`,"aria-pressed":t,disabled:n,onClick:()=>{n||a(!t)},className:oe("flex items-center justify-center gap-2 rounded-lg border px-2 py-1.5 text-xs font-medium transition-colors",t?"border-transparent bg-indigo-400 text-indigo-950 shadow-sm":"border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground",n&&"opacity-40 cursor-not-allowed"),children:[v.jsx(p,{className:"acv-swing h-4 w-4","aria-hidden":!0,style:t?{animation:`${f} 1.4s ease-in-out infinite`}:void 0}),s]})}var yce=5,bce=35;function ov(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function sv(e,t,n){return Math.round(t+e*(n-t))}var Fi=176,im=76,Tp=2*Math.PI*im,yc=Tp*(270/360),lv=Fi/2-im-10;function DC(e){const t=Fi/2,n=Fi/2,a=Tp-yc,s=e.mode==="band"?(()=>{const p=e.band.from*yc,f=Math.max(0,(e.band.to-e.band.from)*yc);return{dasharray:`${f} ${Tp-f}`,dashoffset:-p}})():(()=>{const p=e.fraction*yc;return{dasharray:`${p} ${Tp-p}`,dashoffset:void 0}})();return v.jsxs("svg",{width:Fi,height:Fi,viewBox:`0 0 ${Fi} ${Fi}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:t,cy:n,r:im,fill:"none",stroke:"var(--color-border)",strokeWidth:12,strokeDasharray:`${yc} ${a}`,strokeLinecap:"round"}),v.jsx("circle",{cx:t,cy:n,r:im,fill:"none",stroke:e.color,strokeWidth:12,strokeDasharray:s.dasharray,...s.dashoffset!==void 0?{strokeDashoffset:s.dashoffset}:{},strokeLinecap:"round"})]})}var Sce={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#d4d4d8"};function xce({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:D=>D.climateControl,slice:D=>D.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=Sce[m.mode],M=m.mode==="heat_cool"||m.targetLow!==null&&m.targetHigh!==null,C=yce,E=bce,R=!M&&m.target!==null?ov(m.target,C,E):0,_=M&&m.targetLow!==null?ov(m.targetLow,C,E):0,P=M&&m.targetHigh!==null?ov(m.targetHigh,C,E):0;return v.jsxs("div",{"data-mode":m.mode,className:oe("flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4 transition-colors",M0[m.mode]),children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs("div",{className:"relative",style:{width:Fi,height:Fi},children:[M?v.jsx(DC,{mode:"band",band:{from:_,to:P},color:x}):v.jsx(DC,{mode:"fill",fraction:R,color:x}),M?v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Rp,{fraction:_,color:x,knobTopPx:lv,onDragFraction:D=>{if(c||m.targetHigh===null)return;const L=Math.min(sv(D,C,E),m.targetHigh);h({targetLow:L}),s.setTargetRange({targetLow:L,targetHigh:m.targetHigh})}})}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Rp,{fraction:P,color:x,knobTopPx:lv,onDragFraction:D=>{if(c||m.targetLow===null)return;const L=Math.max(sv(D,C,E),m.targetLow);h({targetHigh:L}),s.setTargetRange({targetLow:m.targetLow,targetHigh:L})}})})]}):v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Rp,{fraction:R,color:x,knobTopPx:lv,onDragFraction:D=>{if(c)return;const L=sv(D,C,E);h({target:L}),s.setTarget({target:L})}})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none",children:[v.jsxs("div",{"data-testid":"current-temp",className:"text-4xl font-bold tabular-nums text-foreground leading-none",children:[m.currentTemp!==null?m.currentTemp:"—",v.jsx("span",{className:"text-lg text-foreground-subtle font-normal ml-0.5",children:"°"})]}),!M&&m.target!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:["set ",m.target,"°"]}),M&&m.targetLow!==null&&m.targetHigh!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:[m.targetLow,"° – ",m.targetHigh,"°"]})]})]}),!M&&m.target!==null&&v.jsx("div",{className:"w-[200px]",children:v.jsx(m4,{value:`${m.target}°`,onDelta:D=>{if(c||m.target===null)return;const L=m.target+D;h({target:L}),s.setTarget({target:L})}})})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:c,onChange:D=>{D.stopPropagation();const L=D.target.value;!c&&L&&(h({mode:m.availableModes.find(B=>B===L)??m.mode}),s.setMode({mode:m.availableModes.find(B=>B===L)??m.mode}))},className:oe("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function kce(e){return e==="locked"||e==="locking"}function Q4(e){return e==="jammed"}var wce={locked:{colorClass:"border-success/30 bg-success/10 text-success",icon:"locked"},locking:{colorClass:"border-success/30 bg-success/10 text-success",icon:"locked"},unlocked:{colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"open"},unlocking:{colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"open"},jammed:{colorClass:"border-danger/30 bg-danger/10 text-danger",icon:"locked"}};function Mce({state:e}){const t=wce[e];return v.jsx("div",{"data-testid":"lock-glyph","data-state":e,className:oe("flex h-16 w-16 items-center justify-center rounded-full border-2",t.colorClass),children:t.icon==="locked"?v.jsx(pu,{className:"h-8 w-8","aria-hidden":"true"}):v.jsx(wy,{className:"h-8 w-8","aria-hidden":"true"})})}function Cce({state:e}){return v.jsx("span",{className:oe("text-sm font-medium capitalize",Q4(e)?"text-danger":"text-foreground-muted"),children:e})}function Ace({busy:e,onOpen:t}){return v.jsxs("button",{type:"button","aria-label":"Open (unlatch)",title:"Open (unlatch)",disabled:e,onClick:n=>{n.stopPropagation(),t()},className:oe("inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium","text-foreground-muted hover:bg-surface-hover transition-colors",e&&"opacity-40 cursor-not-allowed"),children:[v.jsx(il,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Open"]})}function Ece({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:_=>_.lockControl,slice:_=>_.state.lockControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=kce(m.state),x=Q4(m.state)||!f,M=n?.includes(da.LockOpen)===!0,C=()=>{x||(c?(h({state:"unlocking"}),s.unlock({})):(h({state:"locking"}),s.lock({})))},E=()=>{x||s.open({})},R=c?"Unlock":"Lock";return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx(Mce,{state:m.state}),v.jsx(Cce,{state:m.state})]}),v.jsx("div",{className:oe(x&&"pointer-events-none opacity-40"),children:v.jsx(pse,{on:c,targetLabel:R,onConfirm:C})}),M&&v.jsx("div",{className:"flex justify-center",children:v.jsx(Ace,{busy:x,onOpen:E})})]})}var $y=500,V4=150,Rce="linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)";function Ice(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function Tce(e){return Ice(e,V4,$y)}var _ce="#f4b740",Nce="#d4d4d8";function Oce({trpc:e,deviceId:t,features:n,optimistic:a}){const s=vt({trpc:e,deviceId:t,cap:q=>q.switch,slice:q=>q.state.switch}),p=vt({trpc:e,deviceId:t,cap:q=>q.brightness,slice:q=>q.state.brightness}),f=vt({trpc:e,deviceId:t,cap:q=>q.color,slice:q=>q.state.color}),m=zt(s.slice,{enabled:a??!0}),h=zt(p.slice,{enabled:a??!0}),c=zt(f.slice,{enabled:a??!0});if(s.cap===void 0||m.display===void 0)return null;const x=m.display.on===!0,M=!s.available,C=h.display?.percentage??0,E=!p.available,R=x?C/100:0,_=x?_ce:Nce,P=(n?.includes(da.LightColorMired)??!1)&&f.cap!==void 0,D=c.display?.mireds,L=!f.available,B=()=>{if(M)return;const q=!x;m.applyOptimistic({on:q}),s.cap?.setState({on:q})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs(f4,{fraction:R,color:_,children:[v.jsxs("div",{"data-testid":"brightness-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[C,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(Em,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}),p.cap!==void 0&&v.jsxs("label",{className:"flex w-full items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16",children:"Brightness"}),v.jsx("input",{"aria-label":"Brightness",type:"range",min:0,max:100,step:1,className:"flex-1",value:C,disabled:E||!x,onChange:q=>{const G=Number(q.target.value);h.applyOptimistic({percentage:G}),E||p.cap?.setBrightness({percentage:G})}}),v.jsxs("span",{className:"tabular-nums w-9 text-right",children:[C,"%"]})]})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:x?"On":"Off"}),v.jsx(k0,{on:x,busy:M,onToggle:B})]}),P&&v.jsxs("div",{className:"flex items-center gap-2","data-testid":"color-temp-strip",children:[v.jsx(Im,{className:"h-4 w-4 text-foreground-subtle","aria-hidden":"true"}),v.jsxs("label",{className:"flex-1",children:[v.jsx("span",{className:"sr-only",children:"Colour temperature"}),v.jsx("input",{"aria-label":"Colour temperature",type:"range",min:V4,max:$y,step:1,className:"w-full",value:D??$y,disabled:L||!x,onChange:q=>{const G=Number(q.target.value);c.applyOptimistic({mode:"mired",mireds:G}),L||f.cap?.setColor({color:{mode:"mired",mireds:G}})}}),v.jsx("div",{className:"pointer-events-none mt-1",children:v.jsx(Fy,{fraction:D!==void 0?Tce(D):.5,color:Rce})})]})]})]})}var Pce="#3aa6a0",jce="#d4d4d8";function Dce({trpc:e,deviceId:t,features:n,optimistic:a}){const s=vt({trpc:e,deviceId:t,cap:U=>U.switch,slice:U=>U.state.switch}),p=vt({trpc:e,deviceId:t,cap:U=>U.fanControl,slice:U=>U.state.fanControl}),f=zt(s.slice,{enabled:a??!0}),m=zt(p.slice,{enabled:a??!0});if(s.cap===void 0||f.display===void 0)return null;const h=f.display.on===!0,c=!s.available,x=m.display?.percentage??0,M=!p.available,C=h?x/100:0,E=h?Pce:jce,R=n?.includes(da.FanSpeed)??!1,_=(n?.includes(da.FanOscillating)??!1)&&p.cap!==void 0,P=m.display?.availablePresets??[],D=(n?.includes(da.FanPreset)??!1)&&p.cap!==void 0&&P.length>0,L=m.display?.preset??"",B=m.display?.oscillating===!0,q=()=>{if(c)return;const U=!h;f.applyOptimistic({on:U}),s.cap?.setState({on:U})},G=()=>{if(M)return;const U=!B;m.applyOptimistic({oscillating:U}),p.cap?.setOscillating({oscillating:U})},ne=U=>{if(M)return;const me=m.display;if(me===void 0)return;const Me=me.percentageStep!==void 0&&me.percentageStep>0?me.percentageStep:1,Ce=Math.min(100,Math.max(0,Math.round(U*100/Me)*Me));m.applyOptimistic({percentage:Ce}),p.cap?.setPercentage({percentage:Ce})},V=U=>{M||U===""||(m.applyOptimistic({preset:U}),p.cap?.setPreset({preset:U}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex flex-col items-center gap-3",children:R?v.jsxs(f4,{fraction:C,color:E,onDragFraction:ne,children:[v.jsxs("div",{"data-testid":"speed-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[x,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(Kp,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}):v.jsx("div",{"data-testid":"fan-onoff-icon",className:"flex h-[150px] w-[150px] items-center justify-center",children:v.jsx(Kp,{className:"h-16 w-16",style:{color:E},"aria-hidden":"true"})})}),D&&v.jsx("div",{className:"flex justify-center",children:v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Fan preset",value:L,disabled:M,onChange:U=>{U.stopPropagation(),V(U.target.value)},className:oe("bg-surface border border-border rounded px-1 py-0.5",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),P.map(U=>v.jsx("option",{value:U,children:U},U))]})]})}),v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_?v.jsxs("button",{type:"button","aria-label":"Oscillate","aria-pressed":B,disabled:M,onClick:U=>{U.stopPropagation(),G()},className:oe("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors",B?"border-success/50 bg-success/10 text-success":"border-border text-foreground-muted hover:bg-surface-hover",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx(c0,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Oscillate"]}):v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:h?"On":"Off"}),v.jsx(k0,{on:h,busy:c,onToggle:q})]})]})}function zce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:M=>M.switch,slice:M=>M.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=f.on===!0,c=!p,x=()=>{if(c)return;const M=!h;m({on:M}),a.setState({on:M})};return v.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx("div",{"data-testid":"switch-glyph","data-state":h?"on":"off",className:oe("flex h-16 w-16 items-center justify-center rounded-full border-2 transition-colors",h?"border-success/30 bg-success/10 text-success":"border-border bg-surface-subtle text-foreground-subtle"),children:v.jsx(fu,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:h?"On":"Off"}),v.jsx(k0,{on:h,busy:c,onToggle:x})]})}function Lce(e){return e==="playing"||e==="buffering"?"pause":"play"}function qce(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function zC(e){if(e===null)return"--:--";const t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function Bce({title:e,subtitle:t}){return v.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v.jsx(b_,{className:"h-6 w-6 text-foreground-subtle","aria-hidden":"true"}),v.jsx("span",{className:"text-base font-semibold text-foreground line-clamp-1",children:e??"Nothing playing"}),t&&v.jsx("span",{className:"text-xs text-foreground-subtle line-clamp-1",children:t})]})}function cv({label:e,busy:t,onPress:n,children:a,primary:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),t||n()},className:oe("inline-flex items-center justify-center rounded-full transition-colors",s?"h-12 w-12 bg-primary text-primary-foreground hover:bg-primary/90 shadow-md":"h-10 w-10 text-foreground-muted hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:a})}function Uce({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=vt({trpc:e,deviceId:t,cap:B=>B.mediaPlayer,slice:B=>B.state.mediaPlayer}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=Lce(m.state),M=(n?.includes(da.MediaPlayerSeek)??!1)&&m.durationMs!==null&&m.durationMs>0,C=n?.includes(da.MediaPlayerNext)??!1,E=n?.includes(da.MediaPlayerPrevious)??!1,R=(n?.includes(da.MediaPlayerVolume)??!1)&&m.volumeLevel!==null,_=()=>{c||(x==="play"?(h({state:"playing"}),s.play({})):(h({state:"paused"}),s.pause({})))},P=m.currentMedia?.artist??m.currentMedia?.album??null,D=qce(m.positionMs,m.durationMs),L=m.volumeLevel??0;return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx(Bce,{title:m.currentMedia?.title??null,subtitle:P}),M&&v.jsxs("div",{"data-testid":"media-seek",className:"flex flex-col gap-1",children:[v.jsxs("label",{className:"relative block",children:[v.jsx("span",{className:"sr-only",children:"Seek"}),v.jsx("input",{"aria-label":"Seek",type:"range",min:0,max:m.durationMs??0,step:1e3,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:m.positionMs??0,disabled:c,onChange:B=>{if(c)return;const q=Number(B.target.value);h({positionMs:q}),s.seek({positionMs:q})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Fy,{fraction:D})})]}),v.jsxs("div",{className:"flex justify-between text-[11px] tabular-nums text-foreground-subtle",children:[v.jsx("span",{children:zC(m.positionMs)}),v.jsx("span",{children:zC(m.durationMs)})]})]}),v.jsxs("div",{className:"flex items-center justify-center gap-4",children:[E&&v.jsx(cv,{label:"Previous",busy:c,onPress:()=>{s.previous({})},children:v.jsx($ne,{className:"h-5 w-5","aria-hidden":"true"})}),v.jsx(cv,{label:x==="play"?"Play":"Pause",busy:c,onPress:_,primary:!0,children:x==="play"?v.jsx(Lo,{className:"h-6 w-6","aria-hidden":"true"}):v.jsx(mu,{className:"h-6 w-6","aria-hidden":"true"})}),C&&v.jsx(cv,{label:"Next",busy:c,onPress:()=>{s.next({})},children:v.jsx(Qne,{className:"h-5 w-5","aria-hidden":"true"})})]}),R&&v.jsxs("div",{"data-testid":"media-volume",className:"flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":m.isMuted===!0?"Unmute":"Mute",title:m.isMuted===!0?"Unmute":"Mute",disabled:c,onClick:B=>{if(B.stopPropagation(),c||m.isMuted===null)return;const q=!m.isMuted;h({isMuted:q}),s.setMute({muted:q})},className:oe("inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",c&&"opacity-40 cursor-not-allowed"),children:m.isMuted===!0?v.jsx(A_,{className:"h-4 w-4","aria-hidden":"true"}):v.jsx(gu,{className:"h-4 w-4","aria-hidden":"true"})}),v.jsxs("label",{className:"relative block flex-1",children:[v.jsx("span",{className:"sr-only",children:"Volume"}),v.jsx("input",{"aria-label":"Volume",type:"range",min:0,max:100,step:1,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:L,disabled:c,onChange:B=>{if(c)return;const q=Number(B.target.value);h({volumeLevel:q}),s.setVolume({volumeLevel:q})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Fy,{fraction:L/100})})]}),v.jsxs("span",{className:"w-9 text-right text-[11px] tabular-nums text-foreground-subtle",children:[L,"%"]})]})]})}var G4={disarmed:{label:"Disarmed",colorClass:"border-border bg-surface-subtle text-foreground-subtle",icon:"disarmed"},armed_home:{label:"Armed Home",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_away:{label:"Armed Away",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_night:{label:"Armed Night",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_vacation:{label:"Armed Vacation",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_custom_bypass:{label:"Armed (Bypass)",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},arming:{label:"Arming…",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},disarming:{label:"Disarming…",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},pending:{label:"Pending",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},triggered:{label:"Triggered",colorClass:"border-danger/30 bg-danger/10 text-danger",icon:"triggered"}},Z4={home:"Home",away:"Away",night:"Night",vacation:"Vacation",custom_bypass:"Bypass"};function W4(e){return e.startsWith("armed_")}function A0(e){return e==="arming"||e==="disarming"}function K4({icon:e,sizeClass:t="h-8 w-8"}){return e==="disarmed"?v.jsx(Fne,{className:t,"aria-hidden":"true"}):e==="triggered"?v.jsx(Rm,{className:t,"aria-hidden":"true"}):e==="pending"?v.jsx(Hne,{className:t,"aria-hidden":"true"}):v.jsx(Une,{className:t,"aria-hidden":"true"})}function LC({label:e,active:t,busy:n,onSelect:a}){return v.jsx("button",{type:"button","aria-label":e,"aria-pressed":t,disabled:n,onClick:s=>{s.stopPropagation(),n||a()},className:oe("flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors",t?"bg-primary text-primary-foreground shadow-sm":"text-foreground-muted hover:bg-surface-hover",n&&"opacity-40 cursor-not-allowed"),children:e})}function Fce({state:e,availableModes:t,busy:n,onDisarm:a,onArm:s}){const p=W4(e),f=A0(e);return v.jsxs("div",{className:oe("flex min-w-0 items-stretch gap-1 rounded-lg border border-border bg-surface-subtle p-1"),children:[v.jsx(LC,{label:"Disarm",active:!p&&!f,busy:n,onSelect:a}),t.map(m=>v.jsx(LC,{label:Z4[m],active:!f&&e===`armed_${m}`,busy:n,onSelect:()=>s(m)},m))]})}function Y4(e,t,n){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:M=>M.alarmPanel,slice:M=>M.state.alarmPanel}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,handleDisarm:()=>{a===void 0||h||(m({state:"disarming"}),a.disarm({}))},handleArm:M=>{a===void 0||h||(m({state:"arming"}),a.arm({mode:M}))}}}function Hce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=Y4(e,t,n);if(!s||a===void 0)return null;const h=G4[a.state],c=W4(a.state)?a.state.replace("armed_",""):"";return v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsxs("span",{className:oe("inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium whitespace-nowrap",h.colorClass,A0(a.state)&&"animate-pulse"),children:[v.jsx(K4,{icon:h.icon,sizeClass:"h-3 w-3"}),h.label]}),v.jsxs("select",{"aria-label":"Alarm mode",disabled:p,value:c,onClick:x=>x.stopPropagation(),onChange:x=>{x.stopPropagation();const M=x.target.value;M===""?f():m(M)},className:oe("min-w-0 shrink rounded-md border border-border bg-surface-subtle px-1.5 py-0.5 text-xs text-foreground-muted",p&&"cursor-not-allowed opacity-40"),children:[v.jsx("option",{value:"",children:"Disarm"}),a.availableModes.map(x=>v.jsx("option",{value:x,children:Z4[x]},x))]})]})}function $ce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=Y4(e,t,n);if(!s||a===void 0)return null;const h=G4[a.state];return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"alarm-state","data-state":a.state,className:oe("flex h-16 w-16 items-center justify-center rounded-full border-2",h.colorClass,A0(a.state)&&"animate-pulse"),children:v.jsx(K4,{icon:h.icon})}),v.jsx("span",{className:oe("text-sm font-medium",h.colorClass,"border-0 bg-transparent"),children:h.label})]}),v.jsx(Fce,{state:a.state,availableModes:a.availableModes,busy:p,onDisarm:f,onArm:m})]})}function Qce(e,t){if(e<=0)return null;const n=Math.max(0,Math.round((t-e)/1e3));return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:new Date(e).toLocaleDateString()}function E0({atMs:e,neverLabel:t}){const n=Qce(e,Date.now());return v.jsx("span",{className:"text-xs text-foreground-subtle","data-testid":"last-run",children:n===null?t:n})}function X4({error:e}){return e===null||e===""?null:v.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-danger",title:e,"data-testid":"last-error",children:[v.jsx(rl,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),v.jsx("span",{className:"truncate",children:e})]})}function J4(e,t,n){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:x=>x.scriptRunner,slice:x=>x.state.scriptRunner}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p,c=f?.isRunning===!0;return{display:f,capPresent:a!==void 0,busy:h,running:c,run:()=>{a===void 0||h||c||(m({isRunning:!0}),a.run({}))},stop:()=>{a===void 0||h||!c||(m({isRunning:!1}),a.stop({}))}}}function eO({running:e,busy:t,large:n,onRun:a,onStop:s}){const p=e?"Stop":"Run";return v.jsxs("button",{type:"button","aria-label":p,title:p,disabled:t,"data-testid":"script-run","data-running":e?"true":"false",onClick:f=>{f.stopPropagation(),e?s():a()},className:oe("inline-flex items-center gap-1 rounded transition-colors",n?"h-10 px-4 text-sm":"h-5 px-1.5 text-xs",e?"bg-danger text-danger-foreground hover:bg-danger/90":"bg-primary text-primary-foreground hover:bg-primary/90",t&&"cursor-not-allowed opacity-40"),children:[e?v.jsx(cne,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}):v.jsx(Lo,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:p})]})}function Vce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=J4(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(eO,{running:f,busy:p,large:!1,onRun:m,onStop:h}),v.jsx(E0,{atMs:a.lastRunAt,neverLabel:"never run"})]})}function Gce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=J4(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"script-state","data-running":f?"true":"false",className:oe("flex h-16 w-16 items-center justify-center rounded-full border-2",f?"border-primary text-primary animate-pulse":"border-border text-foreground-subtle"),children:v.jsx(Lo,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:f?"Running":"Idle"}),v.jsx(E0,{atMs:a.lastRunAt,neverLabel:"never run"}),v.jsx(X4,{error:a.lastError})]}),v.jsx("div",{className:"flex justify-center",children:v.jsx(eO,{running:f,busy:p,large:!0,onRun:m,onStop:h})})]})}function tO(e,t,n){const{cap:a,slice:s,available:p}=vt({trpc:e,deviceId:t,cap:c=>c.automationControl,slice:c=>c.state.automationControl}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,setEnabled:c=>{a===void 0||h||(m({enabled:c}),c?a.enable({}):a.disable({}))},trigger:()=>{a===void 0||h||a.trigger({})}}}function nO({enabled:e,busy:t,onToggle:n}){return v.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":"Automation enabled",disabled:t,"data-testid":"automation-enabled",onClick:a=>{a.stopPropagation(),n(!e)},className:oe("inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5","text-[11px] font-medium whitespace-nowrap transition-colors",e?"border-success/40 bg-success/10 text-success":"border-border bg-surface-subtle text-foreground-subtle",t&&"cursor-not-allowed opacity-40"),children:e?"Enabled":"Disabled"})}function aO({busy:e,large:t,onTrigger:n}){return v.jsxs("button",{type:"button","aria-label":"Trigger",title:"Run this automation now",disabled:e,"data-testid":"automation-trigger",onClick:a=>{a.stopPropagation(),n()},className:oe("inline-flex items-center gap-1 rounded transition-colors",t?"h-10 px-4 text-sm":"h-5 px-1.5 text-xs","bg-primary text-primary-foreground hover:bg-primary/90",e&&"cursor-not-allowed opacity-40"),children:[v.jsx(Pr,{className:t?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:"Trigger"})]})}function Zce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=tO(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(nO,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(aO,{busy:p,large:!1,onTrigger:m})]})}function Wce({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=tO(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"automation-state","data-enabled":a.enabled?"true":"false",className:oe("flex h-16 w-16 items-center justify-center rounded-full border-2",a.enabled?"border-success text-success":"border-border text-foreground-subtle"),children:v.jsx(Pr,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:a.enabled?"Enabled":"Disabled"}),v.jsx(E0,{atMs:a.lastTriggeredAt,neverLabel:"never triggered"}),v.jsx(X4,{error:a.lastError})]}),v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx(nO,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(aO,{busy:p,large:!0,onTrigger:m})]})]})}function Kce({children:e}){return v.jsx("div",{className:"flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4",children:e})}function iO(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.switch,slice:a=>a.state.switch});return n!==void 0}function Yce({trpc:e,deviceId:t,features:n,optimistic:a}){return iO(e,t)?v.jsx(w0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function Xce(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.lockControl,slice:a=>a.state.lockControl});return n!==void 0}function Jce({trpc:e,deviceId:t,features:n,optimistic:a}){return Xce(e,t)?v.jsx(xse,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function eue({trpc:e,deviceId:t,features:n,optimistic:a}){return iO(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(w0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(kse,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function tue(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.fanControl,slice:a=>a.state.fanControl});return n!==void 0}function nue({trpc:e,deviceId:t,features:n,optimistic:a}){return tue(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(w0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(wse,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function R0(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.climateControl,slice:a=>a.state.climateControl});return n!==void 0}function aue({trpc:e,deviceId:t,features:n,optimistic:a}){return R0(e,t)?v.jsx(Cse,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function iue({trpc:e,deviceId:t,features:n,optimistic:a}){return R0(e,t)?v.jsx($4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function rue({trpc:e,deviceId:t,features:n,optimistic:a}){return R0(e,t)?v.jsx($4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a}):null}function oue(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.mediaPlayer,slice:a=>a.state.mediaPlayer});return n!==void 0}function sue({trpc:e,deviceId:t,features:n,optimistic:a}){return oue(e,t)?v.jsx(_se,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function rO(e,t){const{cap:n}=vt({trpc:e,deviceId:t,cap:a=>a.control,slice:a=>a.state.control});return n!==void 0}function lue({trpc:e,deviceId:t,features:n,optimistic:a}){return rO(e,t)?v.jsx(v4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function cue({trpc:e,deviceId:t,features:n,optimistic:a}){return rO(e,t)?v.jsx(Kce,{children:v.jsx(v4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}):null}var uue={cover:{InlineControl:Wse,HeroCard:Xse},valve:{InlineControl:jle,HeroCard:qle},humidifier:{InlineControl:Ule,HeroCard:Hle},"water-heater":{InlineControl:Vle,HeroCard:Zle},switch:{InlineControl:Yce,HeroCard:zce},light:{InlineControl:eue,HeroCard:Oce},fan:{InlineControl:nue,HeroCard:Dce},sensor:{InlineControl:nle,HeroCard:dle},thermostat:{InlineControl:aue,HeroCard:xce},climate:{InlineControl:iue,HeroCard:rue},button:{InlineControl:vse,HeroCard:yse},update:{InlineControl:ple,HeroCard:mle},lock:{InlineControl:Jce,HeroCard:Ece},"media-player":{InlineControl:sue,HeroCard:Uce},alarm:{InlineControl:Hce,HeroCard:$ce},control:{InlineControl:lue,HeroCard:cue},weather:{InlineControl:Yle,HeroCard:ece},vacuum:{InlineControl:wle,HeroCard:Mle},"lawn-mower":{InlineControl:Nle,HeroCard:Ole},image:{InlineControl:tce,HeroCard:nce},"pet-feeder":{InlineControl:rce,HeroCard:oce},script:{InlineControl:Vce,HeroCard:Gce},automation:{InlineControl:Zce,HeroCard:Wce},dummy:{InlineControl:Jse,HeroCard:ele}};Object.fromEntries(Object.values(H).map(e=>[e,uue[yJ[e]]]));H.Cover+"",H.Valve+"",H.Thermostat+"",H.Climate+"",H.Control+"",H.Button+"",H.MediaPlayer+"",H.AlarmPanel+"",H.Lock+"",H.Vacuum+"",H.LawnMower+"",H.Humidifier+"",H.Switch+"",H.Siren+"",H.Light+"",H.Fan+"",H.WaterHeater+"",H.Sensor+"",H.Presence+"",H.EventEmitter+"",H.Notifier+"",H.Script+"",H.Automation+"",H.Camera+"",H.Hub+"",H.Update+"",H.Generic+"",H.Weather+"",H.Container+"",H.Image+"",H.PetFeeder+"";new Set(Object.values(H));var oO={[H.Camera]:{icon:one,label:"Camera"},[H.Hub]:{icon:Nne,label:"Hub"},[H.Light]:{icon:Em,label:"Light"},[H.Siren]:{icon:Xp,label:"Siren"},[H.Switch]:{icon:My,label:"Switch"},[H.Sensor]:{icon:s_,label:"Sensor"},[H.Thermostat]:{icon:Im,label:"Thermostat"},[H.Climate]:{icon:Yte,label:"Air conditioner"},[H.Button]:{icon:c_,label:"Button"},[H.EventEmitter]:{icon:Pr,label:"Event Emitter"},[H.Update]:{icon:c0,label:"Update"},[H.Generic]:{icon:F2,label:"Generic"},[H.Notifier]:{icon:Wp,label:"Notifier"},[H.Script]:{icon:Bne,label:"Script"},[H.Automation]:{icon:sae,label:"Automation"},[H.Lock]:{icon:pu,label:"Lock"},[H.Cover]:{icon:nne,label:"Cover"},[H.Valve]:{icon:jne,label:"Valve"},[H.Humidifier]:{icon:rae,label:"Humidifier"},[H.WaterHeater]:{icon:ene,label:"Water heater"},[H.Fan]:{icon:Kp,label:"Fan"},[H.MediaPlayer]:{icon:Rne,label:"Media player"},[H.AlarmPanel]:{icon:Rm,label:"Alarm panel"},[H.Control]:{icon:u0,label:"Control"},[H.Presence]:{icon:Ene,label:"Presence"},[H.Weather]:{icon:d_,label:"Weather"},[H.Vacuum]:{icon:ine,label:"Vacuum"},[H.LawnMower]:{icon:Yne,label:"Lawn mower"},[H.Container]:{icon:F2,label:"Container"},[H.Image]:{icon:xne,label:"Image"},[H.PetFeeder]:{icon:ane,label:"Pet feeder"}},due={[Fe.Siren]:{icon:Xp,label:"Siren"},[Fe.Floodlight]:{icon:Em,label:"Floodlight"},[Fe.Spotlight]:{icon:vne,label:"Spotlight"},[Fe.PirSensor]:{icon:S_,label:"PIR sensor"},[Fe.Chime]:{icon:Wp,label:"Chime"},[Fe.Autotrack]:{icon:p_,label:"Auto-track"},[Fe.Nightvision]:{icon:l0,label:"Night vision"},[Fe.PrivacyMask]:{icon:hne,label:"Privacy mask"},[Fe.Doorbell]:{icon:fne,label:"Doorbell"},[Fe.BinaryHelper]:{icon:My,label:"Binary helper"},[Fe.MotionSensor]:{icon:f_,label:"Motion sensor"},[Fe.ContactSensor]:{icon:il,label:"Contact sensor"},[Fe.LeakSensor]:{icon:o0,label:"Leak sensor"},[Fe.SmokeSensor]:{icon:Xte,label:"Smoke sensor"},[Fe.COSensor]:{icon:Gi,label:"CO sensor"},[Fe.GasSensor]:{icon:Yp,label:"Gas sensor"},[Fe.TamperSensor]:{icon:Rm,label:"Tamper sensor"},[Fe.VibrationSensor]:{icon:C_,label:"Vibration sensor"},[Fe.ConnectivitySensor]:{icon:oae,label:"Connectivity"},[Fe.SoundSensor]:{icon:gu,label:"Sound sensor"},[Fe.BinarySensor]:{icon:My,label:"Binary sensor"},[Fe.TemperatureSensor]:{icon:Im,label:"Temperature"},[Fe.HumiditySensor]:{icon:pl,label:"Humidity"},[Fe.AmbientLightSensor]:{icon:w_,label:"Ambient light"},[Fe.PressureSensor]:{icon:yp,label:"Pressure"},[Fe.WindSensor]:{icon:Gi,label:"Wind"},[Fe.RainSensor]:{icon:u_,label:"Rain"},[Fe.UvSensor]:{icon:Zne,label:"UV index"},[Fe.SolarRadiationSensor]:{icon:Wne,label:"Solar radiation"},[Fe.SoilMoistureSensor]:{icon:Gne,label:"Soil moisture"},[Fe.PowerSensor]:{icon:Pr,label:"Power"},[Fe.EnergySensor]:{icon:Pr,label:"Energy"},[Fe.VoltageSensor]:{icon:Pr,label:"Voltage"},[Fe.CurrentSensor]:{icon:Pr,label:"Current"},[Fe.AirQualitySensor]:{icon:Gi,label:"Air quality"},[Fe.BatterySensor]:{icon:yp,label:"Battery"},[Fe.NumericSensor]:{icon:Sne,label:"Numeric sensor"},[Fe.EnumSensor]:{icon:Cne,label:"Enum sensor"},[Fe.DateTimeSensor]:{icon:$2,label:"Date / time"},[Fe.GenericSensor]:{icon:yp,label:"Sensor"},[Fe.NumericControl]:{icon:u0,label:"Numeric control"},[Fe.SelectControl]:{icon:Mne,label:"Select control"},[Fe.TextControl]:{icon:tae,label:"Text control"},[Fe.DateTimeControl]:{icon:$2,label:"Date / time control"},[Fe.MobilePushNotifier]:{icon:Vne,label:"Mobile push"},[Fe.MessagingNotifier]:{icon:v_,label:"Messaging"},[Fe.EmailNotifier]:{icon:Ane,label:"Email"},[Fe.GenericNotifier]:{icon:Wp,label:"Notifier"}},pue=new Set(Object.values(H));new Set(Object.values(Fe));function mue(e){return pue.has(e)}var qC=oO[H.Generic];due[Fe.GenericSensor];function fue(e){return mue(e)?oO[e]??qC:qC}Object.values(H).map(e=>{const t=fue(e);return{id:e,label:t.label,icon:t.icon}});T.createContext(null);H.Sensor,H.Presence;var hue="/addon/snapshot/media";function Hge(e,t={}){const{width:n,baseUrl:a}=t,[s,p]=T.useState(0);return{src:T.useMemo(()=>{if(e===null||e<=0)return null;const f=a!==void 0?a.replace(/\/+$/,""):"",m=new URLSearchParams;n!==void 0&&Number.isInteger(n)&&n>0&&m.set("w",String(n)),s>0&&(m.set("force","1"),m.set("r",String(s)));const h=m.toString();return`${f}${hue}/${String(e)}.jpg${h.length>0?`?${h}`:""}`},[e,n,a,s]),loading:!1,refresh:T.useCallback(()=>{p(f=>f+1)},[])}}d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),online:A(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),isCamera:A().optional()});hi("camstack:player-overlays-state",null);var gue=hi("camstack:player-overlays-actions",null);function $ge(e){const t=T.useContext(gue);T.useEffect(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}hi("camstack:zone-editing",null);var BC=500,uv=800;function bc(e,t,n){try{const a=e.live;if(!a)return null;const s=a.onEvent;return!s||typeof s.subscribe!="function"?null:s.subscribe({category:t},{onData:n})}catch{return null}}function ep(e,t){return e?.id===t}function vue(e,t){const[n,a]=T.useState(null),[s,p]=T.useState(null),[f,m]=T.useState(null),[h,c]=T.useState("watching"),x=T.useRef(void 0),M=T.useRef(void 0),C=T.useRef(void 0),E=T.useRef(0);return T.useEffect(()=>{if(t===null)return;const R=bc(e,"detection.motion-analysis",_=>{const P=_;if(!ep(P?.source,t))return;const D=P.data;!D?.regions||D.regions.length===0||(a({zones:D.regions.map(L=>({...L.bbox,intensity:L.intensity})),frameWidth:D.frameWidth,frameHeight:D.frameHeight}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>a(null),BC))});return()=>{R?.unsubscribe(),x.current&&clearTimeout(x.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=bc(e,"detection.motion-zones-raw",_=>{const P=_;if(!ep(P?.source,t))return;const D=P.data;D?.zones&&(p({boxes:D.zones.map(L=>({bbox:L.bbox,changeScore:L.changeScore})),frameWidth:D.frameSize?.width??0,frameHeight:D.frameSize?.height??0,motionScore:D.zones.length>0?D.zones.reduce((L,B)=>L+B.changeScore,0)/D.zones.length:0}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>p(null),BC))});return()=>{R?.unsubscribe(),M.current&&clearTimeout(M.current)}},[e,t]),T.useEffect(()=>{if(E.current=0,t===null)return;const R=bc(e,"pipeline-analytics.frame-tracked",_=>{const P=_?.data;!P||P.deviceId!==t||P.detections?.length&&typeof P.detections[0]?.kind=="string"&&(E.current=Date.now(),m({detections:P.detections,frameWidth:P.frameWidth,frameHeight:P.frameHeight}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),uv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=bc(e,"detection.result",_=>{const P=_;if(!ep(P?.source,t)||Date.now()-E.current<uv)return;const D=P.data?.frame;D?.detections?.length&&(m({detections:D.detections,frameWidth:D.width,frameHeight:D.height}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),uv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=bc(e,"detection.phase-transition",_=>{const P=_;ep(P?.source,t)&&P.data?.to&&c(P.data.to)});return()=>{R?.unsubscribe()}},[e,t]),{motion:n,motionRaw:s,detection:f,phase:h}}var yue=5*6e4,bue=720*6e4,Sue="camstack:turn-servers:v1";function xue(){const e=globalThis;try{return e.localStorage??null}catch{return null}}function kue(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.fetchedAt!="number"||!Array.isArray(t.servers)?!1:t.servers.every(n=>{if(typeof n!="object"||n===null)return!1;const a=n;return!(!(typeof a.urls=="string"||Array.isArray(a.urls)&&a.urls.every(s=>typeof s=="string"))||a.username!==void 0&&typeof a.username!="string"||a.credential!==void 0&&typeof a.credential!="string")})}var wue=class{freshTtlMs;staleCapMs;storage;now;storageKey;memory=new WeakMap;inflight=new WeakMap;constructor(e={}){this.freshTtlMs=e.freshTtlMs??yue,this.staleCapMs=e.staleCapMs??bue,this.storage="storage"in e?e.storage??null:xue(),this.now=e.now??(()=>Date.now()),this.storageKey=e.storageKey??Sue}async getOrFetch(e,t){const n=this.now(),a=this.memory.get(e)??this.readStorage();if(a){const s=n-a.fetchedAt;if(s<this.freshTtlMs)return a.servers;if(s<this.staleCapMs)return this.startFetch(e,t,a),a.servers}return this.startFetch(e,t,a)}startFetch(e,t,n){const a=this.inflight.get(e);if(a)return a;const s=(async()=>{try{const p=await t();if(p.length>0){const f={servers:p,fetchedAt:this.now()};this.memory.set(e,f),this.writeStorage(f)}return p}catch{return n?.servers}})().finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,s),s}readStorage(){if(this.storage)try{const e=this.storage.getItem(this.storageKey);if(e===null)return;const t=JSON.parse(e);return kue(t)?t:void 0}catch{return}}writeStorage(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(e))}catch{}}},Mue=new wue;function sO(e,t,n=5e3){const[a,s]=T.useState([]);T.useEffect(()=>{if(t===null)return;let E=!1;const R=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(P=>{E||s(P)}).catch(()=>{})};R();const _=setInterval(R,n);return()=>{E=!0,clearInterval(_)}},[e,t,n]);const[p,f]=T.useState(null);T.useEffect(()=>{if(t===null)return;let E=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(R=>{E||!R||f({phase:R.phase,detectionFps:R.actualFps,avgInferenceMs:R.avgInferenceTimeMs,droppedFrames:R.droppedFrames})}).catch(()=>{}),()=>{E=!0}},[e,t]),mi("pipeline.camera-metrics-snapshot",E=>{if(t===null)return;const R=E.data;R.deviceId!==t||!R.metrics||f({phase:R.metrics.phase,detectionFps:R.metrics.actualFps,avgInferenceMs:R.metrics.avgInferenceTimeMs,droppedFrames:R.metrics.droppedFrames})});const{streams:m,hasWebrtc:h}=T.useMemo(()=>t===null||a.length===0?{streams:[],hasWebrtc:!1}:{streams:a.map(E=>({id:E.id,label:E.label,target:E.target,status:E.status,inputFps:E.inputFps,decodeFps:E.decodeFps,bitrateKbps:E.bitrateKbps})),hasWebrtc:!0},[t,a]),c=T.useCallback(async()=>{const E=e.turnProvider;if(E)return Mue.getOrFetch(e,async()=>(await E.getTurnServers.query()).map(R=>({urls:typeof R.urls=="string"?R.urls:[...R.urls],...R.username!==void 0?{username:R.username}:{},...R.credential!==void 0?{credential:R.credential}:{}})))},[e]);T.useEffect(()=>{c()},[c]);const x=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");const _=await e.webrtcSession.createSession.mutate({deviceId:t,target:E,hints:R}),P=await c();return{sessionId:_.sessionId,sdpOffer:_.sdpOffer,...P?{iceServers:P}:{}}},[e,t,c]),M=T.useCallback(async(E,R,_,P)=>{if(t===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:t,target:E,sdpOffer:R,..._!==void 0?{sessionId:_}:{},...P!==void 0?{hints:P}:{}})},[e,t]),C=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:E,sdpAnswer:R})},[e,t]);return{streams:m,hasWebrtc:h,pipelineMetrics:p,createSession:x,handleOffer:M,getIceServers:c,addIceCandidate:T.useCallback(async(E,R)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:E,candidate:R.candidate??"",sdpMid:R.sdpMid??null,sdpMLineIndex:R.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:T.useCallback(async E=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:E}),[e,t]),sendAnswer:C,closeSession:T.useCallback(async E=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:E}).catch(()=>{})},[e,t]),getSessionState:T.useCallback(async E=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:E})}catch{return{pendingRenegotiation:null}}},[e,t])}}T.lazy(()=>Ys(()=>import("./MaskShapeCanvas-DI4BY7W2-PKlfDq_e.js"),[],import.meta.url).then(e=>({default:e.MaskShapeCanvas})));T.lazy(()=>Ys(()=>import("./MotionZonesSettings-DNdnFHso-BcC-Qswj.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings})));T.lazy(()=>Ys(()=>import("./SceneMonitorEditor-d_A4kO-M-DeAdwgn5.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>({default:e.SceneMonitorEditor})));T.lazy(()=>Ys(()=>import("./PrivacyMaskSettings-DNSLc6ww-DTaiq5jX.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));const lO=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Cue=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Aue=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const UC=e=>{const t=Aue(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Eue={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Rue=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Iue=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...Eue,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:lO("lucide",s),...!p&&!Rue(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));const Tue=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Iue,{ref:p,iconNode:t,className:lO(`lucide-${Cue(UC(e))}`,`lucide-${e}`,a),...s}));return n.displayName=UC(e),n};const _ue=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 9h.01",key:"x1ddxp"}]],Nue=Tue("scan-face",_ue),rm={unassignedFace:"unassigned face",reviewed:"reviewed",debug:"debug",train:"train",favourite:"favourite",active:"active",loadingMore:"Loading more events"},Oue=Object.keys(rm),cO=Y(o(),o());function Pue(e){if(e===null||typeof e!="object")return rm;const t=e,n={...rm};for(const a of Oue){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return{unassignedFace:n.unassignedFace,reviewed:n.reviewed,debug:n.debug,train:n.train,favourite:n.favourite,active:n.active,loadingMore:n.loadingMore}}const jue="/viewer/camstack/embed/index.html",Due=N(["reel","gallery"]),zue=N(["small","medium","large"]),Lue=N(["time","importance"]),que=N(["text","semantic"]),Bue=["face","plate"],I0=N(Bue),Uue=["pipeline","sensor","audio"],uO=N(Uue),Fue=N(["auto","dark","light"]),Hue=Ye([Q("auto"),l().int().min(1).max(12)]),$ue=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()});d({view:Due,rows:l().int().min(1).max(6).optional(),columns:Hue.optional(),thumb:zue,deviceIds:w(l().int().nonnegative()),classes:w(o()).optional(),attrs:w(I0).optional(),search:o().optional(),searchMode:que.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:Lue.optional(),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),deviceNames:Y(o(),o()).optional(),fields:$ue,pageSize:l().int().min(1).max(500).optional(),maxRows:l().int().min(1).max(5e3).optional(),refreshMs:l().int().min(0).max(6e5).optional(),maxAgeMs:l().int().min(6e4).optional(),theme:Fue});function T0(e){return e.startsWith("/")&&!e.startsWith("//")}function Que(e){return e!==void 0&&e.length>0?{Authorization:`Bearer ${e}`}:{}}function Vue(e,t,n){if(!t.endsWith(n))return e;const a=t.slice(0,t.length-n.length);return a.length>0?a:e}function dO(e,t){e.token===void 0&&(T0(e.serverUrl)||t.addIssue({code:"custom",path:["token"],message:"token is required unless serverUrl is a same-origin path served through an authenticating relay"}))}const pO=N(["reel","gallery"]),mO=N(["small","medium","large"]),fO=N(["auto","dark","light"]),hO=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()}),gO={label:!0,sublabel:!0,camera:!0,time:!0,badges:!0},vO=N(["time","importance"]),yO=N(["text","semantic"]),bO=Ye([Q("auto"),l().int().min(1).max(12)]),Gue=60,Zue=5e3,Wue=600;function Kue(e){return e.view==="reel"?Math.min(e.maxRows,Wue):e.maxRows}const Yue=0,Xue=720*60*60*1e3,Jue=d({serverUrl:o().min(1),token:o().min(1).optional(),view:pO.default("reel"),rows:l().int().min(1).max(6).default(1),columns:bO.default("auto"),thumbSize:mO.default("medium"),fields:hO.default(gO),deviceIds:w(l().int().nonnegative()).default([]),classes:w(o()).default([]),attrs:w(I0).catch([]).default([]),deviceNames:Y(o(),o()).default({}),kindLabels:Y(o(),o()).default({}),labels:cO.default({}),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).default({}),search:o().default(""),searchMode:yO.default("text"),semanticLimit:l().int().min(1).max(200).default(50),semanticMinScore:l().min(0).max(1).default(.2),sort:vO.default("time"),filterDebug:A().default(!1),filterTrain:A().default(!1),filterFavourited:A().default(!1),showStationary:A().default(!1),excludeSources:w(uO).default([]),reviewedTrackIds:w(o()).default([]),showAdminFlags:A().default(!1),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),pageSize:l().int().min(1).max(500).default(Gue),maxRows:l().int().min(1).max(5e3).default(Zue),refreshMs:l().int().min(0).max(6e5).default(Yue),maxAgeMs:l().int().min(6e4).default(Xue),theme:fO.default("auto"),nativePullToRefresh:A().default(!1)}).superRefine(dO),SO=d({view:pO.optional(),rows:l().int().min(1).max(6).optional(),columns:bO.optional(),thumbSize:mO.optional(),fields:hO.partial().optional(),deviceIds:w(l().int().nonnegative()).optional(),classes:w(o()).optional(),attrs:w(I0).optional(),deviceNames:Y(o(),o()).optional(),kindLabels:Y(o(),o()).optional(),labels:cO.optional(),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).optional(),search:o().optional(),searchMode:yO.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:vO.optional(),filterDebug:A().optional(),filterTrain:A().optional(),filterFavourited:A().optional(),showStationary:A().optional(),excludeSources:w(uO).optional(),reviewedTrackIds:w(o()).optional(),showAdminFlags:A().optional(),sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional(),pageSize:l().int().min(1).max(500).optional(),maxRows:l().int().min(1).max(5e3).optional(),refreshMs:l().int().min(0).max(6e5).optional(),maxAgeMs:l().int().min(6e4).optional(),theme:fO.optional(),nativePullToRefresh:A().optional()});function _0(e){return e==="small"?80:e==="large"?132:106}function ede(e,t=1){const n=Number.isFinite(t)&&t>0?t:1,a=Math.round(_0(e)*n);return Math.max(tde,Math.min(nde,a))}const tde=64,nde=320,_p=3,Np=14,ade=4;function ide(e){return _0(e)+_p*2+Np}function xO(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jue.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function Qy(e,t){const n=t.fields!==void 0?{...e.fields,...t.fields}:e.fields,{sinceMs:a,untilMs:s,...p}=t,{sinceMs:f,untilMs:m,...h}=e,c=FC(a,f),x=FC(s,m);return{...h,...p,fields:n,...c!==void 0?{sinceMs:c}:{},...x!==void 0?{untilMs:x}:{}}}function FC(e,t){if(e!==null)return e??t}function rde(e,t,n){const a=n[String(e)];return a!==void 0&&a.trim().length>0?a:t}const ode={empty:"No events",emptyFiltered:"No events match this filter",error:"Couldn't load events",retry:"Retry",end:"·",loadOlder:"Load older events"};function Ns(e,t){const n=e.strings[t];return n!==void 0&&n.trim().length>0?n:ode[t]}const sde="/addon/pipeline-analytics/event-media",lde="o",HC=64,cde=320;function ude(e){return e.replace(/\/+$/,"")}function dde(e){const t=Math.round(e);return Number.isFinite(t)?Math.max(HC,Math.min(cde,t)):HC}function kO(e,t,n){const a=ude(e),s=encodeURIComponent(t);return`${a}${sde}/${lde}/track/${s}?kind=thumbnailSmall&variant=thumb&size=${dde(n)}`}const pde="audio";function om(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mde(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!om(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!om(s))continue;const p=s.kind;if(typeof p!="string"||p.length===0)continue;const f=s.parentKind;t.set(p,typeof f=="string"&&f.length>0?f:p)}}return t}function wO(e,t){return t.get(e)??e}const $C="audio-",QC="audio";function yu(e){const t=e.toLowerCase();return t.startsWith($C)?t:`${$C}${t}`}function fde(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!om(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!om(s))continue;const p=s.kind,f=s.iconId;typeof p!="string"||p.length===0||typeof f!="string"||f.length===0||t.set(p,f)}}return t}function hde(e,t,n=!1){if(n){const s=t.get(e);if(s!==void 0)return s;if(e.toLowerCase()===QC)return QC;const p=yu(e);return t.get(p)??p}const a=e.toLowerCase();return t.get(e)??t.get(a)??a}function gde(e){const t=new Map;for(const[n,a]of Object.entries(e)){if(n.length===0||a.length===0)continue;t.set(n,a);const s=n.toLowerCase();t.has(s)||t.set(s,a)}return t}const N0=new Map;function Op(e,t){return t.get(e)??t.get(e.toLowerCase())??e}function MO(e,t){const n=yu(e);return t.get(n)??t.get(e)??e}const VC={background:"#09090b",card:"#18181b",cardHover:"#27272a",border:"#27272a",text:"#fafafa",textMuted:"#a1a1aa",skeleton:"#27272a",chip:"#3f3f46",colorScheme:"dark"},GC={background:"#ffffff",card:"#f4f4f5",cardHover:"#e4e4e7",border:"#e4e4e7",text:"#18181b",textMuted:"#71717a",skeleton:"#e4e4e7",chip:"#d4d4d8",colorScheme:"light"};function CO(e,t){return e==="light"?GC:e==="dark"||t?VC:GC}const Vy="#f472b6";function vde(e,t=!1){if(t)return Vy;const n=e.toLowerCase();return n.includes("person")||n.includes("face")?"#38bdf8":n.includes("vehicle")||n.includes("car")||n.includes("truck")||n.includes("plate")?"#a78bfa":n.includes("animal")||n.includes("dog")||n.includes("cat")||n.includes("bird")?"#fbbf24":n.includes("package")||n.includes("parcel")?"#34d399":n.includes("audio")||n.includes("sound")?Vy:n.includes("motion")?"#94a3b8":"#71717a"}function yde(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function bde(e,t){const n=new Date(e),a=new Date(t),s=String(n.getHours()).padStart(2,"0"),p=String(n.getMinutes()).padStart(2,"0");if(n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate())return`${s}:${p}`;const m=String(n.getDate()).padStart(2,"0"),h=String(n.getMonth()+1).padStart(2,"0");return`${m}/${h} ${s}:${p}`}const Sde=/[_\-/.]+/g;function AO(e){return e.toLowerCase().replace(Sde," ").replace(/\s+/g," ").trim()}function xde(e){if(e===void 0)return[];const t=e.trim().toLowerCase();if(t.length===0)return[];const n=AO(e);return n===t||n.length===0?[t]:[t,n]}const Om=new Map,kde=new Set(["plate-detection","plate-ocr","operator:plate-gallery"]),ZC=new Set(["face-recognizer","face-embedding","operator:face-gallery"]),wde=[],Mde=[];function dv(e,t){if(!O0(e))return!1;const n=e.stepId;return typeof n=="string"&&t.has(n)}function EO(e){return e.source==="audio"}function O0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _r(e){return typeof e=="string"&&e.length>0?e:void 0}function pv(e){if(!Array.isArray(e))return[];const t=[];for(const n of e)typeof n=="string"&&n.length>0&&!t.includes(n)&&t.push(n);return t}function Cde(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const a=O0(n)?_r(n.label):void 0;a!==void 0&&!t.includes(a)&&t.push(a)}return t}function Ade(e,t){if(!O0(e))return null;const n=_r(e.trackId),a=_r(e.className);if(n===void 0||a===void 0||typeof e.deviceId!="number"||typeof e.firstSeen!="number"||typeof e.lastSeen!="number")return null;const s=_r(e.label),p=_r(e.subLabel),f=_r(e.producingDeviceName),m=_r(e.source),h=pv(e.classes);return{trackId:n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...s!==void 0?{label:s}:{},...p!==void 0?{subLabel:p}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.firstSeen,lastSeen:e.lastSeen,state:typeof e.state=="string"?e.state:"idle",active:e.active===!0,zonesVisited:pv(e.zonesVisited),zoneNames:pv(e.zoneNames),classes:h.includes(a)?h:[a,...h],audioLabels:Cde(e.audioLabels),bestEventId:_r(e.bestEventId)??n,...f!==void 0?{producingDeviceName:f}:{},...m!==void 0?{source:m}:{},...e.hasEmbeddedFace===!0||dv(e.subLabelMeta,ZC)?{hasAssignableFace:!0}:{},...e.hasEmbeddedFace===!0&&!dv(e.subLabelMeta,ZC)?{hasUnassignedFace:!0}:{},...dv(e.subLabelMeta,kde)?{hasPlate:!0}:{},...e.debug===!0?{debug:!0}:{},...e.markForTrain===!0?{markForTrain:!0}:{},...e.favourited===!0?{favourited:!0}:{}}}function WC(e,t){if(!Array.isArray(e))return[];const n=[];for(const a of e){const s=Ade(a,t);s!==null&&n.push(s)}return n}function Ede(e,t){const n=new Set;for(const a of[e.className,...e.classes])a.length!==0&&(n.add(a),n.add(wO(a,t)));if(e.audioLabels.length>0){n.add(pde);for(const a of e.audioLabels)n.add(yu(a))}return n}function Rde(e,t,n=Om){if(t.size===0)return!0;const a=Ede(e,n);for(const s of t)if(a.has(s))return!0;return!1}function Ide(e,t=Om){const n=new Set,a=s=>{for(const p of xde(s))n.add(p)};for(const s of[e.className,...e.classes])a(s),s.length>0&&a(wO(s,t));a(e.label),a(e.subLabel),a(e.cameraName),a(e.producingDeviceName);for(const s of e.audioLabels)a(s),a(yu(s));for(const s of e.zoneNames)a(s);for(const s of[e.label,e.subLabel]){if(s===void 0)continue;const p=t.get(s.trim().toLowerCase());p!==void 0&&a(p)}return n}function Tde(e,t,n=Om){const a=t.trim().toLowerCase();if(a.length===0)return!0;const s=AO(t);for(const p of Ide(e,n))if(p.includes(a)||s.length>0&&p.includes(s))return!0;return!1}function _de(e,t){return!!(t.size===0||t.has("face")&&e.hasAssignableFace===!0||t.has("plate")&&e.hasPlate===!0)}function Nde(e,t={}){const n=t.debug===!0,a=t.train===!0,s=t.favourited===!0;if(!n&&!a&&!s)return!0;const p=t.reviewedTrackIds?.includes(e.trackId)===!0;return!!(n&&e.debug===!0&&!p||a&&e.markForTrain===!0||s&&e.favourited===!0)}function Ode(e,t){return t.size===0?!0:!t.has(e.source??"pipeline")}function KC(e,t,n,a=Om,s=wde,p={},f=Mde){const m=new Set(t),h=new Set(s),c=new Set(f);return e.filter(x=>Ode(x,c)&&Rde(x,m,a)&&_de(x,h)&&Tde(x,n,a)&&Nde(x,p))}function Pde(e,t=N0){return e.producingDeviceName!==void 0?{text:Op(e.className,t),tier:"device",fullText:e.producingDeviceName}:e.subLabel!==void 0?{text:e.subLabel,tier:"identity"}:e.label!==void 0&&e.label!==e.className?{text:Op(e.label,t),tier:"kind"}:{text:Op(e.className,t),tier:"class"}}function jde(e,t,n,a=N0){if(t)return"";const s=[n];for(const p of e.audioLabels){if(p===e.className||p===e.label)continue;const f=MO(p,a);s.includes(f)||s.push(f)}return s.join(" · ")}function YC(e,t){let n=!1;const a=e.map(s=>{const p=t.get(s.deviceId);return p===void 0||p===s.cameraName?s:(n=!0,{...s,cameraName:p})});return n?a:e}function XC(e,t){if(Object.keys(t).length===0)return e;let a=!1;const s=e.map(p=>{const f=t[p.trackId];if(f===void 0)return p;const m=zde(p,f);return m!==p&&(a=!0),m});return a?s:e}function Dde(e){const{debug:t,markForTrain:n,favourited:a,...s}=e;return s}function zde(e,t){const n=t.debug===!0?!0:t.debug===!1?void 0:e.debug,a=t.markForTrain===!0?!0:t.markForTrain===!1?void 0:e.markForTrain,s=t.favourited===!0?!0:t.favourited===!1?void 0:e.favourited;return n===e.debug&&a===e.markForTrain&&s===e.favourited?e:{...Dde(e),...n===!0?{debug:!0}:{},...a===!0?{markForTrain:!0}:{},...s===!0?{favourited:!0}:{}}}function Lde(e){const t=e.filter(n=>n.isCamera===!0).map(n=>n.id);return t.length>0?t:e.map(n=>n.id)}const Gy=11,JC=9,mv=3,qde=8,Bde=12,Ude=24,Fde=.58,Hde=.85;function $de(e,t){return[...e].length*t*Fde}function Qde(e){return Math.max(Ude,e-qde-Bde)}function eA(e,t,n){const a=Qde(t),s=n.maxLines===1?a:a*n.maxLines*Hde;return $de(e,n.fontSizePx)<=s}function Vde(e,t){for(let n=1;n<=mv;n+=1){const a={fontSizePx:Gy,maxLines:n};if(eA(e,t,a))return a}for(let n=Gy-1;n>=JC;n-=1){const a={fontSizePx:n,maxLines:mv};if(eA(e,t,a))return a}return{fontSizePx:JC,maxLines:mv}}const Gde=1e4;function RO(){try{return window.parent!==window}catch{return!0}}let Zy=null;function IO(e){Zy=e}function Zde(e){if(Zy===null||typeof e!="object"||e===null)return e;const t=e;if(t.type!=="log")return e;const n=typeof t.data=="object"&&t.data!==null?t.data:{};return{...t,data:{deviceId:Zy,...n}}}function rn(e){const t=Zde(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}RO()&&window.parent.postMessage(t,"*")}function bu(e){const t=n=>{const a=n.data;if(typeof a!="object"||a===null)return;const s=a;s.type!=="embed-command"||typeof s.command!="object"||s.command===null||e(s.command)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function Wde(e,t,n,a,s){const p=t();if(p!=null)return Promise.resolve(n(p));if(s?.urlFirst===!0){const f=a!==void 0?a():null;if(f!==null)return Promise.resolve(f)}if(!RO()){const f=a!==void 0?a():null;return f!==null?Promise.resolve(f):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`})}return new Promise(f=>{let m;const h=c=>{const x=c.data;if(typeof x!="object"||x===null)return;const M=x;M.type==="embed-config"&&(clearTimeout(m),window.removeEventListener("message",h),f(n(M.config)))};window.addEventListener("message",h),m=setTimeout(()=>{window.removeEventListener("message",h),f({ok:!1,error:"config handshake timed out"})},Gde),window.parent.postMessage({type:"embed-ready",mode:e},"*")})}function Pm(e,t,n,a,s){const[p,f]=T.useState(null),m=T.useRef(t);m.current=t;const h=T.useRef(n);h.current=n;const c=T.useRef(a);c.current=a;const x=s?.urlFirst===!0;return T.useEffect(()=>{let M=!0;return Wde(e,()=>m.current(),C=>h.current(C),()=>c.current!==void 0?c.current():null,{urlFirst:x}).then(C=>{M&&f(C)}),()=>{M=!1}},[e,x]),p}const Xa=1,Kde=["window","sort","semantic-search","macro-classes","device-names","kind-labels","heartbeat","track-list","attr-filters","flag-filters","debug-status","native-pull-refresh","track-list-delta"];function Yde(e){return{v:Xa,type:"ready",view:e,features:[...Kde]}}function Xde(e){return{v:Xa,type:"error",message:e}}function Pp(e,t){return t!==void 0?{v:Xa,type:"state",state:e,message:t}:{v:Xa,type:"state",state:e}}function Jde(e){return{v:Xa,type:"trackClick",...e}}function epe(e,t){return{v:Xa,type:"trackList",tracks:e,seq:t}}function tpe(e){return{v:Xa,type:"trackListDelta",...e}}function tA(e,t,n,a="feed"){return{v:Xa,type:"countChanged",loaded:e,shown:t,hasMore:n,mode:a}}function npe(){return{v:Xa,type:"heartbeat"}}function ape(e){return{v:Xa,type:"scroll",atTop:e}}function ipe(){return{v:Xa,type:"refreshed"}}function Ba(e){rn(e)}function pi(e,t,n="feed"){rn({type:"log",scope:n,msg:e,...t!==void 0?{data:t}:{}})}const rpe=N(["full","delta"]),ope=d({debug:A().optional(),markForTrain:A().optional(),favourited:A().optional()}),spe=Y(o(),ope);function Sc(e){if(typeof e!="object"||e===null)return null;const t=e,n=t.type;if(n==="refresh"||n==="reload"||n==="loadMore"||n==="scrollToTop"||n==="ping")return{type:n};if(n==="setWindow"){const s=lpe.safeParse(t);return s.success?{type:"setWindow",...s.data.sinceMs!==void 0?{sinceMs:s.data.sinceMs}:{},...s.data.untilMs!==void 0?{untilMs:s.data.untilMs}:{}}:null}if(n==="setTrackListMode"){const s=rpe.safeParse(t.mode);return s.success?{type:"setTrackListMode",mode:s.data}:null}if(n==="setTrackFlagPatches"){const s=spe.safeParse(t.patches);return s.success?{type:"setTrackFlagPatches",patches:s.data}:null}if(n!=="setConfig")return null;const a=SO.safeParse(t.patch);return a.success?{type:"setConfig",patch:a.data}:null}const lpe=d({sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional()});function cpe(e){return{...e.sinceMs!==void 0?{sinceMs:e.sinceMs}:{},...e.untilMs!==void 0?{untilMs:e.untilMs}:{}}}const upe={blockedMs:0,maxLagMs:0,samples:0};function dpe(e,t,n){if(n<=t)return upe;let a=0,s=0,p=0;for(const f of e){const m=f.at-f.lagMs,h=Math.min(f.at,n)-Math.max(m,t);h<=0||(a+=h,s=Math.max(s,f.lagMs),p+=1)}return{blockedMs:Math.round(a),maxLagMs:Math.round(s),samples:p}}function Wy(e,t){const n=Math.min(Math.round(e),t.blockedMs);return{ms:Math.round(e),blockedMs:n,netMs:Math.max(0,Math.round(e)-n),maxLagMs:t.maxLagMs,lagSamples:t.samples}}const ppe=250,nA=600,mpe=8;let Ds=[],aA=null;function fpe(e){e.lagMs<mpe||(Ds.push(e),Ds.length>nA&&(Ds=Ds.slice(Ds.length-nA)))}function Ky(e,t){return dpe(Ds,e,t)}function hpe(e=ppe,t=()=>performance.now(),n=(a,s)=>{const p=setInterval(a,s);return()=>clearInterval(p)}){if(aA!==null)return;let a=t()+e;aA={stop:n(()=>{const p=t();fpe({at:p,lagMs:Math.max(0,p-a)}),a=p+e},e)}}function gpe(e){return e.responseEnd<=0||e.requestStart===0&&e.responseStart===0?null:{totalMs:Math.round(e.responseEnd-e.startTime),queuedMs:Math.round(Math.max(0,e.requestStart-e.startTime)),ttfbMs:Math.round(Math.max(0,e.responseStart-e.requestStart)),transferSize:Math.round(e.transferSize??0)}}function vpe(e,t){let n=null;for(const a of e)a.startTime+1<t||(n===null||a.startTime<n.startTime)&&(n=a);return n}function ype(){if(typeof performance>"u")return null;const e=performance;if(typeof e!="object"||e===null||!("getEntriesByName"in e))return null;const t=e.getEntriesByName;return typeof t!="function"?null:{getEntriesByName:(n,a)=>t.call(performance,n,a)}}function bpe(e,t,n=ype()){if(n===null)return null;try{const a=vpe(n.getEntriesByName(e,"resource"),t);return a===null?null:gpe(a)}catch{return null}}const Spe=250,$i=new Map,fv=new Map,xpe=6,kpe=1e4,wpe=5e3,hv=[250,750];let gv=5;const iA=32;function Mpe(e){try{const t=new URL(e),n=t.pathname.lastIndexOf("/"),a=n>=0?`${t.pathname.slice(0,n)}/<id>`:t.pathname;return{origin:t.origin,path:a,query:t.search}}catch{const t=e.slice(0,iA);return{origin:"(unparseable)",path:e.length>iA?`${t}…`:t,query:""}}}function Cpe(e){return e instanceof Error?{errorName:e.name,errorMessage:e.message}:{errorName:"unknown",errorMessage:String(e)}}let sm=0,TO=[];async function Ape(){if(sm<xpe){sm+=1;return}await new Promise(e=>{TO.push(e)})}function Epe(){const e=TO.shift();if(e!==void 0){e();return}sm=Math.max(0,sm-1)}function Rpe(e,t){for($i.set(e,t);$i.size>Spe;){const n=$i.keys().next();if(n.done===!0)break;const a=$i.get(n.value);$i.delete(n.value),a!==void 0&&URL.revokeObjectURL(a)}}async function _O(e,t){const n=$i.get(e);if(n!==void 0)return $i.delete(e),$i.set(e,n),{status:"ready",src:n};const a=fv.get(e);if(a!==void 0)return a;const s=(async()=>{const p=performance.now(),f=Mpe(e);let m={lastStatus:null,errorName:null,errorMessage:null},h=0;try{for(let c=0;c<=hv.length;c+=1){const x=performance.now();await Ape(),h+=performance.now()-x;const M=performance.now(),C=new AbortController,E=setTimeout(()=>C.abort(),kpe);try{const _=await fetch(e,{headers:Que(t),signal:C.signal});if(_.ok){const P=Math.round(performance.now()-M),D=await _.blob(),L=Math.round(performance.now()-p),B=Math.round(performance.now()-M),q=URL.createObjectURL(D);if(Rpe(e,q),gv>0||L>=500){gv=Math.max(0,gv-1);const G=bpe(e,M),ne=Wy(performance.now()-M,Ky(M,performance.now()));pi("thumbnail ready",{ms:L,queuedMs:Math.round(h),headersMs:P,blobMs:B-P,blockedMs:ne.blockedMs,maxLagMs:ne.maxLagMs,netTotalMs:G?.totalMs??null,netQueuedMs:G?.queuedMs??null,netTtfbMs:G?.ttfbMs??null,bytes:D.size,attempt:c+1,serverTiming:_.headers?.get("server-timing")??null},"media")}return{status:"ready",src:q}}if(_.status===401||_.status===403||_.status===404)return pi("thumbnail missing",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),status:_.status,attempt:c+1,...f},"media"),{status:"missing"};m={lastStatus:_.status,errorName:null,errorMessage:null}}catch(_){m={lastStatus:null,...Cpe(_)}}finally{clearTimeout(E),Epe()}const R=hv[c];R!==void 0&&await new Promise(_=>setTimeout(_,R))}return pi("thumbnail transient failure",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),attempts:hv.length+1,...m,...f},"media"),{status:"transient-failure"}}finally{fv.delete(e)}})();return fv.set(e,s),s}async function Ipe(e,t){const n=await _O(e,t);return n.status==="ready"?n.src:null}function Tpe(e,t){const[n,a]=T.useState({status:"loading"}),[s,p]=T.useState(0);return T.useEffect(()=>{if(e===null){a({status:"loading"});return}const f=$i.get(e);if(f!==void 0){a({status:"ready",src:f});return}let m=!0,h;return a({status:"loading"}),_O(e,t).then(c=>{if(m){if(c.status==="ready"){a({status:"ready",src:c.src});return}if(c.status==="missing"){a({status:"failed"});return}h=setTimeout(()=>p(x=>x+1),wpe)}}),()=>{m=!1,h!==void 0&&clearTimeout(h)}},[e,t,s]),n}function _pe(e){const t=e?.clientHeight??0;return t>0?t:600}function Npe(e,t){const{root:n,disabled:a}=t,[s,p]=T.useState(a===!0),f=T.useRef(s);return f.current=s,T.useEffect(()=>{if(f.current)return;if(a===!0){p(!0);return}const m=e.current;if(!m||typeof IntersectionObserver!="function"){p(!0);return}const h=new IntersectionObserver(c=>{c.some(x=>x.isIntersecting)&&(p(!0),h.disconnect())},{root:n,rootMargin:`${_pe(n)}px`});return h.observe(m),()=>h.disconnect()},[e,n,a]),s}const tp={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,padding:"0 3px",borderRadius:4,background:"#000000B3",color:"#fff",fontSize:9,fontWeight:700,lineHeight:"14px",letterSpacing:.2},Ope=T.memo(function({row:t,serverUrl:n,token:a,thumbPx:s,width:p,heroPx:f,fields:m,palette:h,nowMs:c,variant:x,iconId:M,kindLabels:C=N0,labels:E=rm,scrollRoot:R,eagerImages:_,showAdminFlags:P,onClick:D,onAssignFace:L}){const B=T.useRef(null),G=Npe(B,{root:R,..._===!0?{disabled:!0}:{}})?kO(n,t.trackId,s):null,ne=Tpe(G,a),V=vde(t.className,EO(t)),U=x==="reel",me=f+_p*2+Np,Me=Pde(t,C),Ce=Me.tier!=="class",Ae=!Ce,Ee=Vde(Me.text,f),re=m.label,Te=jde(t,re,Me.text,C),$=K2(M),ue=v.jsxs("div",{style:{position:"relative",width:U?f:"100%",height:U?f:void 0,aspectRatio:U?void 0:"1 / 1",borderRadius:10,overflow:"hidden",background:h.skeleton,border:`1px solid ${h.border}`,boxSizing:"border-box",flex:"0 0 auto"},children:[v.jsx("div",{className:ne.status==="loading"?"events-skeleton":void 0,"data-testid":"card-image-backing",style:{position:"absolute",inset:0,background:ne.status==="failed"?`${V}22`:h.skeleton,boxShadow:`inset 0 0 0 1px ${h.border}`}}),ne.status==="ready"?v.jsx("img",{src:ne.src,alt:"",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null,m.label&&v.jsxs("div",{style:{position:"absolute",left:4,right:4,bottom:4,display:"flex",flexWrap:U?"nowrap":"wrap",gap:3,alignItems:"center",pointerEvents:"none"},children:[Ae&&v.jsx("span",{"data-testid":"card-class-glyph",title:Op(t.className,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${V}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx($,{size:13,color:"#fff"})}),Ce&&v.jsx("span",{"data-testid":"card-title",title:Me.fullText??Me.text,style:{background:"#000000B3",color:"#fff",fontSize:U?Gy:Ee.fontSizePx,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,overflow:"hidden",minWidth:0,...U?{textOverflow:"ellipsis",whiteSpace:"nowrap"}:{display:"-webkit-box",WebkitLineClamp:Ee.maxLines,WebkitBoxOrient:"vertical",whiteSpace:"normal",overflowWrap:"anywhere"}},children:Me.text}),t.hasUnassignedFace===!0&&v.jsxs("span",{...L===void 0?{}:{role:"button",tabIndex:0},"data-testid":"card-face-unassigned",title:E.unassignedFace,onClick:z=>{z.stopPropagation(),L?.(t)},onKeyDown:z=>{L!==void 0&&(z.key!=="Enter"&&z.key!==" "||(z.stopPropagation(),z.preventDefault(),L(t)))},style:{border:"none",cursor:L?"pointer":"default",pointerEvents:L?"auto":"none",display:"inline-flex",alignItems:"center",gap:3,background:"#000000B3",color:"#fff",fontSize:11,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,flex:"0 0 auto"},children:[v.jsx(Nue,{size:13,color:"#fff"}),"?"]}),!U&&t.audioLabels.filter(z=>z!==t.className&&z!==t.label).map(z=>{const ae=yu(z),de=K2(ae);return v.jsx("span",{title:MO(z,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${Vy}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(de,{size:13,color:"#fff"})},`audio-${z}`)})]}),(P===!0&&(t.debug===!0||t.reviewed===!0||t.markForTrain===!0)||t.favourited===!0)&&v.jsxs("span",{"data-testid":"card-flags",style:{position:"absolute",top:4,right:m.badges&&t.active?16:4,display:"inline-flex",gap:2,zIndex:2},children:[P===!0&&t.reviewed===!0&&v.jsx("span",{title:E.reviewed,style:tp,children:"✓"}),P===!0&&t.debug===!0&&t.reviewed!==!0&&v.jsx("span",{title:E.debug,style:tp,children:"D"}),P===!0&&t.markForTrain===!0&&v.jsx("span",{title:E.train,style:tp,children:"T"}),t.favourited===!0&&v.jsx("span",{title:E.favourite,style:{...tp,color:"#fbbf24"},children:"★"})]}),m.badges&&t.active&&v.jsx("span",{title:E.active,style:{position:"absolute",top:4,right:4,width:8,height:8,borderRadius:999,background:"#22c55e",boxShadow:"0 0 0 2px rgba(0,0,0,0.35)"}}),m.badges&&!U&&t.importance!==void 0&&v.jsxs("span",{"data-testid":"card-importance",style:{position:"absolute",top:4,left:4,display:"inline-flex",alignItems:"center",gap:2,background:"#000000B3",color:"#fff",fontSize:10,fontWeight:700,fontVariantNumeric:"tabular-nums",padding:"1px 5px",borderRadius:8},children:["★",Math.round(t.importance*100)]})]});if(U)return v.jsxs("button",{ref:B,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,height:me,minWidth:p,minHeight:me,display:"flex",flexDirection:"column",alignItems:"center",padding:0,border:"none",background:"transparent",cursor:"pointer",font:"inherit",color:h.text,boxSizing:"border-box",contain:"layout paint",overflow:"hidden"},children:[ue,v.jsxs("div",{style:{paddingTop:_p,paddingBottom:_p,paddingLeft:4,paddingRight:4,display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"100%",boxSizing:"border-box"},children:[m.camera&&t.producingDeviceName!==void 0&&v.jsx("span",{style:{fontSize:11,lineHeight:`${Np}px`,fontWeight:600,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.producingDeviceName}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:`${Np}px`,color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:yde(t.lastSeen)})]})]});const ke=m.camera,Ie=t.cameraName,ge=ke||m.time||m.sublabel&&Te.length>0;return v.jsxs("button",{ref:B,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,display:"flex",flexDirection:"column",gap:4,padding:0,border:"none",background:"transparent",cursor:"pointer",textAlign:"left",font:"inherit",color:h.text,boxSizing:"border-box"},children:[ue,ge&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0,paddingTop:2,paddingBottom:2},children:[m.sublabel&&Te.length>0&&v.jsx("span",{style:{fontSize:11,color:h.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te}),ke&&v.jsx("span",{"data-testid":"card-camera",title:Ie,style:{fontSize:12,fontWeight:600,lineHeight:"15px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:Ie}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:"14px",color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",flex:"0 0 auto"},children:bde(t.lastSeen,c)}),m.badges&&t.zonesVisited.length>0&&v.jsx("span",{style:{fontSize:10,color:h.textMuted,background:h.chip,borderRadius:5,padding:"1px 5px",alignSelf:"flex-start",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.zonesVisited.join(" · ")})]})]})});function Ppe(e){return{listRecentTracks:t=>e.trpcClient.pipelineAnalytics.listRecentTracks.query(t),listDevices:()=>e.trpcClient.deviceManager.listAll.query({isCamera:!0,projection:"slim"}),searchObjectEvents:t=>e.trpcClient.pipelineAnalytics.searchObjectEvents.query(t),listEventKinds:t=>e.trpcClient.pipelineAnalytics.listEventKindsBatch.query({deviceIds:t})}}const jpe=2e3,Dpe=1e3;function rA(e,t){const n=Math.max(1,Math.floor(e)),a=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(jpe/a));return Math.min(n,Dpe,s)}function P0(e,t){return e.lastSeen!==t.lastSeen?t.lastSeen-e.lastSeen:e.trackId===t.trackId?0:e.trackId<t.trackId?1:-1}const Cc={rows:[],cursor:null,exhausted:!1,rebuild:null},zpe=8;function Yy(e,t){const n=new Map;for(const a of e)n.set(a.trackId,a);for(const a of t)n.set(a.trackId,a);return[...n.values()].sort(P0)}function Lpe(e,t,n){const a=e.rebuild;if(a===null)return{rows:Yy(e.rows,t),cursor:n,exhausted:n===null,rebuild:null};const s=Yy(a.rows,t),p=a.pages+1,f=s.length>=a.floor;return n===null||f||p>=zpe?{rows:s,cursor:n,exhausted:n===null,rebuild:null}:{...e,rebuild:{rows:s,cursor:n,exhausted:!1,floor:a.floor,pages:p}}}function qpe(e){return e.rows.length===0?Cc:{...e,rebuild:{rows:[],cursor:null,exhausted:!1,floor:e.rows.length,pages:0}}}function Bpe(e){return e.rebuild===null?e:{...e,rebuild:null}}function Upe(e){return e.rebuild!==null}function oA(e){return e.rebuild!==null?e.rebuild.cursor:e.cursor}function Fpe(e,t,n){const a=new Set(e.rows.map(p=>p.trackId));let s=0;for(const p of t)a.has(p.trackId)||(s+=1);return{state:{...e,rows:Yy(e.rows,t)},gap:n!==null,deltaCursor:n,added:s}}function Hpe(e){const t=e.rows[0];return t!==void 0?t.lastSeen:null}function NO(e,t){const n=e.rebuild??e;return n.exhausted?"exhausted":n.rows.length<Math.max(1,t)?"more":"ceiling"}function sA(e,t){return NO(e,t)==="more"}function $pe(e,t){return Math.max(0,e-Math.max(0,t))}function Qpe(e){const t=e.sinceMs??$pe(e.anchorMs,e.maxAgeMs);return e.untilMs!==void 0?{since:t,until:e.untilMs}:{since:t}}function Vpe(e,t){return e===void 0||e>t}function OO(e,t){return t==="time"?e:[...e].sort((n,a)=>{const s=n.importance??-1,p=a.importance??-1;return s!==p?p-s:P0(n,a)})}const lA=200,Gpe=45;function Xy(e){return{trackId:e.trackId,deviceId:e.deviceId,bestEventId:e.bestEventId,className:e.className,firstSeen:e.firstSeen,lastSeen:e.lastSeen}}function Jy(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Zpe(e,t){const n=t.map(E=>E.trackId);if(Jy(e,n))return{kind:"unchanged"};if(e.length===0)return{kind:"reset"};const a=new Set(e);let s=n.length-1,p=e.length-1,f=n.length;for(;s>=0&&!a.has(n[s]);)f=s,s-=1;const m=[];for(;s>=0&&p>=0;){if(n[s]===e[p]){s-=1,p-=1;continue}m.push(e[p]),p-=1}const h=s+1;for(;p>=0;)m.push(e[p]),p-=1;const c=new Set(m),x=[...n.slice(0,h),...e.filter(E=>!c.has(E)),...n.slice(f)];if(!Jy(x,n))return{kind:"reset"};const M=h+(n.length-f);return lA*M+Gpe*m.length>=lA*n.length?{kind:"reset"}:{kind:"delta",prepend:t.slice(0,h).map(Xy),append:f===n.length?[]:t.slice(f).map(Xy),removeIds:m}}const Wpe={seq:0,sentIds:null,mode:"full"};function jp(e,t,n){const a=e.seq+1;return{state:{seq:a,sentIds:n,mode:e.mode},message:epe(t.map(Xy),a)}}function Kpe(e,t){const n=t.map(p=>p.trackId);if(e.sentIds===null)return jp(e,t,n);if(e.mode==="full")return Jy(e.sentIds,n)?{state:e,message:null}:jp(e,t,n);const a=Zpe(e.sentIds,t);if(a.kind==="unchanged")return{state:e,message:null};if(a.kind==="reset")return jp(e,t,n);const s=e.seq+1;return{state:{seq:s,sentIds:n,mode:e.mode},message:tpe({seq:s,baseSeq:e.seq,prepend:a.prepend,append:a.append,removeIds:a.removeIds,count:n.length})}}function Ype(e,t,n){const a=n.map(s=>s.trackId);return jp({...e,mode:t},n,a)}function Xpe(e){let t=Wpe,n=[];const a=s=>{t=s.state,s.message!==null&&e(s.message)};return{report:s=>{n=s,a(Kpe(t,s))},setMode:s=>{a(Ype(t,s,n))}}}function Jpe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xc(e){return typeof e=="string"&&e.length>0?e:void 0}function eme(e,t){if(!Jpe(e))return null;const n=xc(e.id),a=xc(e.className);if(n===void 0||a===void 0||typeof e.deviceId!="number"||typeof e.timestamp!="number"||typeof e.score!="number")return null;const s=xc(e.trackId),p=typeof e.mediaId=="number"?String(e.mediaId):void 0,f=xc(e.label),m=xc(e.subLabel);return{trackId:s??n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...f!==void 0?{label:f}:{},...m!==void 0?{subLabel:m}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.timestamp,lastSeen:e.timestamp,state:"idle",active:!1,zonesVisited:[],zoneNames:[],classes:[a],audioLabels:[],bestEventId:p??s??n,score:e.score}}function tme(e,t){if(!Array.isArray(e))return[];const n=new Map;for(const a of e){const s=eme(a,t);if(s===null)continue;const p=n.get(s.trackId);(p===void 0||s.score>p.score)&&n.set(s.trackId,s)}return[...n.values()].sort((a,s)=>a.score!==s.score?s.score-a.score:s.lastSeen-a.lastSeen)}function nme(e,t,n){const a=new Map;for(const s of e)a.set(s.trackId,s);for(const s of t)a.set(s.trackId,s);return OO([...a.values()].sort(P0),n)}function ame(e,t){if(e.length===0)return e;const n=Math.max(1,Math.floor(t.rowsPerColumn)),a=Math.max(1,t.cardWidth+t.gap),s=Math.max(0,Math.floor(Math.max(0,t.scrollLeft)/a)),p=t.viewportWidth>0?t.viewportWidth:t.cardWidth,f=Math.max(s+1,Math.ceil((Math.max(0,t.scrollLeft)+p*2)/a));return e.slice(s*n,Math.min(e.length,f*n))}const ime=34;function rme(e){const t=Math.max(0,e.gap),n=Math.max(1,e.cardWidth),a=Math.max(0,e.viewportWidth),s=e.columns??"auto",p=s==="auto"?Math.max(1,Math.floor((a+t)/(n+t))):Math.max(1,Math.floor(s)),f=a>0?(a-(p-1)*t)/p:n;return{columns:p,columnWidth:f,rowStridePx:Math.max(1,f+ime+t)}}const ome=2,sme={startRow:0,endRow:0,padTopPx:0,padBottomPx:0,totalPx:0};function lme(e){const t=Math.max(0,Math.floor(e.rowCount));if(t===0)return sme;const n=e.estimatedRowPx>0?e.estimatedRowPx:1,a=P=>{const D=e.measuredPx.get(P);return D!==void 0&&D>0?D:n};let s=0;for(let P=0;P<t;P+=1)s+=a(P);if(e.viewportHeight<=0)return{startRow:0,endRow:t,padTopPx:0,padBottomPx:0,totalPx:s};const p=Math.max(0,e.scrollTop),f=p+e.viewportHeight;let m=0,h=0;for(;m<t-1&&h+a(m)<=p;)h+=a(m),m+=1;let c=m,x=h;for(;c<t&&x<f;)x+=a(c),c+=1;const M=Math.max(0,Math.floor(e.overscanRows??ome)),C=Math.max(0,m-M),E=Math.min(t,c+M);let R=0;for(let P=0;P<C;P+=1)R+=a(P);let _=0;for(let P=C;P<E;P+=1)_+=a(P);return{startRow:C,endRow:E,padTopPx:R,padBottomPx:Math.max(0,s-R-_),totalPx:s}}function cme(e,t){let n=0,a=0;for(const s of e.values())s>0&&(n+=s,a+=1);return a===0?Math.max(1,t):Math.max(1,n/a)}const ume=24,dme=2;function pme(e,t,n){if(e.length===0)return e;const a=Math.max(1,Math.floor(n)),s=Math.max(0,t.startRow)*a,p=Math.max(1,t.endRow-t.startRow+dme),f=Math.min(e.length,s+Math.min(p*a,ume));return e.slice(s,f)}function mme(e){const{rowCount:t,scrollTop:n,viewportHeight:a,fallbackRowPx:s,geometryKey:p}=e,f=T.useRef(new Map),m=T.useRef(new Map),[h,c]=T.useState(()=>new Map),x=T.useRef(p);T.useEffect(()=>{x.current!==p&&(x.current=p,m.current=new Map,c(new Map))},[p]);const M=T.useCallback(E=>{const R=m.current.get(E);if(R!==void 0)return R;const _=P=>{P===null?f.current.delete(E):f.current.set(E,P)};return m.current.set(E,_),_},[]);return T.useLayoutEffect(()=>{let E=null;for(const[R,_]of f.current){const P=Math.round(_.getBoundingClientRect().height);P<=0||h.get(R)!==P&&(E??=new Map(h),E.set(R,P))}E!==null&&c(E)}),{window:T.useMemo(()=>lme({rowCount:t,scrollTop:n,viewportHeight:a,estimatedRowPx:cme(h,s),measuredPx:h}),[t,n,a,s,h]),measureRow:M}}const fme=1,hme=jue,gme=["label","sublabel","camera","time","badges"];function Os(e,t){const n=e.get(t);if(n===null||n.trim()==="")return;const a=Number.parseInt(n,10);return Number.isFinite(a)?a:void 0}function vme(e){if(e===null)return;if(e.trim()==="")return[];const t=[];for(const n of e.split(",")){const a=Number.parseInt(n.trim(),10);Number.isFinite(a)&&a>=0&&t.push(a)}return t}function eb(e){if(e!==null)return e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function yme(e){if(e===null)return;const t=new Set((eb(e)??[]).map(a=>a.toLowerCase())),n={};for(const a of gme)n[a]=t.has(a.toLowerCase());return n}function bme(e,t){const n=e.startsWith("?")?e.slice(1):e;for(const a of n.split("&")){if(a.length===0)continue;const s=a.indexOf("=");if((s===-1?a:a.slice(0,s))===t)return s===-1?"":a.slice(s+1)}return null}function Sme(e){if(e===null)return;const t={};if(e.trim()==="")return t;for(const n of e.split(",")){const a=n.indexOf(":");if(a<=0)continue;const s=n.slice(0,a).trim();if(!/^\d+$/.test(s))continue;let p;try{p=decodeURIComponent(n.slice(a+1))}catch{continue}p.trim().length!==0&&(t[s]=p)}return t}function cA(e,t){const n=e.get(t);if(n===null)return;if(n.trim()==="")return null;const a=Number.parseInt(n,10);return Number.isFinite(a)&&a>=0?a:void 0}function xme(e){if(e===null||e.trim()==="")return;if(e==="auto")return"auto";const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function kme(e){const t=e.startsWith("#")?e.slice(1):e;if(t.length===0)return null;const n=new URLSearchParams(t).get("t");return n!==null&&n.length>0?n:null}function PO(e){const t=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n=t.get("v");if(n===null)return null;if(Number.parseInt(n,10)!==fme)return{ok:!1,error:`unsupported events URL version "${n}"`};const s={},p=t.get("view");p!==null&&(s.view=p);const f=Os(t,"rows");f!==void 0&&(s.rows=f);const m=xme(t.get("cols"));m!==void 0&&(s.columns=m);const h=t.get("thumb");h!==null&&(s.thumbSize=h);const c=yme(t.get("fields"));c!==void 0&&(s.fields=c);const x=vme(t.get("devices"));x!==void 0&&(s.deviceIds=x);const M=eb(t.get("classes"));M!==void 0&&(s.classes=M);const C=eb(t.get("attrs"));C!==void 0&&(s.attrs=C);const E=t.get("q");E!==null&&(s.search=E);const R=Os(t,"page");R!==void 0&&(s.pageSize=R);const _=Os(t,"max");_!==void 0&&(s.maxRows=_);const P=Os(t,"refresh");P!==void 0&&(s.refreshMs=P);const D=Os(t,"age");D!==void 0&&(s.maxAgeMs=D);const L=t.get("theme");L!==null&&(s.theme=L);const B=t.get("sort");B!==null&&(s.sort=B);const q=t.get("smode");q!==null&&(s.searchMode=q);const G=Os(t,"slimit");G!==void 0&&(s.semanticLimit=G);const ne=t.get("sscore");if(ne!==null&&ne.trim()!==""){const Ce=Number.parseFloat(ne);Number.isFinite(Ce)&&(s.semanticMinScore=Ce)}const V=cA(t,"since");V!==void 0&&(s.sinceMs=V);const U=cA(t,"until");U!==void 0&&(s.untilMs=U);const me=Sme(bme(e,"names"));me!==void 0&&(s.deviceNames=me);const Me=SO.safeParse(s);return Me.success?{ok:!0,patch:Me.data}:{ok:!1,error:Me.error.issues.map(Ce=>`${Ce.path.join(".")||"(root)"}: ${Ce.message}`).join("; ")}}function wme(e,t,n,a=""){const s=PO(e);if(s===null)return null;if(!s.ok)return{ok:!1,error:s.error};const p=Vue(n,a,hme),f=kme(t);return f===null&&!T0(p)?null:xO({serverUrl:p,...f!==null?{token:f}:{},fields:gO,...s.patch})}function Mme(){const e=wme(location.search,location.hash,location.origin,location.pathname);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}function Cme(){const e=PO(location.search);return e===null||!e.ok?null:e.patch}function Ame(e,t){return!e.ok||t===null?e:{ok:!0,config:Qy(e.config,t)}}const uA=5,dA=3,Eme=[300,900];let Rme=0;function Ime(e){if(typeof e!="object"||e===null)return!1;const t=e;return"tracks"in t&&(t.nextCursor===null||typeof t.nextCursor=="string")}const Tme=[],_me=/^(10\.|127\.|192\.168\.|169\.254\.|172\.(1[6-9]|2\d|3[01])\.)/;function Nme(e){let t;try{const p=T0(e)&&typeof location<"u"?location.href:void 0;t=new URL(e,p).host}catch{return"unknown:(unparseable)"}const n=t.trim().toLowerCase().replace(/^\[([^\]]*)\].*$/,"$1"),a=n.lastIndexOf(":"),s=a!==-1&&n.indexOf(":")===a?n.slice(0,a):n;return s==="localhost"||s==="::1"||s.startsWith("127.")?`loopback:${t}`:_me.test(s)||/^f[cd][0-9a-f]{2}:/.test(s)||s.startsWith("fe80:")||s.endsWith(".local")?`lan:${t}`:s.includes(".")?`public:${t}`:`unknown:${t}`}function Ome(e){const{client:t,deviceIds:n,nameById:a,pageSize:s,maxRows:p,refreshMs:f,maxAgeMs:m}=e,{sinceMs:h,untilMs:c,devicesResolved:x}=e,M=e.includeStationary===!0,C=e.excludeSources??Tme,E=[...C].toSorted().join(","),[R,_]=T.useState(Cc),[P,D]=T.useState(!1),[L,B]=T.useState(!1),[q,G]=T.useState(null),[ne,V]=T.useState(0),[U,me]=T.useState(p),Me=T.useRef(p);Me.current=U;const Ce=T.useRef(Cc);Ce.current=R;const Ae=T.useRef(!1),Ee=T.useRef(!1),re=T.useRef(0),Te=T.useRef(null),$=T.useRef(Date.now()),ue=T.useRef(a);ue.current=a;const ke=T.useRef(e.channel);ke.current=e.channel;const Ie=T.useRef(null);T.useEffect(()=>{hpe()},[]);const ge=n.join(","),z=T.useCallback(async($e,we=0)=>{const Ve=`feed-${String(++Rme)}`,lt=performance.now();try{const dt=await t.listRecentTracks($e),Tt=performance.now(),ot=Wy(Tt-lt,Ky(lt,Tt)),mn={requestId:Ve,waitMs:Math.round(we),...ot};return Ime(dt)?{ok:!0,page:dt,timing:mn}:(pi("request invalid",{...mn,channel:ke.current}),{ok:!1,message:"unexpected response shape"})}catch(dt){const Tt=dt instanceof Error?dt.message:String(dt),ot=performance.now();return pi("listRecentTracks failed",{error:Tt,devices:$e.deviceIds.length,limit:$e.limit,since:$e.since,cursor:$e.cursor??null,requestId:Ve,channel:ke.current,waitMs:Math.round(we),...Wy(ot-lt,Ky(lt,ot))}),{ok:!1,message:Tt}}},[t]),ae=T.useCallback(($e,we)=>{pi("request complete",{...$e,channel:ke.current,...we})},[]),de=T.useCallback(()=>{if(Ae.current){Ee.current=!0,Ie.current===null&&(Ie.current=performance.now());return}const $e=Ce.current;if(!sA($e,Me.current)||n.length===0)return;const we=Ie.current;Ie.current=null;const Ve=we===null?0:performance.now()-we;Ae.current=!0,B(!0);const lt=rA(s,n.length),dt=Qpe({anchorMs:$.current,maxAgeMs:m,...h!==void 0?{sinceMs:h}:{},...c!==void 0?{untilMs:c}:{}}),Tt=oA($e)!==null;z({deviceIds:[...n],since:dt.since,limit:lt,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...dt.until!==void 0?{until:dt.until}:{},...(()=>{const ot=oA($e);return ot!==null?{cursor:ot}:{}})()},Ve).then(ot=>{if(ot.ok){const en=performance.now(),$n=WC(ot.page.tracks,ue.current),fa=Lpe(Ce.current,$n,ot.page.nextCursor);Ce.current=fa,_(fa),ae(ot.timing,{rows:$n.length,devices:n.length,limit:lt,paged:Tt,parseMs:Math.round(performance.now()-en)}),re.current=0,G(null),D(!0);return}const mn=re.current,Jt=Eme[mn];if(mn+1<dA&&Jt!==void 0){re.current=mn+1,pi("page failed — retrying",{attempt:mn+1,of:dA,backoffMs:Jt}),Te.current=setTimeout(()=>{Te.current=null,Se.current()},Jt);return}re.current=0;const Ln=Bpe(Ce.current);Ce.current=Ln,_(Ln),G(ot.message),D(!0)}).finally(()=>{if(Ae.current=!1,B(!1),Upe(Ce.current)){Se.current();return}Ee.current&&(Ee.current=!1,Se.current())})},[z,ae,n,ge,s,m,h,c,M,E]),Se=T.useRef(de);Se.current=de;const J=T.useCallback(()=>{if(Ae.current||n.length===0)return Promise.resolve();const $e=Hpe(Ce.current);if($e===null)return be.current(),Promise.resolve();Ae.current=!0;const we=rA(s,n.length);return(async()=>{let Ve=null,lt=0,dt=!0;for(;dt&&lt<uA;){const Tt=await z({deviceIds:[...n],since:$e,limit:we,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...c!==void 0?{until:c}:{},...Ve!==null?{cursor:Ve}:{}});if(!Tt.ok)return;const ot=Tt.page,mn=performance.now(),Jt=WC(ot.tracks,ue.current),Ln=Fpe(Ce.current,Jt,ot.nextCursor);Ce.current=Ln.state,_(Ln.state),ae(Tt.timing,{rows:Jt.length,devices:n.length,limit:we,paged:Ve!==null,delta:!0,parseMs:Math.round(performance.now()-mn)}),G(null),dt=Ln.gap,Ve=Ln.deltaCursor,lt+=1}dt&&pi("delta drain hit its page bound — newer rows may be missing",{since:$e,pages:lt,bound:uA})})().finally(()=>{Ae.current=!1,Ee.current&&(Ee.current=!1,Se.current())})},[z,ae,n,ge,s,de,c,M,E]),he=T.useCallback(()=>{Te.current!==null&&(clearTimeout(Te.current),Te.current=null),re.current=0},[]),De=T.useCallback(()=>{const $e=Me.current+Math.max(1,p);Me.current=$e,me($e),Se.current()},[p]),se=T.useCallback(()=>{he(),G(null),D(!1),Se.current()},[he]),be=T.useRef(()=>{}),Qe=T.useCallback(()=>{he(),$.current=Date.now(),Ee.current=!1,Ce.current=Cc,_(Cc),D(!1),B(!1),G(null),Me.current=p,me(p),V($e=>$e+1)},[he,p]),ct=T.useCallback(()=>{he(),$.current=Date.now(),Ee.current=!1;const $e=qpe(Ce.current);Ce.current=$e,_($e),$e.rows.length===0&&D(!1),B(!1),G(null),V(we=>we+1)},[he]),Je=`${ge}|${m}|${h??""}|${c??""}|${M?"1":"0"}|${E}`,et=T.useRef(Je);return T.useEffect(()=>{et.current!==Je&&(et.current=Je,!(Ce.current.rows.length===0&&!P)&&Qe())},[Je,Qe,P]),T.useEffect(()=>{if(n.length===0){x&&D(!0);return}de()},[ne,ge,x]),T.useEffect(()=>{if(f<=0||n.length===0||!Vpe(c,Date.now()))return;const $e=setInterval(()=>{J()},f);return()=>clearInterval($e)},[f,J,n.length,c]),be.current=se,T.useEffect(()=>he,[he]),{rows:R.rows,retry:se,loading:!P,loadingMore:L&&P,error:q,hasMore:sA(R,U),tail:NO(R,U),loadMore:de,loadOlder:De,refresh:J,reload:ct}}const Pme=3,jme=250;function Dme(e){const{urls:t,token:n,paused:a,enabled:s}=e,p=T.useRef(0),f=T.useRef(0),m=T.useRef(!1),h=T.useRef(t),c=T.useRef(t[0]??"");h.current=t;const x=t[0]??"";c.current!==x&&(c.current=x,p.current=0),T.useEffect(()=>{if(m.current=!1,!s||a)return;let M=!1;const C=()=>{if(!(M||m.current))for(;f.current<Pme;){const E=h.current,R=p.current;if(R>=E.length)return;p.current=R+1;const _=E[R];_===void 0||_.length===0||(f.current+=1,Ipe(_,n).finally(()=>{f.current=Math.max(0,f.current-1),C()}))}};return C(),()=>{M=!0,m.current=!0}},[s,a,n,t.length])}const zme=.5,jO=56,Lme=88;function qme(e){return e<=0?0:Math.min(e*zme,Lme)}function pA(e){return e>=jO}function Bme(e,t,n){return e==="gallery"&&!t&&!n}function Ume(e){const{root:t,onRefresh:n,enabled:a}=e,[s,p]=T.useState(0),f=T.useRef(null),m=T.useRef(0);m.current=s;const h=T.useRef(n);h.current=n;const c=T.useCallback(()=>{f.current=null,p(0)},[]);return T.useEffect(()=>{if(!a||t===null)return;const x=R=>{if(t.scrollTop>0){f.current=null;return}const _=R.touches[0];f.current=_!==void 0?_.clientY:null},M=R=>{const _=f.current;if(_===null)return;const P=R.touches[0];if(P!==void 0){if(t.scrollTop>0){f.current=null,p(0);return}p(qme(P.clientY-_))}},C=()=>{if(f.current===null)return;const R=m.current;c(),pA(R)&&h.current()},E={passive:!0};return t.addEventListener("touchstart",x,E),t.addEventListener("touchmove",M,E),t.addEventListener("touchend",C,E),t.addEventListener("touchcancel",c,E),()=>{t.removeEventListener("touchstart",x),t.removeEventListener("touchmove",M),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",c)}},[t,a,c]),{distance:s,armed:pA(s)}}const Ps=8,mA=10,Fme=400;function Hme(e){return Math.max(Fme,Math.round(e))}function DO(e,t){return{display:"flex",alignItems:"center",justifyContent:"center",padding:e?"0 12px":"10px 0",width:e?"max-content":"100%",height:e?t:void 0,...e?{gridColumn:"auto"}:{},whiteSpace:"nowrap"}}function fA(e,t,n){return{...DO(e,t),font:"inherit",fontSize:12,color:n.text,background:n.card,border:`1px solid ${n.border}`,borderRadius:8,cursor:"pointer"}}const $me=8;function hA({message:e,palette:t}){return T.useEffect(()=>{Ba(Xde(e)),Ba(Pp("error",e))},[e]),v.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:t.background,color:"#f87171",fontFamily:"system-ui, sans-serif",fontSize:13,padding:16,textAlign:"center"},children:["Events embed config error: ",e]})}function Qme({client:e,initialConfig:t}){const[n,a]=T.useState(t),[s,p]=T.useState({}),[f,m]=T.useState(()=>window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0),[h,c]=T.useState(()=>Date.now()),[x,M]=T.useState(null);T.useEffect(()=>{let ve=!1;return e.listDevices().then(Re=>{ve||M(Re)}).catch(()=>{ve||M([])}),()=>{ve=!0}},[e]);const C=T.useMemo(()=>{const ve=new Map;for(const Re of x??[])ve.set(Re.id,rde(Re.id,Re.name??`Camera ${Re.id}`,n.deviceNames));for(const[Re,mt]of Object.entries(n.deviceNames)){const qt=Number(Re);Number.isInteger(qt)&&!ve.has(qt)&&mt.trim().length>0&&ve.set(qt,mt)}return ve},[x,n.deviceNames]),[E,R]=T.useState(()=>new Map),[_,P]=T.useState(()=>new Map),D=T.useMemo(()=>gde(n.kindLabels),[n.kindLabels]),L=T.useMemo(()=>Pue(n.labels),[n.labels]),B=T.useMemo(()=>n.deviceIds.length>0?n.deviceIds:x===null?[]:Lde(x),[n.deviceIds,x]);T.useEffect(()=>{if(B.length===0)return;let ve=!1;return e.listEventKinds([...B]).then(Re=>{ve||(R(mde(Re)),P(fde(Re)))}).catch(()=>{pi("event-kind taxonomy unavailable — class filter is exact-id only")}),()=>{ve=!0}},[e,B]);const q=Ome({client:e,deviceIds:B,nameById:C,pageSize:n.pageSize,maxRows:Kue(n),refreshMs:n.refreshMs,maxAgeMs:n.maxAgeMs,channel:Nme(n.serverUrl),devicesResolved:n.deviceIds.length>0||x!==null,...n.showStationary?{includeStationary:!0}:{},excludeSources:n.excludeSources,...n.sinceMs!==void 0?{sinceMs:n.sinceMs}:{},...n.untilMs!==void 0?{untilMs:n.untilMs}:{}}),G=n.searchMode==="semantic"?n.search.trim():"",[ne,V]=T.useState({query:"",rows:[],loading:!1});T.useEffect(()=>{if(G.length===0||B.length===0){V({query:"",rows:[],loading:!1});return}let ve=!1;return V(Re=>({...Re,query:G,loading:!0})),e.searchObjectEvents({text:G,limit:n.semanticLimit,minScore:n.semanticMinScore,...B.length===1&&B[0]!==void 0?{deviceId:B[0]}:{},...n.sinceMs!==void 0?{since:n.sinceMs}:{},...n.untilMs!==void 0?{until:n.untilMs}:{}}).then(Re=>{ve||V({query:G,rows:tme(Re,C),loading:!1})}).catch(Re=>{ve||(pi("searchObjectEvents failed",{error:Re instanceof Error?Re.message:String(Re)}),V({query:G,rows:[],loading:!1}))}),()=>{ve=!0}},[e,G,B,C,n.semanticLimit,n.semanticMinScore,n.sinceMs,n.untilMs]);const U=G.length>0,me=T.useMemo(()=>new Set(n.reviewedTrackIds),[n.reviewedTrackIds]),Me=ve=>me.size===0?[...ve]:ve.map(Re=>me.has(Re.trackId)?{...Re,reviewed:!0}:Re),Ce=T.useMemo(()=>Me(XC(YC(q.rows,C),s)),[q.rows,C,me,s]),Ae=T.useMemo(()=>Me(XC(YC(ne.rows,C),s)),[ne.rows,C,me,s]),Ee=T.useMemo(()=>{const ve={debug:n.filterDebug,train:n.filterTrain,favourited:n.filterFavourited,reviewedTrackIds:n.reviewedTrackIds},Re=KC(Ce,n.classes,n.search,E,n.attrs,ve,n.excludeSources);if(U){const mt=KC(Ae,n.classes,"",E,n.attrs,ve,n.excludeSources);return nme(mt,Re,n.sort)}return OO(Re,n.sort)},[U,Ae,Ce,n.classes,n.attrs,n.filterDebug,n.filterTrain,n.filterFavourited,n.reviewedTrackIds,n.search,n.sort,n.excludeSources,E]),re=CO(n.theme,f),Te=T.useRef(null),[$,ue]=T.useState(null),ke=T.useRef(null),Ie=T.useRef(q.loadMore);Ie.current=q.loadMore;const ge=T.useRef(q.refresh);ge.current=q.refresh;const z=T.useRef(q.reload);z.current=q.reload;const[ae]=T.useState(()=>Xpe(Ba)),de=T.useCallback(ve=>{if(ve.type==="setConfig"){a(Re=>Qy(Re,ve.patch));return}if(ve.type==="setWindow"){a(Re=>Qy(Re,cpe(ve)));return}if(ve.type==="setTrackFlagPatches"){p(ve.patches);return}if(ve.type==="setTrackListMode"){ae.setMode(ve.mode);return}if(ve.type==="refresh"){ge.current().finally(()=>Ba(ipe()));return}if(ve.type==="reload"){z.current();return}if(ve.type==="loadMore"){Ie.current();return}if(ve.type==="ping"){Ba(npe());return}Te.current?.scrollTo({top:0,left:0,behavior:"smooth"})},[ae]);T.useEffect(()=>(window.__camstackEvents={setConfig:ve=>{const Re=Sc({type:"setConfig",patch:ve});Re!==null&&de(Re)},setWindow:ve=>{const Re=Sc({type:"setWindow",...ve});Re!==null&&de(Re)},setTrackFlagPatches:ve=>{const Re=Sc({type:"setTrackFlagPatches",patches:ve});Re!==null&&de(Re)},setTrackListMode:ve=>{const Re=Sc({type:"setTrackListMode",mode:ve});Re!==null&&de(Re)},refresh:()=>de({type:"refresh"}),reload:()=>de({type:"reload"}),loadMore:()=>de({type:"loadMore"}),scrollToTop:()=>de({type:"scrollToTop"}),ping:()=>de({type:"ping"})},bu(ve=>{const Re=Sc(ve);Re!==null&&de(Re)})),[de]),T.useEffect(()=>{Ba(Yde(n.view))},[]),T.useEffect(()=>{Ba(U?tA(ne.rows.length,Ee.length,!1,"semantic"):tA(q.rows.length,Ee.length,q.hasMore,"feed"))},[q.rows.length,Ee.length,q.hasMore,U,ne.rows.length]),T.useEffect(()=>{ae.report(Ee)},[ae,Ee]),T.useEffect(()=>{if(q.error!==null&&!U){Ba(Pp("error",q.error));return}if(U?ne.loading:q.loading){Ba(Pp("loading"));return}Ba(Pp(Ee.length===0?"empty":"ready"))},[q.loading,q.error,Ee.length,U,ne.loading]),T.useEffect(()=>{const ve=window.matchMedia?.("(prefers-color-scheme: dark)");if(!ve)return;const Re=mt=>m(mt.matches);return ve.addEventListener("change",Re),()=>ve.removeEventListener("change",Re)},[]),T.useEffect(()=>{document.documentElement.style.colorScheme=re.colorScheme,document.body.style.background=re.background},[re]),T.useEffect(()=>{const ve="camstack-events-keyframes";if(document.getElementById(ve)!==null)return;const Re=document.createElement("style");Re.id=ve,Re.textContent="@keyframes camstack-spin{to{transform:rotate(360deg)}}",document.head.appendChild(Re)},[]),T.useEffect(()=>{const ve=setInterval(()=>c(Date.now()),6e4);return()=>clearInterval(ve)},[]);const[Se,J]=T.useState(0);T.useEffect(()=>{const ve=$;if(ve===null)return;const Re=()=>{const qt=n.view==="reel"?ve.clientWidth:ve.clientHeight;J(Bn=>Bn===qt?Bn:qt)};if(Re(),typeof ResizeObserver!="function")return;const mt=new ResizeObserver(Re);return mt.observe(ve),()=>mt.disconnect()},[$,n.view]);const he=q.rows.length,De=he>0;T.useEffect(()=>{const ve=Te.current,Re=ke.current;if(!ve||!Re||U||!De)return;const mt=Hme(n.view==="reel"?ve.clientWidth:ve.clientHeight),qt=new IntersectionObserver(Bn=>{Bn.some(Zr=>Zr.isIntersecting)&&Ie.current()},{root:ve,rootMargin:`${mt}px`});return qt.observe(Re),()=>qt.disconnect()},[n.view,q.hasMore,U,De,Se]);const se=T.useRef(0),be=T.useRef(0);T.useEffect(()=>{if(U||q.loading||q.loadingMore||!q.hasMore)return;const ve=Te.current;if(!ve||he===0)return;const Re=n.view==="reel";if((Re?ve.clientWidth:ve.clientHeight)===0)return;if(Re?ve.scrollWidth>ve.clientWidth+1:ve.scrollHeight>ve.clientHeight+1){se.current=0,be.current=he;return}he>be.current&&(se.current=0,be.current=he),!(se.current>=$me)&&(se.current+=1,Ie.current())},[Ee.length,he,q.loading,q.loadingMore,q.hasMore,U,n.view]);const Qe=Ume({root:$,enabled:Bme(n.view,U,n.nativePullToRefresh),onRefresh:()=>{ge.current()}}),ct=T.useRef(null);T.useEffect(()=>{const ve=$;if(!n.nativePullToRefresh||ve===null){ct.current=null;return}const Re=()=>{const mt=n.view==="gallery"&&!U&&ve.scrollTop<=0;ct.current!==mt&&(ct.current=mt,Ba(ape(mt)))};return Re(),ve.addEventListener("scroll",Re,{passive:!0}),()=>ve.removeEventListener("scroll",Re)},[$,n.nativePullToRefresh,n.view,U]);const Je=_0(n.thumbSize),et=ide(n.thumbSize),$e=ede(n.thumbSize,window.devicePixelRatio||1),we=n.view==="reel",[Ve,lt]=T.useState(!1),[dt,Tt]=T.useState({scrollLeft:0,scrollTop:0,viewportWidth:0,viewportHeight:0});T.useEffect(()=>{const ve=$;if(ve===null)return;let Re=null;const mt=()=>{Tt({scrollLeft:ve.scrollLeft,scrollTop:ve.scrollTop,viewportWidth:ve.clientWidth,viewportHeight:ve.clientHeight})},qt=()=>{mt(),lt(!0),Re!==null&&clearTimeout(Re),Re=setTimeout(()=>lt(!1),jme)};return mt(),ve.addEventListener("scroll",qt,{passive:!0}),window.addEventListener("resize",mt),()=>{ve.removeEventListener("scroll",qt),window.removeEventListener("resize",mt),Re!==null&&clearTimeout(Re)}},[$]);const ot=T.useMemo(()=>rme({viewportWidth:dt.viewportWidth,cardWidth:Je,gap:Ps,columns:n.columns}),[dt.viewportWidth,Je,n.columns]),mn=we?0:Math.ceil(Ee.length/ot.columns),Jt=mme({rowCount:mn,scrollTop:dt.scrollTop,viewportHeight:dt.viewportHeight,fallbackRowPx:ot.rowStridePx,geometryKey:`${ot.columns}|${Je}|${n.fields.sublabel?"s":""}${n.fields.camera?"c":""}${n.fields.time?"t":""}${n.fields.badges?"b":""}`}),Ln=T.useMemo(()=>we?ame(Ee,{scrollLeft:dt.scrollLeft,viewportWidth:dt.viewportWidth,cardWidth:Je,gap:Ps,rowsPerColumn:n.rows}):pme(Ee,Jt.window,ot.columns),[we,Ee,dt.scrollLeft,dt.viewportWidth,Je,n.rows,Jt.window,ot.columns]),en=T.useMemo(()=>Ln.map(ve=>kO(n.serverUrl,ve.trackId,$e)),[Ln,n.serverUrl,$e]);Dme({urls:en,token:n.token,paused:Ve,enabled:!q.loading&&Ee.length>0});const $n=T.useCallback((ve,Re)=>{Ba(Jde({trackId:ve.trackId,deviceId:ve.deviceId,bestEventId:ve.bestEventId,className:ve.className,firstSeen:ve.firstSeen,lastSeen:ve.lastSeen,...Re===void 0?{}:{intent:Re}}))},[]),fa=T.useCallback(ve=>$n(ve),[$n]),Ia=T.useCallback(ve=>$n(ve,"assign-face"),[$n]),Jn=we?{display:"grid",gridTemplateRows:`repeat(${n.rows}, ${et}px)`,gridAutoFlow:"column",gridAutoColumns:`${Je}px`,gap:Ps,alignContent:"start"}:{display:"grid",gridTemplateColumns:`repeat(${ot.columns}, minmax(0, 1fr))`,columnGap:Ps,rowGap:Ps,paddingBottom:Ps,alignContent:"start"},We=U?ne.loading:q.loading,Tn=!U&&q.loadingMore&&he>0,qn=!U&&q.error!==null,Ta=!U&&!q.loadingMore&&he>0,vi=Ta&&qn,An=Ta&&!qn&&q.tail==="exhausted",ha=Ta&&!qn&&q.tail==="ceiling",Nn=qn&&Ee.length===0,Uo=!We&&!qn&&!q.loadingMore&&Ee.length===0,Gr=Uo&&he>0,Ji=(ve,Re)=>v.jsx(Ope,{row:ve,eagerImages:!we&&Re<8,serverUrl:n.serverUrl,token:n.token,thumbPx:$e,width:we?`${Je}px`:"100%",heroPx:Je,variant:we?"reel":"gallery",iconId:hde(ve.className,_,EO(ve)),kindLabels:D,labels:L,scrollRoot:$,fields:n.fields,showAdminFlags:n.showAdminFlags===!0,palette:re,nowMs:h,onClick:fa,onAssignFace:Ia},ve.trackId),Qt=v.jsxs(v.Fragment,{children:[Tn&&v.jsx("div",{"data-testid":"tail-loading","aria-label":L.loadingMore,style:{width:we?Je:"100%",height:we?et:void 0,aspectRatio:we?void 0:"1 / 1",borderRadius:10,background:re.skeleton,border:`1px solid ${re.border}`,boxSizing:"border-box",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx("span",{style:{width:14,height:14,borderRadius:999,border:`2px solid ${re.chip}`,borderTopColor:re.textMuted,animation:"camstack-spin 700ms linear infinite"}})}),An&&v.jsx("div",{"data-testid":"tail-end",style:{...DO(we,Je),color:re.textMuted,fontSize:11,opacity:.75},children:Ns(n,"end")}),ha&&v.jsx("button",{type:"button","data-testid":"tail-more",onClick:()=>q.loadOlder(),style:fA(we,Je,re),children:Ns(n,"loadOlder")}),vi&&v.jsx("button",{type:"button","data-testid":"tail-error",onClick:()=>q.retry(),style:{...fA(we,Je,re),color:"#f87171"},children:Ns(n,"retry")}),v.jsx("div",{ref:ke,style:{width:1,height:1,gridRow:we?1:"auto"},"aria-hidden":!0})]});return v.jsxs("div",{ref:ve=>{Te.current=ve,ue(Re=>Re===ve?Re:ve)},"data-testid":"events-scroller",className:we?"events-reel-scroller":void 0,style:{position:"fixed",inset:0,background:re.background,color:re.text,fontFamily:"system-ui, -apple-system, sans-serif",overflowX:we?"auto":"hidden",overflowY:we?"hidden":"auto",padding:we?`${ade}px ${mA}px`:mA,boxSizing:"border-box",WebkitOverflowScrolling:"touch"},children:[Qe.distance>0&&v.jsx("div",{"data-testid":"pull-indicator","data-armed":Qe.armed?"true":"false","aria-hidden":!0,style:{position:"absolute",top:Math.max(0,Qe.distance-28),left:0,right:0,display:"flex",justifyContent:"center",pointerEvents:"none",zIndex:2,opacity:Math.min(1,Qe.distance/jO)},children:v.jsx("span",{style:{width:22,height:22,borderRadius:999,border:`2px solid ${re.chip}`,borderTopColor:re.textMuted,background:re.card,boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transform:`rotate(${Qe.distance*4}deg)`,animation:q.loadingMore?"camstack-spin 700ms linear infinite":void 0}})}),Nn&&v.jsxs("div",{"data-testid":"state-error",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",color:"#f87171",fontSize:13,padding:16,textAlign:"center"},children:[v.jsx("span",{children:Ns(n,"error")}),v.jsx("button",{type:"button","data-testid":"state-retry",onClick:()=>q.retry(),style:{marginTop:10,font:"inherit",fontSize:12,color:re.text,background:re.card,border:`1px solid ${re.border}`,borderRadius:8,padding:"5px 14px",cursor:"pointer"},children:Ns(n,"retry")})]}),Uo&&v.jsx("div",{"data-testid":Gr?"state-empty-filtered":"state-empty",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:re.textMuted,fontSize:13,padding:"0 24px",textAlign:"center"},children:Ns(n,Gr?"emptyFiltered":"empty")}),We&&Ee.length===0&&v.jsx("div",{"data-testid":"state-loading",style:Jn,children:Array.from({length:we?8:12},(ve,Re)=>v.jsx("div",{style:{width:we?Je:"100%",height:we?et:void 0,aspectRatio:we?void 0:"1 / 1",borderRadius:10,background:re.skeleton,border:`1px solid ${re.border}`,boxSizing:"border-box",opacity:.6}},`skeleton-${Re}`))}),we?v.jsxs("div",{style:Jn,children:[Ee.map(Ji),Qt]}):v.jsxs("div",{"data-testid":"events-gallery",children:[v.jsx("div",{"data-testid":"gallery-pad-top",style:{height:Jt.window.padTopPx},"aria-hidden":!0}),Array.from({length:Jt.window.endRow-Jt.window.startRow},(ve,Re)=>{const mt=Jt.window.startRow+Re,qt=mt*ot.columns;return v.jsx("div",{"data-row-index":mt,ref:Jt.measureRow(mt),style:Jn,children:Ee.slice(qt,qt+ot.columns).map((Bn,Zr)=>Ji(Bn,qt+Zr))},mt)}),v.jsx("div",{"data-testid":"gallery-pad-bottom",style:{height:Jt.window.padBottomPx},"aria-hidden":!0}),Qt]})]})}function Vme(){const e=Pm("events",()=>window.__CAMSTACK_EVENTS__,xO,Mme,{urlFirst:!0}),t=T.useMemo(()=>Cme(),[]),n=T.useMemo(()=>e===null?null:Ame(e,t),[e,t]),a=T.useMemo(()=>{if(n===null||!n.ok)return null;const p=wm({serverUrl:n.config.serverUrl,token:n.config.token});return{system:p,client:Ppe(p)}},[n]);T.useEffect(()=>{if(a)return()=>a.system.close()},[a]);const s=CO(n!==null&&n.ok?n.config.theme:"auto",window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0);return n===null?null:n.ok?a?v.jsx(Qme,{client:a.client,initialConfig:n.config}):v.jsx(hA,{message:"Failed to initialise the events embed",palette:s}):v.jsx(hA,{message:n.error,palette:s})}const lm={play:"Play",pause:"Pause",listen:"Listen",mute:"Mute",talk:"Talk",stopTalk:"Stop talk",ptz:"PTZ",linkedDevices:"Linked devices",viewOptions:"View options",moreActions:"More actions",open:"Open",removeFromView:"Remove from view",resizeWidth:"Resize width",resizeHeight:"Resize height",noActiveCameras:"No active cameras",camera:"Camera"},Gme=Object.keys(lm),Zme=Y(o(),o()).optional();function Wme(e){if(e===null||typeof e!="object")return lm;const t=e,n={...lm};for(const a of Gme){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return n}const zO=N(["auto","high","mid","low"]).catch("auto"),Kme=Ye([Q("auto"),l().int().min(1)]),LO=d({enabled:A(),motion:A(),motionHoldSec:l().optional(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),vv=N(["off","top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"]),Yme=d({motionBoxes:A().optional(),motionBadge:vv.optional(),audioMeter:vv.optional(),occupancy:vv.optional(),stats:A().optional()}),Xme=d({cw:l(),ch:l()}),Jme=d({serverUrl:o().min(1),token:o().min(1).optional(),devices:w(l().int().nonnegative()).min(1),layout:Kme,quality:zO,showName:A(),showBadges:A(),muted:A(),paused:A(),highlight:LO.optional(),activeOnly:A().optional(),showBoxes:A().optional(),audioOnIds:w(l().int().nonnegative()).optional(),pausedIds:w(l().int().nonnegative()).optional(),snapshots:Y(o(),o()).optional(),ptzIds:w(l().int().nonnegative()).optional(),overlays:Y(o(),Yme).optional(),editable:A().optional(),cellPanels:A().optional(),spans:Y(o(),Xme).optional(),labels:Zme}).superRefine(dO);function qO(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jme.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}const efe=1,BO=N(["auto","high","mid","low"]),tfe=Ye([Q("auto"),l().int().min(1)]),UO=d({enabled:A(),motion:A(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),nfe=d({devices:w(l().int().nonnegative()).min(1),layout:tfe,quality:BO,showName:A(),audioOnIds:w(l().int().nonnegative()).optional(),activeOnly:A().optional(),boxes:A().optional(),highlight:UO.optional()}),afe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function ife(e){let t="",n=0;for(;n<e.length;){const a=e[n];if(a===void 0)return null;let s,p;if(a<128)s=a,p=0;else if((a&224)===192)s=a&31,p=1;else if((a&240)===224)s=a&15,p=2;else if((a&248)===240)s=a&7,p=3;else return null;for(let f=1;f<=p;f++){const m=e[n+f];if(m===void 0||(m&192)!==128)return null;s=s<<6|m&63}n+=p+1,t+=String.fromCodePoint(s)}return t}function rfe(e){if(e.length%4===1)return null;const t=[];for(const s of e){const p=afe.indexOf(s);if(p<0)return null;t.push(p)}const n=[];for(let s=0;s<t.length;s+=4){const p=t[s],f=t[s+1];if(p===void 0||f===void 0)return null;const m=t[s+2],h=t[s+3];n.push(p<<2|f>>4),m!==void 0&&n.push((f&15)<<4|m>>2),h!==void 0&&m!==void 0&&n.push((m&3)<<6|h)}const a=ife(n);if(a===null)return null;try{return JSON.parse(a)}catch{return null}}function j0(e,t){return e.startsWith(t)?e.slice(t.length):e}function FO(e){const n=new URLSearchParams(j0(e,"#")).get("t");return n!==null&&n.length>0?n:null}function ofe(e,t){return new URLSearchParams(j0(e,"?")).has("v")||FO(t)!==null}function gA(e){if(e.length===0)return null;const t=[];for(const n of e.split(",")){if(!/^\d+$/.test(n))return null;t.push(Number(n))}return t}function Wa(e){return{ok:!1,error:e}}function sfe(e,t){const n=new URLSearchParams(j0(e,"?")),a=n.get("mode");if(a!==null&&a!=="grid")return Wa(`unsupported mode "${a}"`);const s=n.get("v");if(s===null)return Wa("missing share-link version (v)");if(s!==String(efe))return Wa(`unsupported share-link version "${s}"`);const p=n.get("devices"),f=p===null?null:gA(p);if(f===null||f.length===0)return Wa("invalid or missing devices list");const m=n.get("layout");let h;if(m===null||m==="auto")h="auto";else if(/^\d+$/.test(m)&&Number(m)>=1)h=Number(m);else return Wa(`invalid layout "${m}"`);const c=n.get("q")??"auto",x=BO.safeParse(c),M=x.success?x.data:"auto",C=n.get("names")??"0";if(C!=="0"&&C!=="1")return Wa(`invalid names flag "${C}"`);const E=n.get("audio");let R;if(E!==null){const V=gA(E);if(V===null)return Wa(`invalid audio list "${E}"`);R=V}const _=n.get("activeOnly");if(_!==null&&_!=="0"&&_!=="1")return Wa(`invalid activeOnly flag "${_}"`);const P=_==="1",D=n.get("boxes");if(D!==null&&D!=="0"&&D!=="1")return Wa(`invalid boxes flag "${D}"`);const L=D==="1",B=n.get("hl");let q;if(B!==null){const V=rfe(B),U=UO.safeParse(V);if(V===null||!U.success)return Wa("invalid highlight config (hl)");q=U.data}const G={devices:[...f],layout:h,quality:M,showName:C==="1",...R!==void 0&&R.length>0?{audioOnIds:[...R]}:{},...P?{activeOnly:!0}:{},...L?{boxes:!0}:{},...q!==void 0?{highlight:q}:{}},ne=nfe.safeParse(G);return ne.success?{ok:!0,params:ne.data,token:FO(t)}:Wa(ne.error.issues.map(V=>`${V.path.join(".")||"(root)"}: ${V.message}`).join("; "))}function lfe(e,t,n){if(!ofe(e,t))return null;const a=sfe(e,t);if(!a.ok)return{ok:!1,error:a.error};if(a.token===null)return{ok:!1,error:"share token missing — the link must end with #t=<token>"};const s=a.params,p={serverUrl:n,token:a.token,devices:[...s.devices],layout:s.layout,quality:s.quality,showName:s.showName,showBadges:!0,muted:!0,paused:!1,...s.highlight!==void 0?{highlight:s.highlight}:{},...s.activeOnly===!0?{activeOnly:!0}:{},...s.boxes===!0?{showBoxes:!0}:{},...s.audioOnIds!==void 0&&s.audioOnIds.length>0?{audioOnIds:[...s.audioOnIds]}:{}};return qO(p)}function cfe(){const e=lfe(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}const cm=16/9,vA={cols:0,rows:0,cellW:0,cellH:0,wallW:0,wallH:0};function yA(e,t,n,a,s){const p=Math.min(a/e,s/t*cm),f=p/cm;return{cols:e,rows:t,cellW:p,cellH:f,wallW:Math.min(e,n)*p,wallH:t*f,empty:e*t-n}}function bA(e){return{cols:e.cols,rows:e.rows,cellW:e.cellW,cellH:e.cellH,wallW:e.wallW,wallH:e.wallH}}const SA=1e-9;function ufe(e,t){const n=e.cellW*e.cellH,a=t.cellW*t.cellH,s=Math.max(n,a,1);return n-a>s*SA?!0:a-n>s*SA?!1:e.empty!==t.empty?e.empty<t.empty:e.rows<t.rows}function dfe(e,t,n,a){if(e<=0||t<=0||n<=0)return vA;if(typeof a=="number"&&a>=1){const p=Math.floor(a);return bA(yA(p,Math.ceil(e/p),e,t,n))}let s=null;for(let p=1;p<=e;p++){const f=Math.ceil(e/p);if(Math.ceil(e/f)!==p)continue;const m=yA(f,p,e,t,n);(s===null||ufe(m,s))&&(s=m)}return s===null?vA:bA(s)}function pfe(e,t){if(e.length===0)return[];const n=t>=1?Math.floor(t):e.length,a=[];for(let s=0;s<e.length;s+=n)a.push(e.slice(s,s+n));return a}function mfe(e,t){if(e.length===0||t.cellW<=0||t.cellH<=0)return[];const n=[];return pfe(e,t.cols).forEach((s,p)=>{const f=(t.wallW-s.length*t.cellW)/2;s.forEach((m,h)=>{n.push({deviceId:m,x:f+h*t.cellW,y:p*t.cellH,w:t.cellW,h:t.cellH})})}),n}const xA={wallW:0,wallH:0,placements:[]};function ffe(e,t){const n=e!==void 0&&Number.isFinite(e.cw)?Math.round(e.cw):1,a=e!==void 0&&Number.isFinite(e.ch)?Math.round(e.ch):1;return{cw:Math.min(Math.max(n,1),Math.max(t,1)),ch:Math.max(a,1)}}function hfe(e){if(e===void 0)return!1;for(const t of Object.keys(e)){const n=e[t];if(n!==void 0&&(n.cw!==1||n.ch!==1))return!0}return!1}function gfe(e,t,n){const a=new Set,s=[];let p=0;const f=(m,h,c,x)=>{for(let M=m;M<m+x;M++)for(let C=h;C<h+c;C++)if(a.has(`${M}:${C}`))return!1;return!0};for(const m of e){const{cw:h,ch:c}=ffe(t[String(m)],n),x=p+c+e.length;let M=!1;for(let C=0;C<=x&&!M;C++)for(let E=0;E+h<=n;E++)if(f(C,E,h,c)){for(let R=C;R<C+c;R++)for(let _=E;_<E+h;_++)a.add(`${R}:${_}`);s.push({deviceId:m,col:E,row:C,cw:h,ch:c}),p=Math.max(p,C+c),M=!0;break}}return{cells:s,rows:p,cols:n}}function vfe(e,t,n,a,s){const p=dfe(e.length,t,n,a);if(!hfe(s)||p.cols<=0)return{wallW:p.wallW,wallH:p.wallH,placements:mfe(e,p)};if(e.length===0||t<=0||n<=0)return xA;const f=gfe(e,s??{},p.cols);if(f.rows<=0)return xA;const m=Math.min(t/f.cols,n/f.rows*cm),h=m/cm;return{wallW:f.cells.reduce((x,M)=>Math.max(x,M.col+M.cw),0)*m,wallH:f.rows*h,placements:f.cells.map(x=>({deviceId:x.deviceId,x:x.col*m,y:x.row*h,w:x.cw*m,h:x.ch*h}))}}function HO(){const[e,t]=T.useState(null),[n,a]=T.useState("idle"),s=T.useRef(null),p=T.useRef(null),f=T.useRef(null),m=T.useRef(0),h=T.useRef(null),c=pae(),x=mae(),M=fae(),C=T.useRef({start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync});C.current={start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync};const E=T.useCallback(()=>{if(s.current){try{s.current.close()}catch{}s.current=null}if(p.current){for(const D of p.current.getTracks())try{D.stop()}catch{}p.current=null}},[]),R=T.useCallback(async()=>{const D=f.current;if(f.current=null,E(),D)try{await C.current.stop({deviceId:D.deviceId,sessionId:D.sessionId})}catch{}},[E]),_=T.useCallback(async D=>{if(h.current===D){m.current+=1,h.current=null,t(null),a("idle"),await R();return}m.current+=1;const L=m.current;h.current=D,t(D),a("starting");let B;try{B=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{L===m.current&&(h.current=null,t(null),a("error"));return}if(L!==m.current){for(const G of B.getTracks())G.stop();return}if(await R(),L!==m.current){for(const G of B.getTracks())G.stop();return}let q=null;try{p.current=B;const G=await C.current.start({deviceId:D});if(L!==m.current){try{await C.current.stop({deviceId:D,sessionId:G.sessionId})}catch{}E();return}f.current={deviceId:D,sessionId:G.sessionId},q=new RTCPeerConnection,s.current=q,q.oniceconnectionstatechange=()=>{if(L!==m.current||!q)return;const V=q.iceConnectionState;V==="connected"||V==="completed"?a("talking"):(V==="failed"||V==="closed"||V==="disconnected")&&(h.current=null,t(null),a("idle"),R())};for(const V of B.getAudioTracks())q.addTrack(V,B);await q.setRemoteDescription({type:"offer",sdp:G.sdpOffer});const ne=await q.createAnswer();if(await q.setLocalDescription(ne),L!==m.current)return;await C.current.answer({deviceId:D,sessionId:G.sessionId,sdpAnswer:q.localDescription?.sdp??ne.sdp??""})}catch{if(q)try{q.close()}catch{}E();const G=f.current;if(f.current=null,G)try{await C.current.stop({deviceId:G.deviceId,sessionId:G.sessionId})}catch{}L===m.current&&(h.current=null,t(null),a("error"))}},[R,E]),P=T.useCallback(D=>{if(D===null){m.current+=1,h.current=null,t(null),a("idle"),R();return}h.current!==D&&_(D)},[R,_]);return T.useEffect(()=>()=>{m.current+=1,R()},[R]),{activeMicId:e,micState:n,toggleMic:D=>{_(D)},setActiveMic:P}}const yfe=6e3,bfe=500;function Sfe(e,t){const n=T.useRef(new Map),[,a]=T.useState(0),s=t?.motion??!1,p=t?.audio??"off",f=t?.audioDb??-30,m=t?.audioHoldSec??5,h=t?.detection??!1,c=t?.detectionHoldSec??3,x=t?.detectionClasses??[],M=(R,_)=>{n.current.set(R,Date.now()+_),a(P=>P+1)};mi(Ze.MotionOnMotionChanged,R=>{if(!s)return;const _=R.data;_&&_.detected&&M(_.deviceId,yfe)}),mi(Ze.PipelineAudioInferenceResult,R=>{if(p==="off")return;const _=R.data;if(!_)return;(p==="sensor"?_.frame.detections.length>0:(_.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=f)&&M(_.deviceId,m*1e3)}),mi(Ze.DetectionResult,R=>{if(!h)return;const _=R.data;if(!_)return;_.frame.detections.some(D=>x.length===0||x.includes(D.macroClass))&&M(_.frame.deviceId,c*1e3)}),T.useEffect(()=>{const R=setInterval(()=>a(_=>_+1),bfe);return()=>clearInterval(R)},[]);const C=Date.now(),E=new Set;for(const R of e){const _=n.current.get(R);_!==void 0&&C<_&&E.add(R)}return E}function xfe(e){return{type:"tileOpen",deviceId:e}}function kfe(e){return{type:"audioToggle",deviceId:e}}function wfe(e){return{type:"pauseToggle",deviceId:e}}function Mfe(e){return{type:"ptzOpen",deviceId:e}}function Cfe(e,t){return{type:"cellPanelOpen",deviceId:e,panel:t}}function Afe(e){return{type:"tileRemove",deviceId:e}}function Efe(e,t,n){return{type:"tileResize",deviceId:e,cw:t,ch:n}}function $O(e,t,n){return{type:"state",state:e,...t!==void 0?{message:t}:{},...n!==void 0?{commands:n}:{}}}function Rfe(e){return{type:"layout",tiles:e}}function ui(e){rn(e)}const Ife=["top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"];function kA(e){return typeof e=="string"&&Ife.includes(e)}const Tfe={"top-left":{top:8,left:8},"top-center":{top:8,left:0,right:0,justifyContent:"center"},"top-right":{top:8,right:8},"left-center":{left:8,top:0,bottom:0,alignItems:"center"},"right-center":{right:8,top:0,bottom:0,alignItems:"center"},"bottom-left":{bottom:8,left:8},"bottom-center":{bottom:8,left:0,right:0,justifyContent:"center"},"bottom-right":{bottom:8,right:8}};function QO(e){return{position:"absolute",display:"flex",...Tfe[e]}}const VO=[-60,-53,-46,-39,-32,-24],_fe=VO.length,yv=["#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444"];function Nfe(e){const t=Math.min(Math.max(0,e),yv.length-1);return yv[t]??yv[0]}function Ofe(e){if(e===null||!Number.isFinite(e))return 0;let t=0;for(const n of VO)e>=n&&(t+=1);return t}function Pfe(e){if(e==="off")return null;const t=e.split("-"),n=t.includes("top")?"top":t.includes("bottom")?"bottom":"center",a=t.includes("left")?"left":t.includes("right")?"right":"center";return n!=="center"&&a!=="center"?"compact":a==="center"?"horizontal":"vertical"}const wA=[8,11,14,17,21,26],bv={horizontal:{width:8,height:16},vertical:{width:24,height:7},compactWidth:4};function jfe(e,t){if(e==="vertical")return bv.vertical;if(e==="horizontal")return bv.horizontal;const n=wA[t]??wA[0];return{width:bv.compactWidth,height:n}}function Dfe(e){const t=Array.from({length:_fe},(n,a)=>a);return e==="vertical"?[...t].reverse():t}function Co(e){return typeof e=="object"&&e!==null}function zfe(e){if(!Co(e))return[];if(e.detected!==!0)return[];const t=typeof e.frameWidth=="number"?e.frameWidth:0,n=typeof e.frameHeight=="number"?e.frameHeight:0;if(t<=0||n<=0)return[];const a=e.regions;if(!Array.isArray(a))return[];const s=[];for(const p of a){if(!Co(p)||!Co(p.bbox))continue;const{x:f,y:m,w:h,h:c}=p.bbox;typeof f!="number"||typeof m!="number"||typeof h!="number"||typeof c!="number"||!(h>0)||!(c>0)||s.push({x:f/t,y:m/n,w:h/t,h:c/n,pixelCount:typeof p.pixelCount=="number"?p.pixelCount:0})}return s}function Lfe(e){return!Number.isFinite(e)||e<=0?.08:Math.min(.28,.08+e/4e3*.28)}function MA(e){if(!Co(e))return[];const t=Co(e.frame)?e.frame.byClass:void 0,n=Co(t)?t:e.byClass;if(!Co(n))return[];const a=[];for(const[s,p]of Object.entries(n))typeof p!="number"||!Number.isFinite(p)||p<=0||a.push({className:s,count:Math.round(p)});return a.sort((s,p)=>p.count-s.count||s.className.localeCompare(p.className))}function qfe(e,t,n){if(n<=0)return 0;const a=t-e;return a<=0?0:Math.round(a*1e3/n)}function Bfe(e){if(e===null)return"—";const t=[e.resolution,`${e.fps}fps`];return e.dropped>0&&t.push(`${e.dropped} dropped`),t.join(" · ")}const Ufe=1200,Ffe=1e3;function Hfe({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return mi(Ze.MotionAnalysis,s=>{const p=s.data;!p||p.deviceId!==e||(n(zfe(p)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),Ufe))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>v.jsx("div",{style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,border:"1px dashed #f59e0b",borderRadius:2,background:`rgba(245,158,11,${Lfe(s.pixelCount)})`}},`${s.x}:${s.y}:${s.w}:${s.h}:${p}`))})}function $fe({deviceId:e,anchor:t}){const[n,a]=T.useState(null);mi(Ze.PipelineAudioInferenceResult,h=>{const c=h.data;!c||c.deviceId!==e||a(c.frame.level?.dbfs??null)});const s=Ofe(n),p=Pfe(t);if(p===null)return null;const f=p==="horizontal",m=p==="vertical";return v.jsx("div",{style:{...QO(t),pointerEvents:"none"},children:v.jsx("span",{style:{display:"flex",flexDirection:m?"column":"row",alignItems:m||f?"center":"flex-end",gap:m||f?4:3,padding:f||m?"4px 8px":"3px 6px",borderRadius:8,background:"rgba(0,0,0,0.7)"},children:Dfe(p).map(h=>{const c=h<s,x=jfe(p,h);return v.jsx("span",{style:{width:x.width,height:x.height,borderRadius:2,background:c?Nfe(h):"#71717a",opacity:c?1:.35}},h)})})})}function Qfe(e,t){if(typeof e!="object"||e===null)return null;const n=Reflect.get(e,"zoneAnalytics");if(typeof n!="object"||n===null)return null;const a=Reflect.get(n,"getCurrentSnapshot");if(typeof a!="object"||a===null)return null;const s=Reflect.get(a,"query");if(typeof s!="function")return null;const p=s.call(a,{deviceId:t});return p instanceof Promise?p:Promise.resolve(p)}function Vfe({system:e,deviceId:t,anchor:n}){const[a,s]=T.useState([]);return T.useEffect(()=>{let p=!1;const f=Qfe(e.trpcClient,t);if(f!==null)return f.then(m=>{p||s(MA(m))}).catch(()=>{p||s([])}),()=>{p=!0}},[e,t]),mi(Ze.ZoneAnalyticsOccupancyChanged,p=>{const f=p.data;f.deviceId===t&&s(MA(f))}),a.length===0?null:v.jsx("div",{style:{...QO(n),gap:4,pointerEvents:"none"},children:a.slice(0,4).map(p=>v.jsx("span",{style:{padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.75)",color:"#fafaf9",fontSize:11,fontWeight:700,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap"},children:`${p.className} ${p.count}`},p.className))})}function Gfe({containerRef:e}){const[t,n]=T.useState(null),a=T.useRef(null);return T.useEffect(()=>{const s=()=>{const f=e.current?.querySelector("video");if(!f){n(null);return}const m=typeof f.getVideoPlaybackQuality=="function"?f.getVideoPlaybackQuality():null,h=m?.totalVideoFrames??0,c=Date.now(),x=a.current;a.current={frames:h,at:c},n({resolution:f.videoWidth>0?`${f.videoWidth}x${f.videoHeight}`:"—",fps:x===null?0:qfe(x.frames,h,c-x.at),dropped:m?.droppedVideoFrames??0})};s();const p=setInterval(s,Ffe);return()=>{clearInterval(p),a.current=null}},[e]),v.jsx("div",{style:{position:"absolute",top:4,right:4,maxWidth:"90%",padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.7)",color:"#fafaf9",fontSize:10,fontWeight:600,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},children:Bfe(t)})}const Zfe=1e4,CA=1e3,AA=[0,5e3,15e3,3e4],Wfe=4;function Kfe(e){const t=Math.max(0,Math.min(e,AA.length-1));return AA[t]??0}function Yfe(e){return!e.playing||e.lastFrameAt===null?!1:e.nowMs-e.lastFrameAt>=e.stallMs}function Xfe(e){const{containerRef:t,playing:n,onRecover:a,stallMs:s=Zfe}=e,p=e.now??Date.now,[f,m]=T.useState({recovering:!1,attempts:0}),h=T.useRef(null),c=T.useRef(0),x=T.useRef(0),M=T.useRef(a);M.current=a;const C=T.useRef(p);C.current=p;const E=T.useCallback(()=>{const R=C.current(),_=h.current;h.current=R,c.current>0&&_!==null&&R-_<s&&(c.current=0,m({recovering:!1,attempts:0}))},[s]);return T.useEffect(()=>{if(!n){h.current=null;return}const _=t.current?.querySelector("video");if(!_)return;let P=!1,D=null;if(typeof _.requestVideoFrameCallback=="function"){const q=()=>{P||(E(),D=_.requestVideoFrameCallback?.(q)??null)};return D=_.requestVideoFrameCallback(q),()=>{P=!0,D!==null&&_.cancelVideoFrameCallback?.(D)}}let L=_.currentTime;const B=setInterval(()=>{if(P)return;const q=_.currentTime;q!==L&&(L=q,E())},CA);return()=>{P=!0,clearInterval(B)}},[n,t,E]),T.useEffect(()=>{if(!n)return;const R=setInterval(()=>{const _=C.current();if(_<x.current||!Yfe({lastFrameAt:h.current,nowMs:_,stallMs:s,playing:n})||c.current>=Wfe)return;const P=c.current;c.current=P+1,h.current=_,x.current=_+Kfe(P+1)+s,m({recovering:!0,attempts:P+1}),M.current()},CA);return()=>clearInterval(R)},[n,s]),f}const Jfe=300,ehe=130,the=["devices","viewOptions"],nhe={inline:the,overflow:!1},ahe={inline:[],overflow:!0};function ihe(e,t){return e>=Jfe&&t>=ehe?nhe:ahe}const rhe=120,ohe=68;function she(e,t,n){return e&&t>=rhe&&n>=ohe}const lhe=16/9,che={left:0,top:0,width:0,height:0},EA=.5;function uhe(e,t,n){if(!(e>0)||!(t>0))return che;const a={left:0,top:0,width:e,height:t};if(!Number.isFinite(n))return a;const s=Math.min(e,t*n),p=s/n;return e-s<EA&&t-p<EA?a:{left:(e-s)/2,top:(t-p)/2,width:s,height:p}}const dhe=500;function GO(e,t,n){const{motion:a,detection:s}=vue(e.trpcClient,t),p=T.useRef(0),f=T.useRef(0),m=T.useRef(0),h=T.useRef(!1),[,c]=T.useState(0),x=n?.audio??"off",M=n?.audioDb??-30,C=n?.audioHoldSec??5,E=n?.motionHoldSec??0,R=n?.detectionHoldSec??3,_=n?.detectionClasses??[],P=_.join(",");mi(Ze.MotionOnMotionChanged,B=>{const q=B.data;!q||q.deviceId!==t||!n?.motion||(q.detected===!0?(m.current=Date.now()+Math.max(1,E)*1e3,h.current=!0,c(G=>G+1)):q.detected===!1&&h.current&&(m.current=Date.now()+E*1e3,h.current=!1,c(G=>G+1)))}),mi(Ze.PipelineAudioInferenceResult,B=>{const q=B.data;if(!q||q.deviceId!==t||x==="off")return;(x==="sensor"?q.frame.detections.length>0:(q.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=M)&&(p.current=Date.now()+C*1e3,c(ne=>ne+1))}),T.useEffect(()=>{if(!s)return;s.detections.some(q=>_.length===0||_.includes(q.macroClass))&&(f.current=Date.now()+R*1e3,c(q=>q+1))},[s,R,P]),T.useEffect(()=>{const B=a!==null;(B||h.current)&&(m.current=Date.now()+E*1e3,B||c(q=>q+1)),h.current=B},[a,E]);const D=n?.enabled===!0;if(T.useEffect(()=>{if(!D)return;const B=setInterval(()=>c(q=>q+1),dhe);return()=>clearInterval(B)},[D]),!n?.enabled)return null;const L=Date.now();return n.detection&&L<f.current?"detection":x!=="off"&&L<p.current?"audio":n.motion&&(a!==null||L<m.current)?"motion":null}const Ks={motion:"#DC2626",audio:"#3B82F6",detection:"#22C55E"},phe=2500,mhe={person:"#f59e0b",vehicle:"#3b82f6",animal:"#22c55e",face:"#a855f7",plate:"#ec4899"},fhe="#ef4444";function hhe(e){return mhe[e]??fhe}function np(e){return e<0?0:e>1?1:e}function ghe(e){if(e.width<=0||e.height<=0)return[];const t=[];for(const n of e.detections){const{bbox:a}=n,s=np(a.x/e.width),p=np(a.y/e.height),f=np((a.x+a.width)/e.width),m=np((a.y+a.height)/e.height);f<=s||m<=p||t.push({label:n.macroClass,score:n.score,x1:s,y1:p,x2:f,y2:m})}return t}function vhe({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return mi(Ze.DetectionResult,s=>{const p=s.data;!p||p.frame.deviceId!==e||(n(ghe(p.frame)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),phe))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current),n([])},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>{const f=hhe(s.label),m=Math.round(s.score*100);return v.jsx("div",{style:{position:"absolute",left:`${s.x1*100}%`,top:`${s.y1*100}%`,width:`${(s.x2-s.x1)*100}%`,height:`${(s.y2-s.y1)*100}%`,border:`2px solid ${f}`,borderRadius:3},children:v.jsx("span",{style:{position:"absolute",left:-2,bottom:"100%",background:f,color:"#fff",fontSize:10,fontWeight:700,fontFamily:"system-ui, sans-serif",lineHeight:"14px",padding:"0 4px",borderRadius:3,whiteSpace:"nowrap"},children:`${s.label} ${m}%`})},`${s.label}-${p}`)})})}function yhe(e,t,n,a){const s=Number.isFinite(e)&&e>0?e:0,p=Number.isFinite(t)&&t>0?t:0;if(!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)return{width:s,height:p};const f=Math.min(s/n,p/a);return{width:n*f,height:a*f}}function bhe(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function RA(e,t,n,a){if(!Number.isFinite(e))return 0;const s=bhe(t,n,a);return Math.max(-s,Math.min(s,e))}const She=4,IA=8,xhe=300;function TA(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function _A(e){return e>1?"none":"pan-y"}function khe({children:e,onTap:t}){const n=T.useRef(null),a=T.useRef(null),s=T.useRef(new Map),p=T.useRef(1),f=T.useRef(0),m=T.useRef(0),h=T.useRef(null),c=T.useRef(null),x=T.useRef(0),M=()=>{const D=a.current;D&&(D.style.transform=`translate(${f.current}px, ${m.current}px) scale(${p.current})`);const L=n.current;L&&(L.style.touchAction=_A(p.current))},C=()=>{const D=n.current?.getBoundingClientRect();if(!D||D.width<=0||D.height<=0)return;const L=a.current?.querySelector("video")??null,B=L?null:a.current?.querySelector("img")??null,q=L?.videoWidth??B?.naturalWidth??0,G=L?.videoHeight??B?.naturalHeight??0,ne=yhe(D.width,D.height,q,G);f.current=RA(f.current,D.width,ne.width,p.current),m.current=RA(m.current,D.height,ne.height,p.current)},E=()=>{p.current=1,f.current=0,m.current=0,M()},R=D=>{try{D.currentTarget.setPointerCapture(D.pointerId)}catch{}if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size===2){const L=[...s.current.values()],B=L[0],q=L[1];B&&q&&(h.current={dist:TA(B,q),scale:p.current,cx:(B.x+q.x)/2,cy:(B.y+q.y)/2,tx:f.current,ty:m.current}),c.current=null}else s.current.size===1&&(c.current={x:D.clientX,y:D.clientY,tx:f.current,ty:m.current,moved:!1})},_=D=>{if(!s.current.has(D.pointerId))return;if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size>=2&&h.current){const B=[...s.current.values()],q=B[0],G=B[1];if(!q||!G)return;const ne=TA(q,G);h.current.dist>0&&(p.current=Math.max(1,Math.min(She,h.current.scale*(ne/h.current.dist))));const V=(q.x+G.x)/2,U=(q.y+G.y)/2;f.current=h.current.tx+(V-h.current.cx),m.current=h.current.ty+(U-h.current.cy),C(),M();return}const L=c.current;if(s.current.size===1&&L){const B=D.clientX-L.x,q=D.clientY-L.y;(Math.abs(B)>IA||Math.abs(q)>IA)&&(L.moved=!0),p.current>1&&(f.current=L.tx+B,m.current=L.ty+q,C(),M())}},P=D=>{const L=s.current.size===1,B=c.current;if(s.current.delete(D.pointerId),s.current.size<2&&(h.current=null),s.current.size===0&&(c.current=null,L&&B&&!B.moved)){const q=Date.now();q-x.current<xhe?(x.current=0,E()):(x.current=q,t())}};return v.jsx("div",{ref:n,style:{position:"absolute",inset:0,overflow:"hidden",touchAction:_A(1)},onPointerDown:R,onPointerMove:_,onPointerUp:P,onPointerCancel:P,children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%",transformOrigin:"center center",willChange:"transform"},children:e})})}function whe(e,t){if(t==null||t.length===0)return null;if(/^https?:\/\//i.test(t))return t;const n=e.replace(/\/+$/,""),a=t.startsWith("/")?t:`/${t}`;return`${n}${a}`}function Mhe(e,t){const n=t[0];return n===void 0?null:whe(e,n.url)}function Che(e,t){return{handleOffer:(n,a,s)=>e(t,n,a,s),reoffer:(n,a,s,p)=>e(s,a,n,p)}}const Ahe=3500;function Ehe(e){return e==="auto"?{kind:"adaptive"}:{kind:"profile",profile:e}}function Rhe({system:e,deviceId:t,name:n,online:a,quality:s,muted:p,paused:f,showName:m,audioActive:h,micActive:c,onTogglePause:x,onToggleAudio:M,onToggleMic:C,onOpen:E,ptzSupported:R,onPtz:_,cellW:P,cellH:D,onCellPanel:L,highlight:B,showBoxes:q,overlay:G,reconnectSignal:ne,onStall:V,posterUrl:U,labels:me=lm,editable:Me,span:Ce,onRemove:Ae,onResize:Ee}){const{handleOffer:re,getIceServers:Te,addIceCandidate:$,getIceCandidates:ue,closeSession:ke,getSessionState:Ie}=sO(e.trpcClient,t),ge=GO(e,t,B),z=T.useRef(null),[ae,de]=T.useState(0),[Se,J]=T.useState("idle"),he=Xfe({containerRef:z,playing:Se==="playing"&&!f,onRecover:()=>{de(We=>We+1),V?.(t)}}),[De,se]=T.useState(void 0);T.useEffect(()=>{if(U||f)return;let We=!1;const Tn=P!==void 0&&P>0?Math.round(P):void 0;return e.trpcClient.snapshot.getSnapshotLinks.query({targets:[{deviceId:t,...Tn!==void 0?{width:Tn}:{}}]}).then(qn=>{if(We)return;const Ta=Mhe(e.serverUrl,qn??[]);Ta!==null&&se(Ta)}).catch(()=>{}),()=>{We=!0}},[U,f,e,t,P]);const be=U??De,Qe=T.useMemo(()=>Ehe(s),[s]),ct=`grid:${t}:${s}`,Je=T.useMemo(()=>Che(re,Qe),[re,Qe]),[et,$e]=T.useState(!1),we=T.useRef(null),Ve=()=>{we.current&&clearTimeout(we.current),we.current=setTimeout(()=>$e(!1),Ahe)},lt=()=>{$e(!0),Ve()},dt=()=>{$e(We=>{const Tn=!We;return Tn&&Ve(),Tn})},Tt=ihe(P??0,D??0),ot=We=>{We.stopPropagation(),lt()},mn=P!==void 0&&D!==void 0&&P>0&&D>0,Jt=uhe(P??0,D??0,lhe),Ln=mn?{position:"absolute",left:Jt.left,top:Jt.top,width:Jt.width,height:Jt.height}:{position:"absolute",inset:0},en=Math.max(1,Math.round(Ce?.cw??1)),$n=Math.max(1,Math.round(Ce?.ch??1)),fa=mn&&P!==void 0?P/en:0,Ia=mn&&D!==void 0?D/$n:0,Jn=she(Me===!0,P??0,D??0);return T.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]),v.jsxs("div",{ref:z,"data-stall-recovering":he.recovering?"true":void 0,style:{position:"relative",width:"100%",height:"100%",background:"#000"},children:[v.jsxs("div",{style:Ln,children:[v.jsx(khe,{onTap:dt,children:f?v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#fafaf9"},children:v.jsx(OA,{size:28})}):v.jsx(YN,{serverUrl:e.serverUrl,streamKey:ct,autoPlay:!0,muted:p,showControls:!1,className:"w-full h-full",handleOffer:Je.handleOffer,reoffer:Je.reoffer,getSessionState:Ie,getIceServers:Te,addIceCandidate:$,getIceCandidates:ue,closeSession:ke,reconnectSignal:(ne??0)+ae,onStateChange:J,posterUrl:be,onClientNetworkSample:s==="auto"?We=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...We}).catch(()=>{})}:void 0},ct)}),q&&!f?v.jsx(vhe,{deviceId:t}):null,G?.motionBoxes===!0&&!f?v.jsx(Hfe,{deviceId:t}):null]}),kA(G?.audioMeter)&&!f?v.jsx($fe,{deviceId:t,anchor:G.audioMeter}):null,kA(G?.occupancy)&&!f?v.jsx(Vfe,{system:e,deviceId:t,anchor:G.occupancy}):null,G?.stats===!0&&!f?v.jsx(Gfe,{containerRef:z}):null,ge&&(()=>{const We=B?.appearance,Tn=ge==="motion"?We?.motionColor??Ks.motion:ge==="audio"?We?.audioColor??Ks.audio:We?.detectionColor??Ks.detection,qn=We?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${qn}px solid ${Tn}`,boxShadow:`inset 0 0 12px ${Tn}`,pointerEvents:"none"}})})(),(m||et)&&v.jsxs("div",{style:{position:"absolute",left:0,right:0,top:0,display:"flex",alignItems:"center",gap:6,padding:"4px 8px",background:"rgba(0,0,0,0.6)",color:"#fafaf9",fontSize:12,fontWeight:600,fontFamily:"system-ui, sans-serif",pointerEvents:"none",opacity:m||et?1:0,transition:"opacity 150ms ease"},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:4,background:a?"#34d399":"#71717a"}}),v.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]}),v.jsxs("div",{style:{position:"absolute",inset:0,opacity:et?1:0,transition:"opacity 150ms ease",pointerEvents:"none"},children:[v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:v.jsx(Ir,{label:f?me.play:me.pause,big:!0,enabled:et,onClick:We=>{ot(We),x(t)},children:f?v.jsx(OA,{size:22}):v.jsx(Ihe,{size:22})})}),v.jsxs("div",{style:{position:"absolute",left:8,bottom:8,display:"flex",gap:8,pointerEvents:"none"},children:[v.jsx(Ir,{label:h?me.mute:me.listen,active:h,enabled:et,onClick:We=>{ot(We),M(t)},children:h?v.jsx(The,{size:18}):v.jsx(_he,{size:18})}),v.jsx(Ir,{label:c?me.stopTalk:me.talk,active:c,enabled:et,onClick:We=>{ot(We),C(t)},children:v.jsx(Nhe,{size:18,muted:!c})}),R&&_&&(!L||!Tt.overflow)?v.jsx(Ir,{label:me.ptz,enabled:et,onClick:We=>{ot(We),_(t)},children:v.jsx(Lhe,{size:18})}):null,L?Tt.inline.map(We=>v.jsx(Ir,{label:We==="devices"?me.linkedDevices:me.viewOptions,enabled:et,onClick:Tn=>{ot(Tn),L(t,We)},children:We==="devices"?v.jsx(Phe,{size:18}):v.jsx(jhe,{size:18})},We)):null,L&&Tt.overflow?v.jsx(Ir,{label:me.moreActions,enabled:et,onClick:We=>{ot(We),L(t,"actions")},children:v.jsx(Dhe,{size:18})}):null]}),v.jsx("div",{style:{position:"absolute",right:8,bottom:8,pointerEvents:"none"},children:v.jsx(Ir,{label:me.open,enabled:et,onClick:We=>{ot(We),E(t)},children:v.jsx(Ohe,{size:18})})}),Jn&&Ae?v.jsx("div",{style:{position:"absolute",right:8,top:8,pointerEvents:"none"},children:v.jsx(Ir,{label:me.removeFromView,enabled:et,onClick:We=>{ot(We),Ae(t)},children:v.jsx(zhe,{size:18})})}):null,Jn&&Ee?v.jsxs(v.Fragment,{children:[v.jsx(NA,{axis:"x",label:me.resizeWidth,enabled:et,track:fa,span:en,onSpan:We=>{lt(),Ee(t,We,$n)}}),v.jsx(NA,{axis:"y",label:me.resizeHeight,enabled:et,track:Ia,span:$n,onSpan:We=>{lt(),Ee(t,en,We)}})]}):null]})]})}function NA({axis:e,label:t,enabled:n,track:a,span:s,onSpan:p}){const f=T.useRef(null),m=h=>e==="x"?h.clientX:h.clientY;return v.jsx("div",{role:"separator","aria-label":t,"aria-orientation":e==="x"?"vertical":"horizontal",onPointerDown:h=>{h.stopPropagation(),h.currentTarget.setPointerCapture(h.pointerId),f.current={origin:m(h),base:s}},onPointerMove:h=>{if(f.current===null||!(a>0))return;h.stopPropagation();const c=Math.round((m(h)-f.current.origin)/a),x=Math.max(1,f.current.base+c);x!==s&&p(x)},onPointerUp:h=>{f.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:()=>{f.current=null},style:{position:"absolute",...e==="x"?{right:0,top:"50%",width:14,height:48,transform:"translateY(-50%)"}:{bottom:0,left:"50%",width:48,height:14,transform:"translateX(-50%)"},borderRadius:7,background:"rgba(0,0,0,0.55)",border:"1px solid rgba(250,250,249,0.35)",cursor:e==="x"?"ew-resize":"ns-resize",touchAction:"none",pointerEvents:n?"auto":"none"}})}function Ir({children:e,label:t,onClick:n,big:a=!1,active:s=!1,enabled:p=!0}){const f=a?52:40;return v.jsx("button",{type:"button","aria-label":t,onClick:n,style:{width:f,height:f,borderRadius:f/2,border:"none",display:"flex",alignItems:"center",justifyContent:"center",background:s?"rgba(59,130,246,0.85)":"rgba(0,0,0,0.55)",color:"#fafaf9",cursor:"pointer",padding:0,WebkitTapHighlightColor:"transparent",pointerEvents:p?"auto":"none"},children:e})}const Vr={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function OA({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",children:v.jsx("polygon",{points:"6 4 20 12 6 20 6 4",fill:"currentColor"})})}function Ihe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[v.jsx("rect",{x:"6",y:"4",width:"4",height:"16",fill:"currentColor"}),v.jsx("rect",{x:"14",y:"4",width:"4",height:"16",fill:"currentColor"})]})}function The({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})}function _he({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),v.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})}function Nhe({size:e,muted:t}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),v.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2M12 19v4"}),t&&v.jsx("line",{x1:"3",y1:"3",x2:"21",y2:"21"})]})}function Ohe({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:v.jsx("path",{d:"M15 3h6v6M21 3l-9 9M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})})}function Phe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5A5.5 5.5 0 1 0 7.5 11.5c.8.8 1.3 1.5 1.5 2.5"}),v.jsx("path",{d:"M9 18h6M10 22h4"})]})}function jhe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"}),v.jsx("circle",{cx:"8",cy:"6",r:"2"}),v.jsx("circle",{cx:"16",cy:"12",r:"2"}),v.jsx("circle",{cx:"10",cy:"18",r:"2"})]})}function Dhe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[v.jsx("circle",{cx:"5",cy:"12",r:"2",fill:"currentColor"}),v.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"}),v.jsx("circle",{cx:"19",cy:"12",r:"2",fill:"currentColor"})]})}function zhe({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:v.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Lhe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Vr,children:[v.jsx("path",{d:"M12 2v20M2 12h20"}),v.jsx("path",{d:"M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3"})]})}function qhe({wall:e,renderTile:t}){return v.jsx("div",{style:{position:"relative",width:e.wallW,height:e.wallH},children:e.placements.map(n=>v.jsx("div",{"data-device-id":n.deviceId,style:{position:"absolute",left:n.x,top:n.y,width:n.w,height:n.h},children:t(n.deviceId,n.w,n.h)},n.deviceId))})}function PA({message:e}){return T.useEffect(()=>ui($O("error",e)),[e]),v.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#000",color:"#f87171",fontFamily:"system-ui, sans-serif",fontSize:13,padding:16,textAlign:"center"},children:["Grid embed config error: ",e]})}const Bhe=["setDevices","setSpans"];function Uhe(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function Fhe({system:e,config:t}){const[n,a]=T.useState(t.devices),[s,p]=T.useState(()=>new Set(t.audioOnIds??[])),f=HO(),m=T.useRef(f.setActiveMic);m.current=f.setActiveMic;const[h,c]=T.useState(()=>new Set(t.pausedIds??[])),[x,M]=T.useState(t.highlight),[C,E]=T.useState(t.activeOnly??!1),[R,_]=T.useState(t.showBoxes??!1),[P,D]=T.useState(()=>t.overlays??{}),[L,B]=T.useState(()=>t.spans??{}),q=Sfe(n,x),G=T.useMemo(()=>C?n.filter(J=>q.has(J)):n,[C,n,q]),[ne,V]=T.useState(t.quality),[U,me]=T.useState(t.layout),[Me,Ce]=T.useState(t.showName),[Ae,Ee]=T.useState(0),re=T.useMemo(()=>Wme(t.labels),[t.labels]),[Te,$]=T.useState(()=>t.snapshots??{}),ue=T.useMemo(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[ke,Ie]=T.useState({w:window.innerWidth,h:window.innerHeight}),ge=re.camera,[z,ae]=T.useState({});T.useEffect(()=>{let J=!1;return e.trpcClient.deviceManager.listAll.query({deviceIds:[...n],projection:"slim"}).then(he=>{if(J)return;const De={};for(const se of he)De[se.id]={name:se.name??`${ge} ${se.id}`,online:se.online??!1};ae(De)}).catch(()=>{}),()=>{J=!0}},[e,n,ge]),T.useEffect(()=>(window.__camstackGrid={setAudioOn:J=>p(new Set(J)),setMutedAll:J=>{J&&p(new Set)},setActiveMic:J=>m.current(J),setHighlight:J=>M(J),setActiveOnly:J=>E(J),setShowBoxes:J=>_(J),setOverlays:J=>D(J),setPaused:J=>c(new Set(J)),setDevices:J=>a(he=>Uhe(he,J)?he:[...J]),setSpans:J=>B(J),setQuality:J=>V(J),setLayout:J=>me(J),setShowName:Ce,setShowBadges:()=>{},setSnapshots:J=>$(J),fit:(J,he)=>Ie({w:J,h:he}),reconnect:()=>Ee(J=>J+1)},ui($O("ready",void 0,Bhe)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),T.useEffect(()=>bu(J=>{const he=window.__camstackGrid;if(!he)return;switch(J.kind){case"setAudioOn":he.setAudioOn(J.value);break;case"setMutedAll":he.setMutedAll(J.value);break;case"setActiveMic":he.setActiveMic(J.value);break;case"setHighlight":he.setHighlight(J.value);break;case"setActiveOnly":he.setActiveOnly(J.value);break;case"setShowBoxes":he.setShowBoxes(J.value===!0);break;case"setOverlays":he.setOverlays(J.value);break;case"setPaused":he.setPaused(J.value);break;case"setDevices":he.setDevices(J.value);break;case"setSpans":he.setSpans(J.value);break;case"setQuality":he.setQuality(zO.parse(J.value));break;case"setLayout":he.setLayout(J.value);break;case"setShowName":he.setShowName(J.value);break;case"setShowBadges":he.setShowBadges(J.value);break;case"setSnapshots":he.setSnapshots(J.value);break;case"fit":he.fit(J.w,J.h);break;case"reconnect":he.reconnect();break}}),[]);const de=T.useMemo(()=>vfe(G,ke.w,ke.h,U,L),[G,ke.w,ke.h,U,L]),Se=T.useRef(null);return T.useEffect(()=>{const J=Se.current;if(!J)return;const he=[];J.querySelectorAll("[data-device-id]").forEach(De=>{const se=Number(De.dataset.deviceId),be=De.getBoundingClientRect();he.push({deviceId:se,rect:{x:be.x,y:be.y,w:be.width,h:be.height}})}),he.length&&ui(Rfe(he))},[de,G]),v.jsxs("div",{ref:Se,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:[C&&G.length===0&&v.jsx("div",{style:{color:"#a1a1aa",fontFamily:"system-ui, sans-serif",fontSize:14,padding:24,textAlign:"center"},children:re.noActiveCameras}),v.jsx(qhe,{wall:de,renderTile:(J,he,De)=>v.jsx(Rhe,{system:e,deviceId:J,name:z[J]?.name??`${re.camera} ${J}`,online:z[J]?.online??!1,quality:ne,muted:!s.has(J),paused:h.has(J),showName:Me,audioActive:s.has(J),micActive:f.activeMicId===J,onTogglePause:se=>ui(wfe(se)),onToggleAudio:se=>ui(kfe(se)),onToggleMic:f.toggleMic,onOpen:se=>ui(xfe(se)),ptzSupported:ue.has(J),onPtz:se=>ui(Mfe(se)),cellW:he,cellH:De,onCellPanel:t.cellPanels===!1?void 0:(se,be)=>ui(Cfe(se,be)),highlight:x,showBoxes:R,overlay:P[String(J)],reconnectSignal:Ae,posterUrl:Te[String(J)],editable:t.editable===!0,span:L[String(J)],onRemove:se=>ui(Afe(se)),onResize:(se,be,Qe)=>ui(Efe(se,be,Qe)),labels:re})})]})}function Hhe(){const e=Pm("grid",()=>window.__CAMSTACK_GRID__,qO,cfe),t=T.useMemo(()=>{if(e===null||!e.ok)return null;const n=wm({serverUrl:e.config.serverUrl,token:e.config.token}),a=new QT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:n,queryClient:a}},[e]);return T.useEffect(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?v.jsx(I_,{system:t.system,children:v.jsx(GT,{client:t.queryClient,children:v.jsx(b.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:v.jsx(Fhe,{system:t.system,config:e.config})})})}):v.jsx(PA,{message:"Failed to initialise the grid embed"}):v.jsx(PA,{message:e.error})}const D0=Ye([d({kind:Q("adaptive")}),d({kind:Q("profile"),profile:on})]),$he=d({deviceId:l().int().nonnegative(),target:D0.optional(),muted:A().optional(),stats:A().optional(),snapshot:o().optional(),atMs:l().int().positive().optional()});function Qhe(e){const t=$he.safeParse(e);return t.success?t.data:null}const Vhe=["live","loading","playing","paused","gap","ended","error"];function Ghe(e){return typeof e=="string"&&Vhe.includes(e)}const bo="low",jA=5e3;class Zhe{constructor(t){this.deps=t,this.deps.channel.addEventListener("message",this.onMessage)}deps;begun=!1;disposed=!1;lastSentProfile=null;degradedRequest=null;positionsSeen=0;firstFrameAnnounced=!1;rvfcHandle=null;lastPushSeq=null;retargets=0;renders=0;acks=0;lastCursorMs=null;lastState=null;playIntentAt=null;playIntentKind=null;playIntentDragId=void 0;pendingUpgrade=null;upgradeTimer=null;upgradeWarmTimer=null;onMessage=t=>{if(this.disposed||typeof t.data!="string")return;let n;try{n=JSON.parse(t.data)}catch{return}if(typeof n!="object"||n===null)return;const a=n;if(a.t==="liveProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")){this.deps.onLiveProfile?.(a.profile);return}if(a.t==="servedProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")&&typeof a.requested=="string"){const s=a.requested;this.lastSentProfile=a.profile,this.degradedRequest=a.profile===s?null:s,this.degradedRequest!==null&&this.pendingUpgrade?.desiredProfile===this.degradedRequest&&(this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:this.degradedRequest}),this.cancelPlaybackUpgrade()),this.deps.onServedProfile?.({profile:a.profile,requested:s});return}if(a.t==="state"&&Ghe(a.state)){this.lastState=a.state,a.state==="playing"||a.state==="paused"?(this.maybeArmPlaybackUpgrade(),this.playIntentAt!==null&&(this.deps.onLog?.("playback:ready",{kind:this.playIntentKind,state:a.state,waitMs:Math.round(performance.now()-this.playIntentAt),dragId:this.playIntentDragId}),this.playIntentAt=null,this.playIntentKind=null,this.playIntentDragId=void 0)):(a.state==="live"||a.state==="gap"||a.state==="ended"||a.state==="error")&&this.cancelPlaybackUpgrade(),this.deps.onState?.(a.state);return}a.t!=="position"||typeof a.epochMs!="number"||(this.lastCursorMs=a.epochMs,this.deps.onPosition?.(a.epochMs),typeof a.seq=="number"&&(this.lastPushSeq=a.seq),this.begun&&(this.positionsSeen+=1,this.rvfcCapable()||(this.acks+=1,this.sendAck())))};sendAck(){this.send(this.lastPushSeq===null?{t:"scrubAck"}:{t:"scrubAck",seq:this.lastPushSeq})}rvfcCapable(){return typeof this.deps.video()?.requestVideoFrameCallback=="function"}send(t){return this.disposed||this.deps.channel.readyState!=="open"?!1:(this.deps.channel.send(JSON.stringify(t)),!0)}sendPlayRecorded(t,n,a,s,p){const f=this.send({t:"playRecorded",deviceId:t,epoch:n,profile:a});return f&&(this.lastSentProfile=a,this.playIntentAt=performance.now(),this.playIntentKind=s,this.playIntentDragId=p,this.deps.onLog?.("playback:intent",{kind:s,deviceId:t,epochMs:n,profile:a,dragId:p})),f}maybeArmPlaybackUpgrade(){if(this.pendingUpgrade===null||this.upgradeTimer!==null||this.disposed)return;this.upgradeTimer=setTimeout(()=>this.firePlaybackUpgrade(),jA);const t=this.pendingUpgrade;this.upgradeWarmTimer=setTimeout(()=>{if(this.upgradeWarmTimer=null,this.pendingUpgrade===null||this.disposed)return;const n=this.lastCursorMs??t.landEpochMs;this.warm(n,t.desiredProfile)},Math.max(0,jA-1500))}firePlaybackUpgrade(){this.upgradeTimer=null;const t=this.pendingUpgrade;if(this.pendingUpgrade=null,!t||this.disposed)return;const n=this.lastCursorMs??t.landEpochMs;this.sendPlayRecorded(t.deviceId,n,t.desiredProfile,"upgrade"),this.deps.onLog?.("scrub:playback-upgrade",{from:bo,to:t.desiredProfile,epochMs:n})}cancelPlaybackUpgrade(){this.upgradeTimer!==null&&(clearTimeout(this.upgradeTimer),this.upgradeTimer=null),this.upgradeWarmTimer!==null&&(clearTimeout(this.upgradeWarmTimer),this.upgradeWarmTimer=null),this.pendingUpgrade=null}playRecorded(t,n,a){return this.cancelPlaybackUpgrade(),this.sendPlayRecorded(t,n,a,"play")}upgradePlayback(t,n,a){return a===this.lastSentProfile?!0:(this.cancelPlaybackUpgrade(),this.warm(n,a),this.sendPlayRecorded(t,n,a,"upgrade"))}landFromScrub(t,n,a,s){return this.end(),this.cancelPlaybackUpgrade(),this.sendPlayRecorded(t,n,bo,"land",s)?(this.lastCursorMs=n,a===this.degradedRequest?this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:a,epochMs:n}):a!==bo&&(this.pendingUpgrade={deviceId:t,desiredProfile:a,landEpochMs:n},this.warm(n,a),(this.lastState==="playing"||this.lastState==="paused")&&this.maybeArmPlaybackUpgrade()),!0):!1}seek(t){this.cancelPlaybackUpgrade();const n=this.send({t:"seek",epoch:t});return n&&(this.playIntentAt=performance.now(),this.playIntentKind="seek",this.playIntentDragId=void 0,this.deps.onLog?.("playback:intent",{kind:"seek",epochMs:t})),n}warm(t,n=bo){return this.send({t:"warm",epoch:t,profile:n})}setRate(t){return this.send({t:"setRate",rate:t})}stepFrame(t){return this.send({t:"stepFrame",dir:t})}commit(t,n){return this.end(),this.send(n!==void 0?{t:"scrubCommit",epoch:t,dragId:n}:{t:"scrubCommit",epoch:t})}goLive(){this.cancelPlaybackUpgrade();const t=this.send({t:"goLive"});return t&&this.deps.onLog?.("scrub:push-golive",{}),this.end(),t}isActive(){return this.begun&&!this.disposed&&this.deps.channel.readyState==="open"}isOpen(){return!this.disposed&&this.deps.channel.readyState==="open"}begin(t){return this.disposed||this.deps.channel.readyState!=="open"?!1:(this.begun||(this.begun=!0,this.positionsSeen=0,this.firstFrameAnnounced=!1,this.retargets=0,this.renders=0,this.acks=0,this.cancelPlaybackUpgrade(),this.lastSentProfile!==bo&&(this.lastSentProfile=bo,this.send({t:"setProfile",profile:bo})),this.send(t!==void 0?{t:"scrubStart",dragId:t}:{t:"scrubStart"}),this.armRenderAck(),this.deps.onLog?.("scrub:push-begin",{rvfc:this.rvfcCapable(),dragId:t})),!0)}retarget(t,n){this.isActive()&&(this.retargets+=1,this.send(n?{t:"scrubTo",epoch:t,m:n.mode,v:Math.round(n.velocityPxPerS)}:{t:"scrubTo",epoch:t}))}end(){this.begun&&this.deps.onLog?.("scrub:push-drag-end",{retargets:this.retargets,positions:this.positionsSeen,renders:this.renders,acks:this.acks}),this.begun=!1,this.cancelRenderAck()}dispose(){this.cancelPlaybackUpgrade(),this.end(),this.disposed=!0,this.deps.channel.removeEventListener("message",this.onMessage)}armRenderAck(){const t=this.deps.video();t?.requestVideoFrameCallback&&(this.rvfcHandle=t.requestVideoFrameCallback(()=>{this.rvfcHandle=null,!(!this.begun||this.disposed)&&(this.positionsSeen>0&&(this.renders+=1,this.acks+=1,this.sendAck(),this.firstFrameAnnounced||(this.firstFrameAnnounced=!0,this.deps.onFirstFrame?.()),this.deps.onLog?.("scrub:drawn",{depth:"push"})),this.armRenderAck())}))}cancelRenderAck(){this.rvfcHandle!==null&&(this.deps.video()?.cancelVideoFrameCallback?.(this.rvfcHandle),this.rvfcHandle=null)}}function Whe(e,t,n,a){return e?.isOpen()?(e.warm(n),e.playRecorded(t,n,a)):!1}const Khe=24e4;function Yhe(e,t=Khe){if(t<=0)return[e];const n=[];for(let a=0;a<e.length;a+=t)n.push(e.slice(a,a+t));return n.length===0?[""]:n}const Xhe=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus"],DA=["video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp8","video/webm"];function Jhe(e=n=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(n),t){const n=t?.audio?[...Xhe,...DA]:DA;for(const a of n)try{if(e(a))return a}catch{}return""}function ege(e,t){const n=[...e.getVideoTracks()],a=t?.getAudioTracks()??[],s=a.length>0?a.map(p=>{const f=p.clone();return"enabled"in f&&(f.enabled=!0),f}):[...e.getAudioTracks()];return[...n,...s]}function tge(e,t=30){const n=e;try{if(typeof n.captureStream=="function"){const a=n.captureStream(t);if(a.getVideoTracks().length>0)return a}}catch{}try{if(typeof n.mozCaptureStream=="function"){const a=n.mozCaptureStream(t);if(a.getVideoTracks().length>0)return a}}catch{}return nge(e,t)}function nge(e,t){if(e.videoWidth<2||e.videoHeight<2||typeof document>"u")return null;const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight;const a=n.getContext("2d");if(!a||typeof n.captureStream!="function")return null;let s=!0;const p=()=>{if(s){try{a.drawImage(e,0,0,n.width,n.height)}catch{}requestAnimationFrame(p)}};p();const f=n.captureStream(t),m=f.getVideoTracks()[0];if(m){const h=m.stop.bind(m);m.stop=()=>{s=!1,h()}}return f}function age(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const s=String(a.result??""),p=s.indexOf(",");t(p>=0?s.slice(p+1):s)},a.onerror=()=>n(a.error??new Error("read failed")),a.readAsDataURL(e)})}function ige(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function rge(e){let t=null,n=[],a=null,s="",p=!1;const f=()=>{if(t=null,n=[],p=!1,a){for(const h of a.getTracks())try{h.stop()}catch{}a=null}},m=h=>{f(),e.emit({type:"liveCaptureError",message:h})};return{start(){if(t)return;const h=e.getVideo();if(!h){m("no video");return}if(typeof MediaRecorder>"u"){m("MediaRecorder missing");return}const c=tge(h);if(!c){m("no video");return}const x=h.srcObject instanceof MediaStream?h.srcObject:null,M=ege(c,x);if(x&&x.getAudioTracks().length>0)for(const _ of c.getAudioTracks())try{_.stop()}catch{}const C=new MediaStream(M);a=C;const E=M.some(_=>_.kind==="audio"),R=Jhe(void 0,{audio:E});try{t=R?new MediaRecorder(C,{mimeType:R,videoBitsPerSecond:25e5,...E?{audioBitsPerSecond:128e3}:{}}):new MediaRecorder(C)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing");return}n=[],s=ige(),p=!1,t.ondataavailable=_=>{_.data&&_.data.size>0&&n.push(_.data)},t.onerror=()=>m("MediaRecorder missing");try{t.start(1e3)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing")}},stop(){const h=t;if(!h||p){h||m("no video");return}p=!0;const c=s,x=h.mimeType||"video/mp4";h.onstop=()=>{const M=new Blob(n,{type:x});if(f(),M.size===0){e.emit({type:"liveCaptureError",message:"empty capture"});return}age(M).then(C=>{e.emit({type:"liveCaptureStart",id:c,mime:x});const E=Yhe(C),R=E.length;E.forEach((_,P)=>{e.emit({type:"liveCaptureChunk",id:c,index:P,total:R,data:_})}),e.emit({type:"liveCaptureDone",id:c})}).catch(C=>{e.emit({type:"liveCaptureError",message:C instanceof Error?C.message:"encode failed"})})};try{typeof h.requestData=="function"&&h.requestData(),h.stop()}catch(M){m(M instanceof Error?M.message:"stop failed")}},abort(){if(t&&t.state!=="inactive")try{t.stop()}catch{}f()}}}const oge=8,sge=2.5;function lge(e){return e>=oge?"high":e>=sge?"mid":"low"}function cge(e,t){return e.kind==="profile"?e.profile:"low"}function uge(e,t){return e.kind==="profile"?e.profile:lge(t)}const dge=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),target:D0,muted:A(),stats:A().optional(),highlight:LO.optional(),snapshot:o().optional(),initialSeekMs:l().positive().optional()}),zA=["setDevice","setDevice.atMs"];function tb(e,t){rn(t!==void 0?{type:"state",state:e,message:t,caps:zA}:{type:"state",state:e,caps:zA})}function pge(e){switch(e){case"playing":return"playing";case"error":return"error";case"connecting":case"disconnected":case"idle":return"connecting"}}function LA(e,t){return cge(e)}async function mge(){if(typeof window>"u")return null;const e=window.location.origin.replace(/\/+$/,""),t=new AbortController,n=window.setTimeout(()=>t.abort(),2500),a=performance.now();try{const s=await fetch(`${e}/adaptive-probe`,{signal:t.signal});if(!s.ok)return null;const p=await s.arrayBuffer(),f=Math.max(1,performance.now()-a);return p.byteLength<1024?null:p.byteLength*8/f/1e3}catch{return null}finally{window.clearTimeout(n)}}function qA(e,t,n,a){a.kind==="adaptive"&&mge().then(s=>{if(s===null)return;const p=uge(a,s);e.upgradePlayback(t,n,p)})}function fge(e){return e.kind==="adaptive"?{kind:"adaptive"}:{kind:"profile",profile:e.profile}}function hge(e){return e.kind==="adaptive"?"embed:adaptive":`embed:profile:${e.profile}`}function gge(e){const t=dge.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function BA({message:e}){return T.useEffect(()=>{tb("error",e)},[e]),v.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#000",color:"#f87171",fontFamily:"system-ui, sans-serif",fontSize:13,padding:16,textAlign:"center"},children:["Embed config error: ",e]})}function vge({system:e,deviceId:t,initialTarget:n,initialMuted:a,initialStats:s,initialHighlight:p,initialSnapshot:f,initialSeekMs:m}){const[h,c]=T.useState(n);T.useEffect(()=>IO(t),[t]);const x=T.useRef(h);x.current=h;const[M,C]=T.useState(a),[E,R]=T.useState(s),[_,P]=T.useState(p),[D,L]=T.useState(f),[B,q]=T.useState(0),[G,ne]=T.useState({w:window.innerWidth,h:window.innerHeight}),V=GO(e,t,_),U=HO(),me=T.useRef(U.setActiveMic);me.current=U.setActiveMic;const{handleOffer:Me,getIceServers:Ce,addIceCandidate:Ae,getIceCandidates:Ee,closeSession:re,getSessionState:Te}=sO(e.trpcClient,t),$=T.useMemo(()=>fge(h),[h]),ue=T.useMemo(()=>(se,be,Qe)=>Me($,se,be,Qe),[Me,$]),ke=T.useMemo(()=>(se,be,Qe,ct)=>Me(Qe,be,se,ct),[Me]),Ie=T.useRef(null),ge=T.useRef(null),z=T.useRef("low"),ae=T.useRef(!1),de=T.useRef(null),Se=T.useRef(null),J=()=>{const se=de.current;if(se===null)return;const be=z.current,Qe=`${se.phase}|${se.viewportWidth??"-"}x${se.viewportHeight??"-"}|${se.devicePixelRatio??"-"}|${se.downlinkMbps??"-"}|${se.prefersTier??"-"}|${se.probeOrigin??"unreachable"}|${be}`;Qe!==Se.current&&(Se.current=Qe,rn({type:"log",scope:"adaptive",msg:"tier decision",data:{deviceId:t,requested:h.kind==="adaptive"?"adaptive":`pinned:${h.kind}`,phase:se.phase,viewportWidth:se.viewportWidth??null,viewportHeight:se.viewportHeight??null,devicePixelRatio:se.devicePixelRatio??null,downlinkMbps:se.downlinkMbps??null,prefersTier:se.prefersTier??null,probeOrigin:se.probeOrigin,liveProfile:be}}))},he=T.useRef(m??null);T.useEffect(()=>{if(!M)return;const se=setInterval(()=>{let be=0;for(const Qe of Array.from(document.querySelectorAll("video"))){Qe.muted||(Qe.muted=!0,be++);const ct=Qe.srcObject;if(ct instanceof MediaStream)for(const Je of ct.getAudioTracks())Je.enabled&&(Je.enabled=!1,be++)}be>0&&rn({type:"log",scope:"live-audio",msg:"re-muted",data:{corrected:be}})},1e3);return()=>clearInterval(se)},[M]),T.useEffect(()=>()=>Ie.current?.dispose(),[]),T.useEffect(()=>{const se=()=>{const we=Ie.current;return we?.isOpen()?we:null},be=()=>LA(x.current,z.current),Qe=(we,Ve)=>{qA(we,t,Ve,x.current)},ct=we=>{ae.current||(ae.current=!0,rn({type:"log",scope:"recorded:session",msg:"pointer move with no open session",data:{what:we}}),rn({type:"recState",state:"error"}))},Je=(we,Ve)=>{const lt=se();return!lt||!Ve(lt)?(ct(we),!1):(ae.current=!1,!0)},et=(we,Ve)=>{Je("scrubCommit",lt=>{const dt=lt.landFromScrub(t,we,be(),Ve);return dt&&Qe(lt,we),dt})},$e=rge({emit:rn,getVideo:()=>ge.current});return window.__camstackEmbed={setMuted:we=>C(we),setTarget:we=>{const Ve=D0.safeParse(we);Ve.success&&c(Ve.data)},setStats:we=>R(we),setHighlight:we=>P(we),setSnapshot:we=>L(we),setMic:we=>me.current(we?t:null),fit:(we,Ve)=>ne({w:we,h:Ve}),reconnect:()=>q(we=>we+1),playRecorded:(we,Ve,lt)=>{Number.isFinite(Ve)&&Je("playRecorded",dt=>dt.playRecorded(we,Ve,lt))},seek:we=>{Number.isFinite(we)&&Je("seek",Ve=>{const lt=Ve.playRecorded(t,we,be());return lt&&Qe(Ve,we),lt})},scrubCommit:(we,Ve)=>{Number.isFinite(we)&&et(we,Ve)},scrubStart:we=>{rn({type:"log",scope:"recorded:scrub",msg:"scrubStart",data:{dragId:we}}),Je("scrubStart",Ve=>Ve.begin(we))},scrubTo:(we,Ve,lt)=>{if(!Number.isFinite(we))return;const dt=(Ve==="fine"||Ve==="coarse")&&Number.isFinite(lt)?{mode:Ve,velocityPxPerS:lt}:void 0;Je("scrubTo",Tt=>Tt.isActive()?(Tt.retarget(we,dt),!0):!1)},timelineWarm:we=>{Number.isFinite(we)&&se()?.warm(we)},scrubEnd:we=>{Number.isFinite(we)&&et(we)},setRate:we=>{Number.isFinite(we)&&Je("setRate",Ve=>Ve.setRate(we))},stepFrame:we=>{we!==1&&we!==-1||Je("stepFrame",Ve=>Ve.stepFrame(we))},goLive:()=>{Je("goLive",we=>we.goLive())&&rn({type:"recState",state:"live"})},startLiveCapture:()=>$e.start(),stopLiveCapture:()=>$e.stop()},()=>{$e.abort(),window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),T.useEffect(()=>{rn({type:"micState",state:U.micState})},[U.micState]),T.useEffect(()=>bu(se=>{const be=window.__camstackEmbed;if(!be)return;switch(se.kind){case"setMuted":be.setMuted(se.value);break;case"setTarget":be.setTarget(se.value);break;case"setStats":be.setStats(se.value);break;case"setHighlight":be.setHighlight(se.value);break;case"setSnapshot":be.setSnapshot(se.value);break;case"setMic":be.setMic(se.value);break;case"fit":be.fit(se.w,se.h);break;case"reconnect":be.reconnect();break;case"playRecorded":be.playRecorded(se.deviceId,se.epochMs,se.profile);break;case"seek":be.seek(se.epochMs??se.value);break;case"scrubCommit":be.scrubCommit(se.epochMs??se.value,se.dragId);break;case"scrubStart":be.scrubStart(se.dragId);break;case"scrubTo":be.scrubTo(se.epochMs??se.value,se.m,se.v);break;case"scrubEnd":be.scrubEnd(se.epochMs??se.value);break;case"timelineWarm":be.timelineWarm(se.epochMs??se.value);break;case"setRate":be.setRate(se.rate??se.value);break;case"stepFrame":{const ct=se.dir;(ct===1||ct===-1)&&be.stepFrame(ct);break}case"goLive":be.goLive();break;case"startLiveCapture":be.startLiveCapture();break;case"stopLiveCapture":be.stopLiveCapture();break}}),[]);const De=hge(h);return v.jsxs("div",{style:{position:"fixed",left:0,top:0,width:G.w,height:G.h,background:"#000"},children:[v.jsx(YN,{serverUrl:e.serverUrl,streamKey:De,autoPlay:!0,muted:M,showControls:!1,showStats:E,onPlaybackStats:se=>rn({type:"log",scope:"playback",msg:"stats",data:se}),onConnectTiming:se=>rn({type:"log",scope:"webrtc-timing",msg:"connect",data:se}),onClientNetworkSample:h.kind==="adaptive"?se=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...se}).catch(()=>{})}:void 0,className:"w-full h-full",onAdaptiveHints:se=>{de.current=se,J()},handleOffer:ue,reoffer:ke,getSessionState:Te,getIceServers:Ce,addIceCandidate:Ae,getIceCandidates:Ee,closeSession:re,reconnectSignal:B,posterUrl:D,onStateChange:se=>tb(pge(se)),onError:se=>tb("error",se),onReconnectAttempt:se=>rn({type:"log",scope:"live:retry",msg:se.kind==="retry"?"auto-retry scheduled":"auto-retry exhausted",data:se}),onControlChannel:se=>{if(Ie.current?.dispose(),ae.current=!1,Ie.current=new Zhe({channel:se,video:()=>ge.current,onState:be=>rn({type:"recState",state:be}),onPosition:be=>rn({type:"position",positionMs:be}),onServedProfile:be=>rn({type:"servedProfile",profile:be.profile,requested:be.requested}),onLiveProfile:be=>{z.current=be,J()},onFirstFrame:()=>rn({type:"scrubDrawn"}),onLog:(be,Qe)=>rn({type:"log",scope:be.startsWith("playback:")?"playback":"scrub",msg:be,data:Qe})}),he.current!==null){const be=()=>{const Qe=he.current;if(Qe===null)return;const ct=LA(x.current,z.current);Whe(Ie.current,t,Qe,ct)&&(he.current=null,Ie.current&&qA(Ie.current,t,Qe,x.current),rn({type:"log",scope:"recorded:initial-seek",msg:"config-carried seek fired",data:{epochMs:Qe,profile:ct}}))};se.readyState==="open"?be():se.addEventListener("open",be,{once:!0})}},onVideoElement:se=>{ge.current=se}}),V&&(()=>{const se=_?.appearance,be=V==="motion"?se?.motionColor??Ks.motion:V==="audio"?se?.audioColor??Ks.audio:se?.detectionColor??Ks.detection,Qe=se?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${Qe}px solid ${be}`,boxShadow:`inset 0 0 12px ${be}`,pointerEvents:"none",transform:"translateZ(0)"}})})()]})}function yge(){const e=Pm("player",()=>window.__CAMSTACK_EMBED__,gge),[t,n]=T.useState(null);T.useEffect(()=>{const c=M=>{const C=Qhe(M);C&&n(C)};window.__camstackEmbedPage={setDevice:c};const x=bu(M=>{M.kind==="setDevice"&&c(M.value)});return()=>{window.__camstackEmbedPage&&delete window.__camstackEmbedPage,x()}},[]);const a=T.useMemo(()=>{if(e===null||!e.ok)return null;const c=wm({serverUrl:e.config.serverUrl,token:e.config.token}),x=new QT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:c,queryClient:x}},[e]);if(T.useEffect(()=>{if(a)return()=>{a.system.close()}},[a]),e===null)return null;if(!e.ok)return v.jsx(BA,{message:e.error});if(!a)return v.jsx(BA,{message:"Failed to initialise the embed player"});const s=t?.deviceId??e.config.deviceId,p=t?.target??e.config.target,f=t?.muted??e.config.muted,m=t?.stats??e.config.stats??!1,h=t!==null?t.snapshot:e.config.snapshot;return v.jsx(I_,{system:a.system,children:v.jsx(GT,{client:a.queryClient,children:v.jsx(b.Provider,{client:a.system.trpcClient,queryClient:a.queryClient,children:v.jsx(vge,{system:a.system,deviceId:s,initialTarget:p,initialMuted:f,initialStats:m,initialHighlight:e.config.highlight,initialSnapshot:h,initialSeekMs:t===null?e.config.initialSeekMs:t.atMs},s)})})})}const bge=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),startMs:l().int().nonnegative().optional()});function Sge(e){if(e==null)return{ok:!1,error:"config is required"};const t=bge.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function xge(e,t){const n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}const UA=360*60*1e3,kge="scrub unavailable: no open RecordedTrackSession";function Ka(e){rn(e)}function vn(e,t,n){try{rn({type:"log",scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??"")}catch{}}function wge({system:e,config:t}){T.useEffect(()=>IO(t.deviceId),[t.deviceId]);const n=T.useRef(null),a=T.useRef(0),s=T.useRef(0),p=T.useRef(0),[f,m]=T.useState({w:window.innerWidth,h:window.innerHeight}),h=T.useMemo(()=>async c=>{const x=n.current;if(!x)return;const M=++p.current;s.current=performance.now(),vn("loadAt","start",{epochMs:c,window:UA}),Ka({type:"state",state:"loading"});try{const C=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:c,toMs:c+UA});if(M!==p.current){vn("loadAt","superseded",{epochMs:c});return}if(vn("loadAt","manifest",{playbackUrl:C?.playbackUrl??null,endpoints:C?.playbackEndpoints?.length??0,localMaster:!!C?.localMasterPath}),!C?.playbackUrl){Ka({type:"state",state:"error",message:"no footage"});return}x.src=C.playbackUrl;const E=()=>{if(M!==p.current)return;const R=typeof x.getStartDate=="function"?x.getStartDate():null,_=R instanceof Date&&!Number.isNaN(R.getTime())?R.getTime():c;a.current=_;const P=xge(c,_);if(P>0)try{x.currentTime=P}catch(D){vn("loadAt","seek-failed",{msg:String(D)})}x.play().catch(D=>{vn("loadAt","play-rejected",{msg:String(D)})}),vn("loadAt","seek",{epochMs:c,media0Ms:_,offsetSec:P})};x.readyState>=HTMLMediaElement.HAVE_METADATA?E():x.addEventListener("loadedmetadata",E,{once:!0}),vn("loadAt","src-set",{src:C.playbackUrl})}catch(C){vn("loadAt","error",{msg:C instanceof Error?C.message:String(C)}),Ka({type:"state",state:"error",message:C instanceof Error?C.message:String(C)})}},[e,t.deviceId]);return T.useEffect(()=>{vn("init","mounted",{deviceId:t.deviceId,startMs:t.startMs??null,ua:navigator.userAgent});const c=(x,M)=>{vn("scrub","unavailable",{command:x,...M===void 0?{}:{epochMs:M}}),Ka({type:"state",state:"error",message:kge})};return window.__camstackRecording={seekTo:x=>{vn("cmd","seekTo",{epochMs:x}),h(x)},play:()=>{vn("cmd","play"),n.current?.play().catch(()=>{})},pause:()=>{vn("cmd","pause"),n.current?.pause()},setRate:x=>{vn("cmd","setRate",{rate:x}),n.current&&(n.current.playbackRate=x)},fit:(x,M)=>{vn("cmd","fit",{w:x,h:M}),m({w:x,h:M})},scrubStart:()=>{vn("cmd","scrubStart"),c("scrubStart")},scrubTo:x=>{vn("cmd","scrubTo",{epochMs:x}),c("scrubTo",x)},scrubEnd:x=>{vn("cmd","scrubEnd",{epochMs:x}),c("scrubEnd",x)}},t.startMs&&t.startMs>0&&h(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording}},[h,t.startMs,t.deviceId]),T.useEffect(()=>bu(c=>{const x=window.__camstackRecording;if(!x)return;switch(c.kind){case"seekTo":x.seekTo(c.value);break;case"play":x.play();break;case"pause":x.pause();break;case"setRate":x.setRate(c.value);break;case"scrubStart":x.scrubStart();break;case"scrubTo":x.scrubTo(c.value);break;case"scrubEnd":x.scrubEnd(c.value);break;case"fit":x.fit(c.w,c.h);break}}),[]),v.jsx("div",{style:{position:"fixed",left:0,top:0,width:f.w,height:f.h,background:"#000"},children:v.jsx("video",{ref:n,playsInline:!0,controls:!1,style:{width:"100%",height:"100%",objectFit:"contain",background:"#000"},onLoadedMetadata:c=>vn("video","loadedmetadata",{w:c.currentTarget.videoWidth,h:c.currentTarget.videoHeight,dur:c.currentTarget.duration}),onPlaying:()=>{vn("video","playing",{vodStartMs:Math.round(performance.now()-s.current)}),Ka({type:"state",state:"playing"})},onPause:()=>Ka({type:"state",state:"paused"}),onEnded:()=>Ka({type:"state",state:"ended"}),onError:c=>{const x=c.currentTarget.error;vn("video","error",{code:x?.code??null,message:x?.message??null}),Ka({type:"state",state:"error",message:x?.message||"video error"})},onTimeUpdate:c=>Ka({type:"position",positionMs:a.current+c.currentTarget.currentTime*1e3})})})}function Mge(){const e=Pm("recording",()=>window.__CAMSTACK_RECORDING__,Sge),t=T.useMemo(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,wm({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return T.useEffect(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?v.jsx(wge,{system:t,config:e.config}):(Ka({type:"state",state:"error",message:"init failed"}),null):(Ka({type:"state",state:"error",message:e.error}),null)}function Cge(){const e=window.__CAMSTACK_EMBED_MODE__??new URLSearchParams(location.search).get("mode")??new URLSearchParams(location.hash.replace(/^#/,"")).get("mode")??"grid";return e==="player"?v.jsx(yge,{}):e==="recording"?v.jsx(Mge,{}):e==="events"?v.jsx(Vme,{}):v.jsx(Hhe,{})}const FA=document.getElementById("root");FA&&lj.createRoot(FA).render(v.jsx(Cge,{}));export{one as C,hne as E,h_ as I,Oge as M,Lne as R,hu as S,Fge as T,Pge as W,dae as a,$ge as b,W as c,Jne as d,To as e,Hge as f,Uge as g,Bge as h,jge as i,v as j,Lge as k,$g as l,nb as m,aj as n,JP as o,wn as p,T as r,qge as s,vu as u,Ap as v};