@camstack/addon-pipeline-orchestrator 1.2.135 → 1.2.136

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.
@@ -1,115 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-DNdnFHso-B_fslMFv.js","./MaskShapeCanvas-DI4BY7W2-FBlH4Wq_.js","./PrivacyMaskSettings-DNSLc6ww-CD2tFrNb.js","./SceneMonitorEditor-d_A4kO-M-BsQK-gmH.js"])))=>i.map(i=>d[i]);
2
- function fj(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 m=Object.getOwnPropertyDescriptor(a,s);m&&Object.defineProperty(e,s,m.get?m:{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 m of s)if(m.type==="childList")for(const f of m.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function n(s){const m={};return s.integrity&&(m.integrity=s.integrity),s.referrerPolicy&&(m.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?m.credentials="include":s.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function a(s){if(s.ep)return;s.ep=!0;const m=n(s);fetch(s.href,m)}})();function hj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eh={exports:{}},Kl={};var ek;function gj(){if(ek)return Kl;ek=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,m){var f=null;if(m!==void 0&&(f=""+m),s.key!==void 0&&(f=""+s.key),"key"in s){m={};for(var p in s)p!=="key"&&(m[p]=s[p])}else m=s;return s=m.ref,{$$typeof:e,type:a,key:f,ref:s!==void 0?s:null,props:m}}return Kl.Fragment=t,Kl.jsx=n,Kl.jsxs=n,Kl}var tk;function vj(){return tk||(tk=1,Eh.exports=gj()),Eh.exports}var v=vj(),Rh={exports:{}},Wl={},_h={exports:{}},Ih={};var nk;function yj(){return nk||(nk=1,(function(e){function t(Q,me){var xe=Q.length;Q.push(me);e:for(;0<xe;){var Ce=xe-1>>>1,re=Q[Ce];if(0<s(re,me))Q[Ce]=me,Q[xe]=re,xe=Ce;else break e}}function n(Q){return Q.length===0?null:Q[0]}function a(Q){if(Q.length===0)return null;var me=Q[0],xe=Q.pop();if(xe!==me){Q[0]=xe;e:for(var Ce=0,re=Q.length,B=re>>>1;Ce<B;){var ae=2*(Ce+1)-1,pe=Q[ae],ge=ae+1,H=Q[ge];if(0>s(pe,xe))ge<re&&0>s(H,pe)?(Q[Ce]=H,Q[ge]=xe,Ce=ge):(Q[Ce]=pe,Q[ae]=xe,Ce=ae);else if(ge<re&&0>s(H,xe))Q[Ce]=H,Q[ge]=xe,Ce=ge;else break e}}return me}function s(Q,me){var xe=Q.sortIndex-me.sortIndex;return xe!==0?xe:Q.id-me.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;e.unstable_now=function(){return m.now()}}else{var f=Date,p=f.now();e.unstable_now=function(){return f.now()-p}}var h=[],u=[],S=1,w=null,C=3,E=!1,R=!1,T=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function L(Q){for(var me=n(u);me!==null;){if(me.callback===null)a(u);else if(me.startTime<=Q)a(u),me.sortIndex=me.expirationTime,t(h,me);else break;me=n(u)}}function K(Q){if(T=!1,L(Q),!R)if(n(h)!==null)R=!0,J||(J=!0,Me());else{var me=n(u);me!==null&&Re(K,me.startTime-Q)}}var J=!1,$=-1,F=5,ue=-1;function we(){return j?!0:!(e.unstable_now()-ue<F)}function Ee(){if(j=!1,J){var Q=e.unstable_now();ue=Q;var me=!0;try{e:{R=!1,T&&(T=!1,z($),$=-1),E=!0;var xe=C;try{t:{for(L(Q),w=n(h);w!==null&&!(w.expirationTime>Q&&we());){var Ce=w.callback;if(typeof Ce=="function"){w.callback=null,C=w.priorityLevel;var re=Ce(w.expirationTime<=Q);if(Q=e.unstable_now(),typeof re=="function"){w.callback=re,L(Q),me=!0;break t}w===n(h)&&a(h),L(Q)}else a(h);w=n(h)}if(w!==null)me=!0;else{var B=n(u);B!==null&&Re(K,B.startTime-Q),me=!1}}break e}finally{w=null,C=xe,E=!1}me=void 0}}finally{me?Me():J=!1}}}var Me;if(typeof q=="function")Me=function(){q(Ee)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Se=ce.port2;ce.port1.onmessage=Ee,Me=function(){Se.postMessage(null)}}else Me=function(){D(Ee,0)};function Re(Q,me){$=D(function(){Q(e.unstable_now())},me)}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(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(Q){switch(C){case 1:case 2:case 3:var me=3;break;default:me=C}var xe=C;C=me;try{return Q()}finally{C=xe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(Q,me){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var xe=C;C=Q;try{return me()}finally{C=xe}},e.unstable_scheduleCallback=function(Q,me,xe){var Ce=e.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?Ce+xe:Ce):xe=Ce,Q){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=xe+re,Q={id:S++,callback:me,priorityLevel:Q,startTime:xe,expirationTime:re,sortIndex:-1},xe>Ce?(Q.sortIndex=xe,t(u,Q),n(h)===null&&Q===n(u)&&(T?(z($),$=-1):T=!0,Re(K,xe-Ce))):(Q.sortIndex=re,t(h,Q),R||E||(R=!0,J||(J=!0,Me()))),Q},e.unstable_shouldYield=we,e.unstable_wrapCallback=function(Q){var me=C;return function(){var xe=C;C=me;try{return Q.apply(this,arguments)}finally{C=xe}}}})(Ih)),Ih}var ak;function bj(){return ak||(ak=1,_h.exports=yj()),_h.exports}var Th={exports:{}},et={};var ik;function Sj(){if(ik)return et;ik=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"),m=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),C=Symbol.iterator;function E(B){return B===null||typeof B!="object"?null:(B=C&&B[C]||B["@@iterator"],typeof B=="function"?B:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function D(B,ae,pe){this.props=B,this.context=ae,this.refs=j,this.updater=pe||R}D.prototype.isReactComponent={},D.prototype.setState=function(B,ae){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,ae,"setState")},D.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function z(){}z.prototype=D.prototype;function q(B,ae,pe){this.props=B,this.context=ae,this.refs=j,this.updater=pe||R}var L=q.prototype=new z;L.constructor=q,T(L,D.prototype),L.isPureReactComponent=!0;var K=Array.isArray;function J(){}var $={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ue(B,ae,pe){var ge=pe.ref;return{$$typeof:e,type:B,key:ae,ref:ge!==void 0?ge:null,props:pe}}function we(B,ae){return ue(B.type,ae,B.props)}function Ee(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Me(B){var ae={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(pe){return ae[pe]})}var ce=/\/+/g;function Se(B,ae){return typeof B=="object"&&B!==null&&B.key!=null?Me(""+B.key):ae.toString(36)}function Re(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(J,J):(B.status="pending",B.then(function(ae){B.status==="pending"&&(B.status="fulfilled",B.value=ae)},function(ae){B.status==="pending"&&(B.status="rejected",B.reason=ae)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function Q(B,ae,pe,ge,H){var ee=typeof B;(ee==="undefined"||ee==="boolean")&&(B=null);var Te=!1;if(B===null)Te=!0;else switch(ee){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(B.$$typeof){case e:case t:Te=!0;break;case S:return Te=B._init,Q(Te(B._payload),ae,pe,ge,H)}}if(Te)return H=H(B),Te=ge===""?"."+Se(B,0):ge,K(H)?(pe="",Te!=null&&(pe=Te.replace(ce,"$&/")+"/"),Q(H,ae,pe,"",function(vt){return vt})):H!=null&&(Ee(H)&&(H=we(H,pe+(H.key==null||B&&B.key===H.key?"":(""+H.key).replace(ce,"$&/")+"/")+Te)),ae.push(H)),1;Te=0;var ke=ge===""?".":ge+":";if(K(B))for(var Ie=0;Ie<B.length;Ie++)ge=B[Ie],ee=ke+Se(ge,Ie),Te+=Q(ge,ae,pe,ee,H);else if(Ie=E(B),typeof Ie=="function")for(B=Ie.call(B),Ie=0;!(ge=B.next()).done;)ge=ge.value,ee=ke+Se(ge,Ie++),Te+=Q(ge,ae,pe,ee,H);else if(ee==="object"){if(typeof B.then=="function")return Q(Re(B),ae,pe,ge,H);throw ae=String(B),Error("Objects are not valid as a React child (found: "+(ae==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":ae)+"). If you meant to render a collection of children, use an array instead.")}return Te}function me(B,ae,pe){if(B==null)return B;var ge=[],H=0;return Q(B,ge,"","",function(ee){return ae.call(pe,ee,H++)}),ge}function xe(B){if(B._status===-1){var ae=B._result;ae=ae(),ae.then(function(pe){(B._status===0||B._status===-1)&&(B._status=1,B._result=pe)},function(pe){(B._status===0||B._status===-1)&&(B._status=2,B._result=pe)}),B._status===-1&&(B._status=0,B._result=ae)}if(B._status===1)return B._result.default;throw B._result}var Ce=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ae=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(ae))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},re={map:me,forEach:function(B,ae,pe){me(B,function(){ae.apply(this,arguments)},pe)},count:function(B){var ae=0;return me(B,function(){ae++}),ae},toArray:function(B){return me(B,function(ae){return ae})||[]},only:function(B){if(!Ee(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return et.Activity=w,et.Children=re,et.Component=D,et.Fragment=n,et.Profiler=s,et.PureComponent=q,et.StrictMode=a,et.Suspense=h,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,et.__COMPILER_RUNTIME={__proto__:null,c:function(B){return $.H.useMemoCache(B)}},et.cache=function(B){return function(){return B.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(B,ae,pe){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ge=T({},B.props),H=B.key;if(ae!=null)for(ee in ae.key!==void 0&&(H=""+ae.key),ae)!F.call(ae,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&ae.ref===void 0||(ge[ee]=ae[ee]);var ee=arguments.length-2;if(ee===1)ge.children=pe;else if(1<ee){for(var Te=Array(ee),ke=0;ke<ee;ke++)Te[ke]=arguments[ke+2];ge.children=Te}return ue(B.type,H,ge)},et.createContext=function(B){return B={$$typeof:f,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:m,_context:B},B},et.createElement=function(B,ae,pe){var ge,H={},ee=null;if(ae!=null)for(ge in ae.key!==void 0&&(ee=""+ae.key),ae)F.call(ae,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(H[ge]=ae[ge]);var Te=arguments.length-2;if(Te===1)H.children=pe;else if(1<Te){for(var ke=Array(Te),Ie=0;Ie<Te;Ie++)ke[Ie]=arguments[Ie+2];H.children=ke}if(B&&B.defaultProps)for(ge in Te=B.defaultProps,Te)H[ge]===void 0&&(H[ge]=Te[ge]);return ue(B,ee,H)},et.createRef=function(){return{current:null}},et.forwardRef=function(B){return{$$typeof:p,render:B}},et.isValidElement=Ee,et.lazy=function(B){return{$$typeof:S,_payload:{_status:-1,_result:B},_init:xe}},et.memo=function(B,ae){return{$$typeof:u,type:B,compare:ae===void 0?null:ae}},et.startTransition=function(B){var ae=$.T,pe={};$.T=pe;try{var ge=B(),H=$.S;H!==null&&H(pe,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(J,Ce)}catch(ee){Ce(ee)}finally{ae!==null&&pe.types!==null&&(ae.types=pe.types),$.T=ae}},et.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},et.use=function(B){return $.H.use(B)},et.useActionState=function(B,ae,pe){return $.H.useActionState(B,ae,pe)},et.useCallback=function(B,ae){return $.H.useCallback(B,ae)},et.useContext=function(B){return $.H.useContext(B)},et.useDebugValue=function(){},et.useDeferredValue=function(B,ae){return $.H.useDeferredValue(B,ae)},et.useEffect=function(B,ae){return $.H.useEffect(B,ae)},et.useEffectEvent=function(B){return $.H.useEffectEvent(B)},et.useId=function(){return $.H.useId()},et.useImperativeHandle=function(B,ae,pe){return $.H.useImperativeHandle(B,ae,pe)},et.useInsertionEffect=function(B,ae){return $.H.useInsertionEffect(B,ae)},et.useLayoutEffect=function(B,ae){return $.H.useLayoutEffect(B,ae)},et.useMemo=function(B,ae){return $.H.useMemo(B,ae)},et.useOptimistic=function(B,ae){return $.H.useOptimistic(B,ae)},et.useReducer=function(B,ae,pe){return $.H.useReducer(B,ae,pe)},et.useRef=function(B){return $.H.useRef(B)},et.useState=function(B){return $.H.useState(B)},et.useSyncExternalStore=function(B,ae,pe){return $.H.useSyncExternalStore(B,ae,pe)},et.useTransition=function(){return $.H.useTransition()},et.version="19.2.3",et}var rk;function By(){return rk||(rk=1,Th.exports=Sj()),Th.exports}var Nh={exports:{}},zn={};var ok;function xj(){if(ok)return zn;ok=1;var e=By();function t(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)u+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+h+"; visit "+u+" 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 m(h,u,S){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:w==null?null:""+w,children:h,containerInfo:u,implementation:S}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,zn.createPortal=function(h,u){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return m(h,u,null,S)},zn.flushSync=function(h){var u=f.T,S=a.p;try{if(f.T=null,a.p=2,h)return h()}finally{f.T=u,a.p=S,a.d.f()}},zn.preconnect=function(h,u){typeof h=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,a.d.C(h,u))},zn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},zn.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var S=u.as,w=p(S,u.crossOrigin),C=typeof u.integrity=="string"?u.integrity:void 0,E=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;S==="style"?a.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:w,integrity:C,fetchPriority:E}):S==="script"&&a.d.X(h,{crossOrigin:w,integrity:C,fetchPriority:E,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},zn.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var S=p(u.as,u.crossOrigin);a.d.M(h,{crossOrigin:S,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&a.d.M(h)},zn.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var S=u.as,w=p(S,u.crossOrigin);a.d.L(h,S,{crossOrigin:w,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},zn.preloadModule=function(h,u){if(typeof h=="string")if(u){var S=p(u.as,u.crossOrigin);a.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:S,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else a.d.m(h)},zn.requestFormReset=function(h){a.d.r(h)},zn.unstable_batchedUpdates=function(h,u){return h(u)},zn.useFormState=function(h,u,S){return f.H.useFormState(h,u,S)},zn.useFormStatus=function(){return f.H.useHostTransitionStatus()},zn.version="19.2.3",zn}var sk;function SA(){if(sk)return Nh.exports;sk=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(),Nh.exports=xj(),Nh.exports}var lk;function kj(){if(lk)return Wl;lk=1;var e=bj(),t=By(),n=SA();function a(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}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 m(i){var r=i,c=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(c=r.return),i=r.return;while(i)}return r.tag===3?c: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 p(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(m(i)!==i)throw Error(a(188))}function u(i){var r=i.alternate;if(!r){if(r=m(i),r===null)throw Error(a(188));return r!==i?null:i}for(var c=i,g=r;;){var y=c.return;if(y===null)break;var k=y.alternate;if(k===null){if(g=y.return,g!==null){c=g;continue}break}if(y.child===k.child){for(k=y.child;k;){if(k===c)return h(y),i;if(k===g)return h(y),r;k=k.sibling}throw Error(a(188))}if(c.return!==g.return)c=y,g=k;else{for(var _=!1,P=y.child;P;){if(P===c){_=!0,c=y,g=k;break}if(P===g){_=!0,g=y,c=k;break}P=P.sibling}if(!_){for(P=k.child;P;){if(P===c){_=!0,c=k,g=y;break}if(P===g){_=!0,g=k,c=y;break}P=P.sibling}if(!_)throw Error(a(189))}}if(c.alternate!==g)throw Error(a(190))}if(c.tag!==3)throw Error(a(188));return c.stateNode.current===c?i:r}function S(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=S(i),r!==null)return r;i=i.sibling}return null}var w=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),q=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),Ee=Symbol.iterator;function Me(i){return i===null||typeof i!="object"?null:(i=Ee&&i[Ee]||i["@@iterator"],typeof i=="function"?i:null)}var ce=Symbol.for("react.client.reference");function Se(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ce?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case D:return"Profiler";case j:return"StrictMode";case K:return"Suspense";case J:return"SuspenseList";case ue:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case R:return"Portal";case q:return i.displayName||"Context";case z:return(i._context.displayName||"Context")+".Consumer";case L:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case $:return r=i.displayName||null,r!==null?r:Se(i.type)||"Memo";case F:r=i._payload,i=i._init;try{return Se(i(r))}catch{}}return null}var Re=Array.isArray,Q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Ce=[],re=-1;function B(i){return{current:i}}function ae(i){0>re||(i.current=Ce[re],Ce[re]=null,re--)}function pe(i,r){re++,Ce[re]=i.current,i.current=r}var ge=B(null),H=B(null),ee=B(null),Te=B(null);function ke(i,r){switch(pe(ee,r),pe(H,i),pe(ge,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?wx(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=wx(r),i=Mx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ae(ge),pe(ge,i)}function Ie(){ae(ge),ae(H),ae(ee)}function vt(i){i.memoizedState!==null&&pe(Te,i);var r=ge.current,c=Mx(r,i.type);r!==c&&(pe(H,i),pe(ge,c))}function He(i){H.current===i&&(ae(ge),ae(H)),Te.current===i&&(ae(Te),Ql._currentValue=xe)}var Ae,$e;function Oe(i){if(Ae===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);Ae=r&&r[1]||"",$e=-1<c.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ae+i+$e}var At=!1;function Vt(i,r){if(!i||At)return"";At=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(le){var oe=le}Reflect.construct(i,[],ye)}else{try{ye.call()}catch(le){oe=le}i.call(ye.prototype)}}else{try{throw Error()}catch(le){oe=le}(ye=i())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(le){if(le&&oe&&typeof le.stack=="string")return[le.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),_=k[0],P=k[1];if(_&&P){var U=_.split(`
5
- `),ie=P.split(`
6
- `);for(y=g=0;g<U.length&&!U[g].includes("DetermineComponentFrameRoot");)g++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(g===U.length||y===ie.length)for(g=U.length-1,y=ie.length-1;1<=g&&0<=y&&U[g]!==ie[y];)y--;for(;1<=g&&0<=y;g--,y--)if(U[g]!==ie[y]){if(g!==1||y!==1)do if(g--,y--,0>y||U[g]!==ie[y]){var fe=`
7
- `+U[g].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=g&&0<=y);break}}}finally{At=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Oe(c):""}function Pn(i,r){switch(i.tag){case 26:case 27:case 5:return Oe(i.type);case 16:return Oe("Lazy");case 13:return i.child!==r&&r!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Vt(i.type,!1);case 11:return Vt(i.type.render,!1);case 1:return Vt(i.type,!0);case 31:return Oe("Activity");default:return""}}function Sa(i){try{var r="",c=null;do r+=Pn(i,c),c=i,i=i.return;while(i);return r}catch(g){return`
8
- Error generating stack: `+g.message+`
9
- `+g.stack}}var Zn=Object.prototype.hasOwnProperty,qn=e.unstable_scheduleCallback,Cn=e.unstable_cancelCallback,oa=e.unstable_shouldYield,xa=e.unstable_requestPaint,Xt=e.unstable_now,be=e.unstable_getCurrentPriorityLevel,_e=e.unstable_ImmediatePriority,Nt=e.unstable_UserBlockingPriority,An=e.unstable_NormalPriority,$a=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,En=e.log,mi=e.unstable_setDisableYieldValue,Oa=null,_n=null;function Ot(i){if(typeof En=="function"&&mi(i),_n&&typeof _n.setStrictMode=="function")try{_n.setStrictMode(Oa,i)}catch{}}var Jt=Math.clz32?Math.clz32:Dr,To=Math.log,au=Math.LN2;function Dr(i){return i>>>=0,i===0?32:31-(To(i)/au|0)|0}var zr=256,No=262144,Lr=4194304;function Bn(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 qr(i,r,c){var g=i.pendingLanes;if(g===0)return 0;var y=0,k=i.suspendedLanes,_=i.pingedLanes;i=i.warmLanes;var P=g&134217727;return P!==0?(g=P&~k,g!==0?y=Bn(g):(_&=P,_!==0?y=Bn(_):c||(c=P&~i,c!==0&&(y=Bn(c))))):(P=g&~k,P!==0?y=Bn(P):_!==0?y=Bn(_):c||(c=g&~i,c!==0&&(y=Bn(c)))),y===0?0:r!==0&&r!==y&&(r&k)===0&&(k=y&-y,c=r&-r,k>=c||k===32&&(c&4194048)!==0)?r:y}function Hi(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function nl(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 ja(){var i=Lr;return Lr<<=1,(Lr&62914560)===0&&(Lr=4194304),i}function Oo(i){for(var r=[],c=0;31>c;c++)r.push(i);return r}function $i(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function iu(i,r,c,g,y,k){var _=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var P=i.entanglements,U=i.expirationTimes,ie=i.hiddenUpdates;for(c=_&~c;0<c;){var fe=31-Jt(c),ye=1<<fe;P[fe]=0,U[fe]=-1;var oe=ie[fe];if(oe!==null)for(ie[fe]=null,fe=0;fe<oe.length;fe++){var le=oe[fe];le!==null&&(le.lane&=-536870913)}c&=~ye}g!==0&&al(i,g,0),k!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=k&~(_&~r))}function al(i,r,c){i.pendingLanes|=r,i.suspendedLanes&=~r;var g=31-Jt(r);i.entangledLanes|=r,i.entanglements[g]=i.entanglements[g]|1073741824|c&261930}function il(i,r){var c=i.entangledLanes|=r;for(i=i.entanglements;c;){var g=31-Jt(c),y=1<<g;y&r|i[g]&r&&(i[g]|=r),c&=~y}}function rl(i,r){var c=r&-r;return c=(c&42)!==0?1:ol(c),(c&(i.suspendedLanes|r))!==0?0:c}function ol(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 sl(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ru(){var i=me.p;return i!==0?i:(i=window.event,i===void 0?32:Gx(i.type))}function ou(i,r){var c=me.p;try{return me.p=i,r()}finally{me.p=c}}var Pa=Math.random().toString(36).slice(2),mn="__reactFiber$"+Pa,on="__reactProps$"+Pa,Qa="__reactContainer$"+Pa,Br="__reactEvents$"+Pa,su="__reactListeners$"+Pa,xp="__reactHandles$"+Pa,Va="__reactResources$"+Pa,Ur="__reactMarker$"+Pa;function he(i){delete i[mn],delete i[on],delete i[Br],delete i[su],delete i[xp]}function Be(i){var r=i[mn];if(r)return r;for(var c=i.parentNode;c;){if(r=c[Qa]||c[mn]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(i=Tx(i);i!==null;){if(c=i[mn])return c;i=Tx(i)}return r}i=c,c=i.parentNode}return null}function Xe(i){if(i=i[mn]||i[Qa]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function kt(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function Je(i){var r=i[Va];return r||(r=i[Va]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ve(i){i[Ur]=!0}var qe=new Set,it={};function We(i,r){jt(i,r),jt(i+"Capture",r)}function jt(i,r){for(it[i]=r,i=0;i<r.length;i++)qe.add(r[i])}var qt=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]*$"),Kt={},sn={};function Mt(i){return Zn.call(sn,i)?!0:Zn.call(Kt,i)?!1:qt.test(i)?sn[i]=!0:(Kt[i]=!0,!1)}function Sn(i,r,c){if(Mt(r))if(c===null)i.removeAttribute(r);else{switch(typeof c){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,""+c)}}function nt(i,r,c){if(c===null)i.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+c)}}function yt(i,r,c,g){if(g===null)i.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(r,c,""+g)}}function xn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Bt(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ga(i,r,c){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var y=g.get,k=g.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return y.call(this)},set:function(_){c=""+_,k.call(this,_)}}),Object.defineProperty(i,r,{enumerable:g.enumerable}),{getValue:function(){return c},setValue:function(_){c=""+_},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function Et(i){if(!i._valueTracker){var r=Bt(i)?"checked":"value";i._valueTracker=Ga(i,r,""+i[r])}}function Ge(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var c=r.getValue(),g="";return i&&(g=Bt(i)?i.checked?"true":"false":i.value),i=g,i!==c?(r.setValue(i),!0):!1}function ka(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 jo=/[\n"\\]/g;function Dn(i){return i.replace(jo,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Qi(i,r,c,g,y,k,_,P){i.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?i.type=_:i.removeAttribute("type"),r!=null?_==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+xn(r)):i.value!==""+xn(r)&&(i.value=""+xn(r)):_!=="submit"&&_!=="reset"||i.removeAttribute("value"),r!=null?Za(i,_,xn(r)):c!=null?Za(i,_,xn(c)):g!=null&&i.removeAttribute("value"),y==null&&k!=null&&(i.defaultChecked=!!k),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.name=""+xn(P):i.removeAttribute("name")}function Vi(i,r,c,g,y,k,_,P){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),r!=null||c!=null){if(!(k!=="submit"&&k!=="reset"||r!=null)){Et(i);return}c=c!=null?""+xn(c):"",r=r!=null?""+xn(r):c,P||r===i.value||(i.value=r),i.defaultValue=r}g=g??y,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=P?i.checked:!!g,i.defaultChecked=!!g,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.name=_),Et(i)}function Za(i,r,c){r==="number"&&ka(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Ka(i,r,c,g){if(i=i.options,r){r={};for(var y=0;y<c.length;y++)r["$"+c[y]]=!0;for(c=0;c<i.length;c++)y=r.hasOwnProperty("$"+i[c].value),i[c].selected!==y&&(i[c].selected=y),y&&g&&(i[c].defaultSelected=!0)}else{for(c=""+xn(c),r=null,y=0;y<i.length;y++){if(i[y].value===c){i[y].selected=!0,g&&(i[y].defaultSelected=!0);return}r!==null||i[y].disabled||(r=i[y])}r!==null&&(r.selected=!0)}}function y0(i,r,c){if(r!=null&&(r=""+xn(r),r!==i.value&&(i.value=r),c==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=c!=null?""+xn(c):""}function b0(i,r,c,g){if(r==null){if(g!=null){if(c!=null)throw Error(a(92));if(Re(g)){if(1<g.length)throw Error(a(93));g=g[0]}c=g}c==null&&(c=""),r=c}c=xn(r),i.defaultValue=c,g=i.textContent,g===c&&g!==""&&g!==null&&(i.value=g),Et(i)}function Po(i,r){if(r){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=r;return}}i.textContent=r}var c5=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 S0(i,r,c){var g=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?g?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":g?i.setProperty(r,c):typeof c!="number"||c===0||c5.has(r)?r==="float"?i.cssFloat=c:i[r]=(""+c).trim():i[r]=c+"px"}function x0(i,r,c){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,c!=null){for(var g in c)!c.hasOwnProperty(g)||r!=null&&r.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var y in r)g=r[y],r.hasOwnProperty(y)&&c[y]!==g&&S0(i,y,g)}else for(var k in r)r.hasOwnProperty(k)&&S0(i,k,r[k])}function kp(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 u5=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"]]),d5=/^[\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 lu(i){return d5.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function pi(){}var wp=null;function Mp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Do=null,zo=null;function k0(i){var r=Xe(i);if(r&&(i=r.stateNode)){var c=i[on]||null;e:switch(i=r.stateNode,r.type){case"input":if(Qi(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Dn(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var g=c[r];if(g!==i&&g.form===i.form){var y=g[on]||null;if(!y)throw Error(a(90));Qi(g,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(r=0;r<c.length;r++)g=c[r],g.form===i.form&&Ge(g)}break e;case"textarea":y0(i,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&Ka(i,!!c.multiple,r,!1)}}}var Cp=!1;function w0(i,r,c){if(Cp)return i(r,c);Cp=!0;try{var g=i(r);return g}finally{if(Cp=!1,(Do!==null||zo!==null)&&(Ku(),Do&&(r=Do,i=zo,zo=Do=null,k0(r),i)))for(r=0;r<i.length;r++)k0(i[r])}}function ll(i,r){var c=i.stateNode;if(c===null)return null;var g=c[on]||null;if(g===null)return null;c=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(c&&typeof c!="function")throw Error(a(231,r,typeof c));return c}var fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ap=!1;if(fi)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Ap=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Ap=!1}var Gi=null,Ep=null,cu=null;function M0(){if(cu)return cu;var i,r=Ep,c=r.length,g,y="value"in Gi?Gi.value:Gi.textContent,k=y.length;for(i=0;i<c&&r[i]===y[i];i++);var _=c-i;for(g=1;g<=_&&r[c-g]===y[k-g];g++);return cu=y.slice(i,1<g?1-g:void 0)}function uu(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 du(){return!0}function C0(){return!1}function Kn(i){function r(c,g,y,k,_){this._reactName=c,this._targetInst=y,this.type=g,this.nativeEvent=k,this.target=_,this.currentTarget=null;for(var P in i)i.hasOwnProperty(P)&&(c=i[P],this[P]=c?c(k):k[P]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?du:C0,this.isPropagationStopped=C0,this}return w(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),r}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mu=Kn(Fr),ul=w({},Fr,{view:0,detail:0}),m5=Kn(ul),Rp,_p,dl,pu=w({},ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tp,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!==dl&&(dl&&i.type==="mousemove"?(Rp=i.screenX-dl.screenX,_p=i.screenY-dl.screenY):_p=Rp=0,dl=i),Rp)},movementY:function(i){return"movementY"in i?i.movementY:_p}}),A0=Kn(pu),p5=w({},pu,{dataTransfer:0}),f5=Kn(p5),h5=w({},ul,{relatedTarget:0}),Ip=Kn(h5),g5=w({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),v5=Kn(g5),y5=w({},Fr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),b5=Kn(y5),S5=w({},Fr,{data:0}),E0=Kn(S5),x5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k5={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"},w5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M5(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=w5[i])?!!r[i]:!1}function Tp(){return M5}var C5=w({},ul,{key:function(i){if(i.key){var r=x5[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=uu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?k5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tp,charCode:function(i){return i.type==="keypress"?uu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?uu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),A5=Kn(C5),E5=w({},pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),R0=Kn(E5),R5=w({},ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tp}),_5=Kn(R5),I5=w({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),T5=Kn(I5),N5=w({},pu,{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}),O5=Kn(N5),j5=w({},Fr,{newState:0,oldState:0}),P5=Kn(j5),D5=[9,13,27,32],Np=fi&&"CompositionEvent"in window,ml=null;fi&&"documentMode"in document&&(ml=document.documentMode);var z5=fi&&"TextEvent"in window&&!ml,_0=fi&&(!Np||ml&&8<ml&&11>=ml),I0=" ",T0=!1;function N0(i,r){switch(i){case"keyup":return D5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Lo=!1;function L5(i,r){switch(i){case"compositionend":return O0(r);case"keypress":return r.which!==32?null:(T0=!0,I0);case"textInput":return i=r.data,i===I0&&T0?null:i;default:return null}}function q5(i,r){if(Lo)return i==="compositionend"||!Np&&N0(i,r)?(i=M0(),cu=Ep=Gi=null,Lo=!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 B5={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 j0(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!B5[i.type]:r==="textarea"}function P0(i,r,c,g){Do?zo?zo.push(g):zo=[g]:Do=g,r=nd(r,"onChange"),0<r.length&&(c=new mu("onChange","change",null,c,g),i.push({event:c,listeners:r}))}var pl=null,fl=null;function U5(i){vx(i,0)}function fu(i){var r=kt(i);if(Ge(r))return i}function D0(i,r){if(i==="change")return r}var z0=!1;if(fi){var Op;if(fi){var jp="oninput"in document;if(!jp){var L0=document.createElement("div");L0.setAttribute("oninput","return;"),jp=typeof L0.oninput=="function"}Op=jp}else Op=!1;z0=Op&&(!document.documentMode||9<document.documentMode)}function q0(){pl&&(pl.detachEvent("onpropertychange",B0),fl=pl=null)}function B0(i){if(i.propertyName==="value"&&fu(fl)){var r=[];P0(r,fl,i,Mp(i)),w0(U5,r)}}function F5(i,r,c){i==="focusin"?(q0(),pl=r,fl=c,pl.attachEvent("onpropertychange",B0)):i==="focusout"&&q0()}function H5(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return fu(fl)}function $5(i,r){if(i==="click")return fu(r)}function Q5(i,r){if(i==="input"||i==="change")return fu(r)}function V5(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var sa=typeof Object.is=="function"?Object.is:V5;function hl(i,r){if(sa(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var c=Object.keys(i),g=Object.keys(r);if(c.length!==g.length)return!1;for(g=0;g<c.length;g++){var y=c[g];if(!Zn.call(r,y)||!sa(i[y],r[y]))return!1}return!0}function U0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function F0(i,r){var c=U0(i);i=0;for(var g;c;){if(c.nodeType===3){if(g=i+c.textContent.length,i<=r&&g>=r)return{node:c,offset:r-i};i=g}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=U0(c)}}function H0(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?H0(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function $0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=ka(i.document);r instanceof i.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)i=r.contentWindow;else break;r=ka(i.document)}return r}function Pp(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 G5=fi&&"documentMode"in document&&11>=document.documentMode,qo=null,Dp=null,gl=null,zp=!1;function Q0(i,r,c){var g=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;zp||qo==null||qo!==ka(g)||(g=qo,"selectionStart"in g&&Pp(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}),gl&&hl(gl,g)||(gl=g,g=nd(Dp,"onSelect"),0<g.length&&(r=new mu("onSelect","select",null,r,c),i.push({event:r,listeners:g}),r.target=qo)))}function Hr(i,r){var c={};return c[i.toLowerCase()]=r.toLowerCase(),c["Webkit"+i]="webkit"+r,c["Moz"+i]="moz"+r,c}var Bo={animationend:Hr("Animation","AnimationEnd"),animationiteration:Hr("Animation","AnimationIteration"),animationstart:Hr("Animation","AnimationStart"),transitionrun:Hr("Transition","TransitionRun"),transitionstart:Hr("Transition","TransitionStart"),transitioncancel:Hr("Transition","TransitionCancel"),transitionend:Hr("Transition","TransitionEnd")},Lp={},V0={};fi&&(V0=document.createElement("div").style,"AnimationEvent"in window||(delete Bo.animationend.animation,delete Bo.animationiteration.animation,delete Bo.animationstart.animation),"TransitionEvent"in window||delete Bo.transitionend.transition);function $r(i){if(Lp[i])return Lp[i];if(!Bo[i])return i;var r=Bo[i],c;for(c in r)if(r.hasOwnProperty(c)&&c in V0)return Lp[i]=r[c];return i}var G0=$r("animationend"),Z0=$r("animationiteration"),K0=$r("animationstart"),Z5=$r("transitionrun"),K5=$r("transitionstart"),W5=$r("transitioncancel"),W0=$r("transitionend"),Y0=new Map,qp="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(" ");qp.push("scrollEnd");function Da(i,r){Y0.set(i,r),We(r,[i])}var hu=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)},wa=[],Uo=0,Bp=0;function gu(){for(var i=Uo,r=Bp=Uo=0;r<i;){var c=wa[r];wa[r++]=null;var g=wa[r];wa[r++]=null;var y=wa[r];wa[r++]=null;var k=wa[r];if(wa[r++]=null,g!==null&&y!==null){var _=g.pending;_===null?y.next=y:(y.next=_.next,_.next=y),g.pending=y}k!==0&&X0(c,y,k)}}function vu(i,r,c,g){wa[Uo++]=i,wa[Uo++]=r,wa[Uo++]=c,wa[Uo++]=g,Bp|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Up(i,r,c,g){return vu(i,r,c,g),yu(i)}function Qr(i,r){return vu(i,null,null,r),yu(i)}function X0(i,r,c){i.lanes|=c;var g=i.alternate;g!==null&&(g.lanes|=c);for(var y=!1,k=i.return;k!==null;)k.childLanes|=c,g=k.alternate,g!==null&&(g.childLanes|=c),k.tag===22&&(i=k.stateNode,i===null||i._visibility&1||(y=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,y&&r!==null&&(y=31-Jt(c),i=k.hiddenUpdates,g=i[y],g===null?i[y]=[r]:g.push(r),r.lane=c|536870912),k):null}function yu(i){if(50<Ll)throw Ll=0,Yf=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Fo={};function Y5(i,r,c,g){this.tag=i,this.key=c,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 la(i,r,c,g){return new Y5(i,r,c,g)}function Fp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function hi(i,r){var c=i.alternate;return c===null?(c=la(i.tag,r,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=r,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,r=i.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function J0(i,r){i.flags&=65011714;var c=i.alternate;return c===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=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,r=c.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function bu(i,r,c,g,y,k){var _=0;if(g=i,typeof i=="function")Fp(i)&&(_=1);else if(typeof i=="string")_=nj(i,c,ge.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case ue:return i=la(31,c,r,y),i.elementType=ue,i.lanes=k,i;case T:return Vr(c.children,y,k,r);case j:_=8,y|=24;break;case D:return i=la(12,c,r,y|2),i.elementType=D,i.lanes=k,i;case K:return i=la(13,c,r,y),i.elementType=K,i.lanes=k,i;case J:return i=la(19,c,r,y),i.elementType=J,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case q:_=10;break e;case z:_=9;break e;case L:_=11;break e;case $:_=14;break e;case F:_=16,g=null;break e}_=29,c=Error(a(130,i===null?"null":typeof i,"")),g=null}return r=la(_,c,r,y),r.elementType=i,r.type=g,r.lanes=k,r}function Vr(i,r,c,g){return i=la(7,i,g,r),i.lanes=c,i}function Hp(i,r,c){return i=la(6,i,null,r),i.lanes=c,i}function e1(i){var r=la(18,null,null,0);return r.stateNode=i,r}function $p(i,r,c){return r=la(4,i.children!==null?i.children:[],i.key,r),r.lanes=c,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var t1=new WeakMap;function Ma(i,r){if(typeof i=="object"&&i!==null){var c=t1.get(i);return c!==void 0?c:(r={value:i,source:r,stack:Sa(r)},t1.set(i,r),r)}return{value:i,source:r,stack:Sa(r)}}var Ho=[],$o=0,Su=null,vl=0,Ca=[],Aa=0,Zi=null,Wa=1,Ya="";function gi(i,r){Ho[$o++]=vl,Ho[$o++]=Su,Su=i,vl=r}function n1(i,r,c){Ca[Aa++]=Wa,Ca[Aa++]=Ya,Ca[Aa++]=Zi,Zi=i;var g=Wa;i=Ya;var y=32-Jt(g)-1;g&=~(1<<y),c+=1;var k=32-Jt(r)+y;if(30<k){var _=y-y%5;k=(g&(1<<_)-1).toString(32),g>>=_,y-=_,Wa=1<<32-Jt(r)+y|c<<y|g,Ya=k+i}else Wa=1<<k|c<<y|g,Ya=i}function Qp(i){i.return!==null&&(gi(i,1),n1(i,1,0))}function Vp(i){for(;i===Su;)Su=Ho[--$o],Ho[$o]=null,vl=Ho[--$o],Ho[$o]=null;for(;i===Zi;)Zi=Ca[--Aa],Ca[Aa]=null,Ya=Ca[--Aa],Ca[Aa]=null,Wa=Ca[--Aa],Ca[Aa]=null}function a1(i,r){Ca[Aa++]=Wa,Ca[Aa++]=Ya,Ca[Aa++]=Zi,Wa=r.id,Ya=r.overflow,Zi=i}var In=null,Ht=null,ft=!1,Ki=null,Ea=!1,Gp=Error(a(519));function Wi(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yl(Ma(r,i)),Gp}function i1(i){var r=i.stateNode,c=i.type,g=i.memoizedProps;switch(r[mn]=i,r[on]=g,c){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(c=0;c<Bl.length;c++)lt(Bl[c],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":lt("invalid",r),Vi(r,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":lt("invalid",r);break;case"textarea":lt("invalid",r),b0(r,g.value,g.defaultValue,g.children)}c=g.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||g.suppressHydrationWarning===!0||xx(r.textContent,c)?(g.popover!=null&&(lt("beforetoggle",r),lt("toggle",r)),g.onScroll!=null&&lt("scroll",r),g.onScrollEnd!=null&&lt("scrollend",r),g.onClick!=null&&(r.onclick=pi),r=!0):r=!1,r||Wi(i,!0)}function r1(i){for(In=i.return;In;)switch(In.tag){case 5:case 31:case 13:Ea=!1;return;case 27:case 3:Ea=!0;return;default:In=In.return}}function Qo(i){if(i!==In)return!1;if(!ft)return r1(i),ft=!0,!1;var r=i.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||mh(i.type,i.memoizedProps)),c=!c),c&&Ht&&Wi(i),r1(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Ht=Ix(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Ht=Ix(i)}else r===27?(r=Ht,ur(i.type)?(i=vh,vh=null,Ht=i):Ht=r):Ht=In?_a(i.stateNode.nextSibling):null;return!0}function Gr(){Ht=In=null,ft=!1}function Zp(){var i=Ki;return i!==null&&(Jn===null?Jn=i:Jn.push.apply(Jn,i),Ki=null),i}function yl(i){Ki===null?Ki=[i]:Ki.push(i)}var Kp=B(null),Zr=null,vi=null;function Yi(i,r,c){pe(Kp,r._currentValue),r._currentValue=c}function yi(i){i._currentValue=Kp.current,ae(Kp)}function Wp(i,r,c){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===c)break;i=i.return}}function Yp(i,r,c,g){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var k=y.dependencies;if(k!==null){var _=y.child;k=k.firstContext;e:for(;k!==null;){var P=k;k=y;for(var U=0;U<r.length;U++)if(P.context===r[U]){k.lanes|=c,P=k.alternate,P!==null&&(P.lanes|=c),Wp(k.return,c,i),g||(_=null);break e}k=P.next}}else if(y.tag===18){if(_=y.return,_===null)throw Error(a(341));_.lanes|=c,k=_.alternate,k!==null&&(k.lanes|=c),Wp(_,c,i),_=null}else _=y.child;if(_!==null)_.return=y;else for(_=y;_!==null;){if(_===i){_=null;break}if(y=_.sibling,y!==null){y.return=_.return,_=y;break}_=_.return}y=_}}function Vo(i,r,c,g){i=null;for(var y=r,k=!1;y!==null;){if(!k){if((y.flags&524288)!==0)k=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var _=y.alternate;if(_===null)throw Error(a(387));if(_=_.memoizedProps,_!==null){var P=y.type;sa(y.pendingProps.value,_.value)||(i!==null?i.push(P):i=[P])}}else if(y===Te.current){if(_=y.alternate,_===null)throw Error(a(387));_.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(Ql):i=[Ql])}y=y.return}i!==null&&Yp(r,i,c,g),r.flags|=262144}function xu(i){for(i=i.firstContext;i!==null;){if(!sa(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Kr(i){Zr=i,vi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Tn(i){return o1(Zr,i)}function ku(i,r){return Zr===null&&Kr(i),o1(i,r)}function o1(i,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},vi===null){if(i===null)throw Error(a(308));vi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else vi=vi.next=r;return c}var X5=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(c,g){i.push(g)}};this.abort=function(){r.aborted=!0,i.forEach(function(c){return c()})}},J5=e.unstable_scheduleCallback,eO=e.unstable_NormalPriority,pn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xp(){return{controller:new X5,data:new Map,refCount:0}}function bl(i){i.refCount--,i.refCount===0&&J5(eO,function(){i.controller.abort()})}var Sl=null,Jp=0,Go=0,Zo=null;function tO(i,r){if(Sl===null){var c=Sl=[];Jp=0,Go=ah(),Zo={status:"pending",value:void 0,then:function(g){c.push(g)}}}return Jp++,r.then(s1,s1),r}function s1(){if(--Jp===0&&Sl!==null){Zo!==null&&(Zo.status="fulfilled");var i=Sl;Sl=null,Go=0,Zo=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function nO(i,r){var c=[],g={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return i.then(function(){g.status="fulfilled",g.value=r;for(var y=0;y<c.length;y++)(0,c[y])(r)},function(y){for(g.status="rejected",g.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),g}var l1=Q.S;Q.S=function(i,r){QS=Xt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&tO(i,r),l1!==null&&l1(i,r)};var Wr=B(null);function ef(){var i=Wr.current;return i!==null?i:Lt.pooledCache}function wu(i,r){r===null?pe(Wr,Wr.current):pe(Wr,r.pool)}function c1(){var i=ef();return i===null?null:{parent:pn._currentValue,pool:i}}var Ko=Error(a(460)),tf=Error(a(474)),Mu=Error(a(542)),Cu={then:function(){}};function u1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function d1(i,r,c){switch(c=i[c],c===void 0?i.push(r):c!==r&&(r.then(pi,pi),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,p1(i),i;default:if(typeof r.status=="string")r.then(pi,pi);else{if(i=Lt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(g){if(r.status==="pending"){var y=r;y.status="fulfilled",y.value=g}},function(g){if(r.status==="pending"){var y=r;y.status="rejected",y.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,p1(i),i}throw Xr=r,Ko}}function Yr(i){try{var r=i._init;return r(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Xr=c,Ko):c}}var Xr=null;function m1(){if(Xr===null)throw Error(a(459));var i=Xr;return Xr=null,i}function p1(i){if(i===Ko||i===Mu)throw Error(a(483))}var Wo=null,xl=0;function Au(i){var r=xl;return xl+=1,Wo===null&&(Wo=[]),d1(Wo,i,r)}function kl(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Eu(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 f1(i){function r(Y,Z){if(i){var ne=Y.deletions;ne===null?(Y.deletions=[Z],Y.flags|=16):ne.push(Z)}}function c(Y,Z){if(!i)return null;for(;Z!==null;)r(Y,Z),Z=Z.sibling;return null}function g(Y){for(var Z=new Map;Y!==null;)Y.key!==null?Z.set(Y.key,Y):Z.set(Y.index,Y),Y=Y.sibling;return Z}function y(Y,Z){return Y=hi(Y,Z),Y.index=0,Y.sibling=null,Y}function k(Y,Z,ne){return Y.index=ne,i?(ne=Y.alternate,ne!==null?(ne=ne.index,ne<Z?(Y.flags|=67108866,Z):ne):(Y.flags|=67108866,Z)):(Y.flags|=1048576,Z)}function _(Y){return i&&Y.alternate===null&&(Y.flags|=67108866),Y}function P(Y,Z,ne,ve){return Z===null||Z.tag!==6?(Z=Hp(ne,Y.mode,ve),Z.return=Y,Z):(Z=y(Z,ne),Z.return=Y,Z)}function U(Y,Z,ne,ve){var Qe=ne.type;return Qe===T?fe(Y,Z,ne.props.children,ve,ne.key):Z!==null&&(Z.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===F&&Yr(Qe)===Z.type)?(Z=y(Z,ne.props),kl(Z,ne),Z.return=Y,Z):(Z=bu(ne.type,ne.key,ne.props,null,Y.mode,ve),kl(Z,ne),Z.return=Y,Z)}function ie(Y,Z,ne,ve){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ne.containerInfo||Z.stateNode.implementation!==ne.implementation?(Z=$p(ne,Y.mode,ve),Z.return=Y,Z):(Z=y(Z,ne.children||[]),Z.return=Y,Z)}function fe(Y,Z,ne,ve,Qe){return Z===null||Z.tag!==7?(Z=Vr(ne,Y.mode,ve,Qe),Z.return=Y,Z):(Z=y(Z,ne),Z.return=Y,Z)}function ye(Y,Z,ne){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Hp(""+Z,Y.mode,ne),Z.return=Y,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return ne=bu(Z.type,Z.key,Z.props,null,Y.mode,ne),kl(ne,Z),ne.return=Y,ne;case R:return Z=$p(Z,Y.mode,ne),Z.return=Y,Z;case F:return Z=Yr(Z),ye(Y,Z,ne)}if(Re(Z)||Me(Z))return Z=Vr(Z,Y.mode,ne,null),Z.return=Y,Z;if(typeof Z.then=="function")return ye(Y,Au(Z),ne);if(Z.$$typeof===q)return ye(Y,ku(Y,Z),ne);Eu(Y,Z)}return null}function oe(Y,Z,ne,ve){var Qe=Z!==null?Z.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Qe!==null?null:P(Y,Z,""+ne,ve);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:return ne.key===Qe?U(Y,Z,ne,ve):null;case R:return ne.key===Qe?ie(Y,Z,ne,ve):null;case F:return ne=Yr(ne),oe(Y,Z,ne,ve)}if(Re(ne)||Me(ne))return Qe!==null?null:fe(Y,Z,ne,ve,null);if(typeof ne.then=="function")return oe(Y,Z,Au(ne),ve);if(ne.$$typeof===q)return oe(Y,Z,ku(Y,ne),ve);Eu(Y,ne)}return null}function le(Y,Z,ne,ve,Qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return Y=Y.get(ne)||null,P(Z,Y,""+ve,Qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case E:return Y=Y.get(ve.key===null?ne:ve.key)||null,U(Z,Y,ve,Qe);case R:return Y=Y.get(ve.key===null?ne:ve.key)||null,ie(Z,Y,ve,Qe);case F:return ve=Yr(ve),le(Y,Z,ne,ve,Qe)}if(Re(ve)||Me(ve))return Y=Y.get(ne)||null,fe(Z,Y,ve,Qe,null);if(typeof ve.then=="function")return le(Y,Z,ne,Au(ve),Qe);if(ve.$$typeof===q)return le(Y,Z,ne,ku(Z,ve),Qe);Eu(Z,ve)}return null}function ze(Y,Z,ne,ve){for(var Qe=null,bt=null,Ue=Z,rt=Z=0,mt=null;Ue!==null&&rt<ne.length;rt++){Ue.index>rt?(mt=Ue,Ue=null):mt=Ue.sibling;var St=oe(Y,Ue,ne[rt],ve);if(St===null){Ue===null&&(Ue=mt);break}i&&Ue&&St.alternate===null&&r(Y,Ue),Z=k(St,Z,rt),bt===null?Qe=St:bt.sibling=St,bt=St,Ue=mt}if(rt===ne.length)return c(Y,Ue),ft&&gi(Y,rt),Qe;if(Ue===null){for(;rt<ne.length;rt++)Ue=ye(Y,ne[rt],ve),Ue!==null&&(Z=k(Ue,Z,rt),bt===null?Qe=Ue:bt.sibling=Ue,bt=Ue);return ft&&gi(Y,rt),Qe}for(Ue=g(Ue);rt<ne.length;rt++)mt=le(Ue,Y,rt,ne[rt],ve),mt!==null&&(i&&mt.alternate!==null&&Ue.delete(mt.key===null?rt:mt.key),Z=k(mt,Z,rt),bt===null?Qe=mt:bt.sibling=mt,bt=mt);return i&&Ue.forEach(function(hr){return r(Y,hr)}),ft&&gi(Y,rt),Qe}function Ze(Y,Z,ne,ve){if(ne==null)throw Error(a(151));for(var Qe=null,bt=null,Ue=Z,rt=Z=0,mt=null,St=ne.next();Ue!==null&&!St.done;rt++,St=ne.next()){Ue.index>rt?(mt=Ue,Ue=null):mt=Ue.sibling;var hr=oe(Y,Ue,St.value,ve);if(hr===null){Ue===null&&(Ue=mt);break}i&&Ue&&hr.alternate===null&&r(Y,Ue),Z=k(hr,Z,rt),bt===null?Qe=hr:bt.sibling=hr,bt=hr,Ue=mt}if(St.done)return c(Y,Ue),ft&&gi(Y,rt),Qe;if(Ue===null){for(;!St.done;rt++,St=ne.next())St=ye(Y,St.value,ve),St!==null&&(Z=k(St,Z,rt),bt===null?Qe=St:bt.sibling=St,bt=St);return ft&&gi(Y,rt),Qe}for(Ue=g(Ue);!St.done;rt++,St=ne.next())St=le(Ue,Y,rt,St.value,ve),St!==null&&(i&&St.alternate!==null&&Ue.delete(St.key===null?rt:St.key),Z=k(St,Z,rt),bt===null?Qe=St:bt.sibling=St,bt=St);return i&&Ue.forEach(function(pj){return r(Y,pj)}),ft&&gi(Y,rt),Qe}function zt(Y,Z,ne,ve){if(typeof ne=="object"&&ne!==null&&ne.type===T&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:e:{for(var Qe=ne.key;Z!==null;){if(Z.key===Qe){if(Qe=ne.type,Qe===T){if(Z.tag===7){c(Y,Z.sibling),ve=y(Z,ne.props.children),ve.return=Y,Y=ve;break e}}else if(Z.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===F&&Yr(Qe)===Z.type){c(Y,Z.sibling),ve=y(Z,ne.props),kl(ve,ne),ve.return=Y,Y=ve;break e}c(Y,Z);break}else r(Y,Z);Z=Z.sibling}ne.type===T?(ve=Vr(ne.props.children,Y.mode,ve,ne.key),ve.return=Y,Y=ve):(ve=bu(ne.type,ne.key,ne.props,null,Y.mode,ve),kl(ve,ne),ve.return=Y,Y=ve)}return _(Y);case R:e:{for(Qe=ne.key;Z!==null;){if(Z.key===Qe)if(Z.tag===4&&Z.stateNode.containerInfo===ne.containerInfo&&Z.stateNode.implementation===ne.implementation){c(Y,Z.sibling),ve=y(Z,ne.children||[]),ve.return=Y,Y=ve;break e}else{c(Y,Z);break}else r(Y,Z);Z=Z.sibling}ve=$p(ne,Y.mode,ve),ve.return=Y,Y=ve}return _(Y);case F:return ne=Yr(ne),zt(Y,Z,ne,ve)}if(Re(ne))return ze(Y,Z,ne,ve);if(Me(ne)){if(Qe=Me(ne),typeof Qe!="function")throw Error(a(150));return ne=Qe.call(ne),Ze(Y,Z,ne,ve)}if(typeof ne.then=="function")return zt(Y,Z,Au(ne),ve);if(ne.$$typeof===q)return zt(Y,Z,ku(Y,ne),ve);Eu(Y,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Z!==null&&Z.tag===6?(c(Y,Z.sibling),ve=y(Z,ne),ve.return=Y,Y=ve):(c(Y,Z),ve=Hp(ne,Y.mode,ve),ve.return=Y,Y=ve),_(Y)):c(Y,Z)}return function(Y,Z,ne,ve){try{xl=0;var Qe=zt(Y,Z,ne,ve);return Wo=null,Qe}catch(Ue){if(Ue===Ko||Ue===Mu)throw Ue;var bt=la(29,Ue,null,Y.mode);return bt.lanes=ve,bt.return=Y,bt}}}var Jr=f1(!0),h1=f1(!1),Xi=!1;function nf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(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 Ji(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function er(i,r,c){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(wt&2)!==0){var y=g.pending;return y===null?r.next=r:(r.next=y.next,y.next=r),g.pending=r,r=yu(i),X0(i,null,c),r}return vu(i,g,r,c),yu(i)}function wl(i,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var g=r.lanes;g&=i.pendingLanes,c|=g,r.lanes=c,il(i,c)}}function rf(i,r){var c=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,c===g)){var y=null,k=null;if(c=c.firstBaseUpdate,c!==null){do{var _={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};k===null?y=k=_:k=k.next=_,c=c.next}while(c!==null);k===null?y=k=r:k=k.next=r}else y=k=r;c={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=r:i.next=r,c.lastBaseUpdate=r}var of=!1;function Ml(){if(of){var i=Zo;if(i!==null)throw i}}function Cl(i,r,c,g){of=!1;var y=i.updateQueue;Xi=!1;var k=y.firstBaseUpdate,_=y.lastBaseUpdate,P=y.shared.pending;if(P!==null){y.shared.pending=null;var U=P,ie=U.next;U.next=null,_===null?k=ie:_.next=ie,_=U;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==_&&(P===null?fe.firstBaseUpdate=ie:P.next=ie,fe.lastBaseUpdate=U))}if(k!==null){var ye=y.baseState;_=0,fe=ie=U=null,P=k;do{var oe=P.lane&-536870913,le=oe!==P.lane;if(le?(dt&oe)===oe:(g&oe)===oe){oe!==0&&oe===Go&&(of=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var ze=i,Ze=P;oe=r;var zt=c;switch(Ze.tag){case 1:if(ze=Ze.payload,typeof ze=="function"){ye=ze.call(zt,ye,oe);break e}ye=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ze.payload,oe=typeof ze=="function"?ze.call(zt,ye,oe):ze,oe==null)break e;ye=w({},ye,oe);break e;case 2:Xi=!0}}oe=P.callback,oe!==null&&(i.flags|=64,le&&(i.flags|=8192),le=y.callbacks,le===null?y.callbacks=[oe]:le.push(oe))}else le={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(ie=fe=le,U=ye):fe=fe.next=le,_|=oe;if(P=P.next,P===null){if(P=y.shared.pending,P===null)break;le=P,P=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);fe===null&&(U=ye),y.baseState=U,y.firstBaseUpdate=ie,y.lastBaseUpdate=fe,k===null&&(y.shared.lanes=0),rr|=_,i.lanes=_,i.memoizedState=ye}}function g1(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function v1(i,r){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)g1(c[i],r)}var Yo=B(null),Ru=B(0);function y1(i,r){i=Ei,pe(Ru,i),pe(Yo,r),Ei=i|r.baseLanes}function sf(){pe(Ru,Ei),pe(Yo,Yo.current)}function lf(){Ei=Ru.current,ae(Yo),ae(Ru)}var ca=B(null),Ra=null;function tr(i){var r=i.alternate;pe(ln,ln.current&1),pe(ca,i),Ra===null&&(r===null||Yo.current!==null||r.memoizedState!==null)&&(Ra=i)}function cf(i){pe(ln,ln.current),pe(ca,i),Ra===null&&(Ra=i)}function b1(i){i.tag===22?(pe(ln,ln.current),pe(ca,i),Ra===null&&(Ra=i)):nr()}function nr(){pe(ln,ln.current),pe(ca,ca.current)}function ua(i){ae(ca),Ra===i&&(Ra=null),ae(ln)}var ln=B(0);function _u(i){for(var r=i;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||hh(c)||gh(c)))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 bi=0,at=null,Pt=null,fn=null,Iu=!1,Xo=!1,eo=!1,Tu=0,Al=0,Jo=null,aO=0;function en(){throw Error(a(321))}function uf(i,r){if(r===null)return!1;for(var c=0;c<r.length&&c<i.length;c++)if(!sa(i[c],r[c]))return!1;return!0}function df(i,r,c,g,y,k){return bi=k,at=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Q.H=i===null||i.memoizedState===null?nS:Af,eo=!1,k=c(g,y),eo=!1,Xo&&(k=x1(r,c,g,y)),S1(i),k}function S1(i){Q.H=_l;var r=Pt!==null&&Pt.next!==null;if(bi=0,fn=Pt=at=null,Iu=!1,Al=0,Jo=null,r)throw Error(a(300));i===null||hn||(i=i.dependencies,i!==null&&xu(i)&&(hn=!0))}function x1(i,r,c,g){at=i;var y=0;do{if(Xo&&(Jo=null),Al=0,Xo=!1,25<=y)throw Error(a(301));if(y+=1,fn=Pt=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}Q.H=aS,k=r(c,g)}while(Xo);return k}function iO(){var i=Q.H,r=i.useState()[0];return r=typeof r.then=="function"?El(r):r,i=i.useState()[0],(Pt!==null?Pt.memoizedState:null)!==i&&(at.flags|=1024),r}function mf(){var i=Tu!==0;return Tu=0,i}function pf(i,r,c){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~c}function ff(i){if(Iu){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Iu=!1}bi=0,fn=Pt=at=null,Xo=!1,Al=Tu=0,Jo=null}function Un(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?at.memoizedState=fn=i:fn=fn.next=i,fn}function cn(){if(Pt===null){var i=at.alternate;i=i!==null?i.memoizedState:null}else i=Pt.next;var r=fn===null?at.memoizedState:fn.next;if(r!==null)fn=r,Pt=i;else{if(i===null)throw at.alternate===null?Error(a(467)):Error(a(310));Pt=i,i={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},fn===null?at.memoizedState=fn=i:fn=fn.next=i}return fn}function Nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function El(i){var r=Al;return Al+=1,Jo===null&&(Jo=[]),i=d1(Jo,i,r),r=at,(fn===null?r.memoizedState:fn.next)===null&&(r=r.alternate,Q.H=r===null||r.memoizedState===null?nS:Af),i}function Ou(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return El(i);if(i.$$typeof===q)return Tn(i)}throw Error(a(438,String(i)))}function hf(i){var r=null,c=at.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var g=at.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(y){return y.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Nu(),at.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(i),g=0;g<i;g++)c[g]=we;return r.index++,c}function Si(i,r){return typeof r=="function"?r(i):r}function ju(i){var r=cn();return gf(r,Pt,i)}function gf(i,r,c){var g=i.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=c;var y=i.baseQueue,k=g.pending;if(k!==null){if(y!==null){var _=y.next;y.next=k.next,k.next=_}r.baseQueue=y=k,g.pending=null}if(k=i.baseState,y===null)i.memoizedState=k;else{r=y.next;var P=_=null,U=null,ie=r,fe=!1;do{var ye=ie.lane&-536870913;if(ye!==ie.lane?(dt&ye)===ye:(bi&ye)===ye){var oe=ie.revertLane;if(oe===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ye===Go&&(fe=!0);else if((bi&oe)===oe){ie=ie.next,oe===Go&&(fe=!0);continue}else ye={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(P=U=ye,_=k):U=U.next=ye,at.lanes|=oe,rr|=oe;ye=ie.action,eo&&c(k,ye),k=ie.hasEagerState?ie.eagerState:c(k,ye)}else oe={lane:ye,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(P=U=oe,_=k):U=U.next=oe,at.lanes|=ye,rr|=ye;ie=ie.next}while(ie!==null&&ie!==r);if(U===null?_=k:U.next=P,!sa(k,i.memoizedState)&&(hn=!0,fe&&(c=Zo,c!==null)))throw c;i.memoizedState=k,i.baseState=_,i.baseQueue=U,g.lastRenderedState=k}return y===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function vf(i){var r=cn(),c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=i;var g=c.dispatch,y=c.pending,k=r.memoizedState;if(y!==null){c.pending=null;var _=y=y.next;do k=i(k,_.action),_=_.next;while(_!==y);sa(k,r.memoizedState)||(hn=!0),r.memoizedState=k,r.baseQueue===null&&(r.baseState=k),c.lastRenderedState=k}return[k,g]}function k1(i,r,c){var g=at,y=cn(),k=ft;if(k){if(c===void 0)throw Error(a(407));c=c()}else c=r();var _=!sa((Pt||y).memoizedState,c);if(_&&(y.memoizedState=c,hn=!0),y=y.queue,Sf(C1.bind(null,g,y,i),[i]),y.getSnapshot!==r||_||fn!==null&&fn.memoizedState.tag&1){if(g.flags|=2048,es(9,{destroy:void 0},M1.bind(null,g,y,c,r),null),Lt===null)throw Error(a(349));k||(bi&127)!==0||w1(g,r,c)}return c}function w1(i,r,c){i.flags|=16384,i={getSnapshot:r,value:c},r=at.updateQueue,r===null?(r=Nu(),at.updateQueue=r,r.stores=[i]):(c=r.stores,c===null?r.stores=[i]:c.push(i))}function M1(i,r,c,g){r.value=c,r.getSnapshot=g,A1(r)&&E1(i)}function C1(i,r,c){return c(function(){A1(r)&&E1(i)})}function A1(i){var r=i.getSnapshot;i=i.value;try{var c=r();return!sa(i,c)}catch{return!0}}function E1(i){var r=Qr(i,2);r!==null&&ea(r,i,2)}function yf(i){var r=Un();if(typeof i=="function"){var c=i;if(i=c(),eo){Ot(!0);try{c()}finally{Ot(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:i},r}function R1(i,r,c,g){return i.baseState=c,gf(i,Pt,typeof g=="function"?g:Si)}function rO(i,r,c,g,y){if(zu(i))throw Error(a(485));if(i=r.action,i!==null){var k={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){k.listeners.push(_)}};Q.T!==null?c(!0):k.isTransition=!1,g(k),c=r.pending,c===null?(k.next=r.pending=k,_1(r,k)):(k.next=c.next,r.pending=c.next=k)}}function _1(i,r){var c=r.action,g=r.payload,y=i.state;if(r.isTransition){var k=Q.T,_={};Q.T=_;try{var P=c(y,g),U=Q.S;U!==null&&U(_,P),I1(i,r,P)}catch(ie){bf(i,r,ie)}finally{k!==null&&_.types!==null&&(k.types=_.types),Q.T=k}}else try{k=c(y,g),I1(i,r,k)}catch(ie){bf(i,r,ie)}}function I1(i,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(g){T1(i,r,g)},function(g){return bf(i,r,g)}):T1(i,r,c)}function T1(i,r,c){r.status="fulfilled",r.value=c,N1(r),i.state=c,r=i.pending,r!==null&&(c=r.next,c===r?i.pending=null:(c=c.next,r.next=c,_1(i,c)))}function bf(i,r,c){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=c,N1(r),r=r.next;while(r!==g)}i.action=null}function N1(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function O1(i,r){return r}function j1(i,r){if(ft){var c=Lt.formState;if(c!==null){e:{var g=at;if(ft){if(Ht){t:{for(var y=Ht,k=Ea;y.nodeType!==8;){if(!k){y=null;break t}if(y=_a(y.nextSibling),y===null){y=null;break t}}k=y.data,y=k==="F!"||k==="F"?y:null}if(y){Ht=_a(y.nextSibling),g=y.data==="F!";break e}}Wi(g)}g=!1}g&&(r=c[0])}}return c=Un(),c.memoizedState=c.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O1,lastRenderedState:r},c.queue=g,c=J1.bind(null,at,g),g.dispatch=c,g=yf(!1),k=Cf.bind(null,at,!1,g.queue),g=Un(),y={state:r,dispatch:null,action:i,pending:null},g.queue=y,c=rO.bind(null,at,y,k,c),y.dispatch=c,g.memoizedState=i,[r,c,!1]}function P1(i){var r=cn();return D1(r,Pt,i)}function D1(i,r,c){if(r=gf(i,r,O1)[0],i=ju(Si)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=El(r)}catch(_){throw _===Ko?Mu:_}else g=r;r=cn();var y=r.queue,k=y.dispatch;return c!==r.memoizedState&&(at.flags|=2048,es(9,{destroy:void 0},oO.bind(null,y,c),null)),[g,k,i]}function oO(i,r){i.action=r}function z1(i){var r=cn(),c=Pt;if(c!==null)return D1(r,c,i);cn(),r=r.memoizedState,c=cn();var g=c.queue.dispatch;return c.memoizedState=i,[r,g,!1]}function es(i,r,c,g){return i={tag:i,create:c,deps:g,inst:r,next:null},r=at.updateQueue,r===null&&(r=Nu(),at.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=i.next=i:(g=c.next,c.next=i,i.next=g,r.lastEffect=i),i}function L1(){return cn().memoizedState}function Pu(i,r,c,g){var y=Un();at.flags|=i,y.memoizedState=es(1|r,{destroy:void 0},c,g===void 0?null:g)}function Du(i,r,c,g){var y=cn();g=g===void 0?null:g;var k=y.memoizedState.inst;Pt!==null&&g!==null&&uf(g,Pt.memoizedState.deps)?y.memoizedState=es(r,k,c,g):(at.flags|=i,y.memoizedState=es(1|r,k,c,g))}function q1(i,r){Pu(8390656,8,i,r)}function Sf(i,r){Du(2048,8,i,r)}function sO(i){at.flags|=4;var r=at.updateQueue;if(r===null)r=Nu(),at.updateQueue=r,r.events=[i];else{var c=r.events;c===null?r.events=[i]:c.push(i)}}function B1(i){var r=cn().memoizedState;return sO({ref:r,nextImpl:i}),function(){if((wt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function U1(i,r){return Du(4,2,i,r)}function F1(i,r){return Du(4,4,i,r)}function H1(i,r){if(typeof r=="function"){i=i();var c=r(i);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function $1(i,r,c){c=c!=null?c.concat([i]):null,Du(4,4,H1.bind(null,r,i),c)}function xf(){}function Q1(i,r){var c=cn();r=r===void 0?null:r;var g=c.memoizedState;return r!==null&&uf(r,g[1])?g[0]:(c.memoizedState=[i,r],i)}function V1(i,r){var c=cn();r=r===void 0?null:r;var g=c.memoizedState;if(r!==null&&uf(r,g[1]))return g[0];if(g=i(),eo){Ot(!0);try{i()}finally{Ot(!1)}}return c.memoizedState=[g,r],g}function kf(i,r,c){return c===void 0||(bi&1073741824)!==0&&(dt&261930)===0?i.memoizedState=r:(i.memoizedState=c,i=GS(),at.lanes|=i,rr|=i,c)}function G1(i,r,c,g){return sa(c,r)?c:Yo.current!==null?(i=kf(i,c,g),sa(i,r)||(hn=!0),i):(bi&42)===0||(bi&1073741824)!==0&&(dt&261930)===0?(hn=!0,i.memoizedState=c):(i=GS(),at.lanes|=i,rr|=i,r)}function Z1(i,r,c,g,y){var k=me.p;me.p=k!==0&&8>k?k:8;var _=Q.T,P={};Q.T=P,Cf(i,!1,r,c);try{var U=y(),ie=Q.S;if(ie!==null&&ie(P,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var fe=nO(U,g);Rl(i,r,fe,pa(i))}else Rl(i,r,g,pa(i))}catch(ye){Rl(i,r,{then:function(){},status:"rejected",reason:ye},pa())}finally{me.p=k,_!==null&&P.types!==null&&(_.types=P.types),Q.T=_}}function lO(){}function wf(i,r,c,g){if(i.tag!==5)throw Error(a(476));var y=K1(i).queue;Z1(i,y,r,xe,c===null?lO:function(){return W1(i),c(g)})}function K1(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:xe},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:c},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function W1(i){var r=K1(i);r.next===null&&(r=i.alternate.memoizedState),Rl(i,r.next.queue,{},pa())}function Mf(){return Tn(Ql)}function Y1(){return cn().memoizedState}function X1(){return cn().memoizedState}function cO(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var c=pa();i=Ji(c);var g=er(r,i,c);g!==null&&(ea(g,r,c),wl(g,r,c)),r={cache:Xp()},i.payload=r;return}r=r.return}}function uO(i,r,c){var g=pa();c={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},zu(i)?eS(r,c):(c=Up(i,r,c,g),c!==null&&(ea(c,i,g),tS(c,r,g)))}function J1(i,r,c){var g=pa();Rl(i,r,c,g)}function Rl(i,r,c,g){var y={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(zu(i))eS(r,y);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=r.lastRenderedReducer,k!==null))try{var _=r.lastRenderedState,P=k(_,c);if(y.hasEagerState=!0,y.eagerState=P,sa(P,_))return vu(i,r,y,0),Lt===null&&gu(),!1}catch{}if(c=Up(i,r,y,g),c!==null)return ea(c,i,g),tS(c,r,g),!0}return!1}function Cf(i,r,c,g){if(g={lane:2,revertLane:ah(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},zu(i)){if(r)throw Error(a(479))}else r=Up(i,c,g,2),r!==null&&ea(r,i,2)}function zu(i){var r=i.alternate;return i===at||r!==null&&r===at}function eS(i,r){Xo=Iu=!0;var c=i.pending;c===null?r.next=r:(r.next=c.next,c.next=r),i.pending=r}function tS(i,r,c){if((c&4194048)!==0){var g=r.lanes;g&=i.pendingLanes,c|=g,r.lanes=c,il(i,c)}}var _l={readContext:Tn,use:Ou,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};_l.useEffectEvent=en;var nS={readContext:Tn,use:Ou,useCallback:function(i,r){return Un().memoizedState=[i,r===void 0?null:r],i},useContext:Tn,useEffect:q1,useImperativeHandle:function(i,r,c){c=c!=null?c.concat([i]):null,Pu(4194308,4,H1.bind(null,r,i),c)},useLayoutEffect:function(i,r){return Pu(4194308,4,i,r)},useInsertionEffect:function(i,r){Pu(4,2,i,r)},useMemo:function(i,r){var c=Un();r=r===void 0?null:r;var g=i();if(eo){Ot(!0);try{i()}finally{Ot(!1)}}return c.memoizedState=[g,r],g},useReducer:function(i,r,c){var g=Un();if(c!==void 0){var y=c(r);if(eo){Ot(!0);try{c(r)}finally{Ot(!1)}}}else y=r;return g.memoizedState=g.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},g.queue=i,i=i.dispatch=uO.bind(null,at,i),[g.memoizedState,i]},useRef:function(i){var r=Un();return i={current:i},r.memoizedState=i},useState:function(i){i=yf(i);var r=i.queue,c=J1.bind(null,at,r);return r.dispatch=c,[i.memoizedState,c]},useDebugValue:xf,useDeferredValue:function(i,r){var c=Un();return kf(c,i,r)},useTransition:function(){var i=yf(!1);return i=Z1.bind(null,at,i.queue,!0,!1),Un().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,c){var g=at,y=Un();if(ft){if(c===void 0)throw Error(a(407));c=c()}else{if(c=r(),Lt===null)throw Error(a(349));(dt&127)!==0||w1(g,r,c)}y.memoizedState=c;var k={value:c,getSnapshot:r};return y.queue=k,q1(C1.bind(null,g,k,i),[i]),g.flags|=2048,es(9,{destroy:void 0},M1.bind(null,g,k,c,r),null),c},useId:function(){var i=Un(),r=Lt.identifierPrefix;if(ft){var c=Ya,g=Wa;c=(g&~(1<<32-Jt(g)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Tu++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=aO++,r="_"+r+"r_"+c.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Mf,useFormState:j1,useActionState:j1,useOptimistic:function(i){var r=Un();r.memoizedState=r.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=Cf.bind(null,at,!0,c),c.dispatch=r,[i,r]},useMemoCache:hf,useCacheRefresh:function(){return Un().memoizedState=cO.bind(null,at)},useEffectEvent:function(i){var r=Un(),c={impl:i};return r.memoizedState=c,function(){if((wt&2)!==0)throw Error(a(440));return c.impl.apply(void 0,arguments)}}},Af={readContext:Tn,use:Ou,useCallback:Q1,useContext:Tn,useEffect:Sf,useImperativeHandle:$1,useInsertionEffect:U1,useLayoutEffect:F1,useMemo:V1,useReducer:ju,useRef:L1,useState:function(){return ju(Si)},useDebugValue:xf,useDeferredValue:function(i,r){var c=cn();return G1(c,Pt.memoizedState,i,r)},useTransition:function(){var i=ju(Si)[0],r=cn().memoizedState;return[typeof i=="boolean"?i:El(i),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:Mf,useFormState:P1,useActionState:P1,useOptimistic:function(i,r){var c=cn();return R1(c,Pt,i,r)},useMemoCache:hf,useCacheRefresh:X1};Af.useEffectEvent=B1;var aS={readContext:Tn,use:Ou,useCallback:Q1,useContext:Tn,useEffect:Sf,useImperativeHandle:$1,useInsertionEffect:U1,useLayoutEffect:F1,useMemo:V1,useReducer:vf,useRef:L1,useState:function(){return vf(Si)},useDebugValue:xf,useDeferredValue:function(i,r){var c=cn();return Pt===null?kf(c,i,r):G1(c,Pt.memoizedState,i,r)},useTransition:function(){var i=vf(Si)[0],r=cn().memoizedState;return[typeof i=="boolean"?i:El(i),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:Mf,useFormState:z1,useActionState:z1,useOptimistic:function(i,r){var c=cn();return Pt!==null?R1(c,Pt,i,r):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:hf,useCacheRefresh:X1};aS.useEffectEvent=B1;function Ef(i,r,c,g){r=i.memoizedState,c=c(g,r),c=c==null?r:w({},r,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Rf={enqueueSetState:function(i,r,c){i=i._reactInternals;var g=pa(),y=Ji(g);y.payload=r,c!=null&&(y.callback=c),r=er(i,y,g),r!==null&&(ea(r,i,g),wl(r,i,g))},enqueueReplaceState:function(i,r,c){i=i._reactInternals;var g=pa(),y=Ji(g);y.tag=1,y.payload=r,c!=null&&(y.callback=c),r=er(i,y,g),r!==null&&(ea(r,i,g),wl(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var c=pa(),g=Ji(c);g.tag=2,r!=null&&(g.callback=r),r=er(i,g,c),r!==null&&(ea(r,i,c),wl(r,i,c))}};function iS(i,r,c,g,y,k,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,k,_):r.prototype&&r.prototype.isPureReactComponent?!hl(c,g)||!hl(y,k):!0}function rS(i,r,c,g){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,g),r.state!==i&&Rf.enqueueReplaceState(r,r.state,null)}function to(i,r){var c=r;if("ref"in r){c={};for(var g in r)g!=="ref"&&(c[g]=r[g])}if(i=i.defaultProps){c===r&&(c=w({},c));for(var y in i)c[y]===void 0&&(c[y]=i[y])}return c}function oS(i){hu(i)}function sS(i){console.error(i)}function lS(i){hu(i)}function Lu(i,r){try{var c=i.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function cS(i,r,c){try{var g=i.onCaughtError;g(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function _f(i,r,c){return c=Ji(c),c.tag=3,c.payload={element:null},c.callback=function(){Lu(i,r)},c}function uS(i){return i=Ji(i),i.tag=3,i}function dS(i,r,c,g){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var k=g.value;i.payload=function(){return y(k)},i.callback=function(){cS(r,c,g)}}var _=c.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(i.callback=function(){cS(r,c,g),typeof y!="function"&&(or===null?or=new Set([this]):or.add(this));var P=g.stack;this.componentDidCatch(g.value,{componentStack:P!==null?P:""})})}function dO(i,r,c,g,y){if(c.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=c.alternate,r!==null&&Vo(r,c,y,!0),c=ca.current,c!==null){switch(c.tag){case 31:case 13:return Ra===null?Wu():c.alternate===null&&tn===0&&(tn=3),c.flags&=-257,c.flags|=65536,c.lanes=y,g===Cu?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([g]):r.add(g),eh(i,g,y)),!1;case 22:return c.flags|=65536,g===Cu?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([g]):c.add(g)),eh(i,g,y)),!1}throw Error(a(435,c.tag))}return eh(i,g,y),Wu(),!1}if(ft)return r=ca.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=y,g!==Gp&&(i=Error(a(422),{cause:g}),yl(Ma(i,c)))):(g!==Gp&&(r=Error(a(423),{cause:g}),yl(Ma(r,c))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,g=Ma(g,c),y=_f(i.stateNode,g,y),rf(i,y),tn!==4&&(tn=2)),!1;var k=Error(a(520),{cause:g});if(k=Ma(k,c),zl===null?zl=[k]:zl.push(k),tn!==4&&(tn=2),r===null)return!0;g=Ma(g,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,i=y&-y,c.lanes|=i,i=_f(c.stateNode,g,i),rf(c,i),!1;case 1:if(r=c.type,k=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(or===null||!or.has(k))))return c.flags|=65536,y&=-y,c.lanes|=y,y=uS(y),dS(y,i,c,g),rf(c,y),!1}c=c.return}while(c!==null);return!1}var If=Error(a(461)),hn=!1;function Nn(i,r,c,g){r.child=i===null?h1(r,null,c,g):Jr(r,i.child,c,g)}function mS(i,r,c,g,y){c=c.render;var k=r.ref;if("ref"in g){var _={};for(var P in g)P!=="ref"&&(_[P]=g[P])}else _=g;return Kr(r),g=df(i,r,c,_,k,y),P=mf(),i!==null&&!hn?(pf(i,r,y),xi(i,r,y)):(ft&&P&&Qp(r),r.flags|=1,Nn(i,r,g,y),r.child)}function pS(i,r,c,g,y){if(i===null){var k=c.type;return typeof k=="function"&&!Fp(k)&&k.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=k,fS(i,r,k,g,y)):(i=bu(c.type,null,g,r,r.mode,y),i.ref=r.ref,i.return=r,r.child=i)}if(k=i.child,!Lf(i,y)){var _=k.memoizedProps;if(c=c.compare,c=c!==null?c:hl,c(_,g)&&i.ref===r.ref)return xi(i,r,y)}return r.flags|=1,i=hi(k,g),i.ref=r.ref,i.return=r,r.child=i}function fS(i,r,c,g,y){if(i!==null){var k=i.memoizedProps;if(hl(k,g)&&i.ref===r.ref)if(hn=!1,r.pendingProps=g=k,Lf(i,y))(i.flags&131072)!==0&&(hn=!0);else return r.lanes=i.lanes,xi(i,r,y)}return Tf(i,r,c,g,y)}function hS(i,r,c,g){var y=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|c:c,i!==null){for(g=r.child=i.child,y=0;g!==null;)y=y|g.lanes|g.childLanes,g=g.sibling;g=y&~k}else g=0,r.child=null;return gS(i,r,k,c,g)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&wu(r,k!==null?k.cachePool:null),k!==null?y1(r,k):sf(),b1(r);else return g=r.lanes=536870912,gS(i,r,k!==null?k.baseLanes|c:c,c,g)}else k!==null?(wu(r,k.cachePool),y1(r,k),nr(),r.memoizedState=null):(i!==null&&wu(r,null),sf(),nr());return Nn(i,r,y,c),r.child}function Il(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function gS(i,r,c,g,y){var k=ef();return k=k===null?null:{parent:pn._currentValue,pool:k},r.memoizedState={baseLanes:c,cachePool:k},i!==null&&wu(r,null),sf(),b1(r),i!==null&&Vo(i,r,g,!0),r.childLanes=y,null}function qu(i,r){return r=Uu({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function vS(i,r,c){return Jr(r,i.child,null,c),i=qu(r,r.pendingProps),i.flags|=2,ua(r),r.memoizedState=null,i}function mO(i,r,c){var g=r.pendingProps,y=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(ft){if(g.mode==="hidden")return i=qu(r,g),r.lanes=536870912,Il(null,i);if(cf(r),(i=Ht)?(i=_x(i,Ea),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Zi!==null?{id:Wa,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},c=e1(i),c.return=r,r.child=c,In=r,Ht=null)):i=null,i===null)throw Wi(r);return r.lanes=536870912,null}return qu(r,g)}var k=i.memoizedState;if(k!==null){var _=k.dehydrated;if(cf(r),y)if(r.flags&256)r.flags&=-257,r=vS(i,r,c);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(hn||Vo(i,r,c,!1),y=(c&i.childLanes)!==0,hn||y){if(g=Lt,g!==null&&(_=rl(g,c),_!==0&&_!==k.retryLane))throw k.retryLane=_,Qr(i,_),ea(g,i,_),If;Wu(),r=vS(i,r,c)}else i=k.treeContext,Ht=_a(_.nextSibling),In=r,ft=!0,Ki=null,Ea=!1,i!==null&&a1(r,i),r=qu(r,g),r.flags|=4096;return r}return i=hi(i.child,{mode:g.mode,children:g.children}),i.ref=r.ref,r.child=i,i.return=r,i}function Bu(i,r){var c=r.ref;if(c===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(a(284));(i===null||i.ref!==c)&&(r.flags|=4194816)}}function Tf(i,r,c,g,y){return Kr(r),c=df(i,r,c,g,void 0,y),g=mf(),i!==null&&!hn?(pf(i,r,y),xi(i,r,y)):(ft&&g&&Qp(r),r.flags|=1,Nn(i,r,c,y),r.child)}function yS(i,r,c,g,y,k){return Kr(r),r.updateQueue=null,c=x1(r,g,c,y),S1(i),g=mf(),i!==null&&!hn?(pf(i,r,k),xi(i,r,k)):(ft&&g&&Qp(r),r.flags|=1,Nn(i,r,c,k),r.child)}function bS(i,r,c,g,y){if(Kr(r),r.stateNode===null){var k=Fo,_=c.contextType;typeof _=="object"&&_!==null&&(k=Tn(_)),k=new c(g,k),r.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Rf,r.stateNode=k,k._reactInternals=r,k=r.stateNode,k.props=g,k.state=r.memoizedState,k.refs={},nf(r),_=c.contextType,k.context=typeof _=="object"&&_!==null?Tn(_):Fo,k.state=r.memoizedState,_=c.getDerivedStateFromProps,typeof _=="function"&&(Ef(r,c,_,g),k.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(_=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),_!==k.state&&Rf.enqueueReplaceState(k,k.state,null),Cl(r,g,k,y),Ml(),k.state=r.memoizedState),typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(i===null){k=r.stateNode;var P=r.memoizedProps,U=to(c,P);k.props=U;var ie=k.context,fe=c.contextType;_=Fo,typeof fe=="object"&&fe!==null&&(_=Tn(fe));var ye=c.getDerivedStateFromProps;fe=typeof ye=="function"||typeof k.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,fe||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P||ie!==_)&&rS(r,k,g,_),Xi=!1;var oe=r.memoizedState;k.state=oe,Cl(r,g,k,y),Ml(),ie=r.memoizedState,P||oe!==ie||Xi?(typeof ye=="function"&&(Ef(r,c,ye,g),ie=r.memoizedState),(U=Xi||iS(r,c,U,g,oe,ie,_))?(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=ie),k.props=g,k.state=ie,k.context=_,g=U):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{k=r.stateNode,af(i,r),_=r.memoizedProps,fe=to(c,_),k.props=fe,ye=r.pendingProps,oe=k.context,ie=c.contextType,U=Fo,typeof ie=="object"&&ie!==null&&(U=Tn(ie)),P=c.getDerivedStateFromProps,(ie=typeof P=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(_!==ye||oe!==U)&&rS(r,k,g,U),Xi=!1,oe=r.memoizedState,k.state=oe,Cl(r,g,k,y),Ml();var le=r.memoizedState;_!==ye||oe!==le||Xi||i!==null&&i.dependencies!==null&&xu(i.dependencies)?(typeof P=="function"&&(Ef(r,c,P,g),le=r.memoizedState),(fe=Xi||iS(r,c,fe,g,oe,le,U)||i!==null&&i.dependencies!==null&&xu(i.dependencies))?(ie||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,le,U),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,le,U)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||_===i.memoizedProps&&oe===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&oe===i.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=le),k.props=g,k.state=le,k.context=U,g=fe):(typeof k.componentDidUpdate!="function"||_===i.memoizedProps&&oe===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&oe===i.memoizedState||(r.flags|=1024),g=!1)}return k=g,Bu(i,r),g=(r.flags&128)!==0,k||g?(k=r.stateNode,c=g&&typeof c.getDerivedStateFromError!="function"?null:k.render(),r.flags|=1,i!==null&&g?(r.child=Jr(r,i.child,null,y),r.child=Jr(r,null,c,y)):Nn(i,r,c,y),r.memoizedState=k.state,i=r.child):i=xi(i,r,y),i}function SS(i,r,c,g){return Gr(),r.flags|=256,Nn(i,r,c,g),r.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Of(i){return{baseLanes:i,cachePool:c1()}}function jf(i,r,c){return i=i!==null?i.childLanes&~c:0,r&&(i|=ma),i}function xS(i,r,c){var g=r.pendingProps,y=!1,k=(r.flags&128)!==0,_;if((_=k)||(_=i!==null&&i.memoizedState===null?!1:(ln.current&2)!==0),_&&(y=!0,r.flags&=-129),_=(r.flags&32)!==0,r.flags&=-33,i===null){if(ft){if(y?tr(r):nr(),(i=Ht)?(i=_x(i,Ea),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Zi!==null?{id:Wa,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},c=e1(i),c.return=r,r.child=c,In=r,Ht=null)):i=null,i===null)throw Wi(r);return gh(i)?r.lanes=32:r.lanes=536870912,null}var P=g.children;return g=g.fallback,y?(nr(),y=r.mode,P=Uu({mode:"hidden",children:P},y),g=Vr(g,y,c,null),P.return=r,g.return=r,P.sibling=g,r.child=P,g=r.child,g.memoizedState=Of(c),g.childLanes=jf(i,_,c),r.memoizedState=Nf,Il(null,g)):(tr(r),Pf(r,P))}var U=i.memoizedState;if(U!==null&&(P=U.dehydrated,P!==null)){if(k)r.flags&256?(tr(r),r.flags&=-257,r=Df(i,r,c)):r.memoizedState!==null?(nr(),r.child=i.child,r.flags|=128,r=null):(nr(),P=g.fallback,y=r.mode,g=Uu({mode:"visible",children:g.children},y),P=Vr(P,y,c,null),P.flags|=2,g.return=r,P.return=r,g.sibling=P,r.child=g,Jr(r,i.child,null,c),g=r.child,g.memoizedState=Of(c),g.childLanes=jf(i,_,c),r.memoizedState=Nf,r=Il(null,g));else if(tr(r),gh(P)){if(_=P.nextSibling&&P.nextSibling.dataset,_)var ie=_.dgst;_=ie,g=Error(a(419)),g.stack="",g.digest=_,yl({value:g,source:null,stack:null}),r=Df(i,r,c)}else if(hn||Vo(i,r,c,!1),_=(c&i.childLanes)!==0,hn||_){if(_=Lt,_!==null&&(g=rl(_,c),g!==0&&g!==U.retryLane))throw U.retryLane=g,Qr(i,g),ea(_,i,g),If;hh(P)||Wu(),r=Df(i,r,c)}else hh(P)?(r.flags|=192,r.child=i.child,r=null):(i=U.treeContext,Ht=_a(P.nextSibling),In=r,ft=!0,Ki=null,Ea=!1,i!==null&&a1(r,i),r=Pf(r,g.children),r.flags|=4096);return r}return y?(nr(),P=g.fallback,y=r.mode,U=i.child,ie=U.sibling,g=hi(U,{mode:"hidden",children:g.children}),g.subtreeFlags=U.subtreeFlags&65011712,ie!==null?P=hi(ie,P):(P=Vr(P,y,c,null),P.flags|=2),P.return=r,g.return=r,g.sibling=P,r.child=g,Il(null,g),g=r.child,P=i.child.memoizedState,P===null?P=Of(c):(y=P.cachePool,y!==null?(U=pn._currentValue,y=y.parent!==U?{parent:U,pool:U}:y):y=c1(),P={baseLanes:P.baseLanes|c,cachePool:y}),g.memoizedState=P,g.childLanes=jf(i,_,c),r.memoizedState=Nf,Il(i.child,g)):(tr(r),c=i.child,i=c.sibling,c=hi(c,{mode:"visible",children:g.children}),c.return=r,c.sibling=null,i!==null&&(_=r.deletions,_===null?(r.deletions=[i],r.flags|=16):_.push(i)),r.child=c,r.memoizedState=null,c)}function Pf(i,r){return r=Uu({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function Uu(i,r){return i=la(22,i,null,r),i.lanes=0,i}function Df(i,r,c){return Jr(r,i.child,null,c),i=Pf(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function kS(i,r,c){i.lanes|=r;var g=i.alternate;g!==null&&(g.lanes|=r),Wp(i.return,r,c)}function zf(i,r,c,g,y,k){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:c,tailMode:y,treeForkCount:k}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=g,_.tail=c,_.tailMode=y,_.treeForkCount=k)}function wS(i,r,c){var g=r.pendingProps,y=g.revealOrder,k=g.tail;g=g.children;var _=ln.current,P=(_&2)!==0;if(P?(_=_&1|2,r.flags|=128):_&=1,pe(ln,_),Nn(i,r,g,c),g=ft?vl:0,!P&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&kS(i,c,r);else if(i.tag===19)kS(i,c,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(y){case"forwards":for(c=r.child,y=null;c!==null;)i=c.alternate,i!==null&&_u(i)===null&&(y=c),c=c.sibling;c=y,c===null?(y=r.child,r.child=null):(y=c.sibling,c.sibling=null),zf(r,!1,y,c,k,g);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=r.child,r.child=null;y!==null;){if(i=y.alternate,i!==null&&_u(i)===null){r.child=y;break}i=y.sibling,y.sibling=c,c=y,y=i}zf(r,!0,c,null,k,g);break;case"together":zf(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function xi(i,r,c){if(i!==null&&(r.dependencies=i.dependencies),rr|=r.lanes,(c&r.childLanes)===0)if(i!==null){if(Vo(i,r,c,!1),(c&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,c=hi(i,i.pendingProps),r.child=c,c.return=r;i.sibling!==null;)i=i.sibling,c=c.sibling=hi(i,i.pendingProps),c.return=r;c.sibling=null}return r.child}function Lf(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&xu(i)))}function pO(i,r,c){switch(r.tag){case 3:ke(r,r.stateNode.containerInfo),Yi(r,pn,i.memoizedState.cache),Gr();break;case 27:case 5:vt(r);break;case 4:ke(r,r.stateNode.containerInfo);break;case 10:Yi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,cf(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(tr(r),r.flags|=128,null):(c&r.child.childLanes)!==0?xS(i,r,c):(tr(r),i=xi(i,r,c),i!==null?i.sibling:null);tr(r);break;case 19:var y=(i.flags&128)!==0;if(g=(c&r.childLanes)!==0,g||(Vo(i,r,c,!1),g=(c&r.childLanes)!==0),y){if(g)return wS(i,r,c);r.flags|=128}if(y=r.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),pe(ln,ln.current),g)break;return null;case 22:return r.lanes=0,hS(i,r,c,r.pendingProps);case 24:Yi(r,pn,i.memoizedState.cache)}return xi(i,r,c)}function MS(i,r,c){if(i!==null)if(i.memoizedProps!==r.pendingProps)hn=!0;else{if(!Lf(i,c)&&(r.flags&128)===0)return hn=!1,pO(i,r,c);hn=(i.flags&131072)!==0}else hn=!1,ft&&(r.flags&1048576)!==0&&n1(r,vl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var g=r.pendingProps;if(i=Yr(r.elementType),r.type=i,typeof i=="function")Fp(i)?(g=to(i,g),r.tag=1,r=bS(null,r,i,g,c)):(r.tag=0,r=Tf(null,r,i,g,c));else{if(i!=null){var y=i.$$typeof;if(y===L){r.tag=11,r=mS(null,r,i,g,c);break e}else if(y===$){r.tag=14,r=pS(null,r,i,g,c);break e}}throw r=Se(i)||i,Error(a(306,r,""))}}return r;case 0:return Tf(i,r,r.type,r.pendingProps,c);case 1:return g=r.type,y=to(g,r.pendingProps),bS(i,r,g,y,c);case 3:e:{if(ke(r,r.stateNode.containerInfo),i===null)throw Error(a(387));g=r.pendingProps;var k=r.memoizedState;y=k.element,af(i,r),Cl(r,g,null,c);var _=r.memoizedState;if(g=_.cache,Yi(r,pn,g),g!==k.cache&&Yp(r,[pn],c,!0),Ml(),g=_.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:_.cache},r.updateQueue.baseState=k,r.memoizedState=k,r.flags&256){r=SS(i,r,g,c);break e}else if(g!==y){y=Ma(Error(a(424)),r),yl(y),r=SS(i,r,g,c);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ht=_a(i.firstChild),In=r,ft=!0,Ki=null,Ea=!0,c=h1(r,null,g,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Gr(),g===y){r=xi(i,r,c);break e}Nn(i,r,g,c)}r=r.child}return r;case 26:return Bu(i,r),i===null?(c=Px(r.type,null,r.pendingProps,null))?r.memoizedState=c:ft||(c=r.type,i=r.pendingProps,g=ad(ee.current).createElement(c),g[mn]=r,g[on]=i,On(g,c,i),Ve(g),r.stateNode=g):r.memoizedState=Px(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return vt(r),i===null&&ft&&(g=r.stateNode=Nx(r.type,r.pendingProps,ee.current),In=r,Ea=!0,y=Ht,ur(r.type)?(vh=y,Ht=_a(g.firstChild)):Ht=y),Nn(i,r,r.pendingProps.children,c),Bu(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&ft&&((y=g=Ht)&&(g=HO(g,r.type,r.pendingProps,Ea),g!==null?(r.stateNode=g,In=r,Ht=_a(g.firstChild),Ea=!1,y=!0):y=!1),y||Wi(r)),vt(r),y=r.type,k=r.pendingProps,_=i!==null?i.memoizedProps:null,g=k.children,mh(y,k)?g=null:_!==null&&mh(y,_)&&(r.flags|=32),r.memoizedState!==null&&(y=df(i,r,iO,null,null,c),Ql._currentValue=y),Bu(i,r),Nn(i,r,g,c),r.child;case 6:return i===null&&ft&&((i=c=Ht)&&(c=$O(c,r.pendingProps,Ea),c!==null?(r.stateNode=c,In=r,Ht=null,i=!0):i=!1),i||Wi(r)),null;case 13:return xS(i,r,c);case 4:return ke(r,r.stateNode.containerInfo),g=r.pendingProps,i===null?r.child=Jr(r,null,g,c):Nn(i,r,g,c),r.child;case 11:return mS(i,r,r.type,r.pendingProps,c);case 7:return Nn(i,r,r.pendingProps,c),r.child;case 8:return Nn(i,r,r.pendingProps.children,c),r.child;case 12:return Nn(i,r,r.pendingProps.children,c),r.child;case 10:return g=r.pendingProps,Yi(r,r.type,g.value),Nn(i,r,g.children,c),r.child;case 9:return y=r.type._context,g=r.pendingProps.children,Kr(r),y=Tn(y),g=g(y),r.flags|=1,Nn(i,r,g,c),r.child;case 14:return pS(i,r,r.type,r.pendingProps,c);case 15:return fS(i,r,r.type,r.pendingProps,c);case 19:return wS(i,r,c);case 31:return mO(i,r,c);case 22:return hS(i,r,c,r.pendingProps);case 24:return Kr(r),g=Tn(pn),i===null?(y=ef(),y===null&&(y=Lt,k=Xp(),y.pooledCache=k,k.refCount++,k!==null&&(y.pooledCacheLanes|=c),y=k),r.memoizedState={parent:g,cache:y},nf(r),Yi(r,pn,y)):((i.lanes&c)!==0&&(af(i,r),Cl(r,null,null,c),Ml()),y=i.memoizedState,k=r.memoizedState,y.parent!==g?(y={parent:g,cache:g},r.memoizedState=y,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=y),Yi(r,pn,g)):(g=k.cache,Yi(r,pn,g),g!==y.cache&&Yp(r,[pn],c,!0))),Nn(i,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function ki(i){i.flags|=4}function qf(i,r,c,g,y){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(y&335544128)===y)if(i.stateNode.complete)i.flags|=8192;else if(YS())i.flags|=8192;else throw Xr=Cu,tf}else i.flags&=-16777217}function CS(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Bx(r))if(YS())i.flags|=8192;else throw Xr=Cu,tf}function Fu(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?ja():536870912,i.lanes|=r,is|=r)}function Tl(i,r){if(!ft)switch(i.tailMode){case"hidden":r=i.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function $t(i){var r=i.alternate!==null&&i.alternate.child===i.child,c=0,g=0;if(r)for(var y=i.child;y!==null;)c|=y.lanes|y.childLanes,g|=y.subtreeFlags&65011712,g|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)c|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=g,i.childLanes=c,r}function fO(i,r,c){var g=r.pendingProps;switch(Vp(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(r),null;case 1:return $t(r),null;case 3:return c=r.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),yi(pn),Ie(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Qo(r)?ki(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Zp())),$t(r),null;case 26:var y=r.type,k=r.memoizedState;return i===null?(ki(r),k!==null?($t(r),CS(r,k)):($t(r),qf(r,y,null,g,c))):k?k!==i.memoizedState?(ki(r),$t(r),CS(r,k)):($t(r),r.flags&=-16777217):(i=i.memoizedProps,i!==g&&ki(r),$t(r),qf(r,y,i,g,c)),null;case 27:if(He(r),c=ee.current,y=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&ki(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return $t(r),null}i=ge.current,Qo(r)?i1(r):(i=Nx(y,g,c),r.stateNode=i,ki(r))}return $t(r),null;case 5:if(He(r),y=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&ki(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return $t(r),null}if(k=ge.current,Qo(r))i1(r);else{var _=ad(ee.current);switch(k){case 1:k=_.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:k=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":k=_.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":k=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":k=_.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?_.createElement("select",{is:g.is}):_.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?_.createElement(y,{is:g.is}):_.createElement(y)}}k[mn]=r,k[on]=g;e:for(_=r.child;_!==null;){if(_.tag===5||_.tag===6)k.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===r)break e;for(;_.sibling===null;){if(_.return===null||_.return===r)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}r.stateNode=k;e:switch(On(k,y,g),y){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ki(r)}}return $t(r),qf(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,c),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==g&&ki(r);else{if(typeof g!="string"&&r.stateNode===null)throw Error(a(166));if(i=ee.current,Qo(r)){if(i=r.stateNode,c=r.memoizedProps,g=null,y=In,y!==null)switch(y.tag){case 27:case 5:g=y.memoizedProps}i[mn]=r,i=!!(i.nodeValue===c||g!==null&&g.suppressHydrationWarning===!0||xx(i.nodeValue,c)),i||Wi(r,!0)}else i=ad(i).createTextNode(g),i[mn]=r,r.stateNode=i}return $t(r),null;case 31:if(c=r.memoizedState,i===null||i.memoizedState!==null){if(g=Qo(r),c!==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[mn]=r}else Gr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;$t(r),i=!1}else c=Zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return r.flags&256?(ua(r),r):(ua(r),null);if((r.flags&128)!==0)throw Error(a(558))}return $t(r),null;case 13:if(g=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Qo(r),g!==null&&g.dehydrated!==null){if(i===null){if(!y)throw Error(a(318));if(y=r.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(a(317));y[mn]=r}else Gr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;$t(r),y=!1}else y=Zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return r.flags&256?(ua(r),r):(ua(r),null)}return ua(r),(r.flags&128)!==0?(r.lanes=c,r):(c=g!==null,i=i!==null&&i.memoizedState!==null,c&&(g=r.child,y=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(y=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==y&&(g.flags|=2048)),c!==i&&c&&(r.child.flags|=8192),Fu(r,r.updateQueue),$t(r),null);case 4:return Ie(),i===null&&sh(r.stateNode.containerInfo),$t(r),null;case 10:return yi(r.type),$t(r),null;case 19:if(ae(ln),g=r.memoizedState,g===null)return $t(r),null;if(y=(r.flags&128)!==0,k=g.rendering,k===null)if(y)Tl(g,!1);else{if(tn!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(k=_u(i),k!==null){for(r.flags|=128,Tl(g,!1),i=k.updateQueue,r.updateQueue=i,Fu(r,i),r.subtreeFlags=0,i=c,c=r.child;c!==null;)J0(c,i),c=c.sibling;return pe(ln,ln.current&1|2),ft&&gi(r,g.treeForkCount),r.child}i=i.sibling}g.tail!==null&&Xt()>Gu&&(r.flags|=128,y=!0,Tl(g,!1),r.lanes=4194304)}else{if(!y)if(i=_u(k),i!==null){if(r.flags|=128,y=!0,i=i.updateQueue,r.updateQueue=i,Fu(r,i),Tl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!ft)return $t(r),null}else 2*Xt()-g.renderingStartTime>Gu&&c!==536870912&&(r.flags|=128,y=!0,Tl(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=Xt(),i.sibling=null,c=ln.current,pe(ln,y?c&1|2:c&1),ft&&gi(r,g.treeForkCount),i):($t(r),null);case 22:case 23:return ua(r),lf(),g=r.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(c&536870912)!==0&&(r.flags&128)===0&&($t(r),r.subtreeFlags&6&&(r.flags|=8192)):$t(r),c=r.updateQueue,c!==null&&Fu(r,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==c&&(r.flags|=2048),i!==null&&ae(Wr),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),yi(pn),$t(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function hO(i,r){switch(Vp(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return yi(pn),Ie(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return He(r),null;case 31:if(r.memoizedState!==null){if(ua(r),r.alternate===null)throw Error(a(340));Gr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(ua(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Gr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return ae(ln),null;case 4:return Ie(),null;case 10:return yi(r.type),null;case 22:case 23:return ua(r),lf(),i!==null&&ae(Wr),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return yi(pn),null;case 25:return null;default:return null}}function AS(i,r){switch(Vp(r),r.tag){case 3:yi(pn),Ie();break;case 26:case 27:case 5:He(r);break;case 4:Ie();break;case 31:r.memoizedState!==null&&ua(r);break;case 13:ua(r);break;case 19:ae(ln);break;case 10:yi(r.type);break;case 22:case 23:ua(r),lf(),i!==null&&ae(Wr);break;case 24:yi(pn)}}function Nl(i,r){try{var c=r.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var y=g.next;c=y;do{if((c.tag&i)===i){g=void 0;var k=c.create,_=c.inst;g=k(),_.destroy=g}c=c.next}while(c!==y)}}catch(P){_t(r,r.return,P)}}function ar(i,r,c){try{var g=r.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var k=y.next;g=k;do{if((g.tag&i)===i){var _=g.inst,P=_.destroy;if(P!==void 0){_.destroy=void 0,y=r;var U=c,ie=P;try{ie()}catch(fe){_t(y,U,fe)}}}g=g.next}while(g!==k)}}catch(fe){_t(r,r.return,fe)}}function ES(i){var r=i.updateQueue;if(r!==null){var c=i.stateNode;try{v1(r,c)}catch(g){_t(i,i.return,g)}}}function RS(i,r,c){c.props=to(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(g){_t(i,r,g)}}function Ol(i,r){try{var c=i.ref;if(c!==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 c=="function"?i.refCleanup=c(g):c.current=g}}catch(y){_t(i,r,y)}}function Xa(i,r){var c=i.ref,g=i.refCleanup;if(c!==null)if(typeof g=="function")try{g()}catch(y){_t(i,r,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){_t(i,r,y)}else c.current=null}function _S(i){var r=i.type,c=i.memoizedProps,g=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&g.focus();break e;case"img":c.src?g.src=c.src:c.srcSet&&(g.srcset=c.srcSet)}}catch(y){_t(i,i.return,y)}}function Bf(i,r,c){try{var g=i.stateNode;zO(g,i.type,c,r),g[on]=r}catch(y){_t(i,i.return,y)}}function IS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ur(i.type)||i.tag===4}function Uf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||IS(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&&ur(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 Ff(i,r,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(i),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=pi));else if(g!==4&&(g===27&&ur(i.type)&&(c=i.stateNode,r=null),i=i.child,i!==null))for(Ff(i,r,c),i=i.sibling;i!==null;)Ff(i,r,c),i=i.sibling}function Hu(i,r,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?c.insertBefore(i,r):c.appendChild(i);else if(g!==4&&(g===27&&ur(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Hu(i,r,c),i=i.sibling;i!==null;)Hu(i,r,c),i=i.sibling}function TS(i){var r=i.stateNode,c=i.memoizedProps;try{for(var g=i.type,y=r.attributes;y.length;)r.removeAttributeNode(y[0]);On(r,g,c),r[mn]=i,r[on]=c}catch(k){_t(i,i.return,k)}}var wi=!1,gn=!1,Hf=!1,NS=typeof WeakSet=="function"?WeakSet:Set,Rn=null;function gO(i,r){if(i=i.containerInfo,uh=ud,i=$0(i),Pp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var g=c.getSelection&&c.getSelection();if(g&&g.rangeCount!==0){c=g.anchorNode;var y=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{c.nodeType,k.nodeType}catch{c=null;break e}var _=0,P=-1,U=-1,ie=0,fe=0,ye=i,oe=null;t:for(;;){for(var le;ye!==c||y!==0&&ye.nodeType!==3||(P=_+y),ye!==k||g!==0&&ye.nodeType!==3||(U=_+g),ye.nodeType===3&&(_+=ye.nodeValue.length),(le=ye.firstChild)!==null;)oe=ye,ye=le;for(;;){if(ye===i)break t;if(oe===c&&++ie===y&&(P=_),oe===k&&++fe===g&&(U=_),(le=ye.nextSibling)!==null)break;ye=oe,oe=ye.parentNode}ye=le}c=P===-1||U===-1?null:{start:P,end:U}}else c=null}c=c||{start:0,end:0}}else c=null;for(dh={focusedElem:i,selectionRange:c},ud=!1,Rn=r;Rn!==null;)if(r=Rn,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Rn=i;else for(;Rn!==null;){switch(r=Rn,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(c=0;c<i.length;c++)y=i[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,c=r,y=k.memoizedProps,k=k.memoizedState,g=c.stateNode;try{var ze=to(c.type,y);i=g.getSnapshotBeforeUpdate(ze,k),g.__reactInternalSnapshotBeforeUpdate=i}catch(Ze){_t(c,c.return,Ze)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,c=i.nodeType,c===9)fh(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":fh(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,Rn=i;break}Rn=r.return}}function OS(i,r,c){var g=c.flags;switch(c.tag){case 0:case 11:case 15:Ci(i,c),g&4&&Nl(5,c);break;case 1:if(Ci(i,c),g&4)if(i=c.stateNode,r===null)try{i.componentDidMount()}catch(_){_t(c,c.return,_)}else{var y=to(c.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(y,r,i.__reactInternalSnapshotBeforeUpdate)}catch(_){_t(c,c.return,_)}}g&64&&ES(c),g&512&&Ol(c,c.return);break;case 3:if(Ci(i,c),g&64&&(i=c.updateQueue,i!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{v1(i,r)}catch(_){_t(c,c.return,_)}}break;case 27:r===null&&g&4&&TS(c);case 26:case 5:Ci(i,c),r===null&&g&4&&_S(c),g&512&&Ol(c,c.return);break;case 12:Ci(i,c);break;case 31:Ci(i,c),g&4&&DS(i,c);break;case 13:Ci(i,c),g&4&&zS(i,c),g&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=CO.bind(null,c),QO(i,c))));break;case 22:if(g=c.memoizedState!==null||wi,!g){r=r!==null&&r.memoizedState!==null||gn,y=wi;var k=gn;wi=g,(gn=r)&&!k?Ai(i,c,(c.subtreeFlags&8772)!==0):Ci(i,c),wi=y,gn=k}break;case 30:break;default:Ci(i,c)}}function jS(i){var r=i.alternate;r!==null&&(i.alternate=null,jS(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&he(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 Gt=null,Wn=!1;function Mi(i,r,c){for(c=c.child;c!==null;)PS(i,r,c),c=c.sibling}function PS(i,r,c){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(Oa,c)}catch{}switch(c.tag){case 26:gn||Xa(c,r),Mi(i,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:gn||Xa(c,r);var g=Gt,y=Wn;ur(c.type)&&(Gt=c.stateNode,Wn=!1),Mi(i,r,c),Fl(c.stateNode),Gt=g,Wn=y;break;case 5:gn||Xa(c,r);case 6:if(g=Gt,y=Wn,Gt=null,Mi(i,r,c),Gt=g,Wn=y,Gt!==null)if(Wn)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(c.stateNode)}catch(k){_t(c,r,k)}else try{Gt.removeChild(c.stateNode)}catch(k){_t(c,r,k)}break;case 18:Gt!==null&&(Wn?(i=Gt,Ex(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),ms(i)):Ex(Gt,c.stateNode));break;case 4:g=Gt,y=Wn,Gt=c.stateNode.containerInfo,Wn=!0,Mi(i,r,c),Gt=g,Wn=y;break;case 0:case 11:case 14:case 15:ar(2,c,r),gn||ar(4,c,r),Mi(i,r,c);break;case 1:gn||(Xa(c,r),g=c.stateNode,typeof g.componentWillUnmount=="function"&&RS(c,r,g)),Mi(i,r,c);break;case 21:Mi(i,r,c);break;case 22:gn=(g=gn)||c.memoizedState!==null,Mi(i,r,c),gn=g;break;default:Mi(i,r,c)}}function DS(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ms(i)}catch(c){_t(r,r.return,c)}}}function zS(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ms(i)}catch(c){_t(r,r.return,c)}}function vO(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new NS),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new NS),r;default:throw Error(a(435,i.tag))}}function $u(i,r){var c=vO(i);r.forEach(function(g){if(!c.has(g)){c.add(g);var y=AO.bind(null,i,g);g.then(y,y)}})}function Yn(i,r){var c=r.deletions;if(c!==null)for(var g=0;g<c.length;g++){var y=c[g],k=i,_=r,P=_;e:for(;P!==null;){switch(P.tag){case 27:if(ur(P.type)){Gt=P.stateNode,Wn=!1;break e}break;case 5:Gt=P.stateNode,Wn=!1;break e;case 3:case 4:Gt=P.stateNode.containerInfo,Wn=!0;break e}P=P.return}if(Gt===null)throw Error(a(160));PS(k,_,y),Gt=null,Wn=!1,k=y.alternate,k!==null&&(k.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)LS(r,i),r=r.sibling}var za=null;function LS(i,r){var c=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Yn(r,i),Xn(i),g&4&&(ar(3,i,i.return),Nl(3,i),ar(5,i,i.return));break;case 1:Yn(r,i),Xn(i),g&512&&(gn||c===null||Xa(c,c.return)),g&64&&wi&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?g:c.concat(g))));break;case 26:var y=za;if(Yn(r,i),Xn(i),g&512&&(gn||c===null||Xa(c,c.return)),g&4){var k=c!==null?c.memoizedState:null;if(g=i.memoizedState,c===null)if(g===null)if(i.stateNode===null){e:{g=i.type,c=i.memoizedProps,y=y.ownerDocument||y;t:switch(g){case"title":k=y.getElementsByTagName("title")[0],(!k||k[Ur]||k[mn]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=y.createElement(g),y.head.insertBefore(k,y.querySelector("head > title"))),On(k,g,c),k[mn]=i,Ve(k),g=k;break e;case"link":var _=Lx("link","href",y).get(g+(c.href||""));if(_){for(var P=0;P<_.length;P++)if(k=_[P],k.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&k.getAttribute("rel")===(c.rel==null?null:c.rel)&&k.getAttribute("title")===(c.title==null?null:c.title)&&k.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){_.splice(P,1);break t}}k=y.createElement(g),On(k,g,c),y.head.appendChild(k);break;case"meta":if(_=Lx("meta","content",y).get(g+(c.content||""))){for(P=0;P<_.length;P++)if(k=_[P],k.getAttribute("content")===(c.content==null?null:""+c.content)&&k.getAttribute("name")===(c.name==null?null:c.name)&&k.getAttribute("property")===(c.property==null?null:c.property)&&k.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&k.getAttribute("charset")===(c.charSet==null?null:c.charSet)){_.splice(P,1);break t}}k=y.createElement(g),On(k,g,c),y.head.appendChild(k);break;default:throw Error(a(468,g))}k[mn]=i,Ve(k),g=k}i.stateNode=g}else qx(y,i.type,i.stateNode);else i.stateNode=zx(y,g,i.memoizedProps);else k!==g?(k===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):k.count--,g===null?qx(y,i.type,i.stateNode):zx(y,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Bf(i,i.memoizedProps,c.memoizedProps)}break;case 27:Yn(r,i),Xn(i),g&512&&(gn||c===null||Xa(c,c.return)),c!==null&&g&4&&Bf(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Yn(r,i),Xn(i),g&512&&(gn||c===null||Xa(c,c.return)),i.flags&32){y=i.stateNode;try{Po(y,"")}catch(ze){_t(i,i.return,ze)}}g&4&&i.stateNode!=null&&(y=i.memoizedProps,Bf(i,y,c!==null?c.memoizedProps:y)),g&1024&&(Hf=!0);break;case 6:if(Yn(r,i),Xn(i),g&4){if(i.stateNode===null)throw Error(a(162));g=i.memoizedProps,c=i.stateNode;try{c.nodeValue=g}catch(ze){_t(i,i.return,ze)}}break;case 3:if(od=null,y=za,za=id(r.containerInfo),Yn(r,i),za=y,Xn(i),g&4&&c!==null&&c.memoizedState.isDehydrated)try{ms(r.containerInfo)}catch(ze){_t(i,i.return,ze)}Hf&&(Hf=!1,qS(i));break;case 4:g=za,za=id(i.stateNode.containerInfo),Yn(r,i),Xn(i),za=g;break;case 12:Yn(r,i),Xn(i);break;case 31:Yn(r,i),Xn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,$u(i,g)));break;case 13:Yn(r,i),Xn(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Vu=Xt()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,$u(i,g)));break;case 22:y=i.memoizedState!==null;var U=c!==null&&c.memoizedState!==null,ie=wi,fe=gn;if(wi=ie||y,gn=fe||U,Yn(r,i),gn=fe,wi=ie,Xn(i),g&8192)e:for(r=i.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,y&&(c===null||U||wi||gn||no(i)),c=null,r=i;;){if(r.tag===5||r.tag===26){if(c===null){U=c=r;try{if(k=U.stateNode,y)_=k.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{P=U.stateNode;var ye=U.memoizedProps.style,oe=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(ze){_t(U,U.return,ze)}}}else if(r.tag===6){if(c===null){U=r;try{U.stateNode.nodeValue=y?"":U.memoizedProps}catch(ze){_t(U,U.return,ze)}}}else if(r.tag===18){if(c===null){U=r;try{var le=U.stateNode;y?Rx(le,!0):Rx(U.stateNode,!1)}catch(ze){_t(U,U.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;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}g&4&&(g=i.updateQueue,g!==null&&(c=g.retryQueue,c!==null&&(g.retryQueue=null,$u(i,c))));break;case 19:Yn(r,i),Xn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,$u(i,g)));break;case 30:break;case 21:break;default:Yn(r,i),Xn(i)}}function Xn(i){var r=i.flags;if(r&2){try{for(var c,g=i.return;g!==null;){if(IS(g)){c=g;break}g=g.return}if(c==null)throw Error(a(160));switch(c.tag){case 27:var y=c.stateNode,k=Uf(i);Hu(i,k,y);break;case 5:var _=c.stateNode;c.flags&32&&(Po(_,""),c.flags&=-33);var P=Uf(i);Hu(i,P,_);break;case 3:case 4:var U=c.stateNode.containerInfo,ie=Uf(i);Ff(i,ie,U);break;default:throw Error(a(161))}}catch(fe){_t(i,i.return,fe)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function qS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;qS(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Ci(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)OS(i,r.alternate,r),r=r.sibling}function no(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:ar(4,r,r.return),no(r);break;case 1:Xa(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&RS(r,r.return,c),no(r);break;case 27:Fl(r.stateNode);case 26:case 5:Xa(r,r.return),no(r);break;case 22:r.memoizedState===null&&no(r);break;case 30:no(r);break;default:no(r)}i=i.sibling}}function Ai(i,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,y=i,k=r,_=k.flags;switch(k.tag){case 0:case 11:case 15:Ai(y,k,c),Nl(4,k);break;case 1:if(Ai(y,k,c),g=k,y=g.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){_t(g,g.return,ie)}if(g=k,y=g.updateQueue,y!==null){var P=g.stateNode;try{var U=y.shared.hiddenCallbacks;if(U!==null)for(y.shared.hiddenCallbacks=null,y=0;y<U.length;y++)g1(U[y],P)}catch(ie){_t(g,g.return,ie)}}c&&_&64&&ES(k),Ol(k,k.return);break;case 27:TS(k);case 26:case 5:Ai(y,k,c),c&&g===null&&_&4&&_S(k),Ol(k,k.return);break;case 12:Ai(y,k,c);break;case 31:Ai(y,k,c),c&&_&4&&DS(y,k);break;case 13:Ai(y,k,c),c&&_&4&&zS(y,k);break;case 22:k.memoizedState===null&&Ai(y,k,c),Ol(k,k.return);break;case 30:break;default:Ai(y,k,c)}r=r.sibling}}function $f(i,r){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&bl(c))}function Qf(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&bl(i))}function La(i,r,c,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)BS(i,r,c,g),r=r.sibling}function BS(i,r,c,g){var y=r.flags;switch(r.tag){case 0:case 11:case 15:La(i,r,c,g),y&2048&&Nl(9,r);break;case 1:La(i,r,c,g);break;case 3:La(i,r,c,g),y&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&bl(i)));break;case 12:if(y&2048){La(i,r,c,g),i=r.stateNode;try{var k=r.memoizedProps,_=k.id,P=k.onPostCommit;typeof P=="function"&&P(_,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(U){_t(r,r.return,U)}}else La(i,r,c,g);break;case 31:La(i,r,c,g);break;case 13:La(i,r,c,g);break;case 23:break;case 22:k=r.stateNode,_=r.alternate,r.memoizedState!==null?k._visibility&2?La(i,r,c,g):jl(i,r):k._visibility&2?La(i,r,c,g):(k._visibility|=2,ts(i,r,c,g,(r.subtreeFlags&10256)!==0||!1)),y&2048&&$f(_,r);break;case 24:La(i,r,c,g),y&2048&&Qf(r.alternate,r);break;default:La(i,r,c,g)}}function ts(i,r,c,g,y){for(y=y&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var k=i,_=r,P=c,U=g,ie=_.flags;switch(_.tag){case 0:case 11:case 15:ts(k,_,P,U,y),Nl(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?ts(k,_,P,U,y):jl(k,_):(fe._visibility|=2,ts(k,_,P,U,y)),y&&ie&2048&&$f(_.alternate,_);break;case 24:ts(k,_,P,U,y),y&&ie&2048&&Qf(_.alternate,_);break;default:ts(k,_,P,U,y)}r=r.sibling}}function jl(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=i,g=r,y=g.flags;switch(g.tag){case 22:jl(c,g),y&2048&&$f(g.alternate,g);break;case 24:jl(c,g),y&2048&&Qf(g.alternate,g);break;default:jl(c,g)}r=r.sibling}}var Pl=8192;function ns(i,r,c){if(i.subtreeFlags&Pl)for(i=i.child;i!==null;)US(i,r,c),i=i.sibling}function US(i,r,c){switch(i.tag){case 26:ns(i,r,c),i.flags&Pl&&i.memoizedState!==null&&aj(c,za,i.memoizedState,i.memoizedProps);break;case 5:ns(i,r,c);break;case 3:case 4:var g=za;za=id(i.stateNode.containerInfo),ns(i,r,c),za=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=Pl,Pl=16777216,ns(i,r,c),Pl=g):ns(i,r,c));break;default:ns(i,r,c)}}function FS(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 Dl(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var g=r[c];Rn=g,$S(g,i)}FS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)HS(i),i=i.sibling}function HS(i){switch(i.tag){case 0:case 11:case 15:Dl(i),i.flags&2048&&ar(9,i,i.return);break;case 3:Dl(i);break;case 12:Dl(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,Qu(i)):Dl(i);break;default:Dl(i)}}function Qu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var g=r[c];Rn=g,$S(g,i)}FS(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:ar(8,r,r.return),Qu(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,Qu(r));break;default:Qu(r)}i=i.sibling}}function $S(i,r){for(;Rn!==null;){var c=Rn;switch(c.tag){case 0:case 11:case 15:ar(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var g=c.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:bl(c.memoizedState.cache)}if(g=c.child,g!==null)g.return=c,Rn=g;else e:for(c=i;Rn!==null;){g=Rn;var y=g.sibling,k=g.return;if(jS(g),g===c){Rn=null;break e}if(y!==null){y.return=k,Rn=y;break e}Rn=k}}}var yO={getCacheForType:function(i){var r=Tn(pn),c=r.data.get(i);return c===void 0&&(c=i(),r.data.set(i,c)),c},cacheSignal:function(){return Tn(pn).controller.signal}},bO=typeof WeakMap=="function"?WeakMap:Map,wt=0,Lt=null,st=null,dt=0,Rt=0,da=null,ir=!1,as=!1,Vf=!1,Ei=0,tn=0,rr=0,ao=0,Gf=0,ma=0,is=0,zl=null,Jn=null,Zf=!1,Vu=0,QS=0,Gu=1/0,Zu=null,or=null,kn=0,sr=null,rs=null,Ri=0,Kf=0,Wf=null,VS=null,Ll=0,Yf=null;function pa(){return(wt&2)!==0&&dt!==0?dt&-dt:Q.T!==null?ah():ru()}function GS(){if(ma===0)if((dt&536870912)===0||ft){var i=No;No<<=1,(No&3932160)===0&&(No=262144),ma=i}else ma=536870912;return i=ca.current,i!==null&&(i.flags|=32),ma}function ea(i,r,c){(i===Lt&&(Rt===2||Rt===9)||i.cancelPendingCommit!==null)&&(os(i,0),lr(i,dt,ma,!1)),$i(i,c),((wt&2)===0||i!==Lt)&&(i===Lt&&((wt&2)===0&&(ao|=c),tn===4&&lr(i,dt,ma,!1)),Ja(i))}function ZS(i,r,c){if((wt&6)!==0)throw Error(a(327));var g=!c&&(r&127)===0&&(r&i.expiredLanes)===0||Hi(i,r),y=g?kO(i,r):Jf(i,r,!0),k=g;do{if(y===0){as&&!g&&lr(i,r,0,!1);break}else{if(c=i.current.alternate,k&&!SO(c)){y=Jf(i,r,!1),k=!1;continue}if(y===2){if(k=r,i.errorRecoveryDisabledLanes&k)var _=0;else _=i.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){r=_;e:{var P=i;y=zl;var U=P.current.memoizedState.isDehydrated;if(U&&(os(P,_).flags|=256),_=Jf(P,_,!1),_!==2){if(Vf&&!U){P.errorRecoveryDisabledLanes|=k,ao|=k,y=4;break e}k=Jn,Jn=y,k!==null&&(Jn===null?Jn=k:Jn.push.apply(Jn,k))}y=_}if(k=!1,y!==2)continue}}if(y===1){os(i,0),lr(i,r,0,!0);break}e:{switch(g=i,k=y,k){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:lr(g,r,ma,!ir);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(y=Vu+300-Xt(),10<y)){if(lr(g,r,ma,!ir),qr(g,0,!0)!==0)break e;Ri=r,g.timeoutHandle=Cx(KS.bind(null,g,c,Jn,Zu,Zf,r,ma,ao,is,ir,k,"Throttled",-0,0),y);break e}KS(g,c,Jn,Zu,Zf,r,ma,ao,is,ir,k,null,-0,0)}}break}while(!0);Ja(i)}function KS(i,r,c,g,y,k,_,P,U,ie,fe,ye,oe,le){if(i.timeoutHandle=-1,ye=r.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pi},US(r,k,ye);var ze=(k&62914560)===k?Vu-Xt():(k&4194048)===k?QS-Xt():0;if(ze=ij(ye,ze),ze!==null){Ri=k,i.cancelPendingCommit=ze(ax.bind(null,i,r,k,c,g,y,_,P,U,fe,ye,null,oe,le)),lr(i,k,_,!ie);return}}ax(i,r,k,c,g,y,_,P,U)}function SO(i){for(var r=i;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var g=0;g<c.length;g++){var y=c[g],k=y.getSnapshot;y=y.value;try{if(!sa(k(),y))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;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 lr(i,r,c,g){r&=~Gf,r&=~ao,i.suspendedLanes|=r,i.pingedLanes&=~r,g&&(i.warmLanes|=r),g=i.expirationTimes;for(var y=r;0<y;){var k=31-Jt(y),_=1<<k;g[k]=-1,y&=~_}c!==0&&al(i,c,r)}function Ku(){return(wt&6)===0?(ql(0),!1):!0}function Xf(){if(st!==null){if(Rt===0)var i=st.return;else i=st,vi=Zr=null,ff(i),Wo=null,xl=0,i=st;for(;i!==null;)AS(i.alternate,i),i=i.return;st=null}}function os(i,r){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,BO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Ri=0,Xf(),Lt=i,st=c=hi(i.current,null),dt=r,Rt=0,da=null,ir=!1,as=Hi(i,r),Vf=!1,is=ma=Gf=ao=rr=tn=0,Jn=zl=null,Zf=!1,(r&8)!==0&&(r|=r&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=r;0<g;){var y=31-Jt(g),k=1<<y;r|=i[y],g&=~k}return Ei=r,gu(),c}function WS(i,r){at=null,Q.H=_l,r===Ko||r===Mu?(r=m1(),Rt=3):r===tf?(r=m1(),Rt=4):Rt=r===If?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,da=r,st===null&&(tn=1,Lu(i,Ma(r,i.current)))}function YS(){var i=ca.current;return i===null?!0:(dt&4194048)===dt?Ra===null:(dt&62914560)===dt||(dt&536870912)!==0?i===Ra:!1}function XS(){var i=Q.H;return Q.H=_l,i===null?_l:i}function JS(){var i=Q.A;return Q.A=yO,i}function Wu(){tn=4,ir||(dt&4194048)!==dt&&ca.current!==null||(as=!0),(rr&134217727)===0&&(ao&134217727)===0||Lt===null||lr(Lt,dt,ma,!1)}function Jf(i,r,c){var g=wt;wt|=2;var y=XS(),k=JS();(Lt!==i||dt!==r)&&(Zu=null,os(i,r)),r=!1;var _=tn;e:do try{if(Rt!==0&&st!==null){var P=st,U=da;switch(Rt){case 8:Xf(),_=6;break e;case 3:case 2:case 9:case 6:ca.current===null&&(r=!0);var ie=Rt;if(Rt=0,da=null,ss(i,P,U,ie),c&&as){_=0;break e}break;default:ie=Rt,Rt=0,da=null,ss(i,P,U,ie)}}xO(),_=tn;break}catch(fe){WS(i,fe)}while(!0);return r&&i.shellSuspendCounter++,vi=Zr=null,wt=g,Q.H=y,Q.A=k,st===null&&(Lt=null,dt=0,gu()),_}function xO(){for(;st!==null;)ex(st)}function kO(i,r){var c=wt;wt|=2;var g=XS(),y=JS();Lt!==i||dt!==r?(Zu=null,Gu=Xt()+500,os(i,r)):as=Hi(i,r);e:do try{if(Rt!==0&&st!==null){r=st;var k=da;t:switch(Rt){case 1:Rt=0,da=null,ss(i,r,k,1);break;case 2:case 9:if(u1(k)){Rt=0,da=null,tx(r);break}r=function(){Rt!==2&&Rt!==9||Lt!==i||(Rt=7),Ja(i)},k.then(r,r);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:u1(k)?(Rt=0,da=null,tx(r)):(Rt=0,da=null,ss(i,r,k,7));break;case 5:var _=null;switch(st.tag){case 26:_=st.memoizedState;case 5:case 27:var P=st;if(_?Bx(_):P.stateNode.complete){Rt=0,da=null;var U=P.sibling;if(U!==null)st=U;else{var ie=P.return;ie!==null?(st=ie,Yu(ie)):st=null}break t}}Rt=0,da=null,ss(i,r,k,5);break;case 6:Rt=0,da=null,ss(i,r,k,6);break;case 8:Xf(),tn=6;break e;default:throw Error(a(462))}}wO();break}catch(fe){WS(i,fe)}while(!0);return vi=Zr=null,Q.H=g,Q.A=y,wt=c,st!==null?0:(Lt=null,dt=0,gu(),tn)}function wO(){for(;st!==null&&!oa();)ex(st)}function ex(i){var r=MS(i.alternate,i,Ei);i.memoizedProps=i.pendingProps,r===null?Yu(i):st=r}function tx(i){var r=i,c=r.alternate;switch(r.tag){case 15:case 0:r=yS(c,r,r.pendingProps,r.type,void 0,dt);break;case 11:r=yS(c,r,r.pendingProps,r.type.render,r.ref,dt);break;case 5:ff(r);default:AS(c,r),r=st=J0(r,Ei),r=MS(c,r,Ei)}i.memoizedProps=i.pendingProps,r===null?Yu(i):st=r}function ss(i,r,c,g){vi=Zr=null,ff(r),Wo=null,xl=0;var y=r.return;try{if(dO(i,y,r,c,dt)){tn=1,Lu(i,Ma(c,i.current)),st=null;return}}catch(k){if(y!==null)throw st=y,k;tn=1,Lu(i,Ma(c,i.current)),st=null;return}r.flags&32768?(ft||g===1?i=!0:as||(dt&536870912)!==0?i=!1:(ir=i=!0,(g===2||g===9||g===3||g===6)&&(g=ca.current,g!==null&&g.tag===13&&(g.flags|=16384))),nx(r,i)):Yu(r)}function Yu(i){var r=i;do{if((r.flags&32768)!==0){nx(r,ir);return}i=r.return;var c=fO(r.alternate,r,Ei);if(c!==null){st=c;return}if(r=r.sibling,r!==null){st=r;return}st=r=i}while(r!==null);tn===0&&(tn=5)}function nx(i,r){do{var c=hO(i.alternate,i);if(c!==null){c.flags&=32767,st=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(i=i.sibling,i!==null)){st=i;return}st=i=c}while(i!==null);tn=6,st=null}function ax(i,r,c,g,y,k,_,P,U){i.cancelPendingCommit=null;do Xu();while(kn!==0);if((wt&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(k=r.lanes|r.childLanes,k|=Bp,iu(i,c,k,_,P,U),i===Lt&&(st=Lt=null,dt=0),rs=r,sr=i,Ri=c,Kf=k,Wf=y,VS=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,EO(An,function(){return lx(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=Q.T,Q.T=null,y=me.p,me.p=2,_=wt,wt|=4;try{gO(i,r,c)}finally{wt=_,me.p=y,Q.T=g}}kn=1,ix(),rx(),ox()}}function ix(){if(kn===1){kn=0;var i=sr,r=rs,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=Q.T,Q.T=null;var g=me.p;me.p=2;var y=wt;wt|=4;try{LS(r,i);var k=dh,_=$0(i.containerInfo),P=k.focusedElem,U=k.selectionRange;if(_!==P&&P&&P.ownerDocument&&H0(P.ownerDocument.documentElement,P)){if(U!==null&&Pp(P)){var ie=U.start,fe=U.end;if(fe===void 0&&(fe=ie),"selectionStart"in P)P.selectionStart=ie,P.selectionEnd=Math.min(fe,P.value.length);else{var ye=P.ownerDocument||document,oe=ye&&ye.defaultView||window;if(oe.getSelection){var le=oe.getSelection(),ze=P.textContent.length,Ze=Math.min(U.start,ze),zt=U.end===void 0?Ze:Math.min(U.end,ze);!le.extend&&Ze>zt&&(_=zt,zt=Ze,Ze=_);var Y=F0(P,Ze),Z=F0(P,zt);if(Y&&Z&&(le.rangeCount!==1||le.anchorNode!==Y.node||le.anchorOffset!==Y.offset||le.focusNode!==Z.node||le.focusOffset!==Z.offset)){var ne=ye.createRange();ne.setStart(Y.node,Y.offset),le.removeAllRanges(),Ze>zt?(le.addRange(ne),le.extend(Z.node,Z.offset)):(ne.setEnd(Z.node,Z.offset),le.addRange(ne))}}}}for(ye=[],le=P;le=le.parentNode;)le.nodeType===1&&ye.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ye.length;P++){var ve=ye[P];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}ud=!!uh,dh=uh=null}finally{wt=y,me.p=g,Q.T=c}}i.current=r,kn=2}}function rx(){if(kn===2){kn=0;var i=sr,r=rs,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=Q.T,Q.T=null;var g=me.p;me.p=2;var y=wt;wt|=4;try{OS(i,r.alternate,r)}finally{wt=y,me.p=g,Q.T=c}}kn=3}}function ox(){if(kn===4||kn===3){kn=0,xa();var i=sr,r=rs,c=Ri,g=VS;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?kn=5:(kn=0,rs=sr=null,sx(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(or=null),sl(c),r=r.stateNode,_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(Oa,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=Q.T,y=me.p,me.p=2,Q.T=null;try{for(var k=i.onRecoverableError,_=0;_<g.length;_++){var P=g[_];k(P.value,{componentStack:P.stack})}}finally{Q.T=r,me.p=y}}(Ri&3)!==0&&Xu(),Ja(i),y=i.pendingLanes,(c&261930)!==0&&(y&42)!==0?i===Yf?Ll++:(Ll=0,Yf=i):Ll=0,ql(0)}}function sx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,bl(r)))}function Xu(){return ix(),rx(),ox(),lx()}function lx(){if(kn!==5)return!1;var i=sr,r=Kf;Kf=0;var c=sl(Ri),g=Q.T,y=me.p;try{me.p=32>c?32:c,Q.T=null,c=Wf,Wf=null;var k=sr,_=Ri;if(kn=0,rs=sr=null,Ri=0,(wt&6)!==0)throw Error(a(331));var P=wt;if(wt|=4,HS(k.current),BS(k,k.current,_,c),wt=P,ql(0,!1),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(Oa,k)}catch{}return!0}finally{me.p=y,Q.T=g,sx(i,r)}}function cx(i,r,c){r=Ma(c,r),r=_f(i.stateNode,r,2),i=er(i,r,2),i!==null&&($i(i,2),Ja(i))}function _t(i,r,c){if(i.tag===3)cx(i,i,c);else for(;r!==null;){if(r.tag===3){cx(r,i,c);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(or===null||!or.has(g))){i=Ma(c,i),c=uS(2),g=er(r,c,2),g!==null&&(dS(c,g,r,i),$i(g,2),Ja(g));break}}r=r.return}}function eh(i,r,c){var g=i.pingCache;if(g===null){g=i.pingCache=new bO;var y=new Set;g.set(r,y)}else y=g.get(r),y===void 0&&(y=new Set,g.set(r,y));y.has(c)||(Vf=!0,y.add(c),i=MO.bind(null,i,r,c),r.then(i,i))}function MO(i,r,c){var g=i.pingCache;g!==null&&g.delete(r),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,Lt===i&&(dt&c)===c&&(tn===4||tn===3&&(dt&62914560)===dt&&300>Xt()-Vu?(wt&2)===0&&os(i,0):Gf|=c,is===dt&&(is=0)),Ja(i)}function ux(i,r){r===0&&(r=ja()),i=Qr(i,r),i!==null&&($i(i,r),Ja(i))}function CO(i){var r=i.memoizedState,c=0;r!==null&&(c=r.retryLane),ux(i,c)}function AO(i,r){var c=0;switch(i.tag){case 31:case 13:var g=i.stateNode,y=i.memoizedState;y!==null&&(c=y.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),ux(i,c)}function EO(i,r){return qn(i,r)}var Ju=null,ls=null,th=!1,ed=!1,nh=!1,cr=0;function Ja(i){i!==ls&&i.next===null&&(ls===null?Ju=ls=i:ls=ls.next=i),ed=!0,th||(th=!0,_O())}function ql(i,r){if(!nh&&ed){nh=!0;do for(var c=!1,g=Ju;g!==null;){if(i!==0){var y=g.pendingLanes;if(y===0)var k=0;else{var _=g.suspendedLanes,P=g.pingedLanes;k=(1<<31-Jt(42|i)+1)-1,k&=y&~(_&~P),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(c=!0,fx(g,k))}else k=dt,k=qr(g,g===Lt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||Hi(g,k)||(c=!0,fx(g,k));g=g.next}while(c);nh=!1}}function RO(){dx()}function dx(){ed=th=!1;var i=0;cr!==0&&qO()&&(i=cr);for(var r=Xt(),c=null,g=Ju;g!==null;){var y=g.next,k=mx(g,r);k===0?(g.next=null,c===null?Ju=y:c.next=y,y===null&&(ls=c)):(c=g,(i!==0||(k&3)!==0)&&(ed=!0)),g=y}kn!==0&&kn!==5||ql(i),cr!==0&&(cr=0)}function mx(i,r){for(var c=i.suspendedLanes,g=i.pingedLanes,y=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var _=31-Jt(k),P=1<<_,U=y[_];U===-1?((P&c)===0||(P&g)!==0)&&(y[_]=nl(P,r)):U<=r&&(i.expiredLanes|=P),k&=~P}if(r=Lt,c=dt,c=qr(i,i===r?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,c===0||i===r&&(Rt===2||Rt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&Cn(g),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Hi(i,c)){if(r=c&-c,r===i.callbackPriority)return r;switch(g!==null&&Cn(g),sl(c)){case 2:case 8:c=Nt;break;case 32:c=An;break;case 268435456:c=Ye;break;default:c=An}return g=px.bind(null,i),c=qn(c,g),i.callbackPriority=r,i.callbackNode=c,r}return g!==null&&g!==null&&Cn(g),i.callbackPriority=2,i.callbackNode=null,2}function px(i,r){if(kn!==0&&kn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(Xu()&&i.callbackNode!==c)return null;var g=dt;return g=qr(i,i===Lt?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(ZS(i,g,r),mx(i,Xt()),i.callbackNode!=null&&i.callbackNode===c?px.bind(null,i):null)}function fx(i,r){if(Xu())return null;ZS(i,r,!0)}function _O(){UO(function(){(wt&6)!==0?qn(_e,RO):dx()})}function ah(){if(cr===0){var i=Go;i===0&&(i=zr,zr<<=1,(zr&261888)===0&&(zr=256)),cr=i}return cr}function hx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:lu(""+i)}function gx(i,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,i.id&&c.setAttribute("form",i.id),r.parentNode.insertBefore(c,r),i=new FormData(i),c.parentNode.removeChild(c),i}function IO(i,r,c,g,y){if(r==="submit"&&c&&c.stateNode===y){var k=hx((y[on]||null).action),_=g.submitter;_&&(r=(r=_[on]||null)?hx(r.formAction):_.getAttribute("formAction"),r!==null&&(k=r,_=null));var P=new mu("action","action",null,g,y);i.push({event:P,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(cr!==0){var U=_?gx(y,_):new FormData(y);wf(c,{pending:!0,data:U,method:y.method,action:k},null,U)}}else typeof k=="function"&&(P.preventDefault(),U=_?gx(y,_):new FormData(y),wf(c,{pending:!0,data:U,method:y.method,action:k},k,U))},currentTarget:y}]})}}for(var ih=0;ih<qp.length;ih++){var rh=qp[ih],TO=rh.toLowerCase(),NO=rh[0].toUpperCase()+rh.slice(1);Da(TO,"on"+NO)}Da(G0,"onAnimationEnd"),Da(Z0,"onAnimationIteration"),Da(K0,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da(Z5,"onTransitionRun"),Da(K5,"onTransitionStart"),Da(W5,"onTransitionCancel"),Da(W0,"onTransitionEnd"),jt("onMouseEnter",["mouseout","mouseover"]),jt("onMouseLeave",["mouseout","mouseover"]),jt("onPointerEnter",["pointerout","pointerover"]),jt("onPointerLeave",["pointerout","pointerover"]),We("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),We("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),We("onBeforeInput",["compositionend","keypress","textInput","paste"]),We("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),OO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bl));function vx(i,r){r=(r&4)!==0;for(var c=0;c<i.length;c++){var g=i[c],y=g.event;g=g.listeners;e:{var k=void 0;if(r)for(var _=g.length-1;0<=_;_--){var P=g[_],U=P.instance,ie=P.currentTarget;if(P=P.listener,U!==k&&y.isPropagationStopped())break e;k=P,y.currentTarget=ie;try{k(y)}catch(fe){hu(fe)}y.currentTarget=null,k=U}else for(_=0;_<g.length;_++){if(P=g[_],U=P.instance,ie=P.currentTarget,P=P.listener,U!==k&&y.isPropagationStopped())break e;k=P,y.currentTarget=ie;try{k(y)}catch(fe){hu(fe)}y.currentTarget=null,k=U}}}}function lt(i,r){var c=r[Br];c===void 0&&(c=r[Br]=new Set);var g=i+"__bubble";c.has(g)||(yx(r,i,2,!1),c.add(g))}function oh(i,r,c){var g=0;r&&(g|=4),yx(c,i,g,r)}var td="_reactListening"+Math.random().toString(36).slice(2);function sh(i){if(!i[td]){i[td]=!0,qe.forEach(function(c){c!=="selectionchange"&&(OO.has(c)||oh(c,!1,i),oh(c,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[td]||(r[td]=!0,oh("selectionchange",!1,r))}}function yx(i,r,c,g){switch(Gx(r)){case 2:var y=sj;break;case 8:y=lj;break;default:y=kh}c=y.bind(null,r,c,i),y=void 0,!Ap||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(y=!0),g?y!==void 0?i.addEventListener(r,c,{capture:!0,passive:y}):i.addEventListener(r,c,!0):y!==void 0?i.addEventListener(r,c,{passive:y}):i.addEventListener(r,c,!1)}function lh(i,r,c,g,y){var k=g;if((r&1)===0&&(r&2)===0&&g!==null)e:for(;;){if(g===null)return;var _=g.tag;if(_===3||_===4){var P=g.stateNode.containerInfo;if(P===y)break;if(_===4)for(_=g.return;_!==null;){var U=_.tag;if((U===3||U===4)&&_.stateNode.containerInfo===y)return;_=_.return}for(;P!==null;){if(_=Be(P),_===null)return;if(U=_.tag,U===5||U===6||U===26||U===27){g=k=_;continue e}P=P.parentNode}}g=g.return}w0(function(){var ie=k,fe=Mp(c),ye=[];e:{var oe=Y0.get(i);if(oe!==void 0){var le=mu,ze=i;switch(i){case"keypress":if(uu(c)===0)break e;case"keydown":case"keyup":le=A5;break;case"focusin":ze="focus",le=Ip;break;case"focusout":ze="blur",le=Ip;break;case"beforeblur":case"afterblur":le=Ip;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=A0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=f5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=_5;break;case G0:case Z0:case K0:le=v5;break;case W0:le=T5;break;case"scroll":case"scrollend":le=m5;break;case"wheel":le=O5;break;case"copy":case"cut":case"paste":le=b5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=R0;break;case"toggle":case"beforetoggle":le=P5}var Ze=(r&4)!==0,zt=!Ze&&(i==="scroll"||i==="scrollend"),Y=Ze?oe!==null?oe+"Capture":null:oe;Ze=[];for(var Z=ie,ne;Z!==null;){var ve=Z;if(ne=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ne===null||Y===null||(ve=ll(Z,Y),ve!=null&&Ze.push(Ul(Z,ve,ne))),zt)break;Z=Z.return}0<Ze.length&&(oe=new le(oe,ze,null,c,fe),ye.push({event:oe,listeners:Ze}))}}if((r&7)===0){e:{if(oe=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",oe&&c!==wp&&(ze=c.relatedTarget||c.fromElement)&&(Be(ze)||ze[Qa]))break e;if((le||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,le?(ze=c.relatedTarget||c.toElement,le=ie,ze=ze?Be(ze):null,ze!==null&&(zt=m(ze),Ze=ze.tag,ze!==zt||Ze!==5&&Ze!==27&&Ze!==6)&&(ze=null)):(le=null,ze=ie),le!==ze)){if(Ze=A0,ve="onMouseLeave",Y="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(Ze=R0,ve="onPointerLeave",Y="onPointerEnter",Z="pointer"),zt=le==null?oe:kt(le),ne=ze==null?oe:kt(ze),oe=new Ze(ve,Z+"leave",le,c,fe),oe.target=zt,oe.relatedTarget=ne,ve=null,Be(fe)===ie&&(Ze=new Ze(Y,Z+"enter",ze,c,fe),Ze.target=ne,Ze.relatedTarget=zt,ve=Ze),zt=ve,le&&ze)t:{for(Ze=jO,Y=le,Z=ze,ne=0,ve=Y;ve;ve=Ze(ve))ne++;ve=0;for(var Qe=Z;Qe;Qe=Ze(Qe))ve++;for(;0<ne-ve;)Y=Ze(Y),ne--;for(;0<ve-ne;)Z=Ze(Z),ve--;for(;ne--;){if(Y===Z||Z!==null&&Y===Z.alternate){Ze=Y;break t}Y=Ze(Y),Z=Ze(Z)}Ze=null}else Ze=null;le!==null&&bx(ye,oe,le,Ze,!1),ze!==null&&zt!==null&&bx(ye,zt,ze,Ze,!0)}}e:{if(oe=ie?kt(ie):window,le=oe.nodeName&&oe.nodeName.toLowerCase(),le==="select"||le==="input"&&oe.type==="file")var bt=D0;else if(j0(oe))if(z0)bt=Q5;else{bt=H5;var Ue=F5}else le=oe.nodeName,!le||le.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&kp(ie.elementType)&&(bt=D0):bt=$5;if(bt&&(bt=bt(i,ie))){P0(ye,bt,c,fe);break e}Ue&&Ue(i,oe,ie),i==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&Za(oe,"number",oe.value)}switch(Ue=ie?kt(ie):window,i){case"focusin":(j0(Ue)||Ue.contentEditable==="true")&&(qo=Ue,Dp=ie,gl=null);break;case"focusout":gl=Dp=qo=null;break;case"mousedown":zp=!0;break;case"contextmenu":case"mouseup":case"dragend":zp=!1,Q0(ye,c,fe);break;case"selectionchange":if(G5)break;case"keydown":case"keyup":Q0(ye,c,fe)}var rt;if(Np)e:{switch(i){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Lo?N0(i,c)&&(mt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(mt="onCompositionStart");mt&&(_0&&c.locale!=="ko"&&(Lo||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Lo&&(rt=M0()):(Gi=fe,Ep="value"in Gi?Gi.value:Gi.textContent,Lo=!0)),Ue=nd(ie,mt),0<Ue.length&&(mt=new E0(mt,i,null,c,fe),ye.push({event:mt,listeners:Ue}),rt?mt.data=rt:(rt=O0(c),rt!==null&&(mt.data=rt)))),(rt=z5?L5(i,c):q5(i,c))&&(mt=nd(ie,"onBeforeInput"),0<mt.length&&(Ue=new E0("onBeforeInput","beforeinput",null,c,fe),ye.push({event:Ue,listeners:mt}),Ue.data=rt)),IO(ye,i,ie,c,fe)}vx(ye,r)})}function Ul(i,r,c){return{instance:i,listener:r,currentTarget:c}}function nd(i,r){for(var c=r+"Capture",g=[];i!==null;){var y=i,k=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||k===null||(y=ll(i,c),y!=null&&g.unshift(Ul(i,y,k)),y=ll(i,r),y!=null&&g.push(Ul(i,y,k))),i.tag===3)return g;i=i.return}return[]}function jO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function bx(i,r,c,g,y){for(var k=r._reactName,_=[];c!==null&&c!==g;){var P=c,U=P.alternate,ie=P.stateNode;if(P=P.tag,U!==null&&U===g)break;P!==5&&P!==26&&P!==27||ie===null||(U=ie,y?(ie=ll(c,k),ie!=null&&_.unshift(Ul(c,ie,U))):y||(ie=ll(c,k),ie!=null&&_.push(Ul(c,ie,U)))),c=c.return}_.length!==0&&i.push({event:r,listeners:_})}var PO=/\r\n?/g,DO=/\u0000|\uFFFD/g;function Sx(i){return(typeof i=="string"?i:""+i).replace(PO,`
10
- `).replace(DO,"")}function xx(i,r){return r=Sx(r),Sx(i)===r}function Dt(i,r,c,g,y,k){switch(c){case"children":typeof g=="string"?r==="body"||r==="textarea"&&g===""||Po(i,g):(typeof g=="number"||typeof g=="bigint")&&r!=="body"&&Po(i,""+g);break;case"className":nt(i,"class",g);break;case"tabIndex":nt(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":nt(i,c,g);break;case"style":x0(i,g,k);break;case"data":if(r!=="object"){nt(i,"data",g);break}case"src":case"href":if(g===""&&(r!=="a"||c!=="href")){i.removeAttribute(c);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=lu(""+g),i.setAttribute(c,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(c,"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"&&(c==="formAction"?(r!=="input"&&Dt(i,r,"name",y.name,y,null),Dt(i,r,"formEncType",y.formEncType,y,null),Dt(i,r,"formMethod",y.formMethod,y,null),Dt(i,r,"formTarget",y.formTarget,y,null)):(Dt(i,r,"encType",y.encType,y,null),Dt(i,r,"method",y.method,y,null),Dt(i,r,"target",y.target,y,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=lu(""+g),i.setAttribute(c,g);break;case"onClick":g!=null&&(i.onclick=pi);break;case"onScroll":g!=null&&lt("scroll",i);break;case"onScrollEnd":g!=null&&lt("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(c=g.__html,c!=null){if(y.children!=null)throw Error(a(60));i.innerHTML=c}}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}c=lu(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);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(c,""+g):i.removeAttribute(c);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(c,""):i.removeAttribute(c);break;case"capture":case"download":g===!0?i.setAttribute(c,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,g):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(c,g):i.removeAttribute(c);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(c):i.setAttribute(c,g);break;case"popover":lt("beforetoggle",i),lt("toggle",i),Sn(i,"popover",g);break;case"xlinkActuate":yt(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":yt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":yt(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":yt(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":yt(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":yt(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":yt(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":yt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":yt(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Sn(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=u5.get(c)||c,Sn(i,c,g))}}function ch(i,r,c,g,y,k){switch(c){case"style":x0(i,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(c=g.__html,c!=null){if(y.children!=null)throw Error(a(60));i.innerHTML=c}}break;case"children":typeof g=="string"?Po(i,g):(typeof g=="number"||typeof g=="bigint")&&Po(i,""+g);break;case"onScroll":g!=null&&lt("scroll",i);break;case"onScrollEnd":g!=null&&lt("scrollend",i);break;case"onClick":g!=null&&(i.onclick=pi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!it.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),r=c.slice(2,y?c.length-7:void 0),k=i[on]||null,k=k!=null?k[c]:null,typeof k=="function"&&i.removeEventListener(r,k,y),typeof g=="function")){typeof k!="function"&&k!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(r,g,y);break e}c in i?i[c]=g:g===!0?i.setAttribute(c,""):Sn(i,c,g)}}}function On(i,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",i),lt("load",i);var g=!1,y=!1,k;for(k in c)if(c.hasOwnProperty(k)){var _=c[k];if(_!=null)switch(k){case"src":g=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Dt(i,r,k,_,c,null)}}y&&Dt(i,r,"srcSet",c.srcSet,c,null),g&&Dt(i,r,"src",c.src,c,null);return;case"input":lt("invalid",i);var P=k=_=y=null,U=null,ie=null;for(g in c)if(c.hasOwnProperty(g)){var fe=c[g];if(fe!=null)switch(g){case"name":y=fe;break;case"type":_=fe;break;case"checked":U=fe;break;case"defaultChecked":ie=fe;break;case"value":k=fe;break;case"defaultValue":P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,r));break;default:Dt(i,r,g,fe,c,null)}}Vi(i,k,P,U,ie,_,y,!1);return;case"select":lt("invalid",i),g=_=k=null;for(y in c)if(c.hasOwnProperty(y)&&(P=c[y],P!=null))switch(y){case"value":k=P;break;case"defaultValue":_=P;break;case"multiple":g=P;default:Dt(i,r,y,P,c,null)}r=k,c=_,i.multiple=!!g,r!=null?Ka(i,!!g,r,!1):c!=null&&Ka(i,!!g,c,!0);return;case"textarea":lt("invalid",i),k=y=g=null;for(_ in c)if(c.hasOwnProperty(_)&&(P=c[_],P!=null))switch(_){case"value":g=P;break;case"defaultValue":y=P;break;case"children":k=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:Dt(i,r,_,P,c,null)}b0(i,g,y,k);return;case"option":for(U in c)c.hasOwnProperty(U)&&(g=c[U],g!=null)&&(U==="selected"?i.selected=g&&typeof g!="function"&&typeof g!="symbol":Dt(i,r,U,g,c,null));return;case"dialog":lt("beforetoggle",i),lt("toggle",i),lt("cancel",i),lt("close",i);break;case"iframe":case"object":lt("load",i);break;case"video":case"audio":for(g=0;g<Bl.length;g++)lt(Bl[g],i);break;case"image":lt("error",i),lt("load",i);break;case"details":lt("toggle",i);break;case"embed":case"source":case"link":lt("error",i),lt("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(ie in c)if(c.hasOwnProperty(ie)&&(g=c[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Dt(i,r,ie,g,c,null)}return;default:if(kp(r)){for(fe in c)c.hasOwnProperty(fe)&&(g=c[fe],g!==void 0&&ch(i,r,fe,g,c,void 0));return}}for(P in c)c.hasOwnProperty(P)&&(g=c[P],g!=null&&Dt(i,r,P,g,c,null))}function zO(i,r,c,g){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,k=null,_=null,P=null,U=null,ie=null,fe=null;for(le in c){var ye=c[le];if(c.hasOwnProperty(le)&&ye!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":U=ye;default:g.hasOwnProperty(le)||Dt(i,r,le,null,g,ye)}}for(var oe in g){var le=g[oe];if(ye=c[oe],g.hasOwnProperty(oe)&&(le!=null||ye!=null))switch(oe){case"type":k=le;break;case"name":y=le;break;case"checked":ie=le;break;case"defaultChecked":fe=le;break;case"value":_=le;break;case"defaultValue":P=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:le!==ye&&Dt(i,r,oe,le,g,ye)}}Qi(i,_,P,U,ie,fe,k,y);return;case"select":le=_=P=oe=null;for(k in c)if(U=c[k],c.hasOwnProperty(k)&&U!=null)switch(k){case"value":break;case"multiple":le=U;default:g.hasOwnProperty(k)||Dt(i,r,k,null,g,U)}for(y in g)if(k=g[y],U=c[y],g.hasOwnProperty(y)&&(k!=null||U!=null))switch(y){case"value":oe=k;break;case"defaultValue":P=k;break;case"multiple":_=k;default:k!==U&&Dt(i,r,y,k,g,U)}r=P,c=_,g=le,oe!=null?Ka(i,!!c,oe,!1):!!g!=!!c&&(r!=null?Ka(i,!!c,r,!0):Ka(i,!!c,c?[]:"",!1));return;case"textarea":le=oe=null;for(P in c)if(y=c[P],c.hasOwnProperty(P)&&y!=null&&!g.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Dt(i,r,P,null,g,y)}for(_ in g)if(y=g[_],k=c[_],g.hasOwnProperty(_)&&(y!=null||k!=null))switch(_){case"value":oe=y;break;case"defaultValue":le=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==k&&Dt(i,r,_,y,g,k)}y0(i,oe,le);return;case"option":for(var ze in c)oe=c[ze],c.hasOwnProperty(ze)&&oe!=null&&!g.hasOwnProperty(ze)&&(ze==="selected"?i.selected=!1:Dt(i,r,ze,null,g,oe));for(U in g)oe=g[U],le=c[U],g.hasOwnProperty(U)&&oe!==le&&(oe!=null||le!=null)&&(U==="selected"?i.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":Dt(i,r,U,oe,g,le));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 Ze in c)oe=c[Ze],c.hasOwnProperty(Ze)&&oe!=null&&!g.hasOwnProperty(Ze)&&Dt(i,r,Ze,null,g,oe);for(ie in g)if(oe=g[ie],le=c[ie],g.hasOwnProperty(ie)&&oe!==le&&(oe!=null||le!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,r));break;default:Dt(i,r,ie,oe,g,le)}return;default:if(kp(r)){for(var zt in c)oe=c[zt],c.hasOwnProperty(zt)&&oe!==void 0&&!g.hasOwnProperty(zt)&&ch(i,r,zt,void 0,g,oe);for(fe in g)oe=g[fe],le=c[fe],!g.hasOwnProperty(fe)||oe===le||oe===void 0&&le===void 0||ch(i,r,fe,oe,g,le);return}}for(var Y in c)oe=c[Y],c.hasOwnProperty(Y)&&oe!=null&&!g.hasOwnProperty(Y)&&Dt(i,r,Y,null,g,oe);for(ye in g)oe=g[ye],le=c[ye],!g.hasOwnProperty(ye)||oe===le||oe==null&&le==null||Dt(i,r,ye,oe,g,le)}function kx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function LO(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,c=performance.getEntriesByType("resource"),g=0;g<c.length;g++){var y=c[g],k=y.transferSize,_=y.initiatorType,P=y.duration;if(k&&P&&kx(_)){for(_=0,P=y.responseEnd,g+=1;g<c.length;g++){var U=c[g],ie=U.startTime;if(ie>P)break;var fe=U.transferSize,ye=U.initiatorType;fe&&kx(ye)&&(U=U.responseEnd,_+=fe*(U<P?1:(P-ie)/(U-ie)))}if(--g,r+=8*(k+_)/(y.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 uh=null,dh=null;function ad(i){return i.nodeType===9?i:i.ownerDocument}function wx(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 Mx(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 ph=null;function qO(){var i=window.event;return i&&i.type==="popstate"?i===ph?!1:(ph=i,!0):(ph=null,!1)}var Cx=typeof setTimeout=="function"?setTimeout:void 0,BO=typeof clearTimeout=="function"?clearTimeout:void 0,Ax=typeof Promise=="function"?Promise:void 0,UO=typeof queueMicrotask=="function"?queueMicrotask:typeof Ax<"u"?function(i){return Ax.resolve(null).then(i).catch(FO)}:Cx;function FO(i){setTimeout(function(){throw i})}function ur(i){return i==="head"}function Ex(i,r){var c=r,g=0;do{var y=c.nextSibling;if(i.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(g===0){i.removeChild(y),ms(r);return}g--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")g++;else if(c==="html")Fl(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Fl(c);for(var k=c.firstChild;k;){var _=k.nextSibling,P=k.nodeName;k[Ur]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&k.rel.toLowerCase()==="stylesheet"||c.removeChild(k),k=_}}else c==="body"&&Fl(i.ownerDocument.body);c=y}while(c);ms(r)}function Rx(i,r){var c=i;i=0;do{var g=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=g}while(c)}function fh(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":fh(c),he(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function HO(i,r,c,g){for(;i.nodeType===1;){var y=c;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Ur])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!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var k=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=_a(i.nextSibling),i===null)break}return null}function $O(i,r,c){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=_a(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=_a(i.nextSibling),i===null))return null;return i}function hh(i){return i.data==="$?"||i.data==="$~"}function gh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function QO(i,r){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||c.readyState!=="loading")r();else{var g=function(){r(),c.removeEventListener("DOMContentLoaded",g)};c.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function _a(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 vh=null;function Ix(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(r===0)return _a(i.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}i=i.nextSibling}return null}function Tx(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return i;r--}else c!=="/$"&&c!=="/&"||r++}i=i.previousSibling}return null}function Nx(i,r,c){switch(r=ad(c),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 Fl(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);he(i)}var Ia=new Map,Ox=new Set;function id(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var _i=me.d;me.d={f:VO,r:GO,D:ZO,C:KO,L:WO,m:YO,X:JO,S:XO,M:ej};function VO(){var i=_i.f(),r=Ku();return i||r}function GO(i){var r=Xe(i);r!==null&&r.tag===5&&r.type==="form"?W1(r):_i.r(i)}var cs=typeof document>"u"?null:document;function jx(i,r,c){var g=cs;if(g&&typeof r=="string"&&r){var y=Dn(r);y='link[rel="'+i+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),Ox.has(y)||(Ox.add(y),i={rel:i,crossOrigin:c,href:r},g.querySelector(y)===null&&(r=g.createElement("link"),On(r,"link",i),Ve(r),g.head.appendChild(r)))}}function ZO(i){_i.D(i),jx("dns-prefetch",i,null)}function KO(i,r){_i.C(i,r),jx("preconnect",i,r)}function WO(i,r,c){_i.L(i,r,c);var g=cs;if(g&&i&&r){var y='link[rel="preload"][as="'+Dn(r)+'"]';r==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Dn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Dn(c.imageSizes)+'"]')):y+='[href="'+Dn(i)+'"]';var k=y;switch(r){case"style":k=us(i);break;case"script":k=ds(i)}Ia.has(k)||(i=w({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:i,as:r},c),Ia.set(k,i),g.querySelector(y)!==null||r==="style"&&g.querySelector(Hl(k))||r==="script"&&g.querySelector($l(k))||(r=g.createElement("link"),On(r,"link",i),Ve(r),g.head.appendChild(r)))}}function YO(i,r){_i.m(i,r);var c=cs;if(c&&i){var g=r&&typeof r.as=="string"?r.as:"script",y='link[rel="modulepreload"][as="'+Dn(g)+'"][href="'+Dn(i)+'"]',k=y;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ds(i)}if(!Ia.has(k)&&(i=w({rel:"modulepreload",href:i},r),Ia.set(k,i),c.querySelector(y)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector($l(k)))return}g=c.createElement("link"),On(g,"link",i),Ve(g),c.head.appendChild(g)}}}function XO(i,r,c){_i.S(i,r,c);var g=cs;if(g&&i){var y=Je(g).hoistableStyles,k=us(i);r=r||"default";var _=y.get(k);if(!_){var P={loading:0,preload:null};if(_=g.querySelector(Hl(k)))P.loading=5;else{i=w({rel:"stylesheet",href:i,"data-precedence":r},c),(c=Ia.get(k))&&yh(i,c);var U=_=g.createElement("link");Ve(U),On(U,"link",i),U._p=new Promise(function(ie,fe){U.onload=ie,U.onerror=fe}),U.addEventListener("load",function(){P.loading|=1}),U.addEventListener("error",function(){P.loading|=2}),P.loading|=4,rd(_,r,g)}_={type:"stylesheet",instance:_,count:1,state:P},y.set(k,_)}}}function JO(i,r){_i.X(i,r);var c=cs;if(c&&i){var g=Je(c).hoistableScripts,y=ds(i),k=g.get(y);k||(k=c.querySelector($l(y)),k||(i=w({src:i,async:!0},r),(r=Ia.get(y))&&bh(i,r),k=c.createElement("script"),Ve(k),On(k,"link",i),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(y,k))}}function ej(i,r){_i.M(i,r);var c=cs;if(c&&i){var g=Je(c).hoistableScripts,y=ds(i),k=g.get(y);k||(k=c.querySelector($l(y)),k||(i=w({src:i,async:!0,type:"module"},r),(r=Ia.get(y))&&bh(i,r),k=c.createElement("script"),Ve(k),On(k,"link",i),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(y,k))}}function Px(i,r,c,g){var y=(y=ee.current)?id(y):null;if(!y)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=us(c.href),c=Je(y).hoistableStyles,g=c.get(r),g||(g={type:"style",instance:null,count:0,state:null},c.set(r,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=us(c.href);var k=Je(y).hoistableStyles,_=k.get(i);if(_||(y=y.ownerDocument||y,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,_),(k=y.querySelector(Hl(i)))&&!k._p&&(_.instance=k,_.state.loading=5),Ia.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ia.set(i,c),k||tj(y,i,c,_.state))),r&&g===null)throw Error(a(528,""));return _}if(r&&g!==null)throw Error(a(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ds(c),c=Je(y).hoistableScripts,g=c.get(r),g||(g={type:"script",instance:null,count:0,state:null},c.set(r,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function us(i){return'href="'+Dn(i)+'"'}function Hl(i){return'link[rel="stylesheet"]['+i+"]"}function Dx(i){return w({},i,{"data-precedence":i.precedence,precedence:null})}function tj(i,r,c,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}),On(r,"link",c),Ve(r),i.head.appendChild(r))}function ds(i){return'[src="'+Dn(i)+'"]'}function $l(i){return"script[async]"+i}function zx(i,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var g=i.querySelector('style[data-href~="'+Dn(c.href)+'"]');if(g)return r.instance=g,Ve(g),g;var y=w({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Ve(g),On(g,"style",y),rd(g,c.precedence,i),r.instance=g;case"stylesheet":y=us(c.href);var k=i.querySelector(Hl(y));if(k)return r.state.loading|=4,r.instance=k,Ve(k),k;g=Dx(c),(y=Ia.get(y))&&yh(g,y),k=(i.ownerDocument||i).createElement("link"),Ve(k);var _=k;return _._p=new Promise(function(P,U){_.onload=P,_.onerror=U}),On(k,"link",g),r.state.loading|=4,rd(k,c.precedence,i),r.instance=k;case"script":return k=ds(c.src),(y=i.querySelector($l(k)))?(r.instance=y,Ve(y),y):(g=c,(y=Ia.get(k))&&(g=w({},c),bh(g,y)),i=i.ownerDocument||i,y=i.createElement("script"),Ve(y),On(y,"link",g),i.head.appendChild(y),r.instance=y);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,rd(g,c.precedence,i));return r.instance}function rd(i,r,c){for(var g=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=g.length?g[g.length-1]:null,k=y,_=0;_<g.length;_++){var P=g[_];if(P.dataset.precedence===r)k=P;else if(k!==y)break}k?k.parentNode.insertBefore(i,k.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(i,r.firstChild))}function yh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function bh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var od=null;function Lx(i,r,c){if(od===null){var g=new Map,y=od=new Map;y.set(c,g)}else y=od,g=y.get(c),g||(g=new Map,y.set(c,g));if(g.has(i))return g;for(g.set(i,null),c=c.getElementsByTagName(i),y=0;y<c.length;y++){var k=c[y];if(!(k[Ur]||k[mn]||i==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var _=k.getAttribute(r)||"";_=i+_;var P=g.get(_);P?P.push(k):g.set(_,[k])}}return g}function qx(i,r,c){i=i.ownerDocument||i,i.head.insertBefore(c,r==="title"?i.querySelector("head > title"):null)}function nj(i,r,c){if(c===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 Bx(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function aj(i,r,c,g){if(c.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=us(g.href),k=r.querySelector(Hl(y));if(k){r=k._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=sd.bind(i),r.then(i,i)),c.state.loading|=4,c.instance=k,Ve(k);return}k=r.ownerDocument||r,g=Dx(g),(y=Ia.get(y))&&yh(g,y),k=k.createElement("link"),Ve(k);var _=k;_._p=new Promise(function(P,U){_.onload=P,_.onerror=U}),On(k,"link",g),c.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,r),(r=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=sd.bind(i),r.addEventListener("load",c),r.addEventListener("error",c))}}var Sh=0;function ij(i,r){return i.stylesheets&&i.count===0&&cd(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var g=setTimeout(function(){if(i.stylesheets&&cd(i,i.stylesheets),i.unsuspend){var k=i.unsuspend;i.unsuspend=null,k()}},6e4+r);0<i.imgBytes&&Sh===0&&(Sh=62500*LO());var y=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&cd(i,i.stylesheets),i.unsuspend)){var k=i.unsuspend;i.unsuspend=null,k()}},(i.imgBytes>Sh?50:800)+r);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(y)}}:null}function sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cd(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var ld=null;function cd(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,ld=new Map,r.forEach(rj,i),ld=null,sd.call(i))}function rj(i,r){if(!(r.state.loading&4)){var c=ld.get(i);if(c)var g=c.get(null);else{c=new Map,ld.set(i,c);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<y.length;k++){var _=y[k];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(c.set(_.dataset.precedence,_),g=_)}g&&c.set(null,g)}y=r.instance,_=y.getAttribute("data-precedence"),k=c.get(_)||g,k===g&&c.set(null,y),c.set(_,y),this.count++,g=sd.bind(this),y.addEventListener("load",g),y.addEventListener("error",g),k?k.parentNode.insertBefore(y,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),r.state.loading|=4}}var Ql={$$typeof:q,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function oj(i,r,c,g,y,k,_,P,U){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=Oo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oo(0),this.hiddenUpdates=Oo(null),this.identifierPrefix=g,this.onUncaughtError=y,this.onCaughtError=k,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Ux(i,r,c,g,y,k,_,P,U,ie,fe,ye){return i=new oj(i,r,c,_,U,ie,fe,ye,P),r=1,k===!0&&(r|=24),k=la(3,null,null,r),i.current=k,k.stateNode=i,r=Xp(),r.refCount++,i.pooledCache=r,r.refCount++,k.memoizedState={element:g,isDehydrated:c,cache:r},nf(k),i}function Fx(i){return i?(i=Fo,i):Fo}function Hx(i,r,c,g,y,k){y=Fx(y),g.context===null?g.context=y:g.pendingContext=y,g=Ji(r),g.payload={element:c},k=k===void 0?null:k,k!==null&&(g.callback=k),c=er(i,g,r),c!==null&&(ea(c,i,r),wl(c,i,r))}function $x(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<r?c:r}}function xh(i,r){$x(i,r),(i=i.alternate)&&$x(i,r)}function Qx(i){if(i.tag===13||i.tag===31){var r=Qr(i,67108864);r!==null&&ea(r,i,67108864),xh(i,67108864)}}function Vx(i){if(i.tag===13||i.tag===31){var r=pa();r=ol(r);var c=Qr(i,r);c!==null&&ea(c,i,r),xh(i,r)}}var ud=!0;function sj(i,r,c,g){var y=Q.T;Q.T=null;var k=me.p;try{me.p=2,kh(i,r,c,g)}finally{me.p=k,Q.T=y}}function lj(i,r,c,g){var y=Q.T;Q.T=null;var k=me.p;try{me.p=8,kh(i,r,c,g)}finally{me.p=k,Q.T=y}}function kh(i,r,c,g){if(ud){var y=wh(g);if(y===null)lh(i,r,g,dd,c),Zx(i,g);else if(uj(y,i,r,c,g))g.stopPropagation();else if(Zx(i,g),r&4&&-1<cj.indexOf(i)){for(;y!==null;){var k=Xe(y);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var _=Bn(k.pendingLanes);if(_!==0){var P=k;for(P.pendingLanes|=2,P.entangledLanes|=2;_;){var U=1<<31-Jt(_);P.entanglements[1]|=U,_&=~U}Ja(k),(wt&6)===0&&(Gu=Xt()+500,ql(0))}}break;case 31:case 13:P=Qr(k,2),P!==null&&ea(P,k,2),Ku(),xh(k,2)}if(k=wh(g),k===null&&lh(i,r,g,dd,c),k===y)break;y=k}y!==null&&g.stopPropagation()}else lh(i,r,g,null,c)}}function wh(i){return i=Mp(i),Mh(i)}var dd=null;function Mh(i){if(dd=null,i=Be(i),i!==null){var r=m(i);if(r===null)i=null;else{var c=r.tag;if(c===13){if(i=f(r),i!==null)return i;i=null}else if(c===31){if(i=p(r),i!==null)return i;i=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return dd=i,null}function Gx(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(be()){case _e:return 2;case Nt:return 8;case An:case $a:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Ch=!1,dr=null,mr=null,pr=null,Vl=new Map,Gl=new Map,fr=[],cj="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 Zx(i,r){switch(i){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":mr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Vl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(r.pointerId)}}function Zl(i,r,c,g,y,k){return i===null||i.nativeEvent!==k?(i={blockedOn:r,domEventName:c,eventSystemFlags:g,nativeEvent:k,targetContainers:[y]},r!==null&&(r=Xe(r),r!==null&&Qx(r)),i):(i.eventSystemFlags|=g,r=i.targetContainers,y!==null&&r.indexOf(y)===-1&&r.push(y),i)}function uj(i,r,c,g,y){switch(r){case"focusin":return dr=Zl(dr,i,r,c,g,y),!0;case"dragenter":return mr=Zl(mr,i,r,c,g,y),!0;case"mouseover":return pr=Zl(pr,i,r,c,g,y),!0;case"pointerover":var k=y.pointerId;return Vl.set(k,Zl(Vl.get(k)||null,i,r,c,g,y)),!0;case"gotpointercapture":return k=y.pointerId,Gl.set(k,Zl(Gl.get(k)||null,i,r,c,g,y)),!0}return!1}function Kx(i){var r=Be(i.target);if(r!==null){var c=m(r);if(c!==null){if(r=c.tag,r===13){if(r=f(c),r!==null){i.blockedOn=r,ou(i.priority,function(){Vx(c)});return}}else if(r===31){if(r=p(c),r!==null){i.blockedOn=r,ou(i.priority,function(){Vx(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function md(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var c=wh(i.nativeEvent);if(c===null){c=i.nativeEvent;var g=new c.constructor(c.type,c);wp=g,c.target.dispatchEvent(g),wp=null}else return r=Xe(c),r!==null&&Qx(r),i.blockedOn=c,!1;r.shift()}return!0}function Wx(i,r,c){md(i)&&c.delete(r)}function dj(){Ch=!1,dr!==null&&md(dr)&&(dr=null),mr!==null&&md(mr)&&(mr=null),pr!==null&&md(pr)&&(pr=null),Vl.forEach(Wx),Gl.forEach(Wx)}function pd(i,r){i.blockedOn===r&&(i.blockedOn=null,Ch||(Ch=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dj)))}var fd=null;function Yx(i){fd!==i&&(fd=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fd===i&&(fd=null);for(var r=0;r<i.length;r+=3){var c=i[r],g=i[r+1],y=i[r+2];if(typeof g!="function"){if(Mh(g||c)===null)continue;break}var k=Xe(c);k!==null&&(i.splice(r,3),r-=3,wf(k,{pending:!0,data:y,method:c.method,action:g},g,y))}}))}function ms(i){function r(U){return pd(U,i)}dr!==null&&pd(dr,i),mr!==null&&pd(mr,i),pr!==null&&pd(pr,i),Vl.forEach(r),Gl.forEach(r);for(var c=0;c<fr.length;c++){var g=fr[c];g.blockedOn===i&&(g.blockedOn=null)}for(;0<fr.length&&(c=fr[0],c.blockedOn===null);)Kx(c),c.blockedOn===null&&fr.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(g=0;g<c.length;g+=3){var y=c[g],k=c[g+1],_=y[on]||null;if(typeof k=="function")_||Yx(c);else if(_){var P=null;if(k&&k.hasAttribute("formAction")){if(y=k,_=k[on]||null)P=_.formAction;else if(Mh(y)!==null)continue}else P=_.action;typeof P=="function"?c[g+1]=P:(c.splice(g,3),g-=3),Yx(c)}}}function Xx(){function i(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(_){return y=_})},focusReset:"manual",scroll:"manual"})}function r(){y!==null&&(y(),y=null),g||setTimeout(c,20)}function c(){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,y=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),y!==null&&(y(),y=null)}}}function Ah(i){this._internalRoot=i}hd.prototype.render=Ah.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var c=r.current,g=pa();Hx(c,g,i,r,null,null)},hd.prototype.unmount=Ah.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Hx(i.current,2,null,i,null,null),Ku(),r[Qa]=null}};function hd(i){this._internalRoot=i}hd.prototype.unstable_scheduleHydration=function(i){if(i){var r=ru();i={blockedOn:null,target:i,priority:r};for(var c=0;c<fr.length&&r!==0&&r<fr[c].priority;c++);fr.splice(c,0,i),c===0&&Kx(i)}};var Jx=t.version;if(Jx!=="19.2.3")throw Error(a(527,Jx,"19.2.3"));me.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=u(r),i=i!==null?S(i):null,i=i===null?null:i.stateNode,i};var mj={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gd.isDisabled&&gd.supportsFiber)try{Oa=gd.inject(mj),_n=gd}catch{}}return Wl.createRoot=function(i,r){if(!s(i))throw Error(a(299));var c=!1,g="",y=oS,k=sS,_=lS;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(y=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),r=Ux(i,1,!1,null,null,c,g,null,y,k,_,Xx),i[Qa]=r.current,sh(i),new Ah(r)},Wl.hydrateRoot=function(i,r,c){if(!s(i))throw Error(a(299));var g=!1,y="",k=oS,_=sS,P=lS,U=null;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(k=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(P=c.onRecoverableError),c.formState!==void 0&&(U=c.formState)),r=Ux(i,1,!0,r,c??null,g,y,U,k,_,P,Xx),r.context=Fx(null),c=r.current,g=pa(),g=ol(g),y=Ji(g),y.callback=null,er(c,y,g),c=g,r.current.lanes=c,$i(r,c),Ja(r),i[Qa]=r.current,sh(i),new hd(r)},Wl.version="19.2.3",Wl}var ck;function wj(){if(ck)return Rh.exports;ck=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(),Rh.exports=kj(),Rh.exports}var Mj=wj(),Cj=Object.create,xA=Object.defineProperty,Aj=Object.getOwnPropertyDescriptor,kA=Object.getOwnPropertyNames,Ej=Object.getPrototypeOf,Rj=Object.prototype.hasOwnProperty,ci=(e,t)=>function(){return t||(0,e[kA(e)[0]])((t={exports:{}}).exports,t),t.exports},_j=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=kA(t),m=0,f=s.length,p;m<f;m++)p=s[m],!Rj.call(e,p)&&p!==n&&xA(e,p,{get:(h=>t[h]).bind(null,p),enumerable:!(a=Aj(t,p))||a.enumerable});return e},dn=(e,t,n)=>(n=e!=null?Cj(Ej(e)):{},_j(t||!e||!e.__esModule?xA(n,"default",{value:e,enumerable:!0}):n,e)),wA=ci({"../../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}}),Ij=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=wA().default;function a(s,m){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var p=f.call(s,m||"default");if(n(p)!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Tj=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=wA().default,a=Ij();function s(m){var f=a(m,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),wo=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Tj();function a(s,m,f){return(m=n(m))in s?Object.defineProperty(s,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[m]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fa=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=wo();function a(m,f){var p=Object.keys(m);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(m);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(m,u).enumerable})),p.push.apply(p,h)}return p}function s(m){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?a(Object(p),!0).forEach(function(h){n(m,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(p)):a(Object(p)).forEach(function(h){Object.defineProperty(m,h,Object.getOwnPropertyDescriptor(p,h))})}return m}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function Ys(e){const t={subscribe(n){let a=null,s=!1,m=!1,f=!1;function p(){if(a===null){f=!0;return}m||(m=!0,typeof a=="function"?a():a&&a.unsubscribe())}return a=e({next(h){var u;s||(u=n.next)===null||u===void 0||u.call(n,h)},error(h){var u;s||(s=!0,(u=n.error)===null||u===void 0||u.call(n,h),p())},complete(){var h;s||(s=!0,(h=n.complete)===null||h===void 0||h.call(n),p())}}),f&&p(),{unsubscribe:p}},pipe(...n){return n.reduce(Nj,t)}};return t}function Nj(e,t){return t(e)}function Oj(e){const t=new AbortController;return new Promise((a,s)=>{let m=!1;function f(){m||(m=!0,p.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});const p=e.subscribe({next(h){m=!0,a(h),f()},error(h){s(h)},complete(){t.abort(),f()}})})}function jj(e){return t=>{let n=0,a=null;const s=[];function m(){a||(a=t.subscribe({next(p){for(const u of s){var h;(h=u.next)===null||h===void 0||h.call(u,p)}},error(p){for(const u of s){var h;(h=u.error)===null||h===void 0||h.call(u,p)}},complete(){for(const h of s){var p;(p=h.complete)===null||p===void 0||p.call(h)}}}))}function f(){if(n===0&&a){const p=a;a=null,p.unsubscribe()}}return Ys(p=>(n++,s.push(p),m(),{unsubscribe(){n--,f();const h=s.findIndex(u=>u===p);h>-1&&s.splice(h,1)}}))}}function MA(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)},m=Ys(f=>(a(f),()=>{s(f)}));return m.next=f=>{if(t!==f){t=f;for(const p of n)p.next(f)}},m.get=()=>t,m}function Pj(e){return Ys(t=>{function n(s=0,m=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:m,next(h){return n(s+1,h)}})}return n().subscribe(t)})}function xo(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Dj(){return Object.create(null)}const zj=typeof Symbol=="function"&&!!Symbol.asyncIterator;function CA(e){return zj&&xo(e)&&Symbol.asyncIterator in e}const uk=e=>e();function dk(e=0){return new Promise(t=>setTimeout(t,e))}var Lj=Object.create,AA=Object.defineProperty,qj=Object.getOwnPropertyDescriptor,EA=Object.getOwnPropertyNames,Bj=Object.getPrototypeOf,Uj=Object.prototype.hasOwnProperty,qc=(e,t)=>function(){return t||(0,e[EA(e)[0]])((t={exports:{}}).exports,t),t.exports},Fj=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=EA(t),m=0,f=s.length,p;m<f;m++)p=s[m],!Uj.call(e,p)&&p!==n&&AA(e,p,{get:(h=>t[h]).bind(null,p),enumerable:!(a=qj(t,p))||a.enumerable});return e},Wm=(e,t,n)=>(n=e!=null?Lj(Bj(e)):{},Fj(AA(n,"default",{value:e,enumerable:!0}),e));const RA=()=>{},mk=e=>{Object.freeze&&Object.freeze(e)};function _A(e,t,n){var a;const s=t.join(".");return(a=n[s])!==null&&a!==void 0||(n[s]=new Proxy(RA,{get(m,f){if(!(typeof f!="string"||f==="then"))return _A(e,[...t,f],n)},apply(m,f,p){const h=t[t.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let u={args:p,path:t};return h==="call"?u={args:p.length>=2?[p[1]]:[],path:t.slice(0,-1)}:h==="apply"&&(u={args:p.length>=2?p[1]:[],path:t.slice(0,-1)}),mk(u.args),mk(u.path),e(u)}})),n[s]}const Ym=e=>_A(e,[],Dj()),Uy=e=>new Proxy(RA,{get(t,n){if(n!=="then")return e(n)}});var IA=qc({"../../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}}),Hj=qc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=IA().default;function a(s,m){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var p=f.call(s,m||"default");if(n(p)!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),$j=qc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=IA().default,a=Hj();function s(m){var f=a(m,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),TA=qc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=$j();function a(s,m,f){return(m=n(m))in s?Object.defineProperty(s,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[m]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fy=qc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=TA();function a(m,f){var p=Object.keys(m);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(m);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(m,u).enumerable})),p.push.apply(p,h)}return p}function s(m){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?a(Object(p),!0).forEach(function(h){n(m,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(p)):a(Object(p)).forEach(function(h){Object.defineProperty(m,h,Object.getOwnPropertyDescriptor(p,h))})}return m}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});Wm(Fy());Wm(TA());var vd=Wm(Fy());function Qj(e,t){if("error"in e){const a=t.deserialize(e.error);return{ok:!1,error:(0,vd.default)((0,vd.default)({},e),{},{error:a})}}return{ok:!0,result:(0,vd.default)((0,vd.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Oh=class extends Error{constructor(){super("Unable to transform response from server")}};function NA(e,t){let n;try{n=Qj(e,t)}catch{throw new Oh}if(!n.ok&&(!xo(n.error.error)||typeof n.error.error.code!="number"))throw new Oh;if(n.ok&&!xo(n.result))throw new Oh;return n}Wm(Fy());var yd=dn(wo(),1),ps=dn(Fa(),1);function Vj(e){return e instanceof ji}function Gj(e){return xo(e)&&xo(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Zj(e,t){return typeof e=="string"?e:xo(e)&&typeof e.message=="string"?e.message:t}var ji=class Qd extends Error{constructor(t,n){var a,s;const m=n?.cause;super(t,{cause:m}),(0,yd.default)(this,"cause",void 0),(0,yd.default)(this,"shape",void 0),(0,yd.default)(this,"data",void 0),(0,yd.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=m,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,Qd.prototype)}static from(t,n={}){const a=t;return Vj(a)?(n.meta&&(a.meta=(0,ps.default)((0,ps.default)({},a.meta),n.meta)),a):Gj(a)?new Qd(a.error.message,(0,ps.default)((0,ps.default)({},n),{},{result:a,cause:n.cause})):new Qd(Zj(a,"Unknown error"),(0,ps.default)((0,ps.default)({},n),{},{cause:a}))}};function OA(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 pk=e=>typeof e=="function";function Kj(e){if(e)return e;if(typeof window<"u"&&pk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&pk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var pc=dn(Fa());function Wj(e){return{url:e.url.toString(),fetch:e.fetch,transformer:OA(e.transformer),methodOverride:e.methodOverride}}function Yj(e){const t={};for(let n=0;n<e.length;n++){const a=e[n];t[n]=a}return t}const Xj={query:"GET",mutation:"POST",subscription:"PATCH"};function jA(e){return"input"in e?e.transformer.input.serialize(e.input):Yj(e.inputs.map(t=>e.transformer.input.serialize(t)))}const ov=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 m=jA(e);m!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(m))}`)}return s.length&&(a+="?"+s.join("&")),a},Jj=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=jA(e);return t!==void 0?JSON.stringify(t):void 0},e3=e=>sv((0,pc.default)((0,pc.default)({},e),{},{contentTypeHeader:"application/json",getUrl:ov,getBody:Jj}));var t3=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const n3=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 t3};async function a3(e){var t,n;n3(e.signal);const a=e.getUrl(e),s=e.getBody(e),m=(t=e.methodOverride)!==null&&t!==void 0?t:Xj[e.type],f=await(async()=>{const h=await e.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),p=(0,pc.default)((0,pc.default)((0,pc.default)({},e.contentTypeHeader&&m!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),f);return Kj(e.fetch)(a,{method:m,signal:e.signal,body:s,headers:p})}async function sv(e){const t={},n=await a3(e);t.response=n;const a=await n.json();return t.responseJSON=a,{json:a,meta:t}}function i3(e){return e instanceof Uint8Array||e instanceof Blob}function r3(e){return e instanceof FormData}var Cs=dn(Fa(),1);const o3=e=>{if("input"in e){const{input:t}=e;if(r3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return sv((0,Cs.default)((0,Cs.default)({},e),{},{contentTypeHeader:void 0,getUrl:ov,getBody:()=>t}))}if(i3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return sv((0,Cs.default)((0,Cs.default)({},e),{},{contentTypeHeader:"application/octet-stream",getUrl:ov,getBody:()=>t}))}}return e3(e)};function s3(e){const t=Wj(e);return()=>n=>{const{op:a}=n;return Ys(s=>{const{path:m,input:f,type:p}=a;if(p==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=o3((0,Cs.default)((0,Cs.default)({},t),{},{type:p,path:m,input:f,signal:a.signal,headers(){return e.headers?typeof e.headers=="function"?e.headers({op:a}):e.headers:{}}}));let u;return h.then(S=>{u=S.meta;const w=NA(S.json,t.transformer.output);if(!w.ok){s.error(ji.from(w.error,{meta:u}));return}s.next({context:S.meta,result:w.result}),s.complete()}).catch(S=>{s.error(ji.from(S,{meta:u}))}),()=>{}})}}dn(Fa(),1);dn(Fa(),1);const l3={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)}},c3={enabled:!1,closeMs:0},u3={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},d3=e=>e===0?0:Math.min(1e3*2**e,3e4),PA=(e,...t)=>typeof e=="function"?e(...t):e;var m3=dn(wo(),1),fs=class DA extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,DA.prototype)}},p3=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,m3.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 zA(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}async function f3(e){const t=await PA(e.url);if(!e.connectionParams)return t;const a=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+a}async function h3(e,t){const n={method:"connectionParams",data:await PA(e)};return t.encode(n)}var fk=dn(wo(),1),g3=class{constructor(){(0,fk.default)(this,"outgoingRequests",new Array),(0,fk.default)(this,"pendingRequests",{})}register(e,t){const{promise:n,resolve:a}=zA();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}},yr=dn(wo(),1);function v3(e){const{promise:t,resolve:n,reject:a}=zA();return e.addEventListener("open",()=>{e.removeEventListener("error",a),n()}),e.addEventListener("error",a),t}function y3(e,{intervalMs:t,pongTimeoutMs:n}){let a,s;function m(){a=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function f(){clearTimeout(a),m()}function p(){clearTimeout(s),f()}e.addEventListener("open",m),e.addEventListener("message",({data:h})=>{clearTimeout(a),m(),h==="PONG"&&p()}),e.addEventListener("close",()=>{clearTimeout(a),clearTimeout(s)})}var LA=class lv{constructor(t){var n;if((0,yr.default)(this,"id",++lv.connectCount),(0,yr.default)(this,"WebSocketPonyfill",void 0),(0,yr.default)(this,"urlOptions",void 0),(0,yr.default)(this,"keepAliveOpts",void 0),(0,yr.default)(this,"encoder",void 0),(0,yr.default)(this,"wsObservable",MA(null)),(0,yr.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=++lv.connectCount;const n=f3(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&&y3(a,t.keepAliveOpts),a.addEventListener("close",()=>{t.ws===a&&(t.ws=null)}),await v3(a),t.urlOptions.connectionParams&&a.send(await h3(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,yr.default)(LA,"connectCount",0);function b3(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 ei=dn(wo(),1),hs=dn(Fa(),1),S3=class{constructor(e){var t,n;(0,ei.default)(this,"connectionState",void 0),(0,ei.default)(this,"allowReconnect",!1),(0,ei.default)(this,"requestManager",new g3),(0,ei.default)(this,"activeConnection",void 0),(0,ei.default)(this,"reconnectRetryDelay",void 0),(0,ei.default)(this,"inactivityTimeout",void 0),(0,ei.default)(this,"callbacks",void 0),(0,ei.default)(this,"lazyMode",void 0),(0,ei.default)(this,"encoder",void 0),(0,ei.default)(this,"reconnecting",null),this.encoder=(t=e.experimental_encoder)!==null&&t!==void 0?t:l3,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const a=(0,hs.default)((0,hs.default)({},c3),e.lazy);this.inactivityTimeout=new p3(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},a.closeMs),this.activeConnection=new LA({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,hs.default)((0,hs.default)({},u3),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:d3,this.lazyMode=a.enabled,this.connectionState=MA({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 fs({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(ji.from(new fs({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:m,lastEventId:f}){return Ys(p=>{const h=this.batchSend({id:e,method:t,params:{input:m.input.serialize(a),path:n,lastEventId:f}},(0,hs.default)((0,hs.default)({},p),{},{next(u){const S=NA(u,m.output);if(!S.ok){p.error(ji.from(S.error));return}p.next({result:S.result})}}));return()=>{h(),t==="subscription"&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",h)}})}get connection(){return b3(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:"state",state:"connecting",error:ji.from(e)}),this.reconnecting)return;const n=async a=>{try{await dk(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:m,callbacks:f}of s)m.method!=="subscription"&&(f.error(ji.from(a??new fs({message:"WebSocket closed",cause:a}))),this.requestManager.delete(m.id))};e.addEventListener("open",()=>{uk(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,m;n(a),(s=(m=this.callbacks).onClose)===null||s===void 0||s.call(m,a),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new fs({message:"WebSocket closed",cause:a}))}),e.addEventListener("error",a=>{var s,m;n(a),(s=(m=this.callbacks).onError)===null||s===void 0||s.call(m,a),this.reconnect(new fs({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 fs({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(),uk(async()=>{n.activeConnection.isOpen()||await n.open(),await dk(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:a})=>a))}).catch(a=>{this.requestManager.delete(e.id),t.error(ji.from(a))}),this.requestManager.register(e,t)}};function x3(e){return new S3(e)}function k3(e){const{client:t}=e,n=OA(e.transformer);return()=>({op:a})=>Ys(s=>{const m=a.type==="subscription"?t.connectionState.subscribe({next(p){s.next({result:p,context:a.context})}}):null,f=t.request({op:a,transformer:n}).subscribe(s);return()=>{f.unsubscribe(),m?.unsubscribe()}})}var jh=dn(wo(),1),hk=dn(Fa(),1),Xm=class{constructor(e){(0,jh.default)(this,"links",void 0),(0,jh.default)(this,"runtime",void 0),(0,jh.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Pj({links:this.links,op:(0,hk.default)((0,hk.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(jj())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await Oj(n)).result.data}catch(n){throw ji.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 m;(m=n.onConnectionStateChange)===null||m===void 0||m.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 p;(p=n.onStopped)===null||p===void 0||p.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 m;(m=n.onError)===null||m===void 0||m.call(n,s)},complete(){var s;(s=n.onComplete)===null||s===void 0||s.call(n)}})}};const qA=Symbol.for("trpc_untypedClient"),w3={query:"query",mutate:"mutation",subscribe:"subscription"},M3=e=>w3[e];function BA(e){const t=Ym(({path:n,args:a})=>{const s=[...n],m=M3(s.pop()),f=s.join(".");return e[m](f,...a)});return Uy(n=>n===qA?e:t[n])}function cv(e){const t=new Xm(e);return BA(t)}function Hy(e){return e[qA]}dn(Fa(),1);dn(Fa(),1);var C3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var m,f,p,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,p=Symbol.iterator);h--;){if(f&&(m=s[f])!=null)return m.call(s);if(p&&(m=s[p])!=null)return new a(m.call(s));f="@@asyncIterator",p="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function m(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var p=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:p}})}return a=function(p){this.s=p,this.n=p.next},a.prototype={s:null,n:null,next:function(){return m(this.n.apply(this.s,arguments))},return:function(p){var h=this.s.return;return h===void 0?Promise.resolve({value:p,done:!0}):m(h.apply(this.s,arguments))},throw:function(p){var h=this.s.return;return h===void 0?Promise.reject(p):m(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});dn(C3(),1);dn(Fa(),1);var A3=ci({"../../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(p,h){var u=Error();return u.name="SuppressedError",u.error=p,u.suppressed=h,u},s={},m=[];function f(p,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(p)var u=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(u===void 0&&(u=h[Symbol.dispose||Symbol.for("Symbol.dispose")],p))var S=u;if(typeof u!="function")throw new TypeError("Object is not disposable.");S&&(u=function(){try{S.call(h)}catch(C){return Promise.reject(C)}}),m.push({v:h,d:u,a:p})}else p&&m.push({d:h,a:p});return h}return{e:s,u:f.bind(null,!1),a:f.bind(null,!0),d:function(){var h,u=this.e,S=0;function w(){for(;h=m.pop();)try{if(!h.a&&S===1)return S=0,m.push(h),Promise.resolve().then(w);if(h.d){var E=h.d.call(h.v);if(h.a)return S|=2,Promise.resolve(E).then(w,C)}else S|=1}catch(R){return C(R)}if(S===1)return u!==s?Promise.reject(u):Promise.resolve();if(u!==s)throw u}function C(E){return u=u!==s?new a(E,u):E,w()}return w()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),UA=ci({"../../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}}),E3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=UA();function a(s){return new n(s,0)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),R3=ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=UA();function a(m){return function(){return new s(m.apply(this,arguments))}}function s(m){var f,p;function h(S,w){try{var C=m[S](w),E=C.value,R=E instanceof n;Promise.resolve(R?E.v:E).then(function(T){if(R){var j=S==="return"?"return":"next";if(!E.k||T.done)return h(j,T);T=m[j](T).value}u(C.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){u("throw",T)}}function u(S,w){switch(S){case"return":f.resolve({value:w,done:!0});break;case"throw":f.reject(w);break;default:f.resolve({value:w,done:!1})}(f=f.next)?h(f.key,f.arg):p=null}this._invoke=function(S,w){return new Promise(function(C,E){var R={key:S,arg:w,resolve:C,reject:E,next:null};p?p=p.next=R:(f=p=R,h(S,w))})},typeof m.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(m){return this._invoke("next",m)},s.prototype.throw=function(m){return this._invoke("throw",m)},s.prototype.return=function(m){return this._invoke("return",m)},t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});dn(A3(),1);dn(E3(),1);dn(R3(),1);dn(Fa(),1);var Ke=(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.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.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.FrigateLiveEvent="frigate.live-event",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.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})({});const _3="modulepreload",I3=function(e,t){return new URL(e,t).href},gk={},qs=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let u=function(S){return Promise.all(S.map(w=>Promise.resolve(w).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};const f=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),h=p?.nonce||p?.getAttribute("nonce");s=u(n.map(S=>{if(S=I3(S,a),S in gk)return;gk[S]=!0;const w=S.endsWith(".css"),C=w?'[rel="stylesheet"]':"";if(a)for(let R=f.length-1;R>=0;R--){const T=f[R];if(T.href===S&&(!w||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${S}"]${C}`))return;const E=document.createElement("link");if(E.rel=w?"stylesheet":_3,w||(E.as="script"),E.crossOrigin="",E.href=S,h&&E.setAttribute("nonce",h),document.head.appendChild(E),w)return new Promise((R,T)=>{E.addEventListener("load",R),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${S}`)))})}))}function m(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return s.then(f=>{for(const p of f||[])p.status==="rejected"&&m(p.reason);return t().catch(m)})};var vk;function de(e,t,n){function a(p,h){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,h);const u=f.prototype,S=Object.keys(u);for(let w=0;w<S.length;w++){const C=S[w];C in p||(p[C]=u[C].bind(p))}}const s=n?.Parent??Object;class m extends s{}Object.defineProperty(m,"name",{value:e});function f(p){var h;const u=n?.Parent?new m:this;a(u,p),(h=u._zod).deferred??(h.deferred=[]);for(const S of u._zod.deferred)S();return u}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Ps extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class FA extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(vk=globalThis).__zod_globalConfig??(vk.__zod_globalConfig={});const $y=globalThis.__zod_globalConfig;function qi(e){return $y}function HA(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 uv(e,t){return typeof t=="bigint"?t.toString():t}function Jm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qy(e){return e==null}function Vy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function T3(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 yk=Symbol("evaluating");function ht(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==yk)return a===void 0&&(a=yk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Mo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ir(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function bk(e){return JSON.stringify(e)}function N3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $A="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const O3=Jm(()=>{if($y.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Bs(e){if(xc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(xc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function QA(e){return Bs(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const j3=new Set(["string","number","symbol"]);function Us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ui(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function De(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 P3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const D3={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 z3(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 m=Ir(e._zod.def,{get shape(){const f={};for(const p in t){if(!(p in n.shape))throw new Error(`Unrecognized key: "${p}"`);t[p]&&(f[p]=n.shape[p])}return Mo(this,"shape",f),f},checks:[]});return Ui(e,m)}function L3(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 m=Ir(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const p in t){if(!(p in n.shape))throw new Error(`Unrecognized key: "${p}"`);t[p]&&delete f[p]}return Mo(this,"shape",f),f},checks:[]});return Ui(e,m)}function q3(e,t){if(!Bs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const m=e._zod.def.shape;for(const f in t)if(Object.getOwnPropertyDescriptor(m,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ir(e._zod.def,{get shape(){const m={...e._zod.def.shape,...t};return Mo(this,"shape",m),m}});return Ui(e,s)}function B3(e,t){if(!Bs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ir(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Mo(this,"shape",a),a}});return Ui(e,n)}function U3(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=Ir(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Mo(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ui(e,n)}function F3(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=Ir(t._zod.def,{get shape(){const p=t._zod.def.shape,h={...p};if(n)for(const u in n){if(!(u in p))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(h[u]=e?new e({type:"optional",innerType:p[u]}):p[u])}else for(const u in p)h[u]=e?new e({type:"optional",innerType:p[u]}):p[u];return Mo(this,"shape",h),h},checks:[]});return Ui(t,f)}function H3(e,t,n){const a=Ir(t._zod.def,{get shape(){const s=t._zod.def.shape,m={...s};if(n)for(const f in n){if(!(f in m))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(m[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)m[f]=new e({type:"nonoptional",innerType:s[f]});return Mo(this,"shape",m),m}});return Ui(t,a)}function As(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 $3(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 Sr(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function bd(e){return typeof e=="string"?e:e?.message}function Bi(e,t,n){const a=e.message?e.message:bd(e.inst?._zod.def?.error?.(e))??bd(t?.error?.(e))??bd(n.customError?.(e))??bd(n.localeError?.(e))??"Invalid input",{inst:s,continue:m,input:f,...p}=e;return p.path??(p.path=[]),p.message=a,t?.reportInput&&(p.input=f),p}function Gy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function kc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const VA=(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,uv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},GA=de("$ZodError",VA),ZA=de("$ZodError",VA,{Parent:Error});function Q3(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 V3(e,t=n=>n.message){const n={_errors:[]},a=(s,m=[])=>{for(const f of s.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(p=>a({issues:p},[...m,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...m,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...m,...f.path]);else{const p=[...m,...f.path];if(p.length===0)n._errors.push(t(f));else{let h=n,u=0;for(;u<p.length;){const S=p[u];u===p.length-1?(h[S]=h[S]||{_errors:[]},h[S]._errors.push(t(f))):h[S]=h[S]||{_errors:[]},h=h[S],u++}}}};return a(e),n}const Zy=e=>(t,n,a,s)=>{const m=a?{...a,async:!1}:{async:!1},f=t._zod.run({value:n,issues:[]},m);if(f instanceof Promise)throw new Ps;if(f.issues.length){const p=new(s?.Err??e)(f.issues.map(h=>Bi(h,m,qi())));throw $A(p,s?.callee),p}return f.value},Ky=e=>async(t,n,a,s)=>{const m=a?{...a,async:!0}:{async:!0};let f=t._zod.run({value:n,issues:[]},m);if(f instanceof Promise&&(f=await f),f.issues.length){const p=new(s?.Err??e)(f.issues.map(h=>Bi(h,m,qi())));throw $A(p,s?.callee),p}return f.value},ep=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},m=t._zod.run({value:n,issues:[]},s);if(m instanceof Promise)throw new Ps;return m.issues.length?{success:!1,error:new(e??GA)(m.issues.map(f=>Bi(f,s,qi())))}:{success:!0,data:m.value}},G3=ep(ZA),tp=e=>async(t,n,a)=>{const s=a?{...a,async:!0}:{async:!0};let m=t._zod.run({value:n,issues:[]},s);return m instanceof Promise&&(m=await m),m.issues.length?{success:!1,error:new e(m.issues.map(f=>Bi(f,s,qi())))}:{success:!0,data:m.value}},Z3=tp(ZA),K3=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Zy(e)(t,n,s)},W3=e=>(t,n,a)=>Zy(e)(t,n,a),Y3=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Ky(e)(t,n,s)},X3=e=>async(t,n,a)=>Ky(e)(t,n,a),J3=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return ep(e)(t,n,s)},eP=e=>(t,n,a)=>ep(e)(t,n,a),tP=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return tp(e)(t,n,s)},nP=e=>async(t,n,a)=>tp(e)(t,n,a),aP=/^[cC][0-9a-z]{6,}$/,iP=/^[0-9a-z]+$/,rP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oP=/^[0-9a-vA-V]{20}$/,sP=/^[A-Za-z0-9]{27}$/,lP=/^[a-zA-Z0-9_-]{21}$/,cP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uP=/^([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})$/,Sk=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)$/,dP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pP(){return new RegExp(mP,"u")}const fP=/^(?:(?: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])$/,hP=/^(([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}|:))$/,gP=/^((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])$/,vP=/^(([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])$/,yP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KA=/^[A-Za-z0-9_-]*$/,bP=/^https?$/,SP=/^\+[1-9]\d{6,14}$/,WA="(?:(?:\\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])))",xP=new RegExp(`^${WA}$`);function YA(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 kP(e){return new RegExp(`^${YA(e)}$`)}function wP(e){const t=YA({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(`^${WA}T(?:${a})$`)}const MP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},CP=/^-?\d+$/,XA=/^-?\d+(?:\.\d+)?$/,AP=/^(?:true|false)$/i,EP=/^null$/i,RP=/^[^A-Z]*$/,_P=/^[^a-z]*$/,ra=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),JA={number:"number",bigint:"bigint",object:"date"},eE=de("$ZodCheckLessThan",(e,t)=>{ra.init(e,t);const n=JA[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,m=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<m&&(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})}}),tE=de("$ZodCheckGreaterThan",(e,t)=>{ra.init(e,t);const n=JA[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,m=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>m&&(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})}}),IP=de("$ZodCheckMultipleOf",(e,t)=>{ra.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):T3(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})}}),TP=de("$ZodCheckNumberFormat",(e,t)=>{ra.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,m]=D3[t.format];e._zod.onattach.push(f=>{const p=f._zod.bag;p.format=t.format,p.minimum=s,p.maximum=m,n&&(p.pattern=CP)}),e._zod.check=f=>{const p=f.value;if(n){if(!Number.isInteger(p)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?f.issues.push({input:p,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:p,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}}p<s&&f.issues.push({origin:"number",input:p,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),p>m&&f.issues.push({origin:"number",input:p,code:"too_big",maximum:m,inclusive:!0,inst:e,continue:!t.abort})}}),NP=de("$ZodCheckMaxLength",(e,t)=>{var n;ra.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Qy(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=Gy(s);a.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),OP=de("$ZodCheckMinLength",(e,t)=>{var n;ra.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Qy(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=Gy(s);a.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),jP=de("$ZodCheckLengthEquals",(e,t)=>{var n;ra.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Qy(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,m=s.length;if(m===t.length)return;const f=Gy(s),p=m>t.length;a.issues.push({origin:f,...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),np=de("$ZodCheckStringFormat",(e,t)=>{var n,a;ra.init(e,t),e._zod.onattach.push(s=>{const m=s._zod.bag;m.format=t.format,t.pattern&&(m.patterns??(m.patterns=new Set),m.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=()=>{})}),PP=de("$ZodCheckRegex",(e,t)=>{np.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})}}),DP=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=RP),np.init(e,t)}),zP=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_P),np.init(e,t)}),LP=de("$ZodCheckIncludes",(e,t)=>{ra.init(e,t);const n=Us(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const m=s._zod.bag;m.patterns??(m.patterns=new Set),m.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})}}),qP=de("$ZodCheckStartsWith",(e,t)=>{ra.init(e,t);const n=new RegExp(`^${Us(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})}}),BP=de("$ZodCheckEndsWith",(e,t)=>{ra.init(e,t);const n=new RegExp(`.*${Us(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})}}),UP=de("$ZodCheckOverwrite",(e,t)=>{ra.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class FP{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)),m=a.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of m)this.content.push(f)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(m=>` ${m}`)];return new t(...n,s.join(`
12
- `))}}const HP={major:4,minor:4,patch:3},Ct=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=HP;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const m of s._zod.onattach)m(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,p,h)=>{let u=As(f),S;for(const w of p){if(w._zod.def.when){if($3(f)||!w._zod.def.when(f))continue}else if(u)continue;const C=f.issues.length,E=w._zod.check(f);if(E instanceof Promise&&h?.async===!1)throw new Ps;if(S||E instanceof Promise)S=(S??Promise.resolve()).then(async()=>{await E,f.issues.length!==C&&(u||(u=As(f,C)))});else{if(f.issues.length===C)continue;u||(u=As(f,C))}}return S?S.then(()=>f):f},m=(f,p,h)=>{if(As(f))return f.aborted=!0,f;const u=s(p,a,h);if(u instanceof Promise){if(h.async===!1)throw new Ps;return u.then(S=>e._zod.parse(S,h))}return e._zod.parse(u,h)};e._zod.run=(f,p)=>{if(p.skipChecks)return e._zod.parse(f,p);if(p.direction==="backward"){const u=e._zod.parse({value:f.value,issues:[]},{...p,skipChecks:!0});return u instanceof Promise?u.then(S=>m(S,f,p)):m(u,f,p)}const h=e._zod.parse(f,p);if(h instanceof Promise){if(p.async===!1)throw new Ps;return h.then(u=>s(u,a,p))}return s(h,a,p)}}ht(e,"~standard",()=>({validate:s=>{try{const m=G3(e,s);return m.success?{value:m.data}:{issues:m.error?.issues}}catch{return Z3(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Wy=de("$ZodString",(e,t)=>{Ct.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??MP(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}}),Zt=de("$ZodStringFormat",(e,t)=>{np.init(e,t),Wy.init(e,t)}),$P=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=uP),Zt.init(e,t)}),QP=de("$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=Sk(a))}else t.pattern??(t.pattern=Sk());Zt.init(e,t)}),VP=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=dP),Zt.init(e,t)}),GP=de("$ZodURL",(e,t)=>{Zt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim();if(!t.normalize&&t.protocol?.source===bP.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})}}}),ZP=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=pP()),Zt.init(e,t)}),KP=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lP),Zt.init(e,t)}),WP=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=aP),Zt.init(e,t)}),YP=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iP),Zt.init(e,t)}),XP=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rP),Zt.init(e,t)}),JP=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oP),Zt.init(e,t)}),eD=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=sP),Zt.init(e,t)}),tD=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=wP(t)),Zt.init(e,t)}),nD=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xP),Zt.init(e,t)}),aD=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=kP(t)),Zt.init(e,t)}),iD=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cP),Zt.init(e,t)}),rD=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fP),Zt.init(e,t),e._zod.bag.format="ipv4"}),oD=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hP),Zt.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})}}}),sD=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=gP),Zt.init(e,t)}),lD=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vP),Zt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,m]=a;if(!m)throw new Error;const f=Number(m);if(`${f}`!==m)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 nE(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cD=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yP),Zt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{nE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function uD(e){if(!KA.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return nE(n)}const dD=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=KA),Zt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{uD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),mD=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=SP),Zt.init(e,t)});function pD(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 fD=de("$ZodJWT",(e,t)=>{Zt.init(e,t),e._zod.check=n=>{pD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),aE=de("$ZodNumber",(e,t)=>{Ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??XA,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 m=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,...m?{received:m}:{}}),n}}),hD=de("$ZodNumberFormat",(e,t)=>{TP.init(e,t),aE.init(e,t)}),gD=de("$ZodBoolean",(e,t)=>{Ct.init(e,t),e._zod.pattern=AP,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}}),vD=de("$ZodNull",(e,t)=>{Ct.init(e,t),e._zod.pattern=EP,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}}),yD=de("$ZodAny",(e,t)=>{Ct.init(e,t),e._zod.parse=n=>n}),bD=de("$ZodUnknown",(e,t)=>{Ct.init(e,t),e._zod.parse=n=>n}),SD=de("$ZodNever",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),xD=de("$ZodVoid",(e,t)=>{Ct.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}}),kD=de("$ZodDate",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,m=s instanceof Date;return m&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...m?{received:"Invalid Date"}:{},inst:e}),n}});function xk(e,t,n){e.issues.length&&t.issues.push(...Sr(n,e.issues)),t.value[n]=e.value}const wD=de("$ZodArray",(e,t)=>{Ct.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 m=[];for(let f=0;f<s.length;f++){const p=s[f],h=t.element._zod.run({value:p,issues:[]},a);h instanceof Promise?m.push(h.then(u=>xk(u,n,f))):xk(h,n,f)}return m.length?Promise.all(m).then(()=>n):n}});function km(e,t,n,a,s,m){const f=n in a;if(e.issues.length){if(s&&m&&!f)return;t.issues.push(...Sr(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 iE(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=P3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rE(e,t,n,a,s,m){const f=[],p=s.keySet,h=s.catchall._zod,u=h.def.type,S=h.optin==="optional",w=h.optout==="optional";for(const C in t){if(C==="__proto__"||p.has(C))continue;if(u==="never"){f.push(C);continue}const E=h.run({value:t[C],issues:[]},a);E instanceof Promise?e.push(E.then(R=>km(R,n,C,t,S,w))):km(E,n,C,t,S,w)}return f.length&&n.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:m}),e.length?Promise.all(e).then(()=>n):n}const MD=de("$ZodObject",(e,t)=>{if(Ct.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const p=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...p};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=Jm(()=>iE(t));ht(e._zod,"propValues",()=>{const p=t.shape,h={};for(const u in p){const S=p[u]._zod;if(S.values){h[u]??(h[u]=new Set);for(const w of S.values)h[u].add(w)}}return h});const s=xc,m=t.catchall;let f;e._zod.parse=(p,h)=>{f??(f=a.value);const u=p.value;if(!s(u))return p.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),p;p.value={};const S=[],w=f.shape;for(const C of f.keys){const E=w[C],R=E._zod.optin==="optional",T=E._zod.optout==="optional",j=E._zod.run({value:u[C],issues:[]},h);j instanceof Promise?S.push(j.then(D=>km(D,p,C,u,R,T))):km(j,p,C,u,R,T)}return m?rE(S,u,p,h,a.value,e):S.length?Promise.all(S).then(()=>p):p}}),CD=de("$ZodObjectJIT",(e,t)=>{MD.init(e,t);const n=e._zod.parse,a=Jm(()=>iE(t)),s=C=>{const E=new FP(["shape","payload","ctx"]),R=a.value,T=q=>{const L=bk(q);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};E.write("const input = payload.value;");const j=Object.create(null);let D=0;for(const q of R.keys)j[q]=`key_${D++}`;E.write("const newResult = {};");for(const q of R.keys){const L=j[q],K=bk(q),J=C[q],$=J?._zod?.optin==="optional",F=J?._zod?.optout==="optional";E.write(`const ${L} = ${T(q)};`),$&&F?E.write(`
13
- if (${L}.issues.length) {
14
- if (${K} in input) {
15
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
16
- ...iss,
17
- path: iss.path ? [${K}, ...iss.path] : [${K}]
18
- })));
19
- }
20
- }
21
-
22
- if (${L}.value === undefined) {
23
- if (${K} in input) {
24
- newResult[${K}] = undefined;
25
- }
26
- } else {
27
- newResult[${K}] = ${L}.value;
28
- }
29
-
30
- `):$?E.write(`
31
- if (${L}.issues.length) {
32
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
33
- ...iss,
34
- path: iss.path ? [${K}, ...iss.path] : [${K}]
35
- })));
36
- }
37
-
38
- if (${L}.value === undefined) {
39
- if (${K} in input) {
40
- newResult[${K}] = undefined;
41
- }
42
- } else {
43
- newResult[${K}] = ${L}.value;
44
- }
45
-
46
- `):E.write(`
47
- const ${L}_present = ${K} in input;
48
- if (${L}.issues.length) {
49
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
50
- ...iss,
51
- path: iss.path ? [${K}, ...iss.path] : [${K}]
52
- })));
53
- }
54
- if (!${L}_present && !${L}.issues.length) {
55
- payload.issues.push({
56
- code: "invalid_type",
57
- expected: "nonoptional",
58
- input: undefined,
59
- path: [${K}]
60
- });
61
- }
62
-
63
- if (${L}_present) {
64
- if (${L}.value === undefined) {
65
- newResult[${K}] = undefined;
66
- } else {
67
- newResult[${K}] = ${L}.value;
68
- }
69
- }
70
-
71
- `)}E.write("payload.value = newResult;"),E.write("return payload;");const z=E.compile();return(q,L)=>z(C,q,L)};let m;const f=xc,p=!$y.jitless,u=p&&O3.value,S=t.catchall;let w;e._zod.parse=(C,E)=>{w??(w=a.value);const R=C.value;return f(R)?p&&u&&E?.async===!1&&E.jitless!==!0?(m||(m=s(t.shape)),C=m(C,E),S?rE([],R,C,E,w,e):C):n(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),C)}});function kk(e,t,n,a){for(const m of e)if(m.issues.length===0)return t.value=m.value,t;const s=e.filter(m=>!As(m));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(m=>m.issues.map(f=>Bi(f,a,qi())))}),t)}const oE=de("$ZodUnion",(e,t)=>{Ct.init(e,t),ht(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ht(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ht(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),ht(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=>Vy(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 m=!1;const f=[];for(const p of t.options){const h=p._zod.run({value:a.value,issues:[]},s);if(h instanceof Promise)f.push(h),m=!0;else{if(h.issues.length===0)return h;f.push(h)}}return m?Promise.all(f).then(p=>kk(p,a,e,s)):kk(f,a,e,s)}}),AD=de("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,oE.init(e,t);const n=e._zod.parse;ht(e._zod,"propValues",()=>{const s={};for(const m of t.options){const f=m._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(m)}"`);for(const[p,h]of Object.entries(f)){s[p]||(s[p]=new Set);for(const u of h)s[p].add(u)}}return s});const a=Jm(()=>{const s=t.options,m=new Map;for(const f of s){const p=f._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of p){if(m.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);m.set(h,f)}}return m});e._zod.parse=(s,m)=>{const f=s.value;if(!xc(f))return s.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),s;const p=a.value.get(f?.[t.discriminator]);return p?p._zod.run(s,m):t.unionFallback||m.direction==="backward"?n(s,m):(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)}}),ED=de("$ZodIntersection",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,m=t.left._zod.run({value:s,issues:[]},a),f=t.right._zod.run({value:s,issues:[]},a);return m instanceof Promise||f instanceof Promise?Promise.all([m,f]).then(([h,u])=>wk(n,h,u)):wk(n,m,f)}});function dv(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(Bs(e)&&Bs(t)){const n=Object.keys(t),a=Object.keys(e).filter(m=>n.indexOf(m)!==-1),s={...e,...t};for(const m of a){const f=dv(e[m],t[m]);if(!f.valid)return{valid:!1,mergeErrorPath:[m,...f.mergeErrorPath]};s[m]=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],m=t[a],f=dv(s,m);if(!f.valid)return{valid:!1,mergeErrorPath:[a,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wk(e,t,n){const a=new Map;let s;for(const p of t.issues)if(p.code==="unrecognized_keys"){s??(s=p);for(const h of p.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(p);for(const p of n.issues)if(p.code==="unrecognized_keys")for(const h of p.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(p);const m=[...a].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(m.length&&s&&e.issues.push({...s,keys:m}),As(e))return e;const f=dv(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 RD=de("$ZodTuple",(e,t)=>{Ct.init(e,t);const n=t.items;e._zod.parse=(a,s)=>{const m=a.value;if(!Array.isArray(m))return a.issues.push({input:m,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];const f=[],p=Mk(n,"optin"),h=Mk(n,"optout");if(!t.rest){if(m.length<p)return a.issues.push({code:"too_small",minimum:p,inclusive:!0,input:m,inst:e,origin:"array"}),a;m.length>n.length&&a.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:m,inst:e,origin:"array"})}const u=new Array(n.length);for(let S=0;S<n.length;S++){const w=n[S]._zod.run({value:m[S],issues:[]},s);w instanceof Promise?f.push(w.then(C=>{u[S]=C})):u[S]=w}if(t.rest){let S=n.length-1;const w=m.slice(n.length);for(const C of w){S++;const E=t.rest._zod.run({value:C,issues:[]},s);E instanceof Promise?f.push(E.then(R=>Ck(R,a,S))):Ck(E,a,S)}}return f.length?Promise.all(f).then(()=>Ak(u,a,n,m,h)):Ak(u,a,n,m,h)}});function Mk(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Ck(e,t,n){e.issues.length&&t.issues.push(...Sr(n,e.issues)),t.value[n]=e.value}function Ak(e,t,n,a,s){for(let m=0;m<n.length;m++){const f=e[m],p=m<a.length;if(f.issues.length){if(!p&&m>=s){t.value.length=m;break}t.issues.push(...Sr(m,f.issues))}t.value[m]=f.value}for(let m=t.value.length-1;m>=a.length&&(n[m]._zod.optout==="optional"&&t.value[m]===void 0);m--)t.value.length=m;return t}const _D=de("$ZodRecord",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Bs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const m=[],f=t.keyType._zod.values;if(f){n.value={};const p=new Set;for(const u of f)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){p.add(typeof u=="number"?u.toString():u);const S=t.keyType._zod.run({value:u,issues:[]},a);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(S.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:S.issues.map(E=>Bi(E,a,qi())),input:u,path:[u],inst:e});continue}const w=S.value,C=t.valueType._zod.run({value:s[u],issues:[]},a);C instanceof Promise?m.push(C.then(E=>{E.issues.length&&n.issues.push(...Sr(u,E.issues)),n.value[w]=E.value})):(C.issues.length&&n.issues.push(...Sr(u,C.issues)),n.value[w]=C.value)}let h;for(const u in s)p.has(u)||(h=h??[],h.push(u));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const p of Reflect.ownKeys(s)){if(p==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,p))continue;let h=t.keyType._zod.run({value:p,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&XA.test(p)&&h.issues.length){const w=t.keyType._zod.run({value:Number(p),issues:[]},a);if(w instanceof Promise)throw new Error("Async schemas not supported in object keys currently");w.issues.length===0&&(h=w)}if(h.issues.length){t.mode==="loose"?n.value[p]=s[p]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(w=>Bi(w,a,qi())),input:p,path:[p],inst:e});continue}const S=t.valueType._zod.run({value:s[p],issues:[]},a);S instanceof Promise?m.push(S.then(w=>{w.issues.length&&n.issues.push(...Sr(p,w.issues)),n.value[h.value]=w.value})):(S.issues.length&&n.issues.push(...Sr(p,S.issues)),n.value[h.value]=S.value)}}return m.length?Promise.all(m).then(()=>n):n}}),ID=de("$ZodEnum",(e,t)=>{Ct.init(e,t);const n=HA(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>j3.has(typeof s)).map(s=>typeof s=="string"?Us(s):s.toString()).join("|")})$`),e._zod.parse=(s,m)=>{const f=s.value;return a.has(f)||s.issues.push({code:"invalid_value",values:n,input:f,inst:e}),s}}),TD=de("$ZodLiteral",(e,t)=>{if(Ct.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"?Us(a):a?Us(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const m=a.value;return n.has(m)||a.issues.push({code:"invalid_value",values:t.values,input:m,inst:e}),a}}),ND=de("$ZodTransform",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new FA(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 Ps;return n.value=s,n.fallback=!0,n}});function Ek(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const sE=de("$ZodOptional",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vy(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,m=t.innerType._zod.run(n,a);return m instanceof Promise?m.then(f=>Ek(f,s)):Ek(m,s)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),OD=de("$ZodExactOptional",(e,t)=>{sE.init(e,t),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),jD=de("$ZodNullable",(e,t)=>{Ct.init(e,t),ht(e._zod,"optin",()=>t.innerType._zod.optin),ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vy(n.source)}|null)$`):void 0}),ht(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)}),PD=de("$ZodDefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ht(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(m=>Rk(m,t)):Rk(s,t)}});function Rk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const DD=de("$ZodPrefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ht(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))}),zD=de("$ZodNonOptional",(e,t)=>{Ct.init(e,t),ht(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(m=>_k(m,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 LD=de("$ZodCatch",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(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(m=>(n.value=m.value,m.issues.length&&(n.value=t.catchValue({...n,error:{issues:m.issues.map(f=>Bi(f,a,qi()))},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(m=>Bi(m,a,qi()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),lE=de("$ZodPipe",(e,t)=>{Ct.init(e,t),ht(e._zod,"values",()=>t.in._zod.values),ht(e._zod,"optin",()=>t.in._zod.optin),ht(e._zod,"optout",()=>t.out._zod.optout),ht(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const m=t.out._zod.run(n,a);return m instanceof Promise?m.then(f=>Sd(f,t.in,a)):Sd(m,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(m=>Sd(m,t.out,a)):Sd(s,t.out,a)}});function Sd(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 qD=de("$ZodPreprocess",(e,t)=>{lE.init(e,t)}),BD=de("$ZodReadonly",(e,t)=>{Ct.init(e,t),ht(e._zod,"propValues",()=>t.innerType._zod.propValues),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"optin",()=>t.innerType?._zod?.optin),ht(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(Ik):Ik(s)}});function Ik(e){return e.value=Object.freeze(e.value),e}const UD=de("$ZodLazy",(e,t)=>{Ct.init(e,t),ht(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),ht(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ht(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ht(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ht(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,a)=>e._zod.innerType._zod.run(n,a)}),FD=de("$ZodCustom",(e,t)=>{ra.init(e,t),Ct.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(m=>Tk(m,n,a,e));Tk(s,n,a,e)}});function Tk(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(kc(s))}}var Nk;class HD{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 $D(){return new HD}(Nk=globalThis).__zod_globalRegistry??(Nk.__zod_globalRegistry=$D());const cc=globalThis.__zod_globalRegistry;function QD(e,t){return new e({type:"string",...De(t)})}function cE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function Ok(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function VD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function GD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function ZD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function KD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function uE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function WD(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function YD(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function XD(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function JD(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function e6(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function t6(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function n6(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function a6(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function i6(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function r6(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function o6(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function s6(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function l6(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function c6(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function u6(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function d6(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function m6(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function p6(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function f6(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function h6(e,t){return new e({type:"number",checks:[],...De(t)})}function g6(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function v6(e,t){return new e({type:"boolean",...De(t)})}function y6(e,t){return new e({type:"null",...De(t)})}function b6(e){return new e({type:"any"})}function S6(e){return new e({type:"unknown"})}function x6(e,t){return new e({type:"never",...De(t)})}function k6(e,t){return new e({type:"void",...De(t)})}function w6(e,t){return new e({type:"date",...De(t)})}function jk(e,t){return new eE({check:"less_than",...De(t),value:e,inclusive:!1})}function Vd(e,t){return new eE({check:"less_than",...De(t),value:e,inclusive:!0})}function Pk(e,t){return new tE({check:"greater_than",...De(t),value:e,inclusive:!1})}function Gd(e,t){return new tE({check:"greater_than",...De(t),value:e,inclusive:!0})}function Dk(e,t){return new IP({check:"multiple_of",...De(t),value:e})}function dE(e,t){return new NP({check:"max_length",...De(t),maximum:e})}function wm(e,t){return new OP({check:"min_length",...De(t),minimum:e})}function mE(e,t){return new jP({check:"length_equals",...De(t),length:e})}function M6(e,t){return new PP({check:"string_format",format:"regex",...De(t),pattern:e})}function C6(e){return new DP({check:"string_format",format:"lowercase",...De(e)})}function A6(e){return new zP({check:"string_format",format:"uppercase",...De(e)})}function E6(e,t){return new LP({check:"string_format",format:"includes",...De(t),includes:e})}function R6(e,t){return new qP({check:"string_format",format:"starts_with",...De(t),prefix:e})}function _6(e,t){return new BP({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Xs(e){return new UP({check:"overwrite",tx:e})}function I6(e){return Xs(t=>t.normalize(e))}function T6(){return Xs(e=>e.trim())}function N6(){return Xs(e=>e.toLowerCase())}function O6(){return Xs(e=>e.toUpperCase())}function j6(){return Xs(e=>N3(e))}function P6(e,t,n){return new e({type:"array",element:t,...De(n)})}function D6(e,t,n){const a=De(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function z6(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function L6(e,t){const n=q6(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(kc(s,a.value,n._zod.def));else{const m=s;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=a.value),m.inst??(m.inst=n),m.continue??(m.continue=!n._zod.def.abort),a.issues.push(kc(m))}},e(a.value,a)),t);return n}function q6(e,t){const n=new ra({check:"custom",...De(t)});return n._zod.check=e,n}function pE(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??cc,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 Wt(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,m=t.seen.get(e);if(m)return m.count++,n.schemaPath.includes(e)&&(m.cycle=n.path),m.schema;const f={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,f);const p=e._zod.toJSONSchema?.();if(p)f.schema=p;else{const S={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,f.schema,S);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,S)}const w=e._zod.parent;w&&(f.ref||(f.ref=w),Wt(w,t,S),t.seen.get(w).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(f.schema,h),t.io==="input"&&Fn(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 fE(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 p=e.metadataRegistry.get(f[0])?.id;if(p){const h=a.get(p);if(h&&h!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(p,f[0])}}const s=f=>{const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=e.external.registry.get(f[0])?.id,C=e.external.uri??(R=>R);if(w)return{ref:C(w)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${C("__shared")}#/${p}/${E}`}}if(f[1]===n)return{ref:"#"};const u=`#/${p}/`,S=f[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:u+S}},m=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:h,defId:u}=s(f);p.def={...p.schema},u&&(p.defId=u);const S=p.schema;for(const w in S)delete S[w];S.$ref=h};if(e.cycles==="throw")for(const f of e.seen.entries()){const p=f[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.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 p=f[1];if(t===f[0]){m(f);continue}if(e.external){const u=e.external.registry.get(f[0])?.id;if(t!==f[0]&&u){m(f);continue}}if(e.metadataRegistry.get(f[0])?.id){m(f);continue}if(p.cycle){m(f);continue}if(p.count>1&&e.reused==="ref"){m(f);continue}}}function hE(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=p=>{const h=e.seen.get(p);if(h.ref===null)return;const u=h.def??h.schema,S={...u},w=h.ref;if(h.ref=null,w){a(w);const E=e.seen.get(w),R=E.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(R)):Object.assign(u,R),Object.assign(u,S),p._zod.parent===w)for(const j in u)j==="$ref"||j==="allOf"||j in S||delete u[j];if(R.$ref&&E.def)for(const j in u)j==="$ref"||j==="allOf"||j in E.def&&JSON.stringify(u[j])===JSON.stringify(E.def[j])&&delete u[j]}const C=p._zod.parent;if(C&&C!==w){a(C);const E=e.seen.get(C);if(E?.schema.$ref&&(u.$ref=E.schema.$ref,E.def))for(const R in u)R==="$ref"||R==="allOf"||R in E.def&&JSON.stringify(u[R])===JSON.stringify(E.def[R])&&delete u[R]}e.override({zodSchema:p,jsonSchema:u,path:h.path??[]})};for(const p of[...e.seen.entries()].reverse())a(p[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 p=e.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(p)}Object.assign(s,n.def??n.schema);const m=e.metadataRegistry.get(t)?.id;m!==void 0&&s.id===m&&delete s.id;const f=e.external?.defs??{};for(const p of e.seen.entries()){const h=p[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 p=JSON.parse(JSON.stringify(s));return Object.defineProperty(p,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mm(t,"input",e.processors),output:Mm(t,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Fn(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 Fn(a.element,n);if(a.type==="set")return Fn(a.valueType,n);if(a.type==="lazy")return Fn(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 Fn(a.innerType,n);if(a.type==="intersection")return Fn(a.left,n)||Fn(a.right,n);if(a.type==="record"||a.type==="map")return Fn(a.keyType,n)||Fn(a.valueType,n);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Fn(a.in,n)||Fn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Fn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Fn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Fn(s,n))return!0;return!!(a.rest&&Fn(a.rest,n))}return!1}const B6=(e,t={})=>n=>{const a=pE({...n,processors:t});return Wt(e,a),fE(a,e),hE(a,e)},Mm=(e,t,n={})=>a=>{const{libraryOptions:s,target:m}=a??{},f=pE({...s??{},target:m,io:t,processors:n});return Wt(e,f),fE(f,e),hE(f,e)},U6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},F6=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:m,maximum:f,format:p,patterns:h,contentEncoding:u}=e._zod.bag;if(typeof m=="number"&&(s.minLength=m),typeof f=="number"&&(s.maxLength=f),p&&(s.format=U6[p]??p,s.format===""&&delete s.format,p==="time"&&delete s.format),u&&(s.contentEncoding=u),h&&h.size>0){const S=[...h];S.length===1?s.pattern=S[0].source:S.length>1&&(s.allOf=[...S.map(w=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},H6=(e,t,n,a)=>{const s=n,{minimum:m,maximum:f,format:p,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:S}=e._zod.bag;typeof p=="string"&&p.includes("int")?s.type="integer":s.type="number";const w=typeof S=="number"&&S>=(m??Number.NEGATIVE_INFINITY),C=typeof u=="number"&&u<=(f??Number.POSITIVE_INFINITY),E=t.target==="draft-04"||t.target==="openapi-3.0";w?E?(s.minimum=S,s.exclusiveMinimum=!0):s.exclusiveMinimum=S:typeof m=="number"&&(s.minimum=m),C?E?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof f=="number"&&(s.maximum=f),typeof h=="number"&&(s.multipleOf=h)},$6=(e,t,n,a)=>{n.type="boolean"},Q6=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},V6=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},G6=(e,t,n,a)=>{n.not={}},Z6=(e,t,n,a)=>{},K6=(e,t,n,a)=>{},W6=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Y6=(e,t,n,a)=>{const s=e._zod.def,m=HA(s.entries);m.every(f=>typeof f=="number")&&(n.type="number"),m.every(f=>typeof f=="string")&&(n.type="string"),n.enum=m},X6=(e,t,n,a)=>{const s=e._zod.def,m=[];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");m.push(Number(f))}else m.push(f);if(m.length!==0)if(m.length===1){const f=m[0];n.type=f===null?"null":typeof f,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[f]:n.const=f}else m.every(f=>typeof f=="number")&&(n.type="number"),m.every(f=>typeof f=="string")&&(n.type="string"),m.every(f=>typeof f=="boolean")&&(n.type="boolean"),m.every(f=>f===null)&&(n.type="null"),n.enum=m},J6=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ez=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tz=(e,t,n,a)=>{const s=n,m=e._zod.def,{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof p=="number"&&(s.maxItems=p),s.type="array",s.items=Wt(m.element,t,{...a,path:[...a.path,"items"]})},nz=(e,t,n,a)=>{const s=n,m=e._zod.def;s.type="object",s.properties={};const f=m.shape;for(const u in f)s.properties[u]=Wt(f[u],t,{...a,path:[...a.path,"properties",u]});const p=new Set(Object.keys(f)),h=new Set([...p].filter(u=>{const S=m.shape[u]._zod;return t.io==="input"?S.optin===void 0:S.optout===void 0}));h.size>0&&(s.required=Array.from(h)),m.catchall?._zod.def.type==="never"?s.additionalProperties=!1:m.catchall?m.catchall&&(s.additionalProperties=Wt(m.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},az=(e,t,n,a)=>{const s=e._zod.def,m=s.inclusive===!1,f=s.options.map((p,h)=>Wt(p,t,{...a,path:[...a.path,m?"oneOf":"anyOf",h]}));m?n.oneOf=f:n.anyOf=f},iz=(e,t,n,a)=>{const s=e._zod.def,m=Wt(s.left,t,{...a,path:[...a.path,"allOf",0]}),f=Wt(s.right,t,{...a,path:[...a.path,"allOf",1]}),p=u=>"allOf"in u&&Object.keys(u).length===1,h=[...p(m)?m.allOf:[m],...p(f)?f.allOf:[f]];n.allOf=h},rz=(e,t,n,a)=>{const s=n,m=e._zod.def;s.type="array";const f=t.target==="draft-2020-12"?"prefixItems":"items",p=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",h=m.items.map((C,E)=>Wt(C,t,{...a,path:[...a.path,f,E]})),u=m.rest?Wt(m.rest,t,{...a,path:[...a.path,p,...t.target==="openapi-3.0"?[m.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,u&&(s.items=u)):t.target==="openapi-3.0"?(s.items={anyOf:h},u&&s.items.anyOf.push(u),s.minItems=h.length,u||(s.maxItems=h.length)):(s.items=h,u&&(s.additionalItems=u));const{minimum:S,maximum:w}=e._zod.bag;typeof S=="number"&&(s.minItems=S),typeof w=="number"&&(s.maxItems=w)},oz=(e,t,n,a)=>{const s=n,m=e._zod.def;s.type="object";const f=m.keyType,h=f._zod.bag?.patterns;if(m.mode==="loose"&&h&&h.size>0){const S=Wt(m.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const w of h)s.patternProperties[w.source]=S}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Wt(m.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Wt(m.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const u=f._zod.values;if(u){const S=[...u].filter(w=>typeof w=="string"||typeof w=="number");S.length>0&&(s.required=S)}},sz=(e,t,n,a)=>{const s=e._zod.def,m=Wt(s.innerType,t,a),f=t.seen.get(e);t.target==="openapi-3.0"?(f.ref=s.innerType,n.nullable=!0):n.anyOf=[m,{type:"null"}]},lz=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.ref=s.innerType},cz=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},uz=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},dz=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.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},mz=(e,t,n,a)=>{const s=e._zod.def,m=s.in._zod.traits.has("$ZodTransform"),f=t.io==="input"?m?s.out:s.in:s.out;Wt(f,t,a);const p=t.seen.get(e);p.ref=f},pz=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.ref=s.innerType,n.readOnly=!0},gE=(e,t,n,a)=>{const s=e._zod.def;Wt(s.innerType,t,a);const m=t.seen.get(e);m.ref=s.innerType},fz=(e,t,n,a)=>{const s=e._zod.innerType;Wt(s,t,a);const m=t.seen.get(e);m.ref=s},hz=de("ZodISODateTime",(e,t)=>{tD.init(e,t),Yt.init(e,t)});function gz(e){return d6(hz,e)}const vz=de("ZodISODate",(e,t)=>{nD.init(e,t),Yt.init(e,t)});function yz(e){return m6(vz,e)}const bz=de("ZodISOTime",(e,t)=>{aD.init(e,t),Yt.init(e,t)});function Sz(e){return p6(bz,e)}const xz=de("ZodISODuration",(e,t)=>{iD.init(e,t),Yt.init(e,t)});function kz(e){return f6(xz,e)}const wz=(e,t)=>{GA.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>V3(e,n)},flatten:{value:n=>Q3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,uv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,uv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Na=de("ZodError",wz,{Parent:Error}),Mz=Zy(Na),Cz=Ky(Na),Az=ep(Na),Ez=tp(Na),Rz=K3(Na),_z=W3(Na),Iz=Y3(Na),Tz=X3(Na),Nz=J3(Na),Oz=eP(Na),jz=tP(Na),Pz=nP(Na),zk=new WeakMap;function Bc(e,t,n){const a=Object.getPrototypeOf(e);let s=zk.get(a);if(s||(s=new Set,zk.set(a,s)),!s.has(t)){s.add(t);for(const m in n){const f=n[m];Object.defineProperty(a,m,{configurable:!0,enumerable:!1,get(){const p=f.bind(this);return Object.defineProperty(this,m,{configurable:!0,writable:!0,enumerable:!0,value:p}),p},set(p){Object.defineProperty(this,m,{configurable:!0,writable:!0,enumerable:!0,value:p})}})}}}const Tt=de("ZodType",(e,t)=>(Ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mm(e,"input"),output:Mm(e,"output")}}),e.toJSONSchema=B6(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,a)=>Mz(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>Az(e,n,a),e.parseAsync=async(n,a)=>Cz(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>Ez(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>Rz(e,n,a),e.decode=(n,a)=>_z(e,n,a),e.encodeAsync=async(n,a)=>Iz(e,n,a),e.decodeAsync=async(n,a)=>Tz(e,n,a),e.safeEncode=(n,a)=>Nz(e,n,a),e.safeDecode=(n,a)=>Oz(e,n,a),e.safeEncodeAsync=async(n,a)=>jz(e,n,a),e.safeDecodeAsync=async(n,a)=>Pz(e,n,a),Bc(e,"ZodType",{check(...n){const a=this.def;return this.clone(Ir(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 Ui(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(TL(n,a))},superRefine(n,a){return this.check(NL(n,a))},overwrite(n){return this.check(Xs(n))},optional(){return Uk(this)},exactOptional(){return yL(this)},nullable(){return Fk(this)},nullish(){return Uk(Fk(this))},nonoptional(n){return ML(this,n)},array(){return M(this)},or(n){return tt([this,n])},and(n){return mL(this,n)},transform(n){return Hk(this,CE(n))},default(n){return xL(this,n)},prefault(n){return wL(this,n)},catch(n){return AL(this,n)},pipe(n){return Hk(this,n)},readonly(){return _L(this)},describe(n){const a=this.clone();return cc.add(a,{description:n}),a},meta(...n){if(n.length===0)return cc.get(this);const a=this.clone();return cc.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 cc.get(e)?.description},configurable:!0}),e)),vE=de("_ZodString",(e,t)=>{Wy.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,m)=>F6(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Bc(e,"_ZodString",{regex(...a){return this.check(M6(...a))},includes(...a){return this.check(E6(...a))},startsWith(...a){return this.check(R6(...a))},endsWith(...a){return this.check(_6(...a))},min(...a){return this.check(wm(...a))},max(...a){return this.check(dE(...a))},length(...a){return this.check(mE(...a))},nonempty(...a){return this.check(wm(1,...a))},lowercase(a){return this.check(C6(a))},uppercase(a){return this.check(A6(a))},trim(){return this.check(T6())},normalize(...a){return this.check(I6(...a))},toLowerCase(){return this.check(N6())},toUpperCase(){return this.check(O6())},slugify(){return this.check(j6())}})}),Dz=de("ZodString",(e,t)=>{Wy.init(e,t),vE.init(e,t),e.email=n=>e.check(cE(yE,n)),e.url=n=>e.check(uE(bE,n)),e.jwt=n=>e.check(u6(Jz,n)),e.emoji=n=>e.check(WD(qz,n)),e.guid=n=>e.check(Ok(Lk,n)),e.uuid=n=>e.check(VD(xd,n)),e.uuidv4=n=>e.check(GD(xd,n)),e.uuidv6=n=>e.check(ZD(xd,n)),e.uuidv7=n=>e.check(KD(xd,n)),e.nanoid=n=>e.check(YD(Bz,n)),e.guid=n=>e.check(Ok(Lk,n)),e.cuid=n=>e.check(XD(Uz,n)),e.cuid2=n=>e.check(JD(Fz,n)),e.ulid=n=>e.check(e6(Hz,n)),e.base64=n=>e.check(s6(Wz,n)),e.base64url=n=>e.check(l6(Yz,n)),e.xid=n=>e.check(t6($z,n)),e.ksuid=n=>e.check(n6(Qz,n)),e.ipv4=n=>e.check(a6(Vz,n)),e.ipv6=n=>e.check(i6(Gz,n)),e.cidrv4=n=>e.check(r6(Zz,n)),e.cidrv6=n=>e.check(o6(Kz,n)),e.e164=n=>e.check(c6(Xz,n)),e.datetime=n=>e.check(gz(n)),e.date=n=>e.check(yz(n)),e.time=n=>e.check(Sz(n)),e.duration=n=>e.check(kz(n))});function o(e){return QD(Dz,e)}const Yt=de("ZodStringFormat",(e,t)=>{Zt.init(e,t),vE.init(e,t)}),yE=de("ZodEmail",(e,t)=>{VP.init(e,t),Yt.init(e,t)});function zz(e){return cE(yE,e)}const Lk=de("ZodGUID",(e,t)=>{$P.init(e,t),Yt.init(e,t)}),xd=de("ZodUUID",(e,t)=>{QP.init(e,t),Yt.init(e,t)}),bE=de("ZodURL",(e,t)=>{GP.init(e,t),Yt.init(e,t)});function Lz(e){return uE(bE,e)}const qz=de("ZodEmoji",(e,t)=>{ZP.init(e,t),Yt.init(e,t)}),Bz=de("ZodNanoID",(e,t)=>{KP.init(e,t),Yt.init(e,t)}),Uz=de("ZodCUID",(e,t)=>{WP.init(e,t),Yt.init(e,t)}),Fz=de("ZodCUID2",(e,t)=>{YP.init(e,t),Yt.init(e,t)}),Hz=de("ZodULID",(e,t)=>{XP.init(e,t),Yt.init(e,t)}),$z=de("ZodXID",(e,t)=>{JP.init(e,t),Yt.init(e,t)}),Qz=de("ZodKSUID",(e,t)=>{eD.init(e,t),Yt.init(e,t)}),Vz=de("ZodIPv4",(e,t)=>{rD.init(e,t),Yt.init(e,t)}),Gz=de("ZodIPv6",(e,t)=>{oD.init(e,t),Yt.init(e,t)}),Zz=de("ZodCIDRv4",(e,t)=>{sD.init(e,t),Yt.init(e,t)}),Kz=de("ZodCIDRv6",(e,t)=>{lD.init(e,t),Yt.init(e,t)}),Wz=de("ZodBase64",(e,t)=>{cD.init(e,t),Yt.init(e,t)}),Yz=de("ZodBase64URL",(e,t)=>{dD.init(e,t),Yt.init(e,t)}),Xz=de("ZodE164",(e,t)=>{mD.init(e,t),Yt.init(e,t)}),Jz=de("ZodJWT",(e,t)=>{fD.init(e,t),Yt.init(e,t)}),SE=de("ZodNumber",(e,t)=>{aE.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,m)=>H6(e,a,s),Bc(e,"ZodNumber",{gt(a,s){return this.check(Pk(a,s))},gte(a,s){return this.check(Gd(a,s))},min(a,s){return this.check(Gd(a,s))},lt(a,s){return this.check(jk(a,s))},lte(a,s){return this.check(Vd(a,s))},max(a,s){return this.check(Vd(a,s))},int(a){return this.check(qk(a))},safe(a){return this.check(qk(a))},positive(a){return this.check(Pk(0,a))},nonnegative(a){return this.check(Gd(0,a))},negative(a){return this.check(jk(0,a))},nonpositive(a){return this.check(Vd(0,a))},multipleOf(a,s){return this.check(Dk(a,s))},step(a,s){return this.check(Dk(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 h6(SE,e)}const eL=de("ZodNumberFormat",(e,t)=>{hD.init(e,t),SE.init(e,t)});function qk(e){return g6(eL,e)}const tL=de("ZodBoolean",(e,t)=>{gD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$6(e,n,a)});function A(e){return v6(tL,e)}const nL=de("ZodNull",(e,t)=>{vD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q6(e,n,a)});function xE(e){return y6(nL,e)}const aL=de("ZodAny",(e,t)=>{yD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Z6()});function kE(){return b6(aL)}const iL=de("ZodUnknown",(e,t)=>{bD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>K6()});function te(){return S6(iL)}const rL=de("ZodNever",(e,t)=>{SD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G6(e,n,a)});function oL(e){return x6(rL,e)}const sL=de("ZodVoid",(e,t)=>{xD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>V6(e,n)});function N(e){return k6(sL,e)}const lL=de("ZodDate",(e,t)=>{kD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,m)=>W6(e,a),e.min=(a,s)=>e.check(Gd(a,s)),e.max=(a,s)=>e.check(Vd(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 mv(e){return w6(lL,e)}const cL=de("ZodArray",(e,t)=>{wD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tz(e,n,a,s),e.element=t.element,Bc(e,"ZodArray",{min(n,a){return this.check(wm(n,a))},nonempty(n){return this.check(wm(1,n))},max(n,a){return this.check(dE(n,a))},length(n,a){return this.check(mE(n,a))},unwrap(){return this.element}})});function M(e,t){return P6(cL,e,t)}const wE=de("ZodObject",(e,t)=>{CD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nz(e,n,a,s),ht(e,"shape",()=>t.shape),Bc(e,"ZodObject",{keyof(){return O(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:te()})},loose(){return this.clone({...this._zod.def,catchall:te()})},strict(){return this.clone({...this._zod.def,catchall:oL()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return q3(this,n)},safeExtend(n){return B3(this,n)},merge(n){return U3(this,n)},pick(n){return z3(this,n)},omit(n){return L3(this,n)},partial(...n){return F3(AE,this,n[0])},required(...n){return H3(EE,this,n[0])}})});function d(e,t){const n={type:"object",shape:e??{},...De(t)};return new wE(n)}function Bk(e,t){return new wE({type:"object",shape:e,catchall:te(),...De(t)})}const ME=de("ZodUnion",(e,t)=>{oE.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>az(e,n,a,s),e.options=t.options});function tt(e,t){return new ME({type:"union",options:e,...De(t)})}const uL=de("ZodDiscriminatedUnion",(e,t)=>{ME.init(e,t),AD.init(e,t)});function gt(e,t,n){return new uL({type:"union",options:t,discriminator:e,...De(n)})}const dL=de("ZodIntersection",(e,t)=>{ED.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iz(e,n,a,s)});function mL(e,t){return new dL({type:"intersection",left:e,right:t})}const pL=de("ZodTuple",(e,t)=>{RD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rz(e,n,a,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Uc(e,t,n){const a=t instanceof Ct,s=a?n:t,m=a?t:null;return new pL({type:"tuple",items:e,rest:m,...De(s)})}const pv=de("ZodRecord",(e,t)=>{_D.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oz(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function X(e,t,n){return!t||!t._zod?new pv({type:"record",keyType:o(),valueType:e,...De(t)}):new pv({type:"record",keyType:e,valueType:t,...De(n)})}function fL(e,t,n){const a=Ui(e);return a._zod.values=void 0,new pv({type:"record",keyType:a,valueType:t,...De(n)})}const fv=de("ZodEnum",(e,t)=>{ID.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,m)=>Y6(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 m={};for(const f of a)if(n.has(f))m[f]=t.entries[f];else throw new Error(`Key ${f} not found in enum`);return new fv({...t,checks:[],...De(s),entries:m})},e.exclude=(a,s)=>{const m={...t.entries};for(const f of a)if(n.has(f))delete m[f];else throw new Error(`Key ${f} not found in enum`);return new fv({...t,checks:[],...De(s),entries:m})}});function O(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new fv({type:"enum",entries:n,...De(t)})}const hL=de("ZodLiteral",(e,t)=>{TD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X6(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 G(e,t){return new hL({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const gL=de("ZodTransform",(e,t)=>{ND.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ez(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new FA(e.constructor.name);n.addIssue=m=>{if(typeof m=="string")n.issues.push(kc(m,n.value,t));else{const f=m;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=n.value),f.inst??(f.inst=e),n.issues.push(kc(f))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(m=>(n.value=m,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function CE(e){return new gL({type:"transform",transform:e})}const AE=de("ZodOptional",(e,t)=>{sE.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Uk(e){return new AE({type:"optional",innerType:e})}const vL=de("ZodExactOptional",(e,t)=>{OD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yL(e){return new vL({type:"optional",innerType:e})}const bL=de("ZodNullable",(e,t)=>{jD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Fk(e){return new bL({type:"nullable",innerType:e})}const SL=de("ZodDefault",(e,t)=>{PD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xL(e,t){return new SL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const kL=de("ZodPrefault",(e,t)=>{DD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function wL(e,t){return new kL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const EE=de("ZodNonOptional",(e,t)=>{zD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function ML(e,t){return new EE({type:"nonoptional",innerType:e,...De(t)})}const CL=de("ZodCatch",(e,t)=>{LD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AL(e,t){return new CL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const RE=de("ZodPipe",(e,t)=>{lE.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mz(e,n,a,s),e.in=t.in,e.out=t.out});function Hk(e,t){return new RE({type:"pipe",in:e,out:t})}const EL=de("ZodPreprocess",(e,t)=>{RE.init(e,t),qD.init(e,t)}),RL=de("ZodReadonly",(e,t)=>{BD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function _L(e){return new RL({type:"readonly",innerType:e})}const IL=de("ZodLazy",(e,t)=>{UD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fz(e,n,a,s),e.unwrap=()=>e._zod.def.getter()});function Fc(e){return new IL({type:"lazy",getter:e})}const Yy=de("ZodCustom",(e,t)=>{FD.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J6(e,n)});function Ha(e,t){return D6(Yy,(()=>!0),t)}function TL(e,t={}){return z6(Yy,e,t)}function NL(e,t){return L6(e,t)}function Ut(e,t={}){const n=new Yy({type:"custom",check:"custom",fn:a=>a instanceof e,abort:!0,...De(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 OL(e,t){return new EL({type:"pipe",in:CE(e),out:t})}const Xy={custom:"custom"};var jL=[{id:"overview",label:"Overview",icon:"layout-dashboard",order:-10},{id:"general",label:"General",icon:"settings",order:0},{id:"image",label:"Image",icon:"image",order:5},{id:"light",label:"Light",icon:"lightbulb",order:7},{id:"motion",label:"Motion",icon:"activity",order:10},{id:"audio",label:"Audio",icon:"mic",order:12},{id:"alarms",label:"Alarms",icon:"bell-ring",order:13},{id:"snapshot",label:"Snapshot",icon:"camera",order:15},{id:"osd",label:"OSD",icon:"type",order:18},{id:"stream-broker",label:"Stream Broker",icon:"radio",order:20},{id:"streaming",label:"Streaming",icon:"video",order:35},{id:"ptz",label:"PTZ",icon:"move",order:40},{id:"consumables",label:"Consumables",icon:"recycle",order:44},{id:"pipeline",label:"Detection Pipeline",icon:"cpu",order:39},{id:"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(jL.map(e=>[e.id,e]));var Mn=O(["high","mid","low"]),Jy=O(["pull-rtsp","pull-rtmp","pull-http","pull-flv","pull-rfc4571","push-annexb","derived"]),Js=d({width:l().int().positive(),height:l().int().positive()}),hv=d({camStreamId:o().min(1),deviceId:l().int().nonnegative(),kind:Jy,url:o().optional(),codec:o().optional(),resolution:Js.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:X(o(),te()).optional()}),Zd=O(["unassigned","idle","connecting","streaming","error"]),gv=d({deviceId:l().int().nonnegative(),profile:Mn,brokerId:o(),sourceCamStreamId:o().nullable(),status:Zd,resolution:Js.optional(),codec:o().optional(),preBufferSec:l().nonnegative().optional(),errorMessage:o().optional()}),PL=d({id:o(),label:o(),protocol:O(["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:Mn.optional()});d({type:o(),url:o(),videoCodec:o().optional(),audioCodec:o().optional(),metadata:X(o(),te()).readonly().optional()});var DL=d({type:O(["video","audio"]),data:Ut(Uint8Array),pts:l(),dts:l(),keyframe:A(),codec:o()}),$k=d({data:Ut(Uint8Array),width:l(),height:l(),format:O(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:l()}),Ar=d({shmId:o(),slot:l().int().nonnegative(),seq:l().int().nonnegative(),width:l().int().positive(),height:l().int().positive(),format:O(["jpeg","rgb","bgr","yuv420","gray"]),pts:l(),byteLength:l().int().nonnegative(),nodeId:o(),slotCount:l().int().positive()}),zL=O(["rgb","bgr","yuv420","gray"]),LL=d({brokerId:o(),format:zL,maxFps:l().positive().optional(),tag:o().optional()}),qL=d({subscriptionId:o(),maxFps:l().nonnegative()}),BL=d({data:Ut(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),timestamp:l()}),UL=d({brokerId:o(),tag:o().optional()}),FL=d({subscriptionId:o()}),HL=O(["idle","connecting","streaming","error","stopped"]),$L=d({status:HL,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()}),QL=d({profile:Mn,brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:Js.optional()}),VL=d({id:o(),title:o(),description:o().optional(),style:O(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([G(1),G(2),G(3),G(4)]).optional(),tab:o().optional(),location:O(["settings","top-tab"]).optional(),order:l().optional(),fields:M(kE())}),GL=d({id:o(),label:o(),icon:o(),order:l().optional()});d({tabs:M(GL).optional(),sections:M(VL)}).nullable();d({deviceId:l()}),d({deviceId:l()}),d({deviceId:l(),patch:X(o(),te())}),d({success:G(!0)});d({deviceId:l()}),te().nullable();function b(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 Ph(e,t,n){return{...b(e,t,n),systemOnly:!0}}function go(e){return{data:e}}var ZL=d({staticDir:o()}),KL=d({version:o()}),WL={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(N(),ZL,{auth:"admin"}),getVersion:b(N(),KL,{auth:"admin"})}},V=(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})({}),aa=(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})({}),YL=d({staticDir:o()}),XL=d({version:o()}),JL={name:"viewer-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(N(),YL,{auth:"admin"}),getVersion:b(N(),XL,{auth:"admin"})}},e8=d({id:o(),label:o(),protocol:O(["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:Mn.optional(),sdp:o().optional()}),t8=d({key:o(),value:te()}),n8=d({source:o(),data:X(o(),te())}),a8={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:b(d({deviceId:l()}),M(e8)),getConfigEntries:b(d({deviceId:l()}),M(t8)),setConfig:b(d({deviceId:l(),values:X(o(),te())}),N(),{kind:"mutation"}),runAction:b(d({deviceId:l(),action:o().min(1),input:te()}),te(),{kind:"mutation"}),removeDevice:b(d({deviceId:l()}),N(),{kind:"mutation"}),getSettingsSchema:b(d({deviceId:l()}),te().nullable()),getRawState:b(d({deviceId:l()}),n8.nullable(),{auth:"protected"})}},i8="device.state-changed";function _E(e){const t=new Map,n=new Map;let a=null;const s=(p,h)=>`${p}:${h}`,m=()=>{a||e.live?.onEvent&&(a=e.live.onEvent.subscribe({category:i8},{onData:p=>{const h=p.data;if(!h||typeof h.deviceId!="number"||typeof h.capName!="string")return;const u=s(h.deviceId,h.capName);t.set(u,h.slice);const S=n.get(u);if(S)for(const w of S)try{w(h.slice)}catch{}}}))},f=()=>{a&&(n.size>0||(a.unsubscribe(),a=null))};return{read(p,h){return t.get(s(p,h))},async refresh(p,h){const u=await e.deviceState.getCapSlice.query({deviceId:p,capName:h}),S=s(p,h);t.set(S,u??void 0);const w=n.get(S);if(w)for(const C of w)try{C(u??void 0)}catch{}},watch(p,h,u){const S=s(p,h);let w=n.get(S);return w||(w=new Set,n.set(S,w)),w.add(u),m(),()=>{w.delete(u),w.size===0&&n.delete(S),f()}},async write(p,h,u){await e.deviceState.setCapSlice.mutate({deviceId:p,capName:h,slice:u})}}}function r8(e,t,n){const a=(s,m)=>`${s}:${m}`;return{read(s,m){return e.get(s)?.get(m)},async refresh(){},watch(s,m,f){const p=a(s,m);let h=t.get(p);return h||(h=new Set,t.set(p,h)),h.add(f),()=>{h.delete(f),h.size===0&&t.delete(p)}},async write(s,m,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:m,slice:f})}}}function Le(e,t,n){const a=o8(e)?e:_E(e);return{get value(){return a.read(t,n)},refresh(){return a.refresh(t,n)},subscribe(s){const m=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(()=>{}),m},async set(s){await a.write(t,n,s)},async patch(s){const m={...a.read(t,n),...s};await a.write(t,n,m)}}}function o8(e){return typeof e.read=="function"&&typeof e.watch=="function"}function IE(e,t,n){const a=e,s=n?.stateSource??_E(e);function m(u,S){const w=typeof u=="object"&&u!==null?u:{};return S!==void 0?{...w,deviceId:t.deviceId,nodeId:S}:{...w,deviceId:t.deviceId}}function f(u,S,w,C,E){const R=a[u]?.[S];if(!R)throw new Error(`DeviceProxy: api has no '${u}.${S}'`);const T=R;return w==="mutation"?T.mutate(C):w==="subscription"?T.subscribe(C,E):T.query(C)}function p(u,S,w,C,E,R){return f(S,w,C,m(E,t.entries.find(T=>T.capName===u)?.providerNodeId),R)}function h(u,S,w,C,E){return f(u,S,w,m(C,void 0),E)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:Le(s,t.deviceId,"air-quality-sensor"),alarmPanel:Le(s,t.deviceId,"alarm-panel"),ambientLightSensor:Le(s,t.deviceId,"ambient-light-sensor"),audioMetrics:Le(s,t.deviceId,"audio-metrics"),automationControl:Le(s,t.deviceId,"automation-control"),battery:Le(s,t.deviceId,"battery"),binary:Le(s,t.deviceId,"binary"),brightness:Le(s,t.deviceId,"brightness"),cameraStreams:Le(s,t.deviceId,"camera-streams"),carbonMonoxide:Le(s,t.deviceId,"carbon-monoxide"),climateControl:Le(s,t.deviceId,"climate-control"),color:Le(s,t.deviceId,"color"),connectivity:Le(s,t.deviceId,"connectivity"),consumables:Le(s,t.deviceId,"consumables"),contact:Le(s,t.deviceId,"contact"),control:Le(s,t.deviceId,"control"),cover:Le(s,t.deviceId,"cover"),dayNight:Le(s,t.deviceId,"day-night"),deviceDiscovery:Le(s,t.deviceId,"device-discovery"),deviceStatus:Le(s,t.deviceId,"device-status"),doorbell:Le(s,t.deviceId,"doorbell"),enumSensor:Le(s,t.deviceId,"enum-sensor"),eventEmitter:Le(s,t.deviceId,"event-emitter"),fanControl:Le(s,t.deviceId,"fan-control"),featureProbe:Le(s,t.deviceId,"feature-probe"),flood:Le(s,t.deviceId,"flood"),gas:Le(s,t.deviceId,"gas"),humidifier:Le(s,t.deviceId,"humidifier"),humiditySensor:Le(s,t.deviceId,"humidity-sensor"),image:Le(s,t.deviceId,"image"),imageSettings:Le(s,t.deviceId,"image-settings"),intercom:Le(s,t.deviceId,"intercom"),lawnMowerControl:Le(s,t.deviceId,"lawn-mower-control"),lockControl:Le(s,t.deviceId,"lock-control"),mediaPlayer:Le(s,t.deviceId,"media-player"),motion:Le(s,t.deviceId,"motion"),motionTrigger:Le(s,t.deviceId,"motion-trigger"),motionZones:Le(s,t.deviceId,"motion-zones"),nativeObjectDetection:Le(s,t.deviceId,"native-object-detection"),notifier:Le(s,t.deviceId,"notifier"),numericSensor:Le(s,t.deviceId,"numeric-sensor"),petFeeder:Le(s,t.deviceId,"pet-feeder"),powerMeter:Le(s,t.deviceId,"power-meter"),presence:Le(s,t.deviceId,"presence"),pressureSensor:Le(s,t.deviceId,"pressure-sensor"),privacyMask:Le(s,t.deviceId,"privacy-mask"),ptzAutotrack:Le(s,t.deviceId,"ptz-autotrack"),sceneMonitor:Le(s,t.deviceId,"scene-monitor"),scriptRunner:Le(s,t.deviceId,"script-runner"),smoke:Le(s,t.deviceId,"smoke"),streamCatalog:Le(s,t.deviceId,"stream-catalog"),streamParams:Le(s,t.deviceId,"stream-params"),switch:Le(s,t.deviceId,"switch"),tamper:Le(s,t.deviceId,"tamper"),temperatureSensor:Le(s,t.deviceId,"temperature-sensor"),update:Le(s,t.deviceId,"update"),vacuumControl:Le(s,t.deviceId,"vacuum-control"),valve:Le(s,t.deviceId,"valve"),vibration:Le(s,t.deviceId,"vibration"),waterHeater:Le(s,t.deviceId,"water-heater"),weather:Le(s,t.deviceId,"weather"),zoneAnalytics:Le(s,t.deviceId,"zone-analytics"),zoneRules:Le(s,t.deviceId,"zone-rules"),zones:Le(s,t.deviceId,"zones")},accessories:{setChildHidden:u=>p("accessories","accessories","setChildHidden","mutation",u),getStatus:u=>p("accessories","accessories","getStatus","query",u)},airQualitySensor:{getStatus:u=>p("air-quality-sensor","airQualitySensor","getStatus","query",u)},alarmPanel:{arm:u=>p("alarm-panel","alarmPanel","arm","mutation",u),disarm:u=>p("alarm-panel","alarmPanel","disarm","mutation",u),trigger:u=>p("alarm-panel","alarmPanel","trigger","mutation",u),getStatus:u=>p("alarm-panel","alarmPanel","getStatus","query",u)},ambientLightSensor:{getStatus:u=>p("ambient-light-sensor","ambientLightSensor","getStatus","query",u)},audioAnalysis:{resolveDeviceSettings:u=>p("audio-analysis","audioAnalysis","resolveDeviceSettings","query",u),getDeviceSettingsContribution:u=>p("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",u)},audioMetrics:{getCurrentSnapshot:u=>p("audio-metrics","audioMetrics","getCurrentSnapshot","query",u),getHistory:u=>p("audio-metrics","audioMetrics","getHistory","query",u)},automationControl:{enable:u=>p("automation-control","automationControl","enable","mutation",u),disable:u=>p("automation-control","automationControl","disable","mutation",u),trigger:u=>p("automation-control","automationControl","trigger","mutation",u),getStatus:u=>p("automation-control","automationControl","getStatus","query",u)},battery:{wakeForStream:u=>p("battery","battery","wakeForStream","mutation",u),getStatus:u=>p("battery","battery","getStatus","query",u)},binary:{getStatus:u=>p("binary","binary","getStatus","query",u)},brightness:{setBrightness:u=>p("brightness","brightness","setBrightness","mutation",u),getStatus:u=>p("brightness","brightness","getStatus","query",u)},button:{press:u=>p("button","button","press","mutation",u)},cameraCredentials:{getCredentials:u=>p("camera-credentials","cameraCredentials","getCredentials","query",u),getStatus:u=>p("camera-credentials","cameraCredentials","getStatus","query",u)},cameraStreams:{getCameraStreams:u=>p("camera-streams","cameraStreams","getCameraStreams","query",u),getBrokerStreams:u=>p("camera-streams","cameraStreams","getBrokerStreams","query",u),getRtspEntries:u=>p("camera-streams","cameraStreams","getRtspEntries","query",u),getProfileRtspEntries:u=>p("camera-streams","cameraStreams","getProfileRtspEntries","query",u),pickStream:u=>p("camera-streams","cameraStreams","pickStream","query",u)},carbonMonoxide:{getStatus:u=>p("carbon-monoxide","carbonMonoxide","getStatus","query",u)},climateControl:{setMode:u=>p("climate-control","climateControl","setMode","mutation",u),setFanMode:u=>p("climate-control","climateControl","setFanMode","mutation",u),setPreset:u=>p("climate-control","climateControl","setPreset","mutation",u),setTarget:u=>p("climate-control","climateControl","setTarget","mutation",u),setTargetRange:u=>p("climate-control","climateControl","setTargetRange","mutation",u),setTargetHumidity:u=>p("climate-control","climateControl","setTargetHumidity","mutation",u),setSwingVertical:u=>p("climate-control","climateControl","setSwingVertical","mutation",u),setSwingHorizontal:u=>p("climate-control","climateControl","setSwingHorizontal","mutation",u),getStatus:u=>p("climate-control","climateControl","getStatus","query",u)},color:{setColor:u=>p("color","color","setColor","mutation",u),getStatus:u=>p("color","color","getStatus","query",u)},connectivity:{getStatus:u=>p("connectivity","connectivity","getStatus","query",u)},consumables:{reset:u=>p("consumables","consumables","reset","mutation",u),getStatus:u=>p("consumables","consumables","getStatus","query",u)},contact:{getStatus:u=>p("contact","contact","getStatus","query",u)},control:{setValue:u=>p("control","control","setValue","mutation",u),getStatus:u=>p("control","control","getStatus","query",u)},cover:{open:u=>p("cover","cover","open","mutation",u),close:u=>p("cover","cover","close","mutation",u),stop:u=>p("cover","cover","stop","mutation",u),setPosition:u=>p("cover","cover","setPosition","mutation",u),setTiltPosition:u=>p("cover","cover","setTiltPosition","mutation",u),getStatus:u=>p("cover","cover","getStatus","query",u)},dayNight:{getOptions:u=>p("day-night","dayNight","getOptions","query",u),setSettings:u=>p("day-night","dayNight","setSettings","mutation",u),getStatus:u=>p("day-night","dayNight","getStatus","query",u)},detectionPipeline:{getDeviceSettingsContribution:u=>p("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",u)},deviceDiscovery:{listDiscovered:u=>p("device-discovery","deviceDiscovery","listDiscovered","query",u),refreshDiscovery:u=>p("device-discovery","deviceDiscovery","refreshDiscovery","mutation",u),adoptDevice:u=>p("device-discovery","deviceDiscovery","adoptDevice","mutation",u),releaseDevice:u=>p("device-discovery","deviceDiscovery","releaseDevice","mutation",u),getStatus:u=>p("device-discovery","deviceDiscovery","getStatus","query",u)},deviceOps:{getStreamSources:u=>p("device-ops","deviceOps","getStreamSources","query",u),getConfigEntries:u=>p("device-ops","deviceOps","getConfigEntries","query",u),setConfig:u=>p("device-ops","deviceOps","setConfig","mutation",u),runAction:u=>p("device-ops","deviceOps","runAction","mutation",u),removeDevice:u=>p("device-ops","deviceOps","removeDevice","mutation",u),getSettingsSchema:u=>p("device-ops","deviceOps","getSettingsSchema","query",u),getRawState:u=>p("device-ops","deviceOps","getRawState","query",u)},deviceStatus:{getStatus:u=>p("device-status","deviceStatus","getStatus","query",u)},doorbell:{getStatus:u=>p("doorbell","doorbell","getStatus","query",u),getDeviceSettingsContribution:u=>p("doorbell","doorbell","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("doorbell","doorbell","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("doorbell","doorbell","applyDeviceSettingsPatch","mutation",u)},enumSensor:{getStatus:u=>p("enum-sensor","enumSensor","getStatus","query",u)},eventEmitter:{getStatus:u=>p("event-emitter","eventEmitter","getStatus","query",u)},events:{getEvents:u=>p("events","events","getEvents","query",u),getEventThumbnail:u=>p("events","events","getEventThumbnail","query",u),getEventClipUrl:u=>p("events","events","getEventClipUrl","query",u)},fanControl:{setPercentage:u=>p("fan-control","fanControl","setPercentage","mutation",u),setPreset:u=>p("fan-control","fanControl","setPreset","mutation",u),setDirection:u=>p("fan-control","fanControl","setDirection","mutation",u),setOscillating:u=>p("fan-control","fanControl","setOscillating","mutation",u),getStatus:u=>p("fan-control","fanControl","getStatus","query",u)},featureProbe:{getStatus:u=>p("feature-probe","featureProbe","getStatus","query",u)},flood:{getStatus:u=>p("flood","flood","getStatus","query",u)},gas:{getStatus:u=>p("gas","gas","getStatus","query",u)},humidifier:{setOn:u=>p("humidifier","humidifier","setOn","mutation",u),setTargetHumidity:u=>p("humidifier","humidifier","setTargetHumidity","mutation",u),setMode:u=>p("humidifier","humidifier","setMode","mutation",u),getStatus:u=>p("humidifier","humidifier","getStatus","query",u)},humiditySensor:{getStatus:u=>p("humidity-sensor","humiditySensor","getStatus","query",u)},image:{getStatus:u=>p("image","image","getStatus","query",u)},imageSettings:{getOptions:u=>p("image-settings","imageSettings","getOptions","query",u),setSettings:u=>p("image-settings","imageSettings","setSettings","mutation",u),getStatus:u=>p("image-settings","imageSettings","getStatus","query",u)},intercom:{startSession:u=>p("intercom","intercom","startSession","mutation",u),handleAnswer:u=>p("intercom","intercom","handleAnswer","mutation",u),stopSession:u=>p("intercom","intercom","stopSession","mutation",u),startTalkSession:u=>p("intercom","intercom","startTalkSession","mutation",u),pushTalkAudio:u=>p("intercom","intercom","pushTalkAudio","mutation",u),endTalkSession:u=>p("intercom","intercom","endTalkSession","mutation",u),getStatus:u=>p("intercom","intercom","getStatus","query",u)},lawnMowerControl:{startMowing:u=>p("lawn-mower-control","lawnMowerControl","startMowing","mutation",u),pause:u=>p("lawn-mower-control","lawnMowerControl","pause","mutation",u),dock:u=>p("lawn-mower-control","lawnMowerControl","dock","mutation",u),getStatus:u=>p("lawn-mower-control","lawnMowerControl","getStatus","query",u)},lockControl:{lock:u=>p("lock-control","lockControl","lock","mutation",u),unlock:u=>p("lock-control","lockControl","unlock","mutation",u),open:u=>p("lock-control","lockControl","open","mutation",u),getStatus:u=>p("lock-control","lockControl","getStatus","query",u)},mediaPlayer:{play:u=>p("media-player","mediaPlayer","play","mutation",u),pause:u=>p("media-player","mediaPlayer","pause","mutation",u),stop:u=>p("media-player","mediaPlayer","stop","mutation",u),next:u=>p("media-player","mediaPlayer","next","mutation",u),previous:u=>p("media-player","mediaPlayer","previous","mutation",u),seek:u=>p("media-player","mediaPlayer","seek","mutation",u),setVolume:u=>p("media-player","mediaPlayer","setVolume","mutation",u),setMute:u=>p("media-player","mediaPlayer","setMute","mutation",u),setShuffle:u=>p("media-player","mediaPlayer","setShuffle","mutation",u),setRepeat:u=>p("media-player","mediaPlayer","setRepeat","mutation",u),selectSource:u=>p("media-player","mediaPlayer","selectSource","mutation",u),playMedia:u=>p("media-player","mediaPlayer","playMedia","mutation",u),getStatus:u=>p("media-player","mediaPlayer","getStatus","query",u)},motion:{isDetected:u=>p("motion","motion","isDetected","query",u),getStatus:u=>p("motion","motion","getStatus","query",u)},motionDetection:{analyze:u=>p("motion-detection","motionDetection","analyze","mutation",u),removeCamera:u=>p("motion-detection","motionDetection","removeCamera","mutation",u),reset:u=>p("motion-detection","motionDetection","reset","mutation",u),getDeviceSettingsContribution:u=>p("motion-detection","motionDetection","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("motion-detection","motionDetection","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",u)},motionTrigger:{setMotionTrigger:u=>p("motion-trigger","motionTrigger","setMotionTrigger","mutation",u),getStatus:u=>p("motion-trigger","motionTrigger","getStatus","query",u)},motionZones:{getOptions:u=>p("motion-zones","motionZones","getOptions","query",u),setZone:u=>p("motion-zones","motionZones","setZone","mutation",u),getStatus:u=>p("motion-zones","motionZones","getStatus","query",u)},nativeObjectDetection:{setEnabled:u=>p("native-object-detection","nativeObjectDetection","setEnabled","mutation",u),getStatus:u=>p("native-object-detection","nativeObjectDetection","getStatus","query",u)},notificationRules:{listRules:u=>p("notification-rules","notificationRules","listRules","query",u),getRule:u=>p("notification-rules","notificationRules","getRule","query",u),createRule:u=>p("notification-rules","notificationRules","createRule","mutation",u),updateRule:u=>p("notification-rules","notificationRules","updateRule","mutation",u),deleteRule:u=>p("notification-rules","notificationRules","deleteRule","mutation",u),setRuleEnabled:u=>p("notification-rules","notificationRules","setRuleEnabled","mutation",u),listDeviceMutes:u=>p("notification-rules","notificationRules","listDeviceMutes","query",u),setDeviceMuted:u=>p("notification-rules","notificationRules","setDeviceMuted","mutation",u),testRule:u=>p("notification-rules","notificationRules","testRule","mutation",u),getConditionCatalog:u=>p("notification-rules","notificationRules","getConditionCatalog","query",u),getHistory:u=>p("notification-rules","notificationRules","getHistory","query",u),resolveArtifactUrl:u=>p("notification-rules","notificationRules","resolveArtifactUrl","query",u),listSnoozes:u=>p("notification-rules","notificationRules","listSnoozes","query",u),createSnooze:u=>p("notification-rules","notificationRules","createSnooze","mutation",u),cancelSnooze:u=>p("notification-rules","notificationRules","cancelSnooze","mutation",u),getAlarmConfig:u=>p("notification-rules","notificationRules","getAlarmConfig","query",u),setAlarmConfig:u=>p("notification-rules","notificationRules","setAlarmConfig","mutation",u)},notifier:{send:u=>p("notifier","notifier","send","mutation",u),cancel:u=>p("notifier","notifier","cancel","mutation",u),getStatus:u=>p("notifier","notifier","getStatus","query",u)},numericSensor:{getStatus:u=>p("numeric-sensor","numericSensor","getStatus","query",u)},osd:{setOverlay:u=>p("osd","osd","setOverlay","mutation",u),getStatus:u=>p("osd","osd","getStatus","query",u)},petFeeder:{feed:u=>p("pet-feeder","petFeeder","feed","mutation",u),cancelFeed:u=>p("pet-feeder","petFeeder","cancelFeed","mutation",u),resetDesiccant:u=>p("pet-feeder","petFeeder","resetDesiccant","mutation",u),markFoodReplenished:u=>p("pet-feeder","petFeeder","markFoodReplenished","mutation",u),callPet:u=>p("pet-feeder","petFeeder","callPet","mutation",u),playSound:u=>p("pet-feeder","petFeeder","playSound","mutation",u),setChildLock:u=>p("pet-feeder","petFeeder","setChildLock","mutation",u),setIndicatorLight:u=>p("pet-feeder","petFeeder","setIndicatorLight","mutation",u),setFeedSound:u=>p("pet-feeder","petFeeder","setFeedSound","mutation",u),setVolume:u=>p("pet-feeder","petFeeder","setVolume","mutation",u),getStatus:u=>p("pet-feeder","petFeeder","getStatus","query",u)},pipelineAnalytics:{getActiveTracks:u=>p("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",u),getTrack:u=>p("pipeline-analytics","pipelineAnalytics","getTrack","query",u),listTracks:u=>p("pipeline-analytics","pipelineAnalytics","listTracks","query",u),listRecentTracks:u=>p("pipeline-analytics","pipelineAnalytics","listRecentTracks","query",u),clearTracks:u=>p("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",u),getMotionEvents:u=>p("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",u),getObjectEvents:u=>p("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",u),getAudioEvents:u=>p("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",u),listEventKinds:u=>p("pipeline-analytics","pipelineAnalytics","listEventKinds","query",u),listEventKindsBatch:u=>p("pipeline-analytics","pipelineAnalytics","listEventKindsBatch","query",u),getSensorEvents:u=>p("pipeline-analytics","pipelineAnalytics","getSensorEvents","query",u),getKeyEvents:u=>p("pipeline-analytics","pipelineAnalytics","getKeyEvents","query",u),getKeyEventsBatch:u=>p("pipeline-analytics","pipelineAnalytics","getKeyEventsBatch","query",u),getEventDensity:u=>p("pipeline-analytics","pipelineAnalytics","getEventDensity","query",u),pruneEventsBefore:u=>p("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",u),pruneTracksBefore:u=>p("pipeline-analytics","pipelineAnalytics","pruneTracksBefore","mutation",u),wipeAllAnalytics:u=>p("pipeline-analytics","pipelineAnalytics","wipeAllAnalytics","mutation",u),reconcileFromDisk:u=>p("pipeline-analytics","pipelineAnalytics","reconcileFromDisk","mutation",u),deleteTracks:u=>p("pipeline-analytics","pipelineAnalytics","deleteTracks","mutation",u),setTrackFlags:u=>p("pipeline-analytics","pipelineAnalytics","setTrackFlags","mutation",u),getEventStoreFootprint:u=>p("pipeline-analytics","pipelineAnalytics","getEventStoreFootprint","query",u),getEventMediaFootprintByKind:u=>p("pipeline-analytics","pipelineAnalytics","getEventMediaFootprintByKind","query",u),pruneEvents:u=>p("pipeline-analytics","pipelineAnalytics","pruneEvents","mutation",u),deleteDeviceEvents:u=>p("pipeline-analytics","pipelineAnalytics","deleteDeviceEvents","mutation",u),pauseForStorageMigration:u=>p("pipeline-analytics","pipelineAnalytics","pauseForStorageMigration","mutation",u),resumeForStorageMigration:u=>p("pipeline-analytics","pipelineAnalytics","resumeForStorageMigration","mutation",u),refreshStorageLocationsForMigration:u=>p("pipeline-analytics","pipelineAnalytics","refreshStorageLocationsForMigration","mutation",u),startStorageMigrationMove:u=>p("pipeline-analytics","pipelineAnalytics","startStorageMigrationMove","mutation",u),getStorageMigrationMoveStatus:u=>p("pipeline-analytics","pipelineAnalytics","getStorageMigrationMoveStatus","query",u),cancelStorageMigrationMove:u=>p("pipeline-analytics","pipelineAnalytics","cancelStorageMigrationMove","mutation",u),relocateMedia:u=>p("pipeline-analytics","pipelineAnalytics","relocateMedia","mutation",u),countUnstampedEventMedia:u=>p("pipeline-analytics","pipelineAnalytics","countUnstampedEventMedia","query",u),countRelocatableMedia:u=>p("pipeline-analytics","pipelineAnalytics","countRelocatableMedia","query",u),listRelocateMediaJobs:u=>p("pipeline-analytics","pipelineAnalytics","listRelocateMediaJobs","query",u),cancelRelocateMedia:u=>p("pipeline-analytics","pipelineAnalytics","cancelRelocateMedia","mutation",u),listOpsLog:u=>p("pipeline-analytics","pipelineAnalytics","listOpsLog","query",u),reclaimDebugMedia:u=>p("pipeline-analytics","pipelineAnalytics","reclaimDebugMedia","mutation",u),getMediaReclaimStatus:u=>p("pipeline-analytics","pipelineAnalytics","getMediaReclaimStatus","query",u),getTrainingExportSummary:u=>p("pipeline-analytics","pipelineAnalytics","getTrainingExportSummary","query",u),getTrainingExportUrl:u=>p("pipeline-analytics","pipelineAnalytics","getTrainingExportUrl","query",u),listRetrainStaging:u=>p("pipeline-analytics","pipelineAnalytics","listRetrainStaging","query",u),listRetrainFrames:u=>p("pipeline-analytics","pipelineAnalytics","listRetrainFrames","query",u),selectRetrainFrames:u=>p("pipeline-analytics","pipelineAnalytics","selectRetrainFrames","mutation",u),deselectRetrainFrame:u=>p("pipeline-analytics","pipelineAnalytics","deselectRetrainFrame","mutation",u),getRetrainFrameImage:u=>p("pipeline-analytics","pipelineAnalytics","getRetrainFrameImage","query",u),proposeRetrainAnnotations:u=>p("pipeline-analytics","pipelineAnalytics","proposeRetrainAnnotations","mutation",u),runReplayFrameProcessor:u=>p("pipeline-analytics","pipelineAnalytics","runReplayFrameProcessor","mutation",u),listRetrainAnnotations:u=>p("pipeline-analytics","pipelineAnalytics","listRetrainAnnotations","query",u),saveRetrainAnnotations:u=>p("pipeline-analytics","pipelineAnalytics","saveRetrainAnnotations","mutation",u),completeRetrainTrack:u=>p("pipeline-analytics","pipelineAnalytics","completeRetrainTrack","mutation",u),restageRetrainTrack:u=>p("pipeline-analytics","pipelineAnalytics","restageRetrainTrack","mutation",u),getRetrainExportUrl:u=>p("pipeline-analytics","pipelineAnalytics","getRetrainExportUrl","query",u),getEventMedia:u=>p("pipeline-analytics","pipelineAnalytics","getEventMedia","query",u),getTrackMedia:u=>p("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",u),listTrackMedia:u=>p("pipeline-analytics","pipelineAnalytics","listTrackMedia","query",u),listEventMedia:u=>p("pipeline-analytics","pipelineAnalytics","listEventMedia","query",u),searchObjectEvents:u=>p("pipeline-analytics","pipelineAnalytics","searchObjectEvents","query",u),wipeObjectEmbeddings:u=>p("pipeline-analytics","pipelineAnalytics","wipeObjectEmbeddings","mutation",u),rebuildObjectEmbeddings:u=>p("pipeline-analytics","pipelineAnalytics","rebuildObjectEmbeddings","mutation",u),getObjectEmbeddingRebuildStatus:u=>p("pipeline-analytics","pipelineAnalytics","getObjectEmbeddingRebuildStatus","query",u),getDeviceSettingsContribution:u=>p("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",u)},powerMeter:{getStatus:u=>p("power-meter","powerMeter","getStatus","query",u)},presence:{getStatus:u=>p("presence","presence","getStatus","query",u)},pressureSensor:{getStatus:u=>p("pressure-sensor","pressureSensor","getStatus","query",u)},privacyMask:{getOptions:u=>p("privacy-mask","privacyMask","getOptions","query",u),setMask:u=>p("privacy-mask","privacyMask","setMask","mutation",u),setAudioEnabled:u=>p("privacy-mask","privacyMask","setAudioEnabled","mutation",u),getStatus:u=>p("privacy-mask","privacyMask","getStatus","query",u)},ptz:{move:u=>p("ptz","ptz","move","mutation",u),continuousMove:u=>p("ptz","ptz","continuousMove","mutation",u),stop:u=>p("ptz","ptz","stop","mutation",u),getPresets:u=>p("ptz","ptz","getPresets","query",u),goToPreset:u=>p("ptz","ptz","goToPreset","mutation",u),savePreset:u=>p("ptz","ptz","savePreset","mutation",u),deletePreset:u=>p("ptz","ptz","deletePreset","mutation",u),getOptions:u=>p("ptz","ptz","getOptions","query",u),goHome:u=>p("ptz","ptz","goHome","mutation",u),getPosition:u=>p("ptz","ptz","getPosition","query",u),setAutofocus:u=>p("ptz","ptz","setAutofocus","mutation",u),getStatus:u=>p("ptz","ptz","getStatus","query",u)},ptzAutotrack:{getStatus:u=>p("ptz-autotrack","ptzAutotrack","getStatus","query",u),setEnabled:u=>p("ptz-autotrack","ptzAutotrack","setEnabled","mutation",u),getSettings:u=>p("ptz-autotrack","ptzAutotrack","getSettings","query",u),setSettings:u=>p("ptz-autotrack","ptzAutotrack","setSettings","mutation",u)},reboot:{reboot:u=>p("reboot","reboot","reboot","mutation",u)},sceneMonitor:{listScenes:u=>p("scene-monitor","sceneMonitor","listScenes","query",u),listScenesBatch:u=>p("scene-monitor","sceneMonitor","listScenesBatch","query",u),createScene:u=>p("scene-monitor","sceneMonitor","createScene","mutation",u),updateScene:u=>p("scene-monitor","sceneMonitor","updateScene","mutation",u),deleteScene:u=>p("scene-monitor","sceneMonitor","deleteScene","mutation",u),captureReference:u=>p("scene-monitor","sceneMonitor","captureReference","mutation",u),deleteReference:u=>p("scene-monitor","sceneMonitor","deleteReference","mutation",u),recheckNow:u=>p("scene-monitor","sceneMonitor","recheckNow","mutation",u),resetScene:u=>p("scene-monitor","sceneMonitor","resetScene","mutation",u),getStatus:u=>p("scene-monitor","sceneMonitor","getStatus","query",u)},scriptRunner:{run:u=>p("script-runner","scriptRunner","run","mutation",u),stop:u=>p("script-runner","scriptRunner","stop","mutation",u),getStatus:u=>p("script-runner","scriptRunner","getStatus","query",u)},smoke:{getStatus:u=>p("smoke","smoke","getStatus","query",u)},snapshot:{getSnapshot:u=>p("snapshot","snapshot","getSnapshot","query",u),invalidateCache:u=>p("snapshot","snapshot","invalidateCache","mutation",u),getSnapshotOverview:u=>p("snapshot","snapshot","getSnapshotOverview","query",u),getDebugState:u=>p("snapshot","snapshot","getDebugState","query",u),getSnapshotLinks:u=>p("snapshot","snapshot","getSnapshotLinks","query",u),getStatus:u=>p("snapshot","snapshot","getStatus","query",u),getDeviceSettingsContribution:u=>p("snapshot","snapshot","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>p("snapshot","snapshot","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>p("snapshot","snapshot","applyDeviceSettingsPatch","mutation",u)},streamCatalog:{getCatalog:u=>p("stream-catalog","streamCatalog","getCatalog","query",u)},streamParams:{getOptions:u=>p("stream-params","streamParams","getOptions","query",u),setProfile:u=>p("stream-params","streamParams","setProfile","mutation",u),getConfigSchema:u=>p("stream-params","streamParams","getConfigSchema","query",u),getStatus:u=>p("stream-params","streamParams","getStatus","query",u)},switch:{setState:u=>p("switch","switch","setState","mutation",u),getStatus:u=>p("switch","switch","getStatus","query",u)},tamper:{getStatus:u=>p("tamper","tamper","getStatus","query",u)},temperatureSensor:{getStatus:u=>p("temperature-sensor","temperatureSensor","getStatus","query",u)},update:{installUpdate:u=>p("update","update","installUpdate","mutation",u),getStatus:u=>p("update","update","getStatus","query",u)},vacuumControl:{start:u=>p("vacuum-control","vacuumControl","start","mutation",u),pause:u=>p("vacuum-control","vacuumControl","pause","mutation",u),stop:u=>p("vacuum-control","vacuumControl","stop","mutation",u),returnToBase:u=>p("vacuum-control","vacuumControl","returnToBase","mutation",u),locate:u=>p("vacuum-control","vacuumControl","locate","mutation",u),setFanSpeed:u=>p("vacuum-control","vacuumControl","setFanSpeed","mutation",u),getStatus:u=>p("vacuum-control","vacuumControl","getStatus","query",u)},valve:{open:u=>p("valve","valve","open","mutation",u),close:u=>p("valve","valve","close","mutation",u),stop:u=>p("valve","valve","stop","mutation",u),setPosition:u=>p("valve","valve","setPosition","mutation",u),getStatus:u=>p("valve","valve","getStatus","query",u)},vibration:{getStatus:u=>p("vibration","vibration","getStatus","query",u)},videoclips:{listClips:u=>p("videoclips","videoclips","listClips","query",u),getClipPlayback:u=>p("videoclips","videoclips","getClipPlayback","query",u)},waterHeater:{setTargetTemp:u=>p("water-heater","waterHeater","setTargetTemp","mutation",u),setOperationMode:u=>p("water-heater","waterHeater","setOperationMode","mutation",u),setAway:u=>p("water-heater","waterHeater","setAway","mutation",u),getStatus:u=>p("water-heater","waterHeater","getStatus","query",u)},weather:{getStatus:u=>p("weather","weather","getStatus","query",u)},webrtcSession:{listStreams:u=>p("webrtc-session","webrtcSession","listStreams","query",u),createSession:u=>p("webrtc-session","webrtcSession","createSession","mutation",u),handleOffer:u=>p("webrtc-session","webrtcSession","handleOffer","mutation",u),handleAnswer:u=>p("webrtc-session","webrtcSession","handleAnswer","mutation",u),addIceCandidate:u=>p("webrtc-session","webrtcSession","addIceCandidate","mutation",u),getIceCandidates:u=>p("webrtc-session","webrtcSession","getIceCandidates","query",u),closeSession:u=>p("webrtc-session","webrtcSession","closeSession","mutation",u),hasAdaptiveBitrate:u=>p("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",u),getSessionState:u=>p("webrtc-session","webrtcSession","getSessionState","query",u)},zoneAnalytics:{getCurrentSnapshot:u=>p("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",u),getCurrentSnapshotBatch:u=>p("zone-analytics","zoneAnalytics","getCurrentSnapshotBatch","query",u),getZoneHistory:u=>p("zone-analytics","zoneAnalytics","getZoneHistory","query",u),getCameraHistory:u=>p("zone-analytics","zoneAnalytics","getCameraHistory","query",u),getUnzonedHistory:u=>p("zone-analytics","zoneAnalytics","getUnzonedHistory","query",u)},zoneRules:{listRules:u=>p("zone-rules","zoneRules","listRules","query",u),setRules:u=>p("zone-rules","zoneRules","setRules","mutation",u)},zones:{listZones:u=>p("zones","zones","listZones","query",u),addZone:u=>p("zones","zones","addZone","mutation",u),removeZone:u=>p("zones","zones","removeZone","mutation",u),updateZone:u=>p("zones","zones","updateZone","mutation",u)},addonSettings:{getDeviceSettings:u=>h("addonSettings","getDeviceSettings","query",u),updateDeviceSettings:u=>h("addonSettings","updateDeviceSettings","mutation",u)},cameraPipelineConfig:{getDeviceSettingsContribution:u=>h("cameraPipelineConfig","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("cameraPipelineConfig","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("cameraPipelineConfig","applyDeviceSettingsPatch","mutation",u)},deviceAdoption:{getStatus:u=>h("deviceAdoption","getStatus","query",u)},deviceExport:{getDeviceSettingsContribution:u=>h("deviceExport","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("deviceExport","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("deviceExport","applyDeviceSettingsPatch","mutation",u)},deviceManager:{loadConfig:u=>h("deviceManager","loadConfig","query",u),loadRuntimeState:u=>h("deviceManager","loadRuntimeState","query",u),loadMeta:u=>h("deviceManager","loadMeta","query",u),setName:u=>h("deviceManager","setName","mutation",u),setLocation:u=>h("deviceManager","setLocation","mutation",u),setType:u=>h("deviceManager","setType","mutation",u),setIntegrationId:u=>h("deviceManager","setIntegrationId","mutation",u),setLinkDeviceId:u=>h("deviceManager","setLinkDeviceId","mutation",u),setPrimaryChildEntityId:u=>h("deviceManager","setPrimaryChildEntityId","mutation",u),setChildLayout:u=>h("deviceManager","setChildLayout","mutation",u),setDisplay:u=>h("deviceManager","setDisplay","mutation",u),getWireableFields:u=>h("deviceManager","getWireableFields","query",u),setRole:u=>h("deviceManager","setRole","mutation",u),applyInitialMeta:u=>h("deviceManager","applyInitialMeta","mutation",u),setMetadata:u=>h("deviceManager","setMetadata","mutation",u),setDisabled:u=>h("deviceManager","setDisabled","mutation",u),getDevice:u=>h("deviceManager","getDevice","query",u),getLinkedDevices:u=>h("deviceManager","getLinkedDevices","query",u),getStreamSources:u=>h("deviceManager","getStreamSources","query",u),getConfigSchema:u=>h("deviceManager","getConfigSchema","query",u),getSettingsSchema:u=>h("deviceManager","getSettingsSchema","query",u),updateConfig:u=>h("deviceManager","updateConfig","mutation",u),enable:u=>h("deviceManager","enable","mutation",u),disable:u=>h("deviceManager","disable","mutation",u),remove:u=>h("deviceManager","remove","mutation",u),getStreamProfileMap:u=>h("deviceManager","getStreamProfileMap","query",u),setStreamProfileMap:u=>h("deviceManager","setStreamProfileMap","mutation",u),probeStreams:u=>h("deviceManager","probeStreams","mutation",u),getBindings:u=>h("deviceManager","getBindings","query",u),setWrapperActive:u=>h("deviceManager","setWrapperActive","mutation",u),getDeviceSettingsAggregate:u=>h("deviceManager","getDeviceSettingsAggregate","query",u),getDeviceLiveInfoAggregate:u=>h("deviceManager","getDeviceLiveInfoAggregate","query",u),getDeviceAggregate:u=>h("deviceManager","getDeviceAggregate","query",u),runDeviceAction:u=>h("deviceManager","runDeviceAction","mutation",u),updateDeviceField:u=>h("deviceManager","updateDeviceField","mutation",u),updateDeviceFieldsBatch:u=>h("deviceManager","updateDeviceFieldsBatch","mutation",u),testField:u=>h("deviceManager","testField","mutation",u),getDeviceStatusAggregate:u=>h("deviceManager","getDeviceStatusAggregate","query",u),getDeviceSettingsContribution:u=>h("deviceManager","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("deviceManager","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("deviceManager","applyDeviceSettingsPatch","mutation",u)},deviceState:{getSnapshot:u=>h("deviceState","getSnapshot","query",u),getCapSlice:u=>h("deviceState","getCapSlice","query",u),setCapSlice:u=>h("deviceState","setCapSlice","mutation",u)},faceGallery:{listRecentFaces:u=>h("faceGallery","listRecentFaces","query",u),getFaceByTrack:u=>h("faceGallery","getFaceByTrack","query",u)},networkQuality:{getDeviceStats:u=>h("networkQuality","getDeviceStats","query",u),reportClientStats:u=>h("networkQuality","reportClientStats","mutation",u)},osdManager:{getDeviceOsd:u=>h("osdManager","getDeviceOsd","query",u),getSourceCatalog:u=>h("osdManager","getSourceCatalog","query",u),setSlotBinding:u=>h("osdManager","setSlotBinding","mutation",u),clearSlotBinding:u=>h("osdManager","clearSlotBinding","mutation",u),previewSlot:u=>h("osdManager","previewSlot","mutation",u),renderDevice:u=>h("osdManager","renderDevice","mutation",u)},pipelineExecutor:{runPipeline:u=>h("pipelineExecutor","runPipeline","mutation",u),runPipelineBatch:u=>h("pipelineExecutor","runPipelineBatch","mutation",u)},pipelineOrchestrator:{assignPipeline:u=>h("pipelineOrchestrator","assignPipeline","mutation",u),unassignPipeline:u=>h("pipelineOrchestrator","unassignPipeline","mutation",u),setPipelineDevicePin:u=>h("pipelineOrchestrator","setPipelineDevicePin","mutation",u),getPipelineDevicePin:u=>h("pipelineOrchestrator","getPipelineDevicePin","query",u),getPipelineAssignment:u=>h("pipelineOrchestrator","getPipelineAssignment","query",u),getCameraMetrics:u=>h("pipelineOrchestrator","getCameraMetrics","query",u),assignAudio:u=>h("pipelineOrchestrator","assignAudio","mutation",u),unassignAudio:u=>h("pipelineOrchestrator","unassignAudio","mutation",u),getAudioAssignment:u=>h("pipelineOrchestrator","getAudioAssignment","query",u),getAudioAssignments:u=>h("pipelineOrchestrator","getAudioAssignments","query",u),getCameraSettings:u=>h("pipelineOrchestrator","getCameraSettings","query",u),setCameraStepToggle:u=>h("pipelineOrchestrator","setCameraStepToggle","mutation",u),getCameraStepOverrides:u=>h("pipelineOrchestrator","getCameraStepOverrides","query",u),setCameraStepOverride:u=>h("pipelineOrchestrator","setCameraStepOverride","mutation",u),setCameraPipelineForAgent:u=>h("pipelineOrchestrator","setCameraPipelineForAgent","mutation",u),resolvePipeline:u=>h("pipelineOrchestrator","resolvePipeline","query",u),getCameraSwitches:u=>h("pipelineOrchestrator","getCameraSwitches","query",u),setCameraSwitch:u=>h("pipelineOrchestrator","setCameraSwitch","mutation",u),getCameraStatus:u=>h("pipelineOrchestrator","getCameraStatus","query",u),getDeviceSettingsContribution:u=>h("pipelineOrchestrator","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("pipelineOrchestrator","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",u)},pipelineRunner:{detachCamera:u=>h("pipelineRunner","detachCamera","mutation",u),getCameraMetrics:u=>h("pipelineRunner","getCameraMetrics","query",u),runDetailSubtree:u=>h("pipelineRunner","runDetailSubtree","mutation",u)},plateGallery:{listPlates:u=>h("plateGallery","listPlates","query",u),getPlateByTrack:u=>h("plateGallery","getPlateByTrack","query",u)},recording:{getAvailability:u=>h("recording","getAvailability","query",u),getDaysWithRecordings:u=>h("recording","getDaysWithRecordings","query",u),getPlaybackManifest:u=>h("recording","getPlaybackManifest","query",u),getDeviceConfig:u=>h("recording","getDeviceConfig","query",u),locateSegment:u=>h("recording","locateSegment","query",u),readSegmentBytes:u=>h("recording","readSegmentBytes","query",u),readGopBytes:u=>h("recording","readGopBytes","query",u),readWindowBytes:u=>h("recording","readWindowBytes","query",u),setDeviceConfig:u=>h("recording","setDeviceConfig","mutation",u),rescanStorage:u=>h("recording","rescanStorage","mutation",u),pruneFootage:u=>h("recording","pruneFootage","mutation",u),deleteFootprint:u=>h("recording","deleteFootprint","mutation",u),renderGif:u=>h("recording","renderGif","mutation",u),renderClip:u=>h("recording","renderClip","mutation",u),getStatus:u=>h("recording","getStatus","query",u),getDeviceSettingsContribution:u=>h("recording","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("recording","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("recording","applyDeviceSettingsPatch","mutation",u)},recordingExport:{listExports:u=>h("recordingExport","listExports","query",u)},streamBroker:{publishCameraStream:u=>h("streamBroker","publishCameraStream","mutation",u),retractCameraStream:u=>h("streamBroker","retractCameraStream","mutation",u),assignProfile:u=>h("streamBroker","assignProfile","mutation",u),unassignProfile:u=>h("streamBroker","unassignProfile","mutation",u),renderPreBufferClip:u=>h("streamBroker","renderPreBufferClip","mutation",u),produceEventMedia:u=>h("streamBroker","produceEventMedia","mutation",u),restartProfile:u=>h("streamBroker","restartProfile","mutation",u),getDeviceAudioMute:u=>h("streamBroker","getDeviceAudioMute","query",u),setDeviceAudioMute:u=>h("streamBroker","setDeviceAudioMute","mutation",u),getDeviceSettingsContribution:u=>h("streamBroker","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>h("streamBroker","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>h("streamBroker","applyDeviceSettingsPatch","mutation",u)}}}var s8=d({codec:O(["h264","h265","copy"]),profile:O(["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:O(["ultrafast","superfast","veryfast","faster","fast","medium"]).optional(),tune:O(["zerolatency","film","animation"]).optional()}),l8=tt([G("passthrough"),d({codec:O(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:l().int().positive().optional(),sampleRateHz:l().int().positive().optional(),channels:tt([G(1),G(2)]).optional()})]),TE=d({video:s8,audio:l8,inputArgs:M(o()).optional(),outputArgs:M(o()).optional()}),c8={video:{codec:"h264",profile:"baseline",level:"3.1",width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:"veryfast",tune:"zerolatency"}};({...c8.video});var u8=O(["singleton","device","widget"]),Qk=d({capName:o(),kind:u8,deviceId:l().optional(),reachable:A(),latencyMs:l(),error:o().optional()}),d8=d({addonId:o(),caps:M(Qk).readonly(),widgets:M(Qk).readonly()}),m8=d({nodeId:o(),addons:M(d8).readonly()});d({ok:A(),degraded:A(),checkedAt:o(),nodes:M(m8).readonly(),summary:d({total:l(),reachable:l(),unreachable:l()})});var p8=O(["running","done","failed","cancelled"]),f8=O(["adopted","already-adopted","failed","cancelled"]),h8=d({childNativeId:o(),outcome:f8,parentDeviceId:l().int().nonnegative().nullable(),accessoryCount:l().int().nonnegative(),error:o().nullable()}),g8=d({jobId:o(),addonId:o(),integrationId:o(),state:p8,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:M(h8).readonly(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),eb=O(["stream-broker","object-detection","privacy-mask","device-audio","broker-audio","audio-analysis","recording","notifications"]),v8=gt("kind",[d({kind:G("device-disabled")}),d({kind:G("wrapper-binding"),capName:o()}),d({kind:G("recording-config")}),d({kind:G("notification-mute")}),d({kind:G("camera-audio"),capName:o()}),d({kind:G("camera-mask"),capName:o()}),d({kind:G("broker-audio-mute")})]),y8=O(["no-provider","source-unreachable","not-configured"]),b8=d({id:eb,label:o(),costWhenOff:o(),available:A(),unavailableReason:y8.optional(),enabled:A(),authority:v8}),Vk=d({deviceId:l().int(),switches:M(b8).readonly(),fetchedAt:l()}),S8=O(["info","warn","error"]),NE=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:S8,perDevice:A()}),x8=d({channel:o().min(1),armedUntilMs:l(),deviceIds:M(l().int()).readonly().nullable()}),k8=O(["recording","events"]),w8=O(["prune","manual-delete","rescan","retention-run","relocate","orphan-audit"]),tb=O(["retention","quota","manual","operator","maintenance"]),OE=d({id:o(),at:l(),domain:k8,op:w8,reason:tb,deviceId:l().nullable(),nodeId:o(),itemsAffected:l(),bytesReclaimed:l(),detail:o().nullable(),actor:o()}),jE=d({deviceId:l().optional(),limit:l().int().min(1).max(1e3).optional()}),PE=d({id:o(),name:o(),category:o().optional(),description:o().optional(),icon:o().optional()}),M8=["person","vehicle","animal","package"],C8=["person","vehicle","animal"],DE=d({mapping:X(o(),O(M8)),preserveOriginal:A()}),A8=l().int().min(0).max(6),Gk=/^([01]\d|2[0-3]):[0-5]\d$/,E8=O(["off","events","continuous"]),R8=O(C8),Zk=e=>new Set(e).size===e.length,_8=d({motion:A().optional(),audioThresholdDbfs:l().optional(),objectClasses:M(R8).min(1).refine(Zk,{message:"objectClasses must not repeat a class"}).optional(),sensorDeviceIds:M(l().int().positive()).min(1).max(16).refine(Zk,{message:"sensorDeviceIds must not repeat a device"}).optional()}),I8=O(["continuous","events"]),T8=_8,N8=d({days:M(A8),start:o().regex(Gk),end:o().regex(Gk),mode:I8,triggers:T8.optional(),preBufferSec:l().min(0).optional(),postBufferSec:l().min(0).optional()}),O8=d({maxAgeDays:l().min(0).optional(),maxSizeGb:l().min(0).optional()}),Dh=d({enabled:A(),mode:E8.optional(),profiles:M(Mn).optional(),segmentSeconds:l().int().positive().optional(),bands:M(N8).default([]),retention:O8.optional()}).strict(),zE=O(["queued","running","done","failed","cancelled"]),wc=d({jobId:o(),state:zE,fromLocationId:o(),toLocationId:o(),deviceId:l().nullable(),entities:M(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()}),LE=O(["recordings","recordingsLow"]),qE=d({fromLocationId:o(),toLocationId:o(),entities:M(O(["segments"])).optional(),footageClass:LE.optional(),deviceId:l().int().optional(),profiles:M(o()).optional(),throttleMbps:l().min(1).max(1e3).optional(),sinceMs:l().int().optional()}),wr=d({leaseId:o().min(1)}),j8=qE.extend({leaseId:o().min(1)}),BE=O(["move","seal","gallery"]),UE=d({toLocationId:o(),fromLocationId:o().optional(),throttleMbps:l().min(1).max(1e3).optional(),mode:BE.optional()}),Kk=d({present:A(),rows:l().int().nonnegative().nullable()}),P8=d({media:Kk,retrainFrames:Kk,anyPresent:A(),total:l().int().nonnegative().nullable()}).nullable(),D8=UE.extend({leaseId:o().min(1)}),Hc=O(["recordings","recordingsLow","eventMedia","backups","galleryMedia"]),nb=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"}),ab=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(),ib=O(["blocking","nonBlocking"]),Wk=d({destinations:nb,sources:ab,throttleMbps:l().min(1).max(1e3).optional(),mode:ib.optional()}),z8=O(["planning","sealing","pausing","moving","draining","verifying","repointing","refreshing","resuming","done","failed","cancelled"]),L8=O(["pipeline","recorder","analytics"]),q8=d({filesMoved:l().int().nonnegative(),filesTotal:l().int().nonnegative().nullable(),bytesMoved:l().int().nonnegative(),rowsReconciled:l().int().nonnegative().optional(),startedAt:l(),observedAt:l()}),B8=d({storageClass:Hc,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional(),moverJobId:o().nullable(),state:zE.nullable(),error:o().nullable(),progress:q8.nullable()}),Yk=d({jobId:o(),phase:z8,mode:ib,destinations:nb,sources:ab,throttleMbps:l(),moves:M(B8),pauseLeaseId:o().nullable(),pausedParticipants:M(L8),repointed:A(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),U8=O(["sharesDeviceWithSource","deviceIdentityUnknown","unstampedEventMediaRows","blockingOnly","noMover"]),F8=d({code:U8,storageClass:Hc,message:o()}),H8=d({destinations:nb,sources:ab,mode:ib,moves:M(d({storageClass:Hc,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional()})),findings:M(F8)}),$8=O(["footage","media"]),Q8=d({lane:$8,job:wc,migrationJobId:o().nullable(),observedAt:l()}),V8=d({storageClass:Hc,fromLocationId:o(),toLocationId:o(),items:l().int().nonnegative().nullable(),bytes:l().int().nonnegative().nullable()}),G8=d({classes:M(Hc).min(1),throttleMbps:l().min(1).max(1e3).optional()}),Z8=d({fromLocationId:o().min(1),footageClass:LE.optional()}),K8=d({segments:l().int().nonnegative(),bytes:l().int().nonnegative()}).nullable(),W8=d({locationId:o().min(1),apply:A().optional(),deviceId:l().int().positive().optional(),profiles:M(o().min(1)).optional()}),Y8=O(["location-unknown","source-writable","no-ledger","archive-unreadable","anchor-absent","anchor-unreadable","anchor-moved"]);O(["live-tail","listing-error","path-mismatch","durable-refused"]);var X8=d({"live-tail":l().int().nonnegative(),"listing-error":l().int().nonnegative(),"path-mismatch":l().int().nonnegative(),"durable-refused":l().int().nonnegative()}),J8=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()}),eq=d({locationId:o(),applied:A(),refused:Y8.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:M(o()).readonly(),hoursSkipped:l().int().nonnegative(),skippedByReason:X8,bounded:A(),byDevice:M(J8).readonly()}),tq=d({rows:l().int().nonnegative()}).nullable(),nq=d({toLocationId:o().min(1),fromLocationId:o().optional(),mode:BE.optional()}),aq=O(["orphans","debug-media","ghost-ledger","done","failed","cancelled"]),iq=d({includeDebugMedia:A().optional()}),rq=d({jobId:o(),phase:aq,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()}),oq=d({jobId:o().optional()}),vv=o().regex(/^[a-z][a-zA-Z0-9-]*$/),ga=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:X(o(),te()),nodeId:o().optional(),isDefault:A().default(!1),isSystem:A().default(!1),enabled:A().optional(),capacity:d({totalBytes:l(),availableBytes:l()}).nullable().optional(),createdAt:l(),updatedAt:l()}),Ii=tt([vv,o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),sq=O(["local-path","cap-mediated"]),lq=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:O(["single","multi"]),access:sq.optional(),defaultsTo:o().optional(),defaultRoot:O(["data","media","backup"]).optional()}),cq=d({inputFps:l(),outputFps:l(),avgDecodeTimeMs:l(),droppedFrames:l(),lagMs:l().optional(),effectiveFps:l().optional(),adaptiveFps:l().optional()}),Xk=d({codec:o(),maxFps:l().default(0),outputFormat:O(["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:O(["callback","shm"]).default("callback"),debug:A().optional()}),ap=["onnx","coreml","openvino","tflite","pt","gguf"],gs=d({url:o(),sizeMB:l(),isDirectory:A().optional(),files:M(o()).readonly().optional(),runtimes:M(O(["node","python"])).readonly().optional()}),uq=d({url:o(),filename:o(),sizeMB:l()}),dq=d({onnx:gs.optional(),coreml:gs.optional(),openvino:gs.optional(),tflite:gs.optional(),pt:gs.optional(),gguf:gs.optional()}),FE=d({family:o(),tier:o(),precision:O(["fp32","int8"]).optional(),optimization:O(["standard","fast"]).optional(),resolution:l().int().positive().optional()}),mq=["camstack","frigate","scrypted","custom"],HE=O(mq),rb=d({id:o(),name:o(),description:o(),formats:dq,inputSize:d({width:l(),height:l()}),inputChannels:l().int().positive().optional(),labels:M(PE).readonly(),inputLayout:O(["nchw","nhwc"]).optional(),inputNormalization:O(["zero-one","imagenet","none"]).optional(),outputProbabilities:A().optional(),preprocessMode:O(["letterbox","resize"]).optional(),postprocessor:Ha().optional(),faceAlignment:A().optional(),extraFiles:M(uq).readonly().optional(),legacy:A().optional(),metrics:d({map50:l().optional(),p95LatencyMs:X(o(),l()).optional()}).optional(),license:o().optional(),group:FE.optional(),provider:HE.optional(),classMap:DE.optional()}),pq=gt("format",[d({format:G("openvino"),precisions:M(O(["fp16","int8"])).min(1).readonly()}),d({format:G("coreml")})]),fq=d({id:o().regex(/^[a-zA-Z0-9._-]+$/),name:o(),labels:M(PE).readonly(),inputSize:d({width:l(),height:l()}),inputLayout:O(["nchw","nhwc"]).optional(),inputNormalization:O(["zero-one","imagenet","none"]).optional(),preprocessMode:O(["letterbox","resize"]).optional(),outputFormat:O(["yolo","ssd","embedding","classification","ocr","segmentation"]),faceAlignment:A().optional(),classMap:DE.optional()}),hq=d({format:O(ap),precision:O(["fp16","int8"]).optional(),sizeMB:l(),validated:A(),files:M(o()).readonly()}),gq=d({entry:rb,artifacts:M(hq).readonly()}),$n=class extends Error{position;constructor(e,t){super(e),this.name="ExpressionParseError",this.position=t}},uo=class extends Error{constructor(e){super(e),this.name="ExpressionEvalError"}};function Hn(e,t,n){if(typeof e!="number"||!Number.isFinite(e))throw new uo(`${t}: argument ${n+1} must be a finite number`);return e}function Jk(e,t,n){if(typeof e!="string")throw new uo(`${t}: argument ${n+1} must be a string`);return e}function fa(e,t){if(!Number.isFinite(e))throw new uo(`${t}: produced a non-finite result`);return e}function kd(e,t){return e.map((n,a)=>Hn(n,t,a))}var Yl=Number.POSITIVE_INFINITY,$E={min:{minArgs:1,maxArgs:Yl,apply:e=>fa(Math.min(...kd(e,"min")),"min")},max:{minArgs:1,maxArgs:Yl,apply:e=>fa(Math.max(...kd(e,"max")),"max")},abs:{minArgs:1,maxArgs:1,apply:e=>fa(Math.abs(Hn(e[0],"abs",0)),"abs")},floor:{minArgs:1,maxArgs:1,apply:e=>fa(Math.floor(Hn(e[0],"floor",0)),"floor")},ceil:{minArgs:1,maxArgs:1,apply:e=>fa(Math.ceil(Hn(e[0],"ceil",0)),"ceil")},sqrt:{minArgs:1,maxArgs:1,apply:e=>fa(Math.sqrt(Hn(e[0],"sqrt",0)),"sqrt")},round:{minArgs:1,maxArgs:2,apply:e=>{const t=Hn(e[0],"round",0),n=e.length>1?Math.trunc(Hn(e[1],"round",1)):0;if(n<0||n>100)throw new uo("round: digits must be between 0 and 100");const a=10**n;return fa(Math.round(t*a)/a,"round")}},pow:{minArgs:2,maxArgs:2,apply:e=>fa(Hn(e[0],"pow",0)**Hn(e[1],"pow",1),"pow")},clamp:{minArgs:3,maxArgs:3,apply:e=>{const t=Hn(e[0],"clamp",0),n=Hn(e[1],"clamp",1),a=Hn(e[2],"clamp",2);if(n>a)throw new uo("clamp: lower bound is greater than upper bound");return fa(Math.min(a,Math.max(n,t)),"clamp")}},avg:{minArgs:1,maxArgs:Yl,apply:e=>{const t=kd(e,"avg");return fa(t.reduce((n,a)=>n+a,0)/t.length,"avg")}},sum:{minArgs:1,maxArgs:Yl,apply:e=>fa(kd(e,"sum").reduce((t,n)=>t+n,0),"sum")},coalesce:{minArgs:1,maxArgs:Yl,apply:e=>{for(const t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>fa(Hn(e[0],"age",0)-Hn(e[1],"age",1),"age")},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{const n=Hn(e[0],"convert",0),a=Jk(e[1],"convert",1).trim(),s=Jk(e[2],"convert",2).trim();if(t.convert){const m=t.convert(n,a,s);if(m===null)throw new uo(`convert: cannot convert '${a}' to '${s}'`);return fa(m,"convert")}if(a===s)return n;throw new uo("convert: unit conversion table not installed")}}};Object.freeze(Object.assign(Object.create(null),$E));var QE=new Set(Object.keys($E)),ob=2048,sb=/^[A-Za-z_][A-Za-z0-9_]*$/,vq=new Set(["now","true","false","null"]),yq=new Set(["true","false","null"]);function uc(e){return e>="0"&&e<="9"}function VE(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"}function bq(e){return VE(e)||uc(e)}function Sq(e){return e===" "||e===" "||e===`
74
- `||e==="\r"||e==="\f"||e==="\v"}function xq(e){if(e.length>2048)throw new $n(`expression too long (${e.length} > ${ob} chars)`,0);const t=[];let n=0;const a=e.length;for(;n<a;){const s=e[n];if(Sq(s)){n+=1;continue}if(uc(s)){const f=n;for(;n<a&&uc(e[n]);)n+=1;if(n<a&&e[n]==="."){if(n+1>=a||!uc(e[n+1]))throw new $n("malformed number: decimal point needs a digit",n);for(n+=1;n<a&&uc(e[n]);)n+=1}const p=e.slice(f,n),h=Number(p);if(!Number.isFinite(h))throw new $n(`malformed number: '${p}'`,f);t.push({type:"number",value:h,pos:f});continue}if(s==="'"||s==='"'){const f=s,p=n;n+=1;let h="",u=!1;for(;n<a;){const S=e[n];if(S==="\\"){const w=n+1<a?e[n+1]:"";if(w==="\\"||w==="'"||w==='"'){h+=w,n+=2;continue}throw new $n(`invalid string escape: '\\${w}'`,n)}if(S===f){u=!0,n+=1;break}h+=S,n+=1}if(!u)throw new $n("unterminated string literal",p);t.push({type:"string",value:h,pos:p});continue}if(VE(s)){const f=n;for(;n<a&&bq(e[n]);)n+=1;const p=e.slice(f,n);yq.has(p)?t.push({type:"keyword",keyword:kq(p),pos:f}):t.push({type:"identifier",name:p,pos:f});continue}const m=n+1<a?e.slice(n,n+2):"";if(m==="<="||m===">="||m==="=="||m==="!="||m==="&&"||m==="||"){t.push({type:"punct",punct:m,pos:n}),n+=2;continue}if(wq(s)){t.push({type:"punct",punct:s,pos:n}),n+=1;continue}throw new $n(`unexpected character '${s}'`,n)}return t.push({type:"eof",pos:a}),t}function kq(e){return e==="true"?"true":e==="false"?"false":"null"}function wq(e){return e==="("||e===")"||e===","||e==="?"||e===":"||e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="!"||e==="<"||e===">"}var Mq={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function Cq(e){return e==="&&"||e==="||"}function Aq(e){return e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="=="||e==="!="||e==="<"||e==="<="||e===">"||e===">="}var Eq=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 $n("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 $n(`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 $n("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=Mq[n.punct];if(a===void 0||a<e)break;const s=n.punct;this.pos+=1;const m=this.parseBinary(a+1);if(this.countNode(),Cq(s))t={kind:"logical",op:s,left:t,right:m};else if(Aq(s))t={kind:"binary",op:s,left:t,right:m};else throw new $n(`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 $n(`unexpected token '${e.punct}'`,e.pos);case"eof":throw new $n("unexpected end of expression",e.pos)}}parseCall(e,t){if(!QE.has(e))throw new $n(`unknown function '${e}'`,t);this.expectPunct("(");const n=[];if(!this.matchPunct(")"))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new $n(`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 Rq(e){return new Eq(xq(e)).parse()}var io=new Map;function _q(e){const t=io.get(e);if(t!==void 0)return io.delete(e),io.set(e,t),t;let n;try{n={ok:!0,parsed:Rq(e)}}catch(a){n={ok:!1,error:a instanceof $n?a.message:String(a)}}if(io.set(e,n),io.size>256){const a=io.keys().next().value;a!==void 0&&io.delete(a)}return n}function Iq(e){return _q(e)}function GE(e){const t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(const s of t){if(!sb.test(s))return`invalid binding name '${s}'`;if(vq.has(s))return`binding name '${s}' is reserved`;if(QE.has(s))return`binding name '${s}' shadows a builtin function`}const n=Iq(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 Tq=d({kind:G("field").optional(),sourceKey:o(),cap:o(),fieldPath:o()}),Nq=d({kind:G("literal"),value:tt([o(),l(),A(),xE()])}),Oq=d({kind:G("global"),sourceStableId:o(),cap:o(),fieldPath:o()}),ZE=tt([Tq,Nq,Oq]);d({expr:o().min(1).max(ob),bindings:X(o().regex(sb),ZE)}).superRefine((e,t)=>{const n=GE(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})});var jq=O(["eq","ne","gt","gte","lt","lte","contains","in"]),Pq=d({kind:G("condition"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),operator:jq,value:tt([o(),l(),A(),M(tt([o(),l()]))])}),Dq=d({kind:G("expression"),expr:o().min(1).max(ob),bindings:X(o().regex(sb),ZE)}).superRefine((e,t)=>{const n=GE(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})}),Kd=Fc(()=>gt("kind",[d({kind:G("all"),children:M(Kd)}),d({kind:G("any"),children:M(Kd)}),d({kind:G("not"),child:Kd}),Pq,Dq])),zq=gt("kind",[d({kind:G("device-state"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),becomes:tt([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:G("device-event"),category:o().min(1),deviceId:l().int().nonnegative().optional()}),d({kind:G("schedule"),cron:o().min(1).max(120)}),d({kind:G("manual")})]),Lq=gt("kind",[d({kind:G("wait"),seconds:l().min(0).max(300)}),d({kind:G("cap"),deviceId:tt([l().int(),d({$var:o().min(1)})]),cap:o().min(1),method:o().min(1),args:X(o(),te()).optional()}),d({kind:G("code"),code:o().min(1).max(2e4)})]);d({triggers:M(zq),conditions:Kd.optional(),actions:M(Lq)});var qq=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),Bq=d({addonId:o(),page:qq,bundleUrl:o()}),Uq={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:b(N(),M(Bq).readonly())}},Fq=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),Hq={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:b(N(),M(Fq).readonly(),{auth:"admin"})}},$q=d({method:O(["GET","POST","PUT","DELETE","PATCH"]),path:o(),access:O(["public","authenticated","admin"]).optional(),description:o().optional()}),Qq=d({method:o(),path:o(),params:X(o(),o()),query:X(o(),o()),body:te(),headers:X(o(),o()),user:d({id:o(),username:o(),isAdmin:A()}).optional(),scopedToken:te().optional()}),Vq=d({status:l().int(),headers:X(o(),o()),redirectUrl:o().nullable(),body:te().optional(),contentType:o().optional()}),Gq={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:b(N(),M($q)),invoke:b(Qq,Vq,{kind:"mutation"})},mount:{kind:"skip"}},Zq=d({id:o(),label:o(),icon:o(),order:l().optional()}),Kq=d({id:o(),title:o(),description:o().optional(),style:O(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([G(1),G(2),G(3),G(4)]).optional(),tab:o().optional(),location:O(["settings","top-tab"]).optional(),order:l().optional(),fields:M(kE())}),mo=d({tabs:M(Zq).optional(),sections:M(Kq)}),ew=X(o(),te()),tw=d({success:G(!0)}),Wq={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),overlay:X(o(),te()).optional(),cap:o().optional()}),mo.nullable()),updateGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),patch:ew}),tw,{kind:"mutation",auth:"admin"}),getIntegrationSettings:b(d({addonId:o(),nodeId:o().optional()}),mo.nullable()),getDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional()}),mo.nullable()),updateDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional(),patch:ew}),tw,{kind:"mutation",auth:"admin"})}},Yq=O(["device-tab","dashboard","integration-detail"]),nw=O(["xs","sm","md","lg","xl"]),KE=d({remoteName:o(),exposedModule:o(),componentKey:o().optional()}),WE=d({tab:o(),subTab:o().optional(),label:o(),order:l().optional(),kind:G("remote"),remote:KE,stableId:o(),description:o().optional(),icon:o().optional(),bundle:o(),hosts:M(Yq).readonly(),requires:d({deviceContext:A().default(!1),integrationContext:A().default(!1)}),preAuth:A().optional().default(!1),defaultSize:nw.default("md"),allowedSizes:M(nw).readonly().default(["sm","md","lg"]),defaultColumns:l().int().min(1).max(12).default(6),defaultRows:l().int().min(1).max(12).default(1)}),Xq={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:b(N(),M(WE).readonly(),{auth:"admin"})}},Jq=WE.extend({addonId:o(),bundleUrl:o()}),e7={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:b(N(),M(Jq).readonly())}},t7=O(["info","success","warning","error"]),n7=O(["active","in-progress","completed","failed","dismissed"]),a7=d({type:o(),id:o()}),zh=d({id:o(),category:o(),severity:t7,title:o(),message:o(),status:n7,progress:l().optional(),read:A(),createdAt:l(),updatedAt:l(),source:a7.optional(),metadata:X(o(),te()).optional()}),i7={name:"alerts",scope:"system",mode:"singleton",methods:{emit:b(zh,N(),{kind:"mutation"}),update:b(d({alertId:o(),patch:zh.partial()}),N(),{kind:"mutation"}),list:b(d({unreadOnly:A().optional(),limit:l().optional()}).optional(),M(zh).readonly()),getUnreadCount:b(N(),l()),markRead:b(d({alertId:o()}),N(),{kind:"mutation"}),markAllRead:b(N(),N(),{kind:"mutation"}),dismiss:b(d({alertId:o()}),N(),{kind:"mutation"})}},r7={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:b(d({deviceId:l()}),Ha())},events:{onAudioLevel:go(d({deviceId:l(),rms:l(),dbfs:l()}))}},o7=O(["jpeg","rgb","bgr","yuv420","gray"]),yv=d({data:Ha(),format:o7,width:l(),height:l(),timestamp:l()}),Fi=d({x:l(),y:l(),w:l(),h:l()});d({class:o(),originalClass:o(),score:l(),bbox:Fi});var aw=d({data:Ut(Uint8Array),sampleRate:l(),channels:l(),timestamp:l(),deviceId:l().optional()}),s7=d({rms:l(),dbfs:l()}),bv=d({className:o(),originalClass:o().optional(),score:l()}),l7=d({level:s7,classification:d({labels:M(bv).readonly(),inferenceMs:l()}).optional(),timestamp:l()}),c7=d({minConfidence:l().min(0).max(1).default(.3),allowedClasses:M(o()).default([])}),u7=d({labels:M(bv).readonly(),rawLabels:M(bv).readonly().optional(),inferenceMs:l()}),d7={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:b(d({chunk:aw,settings:c7}),l7.nullable(),{kind:"mutation"}),classify:b(aw,u7,{timeoutMs:3e4}),isReady:b(N(),A()),dispose:b(N(),N(),{kind:"mutation"}),reprobeAudioEngine:b(N(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},ip=O(["f32le","s16le"]),m7=d({codec:o(),canDecode:A(),canEncode:A(),label:o().optional()}),p7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),extraData:Ut(Uint8Array).optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),targetFormat:ip.optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),f7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),sourceFormat:ip.optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),bitrateKbps:l().int().positive().optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),h7=d({data:Ut(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),format:ip,pts:l()}),iw=d({data:Ut(Uint8Array),codec:o(),pts:l(),frameComplete:A()}),g7=d({sessionId:o(),kind:O(["decode","encode"]),codec:o(),sourceSampleRate:l(),sourceChannels:l(),targetSampleRate:l(),targetChannels:l(),format:ip,tag:o().optional(),createdAtMs:l(),lastActivityMs:l(),framesIn:l(),framesOut:l()}),v7={name:"audio-codec",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{listSupportedCodecs:b(N(),M(m7).readonly()),canHandle:b(d({codec:o(),kind:O(["decode","encode"])}),A()),createDecodeSession:b(p7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),createEncodeSession:b(f7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),closeSession:b(d({sessionId:o(),nodeId:o().optional()}),N(),{kind:"mutation"}),pushEncodedFrame:b(d({sessionId:o(),nodeId:o().optional(),data:Ut(Uint8Array),pts:l().optional()}),N(),{kind:"mutation"}),pullPcm:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),M(h7)),pushPcm:b(d({sessionId:o(),nodeId:o().optional(),data:Ut(Uint8Array),pts:l().optional()}),N(),{kind:"mutation"}),pullEncoded:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),M(iw)),flushEncode:b(d({sessionId:o(),nodeId:o().optional()}),M(iw),{kind:"mutation"}),listActiveSessions:b(N(),M(g7).readonly())}},Lh=d({userId:o(),username:o(),email:o().optional(),displayName:o().optional(),isAdmin:A().default(!1)}),y7={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:b(d({username:o(),password:o()}),Lh.nullable(),{kind:"mutation"}),getLoginUrl:b(d({state:o()}),o()),handleCallback:b(X(o(),o()),Lh,{kind:"mutation"}),validateToken:b(d({token:o()}),Lh.nullable())},mount:{kind:"skip"}},b7=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(),lastRunAt:l().optional()}),S7=d({id:o(),filename:o(),createdAt:l(),sizeBytes:l(),label:o().optional(),locations:M(o()).readonly()}),rw=d({id:o(),destinationId:o().optional(),label:o().optional(),createdAt:l(),sizeBytes:l(),locations:M(o()).optional()}),x7=d({path:o(),kind:O(["file","dir","symlink"]),sizeBytes:l(),mtime:l()}),k7=d({archiveVersion:G(1),createdAt:l(),dataDir:o(),locations:M(o()),entries:M(x7),totalBytes:l(),totalFiles:l()}),w7=d({name:o(),sizeBytes:l(),fileCount:l(),present:A()}),ow=d({id:o(),label:o(),cron:o(),enabled:A(),locationIds:M(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:M(o()).readonly().optional(),lastRunAt:l().optional(),nextRunAt:l().optional()}),M7={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:b(N(),M(b7).readonly(),{auth:"admin"}),trigger:b(d({destinations:M(o()).optional(),locations:M(o()).optional(),label:o().optional(),retentionCount:l().int().min(1).max(1e3).optional()}).optional(),M(rw).readonly(),{kind:"mutation",auth:"admin"}),list:b(N(),M(rw).readonly(),{auth:"admin"}),listLocations:b(N(),M(w7).readonly(),{auth:"admin"}),getEntries:b(d({destinationId:o(),backupId:o()}),k7.nullable(),{auth:"admin"}),restore:b(d({destinationId:o(),backupId:o(),locations:M(o()).optional()}),N(),{kind:"mutation",auth:"admin"}),delete:b(d({destinationId:o(),backupId:o()}),N(),{kind:"mutation",auth:"admin"}),listArchives:b(d({destinationId:o()}),M(S7).readonly(),{auth:"admin"}),upsertDestinationPolicy:b(d({locationId:o(),enabled:A(),retentionCount:l().int().min(1).max(1e3),label:o().optional(),cron:o().optional()}),N(),{kind:"mutation",auth:"admin"}),previewSchedule:b(d({cron:o(),count:l().int().min(1).max(20).optional()}),d({ok:A(),error:o().optional(),nextRuns:M(l()).readonly()})),listSchedules:b(N(),M(ow).readonly(),{auth:"admin"}),upsertSchedule:b(d({id:o().optional(),label:o(),cron:o(),enabled:A(),locationIds:M(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:M(o()).readonly().optional()}),ow,{kind:"mutation",auth:"admin"}),deleteSchedule:b(d({id:o()}),N(),{kind:"mutation",auth:"admin"})}},C7=O(["connected","disconnected","connecting","auth-failed","unreachable","error"]),sw=d({id:o(),addonId:o(),name:o(),kind:o(),status:C7,info:X(o(),te()),lastCheckedAt:l().nullable(),error:o().nullable()}),lw=d({brokerCount:l().int().nonnegative(),connectedCount:l().int().nonnegative()}),A7=d({addonId:o(),kinds:M(d({kind:o(),label:o()}))}),E7=d({kind:o().optional()}),wd=d({id:o()}),R7=d({kind:o().min(1),name:o().min(1),id:o().min(1).optional(),settings:X(o(),te())}),_7=d({id:o()}),I7=d({id:o()}),T7=gt("ok",[d({ok:G(!0),latencyMs:l().nonnegative()}),d({ok:G(!1),error:o()})]),Wd=X(o(),te()),N7=d({kind:o()}),O7=d({kind:o(),settings:Wd}),j7=gt("ok",[d({ok:G(!0),latencyMs:l().nonnegative().optional()}).strict(),d({ok:G(!1),error:o()})]),P7=te().nullable(),D7=d({brokerId:o(),target:X(o(),te()),payload:te().optional()}),z7=d({brokerId:o(),filter:X(o(),te())}),L7=d({subscriptionId:o()}),q7=d({brokerId:o(),subscriptionId:o()}),B7=d({brokerId:o(),key:o()}),U7={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:lw,kind:"poll"},methods:{list:b(E7,M(sw)),get:b(wd,sw.nullable()),listProviders:b(N(),M(A7),{auth:"admin"}),add:b(R7,_7,{kind:"mutation",auth:"admin"}),remove:b(I7,N(),{kind:"mutation",auth:"admin"}),testConnection:b(wd,T7,{kind:"mutation",auth:"admin"}),getSettings:b(wd,Wd.nullable(),{auth:"admin"}),setSettings:b(d({id:o(),settings:Wd}),N(),{kind:"mutation",auth:"admin"}),getBrokerConfig:b(wd,Wd.nullable(),{auth:"admin"}),getSettingsSchema:b(N7,P7,{auth:"admin"}),testSettings:b(O7,j7,{kind:"mutation",auth:"admin"}),publish:b(D7,te(),{kind:"mutation",auth:"admin"}),subscribe:b(z7,L7,{kind:"mutation",auth:"admin"}),unsubscribe:b(q7,N(),{kind:"mutation",auth:"admin"}),getState:b(B7,te().nullable()),getStatus:b(N(),lw)}},F7={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{}},H7=O(["webrtc","hls","mjpeg","rtsp"]),YE=O(["mp4","gif"]),$7=d({kind:YE,handle:o(),nodeId:o(),mime:o(),bytes:l().int(),width:l().int(),height:l().int()}),Q7=d({fromTs:l(),toTs:l(),packets:l().int()}),V7=d({media:M($7).readonly(),coverage:Q7,profile:Mn,video:O(["copy","encode"])}),Sv=d({brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:d({width:l().int().positive(),height:l().int().positive()}).optional()}),G7=d({sessionId:o(),remoteAddr:o(),userAgent:o().nullish(),playing:A(),muted:A(),connectedAt:l(),lastRtpAt:l(),bytesSent:l()}),Z7=d({tag:o(),subscribedAt:l(),maxFps:l(),framesDelivered:l(),framesDropped:l()}),K7=d({tag:o(),subscribedAt:l(),chunksDelivered:l()}),W7=O(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),xv=d({kind:W7,label:o().optional(),media:O(["audio","video","both"]).optional(),targetCodec:o().optional(),transport:O(["passthrough","repacketize","transcode"]).optional(),remoteAddr:o().optional(),userAgent:o().optional(),userId:o().optional(),sessionId:o().optional(),extra:X(o(),o()).optional()}).readonly(),Y7=d({id:o(),channel:O(["annexb","rtp"]),attribution:xv,subscribedAt:l(),packetsDelivered:l()}),X7=d({rtsp:M(G7).readonly(),decoded:M(Z7).readonly(),audio:M(K7).readonly(),encoded:M(Y7).readonly(),pipeClients:l(),encodedSubscribers:l()});O(["reconnecting","sleeping","offline","disabled","waking"]);var J7=O(["h264","h265","copy"]),e9=O(["aac","opus","pcmu","copy","none"]),t9=d({deviceId:l().int().nonnegative(),video:J7,audio:e9.optional(),profile:Mn.optional(),targetResolution:d({width:l().int().positive(),height:l().int().positive()}).optional(),outputArgs:M(o()).optional(),audioEgress:A().optional(),hostname:o().optional(),tag:o().optional()}),n9=d({url:o(),videoCodec:O(["H264","H265"]),audioCodec:o(),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),pipelineKey:o()}),a9=TE.omit({inputArgs:!0,outputArgs:!0}),i9=O(["tight","relaxed"]),r9=d({deviceId:l().int().nonnegative(),source:gt("kind",[d({kind:G("profile"),profile:Mn}),d({kind:G("cam-stream"),camStreamId:o().min(1)})]),encode:a9,rateControl:i9.optional(),bitstreamFilter:O(["dump_extra","h264_mp4toannexb","hevc_mp4toannexb"]).optional(),publishLocally:A().optional(),pixelFormat:O(["yuv420p","nv12"]).optional(),decodeHwAccel:O(["auto","none","videotoolbox","vaapi","qsv","cuda"]).optional(),hostname:o().optional(),tag:o().optional()}),o9=d({url:o(),pipelineKey:o(),videoCodec:O(["H264","H265"]),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),decodeHwAccel:o().nullable(),camStreamId:o().nullable()}),s9={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{publishCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1),kind:Jy,url:o().optional(),codec:o().optional(),resolution:Js.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:X(o(),te()).optional(),sourceCamStreamId:o().min(1).optional(),encodeProfile:TE.optional()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1)}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:b(d({deviceId:l().int().nonnegative(),profile:Mn,camStreamId:o().min(1)}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:b(d({deviceId:l().int().nonnegative(),profile:Mn}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),renderPreBufferClip:b(d({deviceId:l(),profile:Mn.optional(),aroundMs:l(),preRollSec:l().min(0).max(20).default(3),postRollSec:l().min(0).max(20).default(5),format:O(["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:Mn,durationMs:l()}),{kind:"mutation",auth:"admin"}),produceEventMedia:b(d({deviceId:l(),profile:Mn.optional(),aroundMs:l(),preSeconds:l().min(0).max(20).default(4),postSeconds:l().min(0).max(20).default(6),kinds:M(YE).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)}),V7,{kind:"mutation",auth:"admin"}),fetchEventMedia:b(d({handle:o()}),d({base64:o(),mime:o(),bytes:l().int()}).nullable(),{kind:"mutation",auth:"admin"}),listAllCameraStreams:b(N(),M(hv).readonly()),listAllProfileSlots:b(N(),M(gv).readonly()),getBrokerStats:b(d({brokerId:o()}),$L),probeStream:b(d({brokerId:o()}),d({probed:A(),summary:o()}),{kind:"mutation",auth:"admin"}),listClients:b(d({brokerId:o()}),X7),killClient:b(d({brokerId:o(),channel:O(["rtsp","decoded","audio"]),handle:o()}),d({killed:A()}),{kind:"mutation",auth:"admin"}),restartProfile:b(d({deviceId:l().int().nonnegative(),profile:Mn}),d({success:A()}),{kind:"mutation",auth:"admin"}),getStreamUrl:b(d({streamId:o(),format:H7}),d({url:o()})),getStreamWithCodec:b(t9,n9,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),acquireEgressTranscode:b(r9,o9,{kind:"mutation",auth:"admin"}),releaseEgressTranscode:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:b(UL,FL,{kind:"mutation"}),pullAudioChunks:b(d({subscriptionId:o(),maxCount:l().int().positive().default(8)}),M(BL).readonly()),unsubscribeAudioChunks:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),subscribeFrames:b(LL,qL,{kind:"mutation"}),pullFrameHandles:b(d({subscriptionId:o(),maxCount:l().int().positive().default(4)}),M(Ar).readonly()),unsubscribeFrames:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),setPreBufferDuration:b(d({brokerId:o(),seconds:l().min(0).max(30)}),N(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:b(d({brokerId:o()}),d({configuredSec:l(),bufferedMs:l(),packetCount:l()})),getRtspPort:b(N(),l()),getAllRtspEntries:b(d({hostname:o().optional()}),M(Sv).readonly()),getRtspEntry:b(d({brokerId:o(),hostname:o().optional()}),Sv.nullable()),regenerateRtspToken:b(d({brokerId:o()}),o().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:b(d({brokerId:o(),enabled:A()}),N(),{kind:"mutation",auth:"admin"}),isRtspEnabled:b(d({brokerId:o()}),A()),getDeviceAudioMute:b(d({deviceId:l().int()}),d({muted:A(),appliedBrokers:l().int().nonnegative()})),setDeviceAudioMute:b(d({deviceId:l().int(),muted:A()}),d({muted:A(),appliedBrokers:l().int().nonnegative()}),{kind:"mutation",auth:"admin"})},events:{onCamStreamDemand:go(d({deviceId:l().int().nonnegative(),camStreamId:o(),profile:Mn})),onCamStreamIdle:go(d({deviceId:l().int().nonnegative(),camStreamId:o()})),onRequestStreamSourceRefresh:go(d({deviceId:l().int().nonnegative(),camStreamId:o(),brokerId:o()}))}},cw=O(["h264","h265","hevc","av1","mjpeg","vp8","vp9"]),l9=d({acceptCodecs:M(cw).readonly().optional(),minHeight:l().int().positive().optional(),minWidth:l().int().positive().optional(),excludeDerived:A().optional(),requireSiblingCodec:M(cw).readonly().optional()}).readonly(),c9=d({preferredProviders:M(o()).readonly().optional(),resolutionPreference:O(["highest","lowest"]).optional()}).readonly(),u9=d({camStreamId:o(),codec:o().optional(),resolution:Js.optional(),reason:o()}),d9={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],methods:{getCameraStreams:b(d({deviceId:l().int().nonnegative()}),M(hv).readonly()),getBrokerStreams:b(d({deviceId:l().int().nonnegative()}),M(gv).readonly()),getRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),M(Sv).readonly()),getProfileRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),M(QL).readonly()),pickStream:b(d({deviceId:l().int().nonnegative(),requirements:l9,preferences:c9.optional()}),u9.nullable())},events:{onCamStreamsChanged:go(d({deviceId:l().int().nonnegative(),camStreams:M(hv).readonly()})),onProfileSlotsChanged:go(d({deviceId:l().int().nonnegative(),profileSlots:M(gv).readonly()}))},runtimeState:d({online:A(),slotStatuses:d({high:Zd.optional(),mid:Zd.optional(),low:Zd.optional()}),slotErrors:d({high:o().optional(),mid:o().optional(),low:o().optional()}),lastChangedAt:l()}),durability:"session"},m9=tt([G("hub"),o().min(1)]),p9=O(["stopped","starting","running","failed"]),kv=d({name:o().min(1).max(120),code:o().max(2e5),enabled:A(),placement:m9,integrationId:o().optional()}),vs=kv.extend({id:o(),createdAt:l(),updatedAt:l(),createdBy:o(),status:p9,lastError:o().optional(),lastChangedAt:l()}),f9=d({ok:A(),error:o().optional(),line:l().optional(),column:l().optional()}),h9={name:"core-blocks",scope:"system",mode:"singleton",methods:{list:b(d({}),d({blocks:M(vs)}),{auth:"admin"}),get:b(d({blockId:o()}),d({block:vs.nullable()}),{auth:"admin"}),create:b(d({block:kv}),d({block:vs}),{kind:"mutation",auth:"admin",caller:"required"}),update:b(d({blockId:o(),block:kv.partial()}),d({block:vs}),{kind:"mutation",auth:"admin",caller:"required"}),delete:b(d({blockId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setEnabled:b(d({blockId:o(),enabled:A()}),d({block:vs}),{kind:"mutation",auth:"admin"}),restart:b(d({blockId:o()}),d({block:vs}),{kind:"mutation",auth:"admin"}),compile:b(d({code:o()}),f9,{kind:"mutation",auth:"admin"}),getTypeDefs:b(d({}),d({libs:M(d({filePath:o(),content:o()}))}),{auth:"admin"})}},g9=d({stepId:o(),entry:rb}),v9={name:"custom-model-registry",scope:"system",mode:"collection",internal:!0,methods:{listModels:b(N(),M(g9).readonly(),{auth:"admin"})}},xr=d({where:X(o(),te()).optional(),whereIn:X(o(),M(te())).optional(),whereBetween:X(o(),Uc([te(),te()])).optional(),whereNot:X(o(),te()).optional(),orderBy:d({field:o(),direction:O(["asc","desc"])}).optional(),limit:l().optional(),offset:l().optional()}),Cm=d({where:X(o(),te()).optional(),whereIn:X(o(),M(te())).optional(),whereBetween:X(o(),Uc([te(),te()])).optional(),whereNot:X(o(),te()).optional()}),XE=d({as:o().min(1),field:o().min(1),op:O(["sum","min","max"])}),JE=d({count:l().int(),values:X(o(),l().nullable())}),Am=d({id:o(),data:X(o(),te())}),eR=d({id:o().optional(),data:X(o(),te())}),tR=d({name:o(),type:O(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:A().optional(),notNull:A().optional(),unique:A().optional(),defaultValue:tt([o(),l(),A()]).optional()}),nR=d({name:o(),columns:M(o()).readonly(),unique:A().optional()}),y9={name:"settings-store",scope:"system",mode:"singleton",methods:{get:b(d({namespace:o().optional(),collection:o(),key:o()}),te()),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:te()}),N(),{kind:"mutation"}),query:b(d({namespace:o().optional(),collection:o(),filter:xr.optional(),columns:M(o()).readonly().optional()}),M(Am).readonly()),insert:b(d({namespace:o().optional(),collection:o(),record:Am}),N(),{kind:"mutation"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:M(eR).readonly()}),d({inserted:l().int()}),{kind:"mutation"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:X(o(),te())}),N(),{kind:"mutation"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),N(),{kind:"mutation"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Cm}),d({deleted:l().int()}),{kind:"mutation"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Cm,data:X(o(),te())}),d({updated:l().int()}),{kind:"mutation"}),count:b(d({namespace:o().optional(),collection:o(),filter:xr.optional()}),l()),aggregate:b(d({namespace:o().optional(),collection:o(),fields:M(XE).readonly(),filter:xr.optional()}),JE),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:xr.optional()}),M(d({bucket:l().int(),count:l().int()})).readonly()),isEmpty:b(d({namespace:o().optional(),collection:o()}),A()),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:M(tR).readonly(),indexes:M(nR).readonly().optional()}),N(),{kind:"mutation"})}},b9=d({engineId:o(),kind:O(["relational","vector"]),displayName:o()}),S9={name:"data-store-provider",scope:"system",mode:"collection",internal:!0,methods:{getEngineInfo:b(N(),b9,{auth:"admin"}),get:b(d({namespace:o().optional(),collection:o(),key:o()}),te(),{auth:"admin"}),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:te()}),N(),{kind:"mutation",auth:"admin"}),query:b(d({namespace:o().optional(),collection:o(),filter:xr.optional(),columns:M(o()).readonly().optional()}),M(Am).readonly(),{auth:"admin"}),insert:b(d({namespace:o().optional(),collection:o(),record:Am}),N(),{kind:"mutation",auth:"admin"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:M(eR).readonly()}),d({inserted:l().int()}),{kind:"mutation",auth:"admin"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:X(o(),te())}),N(),{kind:"mutation",auth:"admin"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),N(),{kind:"mutation",auth:"admin"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Cm}),d({deleted:l().int()}),{kind:"mutation",auth:"admin"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Cm,data:X(o(),te())}),d({updated:l().int()}),{kind:"mutation",auth:"admin"}),count:b(d({namespace:o().optional(),collection:o(),filter:xr.optional()}),l(),{auth:"admin"}),aggregate:b(d({namespace:o().optional(),collection:o(),fields:M(XE).readonly(),filter:xr.optional()}),JE,{auth:"admin"}),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:xr.optional()}),M(d({bucket:l().int(),count:l().int()})).readonly(),{auth:"admin"}),isEmpty:b(d({namespace:o().optional(),collection:o()}),A(),{auth:"admin"}),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:M(tR).readonly(),indexes:M(nR).readonly().optional()}),N(),{kind:"mutation",auth:"admin"})}},x9=d({sessionId:o(),slotCount:l().int(),slotByteLength:l().int(),segmentBytes:l().int(),budgetMb:l().int(),framesWritten:l().int(),getFrameHits:l().int(),getFrameMisses:l().int()}),k9={name:"decoder",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{supportsCodec:b(d({codec:o()}),A()),getInfo:b(N(),d({id:o(),name:o(),isPullMode:A().optional(),priority:l().optional(),hwaccel:o().optional(),probedBestHwaccel:o().optional()})),createSession:b(Xk,d({sessionId:o(),nodeId:o()})),destroySession:b(d({sessionId:o()}),N()),pushPacket:b(d({sessionId:o(),packet:DL}),N()),openStream:b(d({sessionId:o(),url:o()}),N()),pullFrames:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),M($k)),pullHandles:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),M(Ar)),getFrame:b(d({handle:Ar}),$k.nullable()),getShmStats:b(d({sessionId:o()}),x9.nullable()),updateConfig:b(d({sessionId:o(),config:Xk.partial()}),N()),getStats:b(d({sessionId:o()}),cq),listActiveSessions:b(N(),M(d({sessionId:o(),codec:o(),outputFormat:o(),createdAtMs:l()})).readonly()),reprobeHwaccel:b(N(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},w9={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{}},el=d({id:o(),system:o(),uniqueId:o().optional(),raw:X(o(),te()).optional()}),M9=O(["online","sleeping","offline","unknown"]),Fs=Fc(()=>d({childNativeId:o(),name:o(),type:O(V),status:M9,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:M(o()).readonly().optional(),features:M(o()).readonly().optional(),sourceInfo:el.optional(),children:M(Fs).readonly().optional()})),uw=d({discovered:M(Fs),lastDiscoveryAt:l().int().nonnegative().nullable(),lastError:o().nullable()}),C9={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Hub],status:{schema:uw,kind:"poll"},runtimeState:uw.extend({lastFetchedAt:l().int().nonnegative()}),durability:"session",methods:{listDiscovered:b(d({deviceId:l().int().nonnegative()}),M(Fs).readonly()),refreshDiscovery:b(d({deviceId:l().int().nonnegative()}),M(Fs).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({deviceId:l().int().nonnegative(),childNativeId:o(),name:o().optional()}),d({deviceId:l().int().nonnegative(),stableId:o()}),{kind:"mutation",auth:"admin"}),releaseDevice:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})}},aR=d({id:o(),label:o(),isDefault:A().optional()}),A9=d({search:o().optional(),area:o().optional(),manufacturer:o().optional(),adoptedOnly:A().optional(),unadoptedOnly:A().optional()}),iR=d({integrationId:o(),page:l().int().positive().default(1),pageSize:l().int().positive().max(2e4).default(50),filter:o().optional(),filterText:A9.optional()}),rR=d({candidates:M(Fs).readonly(),totalCount:l().int().nonnegative(),page:l().int().positive(),pageSize:l().int().positive()}),E9=d({integrationId:o(),childNativeId:o()}),wv=d({lastDiscoveryAt:l().int().nonnegative().nullable(),candidateCount:l().int().nonnegative(),adoptedCount:l().int().nonnegative(),lastError:o().nullable()}),R9=d({name:o().min(1).optional(),hiddenChildIds:M(o()).optional()}),Mv=d({integrationId:o(),childNativeIds:M(o()).min(1),filter:o().optional(),importLocations:A().optional(),perCandidate:X(o(),R9).optional()}),oR=d({adopted:M(d({childNativeId:o(),parentDeviceId:l().int().nonnegative(),accessoryDeviceIds:M(l().int().nonnegative()).readonly()})).readonly()}),sR=d({integrationId:o(),camDeviceId:l().int().nonnegative()}),lR=d({camDeviceId:l().int().nonnegative(),resetToSource:A().optional()}),cR=d({changed:A(),rebuiltChildren:l().int().nonnegative(),removedChildren:l().int().nonnegative().optional()}),_9={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:wv,kind:"poll"},methods:{listCandidateFilters:b(d({integrationId:o()}),d({filters:M(aR)}),{auth:"admin"}),listCandidates:b(iR,rR,{auth:"admin"}),getCandidate:b(E9,Fs.nullable(),{auth:"admin"}),refresh:b(d({integrationId:o()}),wv,{kind:"mutation",auth:"admin"}),adopt:b(Mv,oR,{kind:"mutation",auth:"admin"}),release:b(sR,N(),{kind:"mutation",auth:"admin"}),resync:b(lR,cR,{kind:"mutation",auth:"admin"})}},I9=O(["unlinked","linked","error"]),T9=d({label:o(),value:o(),secret:A().optional()}),N9=d({qr:o().optional(),fields:M(T9).readonly().optional(),note:o().optional()}),dw=d({linkState:I9,exposedDeviceCount:l(),error:o().optional(),setup:N9.optional()}),O9=o(),j9=d({deviceId:o(),exposedAs:o().optional(),capabilities:M(o()).optional()}),P9=d({deviceId:o(),capabilities:M(o()).optional()}),D9=d({deviceId:o()}),z9={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:dw,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:b(N(),dw),listSupportedDeviceKinds:b(N(),M(O9)),listExposedDevices:b(N(),M(j9)),exposeDevice:b(P9,N(),{kind:"mutation"}),unexposeDevice:b(D9,N(),{kind:"mutation"})}},L9=d({connected:A(),deviceCount:l(),error:o().optional()});d({externalId:o(),name:o(),type:o(),metadata:X(o(),te()).optional()});var Es=d({stableId:o(),type:O(V),suggestedName:o(),prefilledConfig:X(o(),te()),sourceInfo:el.optional()}),Em=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),parentDeviceId:l().nullable(),online:A(),features:M(o()),config:X(o(),te()),sourceInfo:el.optional()}),Cv=d({status:O(["ok","error"]),labels:M(o()).optional(),error:o().optional()}),mw=te(),q9={name:"device-provider",scope:"system",mode:"collection",methods:{start:b(N(),N(),{kind:"mutation"}),stop:b(N(),N(),{kind:"mutation"}),getStatus:b(N(),L9),getDevices:b(N(),M(d({id:o(),name:o(),type:o()}))),supportsDiscovery:b(d({}),A()),discoverDevices:b(d({params:X(o(),te()).optional()}),M(Es),{kind:"mutation",auth:"admin"}),getDiscoveryParamsSchema:b(d({}),mw),getManualCreationType:b(d({}),d({deviceType:O(V).nullable()})),adoptDiscoveredDevice:b(d({candidate:Es}),Em,{kind:"mutation",auth:"admin"}),supportsManualCreation:b(d({}),A()),getChildCreationSchema:b(d({type:O(V)}),mw),createDevice:b(d({type:O(V),config:X(o(),te())}),Em,{kind:"mutation",auth:"admin"}),testCreationField:b(d({type:O(V),key:o(),value:te(),formValues:X(o(),te()).optional()}),Cv,{kind:"mutation",auth:"admin"})}},lb=d({childKey:o(),section:o(),order:l().optional(),collapsed:A().optional()}),B9=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:X(o(),B9).optional()}),pw=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),icon:o().min(1).optional()}),Md=d({id:l(),stableId:o(),addonId:o(),type:O(V),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),online:A(),probed:A().optional(),features:M(o()),isCamera:A(),config:X(o(),te()),metadata:X(o(),te()).nullable().optional(),sourceInfo:el.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:M(lb).readonly().optional(),display:cb.optional()}),U9=d({key:o(),value:te(),description:o().optional()}),uR=O(["auto","manual"]),dR=d({deviceId:l(),name:o(),location:o().nullable(),features:M(o()),producesTrackedEvents:A().optional()}),F9=d({deviceId:l(),mode:uR,devices:M(dR)}),qh=d({deviceId:l(),entries:M(d({capName:o(),kind:O(["native","wrapped"]),providerAddonId:o(),providerNodeId:o(),nativeAddonId:o()}))}),H9=d({id:l(),stableId:o(),type:o(),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional()}),$9=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),userNamed:A().optional(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),metadata:X(o(),te()).nullable().optional(),sourceInfo:el.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:M(lb).readonly().optional(),role:o().nullable().optional(),display:cb.optional()}),Q9=te().nullable(),V9=d({streamId:o(),width:l().optional(),height:l().optional(),codec:o().optional(),fps:l().optional(),bitrateKbps:l().optional()}),G9=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:M(o()).optional(),config:X(o(),te())}),Z9=d({deviceId:l()}),K9=d({deviceId:l(),data:X(o(),te())}),W9={name:"device-manager",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{allocateDeviceId:b(d({addonId:o(),stableId:o()}),d({id:l()}),{kind:"mutation"}),registerDevice:b(G9,N(),{kind:"mutation"}),removeDevice:b(Z9,N(),{kind:"mutation"}),persistConfig:b(K9,N(),{kind:"mutation"}),loadConfig:b(d({deviceId:l()}),X(o(),te())),loadRuntimeState:b(d({deviceId:l()}),X(o(),te())),loadMeta:b(d({deviceId:l()}),$9.nullable()),setName:b(d({deviceId:l(),name:o()}),N(),{kind:"mutation",auth:"admin"}),setLocation:b(d({deviceId:l(),location:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),setType:b(d({deviceId:l(),type:O(V)}),N(),{kind:"mutation",auth:"admin"}),setIntegrationId:b(d({deviceId:l(),integrationId:o()}),N(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:b(d({deviceId:l(),linkDeviceId:l().nullable()}),N(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:b(d({deviceId:l(),primaryChildEntityId:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),setChildLayout:b(d({deviceId:l(),childLayout:M(lb).readonly()}),N(),{kind:"mutation",auth:"admin"}),setDisplay:b(d({deviceId:l(),display:cb.nullable()}),N(),{kind:"mutation",auth:"admin"}),getRoleDisplayDefaults:b(d({}),d({defaults:X(o(),pw)}),{kind:"query"}),setRoleDisplayDefaults:b(d({defaults:X(o(),pw)}),N(),{kind:"mutation",auth:"admin"}),getWireableFields:b(d({deviceId:l(),includeSynthesizable:A().optional()}),d({caps:M(d({cap:o(),fields:M(d({path:o(),kind:O(["string","number","boolean","enum"]),enumValues:M(o()).optional(),item:A().optional()})).readonly(),itemArray:d({path:o(),keyField:o()}).optional()})).readonly()}),{kind:"query"}),setRole:b(d({deviceId:l(),role:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),applyInitialMeta:b(d({deviceId:l(),name:o().optional(),location:o().nullable().optional(),type:O(V).optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),role:o().nullable().optional()}),N(),{kind:"mutation",auth:"admin"}),setMetadata:b(d({deviceId:l(),patch:X(o(),te())}),N(),{kind:"mutation",auth:"admin"}),listLocations:b(N(),M(o())),addLocation:b(d({name:o()}),N(),{kind:"mutation",auth:"admin"}),removeLocation:b(d({name:o(),cascade:A().optional()}),N(),{kind:"mutation",auth:"admin"}),renameLocation:b(d({from:o(),to:o()}),d({moved:l()}),{kind:"mutation",auth:"admin"}),setDisabled:b(d({deviceId:l(),disabled:A()}),N(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:b(d({addonId:o()}),M(H9)),listAll:b(d({addonId:o().optional(),projection:O(["full","slim"]).optional(),isCamera:A().optional(),deviceIds:M(l()).optional()}),M(Md)),getDevice:b(d({deviceId:l()}),Md.nullable()),getChildren:b(d({parentDeviceId:l()}),M(Md)),getChildrenBatch:b(d({parentDeviceIds:M(l()).max(256)}),X(o(),M(Md))),getLinkedDevices:b(d({deviceId:l()}),d({mode:uR,devices:M(dR)})),getLinkedDevicesBatch:b(d({deviceIds:M(l())}),M(F9)),getStreamSources:b(d({deviceId:l()}),M(PL)),getConfigSchema:b(d({deviceId:l()}),M(U9)),getSettingsSchema:b(d({deviceId:l()}),Q9),updateConfig:b(d({deviceId:l(),values:X(o(),te())}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),enable:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),remove:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:b(d({integrationId:o()}),d({removed:l()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:b(d({deviceId:l()}),X(o(),o().nullable())),setStreamProfileMap:b(d({deviceId:l(),profileMap:X(o(),o().nullable())}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:b(d({deviceId:l()}),M(V9),{kind:"mutation",auth:"admin"}),getBindings:b(d({deviceId:l()}),qh),getBindingsBatch:b(d({deviceIds:M(l())}),M(qh)),getAllBindings:b(d({}),M(qh)),setWrapperActive:b(d({deviceId:l(),capName:o(),wrapperAddonId:o(),active:A()}),N(),{kind:"mutation",auth:"admin"}),listWrappersForCap:b(d({capName:o()}),M(o())),listBindableCapsForDeviceType:b(d({deviceType:o()}),M(d({capName:o(),wrappers:M(o())}))),getDeviceSettingsAggregate:b(d({deviceId:l()}),mo.nullable()),getDeviceLiveInfoAggregate:b(d({deviceId:l()}),mo.nullable()),getDeviceAggregate:b(d({deviceId:l()}),d({settings:mo.nullable(),live:mo.nullable()})),runDeviceAction:b(d({deviceId:l().int().nonnegative(),action:o().min(1),input:te()}),te(),{kind:"mutation"}),updateDeviceField:b(d({deviceId:l(),writerCapName:o(),writerAddonId:o(),key:o(),value:te()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:b(d({deviceId:l(),changes:M(d({writerCapName:o(),writerAddonId:o(),key:o(),value:te()}))}),d({success:G(!0),failures:M(d({writerCapName:o(),writerAddonId:o(),error:o()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:b(d({addonId:o()}),M(Es),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({addonId:o(),candidate:Es,integrationId:o().optional()}),Em,{kind:"mutation",auth:"admin"}),getCreationSchema:b(d({addonId:o(),type:O(V)}),te().nullable()),createDevice:b(d({addonId:o(),type:O(V),config:X(o(),te()),integrationId:o().optional()}),Em,{kind:"mutation",auth:"admin"}),testCreationField:b(d({addonId:o(),type:O(V),key:o(),value:te(),formValues:X(o(),te()).optional()}),Cv,{kind:"mutation",auth:"admin"}),adoptionListCandidateFilters:b(d({addonId:o(),integrationId:o()}),d({filters:M(aR)}),{auth:"admin"}),adoptionListCandidates:b(iR.extend({addonId:o()}),rR,{auth:"admin"}),adoptionRefresh:b(d({addonId:o(),integrationId:o()}),wv,{kind:"mutation",auth:"admin"}),adoptionAdopt:b(Mv.extend({addonId:o()}),oR,{kind:"mutation",auth:"admin"}),adoptionRelease:b(sR.extend({addonId:o()}),N(),{kind:"mutation",auth:"admin"}),adoptionStartJob:b(Mv.extend({addonId:o()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),adoptionListJobs:b(d({addonId:o(),integrationId:o().optional()}),M(g8).readonly(),{auth:"admin"}),adoptionCancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),adoptionResync:b(lR,cR,{kind:"mutation",auth:"admin"}),discoveryProviders:b(d({}),d({providers:M(d({addonId:o(),label:o()})).readonly()}),{auth:"admin"}),discoverAllProviders:b(d({}),d({groups:M(d({addonId:o(),label:o(),candidates:M(Es).readonly(),error:o().nullable()})).readonly()}),{kind:"mutation",auth:"admin"}),discoverProvider:b(d({addonId:o(),params:X(o(),te()).optional()}),d({candidates:M(Es).readonly()}),{kind:"mutation",auth:"admin"}),providerCreationType:b(d({addonId:o()}),d({deviceType:O(V).nullable()}),{auth:"admin"}),providerDiscoveryParamsSchema:b(d({addonId:o()}),te(),{auth:"admin"}),testField:b(d({deviceId:l(),key:o(),value:te()}),Cv,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:b(d({deviceId:l(),caps:M(o()).readonly().optional()}),X(o(),te().nullable())),getDeviceStatusAggregateBatch:b(d({deviceIds:M(l()).readonly(),caps:M(o()).readonly().optional()}),X(o(),X(o(),te().nullable())))}},Y9={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:b(d({deviceId:l()}),X(o(),X(o(),te()))),getCapSlice:b(d({deviceId:l(),capName:o()}),X(o(),te()).nullable()),getAllSnapshots:b(d({}),X(o(),X(o(),X(o(),te())))),setCapSlice:b(d({deviceId:l(),capName:o(),slice:X(o(),te())}),N(),{kind:"mutation"})},events:{onChanged:go(d({deviceId:l(),capName:o(),slice:X(o(),te())}))}},fw=d({embedding:M(l()),inferenceMs:l()}),X9=d({modelId:o(),embeddingDim:l(),ready:A()}),J9={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:b(d({crop:Ut(Uint8Array),width:l(),height:l()}),fw,{auth:"admin"}),encodeText:b(d({text:o()}),fw,{auth:"admin"}),getInfo:b(N(),X9,{auth:"admin"})}},eB=d({reason:o(),count:l().int().nonnegative()}),mR=d({family:o(),deviceId:l().int().positive(),variant:o().optional(),sinceMs:l(),atMs:l(),attempts:l().int().nonnegative(),succeeded:l().int().nonnegative(),reasons:M(eB).readonly()}),tB={name:"failure-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(N(),M(mR).readonly())},mount:{kind:"skip"}},nB=d({name:o(),path:o()}),aB=d({path:o(),entries:M(nB).readonly(),freeBytes:l(),totalBytes:l()}),iB={name:"filesystem-browse",scope:"system",mode:"singleton",internal:!0,methods:{listAllowedRoots:b(N(),M(o()).readonly(),{auth:"admin"}),browse:b(d({path:o()}),aB,{auth:"admin"}),createDir:b(d({path:o()}),d({path:o()}),{kind:"mutation",auth:"admin"})}},rB=d({inputTokens:l(),outputTokens:l()}),oB=O(["timeout","rate-limited","auth","refusal","bad-request","unavailable","no-profile","budget-exceeded","adapter-error"]),sB=d({ok:G(!0),text:o(),model:o(),usage:rB,truncated:A(),latencyMs:l()}),lB=d({ok:G(!1),code:oB,message:o(),retryAfterMs:l().optional()}),Yd=gt("ok",[sB,lB]),pR=d({bytes:Ut(Uint8Array),mimeType:o()}),fR=d({enabled:A().default(!1),maxAttempts:l().int().min(1).max(5).default(1)}),ub=d({addonId:o().optional(),profileId:o().optional(),consumer:o(),system:o().optional(),prompt:o(),jsonSchema:X(o(),te()).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:fR.optional(),requestId:o().optional()}),cB=d({url:o(),filename:o(),sizeBytes:l(),sha256:o().optional()}),rp=gt("kind",[d({kind:G("catalog"),catalogId:o()}),d({kind:G("url"),url:o(),sha256:o().optional(),label:o().optional(),sizeBytes:l().optional(),extraFiles:M(cB).optional()}),d({kind:G("path"),path:o()})]),db=d({nodeId:o(),engine:O(["llama-cpp"]),model:rp,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:O(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),cacheTypeV:O(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),extraArgs:M(o()).default([]),autoStart:A().default(!1),idleStopMinutes:l().int().default(30)}),uB=d({phase:O(["downloading","verifying"]),file:o(),fileIndex:l().int(),fileCount:l().int(),downloadedBytes:l(),totalBytes:l().optional()}),Mc=d({nodeId:o(),state:O(["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:uB.optional(),lastError:o().optional(),crashesInWindow:l(),memoryBytes:l().optional(),vramBytes:l().optional()}),hR=d({file:o(),sizeBytes:l(),catalogId:o().optional(),installedAt:l().optional(),path:o().optional()}),gR=d({nodeId:o(),modelsBytes:l(),freeBytes:l().optional()}),dB=ub.extend({images:M(pR).optional(),runtime:db,timeoutMs:l().int().positive().optional()}),mB={name:"llm-runtime",scope:"system",mode:"singleton",internal:!0,methods:{complete:b(dB,Yd,{kind:"mutation",auth:"admin"}),ensureStarted:b(d({runtime:db}),Mc,{kind:"mutation",auth:"admin"}),stop:b(d({}),N(),{kind:"mutation",auth:"admin"}),status:b(d({}),Mc,{auth:"admin"}),installModel:b(d({model:rp}),N(),{kind:"mutation",auth:"admin"}),deleteModel:b(d({file:o()}),N(),{kind:"mutation",auth:"admin"}),listLocalModels:b(d({}),M(hR),{auth:"admin"}),getDiskUsage:b(d({}),gR,{auth:"admin"})}},vR=O(["openai-compatible","openai","anthropic","google","managed-local"]),Bh=d({id:o(),name:o(),kind:vR,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:fR.default({enabled:!1,maxAttempts:1}),toolsEnabled:A().default(!1),extraHeaders:X(o(),o()).optional(),runtime:db.optional()}),pB=te(),fB=d({kind:vR,label:o(),icon:o(),addonId:o(),configSchema:pB}),yR=tt([d({consumer:o()}),d({purpose:O(["text","vision"])})]),hB=d({selector:yR,profileId:o()}),gB=d({day:o(),consumer:o(),profileId:o(),calls:l(),okCalls:l(),errorCalls:l(),inputTokens:l(),outputTokens:l(),avgLatencyMs:l()}),vB=d({id:o(),label:o(),family:o(),purpose:O(["text","vision"]),url:o(),sha256:o(),sizeBytes:l(),quantization:o(),minRamBytes:l(),contextSizeDefault:l().int(),mmprojUrl:o().optional()}),yB=gt("ok",[d({ok:G(!0),model:rp,label:o(),repo:o(),quantization:o(),purpose:O(["text","vision"]),totalBytes:l(),extraFilenames:M(o())}),d({ok:G(!1),code:o(),message:o(),candidates:M(o()).optional(),requiredBytes:l().optional()})]),bB=d({nodeId:o(),reachable:A(),status:Mc.optional(),disk:gR.optional(),error:o().optional()}),SB=ub.extend({images:M(pR).min(1)}),ys=d({addonId:o(),profileId:o()}),xB={name:"llm",scope:"system",mode:"collection",internal:!1,providerKind:"ai",nodeIdMode:"data",methods:{generate:b(ub,Yd,{kind:"mutation"}),generateVision:b(SB,Yd,{kind:"mutation"}),cancel:b(d({addonId:o().optional(),requestId:o()}),N(),{kind:"mutation"}),listProfileKinds:b(d({}),M(fB)),listProfiles:b(d({}),M(Bh)),upsertProfile:b(d({profile:Bh}),Bh,{kind:"mutation",auth:"admin"}),deleteProfile:b(ys,N(),{kind:"mutation",auth:"admin"}),testProfile:b(ys,Yd,{kind:"mutation",auth:"admin"}),listModels:b(ys,M(o())),getDefaults:b(d({}),M(hB)),setDefault:b(d({selector:yR,profileId:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),getUsage:b(d({since:l().optional(),until:l().optional(),consumer:o().optional(),profileId:o().optional()}),M(gB)),listModelCatalog:b(d({}),M(vB)),listRuntimeNodes:b(d({}),M(bB)),listNodeModels:b(d({nodeId:o()}),M(hR)),resolveModelRef:b(d({ref:o(),maxBytes:l().positive().optional()}),yB,{kind:"mutation",auth:"admin"}),installModel:b(d({nodeId:o(),model:rp}),N(),{kind:"mutation",auth:"admin"}),deleteModel:b(d({nodeId:o(),file:o()}),N(),{kind:"mutation",auth:"admin"}),getRuntimeStatus:b(ys,Mc),startRuntime:b(ys,Mc,{kind:"mutation",auth:"admin"}),stopRuntime:b(ys,N(),{kind:"mutation",auth:"admin"})}},kB=["decode","transcode","recording","streaming","detection"],wB=["measured","accounted","unattributable"],bR=d({role:O(kB),deviceId:l().int().positive().nullable(),attribution:O(wB),unit:o(),pid:l().int().positive().optional(),startedAtMs:l().optional(),cpuSeconds:l().optional(),rssBytes:l().optional()}),MB={name:"load-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(N(),M(bR).readonly())},mount:{kind:"skip"}},CB=d({armed:l().int().min(0),unknown:M(o()).readonly()}),AB={name:"log-channels",scope:"system",mode:"collection",internal:!0,methods:{list:b(N(),M(NE).readonly()),apply:b(d({windows:M(x8).readonly()}),CB,{kind:"mutation"})},mount:{kind:"skip"}},SR=O(["debug","info","warn","error"]),hw=d({timestamp:mv(),level:SR,scope:M(o()),message:o(),meta:X(o(),te()).optional(),tags:X(o(),o()).optional()}),EB={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:b(hw,N(),{kind:"mutation"}),query:b(d({scope:M(o()).optional(),level:SR.optional(),since:mv().optional(),until:mv().optional(),limit:l().optional(),tags:X(o(),o()).optional()}),M(hw).readonly())},mount:{kind:"skip"}},mb=O(["primary","second-factor"]),RB=d({kind:G("redirect"),id:o(),label:o(),icon:o().optional(),startUrl:o(),stage:mb}),_B=d({kind:G("widget"),id:o(),addonId:o(),bundle:o(),remote:KE,stage:mb}),IB=d({kind:G("passkey"),id:o(),label:o(),stage:mb,rpId:o(),origin:o().nullable()}),TB=gt("kind",[RB,_B,IB]),NB={name:"login-method",scope:"system",mode:"collection",internal:!0,methods:{getLoginMethods:b(N(),M(TB).readonly())},mount:{kind:"skip"}},OB=d({total:l(),user:l(),system:l(),irq:l(),nice:l(),loadAvg:Uc([l(),l(),l()]),cores:l()}),jB=d({percent:l(),totalBytes:l(),usedBytes:l(),availableBytes:l(),swapUsedBytes:l(),swapTotalBytes:l()}),PB=d({readBytes:l(),writeBytes:l(),readOps:l(),writeOps:l(),timestampMs:l()}),DB=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()}),zB=d({openFds:l(),threadCount:l(),activeHandles:l(),activeRequests:l()}),gw=d({avg10:l(),avg60:l(),avg300:l()}),Uh=d({some:gw,full:gw.nullable()}),vw=d({cpu:OB,memory:jB,gpu:xR.nullable(),network:DB,disk:PB,pressure:d({cpu:Uh.nullable(),memory:Uh.nullable(),io:Uh.nullable()}),process:zB,cpuTemperature:l().nullable(),timestampMs:l()}),LB=d({path:o(),totalBytes:l(),usedBytes:l(),availableBytes:l(),percent:l()}),yw=d({pid:l(),cpu:l(),memory:l(),privateBytes:l().optional(),sharedBytes:l().optional()}),qB=d({addonId:o(),nodeId:o(),role:O(["hub","worker"]),pid:l(),state:O(["starting","running","stopping","stopped","crashed"]),uptimeSec:l()}),BB=d({pid:l(),ppid:l(),pgid:l(),classification:O(["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()}),UB=d({source:O(["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()}),FB=d({addonId:o()}),HB=d({success:A(),path:o().optional(),pid:l().optional(),reason:o().optional()}),$B=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()}),QB=d({key:o(),kind:O(["addon","root","unattributed"]),points:M($B).readonly()}),VB=d({nodeId:o(),series:M(QB).readonly(),containerMemory:M(UB).readonly(),bucketMs:l(),retainedSamples:l(),oldestAtMs:l().nullable(),cadenceMs:l(),durable:A()}),GB=d({forNodeId:o(),sinceMs:l().optional(),maxPoints:l().int().positive().optional()}),ZB=d({cpuPercent:l(),memoryPercent:l(),memoryUsedMB:l(),memoryTotalMB:l(),diskPercent:l().optional(),temperature:l().optional(),gpuPercent:l().optional(),gpuMemoryPercent:l().optional()}),KB={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:b(N(),vw),getCached:b(N(),vw.nullable()),getCurrent:b(N(),ZB),getDiskSpace:b(d({dirPath:o()}),LB),getGpuInfo:b(N(),xR.nullable()),getCpuTemperature:b(N(),l().nullable()),getProcessStats:b(d({pids:M(l())}),M(yw)),listAddonInstances:b(N(),M(qB).readonly()),getAddonStats:b(d({addonId:o()}),yw.nullable()),listNodeProcesses:b(N(),M(BB).readonly()),getLoadSeries:b(GB,VB),dumpHeapSnapshot:b(FB,HB,{kind:"mutation",auth:"admin"})}},WB=d({sourceUrl:o(),metadata:fq,targets:M(pq).min(1).readonly(),calibrationRef:o().optional(),sessionId:o().optional()}),YB={name:"model-convert",scope:"system",mode:"singleton",internal:!0,methods:{convert:b(WB,gq,{kind:"mutation",auth:"admin",timeoutMs:6e5})}},XB=d({nodeId:o(),modelId:o(),format:O(ap),entry:rb}),JB=d({ok:A(),sha256:o(),bytes:l(),path:o()}),eU={name:"model-distributor",scope:"system",mode:"singleton",internal:!0,methods:{distributeModel:b(XB,JB,{kind:"mutation",auth:"admin"})}},Rm=d({bbox:Fi,pixelCount:l(),intensity:l()}),tU=d({detected:A(),regionCount:l(),regions:M(Rm).readonly(),rawRegions:M(Rm).readonly(),frameWidth:l(),frameHeight:l(),analysisMs:l()}),nU={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{analyze:b(d({deviceId:l(),frame:yv.optional(),frameHandle:Ar.optional()}),tU,{kind:"mutation"}),removeCamera:b(d({deviceId:l()}),N(),{kind:"mutation"}),reset:b(N(),N(),{kind:"mutation"})},events:{onMotion:{data:d({deviceId:l(),detected:A(),regionCount:l()})}}},aU=O(["external","embedded"]),iU=O(["connected","disconnected","auth-failed","unreachable","tls-error"]),rU=d({id:o(),name:o(),url:o(),kind:aU,status:iU,latencyMs:l().nullable(),error:o().optional(),connectedClients:l().int().nonnegative().optional(),lastCheckedAt:l().optional()}),oU=d({url:o(),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),sU=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()}),lU=d({id:o()}),Cd=d({id:o()}),cU=gt("ok",[d({ok:G(!0),latencyMs:l()}),d({ok:G(!1),error:o()})]),uU=d({port:l().int().min(1).max(65535).default(1883),allowAnonymous:A().default(!1),username:o().optional(),password:o().optional()}),dU=d({id:o(),url:o()}),bw=d({brokerCount:l(),embeddedRunning:A()}),mU={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:bw,kind:"poll"},methods:{listBrokers:b(N(),M(rU)),getBrokerConfig:b(Cd,oU),addBroker:b(sU,lU,{kind:"mutation"}),removeBroker:b(Cd,N(),{kind:"mutation"}),testConnection:b(Cd,cU,{kind:"mutation"}),startEmbeddedBroker:b(uU,dU,{kind:"mutation"}),stopEmbeddedBroker:b(Cd,N(),{kind:"mutation"}),getStatus:b(N(),bw)}},_m=d({url:o(),hostname:o(),port:l(),protocol:O(["http","https"])}),pU=d({connected:A(),endpoint:_m.nullable(),error:o().optional()}),fU=_m.extend({id:o(),label:o(),mode:o().optional(),sourcePort:l().optional()}),hU={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:b(N(),_m,{kind:"mutation"}),stop:b(N(),N(),{kind:"mutation"}),getEndpoint:b(N(),_m.nullable()),getStatus:b(N(),pU),listEndpoints:b(N(),M(fU).readonly())}},kR=O(["image","video","gif","audio","icon"]),gU=d({mediaType:kR,url:o().optional(),bytes:Ut(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`"}),pb=O(["text","markdown","html"]),wR=O(["acknowledge","dismiss","silence","snooze","view","play","open","close","lock","unlock","arm","arm-home","arm-away","arm-night","disarm","light","alert","camera"]),vU=d({id:o(),label:o(),url:o().optional(),icon:wR.optional(),destructive:A().optional(),mode:O(["navigate","background"]).optional()}),Sw=d({body:o(),title:o().optional(),format:pb.default("text"),priority:l().int().min(1).max(5).default(3),level:o().optional(),attachments:M(gU).optional(),clickUrl:o().optional(),actions:M(vU).optional(),sound:o().optional(),ttl:l().optional(),tag:o().optional(),deviceId:l().optional(),eventId:o().optional(),metadata:X(o(),te()).optional()}),yU=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:M(o()).optional(),description:o().optional()}),bU=d({mediaTypes:M(kR),mode:O(["url","bytes","both"]),max:l().int().nonnegative(),maxBytes:l().int().positive().optional()}),SU=d({attachments:bU,actions:l().int().nonnegative(),actionIcons:A().optional(),levels:M(yU),format:M(pb),clickUrl:A(),sound:A(),ttl:A(),bodyMaxLen:l().int().positive()}),xU=te(),kU=d({kind:o(),label:o(),icon:o(),addonId:o(),iconUrl:o().optional(),iconMediaType:o().optional(),configSchema:xU,supportsDiscovery:A(),caps:SU}),Fh=d({id:o(),name:o(),kind:o(),addonId:o(),enabled:A(),config:X(o(),te())}),wU=d({kind:o(),suggestedName:o(),config:X(o(),te())}),MU=d({level:o(),format:pb,attachmentsSent:l().int().nonnegative(),actionsSent:l().int().nonnegative(),truncated:A(),dropped:M(o())}),MR=d({success:A(),error:o().optional(),renderedAs:MU.optional()}),CU=MR,AU={name:"notification-output",scope:"system",mode:"collection",methods:{listTargetKinds:b(d({}),M(kU)),listTargets:b(d({}),M(Fh)),discoverTargets:b(d({kind:o(),config:X(o(),te()).optional()}),M(wU)),send:b(d({targetId:o(),notification:Sw}),MR,{kind:"mutation"}),testTarget:b(d({targetId:o(),sample:Sw.optional()}),CU,{kind:"mutation"}),upsertTarget:b(d({target:Fh}),Fh,{kind:"mutation"}),deleteTarget:b(d({targetId:o()}),N(),{kind:"mutation"}),setTargetEnabled:b(d({targetId:o(),enabled:A()}),N(),{kind:"mutation"})}},EU=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"},{id:"package",name:"Package"}];new Set(EU.map(e=>e.id));var RU={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"}},_U=[{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"}],IU={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"}},TU={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"}},CR=new Map;for(const[e,t]of Object.entries(IU.mapping))CR.set(e.toLowerCase(),t);for(const[e,t]of Object.entries(TU.mapping))CR.set(e.toLowerCase(),t);var Gn={motion:"#f59e0b",audio:"#06b6d4",person:"#22c55e",vehicle:"#3b82f6",animal:"#f97316",package:"#a855f7",sensor:"#8b5cf6",control:"#10b981",genericDetection:"#64748b"},NU={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 OU(e){return e.split(/[-_ ]/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var $c=new Map;function Tr(e,t,n,a,s){$c.set(e,{kind:e,parentKind:null,level:"macro",category:t,color:n,iconId:a,labelKey:`eventKind.${e}`,label:s})}function bn(e,t,n,a,s,m){$c.set(e,{kind:e,parentKind:t,level:"sub",category:n,color:a,iconId:s,labelKey:`eventKind.${e}`,label:m})}Tr("motion","motion",Gn.motion,"motion","Motion");Tr("audio","audio",Gn.audio,"audio","Audio");Tr("person","detection",Gn.person,"person","Person");Tr("vehicle","detection",Gn.vehicle,"vehicle","Vehicle");Tr("animal","detection",Gn.animal,"animal","Animal");Tr("package","package",Gn.package,"package","Package");Tr("sensor","sensor",Gn.sensor,"sensor","Sensor");Tr("control","control",Gn.control,"control","Control");for(const[e,t]of Object.entries(RU.mapping))t!=="vehicle"&&t!=="animal"||$c.has(e)||bn(e,t,"detection",NU[e]??Gn.genericDetection,e,OU(e));bn("package-delivered","package","package",Gn.package,"package","Package delivered");bn("package-picked-up","package","package",Gn.package,"package","Package picked up");bn("contact","sensor","sensor","#f59e0b","door","Contact");bn("motion-sensor","sensor","sensor",Gn.sensor,"pir","Motion sensor");bn("smoke","sensor","sensor","#ef4444","smoke","Smoke");bn("flood","sensor","sensor","#3b82f6","water","Water leak");bn("gas","sensor","sensor","#ef4444","gas","Gas");bn("carbon-monoxide","sensor","sensor","#dc2626","smoke","Carbon monoxide");bn("vibration","sensor","sensor","#eab308","vibration","Vibration");bn("tamper","sensor","sensor","#f97316","tamper","Tamper");bn("presence","sensor","sensor","#22c55e","presence","Presence");bn("enum-sensor","sensor","sensor",Gn.sensor,"generic","Sensor state");bn("device-event","sensor","sensor","#10b981","button","Device event");bn("lock","control","control","#0ea5e9","lock","Lock");bn("switch","control","control",Gn.control,"switch","Switch");bn("siren","control","control","#dc2626","siren","Siren");bn("button","control","control","#10b981","button","Button");bn("doorbell","control","control","#a855f7","doorbell","Doorbell");for(const e of _U){const t=`audio-${e.id}`;$c.has(t)||bn(t,"audio","audio",Gn.audio,t,e.name)}var fb=Object.freeze(Object.fromEntries($c)),Hh=d({kind:o(),label:o(),parentKind:o().nullable()}),jU=d({videoClasses:M(Hh),audioKinds:M(Hh),labels:M(Hh)});function $h(e,t,n){return{kind:e,label:t,parentKind:n}}function PU(){const e=Object.values(fb);return{videoClasses:e.filter(t=>t.category==="detection").map(t=>$h(t.kind,t.label,t.parentKind)),audioKinds:e.filter(t=>t.category==="audio"&&t.level==="sub").map(t=>$h(t.kind,t.label,t.parentKind)),labels:e.filter(t=>t.category==="sensor"||t.category==="control").map(t=>$h(t.kind,t.label,t.parentKind))}}Object.freeze(PU());var DU=O(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),hb=O(["home","away","night","vacation","custom_bypass"]),xw=d({state:DU,availableModes:M(hb),requiresCode:A(),lastChangedAt:l()}),zU={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.AlarmPanel],methods:{arm:b(d({deviceId:l().int().nonnegative(),mode:hb,code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),disarm:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),trigger:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:xw,kind:"push"},runtimeState:xw,durability:"restored",volatileStateFields:["lastChangedAt"]},AR=d({x:l(),y:l()}),Hs=d({kind:G("rect"),x:l(),y:l(),width:l(),height:l()}),op=d({kind:G("polygon"),points:M(AR)}),ER=d({kind:G("grid"),gridWidth:l(),gridHeight:l(),cells:M(A())}),LU=d({kind:G("line"),points:M(AR)});gt("kind",[Hs,op,ER,LU]);var RR=O(["rect","polygon","grid","line"]),qU=d({min:l(),max:l()}),BU=d({width:l(),height:l()}),gb=O(["immediate","track-end","device-event","package-event","system-event"]),vb=O(["device-online","device-offline","device-disabled","device-enabled","device-battery-low","device-battery-normal","stream-online","stream-offline","node-online","node-offline","node-inference-unavailable","detection-blind","addon-crash-loop","addon-update-available","server-update-available","alarm-triggered","alarm-armed","alarm-disarmed","alarm-arming","alarm-arm-refused","addon-updated","server-updated","export-completed","camera-online","camera-offline","camera-disabled","camera-enabled"]),UU=new Set(["camera-online","camera-offline","camera-disabled","camera-enabled"]);vb.options.filter(e=>!UU.has(e));var FU=d({kinds:M(vb).min(1),deviceIds:M(l().int()).min(1).optional(),deviceTypes:M(o().min(1)).min(1).optional(),nodeIds:M(o().min(1)).min(1).optional(),packageNames:M(o().min(1)).min(1).optional()}),_R=1440,HU=d({days:M(l().int().min(0).max(6)).min(1),startMinute:l().int().min(0).max(1439),endMinute:l().int().min(0).max(1439)}),sp=d({windows:M(HU).min(1),timezone:o().optional(),invert:A().optional()}),$U=d({values:M(o().min(1)),maxDistance:l().int().min(0).max(3).default(1)}),QU=d({zoneId:o().optional(),className:o().optional(),op:O(["became-occupied","became-free",">=","<="]).default("became-occupied"),count:l().int().min(0).default(1),sustainSeconds:l().int().min(0).max(3600).default(15)}),VU=d({labels:M(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()}),GU=O(["enter","exit","any"]),ZU=d({ids:M(o().min(1)).min(1),match:O(["any","all"]).default("any")}),KU=gt("kind",[d({kind:G("wait"),seconds:l().min(0).max(300)}),d({kind:G("cap"),deviceId:l().int(),cap:o().min(1),method:o().min(1),args:X(o(),te()).optional()})]),WU=d({name:o().min(1).max(120),enabled:A(),minDelaySec:l().int().min(0).max(86400).optional(),actions:M(KU).min(1)}),YU=d({id:o().min(1).max(64),label:o().min(1).max(40),sequence:o().min(1).max(120),icon:wR.optional(),destructive:A().optional()}),XU=d({onTrigger:M(WU).optional(),buttons:M(YU).max(8).optional()}),JU=d({deviceId:l().int(),states:M(o().min(1)).min(1)}),eF=d({sceneId:o().min(1),deviceId:l().int().optional(),requiredState:O(["matched","diverged"]),latched:A().optional()}),yb=d({deviceState:JU.optional(),scene:eF.optional(),devices:M(l()).optional(),classes:M(o().min(1)).optional(),classesExclude:M(o().min(1)).optional(),minConfidence:l().min(0).max(1).optional(),zones:ZU.optional(),zonesExclude:M(o().min(1)).optional(),crossing:GU.optional(),labelEquals:M(o().min(1)).optional(),identities:M(o().min(1)).optional(),plates:$U.optional(),identitiesExclude:M(o().min(1)).optional(),minImportance:l().min(0).max(1).optional(),minDwellSeconds:l().min(0).optional(),source:O(["pipeline","onboard","sensor","audio","any"]).optional(),minLabelConfidence:l().min(0).max(1).optional(),eventTypeTokens:M(o().min(1)).optional(),sensorKinds:M(o().min(1)).optional(),packagePhase:O(["delivered","picked-up","both"]).optional(),systemEvent:FU.optional(),customZones:M(op).optional(),occupancy:QU.optional(),audio:VU.optional()}),IR=d({targetId:o().min(1),params:X(o(),te()).optional()}),tF=O(["cropped","full","boxed"]),TR=d({attach:O(["best","best-matching","keyFrame","none"]).default("best"),frame:tF.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:Mn.optional()}),nF=O(["shared","per-class"]),NR=d({cooldownSec:l().int().min(0).max(86400).default(60),scope:O(["rule","rule-device"]).default("rule-device"),granularity:nF.optional()}),aF=1e3,iF=2e4,rF=8e3,oF=d({op:O([">=",">","<=","<","=="]),count:l().int().min(0).max(1e3)}),sF=d({enabled:A().default(!1),profileId:o().optional(),prompt:o().max(1e3).optional(),expect:oF.optional(),timeoutMs:l().int().min(aF).max(iF).default(rF),onTimeout:O(["fire","suppress"]).default("fire"),maxImagePx:l().int().min(64).max(2048).default(448)}),Im=d({name:o().min(1).max(200),enabled:A().default(!0),delivery:gb,conditions:yb.default({}),schedule:sp.optional(),targets:M(IR),targetUsers:M(o()).optional(),media:TR.default({attach:"best"}),throttle:NR.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:M(l().int().min(1).max(_R)).max(4).optional(),actions:XU.optional(),confirm:sF.optional(),waitForEnhancement:A().optional(),groupIdleSec:l().int().min(0).max(600).optional()}),lF=Im.partial().extend({disabledTargetIds:M(o()).optional(),enabled:A().optional(),conditions:yb.optional(),media:TR.optional(),throttle:NR.optional(),priority:l().int().min(1).max(5).optional()}),Ad=Im.extend({id:o(),createdBy:o(),createdAt:l(),updatedAt:l(),disabledTargetIds:M(o()).default([])}),cF=d({recordId:o(),recordKind:O(["object-event","track","device-event","package-event","system-event"]),deviceId:l(),timestamp:l(),wouldFire:A(),failedCondition:o().optional(),className:o().optional(),label:o().optional()}),OR=d({id:o(),group:O(["scope","class","zones","quality","label","schedule","device","package","occupancy","audio","system"]),label:o(),valueType:O(["deviceIdList","stringList","number01","number","sourceSelect","zoneSelection","zoneIdList","schedule","plateMatcher","packagePhase","crossingSelect","polygonDraw","occupancy","audio","deviceState","scene","systemEvent"]),operator:O(["in","notIn","anyOf","allOf","gte","fuzzyIn","withinSchedule"]),appliesTo:M(gb),phase:o(),description:o().optional(),options:M(d({value:o(),label:o(),hint:o().optional()})).readonly().optional()}),jR=O(["pending","sent","dead"]),uF=O(["object-event","track-end","device-event","package-event","system-event"]),dF=d({className:o(),label:o().optional(),confidence:l().optional(),zones:M(o()),timestamp:l(),systemEvent:d({kind:vb,subject:o(),title:o(),body:o(),data:X(o(),te())}).optional()}),mF=d({id:o(),ruleId:o(),ruleName:o(),delivery:gb,targetId:o(),deviceId:l(),recordKind:uF,recordId:o(),trackId:o().optional(),status:jR,attempts:l().int(),createdAt:l(),updatedAt:l(),error:o().optional(),subject:dF,artifactIds:M(o().min(1)).optional()}),pF=d({ruleId:o().optional(),deviceId:l().optional(),status:jR.optional(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100)}),PR=O(["rule","device","all"]),fF=d({scope:PR,ruleId:o().optional(),deviceId:l().int().optional(),classes:M(o().min(1)).min(1).optional(),durationMinutes:l().int().min(1).max(_R),global:A().optional(),summary:A().optional()}),kw=d({id:o(),userId:o(),scope:PR,ruleId:o().optional(),deviceId:l().int().optional(),classes:M(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 DR=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:M(o().min(1)).max(16)}),hF=DR.partial(),gF=O(["muted","detection-off","offline"]),vF=d({deviceId:l().int(),reason:gF}),yF=d({mode:hb,ruleCount:l().int().min(0),allDevices:A(),deviceIds:M(l().int()),skippedDevices:M(vF).default([])}),ww=d({deviceId:l().int().nullable(),settings:DR,coverage:M(yF)}),bF={name:"notification-rules",scope:"system",mode:"singleton",methods:{listRules:b(d({}),d({rules:M(Ad)}),{auth:"admin"}),getRule:b(d({ruleId:o()}),d({rule:Ad.nullable()}),{auth:"admin"}),createRule:b(d({rule:Im}),d({rule:Ad}),{kind:"mutation",auth:"admin",caller:"required"}),updateRule:b(d({ruleId:o(),patch:lF}),d({rule:Ad}),{kind:"mutation",auth:"admin",caller:"required"}),deleteRule:b(d({ruleId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setRuleEnabled:b(d({ruleId:o(),enabled:A()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),listDeviceMutes:b(d({}),d({mutedDeviceIds:M(l().int()).readonly()}),{auth:"admin"}),setDeviceMuted:b(d({deviceId:l().int(),muted:A()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),testRule:b(d({rule:Im,lookbackMinutes:l().int().min(1).max(1440).default(60)}),d({results:M(cF)}),{kind:"mutation",auth:"admin"}),getConditionCatalog:b(d({}),d({catalog:M(OR),taxonomy:jU.optional()})),getHistory:b(d({filter:pF.default({limit:100})}),d({entries:M(mF)}),{auth:"admin"}),resolveArtifactUrl:b(d({artifactId:o().min(1)}),d({url:o().nullable()}),{auth:"admin"}),listSnoozes:b(d({}),d({snoozes:M(kw)}),{caller:"required"}),createSnooze:b(d({snooze:fF}),d({snooze:kw}),{kind:"mutation",caller:"required"}),cancelSnooze:b(d({snoozeId:o()}),d({success:G(!0)}),{kind:"mutation",caller:"required"}),getAlarmConfig:b(d({}),ww,{auth:"admin"}),setAlarmConfig:b(d({patch:hF}),ww,{kind:"mutation",auth:"admin"})}},Xd=O(["view","create","delete"]),zR=tt([G("*"),M(o())]),LR=X(o(),tt([G("*"),M(o())])),SF=O(["device","system"]),xF=gt("kind",[d({kind:G("all")}),d({kind:G("ids"),ids:M(l().int()).min(1)}),d({kind:G("types"),types:M(O(V)).min(1)}),d({kind:G("locations"),locations:M(o().min(1)).min(1)})]),kF=d({type:G("device"),selector:xF,access:M(Xd).min(1),includeLinked:A().optional()});function wF(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 ba=OL(wF,gt("type",[d({type:G("category"),target:SF,access:M(Xd).min(1)}),d({type:G("capability"),target:o(),access:M(Xd).min(1)}),d({type:G("addon"),target:o(),access:M(Xd).min(1)}),kF]));d({id:o(),username:o(),passwordHash:o(),isAdmin:A().default(!1),allowedProviders:zR,allowedDevices:LR,scopes:M(ba).default([]),createdAt:l(),updatedAt:l()});d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:zR,allowedDevices:LR,tokenHash:o(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()});d({id:o(),userId:o(),name:o(),tokenHash:o(),tokenPrefix:o(),scopes:M(ba),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()});var MF=d({integrationId:o(),displayName:o(),requestedScopes:M(ba),allowedRedirectPrefixes:M(o()).min(1),allowedPrivateHostPaths:M(o()).optional(),requiresPkce:A().optional(),hubUrl:o().optional(),refreshTokenTtlSec:tt([l().int().positive(),G("never")]).optional()}),CF={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:b(N(),MF,{auth:"admin"})}},AF=d({handle:Ar,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:O(["stretch","contain"]),format:O(["rgb","gray","jpeg"])});var EF=d({registryId:o().min(1),id:o().min(1),width:l().int().positive(),height:l().int().positive(),format:O(["rgb","gray"]),timestamp:l(),capturedAt:l().optional()}),Av=O(["onnx","coreml","openvino","tflite","pt","gguf"]),Cc=O(["detector","cropper","classifier","refiner","audio-classifier"]),ta=d({runtime:O(["node","python"]),backend:o(),format:Av,device:o().optional()}),RF=d({id:o(),label:o(),description:o().optional()}),_F=d({engine:ta,devices:M(RF).readonly(),defaultDevice:o()}),Ev=Fc(()=>d({addonId:o(),addonName:o(),slot:Cc,inputClasses:M(o()).readonly(),outputClasses:M(o()).readonly(),enabled:A(),modelId:o(),children:M(Ev).readonly(),group:o().optional(),settings:X(o(),te()).optional()})),Tm=Fc(()=>d({addonId:o(),enabled:A(),modelId:o(),children:M(Tm).readonly(),settings:X(o(),te()).optional()})),Qh=d({id:o(),name:o(),createdAt:o(),updatedAt:o(),engine:ta,steps:M(Tm).readonly()}),IF=d({id:o(),name:o(),formats:X(o(),d({downloaded:A(),sizeMB:l()})),group:FE.optional(),legacy:A().optional(),provider:HE.optional()}),TF=Ha(),NF=d({id:o(),name:o(),slot:Cc,inputClasses:M(o()).readonly(),outputClasses:M(o()).readonly(),childSlots:M(Cc).readonly(),models:M(IF).readonly(),defaultModelId:o(),defaultModelIdByFormat:X(o(),o()).optional(),enabledByDefault:A().optional(),backfillIntoExistingOverrides:A().optional(),defaultConfidence:l(),group:o().optional(),configSchema:M(TF).readonly().optional()}),OF=d({id:Cc,label:o(),priority:l(),parentSlot:Cc.nullable(),addons:M(NF).readonly()}),jF=d({availableEngines:M(_F).readonly(),selectedEngine:ta,slots:M(OF).readonly()}),PF=d({runtimeId:O(["onnx","openvino","coreml","edgetpu"]).nullable(),device:o().nullable(),state:O(["idle","installing","verifying","ready","failed"]),progress:l().optional(),error:o().optional(),nextRetryAt:l().optional(),configIssues:M(o()).optional()}),vo=Fc(()=>d({addonId:o(),modelId:o().optional(),enabled:A().default(!0),children:M(vo).optional(),settings:X(o(),te()).optional(),jumpDeviceKey:o().optional()})),DF=d({addonId:o(),chosen:o(),running:o(),format:o()}),zF=d({addonId:o(),kind:O(["unknown-addon","no-format-build"]),detail:o()}),LF=d({ok:A(),issues:M(zF).readonly(),substitutions:M(DF).readonly(),format:o()}),qF=d({filename:o(),stepIds:M(o()).readonly().optional()}),BF=d({base64:o(),filename:o()}),UF=d({filename:o(),sizeKb:l()}),FF=d({base64:o()}),HF=d({id:o(),name:o(),description:o(),available:A(),rawLabels:M(o()).readonly().optional()}),$F=d({activeBackend:o(),availableBackends:M(HF).readonly(),sampleRate:l(),chunkDurationMs:l()}),QF=d({filePath:o(),sizeMB:l(),durationMs:l()}),VF=d({success:A(),error:o().optional(),frame:Ha().optional()}),GF=Ha(),ZF=Ha(),KF=Ha(),WF=Ha(),YF=Ha(),Rv=Ha(),XF={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:b(N(),M(ta)),getSelectedEngine:b(N(),ta),getDefaultSteps:b(ta,M(Ev)),getEngineProvisioning:b(d({nodeId:o()}),PF),getVideoPipelineSteps:b(N(),X(o(),d({modelId:o(),settings:X(o(),te()).readonly()}))),setVideoPipelineSteps:b(d({steps:X(o(),d({modelId:o(),settings:X(o(),te()).readonly()}))}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),clearDeviceOverrides:b(d({nodeId:o()}),d({success:G(!0),clearedDevices:l()}),{kind:"mutation",auth:"admin"}),getInferenceDeviceHealth:b(d({nodeId:o()}),d({unhealthy:M(d({deviceKey:o(),state:O(["failed","backoff"]),since:l(),deaths:l(),lastError:o()})).readonly()})),rearmInferenceDevice:b(d({nodeId:o(),deviceKey:o()}),d({rearmed:A()}),{kind:"mutation",auth:"admin"}),getSchema:b(N(),jF),getGlobalSteps:b(N(),M(Ev).readonly().nullable()),getGlobalPipelineConfig:b(N(),GF),getOrchestratorConfigSchema:b(N(),ZF),validatePipeline:b(d({steps:M(vo)}),LF),listTemplates:b(N(),M(Qh).readonly()),saveTemplate:b(d({name:o(),steps:M(Tm).readonly(),engine:ta}),Qh,{kind:"mutation"}),updateTemplate:b(d({id:o(),name:o().optional(),steps:M(Tm).readonly().optional()}),Qh,{kind:"mutation"}),deleteTemplate:b(d({id:o()}),N(),{kind:"mutation"}),getCapabilities:b(N(),WF),getAddonModels:b(d({addonId:o()}),YF),downloadModel:b(d({addonId:o(),modelId:o(),format:Av}),QF,{kind:"mutation"}),deleteModel:b(d({addonId:o(),modelId:o(),format:Av}),d({success:G(!0)}),{kind:"mutation"}),runPipeline:b(d({engine:ta.optional(),steps:M(vo).min(1),frame:yv.optional(),frameRef:EF.optional(),frameHandle:Ar.optional(),imageBase64:o().optional(),image:Ut(Uint8Array).optional(),referenceImage:o().optional(),deviceId:l().optional(),sessionId:o().optional(),plane:O(["full","frame"]).optional(),deviceKey:o().optional(),nativeCropRef:AF.optional()}),Rv,{kind:"mutation"}),runPipelineBatch:b(d({engine:ta.optional(),steps:M(vo).min(1),frames:M(yv).min(1).max(255),deviceId:l().optional(),sessionId:o().optional(),frameId:l().int().nonnegative().optional(),deviceKey:o().optional()}),d({results:M(Rv).readonly()}),{kind:"mutation"}),cacheFrameInPool:b(d({data:Ut(Uint8Array),width:l().int().positive(),height:l().int().positive(),format:O(["rgb","bgr","gray"])}),d({frameId:l(),width:l(),height:l()}),{kind:"mutation"}),inferCached:b(d({stepId:o(),frameId:l().int()}),X(o(),te()),{kind:"mutation"}),uncacheFrame:b(d({frameId:l().int()}),N(),{kind:"mutation"}),getEffectiveTuning:b(N(),d({batchMode:o(),windowMs:l(),maxBatchSize:l(),concurrency:l()})),listLoadedEngines:b(N(),M(d({engineKey:o(),engine:ta,modelsLoaded:M(o()).readonly(),inUseByCameras:M(l()).readonly(),kind:O(["runtime","warm-override","device-pool"]),poolPid:l().nullable(),idleMs:l().nullable(),idleTtlMs:l().nullable()})).readonly()),spinEngine:b(d({engine:ta}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),killEngine:b(d({engine:ta,force:A().optional()}),d({success:A(),reason:o().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:b(N(),M(qF).readonly()),getReferenceImage:b(d({filename:o()}),BF.nullable()),getReferenceAudioFiles:b(N(),M(UF).readonly()),getReferenceAudio:b(d({filename:o()}),FF.nullable()),getAudioCapabilities:b(N(),$F),runAudioTest:b(d({addonId:o(),modelId:o(),filename:o().optional(),settings:X(o(),te()).optional()}),VF,{kind:"mutation"}),getDetectionConfigSchema:b(N(),KF)}},JF=O(["include","exclude"]),co=d({id:o(),name:o().optional(),zoneIds:M(o()).min(1).readonly(),mode:JF,classFilter:M(o()).readonly().optional(),overlapThreshold:l().min(0).max(1).optional(),bboxInclusionPct:l().min(0).max(100).optional(),preferMask:A().optional(),enabled:A().default(!0)});M(co).readonly();var eH=O(["polygon","tripwire"]),tH=d({x:l(),y:l()}),Rs=d({id:o(),name:o(),kind:eH.default("polygon"),polygon:M(tH).readonly(),color:o().default("#3b82f6")}),nH={name:"zones",scope:"device",mode:"singleton",deviceTypes:[V.Camera],methods:{listZones:b(d({deviceId:l()}),M(Rs).readonly()),addZone:b(d({deviceId:l(),zone:Rs}),N(),{kind:"mutation",auth:"admin"}),removeZone:b(d({deviceId:l(),zoneId:o()}),N(),{kind:"mutation",auth:"admin"}),updateZone:b(d({deviceId:l(),zone:Rs}),N(),{kind:"mutation",auth:"admin"})},runtimeState:d({zones:M(Rs).readonly()}),durability:"restored"},bb=O(["new","entered","left","moving","idle"]),aH=O(["motion","object","audio"]),iH=gt("kind",[Hs,op]),rH=O(["motion","audio","person","vehicle","animal","door","pir","smoke","water","button","package","generic"]),oH=O(["motion","audio","detection","sensor","control","custom","package"]),sH=O(["macro","sub"]),qR=d({kind:o(),labelKey:o(),label:o(),color:o(),iconId:o(),icon:rH,category:oH,parentKind:o().nullable(),level:sH,source:d({capName:o(),deviceId:l()})}),lH=d({deviceId:l(),kinds:M(qR).readonly()}),cH=d({id:o(),deviceId:l(),sourceDeviceId:l(),kind:o(),value:X(o(),te()).nullable(),timestamp:l()}),BR=d({x:l(),y:l(),timestamp:l(),bbox:Fi}),uH=d({timestamp:l(),position:BR,mediaKey:o()}),dH=d({minX:l(),minY:l(),maxX:l(),maxY:l()}),UR=O(["full","slim"]),mH=d({label:o(),peakScore:l(),count:l(),firstAt:l(),lastAt:l()}),pH=O(["pipeline","sensor","audio"]),Sb=O(["none","staging","trained"]),xb={markForTrain:A().optional(),debug:A().optional(),favourited:A().optional()},FR={retrainStatus:Sb.optional()},fH=d(xb),hH=d({trackId:o(),markForTrain:A(),debug:A(),favourited:A(),retrainStatus:Sb});tt([G(1),G(2)]);var Mw=d({stepId:o(),modelId:o().optional(),decidedAt:l(),identityId:o().optional()}),kb={label:o().optional(),labelScore:l().optional(),labelMeta:Mw.optional(),subLabel:o().optional(),subLabelScore:l().optional(),subLabelMeta:Mw.optional()},gH=d({deviceId:l(),tracks:l().int(),files:l().int(),bytes:l().int()}),vH=d({generatedAt:l(),trackCount:l().int(),fileCount:l().int(),byteCount:l().int(),truncated:A(),devices:M(gH).readonly()}),Jd=d({trackId:o(),deviceId:l(),className:o(),...kb,producingDeviceName:o().optional(),source:pH.optional(),firstSeen:l(),lastSeen:l(),positions:M(BR).readonly(),snapshots:M(uH).readonly(),zonesVisited:M(o()).readonly(),zoneNames:M(o()).readonly().optional(),classes:M(o()).readonly().optional(),totalDistance:l(),state:bb,active:A(),importance:l().optional(),bestEventId:o().optional(),importanceReason:o().optional(),audioLabels:M(mH).readonly().optional(),envelope:dH.optional(),hasFace:A().optional(),hasEmbeddedFace:A().optional(),hasRider:A().optional(),previewMissReason:o().optional(),...xb,...FR}),wb={id:o(),deviceId:l(),timestamp:l()},yH=d({...wb,kind:G("motion"),regionCount:l(),regions:M(d({bbox:Fi,pixelCount:l(),intensity:l()})).readonly().optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaUrl:o().optional()}),HR=O(["pipeline","onboard"]),bH=O(["enter","exit"]),SH=d({direction:bH,zoneId:o(),zoneName:o().optional()}),$R=d({...wb,kind:G("object"),source:HR.optional(),frameId:o().optional(),trackId:o().optional(),className:o(),...kb,confidence:l().optional(),bbox:Fi.optional(),zones:M(o()).readonly().optional(),state:bb.optional(),zoneCrossing:SH.optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaKey:o().optional(),keyFrameMediaKey:o().optional(),mediaUrl:o().optional(),importance:l().optional()}),xH=d({...wb,kind:G("audio"),rms:l(),dbfs:l(),classification:d({className:o(),originalClass:o().optional(),score:l()}).optional(),mediaUrl:o().optional()}),$s=O(["crop","thumbnail","snapshot","firstFrame","lastFrame","fullFrame","fullFrameBoxed","faceCrop","plateCrop","keyFrame","keyFrameSmall","thumbnailSmall"]),kH=d({key:o(),kind:$s,sizeBytes:l(),timestamp:l()}),_v=kH.extend({url:o(),base64:o()}),Cw=_v.omit({base64:!0}),wH=O(["person","vehicle","animal","package","face","plate"]),MH=O(["subject","model_error"]),CH=O(["operator","assist"]),QR=d({x:l(),y:l(),w:l(),h:l()}),Iv=d({id:o(),trackId:o(),deviceId:l(),mediaKey:o(),bbox:QR,macroClass:wH,label:o().optional(),subLabel:o().optional(),kind:MH,source:CH,assistModelId:o().optional(),assistScore:l().optional(),exportedInBatch:o().optional(),createdAt:l()}),VR=Iv.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),AH=d({trackId:o(),deviceId:l(),className:o(),label:o().optional(),firstSeen:l(),lastSeen:l(),frameCount:l().int(),annotationCount:l().int()}),EH=d({mediaKey:o(),kind:$s,timestamp:l(),sizeBytes:l().int(),copied:A()}),GR=d({frameId:o(),deviceId:l(),trackId:o(),sourceMediaKey:o(),sourceKind:$s,sizeBytes:l().int(),width:l().int(),height:l().int(),copiedAt:l()}),RH=O(["source-missing","unreadable-image","write-failed"]),_H=d({copied:M(GR).readonly(),refused:M(d({sourceMediaKey:o(),reason:RH})).readonly()}),IH=d({candidates:M(EH).readonly(),copies:M(GR).readonly(),autoPickMediaKey:o().optional()}),TH=gt("kind",[d({kind:G("package"),zone:QR.optional()}),d({kind:G("objects"),modelId:o(),minScore:l().optional()})]),NH=gt("kind",[d({kind:G("proposed"),modelId:o(),stepId:o(),minScore:l(),proposals:M(VR).readonly(),belowThreshold:l().int()}),d({kind:G("refused"),reason:o(),detail:o().optional()})]),Aw=d({trackId:o(),retrainStatus:Sb,changed:A(),reason:O(["unknown-track","no-frames-copied","not-staging","not-trained","unchanged"]).optional()}),ZR=1e3,KR=5e3,Tv=d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(KR).default(ZR),projection:O(["full","slim"]).optional()}),OH=Tv.extend({classFilter:o().optional()}),jH=d({deviceIds:M(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(1e3).default(200),cursor:o().optional(),projection:UR.optional(),includeStationary:A().optional()}),PH=d({tracks:M(Jd).readonly(),nextCursor:o().nullable()}),WR=50,YR=200,DH=d({deviceId:l(),since:l(),until:l(),limit:l().int().min(1).max(YR).default(WR),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),XR=d({id:o(),trackId:o(),timestamp:l(),className:o(),...kb,importance:l(),bestEventId:o(),windowMs:l().optional(),...xb,...FR}),zH=d({deviceIds:M(l()).min(1).max(200),since:l(),until:l(),limit:l().int().min(1).max(YR).default(WR),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),LH=d({deviceId:l(),events:M(XR).readonly()});d({trackId:o(),className:o(),confidence:l(),bbox:Fi,zones:M(o()).readonly(),state:bb});var qH=Bk({id:o(),kind:O(["first-level","detail"]),macroClass:o(),score:l(),bbox:d({x:l(),y:l(),width:l(),height:l()}),labels:M(Bk({label:o(),score:l()})).readonly(),parentId:o().optional()}),BH=$R.extend({score:l()}),UH=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)}),Ew=d({tracks:l().int(),events:l().int(),media:l().int(),faces:l().int(),plates:l().int(),embeddings:l().int()}),FH=d({mediaDropped:l().int(),tracks:l().int(),events:l().int()}),HH=d({deviceId:l(),rows:l().int(),bytes:l().int()}),$H=d({totalRows:l().int(),totalBytes:l().int(),devices:M(HH).readonly()}),QH=d({kind:$s,rows:l().int(),bytes:l().int()}),VH=d({totalRows:l().int(),totalBytes:l().int(),kinds:M(QH).readonly(),unaccountedRows:l().int(),unaccountedBytes:l().int()}),Rw=d({motion:l().int(),object:l().int(),audio:l().int()}),GH=d({deviceId:l().optional(),since:l().optional(),until:l().optional(),maxTracks:l().int().positive().optional(),executeOnNodeId:o().optional(),pacingMs:l().int().nonnegative().optional()}),ZH=d({deleted:l()}),KH=d({started:A(),alreadyRunning:A()}),WH=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()}),YH=d({started:A(),alreadyRunning:A()}),XH=d({mode:O(["report","reclaim"]).default("report"),scopes:M(O(["motion-still","track-filmstrip"])).min(1).optional(),deviceIds:M(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()}),JH=d({running:A(),mode:O(["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()}),e$=d({timestamp:l(),frame:Rv}),t$=d({className:o(),firstSeenMs:l(),lastSeenMs:l(),bbox:Fi,framesMatched:l().int()}),n$=d({tracks:M(t$).readonly()}),a$={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:b(d({deviceId:l()}),M(Jd).readonly()),getTrack:b(d({deviceId:l(),trackId:o()}),Jd.nullable()),listTracks:b(d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().optional(),zone:iH.optional(),projection:UR.optional(),includeStationary:A().optional()}),M(Jd).readonly()),listRecentTracks:b(jH,PH),clearTracks:b(d({deviceId:l()}),N(),{kind:"mutation",auth:"admin"}),getMotionEvents:b(Tv,M(yH).readonly()),getObjectEvents:b(OH,M($R).readonly()),getAudioEvents:b(Tv,M(xH).readonly()),listEventKinds:b(d({deviceId:l()}),M(qR).readonly()),listEventKindsBatch:b(d({deviceIds:M(l()).min(1).max(200)}),M(lH).readonly()),getSensorEvents:b(d({deviceId:l(),since:l().optional(),until:l().optional(),kinds:M(o()).optional(),limit:l().int().min(1).max(KR).default(ZR)}),M(cH).readonly()),getKeyEvents:b(DH,M(XR).readonly()),getKeyEventsBatch:b(zH,M(LH).readonly()),getEventDensity:b(d({deviceId:l(),since:l(),until:l(),bucketMs:l().int().positive()}),M(d({bucketStart:l(),motion:l().int(),object:l().int(),audio:l().int()})).readonly()),pruneEventsBefore:b(d({deviceId:l(),cutoffMs:l()}),d({motion:l().int(),object:l().int(),audio:l().int()}),{kind:"mutation",auth:"admin"}),pruneTracksBefore:b(d({deviceId:l(),cutoffMs:l()}),Ew,{kind:"mutation",auth:"admin"}),wipeAllAnalytics:b(d({deviceId:l()}),Ew,{kind:"mutation",auth:"admin"}),reconcileFromDisk:b(d({deviceId:l()}),FH,{kind:"mutation",auth:"admin"}),deleteTracks:b(d({deviceId:l(),trackIds:M(o()).min(1)}),d({deleted:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),setTrackFlags:b(d({deviceId:l(),trackId:o(),flags:fH}),hH,{kind:"mutation"}),getEventStoreFootprint:b(d({}),$H,{kind:"query",auth:"admin"}),getEventMediaFootprintByKind:b(d({deviceId:l().int().optional()}),VH,{kind:"query",auth:"admin"}),pruneEvents:b(d({olderThanMs:l(),reason:tb.optional()}),Rw,{kind:"mutation",auth:"admin"}),deleteDeviceEvents:b(d({deviceId:l()}),Rw,{kind:"mutation",auth:"admin"}),pauseForStorageMigration:b(wr,d({paused:G(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(wr,d({resumed:G(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(wr,d({refreshed:G(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(D8,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),wc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateMedia:b(UE,d({jobId:o()}),{kind:"mutation",auth:"admin"}),countUnstampedEventMedia:b(d({}),P8,{auth:"admin"}),countRelocatableMedia:b(nq,tq,{kind:"query",auth:"admin"}),listRelocateMediaJobs:b(d({}),M(wc).readonly(),{kind:"query",auth:"admin"}),cancelRelocateMedia:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(jE,M(OE).readonly(),{kind:"query",auth:"admin"}),reclaimDebugMedia:b(XH,YH,{kind:"mutation",auth:"admin"}),getMediaReclaimStatus:b(d({}),JH,{kind:"query",auth:"admin"}),getTrainingExportSummary:b(d({deviceIds:M(l()).optional()}),vH,{kind:"query",auth:"admin"}),getTrainingExportUrl:b(d({deviceIds:M(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),listRetrainStaging:b(d({deviceIds:M(l()).optional(),limit:l().int().min(1).max(500).optional()}),M(AH).readonly(),{kind:"query",auth:"admin"}),listRetrainFrames:b(d({trackId:o()}),IH,{kind:"query",auth:"admin"}),selectRetrainFrames:b(d({deviceId:l(),trackId:o(),mediaKeys:M(o()).min(1)}),_H,{kind:"mutation",auth:"admin"}),deselectRetrainFrame:b(d({deviceId:l(),trackId:o(),frameId:o()}),d({removed:A(),removedAnnotations:l().int()}),{kind:"mutation",auth:"admin"}),getRetrainFrameImage:b(d({frameId:o()}),d({base64:o(),width:l().int(),height:l().int()}),{kind:"query",auth:"admin"}),proposeRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),subject:TH,nodeId:o().optional()}),NH,{kind:"mutation",auth:"admin"}),runReplayFrameProcessor:b(d({deviceId:l(),source:HR,zones:M(Rs).readonly().optional(),detectionRules:M(co).readonly().optional(),zoneMembershipMinOverlap:l().min(0).max(1).optional(),frames:M(e$).min(1)}),n$,{kind:"mutation",auth:"admin"}),listRetrainAnnotations:b(d({trackId:o()}),M(Iv).readonly(),{kind:"query",auth:"admin"}),saveRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),annotations:M(VR)}),M(Iv).readonly(),{kind:"mutation",auth:"admin"}),completeRetrainTrack:b(d({deviceId:l(),trackId:o()}),Aw,{kind:"mutation",auth:"admin"}),restageRetrainTrack:b(d({deviceId:l(),trackId:o()}),Aw,{kind:"mutation",auth:"admin"}),getRetrainExportUrl:b(d({deviceIds:M(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),getEventMedia:b(d({eventId:o(),kind:$s.optional(),deviceId:l()}),M(_v).readonly()),getTrackMedia:b(d({trackId:o(),kinds:M($s).optional(),deviceId:l()}),M(_v).readonly()),listTrackMedia:b(d({trackId:o(),deviceId:l()}),M(Cw).readonly()),listEventMedia:b(d({eventId:o(),deviceId:l()}),M(Cw).readonly()),searchObjectEvents:b(UH,M(BH).readonly()),wipeObjectEmbeddings:b(d({}),ZH,{kind:"mutation",auth:"admin"}),rebuildObjectEmbeddings:b(GH,KH,{kind:"mutation",auth:"admin"}),getObjectEmbeddingRebuildStatus:b(d({}),WH)},events:{onFrameTracked:{data:d({deviceId:l(),timestamp:l(),frameWidth:l(),frameHeight:l(),detections:M(qH).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:aH,eventId:o(),timestamp:l()})}}};d({activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()});var Mb=d({detectionMode:O(["disabled","always-on","on-motion"]),configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceTimeMs:l(),droppedFrames:l(),phase:O(["idle","watching","active"])}),i$=Mb.extend({deviceId:l()}),Nm=d({x:l(),y:l(),w:l(),h:l()}),r$=d({bytes:Ut(Uint8Array).optional(),jpeg:o().optional(),width:l().int().positive(),height:l().int().positive(),tier:O(["native","ram-fullframe"]).optional()}),o$=d({bbox:Nm,className:o()}),JR=d({stepId:o(),className:o(),score:l(),bbox:Nm.optional(),embedding:o().optional(),embeddingMagnitude:l().optional(),embeddingModelId:o().optional(),label:o().optional(),labelTier:tt([G(1),G(2)]).optional(),labelModelId:o().optional(),alignedCropJpeg:o().optional(),nativeFaceShortSidePx:l().optional()}),s$=O(["unknown-step","model-not-servable","unreadable-frame","execution-failed"]),l$=gt("kind",[d({kind:G("ran"),nodeId:o(),modelId:o(),details:M(JR)}),d({kind:G("refused"),nodeId:o(),reason:s$,detail:o()})]),_w={min:0,default:3e4},Iw={min:0,max:6e5},Tw={min:5e3,max:6e5},Vh={min:1,max:30,default:4},Gh={min:1,max:30,default:10},Zh={min:0,max:300,default:300},Kh={min:1,max:10,default:4},Cb=O(["onboard","analyzer"]),c$=M(Cb),u$=d({deviceId:l(),detected:A(),source:Cb.default("analyzer"),regions:M(Rm).readonly().optional()}),d$=gt("kind",[d({kind:G("local-broker")}),d({kind:G("remote-restream"),ownerNodeId:o(),ownerReachableHost:o().optional(),hubHostnameOverride:o().optional()})]).describe("Per-camera frame-source mode for the runner (P2c)"),m$=d({deviceKey:o(),weight:l().positive().default(1),maxSessions:l().int().positive().nullable().default(null)}),p$=d({deviceId:l(),detectionMode:O(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:O(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:l().min(_w.min).default(_w.default),maxSessionHoldMs:l().min(Iw.min).max(Iw.max).optional(),audioMotionWindowMs:l().min(Tw.min).max(Tw.max).optional(),motionFps:l().min(Vh.min).max(Vh.max).default(Vh.default),detectionFps:l().min(Gh.min).max(Gh.max).default(Gh.default),motionStreamId:o(),detectionStreamId:o(),motionSources:c$.default(["analyzer"]),pipelineEnabled:A().default(!0),steps:M(vo).readonly().optional(),audio:d({modelId:o().optional(),enabled:A()}).nullable().optional(),zones:M(Rs).readonly().default([]),onboardMotionDrivesAnalyzer:A().default(!0),occupancyRecheckEnabled:A().default(!0),occupancyRecheckSec:l().min(Zh.min).max(Zh.max).default(Zh.default),occupancyRecheckFrames:l().min(Kh.min).max(Kh.max).default(Kh.default),frameSource:d$.default({kind:"local-broker"}),deviceKey:o().optional(),inferenceDevices:M(m$).readonly().optional()}),e_=d({nodeId:o(),attachedCameras:l(),activeCameras:l(),avgInferenceFps:l(),avgInferenceTimeMs:l(),queueDepthTotal:l(),devices:M(d({deviceKey:o(),backend:o(),attachedCameras:l(),queueDepthTotal:l()})).default([]),hardware:d({hasGpu:A(),inferenceBackend:o().optional(),cpuCores:l().optional()})}),Nw=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()}),f$=d({node:Nw,cameras:M(Nw.extend({deviceId:l()}))}),h$=d({nodeId:o(),activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l(),frameLazy:f$.optional()}),g$={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:b(p$,d({success:G(!0)}),{kind:"mutation"}),detachCamera:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation"}),reportMotion:b(u$,d({success:G(!0)}),{kind:"mutation"}),getLocalLoad:b(N(),e_),getLocalMetrics:b(N(),h$),getCameraMetrics:b(d({deviceId:l()}),Mb.nullable()),getAllCameraMetrics:b(N(),M(i$).readonly()),getLocalCameras:b(N(),M(l()).readonly()),getNativeCrop:b(d({handle:Ar,bbox:Nm,maxWidth:l().int().positive().optional(),encodeJpeg:A().optional()}),r$.nullable()),runDetailSubtree:b(d({deviceId:l(),frameHandle:Ar.optional(),frameJpeg:o().optional(),cropJpeg:o().optional(),parent:o$,steps:M(o()).optional()}),d({details:M(JR)}).nullable(),{kind:"mutation"}),runStatelessStep:b(d({stepId:o(),modelId:o(),frameJpeg:o(),bbox:Nm,className:o(),sourceDeviceId:l()}),l$,{kind:"mutation"})}},em=d({engine:ta.optional(),steps:M(vo).readonly(),audio:d({engine:ta.optional(),modelId:o().optional(),enabled:A(),settings:X(o(),te()).readonly().optional()}).nullable().optional()}),Wh=d({id:o(),name:o(),description:o().optional(),config:em,createdAt:o(),updatedAt:o()}),Ab=d({modelId:o().optional(),settings:X(o(),te()).optional(),jumpDeviceKey:o().optional()}),Ow=d({maxCameras:l().int().nonnegative().nullable().default(null),detectWeight:l().positive().optional(),detect:A().optional(),decode:A().optional(),audio:A().optional(),ingest:A().optional(),reachableHost:o().optional(),inferenceDevices:X(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:X(o(),Ab).optional()})).optional()}),t_=d({steps:M(vo).readonly(),audio:d({modelId:o(),enabled:A()}).nullable()}),Nv=d({modelId:o().optional(),settings:X(o(),te()).readonly().optional()}),v$=d({pinnedAgentNodeId:o().optional(),stepToggles:X(o(),A()).optional(),stepOverridesByDevice:X(o(),X(o(),X(o(),Nv))).optional(),pipelineByAgent:X(o(),t_).optional()}),jw=d({deviceId:l(),agentNodeId:o(),pinned:A(),reason:O(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:l()}),y$=d({nodeId:o(),online:A(),load:e_,score:l(),decodeHwaccel:o().nullable()}),b$=d({totalAgents:l(),onlineAgents:l(),totalCameras:l(),attachedCameras:l(),activeCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()}),S$=X(o(),o()),x$=d({ownerNodeId:o(),reachableHost:o().optional(),configIssue:o().optional()}),k$=d({camStreamId:o(),codec:o(),width:l(),height:l(),fps:l(),kind:o()}),w$=d({streams:M(k$).readonly()}),M$=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()})}),C$=d({profile:o(),status:o(),codec:o(),width:l(),height:l(),subscribers:l(),inFps:l(),outFps:l()}),A$=d({profiles:M(C$).readonly(),webrtcSessions:l(),rtspRestream:A()}),E$=d({framesWritten:l(),getFrameHits:l(),getFrameMisses:l(),budgetMb:l()}),R$=d({nodeId:o(),formats:M(o()).readonly(),sessionCount:l(),shm:E$}),_$=d({enabled:A(),fps:l()}),I$=O(["idle","installing","verifying","ready","failed"]),T$=d({state:I$,error:o().optional()}),N$=O(["idle","watching","active"]),O$=d({nodeId:o(),engine:d({backend:o(),device:o()}),phase:N$,configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceMs:l(),provisioning:T$}),j$=d({nodeId:o(),enabled:A()}),P$=O(["off","continuous","events"]),D$=d({mode:P$,active:A(),storageBytes:l()}),z$=O(["source","broker","detection","recording","switches"]),L$=O(["timeout","error","partial"]),q$=d({stage:z$,reason:L$,elapsedMs:l()}),Pw=d({state:O(["idle","running","done","error"]),total:l().int().nonnegative(),completed:l().int().nonnegative(),currentDeviceId:l().int().nullable(),failed:M(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()}),Dw=d({deviceId:l(),assignment:M$,source:w$,broker:A$.nullable(),decoder:R$.nullable(),motion:_$.nullable(),detection:O$.nullable(),audio:j$.nullable(),recording:D$.nullable(),switchedOff:M(eb).readonly(),degraded:M(q$).readonly(),fetchedAt:l()}),B$=["disabled","unavailable","cannot-host-camera-root","accelerator-preferred"],U$=O(B$),F$=d({key:o(),backend:o(),device:o(),format:O(ap),available:A(),enabled:A(),weight:l(),maxSessions:l().nullable(),defaultModelId:o(),steps:X(o(),Ab).optional(),exclusion:U$.nullable()}),H$=d({nodeId:o(),reachable:A(),devices:M(F$).readonly()}),$$={name:"pipeline-orchestrator",scope:"system",mode:"singleton",nodeIdMode:"data",exposesDeviceSettings:!0,methods:{pauseForStorageMigration:b(wr,d({paused:G(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(wr,d({resumed:G(!0)}),{kind:"mutation",auth:"admin"}),assignPipeline:b(d({deviceId:l(),agentNodeId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setPipelineDevicePin:b(d({deviceId:l(),deviceKey:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getPipelineDevicePin:b(d({deviceId:l()}),d({deviceKey:o().nullable()})),rebalance:b(N(),d({migrated:l()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:b(N(),M(jw).readonly()),getPipelineAssignment:b(d({deviceId:l()}),jw.nullable()),getAgentLoad:b(N(),M(y$).readonly()),getGlobalMetrics:b(N(),b$),getCameraMetrics:b(d({deviceId:l()}),Mb.nullable()),getCapabilityBindings:b(d({nodeId:o()}),S$),setCapabilityBinding:b(d({nodeId:o(),capName:o(),addonId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getIngestOwner:b(N(),x$),assignAudio:b(d({deviceId:l(),nodeId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:b(d({deviceId:l()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:b(d({deviceId:l()}),d({nodeId:o(),pinned:A(),assignedAt:l()}).nullable()),getAudioNodeLoad:b(N(),M(d({nodeId:o(),deviceCount:l()}))),getAudioAssignments:b(N(),M(d({deviceId:l(),nodeId:o(),pinned:A(),assignedAt:l()}))),getAgentSettings:b(d({agentNodeId:o()}),Ow.nullable()),listAgentSettings:b(N(),M(d({nodeId:o(),settings:Ow})).readonly()),removeAgentSettings:b(d({agentNodeId:o()}),d({success:A(),removed:A()}),{kind:"mutation",auth:"admin"}),setAgentMaxCameras:b(d({agentNodeId:o(),maxCameras:l().int().nonnegative().nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setAgentDetectWeight:b(d({agentNodeId:o(),detectWeight:l().positive().nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setAgentCapabilities:b(d({agentNodeId:o(),detect:A().nullable().optional(),audio:A().nullable().optional(),ingest:A().nullable().optional()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setAgentReachableHost:b(d({agentNodeId:o(),reachableHost:o().nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setAgentInferenceDevices:b(d({agentNodeId:o(),inferenceDevices:X(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:X(o(),Ab).optional()}))}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getNodeInferenceDevices:b(d({nodeId:o()}),H$),resetNodePipelineDefaults:b(d({agentNodeId:o()}),d({success:G(!0),effectiveModelId:o().nullable(),clearedCameraOverrides:l()}),{kind:"mutation",auth:"admin"}),getCameraSettings:b(d({deviceId:l()}),v$.nullable()),setCameraStepToggle:b(d({deviceId:l(),addonId:o(),enabled:A().nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:b(d({deviceId:l()}),X(o(),X(o(),X(o(),Nv))).nullable()),setCameraStepOverride:b(d({deviceId:l(),agentNodeId:o(),deviceKey:o(),addonId:o(),patch:Nv.nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:b(d({deviceId:l(),agentNodeId:o(),pipeline:t_.nullable()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:b(d({deviceId:l(),agentNodeId:o().optional()}),em),getCameraSwitches:b(d({deviceId:l()}),Vk),setCameraSwitch:b(d({deviceId:l(),switchId:eb,enabled:A()}),Vk,{kind:"mutation",auth:"admin"}),getCameraStatus:b(d({deviceId:l()}),Dw),getCameraStatuses:b(d({deviceIds:M(l()).optional()}),M(Dw).readonly()),reconcileFromDisk:b(N(),Pw,{kind:"mutation",auth:"admin"}),getReconcileFromDiskStatus:b(N(),Pw,{auth:"admin"}),listTemplates:b(N(),M(Wh).readonly()),saveTemplate:b(d({name:o(),description:o().optional(),config:em}),Wh,{kind:"mutation",auth:"admin"}),updateTemplate:b(d({id:o(),name:o().optional(),description:o().optional(),config:em.optional()}),Wh,{kind:"mutation",auth:"admin"}),deleteTemplate:b(d({id:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"})}},Q$={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 V$(e){return Q$[e]??"generic"}var G$={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 Z$(e,t){const n=fb[t];if(n===void 0)throw new Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:V$(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(G$).map(([e,t])=>[e,Z$(e,t)])));var K$=O(["workspace","baked","data-root"]),W$=O(["idle","checking","staging","pending-restart","awaiting-confirmation"]),Y$=O(["in-sync","behind-patch","behind-series","ahead","unknown"]),X$=d({state:Y$,seedVersion:o().nullable(),contractVersion:o().nullable(),contractSource:O(["registry","running"]).nullable(),message:o()}),J$=d({fromVersion:o(),toVersion:o().nullable(),atMs:l(),reason:o()}),eQ=d({packageName:o(),runningVersion:o().nullable(),nodeRuntimeVersion:o().nullable(),activeVersion:o().nullable(),previousVersion:o().nullable(),seedVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),bootMode:K$,updateState:W$,pendingVersion:o().nullable(),rolledBack:J$.nullable(),stateFileCorrupt:A(),lastCheckedAtMs:l().nullable(),imageContract:X$.optional()}),tQ=d({packageName:o(),runningVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),checkedAtMs:l(),error:o().nullable()}),Yh=d({accepted:A(),targetVersion:o().nullable(),restarting:A(),message:o()}),nQ={name:"server-management",scope:"system",mode:"singleton",methods:{getServerPackageStatus:b(N(),eQ,{auth:"admin"}),checkServerUpdate:b(N(),tQ,{kind:"mutation",auth:"admin"}),applyServerUpdate:b(d({version:o().optional()}),Yh,{kind:"mutation",auth:"admin",timeoutMs:16*6e4}),rollbackServerUpdate:b(N(),Yh,{kind:"mutation",auth:"admin"}),restartServer:b(N(),Yh,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},_s=zz(),aQ=d({to:tt([_s,M(_s).min(1)]),cc:M(_s).optional(),bcc:M(_s).optional(),from:o().optional(),replyTo:o().optional(),subject:o(),text:o(),html:o().optional()}),iQ=d({messageId:o(),accepted:M(_s).default([]),rejected:M(_s).default([])}),zw=d({ready:A(),host:o(),error:o().optional(),lastVerifiedAt:l().optional()}),rQ={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:b(aQ,iQ,{kind:"mutation",auth:"admin",access:"create"}),verify:b(N(),zw,{kind:"mutation",auth:"admin",access:"view"}),getStatus:b(N(),zw,{auth:"admin"})}},oQ=d({base64:o(),contentType:o()}),sQ=d({lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),lastBytes:l().nullable(),lastStreamId:o().nullable()}),lQ={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:b(d({deviceId:l(),streamId:o().optional(),force:A().optional()}),oQ.nullable()),invalidateCache:b(d({deviceId:l()}),N(),{kind:"mutation",auth:"admin"}),getSnapshotOverview:Ph(d({deviceIds:M(l()).min(1).max(200)}),M(d({deviceId:l(),lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),etag:o().nullable()}))),getDebugState:Ph(d({deviceId:l()}),d({battery:d({sleeping:A(),lastUpdated:l(),lastContactAt:l().optional()}).nullable(),state:d({isBattery:A(),reason:O(["disabled","offline","sleeping","unreachable","waking"]).nullable()}),frame:d({capturedAt:l().nullable(),ageMs:l().nullable()}),waking:A()})),getSnapshotLinks:Ph(d({targets:M(d({deviceId:l(),width:l().int().positive().optional()})).min(1).max(200)}),M(d({deviceId:l(),url:o().nullable(),capturedAt:l().nullable(),ageMs:l().nullable(),expiresAt:l().nullable(),width:l().nullable(),neverCaptured:A(),sleeping:A(),stateReason:O(["disabled","offline","sleeping","unreachable","waking"]).nullable(),battery:A()})))},status:{schema:sQ,kind:"poll"}},Lw=d({userId:o(),username:o(),isAdmin:A(),provider:o(),email:o().optional(),displayName:o().optional(),hubUrl:o().optional(),scopes:M(ba).optional(),redirectUri:o().optional(),integrationId:o().optional(),jti:o().optional(),codeChallenge:o().optional(),sessionId:o().optional(),refreshTtl:tt([l().int().positive(),G("never")]).optional()}),cQ={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:b(d({claims:Lw,ttlSec:tt([l().int().positive(),G("never")]).optional()}),d({token:o()}),{auth:"admin"}),verifyBridgeToken:b(d({token:o()}),Lw.nullable(),{auth:"admin"})}},uQ=gt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:te(),nodeLocal:A(),shouldSaveDiskSpace:G(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:te(),nodeLocal:A(),shouldSaveDiskSpace:G(!1),minFreePercent:G(null)})]),dQ={name:"storage",scope:"system",mode:"singleton",methods:{resolve:b(d({location:Ii,relativePath:o()}),o()),write:b(d({location:Ii,relativePath:o(),data:Ut(Uint8Array)}),N(),{kind:"mutation"}),read:b(d({location:Ii,relativePath:o()}),Ut(Uint8Array)),exists:b(d({location:Ii,relativePath:o()}),A()),list:b(d({location:Ii,prefix:o().optional()}),M(o()).readonly()),delete:b(d({location:Ii,relativePath:o()}),N(),{kind:"mutation"}),getAvailableSpace:b(d({location:Ii}),l().nullable()),beginUpload:b(d({location:Ii,relativePath:o(),sizeBytes:l().optional()}),d({uploadId:o()}),{kind:"mutation"}),writeChunk:b(d({uploadId:o(),offset:l(),data:Ut(Uint8Array)}),N(),{kind:"mutation"}),finalizeUpload:b(d({uploadId:o()}),N(),{kind:"mutation"}),abortUpload:b(d({uploadId:o()}),N(),{kind:"mutation"}),beginDownload:b(d({location:Ii,relativePath:o()}),d({downloadId:o(),sizeBytes:l()}),{kind:"mutation"}),readChunk:b(d({downloadId:o(),offset:l(),length:l()}),Ut(Uint8Array)),endDownload:b(d({downloadId:o()}),N(),{kind:"mutation"}),listLocations:b(d({type:vv.optional()}),M(ga).readonly()),getDefaultLocation:b(d({type:vv}),ga.nullable()),listLocationDeclarations:b(N(),M(lq).readonly()),upsertLocation:b(ga.omit({createdAt:!0,updatedAt:!0}),ga,{kind:"mutation",auth:"admin"}),deleteLocation:b(d({id:o(),force:A().optional()}),N(),{kind:"mutation",auth:"admin"}),testLocation:b(d({id:o()}),d({ok:A(),error:o().optional()}),{auth:"admin"}),listProviders:b(N(),M(uQ).readonly()),testConfig:b(d({providerId:o(),locationId:o().optional(),config:X(o(),te())}),d({ok:A(),error:o().optional()}),{auth:"admin"})}},mQ=d({bytes:l().int().nonnegative()}),pQ=d({reclaimedBytes:l().int().nonnegative(),exhausted:A()}),fQ={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:b(d({locationId:o()}),mQ,{auth:"admin"}),evict:b(d({locationId:o(),targetBytes:l().int().positive()}),pQ,{kind:"mutation",auth:"admin"})}},hQ={name:"storage-migration",scope:"system",mode:"singleton",methods:{plan:b(Wk,H8,{auth:"admin"}),start:b(Wk,d({jobId:o()}),{kind:"mutation",auth:"admin"}),status:b(d({jobId:o().optional()}),Yk.nullable(),{auth:"admin"}),cancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),movers:b(d({}),M(Q8).readonly(),{auth:"admin"}),residue:b(d({}),M(V8).readonly(),{auth:"admin"}),drain:b(G8,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStart:b(iq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStatus:b(oq,rq.nullable(),{auth:"admin"}),cleanupCancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),history:b(d({}),M(Yk).readonly(),{auth:"admin"})}},gQ=gt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:te(),nodeLocal:A(),shouldSaveDiskSpace:G(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:te(),nodeLocal:A(),shouldSaveDiskSpace:G(!1),minFreePercent:G(null)})]),vQ=d({ok:A(),error:o().optional()}),yQ=d({location:ga,relativePath:o(),sizeBytes:l().optional()}),bQ=d({uploadId:o()}),SQ=d({uploadId:o(),offset:l(),data:Ut(Uint8Array)}),xQ=d({uploadId:o()}),kQ=d({uploadId:o()}),wQ=d({location:ga,relativePath:o()}),MQ=d({downloadId:o(),sizeBytes:l()}),CQ=d({downloadId:o(),offset:l(),length:l()}),AQ=d({downloadId:o()}),EQ={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:b(N(),gQ,{auth:"admin"}),testLocation:b(d({config:X(o(),te())}),vQ,{auth:"admin"}),resolve:b(d({location:ga,relativePath:o()}),o(),{auth:"admin"}),write:b(d({location:ga,relativePath:o(),data:Ut(Uint8Array)}),N(),{kind:"mutation",auth:"admin"}),read:b(d({location:ga,relativePath:o()}),Ut(Uint8Array),{auth:"admin"}),exists:b(d({location:ga,relativePath:o()}),A(),{auth:"admin"}),list:b(d({location:ga,prefix:o().optional()}),M(o()).readonly(),{auth:"admin"}),delete:b(d({location:ga,relativePath:o()}),N(),{kind:"mutation",auth:"admin"}),getAvailableSpace:b(d({location:ga}),l().nullable(),{auth:"admin"}),beginUpload:b(yQ,bQ,{kind:"mutation",auth:"admin"}),writeChunk:b(SQ,N(),{kind:"mutation",auth:"admin"}),finalizeUpload:b(xQ,N(),{kind:"mutation",auth:"admin"}),abortUpload:b(kQ,N(),{kind:"mutation",auth:"admin"}),beginDownload:b(wQ,MQ,{kind:"mutation",auth:"admin"}),readChunk:b(CQ,Ut(Uint8Array),{auth:"admin"}),endDownload:b(AQ,N(),{kind:"mutation",auth:"admin"})}},RQ=te().nullable(),Ov=X(o(),te()),qw=d({sessionId:o(),profileId:o(),label:o(),cols:l().int().positive(),rows:l().int().positive(),startedAt:l()}),_Q=d({profileId:o(),label:o(),description:o().optional(),executable:o().optional(),args:M(o()).readonly().optional(),cwd:o().optional(),environment:M(o()).readonly().optional(),settingsSchema:RQ.optional()}),Xl=d({instanceId:o(),cameraStableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),enabled:A(),executable:o(),args:M(o()).readonly(),cwd:o(),environment:M(o()).readonly(),profileSettings:Ov}),IQ=d({stableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),adoptable:A()}),TQ=gt("kind",[d({seq:l().int().positive(),kind:G("data"),data:o()}),d({seq:l().int().positive(),kind:G("exit"),exitCode:l().int(),signal:l().int().optional()})]),NQ=d({cursor:l().int().nonnegative(),reset:A(),snapshot:o().optional(),events:M(TQ).readonly()}),OQ={name:"terminal-session",scope:"system",mode:"singleton",methods:{listProfiles:b(N(),M(_Q).readonly(),{auth:"admin"}),listInstances:b(N(),M(Xl).readonly(),{auth:"admin"}),createInstance:b(d({targetNodeId:o().min(1),profileId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:M(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:M(o().max(4096)).max(64).optional(),profileSettings:Ov.optional()}),Xl,{kind:"mutation",auth:"admin"}),updateInstance:b(d({instanceId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:M(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:M(o().max(4096)).max(64).optional(),profileSettings:Ov.optional()}),Xl,{kind:"mutation",auth:"admin"}),deleteInstance:b(d({instanceId:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setInstanceEnabled:b(d({instanceId:o().min(1),enabled:A()}),Xl,{kind:"mutation",auth:"admin"}),listLegacyCameras:b(N(),M(IQ).readonly(),{auth:"admin"}),adoptLegacyMonitor:b(d({stableId:o().min(1),name:o().trim().min(1).max(160).optional()}),Xl,{kind:"mutation",auth:"admin"}),listSessions:b(N(),M(qw).readonly(),{auth:"admin"}),openSession:b(d({profileId:o(),cols:l().int().positive(),rows:l().int().positive(),executable:o().max(1024).optional(),args:M(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:M(o().max(4096)).max(64).optional()}),qw,{kind:"mutation",auth:"admin"}),resize:b(d({sessionId:o(),cols:l().int().positive(),rows:l().int().positive()}),N(),{kind:"mutation",auth:"admin"}),pullOutput:b(d({sessionId:o(),afterSeq:l().int().nonnegative(),waitMs:l().int().min(0).max(2e3).default(0),waitForOutput:A().optional()}),NQ,{kind:"mutation",auth:"admin",timeoutMs:15e3}),writeInput:b(d({sessionId:o(),data:o().max(64*1024)}),N(),{kind:"mutation",auth:"admin"}),close:b(d({sessionId:o()}),N(),{kind:"mutation",auth:"admin"})}},jQ=d({urls:tt([o(),M(o())]),username:o().optional(),credential:o().optional()}),PQ={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:b(N(),M(jQ).readonly())}},DQ=d({credentialId:o(),label:o(),createdAt:l(),lastUsedAt:l().nullable(),transports:M(o()).default([])}),zQ={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:b(d({userId:o(),username:o()}),d({optionsJSON:X(o(),te())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:b(d({userId:o(),response:X(o(),te()),label:o()}),d({success:G(!0),credentialId:o()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:b(d({userId:o().optional()}),d({optionsJSON:X(o(),te())}),{kind:"mutation",access:"view",auth:"admin"}),finishAuthentication:b(d({userId:o(),response:X(o(),te())}),d({verified:A()}),{kind:"mutation",access:"view",auth:"admin"}),beginDiscoverableAuthentication:b(d({}),d({optionsJSON:X(o(),te())}),{kind:"mutation",access:"view",auth:"admin"}),finishDiscoverableAuthentication:b(d({response:X(o(),te())}),d({verified:A(),userId:o().nullable()}),{kind:"mutation",access:"view",auth:"admin"}),listPasskeys:b(d({userId:o()}),M(DQ),{auth:"admin"}),removePasskey:b(d({userId:o(),credentialId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getSecondFactorPreference:b(d({userId:o()}),d({enabled:A()}),{auth:"admin"}),setSecondFactorPreference:b(d({userId:o(),enabled:A()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"create"})}},n_=O(["cosine","dot","euclidean"]),Qc=X(o(),tt([o(),l(),A()])),a_=d({equals:X(o(),tt([o(),l(),A()])).optional(),between:X(o(),Uc([l(),l()])).optional()}),LQ=d({id:o(),vector:o(),metadata:Qc}),qQ=d({id:o(),score:l(),metadata:Qc}),BQ=d({index:o(),dim:l().int().positive(),metric:n_.default("cosine")}),UQ=d({index:o(),items:M(LQ)}),FQ=d({upserted:l(),rejected:l()}),HQ=d({index:o(),vector:o(),topK:l().int().positive(),minScore:l().optional(),filter:a_.optional()}),$Q=d({matches:M(qQ),scanned:l(),truncated:A(),effectiveTopK:l().int().positive()}),QQ=d({index:o(),ids:M(o())}),VQ=d({index:o(),filter:a_}),Bw=d({deleted:l()}),GQ=d({index:o(),ids:M(o())}),ZQ=d({items:M(d({id:o(),metadata:Qc}))}),KQ=d({index:o(),ids:M(o())}),WQ=d({items:M(d({id:o(),vector:o(),metadata:Qc}))}),YQ=d({index:o(),cursor:l().int().nonnegative().default(0),limit:l().int().positive()}),XQ=d({items:M(d({id:o(),metadata:Qc})),nextCursor:l().int().nonnegative().nullable()}),JQ=d({index:o()}),eV=d({backend:o(),count:l(),dim:l(),metric:n_,bytes:l().optional(),exact:A()}),tV={name:"vector-store",scope:"system",mode:"singleton",internal:!0,methods:{declareIndex:b(BQ,N(),{kind:"mutation",auth:"admin"}),upsert:b(UQ,FQ,{kind:"mutation",auth:"admin"}),query:b(HQ,$Q,{auth:"admin"}),getByIds:b(GQ,ZQ,{auth:"admin"}),fetchByIds:b(KQ,WQ,{auth:"admin"}),scan:b(YQ,XQ,{auth:"admin"}),deleteByIds:b(QQ,Bw,{kind:"mutation",auth:"admin"}),deleteByFilter:b(VQ,Bw,{kind:"mutation",auth:"admin"}),stats:b(JQ,eV,{auth:"admin"})}},nV=d({id:o(),source:o(),kind:O(["motion","object","audio","native"]),timeRange:d({startMs:l(),endMs:l()}),labels:M(o()).max(3).optional(),thumbnail:o().optional(),stillAtMs:l().optional(),eventIds:M(o()).optional(),eventCount:l().int().nonnegative().optional(),holes:M(d({startMs:l(),endMs:l()})).optional()}),aV=d({playbackUrl:o(),playbackEndpoints:M(o()).optional(),token:o().optional()}),iV={name:"videoclips",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],methods:{listClips:b(d({deviceId:l(),since:l(),until:l(),limit:l().int().positive().optional()}),M(nV).readonly(),{kind:"query",auth:"admin"}),getClipPlayback:b(d({deviceId:l(),clipId:o()}),aV,{kind:"query",auth:"admin"})}},Uw=d({viewportWidth:l().int().positive().optional(),viewportHeight:l().int().positive().optional(),devicePixelRatio:l().positive().optional(),downlinkMbps:l().nonnegative().optional(),prefersTier:o().optional()}).partial(),tm=gt("kind",[d({kind:G("adaptive")}),d({kind:G("profile"),profile:Mn}),d({kind:G("cam-stream"),camStreamId:o().min(1)})]),rV=d({id:o(),label:o(),target:tm,codec:o().nullable(),resolution:d({width:l(),height:l()}).nullable(),status:O(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:l().nullable(),decodeFps:l().nullable(),bitrateKbps:l().nullable()}),oV={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[V.Camera],methods:{listStreams:b(d({deviceId:l().int().nonnegative()}),M(rV)),createSession:b(d({deviceId:l().int().nonnegative(),target:tm,hints:Uw.optional(),relayOnly:A().optional(),consumerAttribution:xv.optional()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation"}),handleOffer:b(d({deviceId:l().int().nonnegative(),target:tm.optional(),sdpOffer:o(),sessionId:o().optional(),relayOnly:A().optional(),nonTrickle:A().optional(),disableTurn:A().optional(),disableIpv6:A().optional(),consumerAttribution:xv.optional(),hints:Uw.optional()}),d({sessionId:o(),sdpAnswer:o()}),{kind:"mutation"}),handleAnswer:b(d({deviceId:l().int().nonnegative(),sessionId:o(),sdpAnswer:o()}),N(),{kind:"mutation"}),addIceCandidate:b(d({deviceId:l().int().nonnegative(),sessionId:o(),candidate:o(),sdpMid:o().nullable().optional(),sdpMLineIndex:l().int().nullable().optional()}),N(),{kind:"mutation"}),getIceCandidates:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({candidates:M(d({candidate:o(),sdpMid:o().nullable(),sdpMLineIndex:l().int().nullable()})),done:A()}),{kind:"query"}),closeSession:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),N(),{kind:"mutation"}),hasAdaptiveBitrate:b(d({deviceId:l().int().nonnegative(),profile:Mn}),A()),getSessionState:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({pendingRenegotiation:d({target:tm,epoch:l()}).nullable()}))},mount:{kind:"server-provided"}},sV=d({childDeviceIds:M(l()).readonly(),hiddenChildIds:M(l()).readonly()}),lV={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera,V.Hub,V.Switch,V.Light,V.Sensor,V.Thermostat,V.Cover,V.Lock,V.Fan,V.MediaPlayer,V.AlarmPanel,V.Generic],methods:{setChildHidden:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative(),hidden:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onAccessoriesChanged:{data:d({deviceId:l(),childDeviceIds:M(l()).readonly(),hiddenChildIds:M(l()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:l(),childDeviceId:l(),hidden:A()})}},status:{schema:sV,kind:"command-driven"}},cV=O(["install","update","uninstall","restart"]),i_=O(["queued","fetching","staged","validating","applying","restarting","applied","done","failed","skipped"]),uV=O(["framework","addon"]),dV=d({tsMs:l(),nodeId:o(),packageName:o(),phase:i_,message:o()}),mV=d({taskId:o(),nodeId:o(),packageName:o(),fromVersion:o().nullable(),toVersion:o(),target:uV,phase:i_,stagedPath:o().nullable(),attempts:l(),steps:M(dV),error:o().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable()}),pV=O(["running","completed","failed","partially-failed","cancelled"]),fV=O(["single","bulk","cluster"]),Fw=d({jobId:o(),kind:cV,createdAtMs:l(),createdBy:o(),scope:fV,tasks:M(mV),state:pV,schemaVersion:G(1)}),Hw=O(["debug","info","warn","error"]),jv=O(["off","latest","beta"]),r_=O(["off","latest","beta","inherit"]),hV=d({id:o(),name:o().optional(),version:o().optional(),description:o().optional(),icon:o().optional(),color:o().optional(),capabilities:M(te()).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()}),gV=d({pid:l().optional(),mode:o(),state:o()}),vV=d({phase:O(["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()}),yV=d({manifest:hV,declaration:te().optional(),source:o(),installSource:o().optional(),process:gV.optional(),hasBackup:A().optional(),health:vV.nullable().optional()}),bV=d({name:o(),version:o(),dir:o(),installSource:o().optional()}),SV=d({name:o(),currentVersion:o(),latestVersion:o(),category:O(["addon","core"]),requiresRestart:A(),isSystem:A()}),xV=d({version:o(),publishedAt:o(),deprecated:o().optional(),distTags:M(o()).readonly()}),kV=d({name:o(),version:o(),description:o(),keywords:M(o()).readonly(),publishedAt:o(),author:o(),installed:A(),installedVersion:o().optional()}),wV=d({channel:jv,intervalSeconds:l(),updateCheckIntervalSeconds:l()}),MV=r_,CV=te(),$w=te(),AV=te(),EV=O(["queued","updating","done","done-pending-restart","failed"]),RV=d({name:o(),isSystem:A(),fromVersion:o(),toVersion:o(),status:EV,error:o().optional(),startedAtMs:l().optional(),completedAtMs:l().optional()}),_V=O(["regular","system","restarting","finalizing"]);d({id:o(),nodeId:o(),startedAtMs:l(),completedAtMs:l().optional(),total:l(),completed:l(),failed:l(),current:o().nullable(),phase:_V,cancelled:A(),items:M(RV).readonly()});var IV=d({packageName:o(),currentVersion:o(),latestVersion:o().nullable(),hasUpdate:A(),description:o().optional(),buildId:o().nullable()}),TV=d({timestamp:o(),level:o(),message:o(),scope:o().optional()}),NV=te(),OV=d({addonId:o().min(1),action:o().min(1),input:te()}),jV={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:b(N(),M(yV).readonly()),getLogs:b(d({addonId:o(),limit:l().min(1).max(500).default(100),level:Hw.optional()}),M(NV)),listPackages:b(N(),M(bV).readonly()),installPackage:b(d({packageName:o(),version:o().optional()}),$w,{kind:"mutation",auth:"admin"}),installFromWorkspace:b(d({packageName:o()}),$w,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:b(N(),A()),listWorkspacePackages:b(N(),M(te()).readonly()),uninstallPackage:b(d({packageName:o()}),te(),{kind:"mutation",auth:"admin"}),reloadPackages:b(N(),AV,{kind:"mutation",auth:"admin"}),searchAvailable:b(d({query:o().optional()}),M(kV)),listUpdates:b(d({nodeId:o().optional()}),M(SV).readonly(),{auth:"admin"}),updatePackage:b(d({name:o().min(1),version:o().optional(),nodeId:o().optional()}),te(),{kind:"mutation",auth:"admin"}),rollbackPackage:b(d({name:o().min(1)}),d({rolledBackTo:o().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:b(d({nodeId:o().optional()}),te(),{kind:"mutation",auth:"admin"}),restartServer:b(d({confirm:G(!0)}),te(),{kind:"mutation",auth:"admin"}),getLastRestart:b(N(),d({kind:O(["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:b(N(),M(IV).readonly(),{auth:"admin"}),listCapabilityProviders:b(d({capName:o().min(1)}),M(d({addonId:o(),mode:O(["singleton","collection"]),isActive:A()})).readonly()),setCapabilityProviderEnabled:b(d({capName:o().min(1),addonId:o().min(1),enabled:A()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getVersions:b(d({name:o()}),M(xV).readonly()),restartAddon:b(d({addonId:o()}),CV,{kind:"mutation",auth:"admin"}),retryLoad:b(d({packageName:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:b(N(),wV,{auth:"admin"}),setAutoUpdateSettings:b(d({channel:jv,intervalSeconds:l().min(300).max(86400).optional(),updateCheckIntervalSeconds:l().min(900).max(604800).optional()}),te(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:b(d({addonId:o()}),MV,{auth:"admin"}),setAddonAutoUpdate:b(d({addonId:o(),channel:r_}),te(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:b(d({channel:jv}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),custom:b(OV,te(),{kind:"mutation"}),startJob:b(d({kind:O(["install","update","uninstall","restart"]),targets:M(d({name:o().min(1),version:o().min(1)})).min(1),nodeIds:M(o()).optional()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),getJob:b(d({jobId:o()}),Fw.nullable(),{auth:"admin"}),listJobs:b(d({activeOnly:A().optional()}),M(Fw),{auth:"admin"}),cancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),onAddonLogs:b(d({addonId:o(),level:Hw.optional()}),TV,{kind:"subscription"})},mount:{kind:"server-provided"}},Qw=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()}),PV={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:Qw,kind:"push"},runtimeState:Qw,durability:"restored",volatileStateFields:["lastFetchedAt"]},Vw=d({lux:l().min(0),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),DV={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:Vw,kind:"push"},runtimeState:Vw,durability:"restored",volatileStateFields:["lastFetchedAt"]},zV=d({className:o(),hits:l().int().nonnegative(),avgScore:l().min(0).max(1),peakScore:l().min(0).max(1)}),Gw=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:M(zV).readonly()}),LV=d({ts:l().int(),dbfs:l().nullable(),peakDbfs:l(),avgDbfs:l(),topClass:o().nullable(),topScore:l().min(0).max(1).nullable()}),qV=d({points:M(LV).readonly(),effectiveSampleEveryMs:l().int().positive(),windowMsActual:l().int().nonnegative()}),BV={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[V.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),Gw.nullable()),getHistory:b(d({deviceId:l(),windowSec:l().int().positive().optional(),sampleEveryMs:l().int().positive().optional()}),qV)},runtimeState:Gw,durability:"session"},Zw=d({enabled:A(),isRunning:A(),lastTriggeredAt:l(),lastError:o().nullable(),lastChangedAt:l()}),UV={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Automation],methods:{enable:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),trigger:b(d({deviceId:l().int().nonnegative(),skipCondition:A().optional()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:Zw,kind:"push"},runtimeState:Zw,durability:"session"},Xh=d({percentage:l().min(0).max(100),charging:O(["dc","solar","none"]),sleeping:A(),lastUpdated:l(),lastContactAt:l().optional(),binary:A().optional()}),FV={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera,V.Sensor,V.Button,V.Switch],methods:{wakeForStream:b(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:Xh})}},status:{schema:Xh,kind:"push",empty:{percentage:0,charging:"none",sleeping:!1,lastUpdated:0}},runtimeState:Xh,durability:"restored",volatileStateFields:["lastUpdated"]},Kw=d({on:A(),lastChangedAt:l()}),HV={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:Kw,kind:"push"},runtimeState:Kw,durability:"restored",volatileStateFields:["lastChangedAt"]},Ww=d({percentage:l().min(0).max(100),lastChangedAt:l()}),$V={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Light],methods:{setBrightness:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"})},events:{onBrightnessChanged:{data:d({deviceId:l(),percentage:l().min(0).max(100),lastChangedAt:l()})}},status:{schema:Ww,kind:"command-driven"},runtimeState:Ww,durability:"session"},QV={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Button],methods:{press:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})}},VV=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()}),GV=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()}),ZV={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],methods:{getCredentials:b(d({deviceId:l()}),VV.nullable(),{kind:"query",auth:"admin"})},status:{schema:GV,kind:"command-driven"}},Yw=d({detected:A(),lastChangedAt:l()}),KV={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:Yw,kind:"push"},runtimeState:Yw,durability:"restored",volatileStateFields:["lastChangedAt"]},Pv=O(["off","heat","cool","auto","heat_cool","fan_only","dry"]),Xw=d({mode:Pv,availableModes:M(Pv),fanMode:o(),availableFanModes:M(o()),preset:o(),availablePresets:M(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()}),WV={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Thermostat,V.Climate],methods:{setMode:b(d({deviceId:l().int().nonnegative(),mode:Pv}),N(),{kind:"mutation",auth:"admin"}),setFanMode:b(d({deviceId:l().int().nonnegative(),fanMode:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setTarget:b(d({deviceId:l().int().nonnegative(),target:l()}),N(),{kind:"mutation",auth:"admin"}),setTargetRange:b(d({deviceId:l().int().nonnegative(),targetLow:l(),targetHigh:l()}),N(),{kind:"mutation",auth:"admin"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),targetHumidity:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setSwingVertical:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setSwingHorizontal:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:Xw,kind:"push"},runtimeState:Xw,durability:"session"},Eb=d({r:l().int().min(0).max(255),g:l().int().min(0).max(255),b:l().int().min(0).max(255)}),Rb=d({h:l().min(0).max(360),s:l().min(0).max(100),v:l().min(0).max(100)}),YV=gt("mode",[d({mode:G("rgb"),rgb:Eb}),d({mode:G("hsv"),hsv:Rb}),d({mode:G("mired"),mireds:l().int().min(50).max(1e3)})]),Jw=d({mode:O(["rgb","hsv","mired"]),rgb:Eb.optional(),hsv:Rb.optional(),mireds:l().int().optional(),lastChangedAt:l()}),XV={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Light],methods:{setColor:b(d({deviceId:l().int().nonnegative(),color:YV}),N(),{kind:"mutation",auth:"admin"})},events:{onColorChanged:{data:d({deviceId:l(),mode:O(["rgb","hsv","mired"]),rgb:Eb.optional(),hsv:Rb.optional(),mireds:l().int().optional(),lastChangedAt:l()})}},status:{schema:Jw,kind:"command-driven"},runtimeState:Jw,durability:"session"},JV=gt("outcome",[d({outcome:G("validated"),latencyMs:l().nonnegative().optional(),detail:o().optional()}).strict(),d({outcome:G("rejected"),error:o()}).strict(),d({outcome:G("inconclusive"),error:o()}).strict()]),eG=d({settings:X(o(),te())}),tG=d({label:o()}),nG={name:"connection-test",scope:"system",mode:"collection",methods:{testSettings:b(eG,JV,{kind:"mutation",auth:"admin"}),describeTest:b(N(),tG,{auth:"admin"})}},e2=d({connected:A(),lastChangedAt:l()}),aG={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:e2,kind:"push"},runtimeState:e2,durability:"restored",volatileStateFields:["lastChangedAt"]},o_=d({key:o().min(1),label:o().min(1),level:l().min(0).max(100).nullable(),status:O(["ok","replace"]).nullable(),lastResetAt:l().nullable(),resettable:A()}),t2=d({items:M(o_),lastChangedAt:l()}),iG={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(V),deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:b(d({deviceId:l().int().nonnegative(),key:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:t2,kind:"push",empty:{items:[],lastChangedAt:0},itemArray:{path:"items",keyField:"key",labelField:"label",itemSchema:o_,emptyItem:{key:"",label:"",level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:t2.extend({lastFetchedAt:l()}),durability:"session"},n2=d({entryOpen:A(),lastChangedAt:l()}),rG={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:n2,kind:"push"},runtimeState:n2,durability:"restored",volatileStateFields:["lastChangedAt"]},oG=O(["numeric","select","text","datetime"]),a2=d({kind:oG,value:tt([l(),o()]),options:M(o()),lastChangedAt:l(),unit:o().optional(),min:l().optional(),max:l().optional(),step:l().optional(),precision:l().int().min(0).max(10).optional(),format:O(["date","time","datetime"]).optional()}),sG=gt("kind",[d({kind:G("numeric"),value:l()}),d({kind:G("select"),value:o().min(1)}),d({kind:G("text"),value:o()}),d({kind:G("datetime"),value:o().min(1)})]),lG={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Control],methods:{setValue:b(d({deviceId:l().int().nonnegative(),control:sG}),N(),{kind:"mutation",auth:"admin"})},status:{schema:a2,kind:"push"},runtimeState:a2,durability:"session"},cG=O(["open","opening","closing","closed","stopped"]),i2=d({state:cG,position:l().min(0).max(100).nullable(),tiltPosition:l().min(0).max(100).nullable(),lastChangedAt:l()}),uG={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Cover],methods:{open:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),close:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setTiltPosition:b(d({deviceId:l().int().nonnegative(),tiltPosition:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:i2,kind:"push"},runtimeState:i2,durability:"restored",volatileStateFields:["lastChangedAt"]},_b=O(["auto","day","night","schedule"]),r2=d({min:l(),max:l(),step:l()}),o2=d({mode:_b,sensitivity:l().optional(),switchDelaySec:l().optional(),lastFetchedAt:l()}),dG=d({modes:M(_b),supportsSensitivity:A(),sensitivity:r2.optional(),supportsSwitchDelay:A(),switchDelaySec:r2.optional()}),mG=d({mode:_b.optional(),sensitivity:l().optional(),switchDelaySec:l().optional()}),pG={name:"day-night",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"day-night",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),dG),setSettings:b(d({deviceId:l(),settings:mG}),N(),{kind:"mutation",auth:"admin"})},status:{schema:o2,kind:"poll"},runtimeState:o2,durability:"restored",volatileStateFields:["lastFetchedAt"]},Jh=d({online:A(),lastChangedAt:l()}),fG={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:Jh})}},status:{schema:Jh,kind:"push"},runtimeState:Jh,durability:"restored",volatileStateFields:["lastChangedAt"]},s2=d({lastPressedAt:l().nullable(),pressCountSinceStart:l()}),hG=d({deviceId:l(),timestamp:l()}),gG={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[V.Button,V.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:hG}},status:{schema:s2,kind:"push"},runtimeState:s2,durability:"restored"},vG=O(["date","time","datetime"]),l2=d({value:o(),format:vG.optional(),lastFetchedAt:l()}),yG={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:l2,kind:"push"},runtimeState:l2,durability:"restored",volatileStateFields:["lastFetchedAt"]},s_=d({deviceId:l(),eventType:o(),data:X(o(),te()).nullable(),timestamp:l(),seq:l()}),c2=d({eventTypes:M(o()),lastEvent:s_.nullable(),eventCountSinceStart:l()}),bG={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.EventEmitter],methods:{},events:{onEvent:{data:s_}},status:{schema:c2,kind:"push"},runtimeState:c2,durability:"session"},SG=d({id:o(),type:o(),timestamp:l(),label:o().optional(),thumbnailUrl:o().optional(),clipUrl:o().optional(),metadata:X(o(),te()).optional()}),xG={name:"events",scope:"device",mode:"singleton",deviceTypes:[V.Camera],methods:{getEvents:b(d({deviceId:l(),from:l().optional(),to:l().optional(),limit:l().optional()}),M(SG)),getEventThumbnail:b(d({deviceId:l(),eventId:o()}),d({base64:o(),contentType:o()}).nullable()),getEventClipUrl:b(d({deviceId:l(),eventId:o()}),o().nullable())}},u2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaKey:o().optional(),coverBase64:o().optional()}),kG=d({id:o(),source:O(["detected","photo"]),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),d2=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:Fi.optional(),keyFrameMediaKey:o().optional(),bestMatchScore:l().optional(),nativeFaceShortSidePx:l().optional(),suggestedIdentityId:o().optional(),suggestedMatchScore:l().optional()}),wG=O(["unassigned","recognized","identified","all"]),MG=O(["timestamp","suggestionConfidence"]),CG=O(["asc","desc"]),AG=d({faceIds:M(o()).readonly(),representativeFaceId:o(),size:l().int(),cohesion:l()}),EG=d({key:o(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),RG={name:"face-gallery",scope:"system",mode:"singleton",methods:{listIdentities:b(d({includeCrops:A().optional()}).optional(),M(u2).readonly()),createIdentity:b(d({name:o().min(1)}),u2,{kind:"mutation",auth:"admin"}),renameIdentity:b(d({id:o(),name:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deleteIdentity:b(d({id:o()}),N(),{kind:"mutation",auth:"admin"}),listIdentitySamples:b(d({identityId:o()}),M(kG).readonly()),removeSample:b(d({identityId:o(),sampleId:o()}),N(),{kind:"mutation",auth:"admin"}),listRecentFaces:b(d({deviceId:l().int().optional(),deviceIds:M(l().int()).optional(),limit:l().int().positive().optional(),filter:wG.optional(),since:l().int().optional(),until:l().int().optional(),sortBy:MG.optional(),sortDirection:CG.optional(),includeCrops:A().optional()}).optional(),M(d2).readonly()),getFaceByTrack:b(d({deviceId:l().int(),trackId:o()}),d2.nullable()),getFaceMedia:b(d({faceId:o()}),M(EG).readonly()),assignFace:b(d({faceId:o(),identityId:o()}),N(),{kind:"mutation",auth:"admin"}),unassignFace:b(d({faceId:o()}),N(),{kind:"mutation",auth:"admin"}),deleteFace:b(d({faceId:o()}),N(),{kind:"mutation",auth:"admin"}),assignFaces:b(d({faceIds:M(o()).min(1),identityId:o()}),d({assigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignFaces:b(d({faceIds:M(o()).min(1)}),d({unassigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),suggestFaceClusters:b(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(),M(AG).readonly())}},l_=O(["forward","reverse"]),m2=d({percentage:l().min(0).max(100).nullable(),percentageStep:l().positive().optional(),preset:o(),availablePresets:M(o()),direction:l_.nullable(),oscillating:A().nullable(),lastChangedAt:l()}),_G={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Fan],methods:{setPercentage:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setDirection:b(d({deviceId:l().int().nonnegative(),direction:l_}),N(),{kind:"mutation",auth:"admin"}),setOscillating:b(d({deviceId:l().int().nonnegative(),oscillating:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:m2,kind:"push"},runtimeState:m2,durability:"session"},eg=d({flags:X(o(),te()),deviceType:o().nullable(),model:o().nullable(),channelCount:l().nullable(),lastProbedAt:l(),lastFetchedAt:l()}),IG={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:d({deviceId:l(),status:eg})}},status:{schema:eg,kind:"push"},runtimeState:eg,durability:"session"},p2=d({flooded:A(),lastChangedAt:l()}),TG={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:p2,kind:"push"},runtimeState:p2,durability:"restored",volatileStateFields:["lastChangedAt"]},f2=d({detected:A(),lastChangedAt:l()}),NG={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:f2,kind:"push"},runtimeState:f2,durability:"restored",volatileStateFields:["lastChangedAt"]},h2=d({on:A(),currentHumidity:l().min(0).max(100).nullable(),targetHumidity:l().min(0).max(100).nullable(),mode:o().nullable(),availableModes:M(o()),action:o().nullable(),minHumidity:l().nullable(),maxHumidity:l().nullable(),lastChangedAt:l()}),OG={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Humidifier],methods:{setOn:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),humidity:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:h2,kind:"push"},runtimeState:h2,durability:"session"},g2=d({percent:l().min(0).max(100),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),jG={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor,V.Thermostat],methods:{},status:{schema:g2,kind:"push"},runtimeState:g2,durability:"restored",volatileStateFields:["lastFetchedAt"]},v2=d({url:o().nullable(),lastUpdated:l().nullable()}),PG={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Image],methods:{},status:{schema:v2,kind:"push"},runtimeState:v2,durability:"session"},Ib=O(["0","90","180","270"]),Tb=O(["auto","manual"]),Nb=O(["auto","manual"]),Ob=O(["off","blc","wdr","hlc"]),Jl=d({min:l(),max:l(),step:l()}),y2=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Ib.optional(),whiteBalance:Tb.optional(),warmth:l().optional(),exposureMode:Nb.optional(),backlightMode:Ob.optional(),lastFetchedAt:l()}),DG=d({supportsBrightness:A(),brightness:Jl.optional(),supportsContrast:A(),contrast:Jl.optional(),supportsSaturation:A(),saturation:Jl.optional(),supportsSharpness:A(),sharpness:Jl.optional(),supportsMirror:A(),supportsFlip:A(),rotateOptions:M(Ib),whiteBalanceModes:M(Tb),supportsWarmth:A(),warmth:Jl.optional(),exposureModes:M(Nb),backlightModes:M(Ob)}),zG=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Ib.optional(),whiteBalance:Tb.optional(),warmth:l().optional(),exposureMode:Nb.optional(),backlightMode:Ob.optional()}),LG={name:"image-settings",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"image-settings",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),DG),setSettings:b(d({deviceId:l(),settings:zG}),N(),{kind:"mutation",auth:"admin"})},status:{schema:y2,kind:"poll"},runtimeState:y2,durability:"restored",volatileStateFields:["lastFetchedAt"]},b2=d({id:o(),addonId:o(),name:o(),enabled:A(),info:X(o(),te()).readonly(),createdAt:l(),updatedAt:l(),processState:o()}),tg=d({id:o(),addonId:o(),name:o(),enabled:A(),info:X(o(),te()).readonly(),createdAt:l(),updatedAt:l()}),qG=d({addonId:o(),name:o(),description:o(),iconUrl:o().nullable(),color:o(),instanceMode:o(),mode:O(["standalone","account","broker"]),discoveryMode:o(),kind:O(["device-adoption","device-provider"]),brokerKind:o().nullable(),supportsLocationImport:A(),canTest:A(),existingInstances:M(d({id:o(),name:o()})),canAdd:A()}),BG=O(["validated","rejected","inconclusive","unsupported"]),UG=d({success:A(),error:o().optional(),status:BG.optional(),testedBy:o().nullable().optional(),latencyMs:l().nonnegative().optional(),detail:o().optional()}),FG=d({addonId:o(),name:o(),enabled:A().optional(),info:X(o(),te()).optional(),settings:X(o(),te()).optional(),skipRestart:A().optional()}),HG=d({id:o(),name:o().optional(),enabled:A().optional(),info:X(o(),te()).optional()}),$G=d({success:A(),deletedId:o()}),QG={name:"integrations",scope:"system",mode:"singleton",methods:{list:b(N(),M(b2)),get:b(d({id:o()}),b2),getByAddonId:b(d({addonId:o()}),tg.nullable()),create:b(FG,tg,{kind:"mutation",auth:"admin"}),update:b(HG,tg,{kind:"mutation",auth:"admin"}),delete:b(d({id:o()}),$G,{kind:"mutation",auth:"admin"}),getSettings:b(d({id:o()}),X(o(),te()),{auth:"admin"}),setSettings:b(d({id:o(),settings:X(o(),te())}),d({success:A()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:b(N(),M(qG),{auth:"admin"}),testConnection:b(d({addonId:o(),settings:X(o(),te())}),UG,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},VG=d({codecs:M(o()),sampleRate:l(),duplex:O(["half","full"]),maxBacklogMs:l()}),ng=d({talking:A(),lastSessionAt:l().nullable(),ability:VG.nullable()}),GG=O(["opus","s16le","g711ulaw","g711alaw"]),ZG={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],methods:{startSession:b(d({deviceId:l()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation",auth:"protected"}),handleAnswer:b(d({deviceId:l(),sessionId:o(),sdpAnswer:o()}),N(),{kind:"mutation",auth:"protected"}),stopSession:b(d({deviceId:l(),sessionId:o()}),N(),{kind:"mutation",auth:"protected"}),startTalkSession:b(d({deviceId:l()}),d({sessionId:o()}),{kind:"mutation",auth:"protected"}),pushTalkAudio:b(d({deviceId:l(),audioBase64:o(),codec:GG.optional(),sampleRate:l().int().positive().optional(),channels:l().int().positive().optional(),sequenceNumber:l().int()}),d({accepted:A()}),{kind:"mutation",auth:"protected"}),endTalkSession:b(d({deviceId:l()}),N(),{kind:"mutation",auth:"protected"})},events:{onStatusChanged:{data:d({deviceId:l(),status:ng})}},status:{schema:ng,kind:"command-driven"},runtimeState:ng,durability:"session"},KG=O(["idle","mowing","paused","docked","error"]),WG=O(["info","warning","error"]),S2=d({activity:KG,batteryLevel:l().min(0).max(100).nullable(),progressPercent:l().min(0).max(100).nullable(),currentCode:l().nullable(),currentCodeLabel:o().nullable(),severity:WG,lastChangedAt:l()}),YG={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.LawnMower],methods:{startMowing:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),dock:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:S2,kind:"push"},runtimeState:S2,durability:"session"},XG=O(["lan","wifi","docker","vpn","loopback","other"]),c_=d({name:o(),family:O(["IPv4","IPv6"]),address:o(),cidr:o(),netmask:o(),internal:A(),mac:o(),kind:XG,preferred:A(),plausible:A(),plausibleReason:o()}),JG=d({interfaces:M(c_).readonly(),probedAt:l()}),eZ=c_.nullable(),tZ=d({label:o(),baseUrl:o(),kind:O(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:O(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:A(),plausibleReason:o(),priority:l()}),nZ=O(["server-config","server-env","caller-hint","default"]),aZ=d({port:l().int().min(1).max(65535),source:nZ}),iZ=d({endpoints:M(tZ).readonly(),localPort:aZ}),x2=d({baseUrl:o().nullable(),resolved:o().nullable()}),k2=d({baseUrls:M(o()).readonly(),resolved:M(o()).readonly()}),ag=d({addresses:M(o()).readonly()}),Ed=d({mode:O(["generated","uploaded","disabled"]),leafFingerprintSha256:o().nullable(),caFingerprintSha256:o().nullable(),validTo:o().nullable(),sans:M(o()),caCertPem:o().nullable(),reissueError:o().nullable(),restartRequired:A()}),rZ={name:"local-network",scope:"system",mode:"singleton",methods:{list:b(N(),JG),getPreferred:b(N(),eZ),getConnectionEndpoints:b(d({port:l().int().min(1).max(65535).optional(),includeLoopback:A().optional(),ipv4Only:A().optional(),scheme:O(["http","https"]).optional()}),iZ),getNotificationEndpoint:b(N(),x2),setNotificationEndpoint:b(d({baseUrl:o().nullable()}),x2,{kind:"mutation"}),getViewerEndpoints:b(N(),k2),setViewerEndpoints:b(d({baseUrls:M(o()).readonly()}),k2,{kind:"mutation"}),getAllowedAddresses:b(N(),ag),setAllowedAddresses:b(ag,d({success:G(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:b(N(),ag,{kind:"mutation"}),getTlsStatus:b(N(),Ed),regenerateCertificate:b(d({reason:o().optional()}),Ed,{kind:"mutation",auth:"admin"}),uploadCertificate:b(d({certPem:o().min(1),keyPem:o().min(1),caPem:o().optional()}),Ed,{kind:"mutation",auth:"admin"}),downloadCa:b(N(),d({pem:o()})),revertToGeneratedCertificate:b(N(),Ed,{kind:"mutation",auth:"admin"})},mount:{kind:"hub-only"}},oZ=O(["locked","unlocked","locking","unlocking","jammed"]),w2=d({state:oZ,lastChangedAt:l()}),sZ={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Lock],methods:{lock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),unlock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),open:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:w2,kind:"push"},runtimeState:w2,durability:"restored",volatileStateFields:["lastChangedAt"]},lZ=O(["off","on","idle","playing","paused","buffering","standby"]),u_=O(["off","all","one"]),cZ=d({type:o(),title:o(),artist:o().optional(),album:o().optional(),imageUrl:o().optional()}),M2=d({state:lZ,volumeLevel:l().min(0).max(100).nullable(),isMuted:A().nullable(),source:o(),availableSources:M(o()),currentMedia:cZ.nullable(),positionMs:l().int().nonnegative().nullable(),durationMs:l().int().nonnegative().nullable(),shuffle:A().nullable(),repeat:u_.nullable(),lastChangedAt:l()}),uZ={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.MediaPlayer],methods:{play:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),next:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),previous:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),seek:b(d({deviceId:l().int().nonnegative(),positionMs:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setVolume:b(d({deviceId:l().int().nonnegative(),volumeLevel:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setMute:b(d({deviceId:l().int().nonnegative(),muted:A()}),N(),{kind:"mutation",auth:"admin"}),setShuffle:b(d({deviceId:l().int().nonnegative(),shuffle:A()}),N(),{kind:"mutation",auth:"admin"}),setRepeat:b(d({deviceId:l().int().nonnegative(),repeat:u_}),N(),{kind:"mutation",auth:"admin"}),selectSource:b(d({deviceId:l().int().nonnegative(),source:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),playMedia:b(d({deviceId:l().int().nonnegative(),mediaId:o().min(1),mediaType:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:M2,kind:"push"},runtimeState:M2,durability:"session"},dZ=d({id:o(),label:o(),scope:O(["mesh","public"]),url:o(),hostname:o(),port:l(),protocol:O(["http","https"])}),mZ=d({id:o(),hostname:o(),magicDns:o(),addresses:M(o()).readonly(),os:o().optional(),online:A(),lastSeenMs:l(),isSelf:A(),connection:O(["direct","relay","idle"]),relay:o().nullable(),lastHandshakeMs:l(),rxBytes:l(),txBytes:l(),tags:M(o()).readonly(),exitNodeOption:A(),advertisedRoutes:M(o()).readonly(),userLogin:o().nullable(),keyExpiry:l().nullable()}),pZ=d({joined:A(),meshIp:o(),magicDnsHostname:o(),peerCount:l(),endpoints:M(dZ).readonly(),error:o().optional(),tenantName:o(),magicDnsSuffix:o(),userLogin:o().nullable(),controlPlaneUrl:o(),keyExpiry:l().nullable(),daemonSocket:o().optional(),daemonCliPath:o().optional()}),fZ={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:b(N(),pZ),join:b(d({authKey:o().min(8),hostname:o().optional()}),d({joined:G(!0)}),{kind:"mutation"}),startLogin:b(d({hostname:o().optional()}),d({loginUrl:o()}),{kind:"mutation"}),leave:b(N(),d({left:G(!0)}),{kind:"mutation"}),logout:b(N(),d({loggedOut:G(!0)}),{kind:"mutation"}),listPeers:b(N(),d({peers:M(mZ).readonly()})),testConnection:b(d({authKey:o().optional()}),d({ok:A(),tenant:o().optional(),daemonVersion:o().optional(),error:o().optional()}),{kind:"mutation"})}},C2=d({detected:A(),lastDetectedAt:l().nullable(),autoClearAfterMs:l().nullable()}),hZ=d({deviceId:l(),detected:A(),timestamp:l(),source:Cb,regions:M(Rm).readonly().optional()}),gZ={name:"motion",scope:"device",mode:"singleton",deviceNative:!0,deviceTypes:[V.Camera,V.Sensor],methods:{isDetected:b(d({deviceId:l()}),A())},events:{onMotionChanged:{data:hZ}},status:{schema:C2,kind:"push"},runtimeState:C2,durability:"session"},d_=d({enabled:A(),lastChangedAt:l()}),vZ=d_.extend({lastFetchedAt:l()}),yZ={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Light,V.Siren,V.Switch],methods:{setMotionTrigger:b(d({deviceId:l().int().nonnegative(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:d({deviceId:l(),enabled:A(),lastChangedAt:l()})}},status:{schema:d_,kind:"command-driven"},runtimeState:vZ,durability:"session"},m_=d({id:l(),enabled:A(),shape:ER}),A2=d({enabled:A(),sensitivity:l(),regions:M(m_),lastFetchedAt:l()}),bZ=d({maxRegions:l(),supportedShapes:M(RR),grid:BU,sensitivity:d({min:l(),max:l(),step:l()})}),SZ=d({enabled:A().optional(),sensitivity:l().optional(),regions:M(m_).optional()}),xZ={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:b(d({deviceId:l()}),bZ),setZone:b(d({deviceId:l(),patch:SZ}),N(),{kind:"mutation",auth:"admin"})},status:{schema:A2,kind:"poll"},runtimeState:A2,durability:"restored",volatileStateFields:["lastFetchedAt"]},Dv=O(["person","vehicle","animal","face","package","other"]),p_=d({class:Dv,timestamp:l(),confidence:l().min(0).max(1).optional()}),f_=d({lastByClass:fL(Dv,p_.nullable()),supportedClasses:M(Dv).readonly(),enabled:A()}),kZ=f_.extend({lastFetchedAt:l()}),wZ={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],methods:{setEnabled:b(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:d({deviceId:l(),detection:p_})}},status:{schema:f_,kind:"push"},runtimeState:kZ,durability:"restored",volatileStateFields:["lastFetchedAt"]},MZ=d({nominalBitrateKbps:l(),observedBitrateKbps:l(),peakBitrateKbps:l(),packetLossPercent:l(),lastUpdated:l()}),CZ=d({rttMs:l(),jitterMs:l(),estimatedBandwidthKbps:l(),packetLossPercent:l().min(0).max(100),lastUpdated:l()}),E2=d({deviceId:l(),streams:X(o(),MZ),client:CZ.optional()}),AZ={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:b(d({deviceId:l()}),E2.nullable()),getAllStats:b(N(),M(E2).readonly()),reportClientStats:b(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)}),N(),{kind:"mutation"})},mount:{kind:"server-provided"}},EZ=d({addonId:o(),capabilities:M(o()).readonly(),status:o()}),RZ=d({pid:l(),name:o(),state:o(),cpuPercent:l(),memoryRss:l(),uptimeSeconds:l(),services:M(EZ).readonly(),groupId:o().optional()}),_Z=d({id:o(),status:o(),cpuPercent:l(),memoryRss:l()}),IZ=d({category:o(),total:l(),healthy:l(),addons:M(_Z).readonly()}),TZ=d({name:o(),version:o()}),NZ=d({id:o(),name:o(),hostname:o(),platform:o(),arch:o(),cpuModel:o().nullable(),cpuCores:l(),memoryMB:l(),engines:M(o()).readonly(),isHub:A(),isOnline:A(),cpuPercent:l(),memoryPercent:l(),uptime:l(),lastSeen:o(),localIps:M(o()).readonly(),addons:M(d({id:o(),capabilities:M(o()).readonly(),status:o()})).readonly(),processes:M(RZ).readonly(),categories:M(IZ).readonly(),rootPackage:TZ.nullable()}),OZ=d({callerAddonId:o(),providerAddonId:o(),capName:o(),callsPerMin:l(),lastCallAtMs:l()}),jZ=d({nodeId:o(),name:o(),version:o(),status:o(),synced:A()}),PZ=d({hubVersion:o(),nodes:M(jZ)}),ig=d({nodeId:o(),addonId:o()}),DZ=d({id:o(),status:o(),version:o().optional(),packageName:o().optional()}),ec=d({success:A()}),zZ=d({success:A(),reason:o().optional()}),LZ=d({restarted:M(o()).readonly(),failed:M(o()).readonly()}),qZ=d({nodeId:o(),name:o()}),BZ={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:b(N(),M(NZ).readonly(),{auth:"admin"}),deployAddon:b(ig,ec,{kind:"mutation",auth:"admin"}),undeployAddon:b(ig,ec,{kind:"mutation",auth:"admin"}),restartAddon:b(ig,ec,{kind:"mutation",auth:"admin"}),restartProcess:b(d({nodeId:o(),processName:o()}),zZ,{kind:"mutation",auth:"admin"}),restartNode:b(d({nodeId:o()}),LZ,{kind:"mutation",auth:"admin"}),shutdownNode:b(d({nodeId:o()}),ec,{kind:"mutation",auth:"admin"}),renameNode:b(d({nodeId:o(),name:o().min(1).max(64)}),qZ,{kind:"mutation",auth:"admin"}),clusterAddonStatus:b(N(),X(o(),PZ),{auth:"admin"}),getCapUsageGraph:b(d({windowSeconds:l().int().positive().max(300).default(60)}),M(OZ).readonly(),{auth:"admin"}),getNodeAddons:b(d({nodeId:o()}),M(DZ).readonly(),{auth:"admin"}),setProcessLogLevel:b(d({nodeId:o(),level:o()}),ec,{kind:"mutation",auth:"admin"}),executeQuery:b(d({nodeId:o(),addonId:o(),queryName:o(),params:X(o(),te()).optional()}),te(),{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},UZ=O(["min","low","normal","high"]),FZ=d({id:o().min(1),title:o().min(1),uri:Lz().optional(),destructive:A().optional()}),HZ=d({image:A(),priority:A(),data:A(),actions:A(),recipients:A()}),R2=d({lastSentAt:l(),lastError:o().nullable(),queueDepth:l().int().nonnegative(),supports:HZ}),$Z=d({deviceId:l().int().nonnegative(),title:o().optional(),body:o().min(1),image:o().optional(),priority:UZ.optional(),channel:o().optional(),recipients:M(o()).optional(),actions:M(FZ).optional(),data:X(o(),te()).optional()}),QZ=d({notificationId:o(),acceptedAt:l()}),VZ={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Notifier],methods:{send:b($Z,QZ,{kind:"mutation",auth:"admin"}),cancel:b(d({deviceId:l().int().nonnegative(),notificationId:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},events:{onSent:{data:d({deviceId:l(),notificationId:o(),success:A(),error:o().nullable(),acceptedAt:l()})}},status:{schema:R2,kind:"command-driven"},runtimeState:R2,durability:"session"},_2=d({value:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional(),lastFetchedAt:l()}),GZ={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:_2,kind:"push"},runtimeState:_2,durability:"restored",volatileStateFields:["lastFetchedAt"]},h_=O(["text","timestamp","watermark"]),zv=O(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),ZZ=d({id:o(),kind:h_,enabled:A(),text:o().optional(),position:zv.optional(),availablePositions:M(zv).readonly(),readOnly:A().optional()}),I2=d({overlays:M(ZZ).readonly()}),KZ=d({enabled:A().optional(),text:o().optional(),position:zv.optional()}).partial(),WZ={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],methods:{setOverlay:b(d({deviceId:l(),overlayId:o(),patch:KZ}),N(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:d({deviceId:l(),status:I2})}},status:{schema:I2,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}}}]}},YZ=gt("kind",[d({kind:G("static"),text:o().max(64)}),d({kind:G("clock"),pattern:o().min(1).max(32).default("HH:mm"),timezone:o().min(1).max(64).optional()}),d({kind:G("device-state"),deviceId:l().int().optional(),capName:o().min(1).max(64),valuePath:o().min(1).max(64)}),d({kind:G("latest-recognition"),recognition:O(["person","plate"])})]),Lv=d({enabled:A().default(!0),source:YZ,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:X(o(),o()).optional(),schedule:sp.optional(),conditions:yb.optional(),fallbackText:o().max(64).default("")}),T2=d({slotId:o(),kind:h_,readOnly:A(),cameraEnabled:A(),cameraText:o().optional(),binding:Lv.nullable()}),XZ=O(["written","unchanged","gated","unreadable","disabled","unbound","failed"]),rg=d({slotId:o(),outcome:XZ,text:o(),reason:o().optional()}),JZ=O(["number","boolean","string","enum"]),eK=d({deviceId:l().int(),deviceName:o(),capName:o(),valuePath:o(),label:o(),valueType:JZ,enumValues:M(o()).readonly().optional()}),tK={name:"osd-manager",scope:"system",mode:"singleton",methods:{getDeviceOsd:b(d({deviceId:l().int()}),d({supported:A(),slots:M(T2)}),{auth:"admin"}),getSourceCatalog:b(d({deviceId:l().int()}),d({sources:M(eK)}),{auth:"admin"}),getConditionSupport:b(d({}),d({supported:M(o()),catalog:M(OR)}),{auth:"admin"}),setSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1),binding:Lv}),d({slot:T2,render:rg}),{kind:"mutation",auth:"admin"}),clearSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1)}),d({success:G(!0)}),{kind:"mutation",auth:"admin"}),copyDeviceConfiguration:b(d({sourceDeviceId:l().int(),targetDeviceId:l().int()}),d({copied:l().int().nonnegative(),skipped:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),previewSlot:b(d({deviceId:l().int(),slotId:o().min(1),binding:Lv.optional()}),rg,{kind:"mutation",auth:"admin"}),renderDevice:b(d({deviceId:l().int()}),d({results:M(rg)}),{kind:"mutation",auth:"admin"})}},g_=4,jb=200,nK=O(["normal","offline","on_batteries"]),og=l().int().min(4).max(200),N2=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:nK.nullable(),error:o().nullable(),errorCode:l().nullable(),isDualHopper:A(),childLock:A(),indicatorLight:A(),feedSound:A(),volume:l(),lastFetchedAt:l()}),aK={name:"pet-feeder",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.PetFeeder],methods:{feed:b(d({deviceId:l().int().nonnegative(),grams:og.optional(),hopper1:og.optional(),hopper2:og.optional()}),N(),{kind:"mutation",auth:"admin"}),cancelFeed:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),resetDesiccant:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),markFoodReplenished:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),callPet:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),playSound:b(d({deviceId:l().int().nonnegative(),soundId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setChildLock:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setIndicatorLight:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setFeedSound:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setVolume:b(d({deviceId:l().int().nonnegative(),level:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:N2,kind:"poll"},runtimeState:N2,durability:"session"},O2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaKey:o().optional(),coverBase64:o().optional()}),iK=d({id:o(),text:o(),score:l(),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),sg=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:Fi.optional(),keyFrameMediaKey:o().optional(),base64:o().optional(),cropUrl:o().optional()}),rK=d({key:o(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),oK=d({plateIds:M(o()).readonly(),representativePlateId:o(),representativeText:o(),size:l().int(),cohesion:l()}),sK={name:"plate-gallery",scope:"system",mode:"singleton",methods:{listPlates:b(d({deviceId:l().int().optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}).optional(),M(sg).readonly()),getPlateByTrack:b(d({deviceId:l().int(),trackId:o()}),sg.nullable()),getPlateMedia:b(d({plateId:o()}),M(rK).readonly()),searchPlates:b(d({text:o().min(1),maxDistance:l().int().min(0).optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}),M(sg).readonly()),suggestPlateClusters:b(d({maxDistance:l().int().min(0).optional(),minClusterSize:l().int().min(2).optional(),limit:l().int().positive().optional()}).optional(),M(oK).readonly()),correctPlateText:b(d({plateId:o(),text:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deletePlate:b(d({plateId:o()}),N(),{kind:"mutation",auth:"admin"}),listVehicles:b(d({includeCrops:A().optional()}).optional(),M(O2).readonly()),createVehicle:b(d({name:o().min(1)}),O2,{kind:"mutation",auth:"admin"}),renameVehicle:b(d({id:o(),name:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deleteVehicle:b(d({id:o()}),N(),{kind:"mutation",auth:"admin"}),listVehicleSamples:b(d({vehicleId:o()}),M(iK).readonly()),removeVehicleSample:b(d({vehicleId:o(),sampleId:o()}),N(),{kind:"mutation",auth:"admin"}),assignPlate:b(d({plateId:o(),vehicleId:o()}),N(),{kind:"mutation",auth:"admin"}),unassignPlate:b(d({plateId:o()}),N(),{kind:"mutation",auth:"admin"}),assignPlates:b(d({plateIds:M(o()).min(1),vehicleId:o()}),d({assigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignPlates:b(d({plateIds:M(o()).min(1)}),d({unassigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"})}},v_=O(ap),lK=O(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),cK=d({preferred:M(o()).readonly(),rationale:o()}),qv=O(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),uK=d({encoder:qv,codec:O(["H264","H265"]),family:O(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:A(),reason:o().optional()});d({encoders:M(uK).readonly(),defaultH264:qv,defaultH265:qv,probedAt:l()});d({methods:M(o()).readonly(),probedAt:l()});var dK=O(["darwin","linux","win32"]),mK=O(["arm64","x64"]),pK=d({type:O(["nvidia","amd","intel","apple"]),name:o(),memoryMB:l().optional()}),fK=d({type:O(["apple-ane","intel-npu"])}),hK=d({type:G("coral-edgetpu"),bus:o().optional()}),y_=d({platform:dK,arch:mK,cpuModel:o(),cpuCores:l(),totalRAM_MB:l(),availableRAM_MB:l(),gpu:pK.nullable(),npu:fK.nullable(),coral:hK.nullable().optional()}),j2=d({runtime:O(["node","python"]),backend:o(),format:O(["onnx","coreml","openvino","tflite"]),score:l(),reason:o(),available:A()}),gK=d({key:o(),backend:o(),device:o(),format:v_,runtime:G("python"),score:l(),available:A()}),vK=d({hardware:y_,scores:M(j2).readonly(),bestScore:j2,pythonPath:o().nullable(),devices:M(gK).readonly()}),yK=d({modelId:o(),name:o(),minRAM_MB:l(),accuracyScore:l(),formats:M(o()).readonly()}),bK=d({modelId:o(),runtime:O(["node","python"]),backend:o(),format:v_,reason:o()}),SK={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:b(N(),vK),getHardware:b(N(),y_),resolveInferenceConfig:b(d({requirements:M(yK).readonly()}),bK),resolveHwAccel:b(d({prefer:lK}),cK)}},P2=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()}),xK={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:P2,kind:"push"},runtimeState:P2,durability:"restored",volatileStateFields:["lastFetchedAt"]},kK=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),accuracyMeters:l().nonnegative()}),D2=d({state:o(),location:o().nullable(),gps:kK.nullable(),batteryPercent:l().min(0).max(100).nullable(),lastChangedAt:l()}),wK={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Presence],methods:{},status:{schema:D2,kind:"push"},runtimeState:D2,durability:"restored",volatileStateFields:["lastChangedAt"]},z2=d({hpa:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),MK={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:z2,kind:"push"},runtimeState:z2,durability:"restored",volatileStateFields:["lastFetchedAt"]},CK=gt("kind",[Hs,op]),b_=d({id:l(),enabled:A(),shape:CK}),L2=d({enabled:A(),regions:M(b_),audioEnabled:A().nullable(),lastFetchedAt:l()}),AK=d({maxRegions:l(),supportedShapes:M(RR),polygonVertices:qU.optional(),supportsAudioMute:A()}),EK=d({enabled:A().optional(),regions:M(b_).optional()}),RK={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:b(d({deviceId:l()}),AK),setMask:b(d({deviceId:l(),patch:EK}),N(),{kind:"mutation",auth:"admin"}),setAudioEnabled:b(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:L2,kind:"poll"},runtimeState:L2,durability:"restored",volatileStateFields:["lastFetchedAt"]},_K=d({id:o(),name:o()}),S_=d({pan:l(),tilt:l(),zoom:l()}),q2=d({pan:l().optional(),tilt:l().optional(),zoom:l().optional(),speed:l().optional()}),IK=S_.extend({autofocus:A()}),TK=d({hasPan:A(),hasTilt:A(),hasZoom:A(),supportsPresets:A(),maxPresets:l().optional(),hasAutofocus:A()}),NK={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:b(q2.extend({deviceId:l()}),N(),{kind:"mutation"}),continuousMove:b(q2.extend({deviceId:l()}),N(),{kind:"mutation"}),stop:b(d({deviceId:l()}),N(),{kind:"mutation"}),getPresets:b(d({deviceId:l()}),M(_K)),goToPreset:b(d({deviceId:l(),presetId:o()}),N(),{kind:"mutation"}),savePreset:b(d({deviceId:l(),presetId:o(),name:o()}),N(),{kind:"mutation",auth:"admin"}),deletePreset:b(d({deviceId:l(),presetId:o()}),N(),{kind:"mutation",auth:"admin"}),getOptions:b(d({deviceId:l()}),TK),goHome:b(d({deviceId:l()}),N(),{kind:"mutation"}),getPosition:b(d({deviceId:l()}),S_),setAutofocus:b(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation"})},status:{schema:IK,kind:"command-driven"}},OK=o().describe("Vendor target string (people/vehicle/pet); empty = camera default"),Bv=d({targetType:OK,stopDelaySeconds:l().int().min(0).max(300),disappearDelaySeconds:l().int().min(0).max(300)}),jK=d({value:o(),label:o()}),nm=d({enabled:A(),lastChangedAt:l(),currentSettings:Bv.nullable(),supportedTargetTypes:M(jK)}),PK=nm.extend({lastFetchedAt:l()}),DK={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:b(d({deviceId:l()}),nm),setEnabled:b(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation"}),getSettings:b(d({deviceId:l()}),Bv.nullable()),setSettings:b(d({deviceId:l(),settings:Bv.partial()}),N(),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:nm})}},status:{schema:nm,kind:"command-driven"},runtimeState:PK,durability:"session"},zK={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera,V.Sensor,V.Switch],methods:{reboot:b(d({deviceId:l().int().nonnegative()}),d({success:G(!0)}),{kind:"mutation",auth:"admin"})}},B2=d({deviceId:l(),enabled:A(),activeMode:O(["off","continuous","events"]),nodeId:o(),storageBytes:l()}),LK=d({profile:o(),startMs:l(),endMs:l()}),qK=d({deviceId:l(),ranges:M(LK)}),BK=d({deviceId:l(),days:M(l())}),UK=d({deviceId:l(),localMasterPath:o().nullable(),playbackUrl:o().nullable(),playbackEndpoints:M(o())}),FK=d({deviceId:l(),usedBytes:l(),oldestMs:l().nullable().optional()}),HK=d({locationId:o().nullable(),locationIds:M(o()).optional(),root:o().optional(),usedBytes:l(),availableBytes:l().nullable(),totalBytes:l().nullable()}),$K=d({nodeId:o(),totalUsedBytes:l(),devices:M(FK),locations:M(HK).optional()}),QK=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o(),bytes:l(),files:l().int()}),VK=O(["unassigned","target-not-writable","below-threshold","no-headroom"]),GK=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o().nullable(),bytes:l(),reason:VK}),U2=d({moves:M(QK),skipped:M(GK),bytesToMove:l(),jobIds:M(o())}),F2=d({throttleMbps:l().min(1).max(1e3).optional(),minMoveGb:l().min(0).optional()}),ZK=d({deviceId:l().int(),profile:o(),locationId:o()}),KK=d({deviceId:l().int(),locationId:o()}),WK=d({assignments:M(ZK),pins:M(KK),defaultLocations:X(o(),o())}),YK=d({deviceId:l().int(),locationId:o().nullable()}),XK=gt("kind",[d({kind:G("segment"),startMs:l(),durMs:l(),bytes:l()}),d({kind:G("gap"),nearestEdgeMs:l().nullable(),prevEndMs:l().nullable().optional()})]),JK=d({data:Ut(Uint8Array)}),eW=d({data:Ut(Uint8Array),gopStartMs:l(),gopDurMs:l()}),tW=gt("kind",[d({kind:G("ok"),data:Ut(Uint8Array),gopStartMs:l(),gopDurMs:l(),reachesRequestedEnd:A()}),d({kind:G("spans-multiple-segments"),segmentEndMs:l()})]),nW={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:B2,kind:"command-driven"},methods:{getAvailability:b(d({deviceId:l(),fromMs:l(),toMs:l()}),qK,{kind:"query",auth:"protected"}),getDaysWithRecordings:b(d({deviceId:l(),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),BK,{kind:"query",auth:"protected"}),getPlaybackManifest:b(d({deviceId:l(),fromMs:l(),toMs:l()}),UK,{kind:"query",auth:"protected"}),getStorageUsage:b(d({}),$K,{kind:"query",auth:"admin"}),getDeviceConfig:b(d({deviceId:l()}),Dh,{kind:"query",auth:"admin"}),locateSegment:b(d({deviceId:l(),profile:o(),epochMs:l()}),XK,{kind:"query",auth:"admin"}),readSegmentBytes:b(d({deviceId:l(),profile:o(),startMs:l()}),JK,{kind:"query",auth:"admin"}),readGopBytes:b(d({deviceId:l(),profile:o(),startMs:l(),epochMs:l()}),eW,{kind:"query",auth:"admin"}),readWindowBytes:b(d({deviceId:l(),profile:o(),startMs:l(),fromMs:l(),toMs:l()}),tW,{kind:"query",auth:"admin"}),setDeviceConfig:b(d({deviceId:l(),config:Dh}),Dh,{kind:"mutation",auth:"admin"}),rescanStorage:b(d({deviceId:l()}),B2,{kind:"mutation",auth:"admin"}),pruneFootage:b(d({deviceId:l(),reason:tb.optional()}),d({floorMs:l().nullable(),deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),deleteFootprint:b(d({deviceId:l(),fromMs:l().optional(),toMs:l().optional()}),d({deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(jE,M(OE).readonly(),{kind:"query",auth:"admin"}),renderGif:b(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:b(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:b(wr,d({paused:G(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(wr,d({resumed:G(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(wr,d({refreshed:G(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(j8,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),wc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateFootage:b(qE,d({jobId:o()}),{kind:"mutation",auth:"admin"}),listRelocateJobs:b(d({}),M(wc).readonly(),{kind:"query",auth:"admin"}),getRelocateResidue:b(Z8,K8,{kind:"query",auth:"admin"}),reconcileLedgerAgainstDisk:b(W8,eq,{kind:"mutation",auth:"admin"}),cancelRelocateJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),planStorageRebalance:b(F2,U2,{kind:"query",auth:"admin"}),startStorageRebalance:b(F2,U2,{kind:"mutation",auth:"admin"}),getPlacement:b(d({}),WK,{kind:"query",auth:"admin"}),setDevicePlacement:b(YK,d({ok:G(!0)}),{kind:"mutation",auth:"admin"})}},aW=l().min(.25).max(32),iW=d({fromSec:l().nonnegative(),toSec:l().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:"dense range must have toSec > fromSec"}),rW=d({everyMs:l().int().positive(),ranges:M(iW).min(1).max(200)}),oW=d({everyMs:l().int().positive(),outputFps:l().int().min(1).max(60).optional(),dense:rW.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:Xy.custom,message:"dense.everyMs must be strictly smaller than the base everyMs",path:["dense","everyMs"]})}),x_=d({speed:aW.optional(),timelapse:oW.optional(),includeAudio:A(),maxLifeMs:l().int().positive(),deleteAfterDownload:A(),title:o().max(200).optional(),notifyTargetIds:M(o().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:Xy.custom,message:"speed and timelapse are mutually exclusive",path:["timelapse"]})}),sW=O(["queued","rendering","ready","failed","expired","deleted"]),tc=d({id:o(),deviceId:l(),profile:o(),fromMs:l(),toMs:l(),options:x_,state:sW,progressPct:l().nullable(),fileBytes:l().nullable(),expiresAt:l(),deleteAfterDownload:A(),downloadedAt:l().nullable(),createdAt:l(),createdBy:o(),error:o().nullable()}),lW=d({url:o(),endpoints:M(o())}),cW=d({base64:o(),contentType:o(),name:o(),bytes:l().int().nonnegative()}),uW={name:"recording-export",scope:"system",mode:"singleton",methods:{createExport:b(d({deviceId:l(),profile:o().optional(),profiles:M(o()).min(1).optional(),fromMs:l(),toMs:l(),options:x_}).superRefine((e,t)=>{(e.profiles!==void 0&&e.profiles.length>0?e.profiles:e.profile!==void 0?[e.profile]:[]).length<1&&t.addIssue({code:Xy.custom,message:"pass profiles[] (min 1) or legacy profile",path:["profiles"]})}),tc,{kind:"mutation",auth:"protected"}),listExports:b(d({deviceId:l().optional()}),M(tc),{kind:"query",auth:"protected"}),getExport:b(d({exportId:o()}),tc,{kind:"query",auth:"protected"}),cancelExport:b(d({exportId:o()}),tc,{kind:"mutation",auth:"protected"}),deleteExport:b(d({exportId:o()}),tc,{kind:"mutation",auth:"protected"}),getDownloadUrl:b(d({exportId:o()}),lW,{kind:"query",auth:"protected"}),readExportBytes:b(d({exportId:o()}),cW,{kind:"query",auth:"protected"})}},fc=o(),k_=O(["skip","judge-anyway"]),dW=O(["matched","diverged","unknown"]),mW=O(["no-reference-for-condition","view-shifted","no-vision-profile","encoder-model-changed","no-snapshot"]),pW=d({embedding:M(l()),modelId:o(),condition:fc,capturedAt:l(),thumbnailMediaId:o().optional(),anchorEmbedding:M(l()).optional()}),fW=d({id:o(),label:o(),references:M(pW),textPrompts:M(o()).optional(),referenceCount:l(),currentlyMatched:A()}),Uv=gt("mode",[d({mode:G("similarity"),threshold:l().min(0).max(1),hysteresisCount:l().int().positive()}),d({mode:G("llm"),prompt:o(),profileId:o().optional(),hysteresisCount:l().int().positive()})]),hW=.85,gW="skip",vW=8e3,w_=d({enabled:A().default(!1),prompt:o().min(1).max(1e3),profileId:o().optional(),timeoutMs:l().int().min(1e3).max(2e4).default(vW),maxImagePx:l().int().min(64).max(2048).default(448),onTimeout:O(["flip","hold"]).default("hold")}),M_=d({id:o(),label:o(),roi:Hs,enabled:A(),triggerMode:O(["periodic","on-motion","both"]),checkIntervalSec:l().optional(),check:Uv,states:M(fW),currentStateId:o().nullable(),lastCheckedAt:l().nullable(),lastConfidence:l().nullable(),currentCondition:fc.nullable(),availability:O(["ok","unavailable"]),unavailableReason:o().nullable(),baselineStateId:o().nullable(),emit:O(["latched","live"]).default("latched"),verdict:dW,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:w_.optional(),anchorThreshold:l().min(0).max(1).default(hW),autoRestore:A().default(!1),onUncoveredCondition:k_.default(gW),suspendedCondition:fc.nullable().default(null),unavailable:mW.nullable(),coveredConditions:M(fc)}),am=d({monitors:M(M_),lastFetchedAt:l()}),yW=d({deviceId:l(),status:am.nullable()}),bW={name:"scene-monitor",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[V.Camera],methods:{listScenes:b(d({deviceId:l()}),am),listScenesBatch:b(d({deviceIds:M(l()).min(1).max(200)}),M(yW).readonly()),createScene:b(d({deviceId:l(),label:o(),roi:Hs,check:Uv,triggerMode:O(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional()}),M_,{kind:"mutation",auth:"admin"}),updateScene:b(d({deviceId:l(),monitorId:o(),patch:d({label:o().optional(),roi:Hs.optional(),enabled:A().optional(),triggerMode:O(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional(),check:Uv.optional(),emit:O(["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:k_.optional(),confirm:w_.nullable().optional()})}),N(),{kind:"mutation",auth:"admin"}),deleteScene:b(d({deviceId:l(),monitorId:o()}),N(),{kind:"mutation",auth:"admin"}),captureReference:b(d({deviceId:l(),monitorId:o(),stateId:o().optional(),label:o().optional(),condition:fc.optional()}),d({stateId:o(),referenceCount:l()}),{kind:"mutation",auth:"admin"}),deleteReference:b(d({deviceId:l(),monitorId:o(),stateId:o(),index:l()}),N(),{kind:"mutation",auth:"admin"}),recheckNow:b(d({deviceId:l(),monitorId:o()}),N(),{kind:"mutation",auth:"admin"}),resetScene:b(d({deviceId:l(),monitorId:o(),recapture:A().optional()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:am,kind:"push"},runtimeState:am,durability:"session"},H2=d({isRunning:A(),lastRunAt:l(),lastRunSuccess:A().nullable(),lastError:o().nullable(),lastChangedAt:l()}),SW={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Script],methods:{run:b(d({deviceId:l().int().nonnegative(),variables:X(o(),te()).optional()}),N(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:H2,kind:"push"},runtimeState:H2,durability:"session"},$2=d({detected:A(),lastChangedAt:l()}),xW={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:$2,kind:"push"},runtimeState:$2,durability:"restored",volatileStateFields:["lastChangedAt"]},C_=d({camStreamId:o().min(1),kind:Jy,url:o().optional(),codec:o().optional(),resolution:Js.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:X(o(),te()).optional()}),kW=d({descriptors:M(C_),lastFetchedAt:l()}),wW={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],methods:{getCatalog:b(d({deviceId:l().int().nonnegative()}),M(C_).readonly())},runtimeState:kW,durability:"restored",volatileStateFields:["lastFetchedAt"]},MW=O(["main","sub","ext"]),lg=d({width:l(),height:l(),codec:O(["h264","h265"]),framerate:l(),bitrate:l(),bitrateMode:O(["vbr","cbr"]).optional(),encoderProfile:O(["high","main","baseline"]).optional(),gop:l().optional(),audio:A().optional()}),Q2=d({main:lg.optional(),sub:lg.optional(),ext:lg.optional(),lastFetchedAt:l()}),cg=d({resolutions:M(d({width:l(),height:l()})),codecs:M(O(["h264","h265"])),framerates:M(l()),bitrates:M(l()),bitrateRange:Uc([l(),l()]).optional(),supportsBitrateMode:A(),supportsEncoderProfile:A(),supportsGop:A(),gop:d({min:l(),max:l(),step:l()}).optional()}),CW=d({main:cg.optional(),sub:cg.optional(),ext:cg.optional()}),AW=d({width:l().optional(),height:l().optional(),codec:O(["h264","h265"]).optional(),framerate:l().optional(),bitrate:l().optional(),bitrateMode:O(["vbr","cbr"]).optional(),encoderProfile:O(["high","main","baseline"]).optional(),gop:l().optional()}),EW={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:b(d({deviceId:l()}),CW),setProfile:b(d({deviceId:l(),profile:MW,patch:AW}),N(),{kind:"mutation",auth:"admin"}),getConfigSchema:b(d({deviceId:l()}),te().nullable())},status:{schema:Q2,kind:"poll"},runtimeState:Q2,durability:"restored",volatileStateFields:["lastFetchedAt"]},V2=d({on:A(),lastChangedAt:l()}),RW={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Switch,V.Siren,V.Light],methods:{setState:b(d({deviceId:l(),on:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onStateChanged:{data:d({deviceId:l(),on:A(),lastChangedAt:l()})}},status:{schema:V2,kind:"command-driven"},runtimeState:V2,durability:"restored",volatileStateFields:["lastChangedAt"],settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},G2=d({streaming:A(),notifications:A(),objectDetection:A(),remoteAccess:A(),agentCluster:A(),smartHome:A(),recordings:A(),backup:A(),repl:A()}),_W=d({status:G("ok"),uptime:l()}),IW=d({name:o(),address:o(),family:o(),internal:A()}),TW=O(["operator-set","derived-from-ip"]),NW=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),source:TW,updatedAt:l(),label:o().optional()}),ug=d({location:NW.nullable(),derivationAttemptedAt:l().nullable(),derivationError:o().nullable()}),OW=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180)}).nullable(),jW=O(["http","ws","mesh","unknown"]),A_=d({http:l(),ws:l(),mesh:l(),unknown:l()}),PW=d({plane:jW,procedure:o(),userAgent:o(),ip:o(),principal:o(),calls:l(),subscriptions:l(),perMin:l()}),DW=d({procedure:o(),calls:l(),planes:A_,subscriptions:l(),perMin:l()}),zW=d({armed:A(),elapsedMs:l(),windowMs:l(),armedUntilMs:l(),httpRequests:l(),batchedRequests:l(),procedureCalls:l(),planes:A_,planesExplainTotal:A(),wsConnections:l(),wsMessages:l(),subscriptions:l(),subscriptionStops:l(),distinctGroups:l(),unattributedCalls:l(),procedures:M(DW).readonly(),groups:M(PW).readonly()}),LW=zW.extend({persisted:A()}),Pb=O(["debug","info","warn","error"]),E_=O(["request-census"]),qW=O(["cluster","node","component"]),BW=O(["default","cluster","node","component"]),UW=d({scope:qW,nodeId:o().nullable(),component:o().nullable(),level:Pb.nullable()}),FW=d({level:Pb,levelSource:BW}),HW=d({layers:M(UW).readonly()}),$W=d({id:E_,armed:A(),armedUntilMs:l(),remainingMs:l(),persisted:A()}),QW=d({id:E_,armMs:l().int().min(0),reportEveryMs:l().int().positive().optional()}),VW=d({channel:o(),armed:A(),armedUntilMs:l(),remainingMs:l(),deviceIds:M(l().int()).readonly().nullable()}),GW=d({channel:o().min(1),armMs:l().int().min(0),deviceIds:M(l().int()).readonly().nullable().optional()}),ZW=d({level:Pb.nullable().optional(),diagnostics:M(QW).readonly().optional(),channels:M(GW).readonly().optional()}),KW=bR.extend({addonId:o()}),WW=mR.extend({addonId:o()}),YW=d({scopeNodeId:o().optional(),scopeComponent:o().optional()}),XW=d({scopeNodeId:o().optional(),scopeComponent:o().optional(),patch:ZW}),Z2=d({scopeNodeId:o().nullable(),scopeComponent:o().nullable(),effective:FW,explicit:HW,activeWindows:M($W).readonly(),channels:M(NE).readonly(),activeChannels:M(VW).readonly(),persisted:A()}),JW={name:"system",scope:"system",mode:"singleton",methods:{info:b(N(),G2),health:b(N(),_W),featureFlags:b(N(),G2),networkAddresses:b(N(),M(IW).readonly()),getRetentionConfig:b(N(),te().nullable(),{auth:"admin"}),setRetentionConfig:b(X(o(),te()),xE(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:b(N(),N(),{kind:"mutation",auth:"admin"}),getSiteLocation:b(N(),ug),setSiteLocation:b(OW,ug,{kind:"mutation",auth:"admin"}),detectSiteLocation:b(N(),ug,{kind:"mutation",auth:"admin"}),getRequestCensus:b(N(),LW,{auth:"admin"}),getLoadContributions:b(N(),M(KW).readonly(),{auth:"admin"}),getFailureContributions:b(N(),M(WW).readonly(),{auth:"admin"}),getLoggingSettings:b(YW,Z2,{auth:"admin"}),setLoggingSettings:b(XW,Z2,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},K2=d({tampered:A(),lastChangedAt:l()}),eY={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:K2,kind:"push"},runtimeState:K2,durability:"restored",volatileStateFields:["lastChangedAt"]},W2=d({celsius:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),tY={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor,V.Thermostat],methods:{},status:{schema:W2,kind:"push"},runtimeState:W2,durability:"restored",volatileStateFields:["lastFetchedAt"]},nY=d({title:o(),message:o(),severity:O(["info","warning","critical"]),duration:l().optional(),action:d({label:o(),url:o()}).optional()}),aY={name:"toast",scope:"system",mode:"singleton",methods:{onToast:b(N(),nY,{kind:"subscription"})},mount:{kind:"server-provided"}},Y2=d({currentVersion:o().nullable(),availableVersion:o().nullable(),updatable:A(),state:o().nullable(),inProgress:A()}),iY={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Update],methods:{installUpdate:b(N(),N(),{kind:"mutation",auth:"admin"})},status:{schema:Y2,kind:"poll"},runtimeState:Y2,durability:"session"},dg=d({id:o(),username:o(),isAdmin:A().default(!1),allowedProviders:tt([M(o()),G("*")]),allowedDevices:X(o(),tt([M(o()),G("*")])),scopes:M(ba).default([]),totpEnabled:A().default(!1),createdAt:l(),updatedAt:l()}),rY=d({username:o(),password:o().min(6),isAdmin:A().default(!1),allowedProviders:tt([M(o()),G("*")]).optional(),allowedDevices:X(o(),tt([M(o()),G("*")])).optional(),scopes:M(ba).optional()}),oY=d({id:o(),isAdmin:A().optional(),allowedProviders:tt([M(o()),G("*")]).optional(),allowedDevices:X(o(),tt([M(o()),G("*")])).optional(),scopes:M(ba).optional()}),Fv=d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:tt([M(o()),G("*")]).optional(),allowedDevices:X(o(),tt([M(o()),G("*")])).optional(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()}),sY=d({label:o(),isAdmin:A().default(!1),allowedProviders:tt([M(o()),G("*")]).optional(),allowedDevices:X(o(),tt([M(o()),G("*")])).optional()}),lY=d({token:o(),record:Fv}),Hv=d({id:o(),userId:o(),name:o(),tokenPrefix:o(),scopes:M(ba),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()}),cY=d({userId:o(),name:o(),scopes:M(ba),expiresAt:l().optional()}),uY=d({token:o(),record:Hv}),dY=d({id:o(),userId:o(),username:o(),integrationId:o(),scopes:M(ba),createdAt:l(),lastUsedAt:l(),revokedAt:l().nullable()}),mY=d({secret:o(),otpauthUrl:o()}),pY=d({enabled:A(),confirmedAt:l().nullable()}),fY={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:b(N(),M(dg),{auth:"admin"}),createUser:b(rY,dg,{kind:"mutation",auth:"admin",access:"create"}),updateUser:b(oY,d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:b(d({id:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:b(d({id:o(),newPassword:o().min(6)}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:b(d({userId:o(),scopes:M(ba)}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:b(d({username:o(),password:o()}),dg.extend({passwordHash:o()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:b(N(),M(Fv),{auth:"admin"}),createApiKey:b(sY,lY,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:b(d({id:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:b(d({token:o()}),Fv.nullable(),{kind:"mutation",access:"view"}),createScopedToken:b(cY,uY,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:b(d({id:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:b(d({token:o()}),Hv.nullable(),{access:"view"}),listScopedTokens:b(d({userId:o()}),M(Hv),{auth:"admin"}),setupTotp:b(d({userId:o()}),mY,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:b(d({userId:o(),code:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:b(d({userId:o()}),d({success:G(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:b(d({userId:o()}),pY,{auth:"admin"}),verifyTotp:b(d({userId:o(),code:o()}),d({valid:A()}),{kind:"mutation",access:"view"}),oauthIssueCode:b(d({integrationId:o(),userId:o(),username:o(),scopes:M(ba),redirectUri:o(),hubUrl:o(),codeChallenge:o().optional(),refreshTtlSec:tt([l().int().positive(),G("never")]).optional()}),d({code:o()}),{kind:"mutation",access:"create"}),oauthExchangeCode:b(d({code:o(),redirectUri:o(),codeVerifier:o().optional()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:b(d({refreshToken:o()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:b(d({token:o()}),d({userId:o(),username:o(),scopes:M(ba)}).nullable(),{access:"view"}),listOauthSessions:b(N(),M(dY),{auth:"admin"}),revokeOauthSession:b(d({id:o()}),d({success:A()}),{kind:"mutation",auth:"admin",access:"delete"})}},hY=O(["idle","cleaning","paused","returning","docked","drying","error"]),Rd=d({level:l().min(0).max(100).nullable(),status:O(["ok","low","full"]).nullable()}),X2=d({state:hY,batteryLevel:l().min(0).max(100).nullable(),fanSpeed:o().nullable(),availableFanSpeeds:M(o()),cleanWater:Rd.nullable(),dirtyWater:Rd.nullable(),detergent:Rd.nullable(),dustBin:Rd.nullable(),progressPercent:l().min(0).max(100).nullable(),errorCode:l().nullable(),errorLabel:o().nullable(),lastChangedAt:l()}),gY={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Vacuum],methods:{start:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),returnToBase:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),locate:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setFanSpeed:b(d({deviceId:l().int().nonnegative(),speed:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:X2,kind:"push"},runtimeState:X2,durability:"session"},vY=O(["open","opening","closing","closed","stopped"]),J2=d({state:vY,position:l().min(0).max(100).nullable(),lastChangedAt:l()}),yY={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Valve],methods:{open:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),close:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:J2,kind:"push"},runtimeState:J2,durability:"session"},eM=d({detected:A(),lastChangedAt:l()}),bY={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Sensor],methods:{},status:{schema:eM,kind:"push"},runtimeState:eM,durability:"restored",volatileStateFields:["lastChangedAt"]},tM=d({currentTemp:l().nullable(),targetTemp:l().nullable(),operationMode:o().nullable(),availableModes:M(o()),away:A().nullable(),minTemp:l().nullable(),maxTemp:l().nullable(),lastChangedAt:l()}),SY={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.WaterHeater],methods:{setTargetTemp:b(d({deviceId:l().int().nonnegative(),temp:l().finite()}),N(),{kind:"mutation",auth:"admin"}),setOperationMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setAway:b(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:tM,kind:"push"},runtimeState:tM,durability:"session"},nM=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()}),xY={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[V.Weather],methods:{},status:{schema:nM,kind:"push"},runtimeState:nM,durability:"session"},$v=d({totalObjects:l().int().nonnegative(),byClass:X(o(),l().int().nonnegative())}),kY=$v.extend({zoneId:o(),zoneName:o(),trackIds:M(o()).readonly()}),wY=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(),keyFrameMediaKey:o().optional()}),Qv=d({ts:l().int(),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),zones:M(kY).readonly(),frame:$v,unzoned:$v,stationaryObjects:M(wY).readonly().optional()}),MY=d({deviceId:l(),read:O(["read","unreadable"]),snapshot:Qv.nullable()}),CY=O(["minute","5min","hour"]),mg=d({from:l().int(),to:l().int(),resolution:CY}),pg=d({ts:l().int(),count:l().int().nonnegative()}),AY={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[V.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),Qv.nullable()),getCurrentSnapshotBatch:b(d({deviceIds:M(l()).min(1).max(200)}),M(MY).readonly()),getZoneHistory:b(d({deviceId:l(),zoneId:o(),className:o().optional()}).extend(mg.shape),M(pg).readonly()),getCameraHistory:b(d({deviceId:l(),className:o().optional()}).extend(mg.shape),M(pg).readonly()),getUnzonedHistory:b(d({deviceId:l(),className:o().optional()}).extend(mg.shape),M(pg).readonly())},runtimeState:Qv,durability:"session"},aM=O(["motion","detection","package"]),EY={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[V.Camera],methods:{listRules:b(d({deviceId:l(),stage:aM}),M(co).readonly()),setRules:b(d({deviceId:l(),stage:aM,rules:M(co).readonly()}),N(),{kind:"mutation",auth:"admin"})},runtimeState:d({motion:M(co).readonly(),detection:M(co).readonly(),package:M(co).readonly()}),durability:"restored"};Fe.Siren,Fe.Floodlight,Fe.Spotlight,Fe.PirSensor,Fe.Chime,Fe.Autotrack,Fe.Nightvision,Fe.PrivacyMask;var RY={[V.Cover]:"cover",[V.Valve]:"valve",[V.Humidifier]:"humidifier",[V.WaterHeater]:"water-heater",[V.Camera]:"dummy",[V.Hub]:"dummy",[V.Switch]:"switch",[V.Siren]:"switch",[V.Light]:"light",[V.Fan]:"fan",[V.Sensor]:"sensor",[V.Thermostat]:"thermostat",[V.Climate]:"climate",[V.Button]:"button",[V.EventEmitter]:"dummy",[V.Update]:"update",[V.Generic]:"dummy",[V.Notifier]:"dummy",[V.Script]:"script",[V.Automation]:"automation",[V.Lock]:"lock",[V.MediaPlayer]:"media-player",[V.AlarmPanel]:"alarm",[V.Control]:"control",[V.Presence]:"sensor",[V.Weather]:"weather",[V.Vacuum]:"vacuum",[V.LawnMower]:"lawn-mower",[V.Container]:"dummy",[V.Image]:"image",[V.PetFeeder]:"pet-feeder"};new Set(Object.values(V));aa.BatteryOperated;var _Y="device.state-changed",IY="capability.binding-changed",TY="device.registered",NY="device.unregistered",OY="device.updated",jY=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=r8(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const t=(m,f)=>Number.isFinite(e)?new Promise((p,h)=>{const u=setTimeout(()=>h(new Error(`SystemMirror.init: '${f}' timed out after ${e}ms`)),e);m.then(S=>{clearTimeout(u),p(S)},S=>{clearTimeout(u),h(S)})}):m,[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 m of n)this.bindings.set(m.deviceId,m);for(const[m,f]of Object.entries(a)){const p=Number(m);if(!Number.isFinite(p))continue;const h=new Map;for(const[u,S]of Object.entries(f))h.set(u,S);this.stateMirror.set(p,h)}for(const m of s)this.devices.set(m.id,m);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?IE(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=fg(e.caps),p=new Set(a.entries.map(h=>h.capName));if(!f.every(h=>p.has(h)))continue}if(e.anyCap!==void 0){const f=fg(e.anyCap),p=new Set(a.entries.map(h=>h.capName));if(!f.some(h=>p.has(h)))continue}if(e.name!==void 0&&(!s||!PY(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||!fg(e.feature).every(f=>s.features.includes(f)))||e.isCamera!==void 0&&(!s||s.isCamera!==e.isCamera))continue;const m=this.getDeviceById(n);if(m){if(e.where&&s){if(!e.where(s,m))continue}else if(e.where&&!s)continue;t.push(m)}}return t}whereState(e,t){const n=[];for(const[a,s]of this.stateMirror){const m=s.get(e);if(!m||!t(m,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 m=s.get(e);m&&n.push(t(m,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 m=s.get(e);m&&t(m,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,m)=>{const p=(()=>{const S=this.stateMirror.get(e)?.get(t);return S&&n(S)?S:null})();if(p){s(p);return}let h=null;const u=this.listenDevice(e,(S,w,C)=>{w===t&&C&&n(C)&&(h&&clearTimeout(h),u(),s(C))});Number.isFinite(a)&&(h=setTimeout(()=>{u(),m(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 m=null;const f=this.onDeviceAdded(p=>{if(p!==e)return;const h=this.getDeviceById(p);h&&(m&&clearTimeout(m),f(),n(h))});Number.isFinite(t)&&(m=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),m=Math.max(1,a.parallelism??s.length),f=[];for(let p=0;p<s.length;p+=m){const h=s.slice(p,p+m),u=await Promise.allSettled(h.map(async S=>{const w=S[e];if(!w||typeof w[t]!="function")throw new Error(`device '${S.deviceId}' does not expose '${e}.${t}'`);return await w[t](n)}));for(let S=0;S<u.length;S++){const w=h[S],C=u[S];C.status==="fulfilled"?f.push({deviceId:w.deviceId,ok:!0,result:C.value}):f.push({deviceId:w.deviceId,ok:!1,error:C.reason})}}return f}summary(){const e={},t={},n={};let a=0,s=0;for(const m of this.bindings.values())for(const f of m.entries)e[f.capName]=(e[f.capName]??0)+1;for(const m of this.devices.values())t[m.addonId]=(t[m.addonId]??0)+1,n[m.type]=(n[m.type]??0)+1,m.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,m=this.bindings.get(a)??null,f={},p=this.stateMirror.get(a);if(p)for(const[h,u]of p)f[h]={...u};return{deviceId:a,info:s,binding:m?{...m,entries:m.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,m]of n)a.set(s,{...m});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:_Y},{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:IY},{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:TY},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"added")}})),this.bridges.push(e.subscribe({category:NY},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.applyDeviceRemoval(n.deviceId)}})),this.bridges.push(e.subscribe({category:OY},{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}`,m=this.handleListeners.get(s);if(m)for(const h of m)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 p=this.deviceListeners.get(e);if(p)for(const h of p)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 fg(e){return Array.isArray(e)?e:[e]}function PY(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 DY=[lV,Uq,Hq,Gq,Wq,e7,Xq,jV,WL,PV,zU,i7,DV,r7,d7,v7,BV,y7,UV,M7,FV,HV,$V,U7,QV,ZV,F7,d9,KV,WV,XV,nG,aG,iG,rG,lG,h9,uG,v9,S9,pG,k9,w9,_9,C9,z9,W9,a8,q9,Y9,fG,gG,J9,yG,bG,xG,RG,tB,_G,IG,iB,TG,NG,OG,jG,PG,LG,QG,ZG,YG,xB,mB,MB,rZ,sZ,AB,EB,NB,uZ,fZ,KB,YB,eU,gZ,nU,yZ,xZ,mU,wZ,hU,AZ,BZ,AU,bF,VZ,GZ,CF,WZ,tK,aK,a$,XF,$$,g$,sK,SK,xK,wK,MK,RK,NK,DK,zK,nW,uW,bW,SW,nQ,y9,xW,rQ,lQ,cQ,dQ,fQ,hQ,EQ,s9,wW,EW,RW,JW,eY,tY,OQ,aY,PQ,iY,fY,zQ,gY,yY,tV,bY,iV,JL,SY,xY,oV,AY,EY,nH];function iM(e){const t=e;function n(a,s,m,f,p){const h=t[a]?.[s];if(!h)throw new Error(`SystemProxy: api has no '${a}.${s}'`);const u=h;return m==="mutation"?u.mutate(f):m==="subscription"?u.subscribe(f,p):u.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),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),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),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),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),dumpHeapSnapshot:a=>n("metricsProvider","dumpHeapSnapshot","mutation",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),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:{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),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),getDefaultLocation:a=>n("storage","getDefaultLocation","query",a),listLocationDeclarations:a=>n("storage","listLocationDeclarations","query",a),upsertLocation:a=>n("storage","upsertLocation","mutation",a),deleteLocation:a=>n("storage","deleteLocation","mutation",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 zY=["devices","classes"];new Set(zY);var R_=d({title:o().max(500).optional(),body:o().max(2e3).optional()}),__=o().min(1).max(200),I_=M(l()).min(1),T_=l().int().min(2).max(3600),N_=l().int().min(1).max(60),O_=M(IR).min(1),j_=l().int().min(1).max(5),LY=.1,P_=l().min(LY).max(3600),D_=l().min(0).max(60),z_=o().max(200),L_=O(["image","gif"]),q_=M(o().min(1).max(40)).max(20),qY=d({name:__,enabled:A().default(!0),deviceIds:I_,schedule:sp,cadenceSec:T_.default(15),framerate:N_.default(10),denseCadenceSec:P_.optional(),minDwellSec:D_.optional(),targets:O_,template:R_.optional(),previewText:z_.optional(),previewMode:L_.default("image"),reportClasses:q_.optional(),priority:j_.default(3)});d({name:__.optional(),enabled:A().optional(),deviceIds:I_.optional(),schedule:sp.optional(),cadenceSec:T_.optional(),framerate:N_.optional(),denseCadenceSec:P_.optional(),minDwellSec:D_.optional(),targets:O_.optional(),template:R_.nullable().optional(),previewText:z_.optional(),previewMode:L_.optional(),reportClasses:q_.optional(),priority:j_.optional()});qY.extend({id:o(),ownerUserId:o().optional(),lastGeneratedAt:l().optional(),generatedByDevice:X(o(),l()).optional(),createdBy:o(),createdAt:l(),updatedAt:l()});var BY=[{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(BY.map(e=>[e.stepId,e.defaultModelId])));o().min(1);var UY=[{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 FY(e,t){return`clusterStepSetting:${e}:${t}`}var HY=l().finite();function $Y(e){const t={};for(const n of UY){const a=HY.safeParse(e[FY(n.stepId,n.key)]),s=a.success?a.data:n.default,m=t[n.stepId]??{};t[n.stepId]={...m,[n.key]:s}}return t}$Y({});d({paddingRatio:l().min(0).max(4),square:A()});var QY=O(["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:QY,tileBudgetMb:l().int().min(0).max(1024),sceneBudgetMb:l().int().min(0).max(1024)});var rM={"°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 Vv(e){return Object.hasOwn(rM,e)?rM[e]:void 0}function oM(e){return Vv(e)?.dimension}function VY(e,t){return e*t.factor+t.offset}function GY(e,t){return(e-t.offset)/t.factor}function ZY(e,t,n){if(t===n)return e;const a=Vv(t);if(!a)return;const s=Vv(n);if(s&&a.dimension===s.dimension)return GY(VY(e,a),s)}function KY(e,t){if(e===t)return!0;const n=oM(e);return n===void 0?!1:n===oM(t)}var WY=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()}},B_=class{constructor(t){this.generateIdentifier=t,this.kv=new WY}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)}},YY=class extends B_{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 XY(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 JY(e,t){const n=XY(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const m=a[s];if(t(m))return m}}function Qs(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function im(e,t){return e.indexOf(t)!==-1}function sM(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var eX=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return JY(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}},tX=e=>Object.prototype.toString.call(e).slice(8,-1),U_=e=>typeof e>"u",nX=e=>e===null,Ac=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Gv=e=>Ac(e)&&Object.keys(e).length===0,Er=e=>Array.isArray(e),aX=e=>typeof e=="string",iX=e=>typeof e=="number"&&!isNaN(e),rX=e=>typeof e=="boolean",oX=e=>e instanceof RegExp,Ec=e=>e instanceof Map,Rc=e=>e instanceof Set,F_=e=>tX(e)==="Symbol",sX=e=>e instanceof Date&&!isNaN(e.valueOf()),H_=e=>e instanceof Error,lM=e=>typeof e=="number"&&isNaN(e),lX=e=>rX(e)||nX(e)||U_(e)||iX(e)||aX(e)||F_(e),cX=e=>typeof e=="bigint",uX=e=>e===1/0||e===-1/0,dX=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),mX=e=>e instanceof URL,Zv=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),hg=e=>e.map(String).map(Zv).join("."),hc=(e,t)=>{const n=[];let a="";for(let m=0;m<e.length;m++){let f=e.charAt(m);if(!t&&f==="\\"){const p=e.charAt(m+1);if(p==="\\"){a+="\\",m++;continue}else if(p!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(m+1)==="."){a+=".",m++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function ti(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var $_=[ti(U_,"undefined",()=>null,()=>{}),ti(cX,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ti(sX,"Date",e=>e.toISOString(),e=>new Date(e)),ti(H_,"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}),ti(oX,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ti(Rc,"set",e=>[...e.values()],e=>new Set(e)),ti(Ec,"map",e=>[...e.entries()],e=>new Map(e)),ti(e=>lM(e)||uX(e),"number",e=>lM(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ti(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ti(mX,"URL",e=>e.toString(),e=>new URL(e))];function lp(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var Q_=lp((e,t)=>F_(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}),pX=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),V_=lp(dX,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=pX[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function G_(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Z_=lp(G_,(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)}),K_=lp((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)}),fX=[Z_,Q_,K_,V_],cM=(e,t)=>{const n=sM(fX,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=sM($_,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},W_={};$_.forEach(e=>{W_[e.annotation]=e});var hX=(e,t,n)=>{if(Er(t))switch(t[0]){case"symbol":return Q_.untransform(e,t,n);case"class":return Z_.untransform(e,t,n);case"custom":return K_.untransform(e,t,n);case"typed-array":return V_.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=W_[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Is=(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 Y_(e){if(im(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(im(e,"prototype"))throw new Error("prototype is not allowed as a property");if(im(e,"constructor"))throw new Error("constructor is not allowed as a property")}var gX=(e,t)=>{Y_(t);for(let n=0;n<t.length;n++){const a=t[n];if(Rc(e))e=Is(e,+a);else if(Ec(e)){const s=+a,m=+t[++n]==0?"key":"value",f=Is(e,s);switch(m){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},Kv=(e,t,n)=>{if(Y_(t),t.length===0)return n(e);let a=e;for(let m=0;m<t.length-1;m++){const f=t[m];if(Er(a)){const p=+f;a=a[p]}else if(Ac(a))a=a[f];else if(Rc(a)){const p=+f;a=Is(a,p)}else if(Ec(a)){if(m===t.length-2)break;const p=+f,h=+t[++m]==0?"key":"value",u=Is(a,p);switch(h){case"key":a=u;break;case"value":a=a.get(u);break}}}const s=t[t.length-1];if(Er(a)?a[+s]=n(a[+s]):Ac(a)&&(a[s]=n(a[s])),Rc(a)){const m=Is(a,+s),f=n(m);m!==f&&(a.delete(m),a.add(f))}if(Ec(a)){const m=+t[t.length-2],f=Is(a,m);switch(+s==0?"key":"value"){case"key":{const p=n(f);a.set(p,a.get(f)),p!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},X_=e=>e<1;function Wv(e,t,n,a=[]){if(!e)return;const s=X_(n);if(!Er(e)){Qs(e,(p,h)=>Wv(p,t,n,[...a,...hc(h,s)]));return}const[m,f]=e;f&&Qs(f,(p,h)=>{Wv(p,t,n,[...a,...hc(h,s)])}),t(m,a)}function vX(e,t,n,a){return Wv(t,(s,m)=>{e=Kv(e,m,f=>hX(f,s,a))},n),e}function yX(e,t,n){const a=X_(n);function s(m,f){const p=gX(e,hc(f,a));m.map(h=>hc(h,a)).forEach(h=>{e=Kv(e,h,()=>p)})}if(Er(t)){const[m,f]=t;m.forEach(p=>{e=Kv(e,hc(p,a),()=>e)}),f&&Qs(f,s)}else Qs(t,s);return e}var bX=(e,t)=>Ac(e)||Er(e)||Ec(e)||Rc(e)||H_(e)||G_(e,t);function SX(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function xX(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(p=>p.map(String)).sort((p,h)=>p.length-h.length));const[m,...f]=s;m.length===0?a=f.map(hg):n[hg(m)]=f.map(hg)}),a?Gv(n)?[a]:[a,n]:Gv(n)?void 0:n}var J_=(e,t,n,a,s=[],m=[],f=new Map)=>{const p=lX(e);if(!p){SX(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!bX(e,n)){const E=cM(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return p||f.set(e,R),R}if(im(m,e))return{transformedValue:null};const h=cM(e,n),u=h?.value??e,S=Er(u)?[]:{},w={};Qs(u,(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 T=J_(E,t,n,a,[...s,R],[...m,e],f);S[R]=T.transformedValue,Er(T.annotations)?w[Zv(R)]=T.annotations:Ac(T.annotations)&&Qs(T.annotations,(j,D)=>{w[Zv(R)+"."+D]=j})});const C=Gv(w)?{transformedValue:S,annotations:h?[h.type]:void 0}:{transformedValue:S,annotations:h?[h.type,w]:w};return p||f.set(e,C),C};function eI(e){return Object.prototype.toString.call(e).slice(8,-1)}function uM(e){return eI(e)==="Array"}function kX(e){if(eI(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function wX(e,t,n,a,s){const m={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";m==="enumerable"&&(e[t]=n),s&&m==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Yv(e,t={}){if(uM(e))return e.map(s=>Yv(s,t));if(!kX(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,m)=>{if(m==="__proto__"||uM(t.props)&&!t.props.includes(m))return s;const f=e[m];return wX(s,m,Yv(f,t),e,t.nonenumerable),s},{})}var pt=class{constructor({dedupe:t=!1}={}){this.classRegistry=new YY,this.symbolRegistry=new B_(n=>n.description??""),this.customTransformerRegistry=new eX,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,a=J_(t,n,this,this.dedupe),s={json:a.transformedValue};a.annotations&&(s.meta={...s.meta,values:a.annotations});const m=xX(n,this.dedupe);return m&&(s.meta={...s.meta,referentialEqualities:m}),s.meta&&(s.meta.v=1),s}deserialize(t,n){const{json:a,meta:s}=t;let m=n?.inPlace?a:Yv(a);return s?.values&&(m=vX(m,s.values,s.v??0,this)),s?.referentialEqualities&&(m=yX(m,s.referentialEqualities,s.v??0)),m}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)}};pt.defaultInstance=new pt;pt.serialize=pt.defaultInstance.serialize.bind(pt.defaultInstance);pt.deserialize=pt.defaultInstance.deserialize.bind(pt.defaultInstance);pt.stringify=pt.defaultInstance.stringify.bind(pt.defaultInstance);pt.parse=pt.defaultInstance.parse.bind(pt.defaultInstance);pt.registerClass=pt.defaultInstance.registerClass.bind(pt.defaultInstance);pt.registerSymbol=pt.defaultInstance.registerSymbol.bind(pt.defaultInstance);pt.registerCustom=pt.defaultInstance.registerCustom.bind(pt.defaultInstance);pt.allowErrorProps=pt.defaultInstance.allowErrorProps.bind(pt.defaultInstance);pt.serialize;pt.deserialize;pt.stringify;pt.parse;pt.registerClass;pt.registerCustom;pt.registerSymbol;pt.allowErrorProps;var MX=1e4,CX=6e3,AX=2e3,EX=3e4,RX=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??AX,this.maxRetryMs=t.maxRetryDelayMs??EX,this._trpcClient=this.buildTrpcClient(),this._systemProxy=iM(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,m)=>{const f=setTimeout(()=>m(new Error(`System.awaitConnected: probe timed out after ${n}ms`)),n);a.then(()=>{clearTimeout(f),s()},p=>{clearTimeout(f),m(p instanceof Error?p:new Error(String(p)))})}):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 jY(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=iM(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,m=a?.protocol==="https:"?"https":"http",f=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!f)return{winner:this._serverUrl,switched:!1};let p;try{p=(await f.query({port:s,ipv4Only:t?.ipv4Only,scheme:m})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(p.length===0)return{winner:this._serverUrl,switched:!1};const h=await _X(p.map(u=>u.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,m=s.token,f=s.requiresTotp===!0||Array.isArray(s.secondFactors)&&s.secondFactors.length>0;typeof m=="string"&&!f&&this.setToken(m)}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 m of a){const f=n.getDeviceInfo(m.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,p=this._trpcClient.live.onEvent.subscribe({category:t},{onData:h=>{for(const u of[...f])try{u(h)}catch{}}});s={listeners:f,unsubscribe:()=>{try{p.unsubscribe()}catch{}}},this._eventSubs.set(t,s)}s.listeners.add(a);let m=!1;return()=>{if(m)return;m=!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,m=this._wsEpoch;return this._wsClient=x3({url:n,connectionParams:()=>({token:this.token}),retryDelayMs:f=>Math.min(a*Math.pow(2,f),s),keepAlive:{enabled:!0,intervalMs:MX,pongTimeoutMs:CX},onOpen:()=>{m===this._wsEpoch&&(this._connectionVersion+=1,this.emitConnectionEvent("connected"))},onClose:()=>{m===this._wsEpoch&&this.emitConnectionEvent("disconnected")}}),cv({links:[k3({client:this._wsClient,transformer:pt})]})}return this._wsClient=null,cv({links:[s3({url:`${this._serverUrl}/trpc`,headers:t,transformer:pt})]})}};function cp(e){return new RX(e)}async function _X(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(m=>m.toLowerCase().startsWith("https://")):e;if(n.length===0)return null;const a=n.map(()=>new AbortController),s=n.map(async(m,f)=>{const p=a[f],h=setTimeout(()=>p.abort(),t);try{const u=await fetch(`${m.replace(/\/+$/,"")}/trpc/health`,{method:"GET",signal:p.signal,credentials:"omit"});if(!u.ok)throw new Error(`${u.status}`);return m}finally{clearTimeout(h)}});try{const m=await Promise.any(s);for(const f of a)try{f.abort()}catch{}return m}catch{return null}}var IX=(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})({}),TX=["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"],NX=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],OX=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],jX=["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"],PX=["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"],DX=["motion","movement","other"],zX=["package","packet"],LX=["audio"],qX=["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"],BX=["doorbell","ring"],UX=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...TX.reduce((e,t)=>({...e,[t]:"animal"}),{}),...NX.reduce((e,t)=>({...e,[t]:"person"}),{}),...OX.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...DX.reduce((e,t)=>({...e,[t]:"motion"}),{}),...zX.reduce((e,t)=>({...e,[t]:"package"}),{}),...jX.reduce((e,t)=>({...e,[t]:"face"}),{}),...PX.reduce((e,t)=>({...e,[t]:"plate"}),{}),...LX.reduce((e,t)=>({...e,[t]:"audio"}),{}),...qX.reduce((e,t)=>({...e,[t]:"audio"}),{}),...BX.reduce((e,t)=>({...e,[t]:"doorbell"}),{}),...UX.reduce((e,t)=>({...e,[t]:"sensor"}),{})});var FX=Object.values(IX),HX=FX.filter(e=>e!=="motion");[...HX];var $X=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set($X);var QX=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(QX);var I=By();const vn=hj(I),VX=fj({__proto__:null,default:vn},[I]);I.createContext(null);var Co=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(){}},GX=class extends Co{#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"}},Db=new GX,ZX={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},KX=class{#t=ZX;#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)}},po=new KX;function WX(e){setTimeout(e,0)}var YX=typeof window>"u"||"Deno"in globalThis;function Ln(){}function XX(e,t){return typeof e=="function"?e(t):e}function Xv(e){return typeof e=="number"&&e>=0&&e!==1/0}function tI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mr(e,t){return typeof e=="function"?e(t):e}function va(e,t){return typeof e=="function"?e(t):e}function dM(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:m,queryKey:f,stale:p}=e;if(f){if(a){if(t.queryHash!==zb(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 p=="boolean"&&t.isStale()!==p||s&&s!==t.state.fetchStatus||m&&!m(t))}function mM(e,t){const{exact:n,status:a,predicate:s,mutationKey:m}=e;if(m){if(!t.options.mutationKey)return!1;if(n){if(Rr(t.options.mutationKey)!==Rr(m))return!1}else if(!_c(t.options.mutationKey,m))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function zb(e,t){return(t?.queryKeyHashFn||Rr)(e)}function Rr(e){return JSON.stringify(e,(t,n)=>Jv(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 JX=Object.prototype.hasOwnProperty;function Lb(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=pM(e)&&pM(t);if(!a&&!(Jv(e)&&Jv(t)))return t;const m=(a?e:Object.keys(e)).length,f=a?t:Object.keys(t),p=f.length,h=a?new Array(p):{};let u=0;for(let S=0;S<p;S++){const w=a?S:f[S],C=e[w],E=t[w];if(C===E){h[w]=C,(a?S<m:JX.call(e,w))&&u++;continue}if(C===null||E===null||typeof C!="object"||typeof E!="object"){h[w]=E;continue}const R=Lb(C,E,n+1);h[w]=R,R===C&&u++}return m===p&&u===m?e:h}function Ic(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 pM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jv(e){if(!fM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fM(e){return Object.prototype.toString.call(e)==="[object Object]"}function eJ(e){return new Promise(t=>{po.setTimeout(t,e)})}function ey(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lb(e,t):t}function tJ(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function nJ(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var ya=Symbol();function nI(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ya?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qb(e,t){return typeof e=="function"?e(...t):!!e}function aJ(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 Tc=(()=>{let e=()=>YX;return{isServer(){return e()},setIsServer(t){e=t}}})();function ty(){let e,t;const n=new Promise((s,m)=>{e=s,t=m});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 iJ=WX;function rJ(){let e=[],t=0,n=p=>{p()},a=p=>{p()},s=iJ;const m=p=>{t?e.push(p):s(()=>{n(p)})},f=()=>{const p=e;e=[],p.length&&s(()=>{a(()=>{p.forEach(h=>{n(h)})})})};return{batch:p=>{let h;t++;try{h=p()}finally{t--,t||f()}return h},batchCalls:p=>(...h)=>{m(()=>{p(...h)})},schedule:m,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{a=p},setScheduler:p=>{s=p}}}var rn=rJ(),oJ=class extends Co{#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}},Om=new oJ;function sJ(e){return Math.min(1e3*2**e,3e4)}function aI(e){return(e??"online")==="online"?Om.isOnline():!0}var ny=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function iI(e){let t=!1,n=0,a;const s=ty(),m=()=>s.status!=="pending",f=T=>{if(!m()){const j=new ny(T);C(j),e.onCancel?.(j)}},p=()=>{t=!0},h=()=>{t=!1},u=()=>Db.isFocused()&&(e.networkMode==="always"||Om.isOnline())&&e.canRun(),S=()=>aI(e.networkMode)&&e.canRun(),w=T=>{m()||(a?.(),s.resolve(T))},C=T=>{m()||(a?.(),s.reject(T))},E=()=>new Promise(T=>{a=j=>{(m()||u())&&T(j)},e.onPause?.()}).then(()=>{a=void 0,m()||e.onContinue?.()}),R=()=>{if(m())return;let T;const j=n===0?e.initialPromise:void 0;try{T=j??e.fn()}catch(D){T=Promise.reject(D)}Promise.resolve(T).then(w).catch(D=>{if(m())return;const z=e.retry??(Tc.isServer()?0:3),q=e.retryDelay??sJ,L=typeof q=="function"?q(n,D):q,K=z===!0||typeof z=="number"&&n<z||typeof z=="function"&&z(n,D);if(t||!K){C(D);return}n++,e.onFail?.(n,D),eJ(L).then(()=>u()?void 0:E()).then(()=>{t?C(D):R()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(a?.(),s),cancelRetry:p,continueRetry:h,canStart:S,start:()=>(S()?R():E().then(R),s)}}var rI=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xv(this.gcTime)&&(this.#t=po.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tc.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(po.clearTimeout(this.#t),this.#t=void 0)}};function lJ(e){return{onFetch:(t,n)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,m=t.state.data?.pages||[],f=t.state.data?.pageParams||[];let p={pages:[],pageParams:[]},h=0;const u=async()=>{let S=!1;const w=R=>{aJ(R,()=>t.signal,()=>S=!0)},C=nI(t.options,t.fetchOptions),E=async(R,T,j)=>{if(S)return Promise.reject(t.signal.reason);if(T==null&&R.pages.length)return Promise.resolve(R);const z=(()=>{const J={client:t.client,queryKey:t.queryKey,pageParam:T,direction:j?"backward":"forward",meta:t.options.meta};return w(J),J})(),q=await C(z),{maxPages:L}=t.options,K=j?nJ:tJ;return{pages:K(R.pages,q,L),pageParams:K(R.pageParams,T,L)}};if(s&&m.length){const R=s==="backward",T=R?oI:ay,j={pages:m,pageParams:f},D=T(a,j);p=await E(j,D,R)}else{const R=e??m.length;do{const T=h===0?f[0]??a.initialPageParam:ay(a,p);if(h>0&&T==null)break;p=await E(p,T),h++}while(h<R)}return p};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function ay(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 oI(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function cJ(e,t){return t?ay(e,t)!=null:!1}function uJ(e,t){return!t||!e.getPreviousPageParam?!1:oI(e,t)!=null}var dJ=class extends rI{#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=gM(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=gM(this.options);t.data!==void 0&&(this.setState(hM(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=ey(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(Ln).catch(Ln):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=>va(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ya||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Mr(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:!tI(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(u=>u.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=nI(this.options,t),S=(()=>{const w={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(w),w})();return this.#o=!1,this.options.persister?this.options.persister(h,S,this):h(S)},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"?lJ(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=iI({initialPromise:t?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof ny&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(h,u)=>{this.#l({type:"failed",failureCount:h,error:u})},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 ny){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,...sI(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...hM(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),rn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function sI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gM(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 Vc=class extends Co{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#s=ty(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#a=void 0;#i;#r;#s;#o;#u;#l;#p;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),vM(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iy(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iy(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 va(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&&!Ic(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&yM(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),a&&(this.#e!==n||va(this.options.enabled,this.#e)!==va(t.enabled,this.#e)||Mr(this.options.staleTime,this.#e)!==Mr(t.staleTime,this.#e))&&this.#g();const s=this.#v();a&&(this.#e!==n||va(this.options.enabled,this.#e)!==va(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 pJ(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.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#m(e){this.#k();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ln)),t}#g(){this.#S();const e=Mr(this.options.staleTime,this.#e);if(Tc.isServer()||this.#a.isStale||!Xv(e))return;const n=tI(this.#a.dataUpdatedAt,e)+1;this.#d=po.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,!(Tc.isServer()||va(this.options.enabled,this.#e)===!1||!Xv(this.#c)||this.#c===0)&&(this.#f=po.setInterval(()=>{(this.options.refetchIntervalInBackground||Db.isFocused())&&this.#m()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(po.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(po.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#e,a=this.options,s=this.#a,m=this.#i,f=this.#r,h=e!==n?e.state:this.#n,{state:u}=e;let S={...u},w=!1,C;if(t._optimisticResults){const F=this.hasListeners(),ue=!F&&vM(e,t),we=F&&yM(e,n,t,a);(ue||we)&&(S={...S,...sI(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(S.fetchStatus="idle")}let{error:E,errorUpdatedAt:R,status:T}=S;C=S.data;let j=!1;if(t.placeholderData!==void 0&&C===void 0&&T==="pending"){let F;s?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(F=s.data,j=!0):F=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,F!==void 0&&(T="success",C=ey(s?.data,F,t),w=!0)}if(t.select&&C!==void 0&&!j)if(s&&C===m?.data&&t.select===this.#u)C=this.#l;else try{this.#u=t.select,C=t.select(C),C=ey(s?.data,C,t),this.#l=C,this.#o=null}catch(F){this.#o=F}this.#o&&(E=this.#o,C=this.#l,R=Date.now(),T="error");const D=S.fetchStatus==="fetching",z=T==="pending",q=T==="error",L=z&&D,K=C!==void 0,$={status:T,fetchStatus:S.fetchStatus,isPending:z,isSuccess:T==="success",isError:q,isInitialLoading:L,isLoading:L,data:C,dataUpdatedAt:S.dataUpdatedAt,error:E,errorUpdatedAt:R,failureCount:S.fetchFailureCount,failureReason:S.fetchFailureReason,errorUpdateCount:S.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:S.dataUpdateCount>h.dataUpdateCount||S.errorUpdateCount>h.errorUpdateCount,isFetching:D,isRefetching:D&&!z,isLoadingError:q&&!K,isPaused:S.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:q&&K,isStale:Bb(e,t),refetch:this.refetch,promise:this.#s,isEnabled:va(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=$.data!==void 0,ue=$.status==="error"&&!F,we=ce=>{ue?ce.reject($.error):F&&ce.resolve($.data)},Ee=()=>{const ce=this.#s=$.promise=ty();we(ce)},Me=this.#s;switch(Me.status){case"pending":e.queryHash===n.queryHash&&we(Me);break;case"fulfilled":(ue||$.data!==Me.value)&&Ee();break;case"rejected":(!ue||$.error!==Me.reason)&&Ee();break}}return $}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.#p=this.#e),Ic(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 m=new Set(s??this.#h);return this.options.throwOnError&&m.add("error"),Object.keys(this.#a).some(f=>{const p=f;return this.#a[p]!==e[p]&&m.has(p)})};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){rn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function mJ(e,t){return va(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&va(t.retryOnMount,e)===!1)}function vM(e,t){return mJ(e,t)||e.state.data!==void 0&&iy(e,t,t.refetchOnMount)}function iy(e,t,n){if(va(t.enabled,e)!==!1&&Mr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Bb(e,t)}return!1}function yM(e,t,n,a){return(e!==t||va(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Bb(e,n)}function Bb(e,t){return va(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function pJ(e,t){return!Ic(e.getCurrentResult(),t)}var lI=class extends Vc{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:m,isError:f,isRefetchError:p}=a,h=n.fetchMeta?.fetchMore?.direction,u=f&&h==="forward",S=s&&h==="forward",w=f&&h==="backward",C=s&&h==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:cJ(t,n.data),hasPreviousPage:uJ(t,n.data),isFetchNextPageError:u,isFetchingNextPage:S,isFetchPreviousPageError:w,isFetchingPreviousPage:C,isRefetchError:p&&!u&&!w,isRefetching:m&&!S&&!C}}},fJ=class extends rI{#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||cI(),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=iI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(m,f)=>{this.#i({type:"failed",failureCount:m,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 m=await this.#a.start();return await this.#n.config.onSuccess?.(m,e,this.state.context,this,n),await this.options.onSuccess?.(m,e,this.state.context,n),await this.#n.config.onSettled?.(m,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(m,null,e,this.state.context,n),this.#i({type:"success",data:m}),m}catch(m){try{await this.#n.config.onError?.(m,e,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onError?.(m,e,this.state.context,n)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,m,this.state.variables,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,m,e,this.state.context,n)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:m}),m}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),rn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function cI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hJ=class extends Co{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 fJ({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=Id(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=Id(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=Id(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=Id(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){rn.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=>mM(t,n))}findAll(e={}){return this.getAll().filter(t=>mM(e,t))}notify(e){rn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return rn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ln))))}};function Id(e){return e.options.scope?.id}var gJ=class extends Co{#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),Ic(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Rr(n.mutationKey)!==Rr(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??cI();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){rn.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(m){Promise.reject(m)}try{this.#a.onSettled?.(t.data,null,n,a,s)}catch(m){Promise.reject(m)}}else if(t?.type==="error"){try{this.#a.onError?.(t.error,n,a,s)}catch(m){Promise.reject(m)}try{this.#a.onSettled?.(void 0,t.error,n,a,s)}catch(m){Promise.reject(m)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function bM(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function vJ(e,t,n){const a=e.slice(0);return a[t]=n,a}var yJ=class extends Co{#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,rn.batch(()=>{const n=this.#i,a=this.#c(this.#n);a.forEach(S=>S.observer.setOptions(S.defaultedQueryOptions));const s=a.map(S=>S.observer),m=s.map(S=>S.getCurrentResult()),f=n.length!==s.length,p=s.some((S,w)=>S!==n[w]),h=f||p,u=h?!0:m.some((S,w)=>{const C=this.#e[w];return!C||!Ic(S,C)});!h&&!u||(h&&(this.#l=a,this.#i=s),this.#e=m,this.hasListeners()&&(h&&(bM(n,s).forEach(S=>{S.destroy()}),bM(s,n).forEach(S=>{S.subscribe(w=>{this.#h(S,w)})})),this.#m()))})}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(m=>m.observer.getOptimisticResult(m.defaultedQueryOptions)),s=n.map(m=>m.defaultedQueryOptions.queryHash);return[a,m=>this.#d(m??a,t,s),()=>this.#p(a,n)]}#p(e,t){return t.map((n,a)=>{const s=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,m=>{t.forEach(f=>{f.observer.trackProp(m)})})})}#d(e,t,n){if(t){const a=this.#u,s=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((m,f)=>m!==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=Lb(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 m=t.get(s);m?m.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 Vc(this.#t,s);n.push({defaultedQueryOptions:s,observer:f})}),n}#h(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=vJ(this.#e,n,t),this.#m())}#m(){if(this.hasListeners()){const e=this.#p(this.#e,this.#l),t=this.#f(),n=this.#r,a=t?n:this.#d(e,this.#a?.combine);(t||n!==a)&&rn.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},bJ=class extends Co{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,s=t.queryHash??zb(a,t);let m=this.get(s);return m||(m=new dJ({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(m)),m}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(){rn.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=>dM(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>dM(e,n)):t}notify(e){rn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},uI=class{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e={}){this.#t=e.queryCache||new bJ,this.#e=e.mutationCache||new hJ,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=Db.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=Om.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(Mr(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}),m=this.#t.get(a.queryHash)?.state.data,f=XX(t,m);if(f!==void 0)return this.#t.build(this,a).setData(f,{...n,manual:!0})}setQueriesData(e,t,n){return rn.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;rn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return rn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=rn.batch(()=>this.#t.findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(Ln).catch(Ln)}invalidateQueries(e,t={}){return rn.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=rn.batch(()=>this.#t.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let m=s.fetch(void 0,n);return n.throwOnError||(m=m.catch(Ln)),s.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(a).then(Ln)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Mr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ln).catch(Ln)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ln).catch(Ln)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Om.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(Rr(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(Rr(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=zb(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===ya&&(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()}},dI=I.createContext(void 0),Gc=e=>{const t=I.useContext(dI);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},mI=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(dI.Provider,{value:e,children:t})),pI=I.createContext(!1),fI=()=>I.useContext(pI);pI.Provider;function SJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xJ=I.createContext(SJ()),hI=()=>I.useContext(xJ),gI=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?qb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},vI=e=>{I.useEffect(()=>{e.clearReset()},[e])},yI=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||qb(n,[e.error,a])),Ub=(e,t)=>t.state.data===void 0,bI=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))}},kJ=(e,t)=>e.isLoading&&e.isFetching&&!t,ry=(e,t)=>e?.suspense&&t.isPending,oy=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function SI({queries:e,...t},n){const a=Gc(n),s=fI(),m=hI(),f=I.useMemo(()=>e.map(T=>{const j=a.defaultQueryOptions(T);return j._optimisticResults=s?"isRestoring":"optimistic",j}),[e,a,s]);f.forEach(T=>{bI(T);const j=a.getQueryCache().get(T.queryHash);gI(T,m,j)}),vI(m);const[p]=I.useState(()=>new yJ(a,f,t)),[h,u,S]=p.getOptimisticResult(f,t.combine),w=!s&&t.subscribed!==!1;I.useSyncExternalStore(I.useCallback(T=>w?p.subscribe(rn.batchCalls(T)):Ln,[p,w]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),I.useEffect(()=>{p.setQueries(f,t)},[f,t,p]);const E=h.some((T,j)=>ry(f[j],T))?h.flatMap((T,j)=>{const D=f[j];if(D&&ry(D,T)){const z=new Vc(a,D);return oy(D,z,m)}return[]}):[];if(E.length>0)throw Promise.all(E);const R=h.find((T,j)=>{const D=f[j];return D&&yI({result:T,errorResetBoundary:m,throwOnError:D.throwOnError,query:a.getQueryCache().get(D.queryHash),suspense:D.suspense})});if(R?.error)throw R.error;return u(S())}function up(e,t,n){const a=fI(),s=hI(),m=Gc(n),f=m.defaultQueryOptions(e);m.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=m.getQueryCache().get(f.queryHash),h=e.subscribed!==!1;f._optimisticResults=a?"isRestoring":h?"optimistic":void 0,bI(f),gI(f,s,p),vI(s);const u=!m.getQueryCache().get(f.queryHash),[S]=I.useState(()=>new t(m,f)),w=S.getOptimisticResult(f),C=!a&&h;if(I.useSyncExternalStore(I.useCallback(E=>{const R=C?S.subscribe(rn.batchCalls(E)):Ln;return S.updateResult(),R},[S,C]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),I.useEffect(()=>{S.setOptions(f)},[f,S]),ry(f,w))throw oy(f,S,s);if(yI({result:w,errorResetBoundary:s,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw w.error;return m.getDefaultOptions().queries?._experimental_afterQuery?.(f,w),f.experimental_prefetchInRender&&!Tc.isServer()&&kJ(w,a)&&(u?oy(f,S,s):p?.promise)?.catch(Ln).finally(()=>{S.updateResult()}),f.notifyOnChangeProps?w:S.trackResult(w)}function wJ(e,t){return up(e,Vc,t)}function MJ(e,t){return up({...e,enabled:!0,suspense:!0,throwOnError:Ub,placeholderData:void 0},Vc,t)}function CJ(e,t){return up({...e,enabled:!0,suspense:!0,throwOnError:Ub},lI,t)}function AJ(e,t){return SI({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:Ub,enabled:!0,placeholderData:void 0}))},t)}function EJ(e,t){const n=Gc(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function RJ(e,t){const n=Gc(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function _J(e,t){const n=Gc(t),[a]=I.useState(()=>new gJ(n,e));I.useEffect(()=>{a.setOptions(e)},[a,e]);const s=I.useSyncExternalStore(I.useCallback(f=>a.subscribe(rn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),m=I.useCallback((f,p)=>{a.mutate(f,p).catch(Ln)},[a]);if(s.error&&qb(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:m,mutateAsync:s.mutate}}function IJ(e,t){return up(e,lI,t)}var TJ=Object.create,xI=Object.defineProperty,NJ=Object.getOwnPropertyDescriptor,kI=Object.getOwnPropertyNames,OJ=Object.getPrototypeOf,jJ=Object.prototype.hasOwnProperty,Nr=(e,t)=>function(){return t||(0,e[kI(e)[0]])((t={exports:{}}).exports,t),t.exports},PJ=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=kI(t),m=0,f=s.length,p;m<f;m++)p=s[m],!jJ.call(e,p)&&p!==n&&xI(e,p,{get:(h=>t[h]).bind(null,p),enumerable:!(a=NJ(t,p))||a.enumerable});return e},Ao=(e,t,n)=>(n=e!=null?TJ(OJ(e)):{},PJ(t||!e||!e.__esModule?xI(n,"default",{value:e,enumerable:!0}):n,e)),DJ=Nr({"../../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 m={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(s.includes(f))continue;m[f]=a[f]}return m}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),zJ=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=DJ();function a(s,m){if(s==null)return{};var f,p,h=n(s,m);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);for(p=0;p<u.length;p++)f=u[p],m.includes(f)||{}.propertyIsEnumerable.call(s,f)&&(h[f]=s[f])}return h}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),wI=Nr({"../../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}}),LJ=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=wI().default;function a(s,m){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var p=f.call(s,m||"default");if(n(p)!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),qJ=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=wI().default,a=LJ();function s(m){var f=a(m,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),BJ=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=qJ();function a(s,m,f){return(m=n(m))in s?Object.defineProperty(s,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[m]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zc=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=BJ();function a(m,f){var p=Object.keys(m);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(m);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(m,u).enumerable})),p.push.apply(p,h)}return p}function s(m){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?a(Object(p),!0).forEach(function(h){n(m,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(p)):a(Object(p)).forEach(function(h){Object.defineProperty(m,h,Object.getOwnPropertyDescriptor(p,h))})}return m}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),UJ=Ao(zJ(),1),SM=Ao(Zc(),1);const FJ=["cursor","direction"];function ri(e,t,n){const a=e.flatMap(s=>s.split("."));if(!t&&(!n||n==="any"))return a.length?[a]:[];if(n==="infinite"&&xo(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:m}=t,f=(0,UJ.default)(t,FJ);return[a,{input:f,type:"infinite"}]}return[a,(0,SM.default)((0,SM.default)({},typeof t<"u"&&t!==ya&&{input:t}),n&&n!=="any"&&{type:n})]}function rm(e){return ri(e,void 0,"any")}function HJ(e){return Ym(({path:t,args:n})=>{var a;const s=[...t],m=s.pop();if(m==="useMutation")return e[m](s,...n);if(m==="_def")return{path:s};const[f,...p]=n,h=(a=p[0])!==null&&a!==void 0?a:{};return e[m](s,f,h)})}var gg;const $J=["client","ssrContext","ssrState","abortOnUnmount"],QJ=(gg=I.createContext)===null||gg===void 0?void 0:gg.call(VX,null),VJ=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 GJ(e){return Ym(t=>{const n=[...t.path],a=n.pop(),s=[...t.args],m=s.shift(),f=VJ(a),p=ri(n,m,f);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,p,s[0]),queryOptions:()=>e.queryOptions(n,p,...s),fetch:()=>e.fetchQuery(p,...s),fetchInfinite:()=>e.fetchInfiniteQuery(p,s[0]),prefetch:()=>e.prefetchQuery(p,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(p,s[0]),ensureData:()=>e.ensureQueryData(p,...s),invalidate:()=>e.invalidateQueries(p,...s),reset:()=>e.resetQueries(p,...s),refetch:()=>e.refetchQueries(p,...s),cancel:()=>e.cancelQuery(p,...s),setData:()=>{e.setQueryData(p,s[0],s[1])},setQueriesData:()=>e.setQueriesData(p,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(p,s[0],s[1])},getData:()=>e.getQueryData(p),getInfiniteData:()=>e.getInfiniteQueryData(p),setMutationDefaults:()=>e.setMutationDefaults(rm(n),m),getMutationDefaults:()=>e.getMutationDefaults(rm(n)),isMutating:()=>e.isMutating({mutationKey:rm(n)})}[a]()})}function ZJ(e){const t=BA(e.client),n=GJ(e);return Uy(a=>{const s=a;return s==="client"?t:$J.includes(s)?e[s]:n[a]})}var KJ=Ao(Zc(),1);function xM(e){const t=e instanceof Xm?e:Hy(e);return Ym(n=>{const a=n.path,s=a.join("."),[m,f]=n.args;return(0,KJ.default)({queryKey:ri(a,m,"query"),queryFn:()=>t.query(s,m,f?.trpc)},f)})}var vg=Ao(Zc(),1);function Qn(e,t,n){var a;const s=e[0];let m=(a=e[1])===null||a===void 0?void 0:a.input;if(n){var f;m=(0,vg.default)((0,vg.default)((0,vg.default)({},(f=m)!==null&&f!==void 0?f:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.join("."),m,t?.trpc]}var WJ=Nr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var m,f,p,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,p=Symbol.iterator);h--;){if(f&&(m=s[f])!=null)return m.call(s);if(p&&(m=s[p])!=null)return new a(m.call(s));f="@@asyncIterator",p="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function m(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var p=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:p}})}return a=function(p){this.s=p,this.n=p.next},a.prototype={s:null,n:null,next:function(){return m(this.n.apply(this.s,arguments))},return:function(p){var h=this.s.return;return h===void 0?Promise.resolve({value:p,done:!0}):m(h.apply(this.s,arguments))},throw:function(p){var h=this.s.return;return h===void 0?Promise.reject(p):m(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),YJ=Ao(WJ(),1);function sy(e){return{path:e.path.join(".")}}function nc(e){const t=sy(e);return I.useMemo(()=>t,[t])}async function MI(e,t,n){const s=t.getQueryCache().build(t,{queryKey:n});s.setState({data:[],status:"success"});const m=[];var f=!1,p=!1,h;try{for(var u=(0,YJ.default)(e),S;f=!(S=await u.next()).done;f=!1){const w=S.value;m.push(w),s.setState({data:[...m]})}}catch(w){p=!0,h=w}finally{try{f&&u.return!=null&&await u.return()}finally{if(p)throw h}}return m}var xt=Ao(Zc(),1);function XJ(e){const{client:t,queryClient:n}=e,a=t instanceof Xm?t:Hy(t);return{infiniteQueryOptions:(s,m,f)=>{var p,h;const u=((p=m[1])===null||p===void 0?void 0:p.input)===ya,S=async w=>{var C;const E=(0,xt.default)((0,xt.default)({},f),{},{trpc:(0,xt.default)((0,xt.default)({},f?.trpc),!(f==null||(C=f.trpc)===null||C===void 0)&&C.abortOnUnmount?{signal:w.signal}:{signal:null})});return await a.query(...Qn(m,E,{direction:w.direction,pageParam:w.pageParam}))};return Object.assign((0,xt.default)((0,xt.default)({},f),{},{initialData:f?.initialData,queryKey:m,queryFn:u?ya:S,initialPageParam:(h=f?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:sy({path:s})})},queryOptions:(s,m,f)=>{var p;const h=((p=m[1])===null||p===void 0?void 0:p.input)===ya,u=async S=>{var w;const C=(0,xt.default)((0,xt.default)({},f),{},{trpc:(0,xt.default)((0,xt.default)({},f?.trpc),!(f==null||(w=f.trpc)===null||w===void 0)&&w.abortOnUnmount?{signal:S.signal}:{signal:null})}),E=await a.query(...Qn(m,C));return CA(E)?MI(E,n,m):E};return Object.assign((0,xt.default)((0,xt.default)({},f),{},{initialData:f?.initialData,queryKey:m,queryFn:h?ya:u}),{trpc:sy({path:s})})},fetchQuery:(s,m)=>n.fetchQuery((0,xt.default)((0,xt.default)({},m),{},{queryKey:s,queryFn:()=>a.query(...Qn(s,m))})),fetchInfiniteQuery:(s,m)=>{var f;return n.fetchInfiniteQuery((0,xt.default)((0,xt.default)({},m),{},{queryKey:s,queryFn:({pageParam:p,direction:h})=>a.query(...Qn(s,m,{pageParam:p,direction:h})),initialPageParam:(f=m?.initialCursor)!==null&&f!==void 0?f:null}))},prefetchQuery:(s,m)=>n.prefetchQuery((0,xt.default)((0,xt.default)({},m),{},{queryKey:s,queryFn:()=>a.query(...Qn(s,m))})),prefetchInfiniteQuery:(s,m)=>{var f;return n.prefetchInfiniteQuery((0,xt.default)((0,xt.default)({},m),{},{queryKey:s,queryFn:({pageParam:p,direction:h})=>a.query(...Qn(s,m,{pageParam:p,direction:h})),initialPageParam:(f=m?.initialCursor)!==null&&f!==void 0?f:null}))},ensureQueryData:(s,m)=>n.ensureQueryData((0,xt.default)((0,xt.default)({},m),{},{queryKey:s,queryFn:()=>a.query(...Qn(s,m))})),invalidateQueries:(s,m,f)=>n.invalidateQueries((0,xt.default)((0,xt.default)({},m),{},{queryKey:s}),f),resetQueries:(s,m,f)=>n.resetQueries((0,xt.default)((0,xt.default)({},m),{},{queryKey:s}),f),refetchQueries:(s,m,f)=>n.refetchQueries((0,xt.default)((0,xt.default)({},m),{},{queryKey:s}),f),cancelQuery:(s,m)=>n.cancelQueries({queryKey:s},m),setQueryData:(s,m,f)=>n.setQueryData(s,m,f),setQueriesData:(s,m,f,p)=>n.setQueriesData((0,xt.default)((0,xt.default)({},m),{},{queryKey:s}),f,p),getQueryData:s=>n.getQueryData(s),setInfiniteQueryData:(s,m,f)=>n.setQueryData(s,m,f),getInfiniteQueryData:s=>n.getQueryData(s),setMutationDefaults:(s,m)=>{const f=s[0],p=h=>a.mutation(...Qn([f,{input:h}],e));return n.setMutationDefaults(s,typeof m=="function"?m({canonicalMutationFn:p}):m)},getMutationDefaults:s=>n.getMutationDefaults(s),isMutating:s=>n.isMutating((0,xt.default)((0,xt.default)({},s),{},{exact:!0}))}}var Ne=Ao(Zc());const kM=(e,t)=>new Proxy(e,{get(a,s){return t(s),a[s]}});function JJ(e){var t,n;const a=(t=void 0)!==null&&t!==void 0?t:K=>K.originalFn(),s=(n=void 0)!==null&&n!==void 0?n:QJ,m=cv,f=K=>{var J;const{abortOnUnmount:$=!1,queryClient:F,ssrContext:ue}=K,[we,Ee]=I.useState((J=K.ssrState)!==null&&J!==void 0?J:!1),Me=K.client instanceof Xm?K.client:Hy(K.client),ce=I.useMemo(()=>XJ({client:Me,queryClient:F}),[Me,F]),Se=I.useMemo(()=>(0,Ne.default)({abortOnUnmount:$,queryClient:F,client:Me,ssrContext:ue??null,ssrState:we},ce),[$,Me,ce,F,ue,we]);return I.useEffect(()=>{Ee(Re=>Re?"mounted":!1)},[]),v.jsx(s.Provider,{value:Se,children:K.children})};function p(){const K=I.useContext(s);if(!K)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return K}function h(K,J){var $;const{queryClient:F,ssrState:ue}=p();return ue&&ue!=="mounted"&&(($=F.getQueryCache().find({queryKey:K}))===null||$===void 0?void 0:$.state.status)==="error"?(0,Ne.default)({retryOnMount:!1},J):J}function u(K,J,$){var F,ue,we,Ee,Me;const ce=p(),{abortOnUnmount:Se,client:Re,ssrState:Q,queryClient:me,prefetchQuery:xe}=ce,Ce=ri(K,J,"query"),re=me.getQueryDefaults(Ce),B=J===ya;typeof window>"u"&&Q==="prepass"&&($==null||(F=$.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((ue=$?.enabled)!==null&&ue!==void 0?ue:re?.enabled)!==!1&&!B&&!me.getQueryCache().find({queryKey:Ce})&&xe(Ce,$);const ae=h(Ce,(0,Ne.default)((0,Ne.default)({},re),$)),pe=(we=(Ee=$==null||(Me=$.trpc)===null||Me===void 0?void 0:Me.abortOnUnmount)!==null&&Ee!==void 0?Ee:void 0)!==null&&we!==void 0?we:Se,ge=wJ((0,Ne.default)((0,Ne.default)({},ae),{},{queryKey:Ce,queryFn:B?J:async H=>{const ee=(0,Ne.default)((0,Ne.default)({},ae),{},{trpc:(0,Ne.default)((0,Ne.default)({},ae?.trpc),pe?{signal:H.signal}:{signal:null})}),Te=await Re.query(...Qn(Ce,ee));return CA(Te)?MI(Te,me,Ce):Te}}),me);return ge.trpc=nc({path:K}),ge}function S(K,J,$){var F,ue,we;const Ee=p(),Me=ri(K,J,"query"),ce=J===ya,Se=(F=(ue=$==null||(we=$.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&ue!==void 0?ue:void 0)!==null&&F!==void 0?F:Ee.abortOnUnmount;EJ((0,Ne.default)((0,Ne.default)({},$),{},{queryKey:Me,queryFn:ce?J:Re=>{const Q={trpc:(0,Ne.default)((0,Ne.default)({},$?.trpc),Se?{signal:Re.signal}:{})};return Ee.client.query(...Qn(Me,Q))}}))}function w(K,J,$){var F,ue,we;const Ee=p(),Me=ri(K,J,"query"),ce=(F=(ue=$==null||(we=$.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&ue!==void 0?ue:void 0)!==null&&F!==void 0?F:Ee.abortOnUnmount,Se=MJ((0,Ne.default)((0,Ne.default)({},$),{},{queryKey:Me,queryFn:Re=>{const Q=(0,Ne.default)((0,Ne.default)({},$),{},{trpc:(0,Ne.default)((0,Ne.default)({},$?.trpc),ce?{signal:Re.signal}:{signal:null})});return Ee.client.query(...Qn(Me,Q))}}),Ee.queryClient);return Se.trpc=nc({path:K}),[Se.data,Se]}function C(K,J){const{client:$,queryClient:F}=p(),ue=rm(K),we=F.defaultMutationOptions(F.getMutationDefaults(ue)),Ee=_J((0,Ne.default)((0,Ne.default)({},J),{},{mutationKey:ue,mutationFn:Me=>$.mutation(...Qn([K,{input:Me}],J)),onSuccess(...Me){var ce,Se;return a({originalFn:()=>{var Q,me,xe;return(Q=J==null||(me=J.onSuccess)===null||me===void 0?void 0:me.call(J,...Me))!==null&&Q!==void 0?Q:we==null||(xe=we.onSuccess)===null||xe===void 0?void 0:xe.call(we,...Me)},queryClient:F,meta:(ce=(Se=J?.meta)!==null&&Se!==void 0?Se:we?.meta)!==null&&ce!==void 0?ce:{}})}}),F);return Ee.trpc=nc({path:K}),Ee}const E={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};function T(K,J,$){var F;const ue=(F=$?.enabled)!==null&&F!==void 0?F:J!==ya,we=Rr(ri(K,J,"any")),{client:Ee}=p(),Me=I.useRef($);I.useEffect(()=>{Me.current=$});const[ce]=I.useState(new Set([])),Se=I.useCallback(B=>{ce.add(B)},[ce]),Re=I.useRef(null),Q=I.useCallback(B=>{const ae=xe.current,pe=xe.current=B(ae);let ge=!1;for(const H of ce)if(ae[H]!==pe[H]){ge=!0;break}ge&&re(kM(pe,Se))},[Se,ce]),me=I.useCallback(()=>{var B;if((B=Re.current)===null||B===void 0||B.unsubscribe(),!ue){Q(()=>(0,Ne.default)((0,Ne.default)({},E),{},{reset:me}));return}Q(()=>(0,Ne.default)((0,Ne.default)({},R),{},{reset:me}));const ae=Ee.subscription(K.join("."),J??void 0,{onStarted:()=>{var pe,ge;(pe=(ge=Me.current).onStarted)===null||pe===void 0||pe.call(ge),Q(H=>(0,Ne.default)((0,Ne.default)({},H),{},{status:"pending",error:null}))},onData:pe=>{var ge,H;(ge=(H=Me.current).onData)===null||ge===void 0||ge.call(H,pe),Q(ee=>(0,Ne.default)((0,Ne.default)({},ee),{},{status:"pending",data:pe,error:null}))},onError:pe=>{var ge,H;(ge=(H=Me.current).onError)===null||ge===void 0||ge.call(H,pe),Q(ee=>(0,Ne.default)((0,Ne.default)({},ee),{},{status:"error",error:pe}))},onConnectionStateChange:pe=>{Q(ge=>{switch(pe.state){case"idle":return(0,Ne.default)((0,Ne.default)({},ge),{},{status:pe.state,error:null,data:void 0});case"connecting":return(0,Ne.default)((0,Ne.default)({},ge),{},{error:pe.error,status:pe.state});case"pending":return ge}})},onComplete:()=>{var pe,ge;(pe=(ge=Me.current).onComplete)===null||pe===void 0||pe.call(ge),Q(H=>(0,Ne.default)((0,Ne.default)({},H),{},{status:"idle",error:null,data:void 0}))}});Re.current=ae},[Ee,we,ue,Q]);I.useEffect(()=>(me(),()=>{var B;(B=Re.current)===null||B===void 0||B.unsubscribe()}),[me]);const xe=I.useRef(ue?(0,Ne.default)((0,Ne.default)({},R),{},{reset:me}):(0,Ne.default)((0,Ne.default)({},E),{},{reset:me})),[Ce,re]=I.useState(kM(xe.current,Se));return Ce}function j(K,J,$){var F,ue,we,Ee,Me;const{client:ce,ssrState:Se,prefetchInfiniteQuery:Re,queryClient:Q,abortOnUnmount:me}=p(),xe=ri(K,J,"infinite"),Ce=Q.getQueryDefaults(xe),re=J===ya;typeof window>"u"&&Se==="prepass"&&($==null||(F=$.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((ue=$?.enabled)!==null&&ue!==void 0?ue:Ce?.enabled)!==!1&&!re&&!Q.getQueryCache().find({queryKey:xe})&&Re(xe,(0,Ne.default)((0,Ne.default)({},Ce),$));const B=h(xe,(0,Ne.default)((0,Ne.default)({},Ce),$)),ae=(we=$==null||(Ee=$.trpc)===null||Ee===void 0?void 0:Ee.abortOnUnmount)!==null&&we!==void 0?we:me,pe=IJ((0,Ne.default)((0,Ne.default)({},B),{},{initialPageParam:(Me=$.initialCursor)!==null&&Me!==void 0?Me:null,persister:$.persister,queryKey:xe,queryFn:re?J:ge=>{var H;const ee=(0,Ne.default)((0,Ne.default)({},B),{},{trpc:(0,Ne.default)((0,Ne.default)({},B?.trpc),ae?{signal:ge.signal}:{signal:null})});return ce.query(...Qn(xe,ee,{pageParam:(H=ge.pageParam)!==null&&H!==void 0?H:$.initialCursor,direction:ge.direction}))}}),Q);return pe.trpc=nc({path:K}),pe}function D(K,J,$){var F,ue,we;const Ee=p(),Me=ri(K,J,"infinite"),ce=Ee.queryClient.getQueryDefaults(Me),Se=J===ya,Re=h(Me,(0,Ne.default)((0,Ne.default)({},ce),$)),Q=(F=$==null||(ue=$.trpc)===null||ue===void 0?void 0:ue.abortOnUnmount)!==null&&F!==void 0?F:Ee.abortOnUnmount;RJ((0,Ne.default)((0,Ne.default)({},$),{},{initialPageParam:(we=$.initialCursor)!==null&&we!==void 0?we:null,queryKey:Me,queryFn:Se?J:me=>{var xe;const Ce=(0,Ne.default)((0,Ne.default)({},Re),{},{trpc:(0,Ne.default)((0,Ne.default)({},Re?.trpc),Q?{signal:me.signal}:{})});return Ee.client.query(...Qn(Me,Ce,{pageParam:(xe=me.pageParam)!==null&&xe!==void 0?xe:$.initialCursor,direction:me.direction}))}}))}function z(K,J,$){var F,ue,we;const Ee=p(),Me=ri(K,J,"infinite"),ce=Ee.queryClient.getQueryDefaults(Me),Se=h(Me,(0,Ne.default)((0,Ne.default)({},ce),$)),Re=(F=$==null||(ue=$.trpc)===null||ue===void 0?void 0:ue.abortOnUnmount)!==null&&F!==void 0?F:Ee.abortOnUnmount,Q=CJ((0,Ne.default)((0,Ne.default)({},$),{},{initialPageParam:(we=$.initialCursor)!==null&&we!==void 0?we:null,queryKey:Me,queryFn:me=>{var xe;const Ce=(0,Ne.default)((0,Ne.default)({},Se),{},{trpc:(0,Ne.default)((0,Ne.default)({},Se?.trpc),Re?{signal:me.signal}:{})});return Ee.client.query(...Qn(Me,Ce,{pageParam:(xe=me.pageParam)!==null&&xe!==void 0?xe:$.initialCursor,direction:me.direction}))}}),Ee.queryClient);return Q.trpc=nc({path:K}),[Q.data,Q]}return{Provider:f,createClient:m,useContext:p,useUtils:p,useQuery:u,usePrefetchQuery:S,useSuspenseQuery:w,useQueries:(K,J)=>{const{ssrState:$,queryClient:F,prefetchQuery:ue,client:we}=p(),Ee=xM(we),Me=K(Ee);if(typeof window>"u"&&$==="prepass")for(const Se of Me){var ce;const Re=Se;((ce=Re.trpc)===null||ce===void 0?void 0:ce.ssr)!==!1&&!F.getQueryCache().find({queryKey:Re.queryKey})&&ue(Re.queryKey,Re)}return SI({queries:Me.map(Se=>(0,Ne.default)((0,Ne.default)({},Se),{},{queryKey:Se.queryKey})),combine:J?.combine},F)},useSuspenseQueries:K=>{const{queryClient:J,client:$}=p(),F=xM($),ue=K(F),we=AJ({queries:ue.map(Ee=>(0,Ne.default)((0,Ne.default)({},Ee),{},{queryFn:Ee.queryFn,queryKey:Ee.queryKey}))},J);return[we.map(Ee=>Ee.data),we]},useMutation:C,useSubscription:T,useInfiniteQuery:j,usePrefetchInfiniteQuery:D,useSuspenseInfiniteQuery:z}}function eee(e){const t=HJ(e);return Uy(n=>n==="useContext"||n==="useUtils"?()=>{const a=e.useUtils();return I.useMemo(()=>ZJ(a),[a])}:e.hasOwnProperty(n)?e[n]:t[n])}function tee(e){const t=JJ();return eee(t)}SA();var yg={};var CI=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();var nee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var aee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());var wM=e=>{const t=aee(e);return t.charAt(0).toUpperCase()+t.slice(1)};var iee={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 ree=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var oee=I.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:m,iconNode:f,...p},h)=>I.createElement("svg",{ref:h,...iee,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:CI("lucide",s),...!m&&!ree(p)&&{"aria-hidden":"true"},...p},[...f.map(([u,S])=>I.createElement(u,S)),...Array.isArray(m)?m:[m]]));var W=(e,t)=>{const n=I.forwardRef(({className:a,...s},m)=>I.createElement(oee,{ref:m,iconNode:t,className:CI(`lucide-${nee(wM(e))}`,`lucide-${e}`,a),...s}));return n.displayName=wM(e),n};var AI=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 see=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 lee=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 cee=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 ly=W("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var uee=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 jm=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 dee=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 bg=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 Pm=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 MM=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 CM=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 mee=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 pee=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 fee=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 AM=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 hee=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 gee=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 Sg=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 EM=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 EI=W("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Eo=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 vee=W("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var dp=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 yee=W("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var RI=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 bee=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 RM=W("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var See=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 xee=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 _I=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 _M=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 II=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 kee=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 wee=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 TI=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 IM=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 Mee=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 Vs=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 NI=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 Fb=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 tl=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 Cee=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 Dm=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 Aee=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 zm=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 Eee=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 Ree=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 OI=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 om=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 _ee=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 Iee=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 mp=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 jI=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 Tee=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 Nee=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 Oee=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 pp=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 jee=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 Pee=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 Hb=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 cy=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 Kc=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 Dee=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 zee=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 PI=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 DI=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 gfe=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 Lee=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 $b=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 zI=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 qee=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 Bee=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 LI=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 Uee=W("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var Fee=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 Hee=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 Wc=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 ha=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 $ee=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 Qee=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 Vee=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 Ro=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 Yc=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 qI=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 Gee=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 Qb=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 Zee=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 Kee=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 Wee=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 fp=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 Yee=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 Xee=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 Jee=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 Lm=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 ete=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 tte=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 Vb=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 nte=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 BI=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 UI=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 ate=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 Xc=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 ite=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 FI=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 rte=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 HI=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 hp=W("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var uy=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 ote=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 ste=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 lte=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 cte=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 Gs=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 ute=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 dte=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 mte=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 pte=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 fte=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 TM=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 $I=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 Jc=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 QI=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 hte=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 NM=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 gte=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 zi=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 vte=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 yte=W("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var kr=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 bte=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 Ste=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"}]]),VI=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,x=VI??tee();typeof globalThis<"u"&&!VI&&(globalThis.__camstackTrpcReact=x);function ui(e,t){if(typeof globalThis>"u")return I.createContext(t);const n=globalThis.__camstackSharedContexts,a=n??new Map;n||(globalThis.__camstackSharedContexts=a);const s=a.get(e);if(s)return s;const m=I.createContext(t);return a.set(e,m),m}var GI=ui("camstack:system",null);function ZI({system:e,children:t}){return v.jsx(GI.Provider,{value:e,children:t})}function xte(){const e=I.useContext(GI);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function si(e,t){const n=xte(),a=I.useRef(t);a.current=t;const[s,m]=I.useState(n.connectionVersion);I.useEffect(()=>n.subscribeConnectionEvents((f,p)=>{f==="connected"&&m(p)}),[n]),I.useEffect(()=>n.subscribeEvent(e,f=>{a.current(f)}),[n,e,s])}x.accessories.setChildHidden.useMutation;x.accessories.getStatus.useQuery;x.addonPages.listPages.useQuery;x.addons.list.useQuery;x.addons.getLogs.useQuery;x.addons.listPackages.useQuery;x.addons.installPackage.useMutation;x.addons.installFromWorkspace.useMutation;x.addons.isWorkspaceAvailable.useQuery;x.addons.listWorkspacePackages.useQuery;x.addons.uninstallPackage.useMutation;x.addons.reloadPackages.useMutation;x.addons.searchAvailable.useQuery;x.addons.listUpdates.useQuery;x.addons.updatePackage.useMutation;x.addons.rollbackPackage.useMutation;x.addons.forceRefresh.useMutation;x.addons.restartServer.useMutation;x.addons.getLastRestart.useQuery;x.addons.listFrameworkPackages.useQuery;x.addons.listCapabilityProviders.useQuery;x.addons.setCapabilityProviderEnabled.useMutation;x.addons.getVersions.useQuery;x.addons.restartAddon.useMutation;x.addons.retryLoad.useMutation;x.addons.getAutoUpdateSettings.useQuery;x.addons.setAutoUpdateSettings.useMutation;x.addons.getAddonAutoUpdate.useQuery;x.addons.setAddonAutoUpdate.useMutation;x.addons.applyAutoUpdateToAll.useMutation;x.addons.custom.useMutation;x.addons.startJob.useMutation;x.addons.getJob.useQuery;x.addons.listJobs.useQuery;x.addons.cancelJob.useMutation;x.addons.onAddonLogs.useSubscription;x.addonSettings.getGlobalSettings.useQuery;x.addonSettings.updateGlobalSettings.useMutation;x.addonSettings.getDeviceSettings.useQuery;x.addonSettings.updateDeviceSettings.useMutation;x.addonWidgets.listWidgets.useQuery;x.airQualitySensor.getStatus.useQuery;x.alarmPanel.arm.useMutation;x.alarmPanel.disarm.useMutation;x.alarmPanel.trigger.useMutation;x.alarmPanel.getStatus.useQuery;x.alerts.emit.useMutation;x.alerts.update.useMutation;x.alerts.list.useQuery;x.alerts.getUnreadCount.useQuery;x.alerts.markRead.useMutation;x.alerts.markAllRead.useMutation;x.alerts.dismiss.useMutation;x.ambientLightSensor.getStatus.useQuery;x.audioAnalysis.resolveDeviceSettings.useQuery;x.audioAnalysis.getDeviceSettingsContribution.useQuery;x.audioAnalysis.getDeviceLiveContribution.useQuery;x.audioAnalysis.applyDeviceSettingsPatch.useMutation;x.audioAnalyzer.analyseChunk.useMutation;x.audioAnalyzer.classify.useQuery;x.audioAnalyzer.isReady.useQuery;x.audioAnalyzer.dispose.useMutation;x.audioAnalyzer.reprobeAudioEngine.useMutation;x.audioCodec.listSupportedCodecs.useQuery;x.audioCodec.canHandle.useQuery;x.audioCodec.createDecodeSession.useMutation;x.audioCodec.createEncodeSession.useMutation;x.audioCodec.closeSession.useMutation;x.audioCodec.pushEncodedFrame.useMutation;x.audioCodec.pullPcm.useQuery;x.audioCodec.pushPcm.useMutation;x.audioCodec.pullEncoded.useQuery;x.audioCodec.flushEncode.useMutation;x.audioCodec.listActiveSessions.useQuery;x.audioMetrics.getCurrentSnapshot.useQuery;x.audioMetrics.getHistory.useQuery;x.automationControl.enable.useMutation;x.automationControl.disable.useMutation;x.automationControl.trigger.useMutation;x.automationControl.getStatus.useQuery;x.backup.listDestinations.useQuery;x.backup.trigger.useMutation;x.backup.list.useQuery;x.backup.listLocations.useQuery;x.backup.getEntries.useQuery;x.backup.restore.useMutation;x.backup.delete.useMutation;x.backup.listArchives.useQuery;x.backup.upsertDestinationPolicy.useMutation;x.backup.previewSchedule.useQuery;x.backup.listSchedules.useQuery;x.backup.upsertSchedule.useMutation;x.backup.deleteSchedule.useMutation;x.battery.wakeForStream.useMutation;x.battery.getStatus.useQuery;x.binary.getStatus.useQuery;x.brightness.setBrightness.useMutation;x.brightness.getStatus.useQuery;x.broker.list.useQuery;x.broker.get.useQuery;x.broker.listProviders.useQuery;x.broker.add.useMutation;x.broker.remove.useMutation;x.broker.testConnection.useMutation;x.broker.getSettings.useQuery;x.broker.setSettings.useMutation;x.broker.getBrokerConfig.useQuery;x.broker.getSettingsSchema.useQuery;x.broker.testSettings.useMutation;x.broker.publish.useMutation;x.broker.subscribe.useMutation;x.broker.unsubscribe.useMutation;x.broker.getState.useQuery;x.broker.getStatus.useQuery;x.button.press.useMutation;x.cameraCredentials.getCredentials.useQuery;x.cameraCredentials.getStatus.useQuery;x.cameraPipelineConfig.getDeviceSettingsContribution.useQuery;x.cameraPipelineConfig.getDeviceLiveContribution.useQuery;x.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation;x.cameraStreams.getCameraStreams.useQuery;x.cameraStreams.getBrokerStreams.useQuery;x.cameraStreams.getRtspEntries.useQuery;x.cameraStreams.getProfileRtspEntries.useQuery;x.cameraStreams.pickStream.useQuery;x.carbonMonoxide.getStatus.useQuery;x.climateControl.setMode.useMutation;x.climateControl.setFanMode.useMutation;x.climateControl.setPreset.useMutation;x.climateControl.setTarget.useMutation;x.climateControl.setTargetRange.useMutation;x.climateControl.setTargetHumidity.useMutation;x.climateControl.setSwingVertical.useMutation;x.climateControl.setSwingHorizontal.useMutation;x.climateControl.getStatus.useQuery;x.color.setColor.useMutation;x.color.getStatus.useQuery;x.connectionTest.testSettings.useMutation;x.connectionTest.describeTest.useQuery;x.connectivity.getStatus.useQuery;x.consumables.reset.useMutation;x.consumables.getStatus.useQuery;x.contact.getStatus.useQuery;x.control.setValue.useMutation;x.control.getStatus.useQuery;x.coreBlocks.list.useQuery;x.coreBlocks.get.useQuery;x.coreBlocks.create.useMutation;x.coreBlocks.update.useMutation;x.coreBlocks.delete.useMutation;x.coreBlocks.setEnabled.useMutation;x.coreBlocks.restart.useMutation;x.coreBlocks.compile.useMutation;x.coreBlocks.getTypeDefs.useQuery;x.cover.open.useMutation;x.cover.close.useMutation;x.cover.stop.useMutation;x.cover.setPosition.useMutation;x.cover.setTiltPosition.useMutation;x.cover.getStatus.useQuery;x.dayNight.getOptions.useQuery;x.dayNight.setSettings.useMutation;x.dayNight.getStatus.useQuery;x.decoder.supportsCodec.useQuery;x.decoder.getInfo.useQuery;x.decoder.createSession.useQuery;x.decoder.destroySession.useQuery;x.decoder.pushPacket.useQuery;x.decoder.openStream.useQuery;x.decoder.pullFrames.useQuery;x.decoder.pullHandles.useQuery;x.decoder.getFrame.useQuery;x.decoder.getShmStats.useQuery;x.decoder.updateConfig.useQuery;x.decoder.getStats.useQuery;x.decoder.listActiveSessions.useQuery;x.decoder.reprobeHwaccel.useMutation;x.detectionPipeline.getDeviceSettingsContribution.useQuery;x.detectionPipeline.getDeviceLiveContribution.useQuery;x.detectionPipeline.applyDeviceSettingsPatch.useMutation;x.deviceAdoption.listCandidateFilters.useQuery;x.deviceAdoption.listCandidates.useQuery;x.deviceAdoption.getCandidate.useQuery;x.deviceAdoption.refresh.useMutation;x.deviceAdoption.adopt.useMutation;x.deviceAdoption.release.useMutation;x.deviceAdoption.resync.useMutation;x.deviceAdoption.getStatus.useQuery;x.deviceDiscovery.listDiscovered.useQuery;x.deviceDiscovery.refreshDiscovery.useMutation;x.deviceDiscovery.adoptDevice.useMutation;x.deviceDiscovery.releaseDevice.useMutation;x.deviceDiscovery.getStatus.useQuery;x.deviceExport.getStatus.useQuery;x.deviceExport.listSupportedDeviceKinds.useQuery;x.deviceExport.listExposedDevices.useQuery;x.deviceExport.exposeDevice.useMutation;x.deviceExport.unexposeDevice.useMutation;x.deviceExport.getDeviceSettingsContribution.useQuery;x.deviceExport.getDeviceLiveContribution.useQuery;x.deviceExport.applyDeviceSettingsPatch.useMutation;x.deviceManager.allocateDeviceId.useMutation;x.deviceManager.registerDevice.useMutation;x.deviceManager.removeDevice.useMutation;x.deviceManager.persistConfig.useMutation;x.deviceManager.loadConfig.useQuery;x.deviceManager.loadRuntimeState.useQuery;x.deviceManager.loadMeta.useQuery;x.deviceManager.setName.useMutation;x.deviceManager.setLocation.useMutation;x.deviceManager.setType.useMutation;x.deviceManager.setIntegrationId.useMutation;x.deviceManager.setLinkDeviceId.useMutation;x.deviceManager.setPrimaryChildEntityId.useMutation;x.deviceManager.setChildLayout.useMutation;x.deviceManager.setDisplay.useMutation;var KI=x.deviceManager.getRoleDisplayDefaults.useQuery;x.deviceManager.setRoleDisplayDefaults.useMutation;x.deviceManager.getWireableFields.useQuery;x.deviceManager.setRole.useMutation;x.deviceManager.applyInitialMeta.useMutation;x.deviceManager.setMetadata.useMutation;x.deviceManager.listLocations.useQuery;x.deviceManager.addLocation.useMutation;x.deviceManager.removeLocation.useMutation;x.deviceManager.setDisabled.useMutation;x.deviceManager.listPersistedByAddon.useQuery;x.deviceManager.listAll.useQuery;var WI=x.deviceManager.getDevice.useQuery;x.deviceManager.getChildren.useQuery;x.deviceManager.getLinkedDevices.useQuery;x.deviceManager.getStreamSources.useQuery;x.deviceManager.getConfigSchema.useQuery;x.deviceManager.getSettingsSchema.useQuery;x.deviceManager.updateConfig.useMutation;x.deviceManager.enable.useMutation;x.deviceManager.disable.useMutation;x.deviceManager.remove.useMutation;x.deviceManager.removeByIntegration.useMutation;x.deviceManager.getStreamProfileMap.useQuery;x.deviceManager.setStreamProfileMap.useMutation;x.deviceManager.probeStreams.useMutation;x.deviceManager.getBindings.useQuery;x.deviceManager.getAllBindings.useQuery;x.deviceManager.setWrapperActive.useMutation;x.deviceManager.listWrappersForCap.useQuery;x.deviceManager.listBindableCapsForDeviceType.useQuery;x.deviceManager.getDeviceSettingsAggregate.useQuery;x.deviceManager.getDeviceLiveInfoAggregate.useQuery;x.deviceManager.getDeviceAggregate.useQuery;x.deviceManager.runDeviceAction.useMutation;x.deviceManager.updateDeviceField.useMutation;x.deviceManager.updateDeviceFieldsBatch.useMutation;x.deviceManager.discoverDevices.useMutation;x.deviceManager.adoptDevice.useMutation;x.deviceManager.getCreationSchema.useQuery;x.deviceManager.createDevice.useMutation;x.deviceManager.testCreationField.useMutation;x.deviceManager.adoptionListCandidateFilters.useQuery;x.deviceManager.adoptionListCandidates.useQuery;x.deviceManager.adoptionRefresh.useMutation;x.deviceManager.adoptionAdopt.useMutation;x.deviceManager.adoptionRelease.useMutation;x.deviceManager.adoptionStartJob.useMutation;x.deviceManager.adoptionListJobs.useQuery;x.deviceManager.adoptionCancelJob.useMutation;x.deviceManager.adoptionResync.useMutation;x.deviceManager.discoveryProviders.useQuery;x.deviceManager.discoverAllProviders.useMutation;x.deviceManager.discoverProvider.useMutation;x.deviceManager.providerCreationType.useQuery;x.deviceManager.providerDiscoveryParamsSchema.useQuery;x.deviceManager.testField.useMutation;x.deviceManager.getDeviceStatusAggregate.useQuery;x.deviceManager.getDeviceStatusAggregateBatch.useQuery;x.deviceManager.getDeviceSettingsContribution.useQuery;x.deviceManager.getDeviceLiveContribution.useQuery;x.deviceManager.applyDeviceSettingsPatch.useMutation;x.deviceOps.getStreamSources.useQuery;x.deviceOps.getConfigEntries.useQuery;x.deviceOps.setConfig.useMutation;x.deviceOps.runAction.useMutation;x.deviceOps.removeDevice.useMutation;x.deviceOps.getSettingsSchema.useQuery;x.deviceOps.getRawState.useQuery;x.deviceProvider.start.useMutation;x.deviceProvider.stop.useMutation;x.deviceProvider.getStatus.useQuery;x.deviceProvider.getDevices.useQuery;x.deviceProvider.supportsDiscovery.useQuery;x.deviceProvider.discoverDevices.useMutation;x.deviceProvider.getDiscoveryParamsSchema.useQuery;x.deviceProvider.getManualCreationType.useQuery;x.deviceProvider.adoptDiscoveredDevice.useMutation;x.deviceProvider.supportsManualCreation.useQuery;x.deviceProvider.getChildCreationSchema.useQuery;x.deviceProvider.createDevice.useMutation;x.deviceProvider.testCreationField.useMutation;x.deviceState.getSnapshot.useQuery;x.deviceState.getCapSlice.useQuery;x.deviceState.getAllSnapshots.useQuery;x.deviceState.setCapSlice.useMutation;x.deviceStatus.getStatus.useQuery;x.doorbell.getStatus.useQuery;x.doorbell.getDeviceSettingsContribution.useQuery;x.doorbell.getDeviceLiveContribution.useQuery;x.doorbell.applyDeviceSettingsPatch.useMutation;x.enumSensor.getStatus.useQuery;x.eventEmitter.getStatus.useQuery;x.events.getEvents.useQuery;x.events.getEventThumbnail.useQuery;x.events.getEventClipUrl.useQuery;x.faceGallery.listIdentities.useQuery;x.faceGallery.createIdentity.useMutation;x.faceGallery.renameIdentity.useMutation;x.faceGallery.deleteIdentity.useMutation;x.faceGallery.listIdentitySamples.useQuery;x.faceGallery.removeSample.useMutation;x.faceGallery.listRecentFaces.useQuery;x.faceGallery.getFaceByTrack.useQuery;x.faceGallery.getFaceMedia.useQuery;x.faceGallery.assignFace.useMutation;x.faceGallery.unassignFace.useMutation;x.faceGallery.deleteFace.useMutation;x.faceGallery.assignFaces.useMutation;x.faceGallery.unassignFaces.useMutation;x.faceGallery.suggestFaceClusters.useQuery;x.fanControl.setPercentage.useMutation;x.fanControl.setPreset.useMutation;x.fanControl.setDirection.useMutation;x.fanControl.setOscillating.useMutation;x.fanControl.getStatus.useQuery;x.featureProbe.getStatus.useQuery;x.flood.getStatus.useQuery;x.gas.getStatus.useQuery;x.humidifier.setOn.useMutation;x.humidifier.setTargetHumidity.useMutation;x.humidifier.setMode.useMutation;x.humidifier.getStatus.useQuery;x.humiditySensor.getStatus.useQuery;x.image.getStatus.useQuery;x.imageSettings.getOptions.useQuery;x.imageSettings.setSettings.useMutation;x.imageSettings.getStatus.useQuery;x.integrations.list.useQuery;x.integrations.get.useQuery;x.integrations.getByAddonId.useQuery;x.integrations.create.useMutation;x.integrations.update.useMutation;x.integrations.delete.useMutation;x.integrations.getSettings.useQuery;x.integrations.setSettings.useMutation;x.integrations.getAvailableTypes.useQuery;x.integrations.testConnection.useMutation;var kte=x.intercom.startSession.useMutation,wte=x.intercom.handleAnswer.useMutation,Mte=x.intercom.stopSession.useMutation;x.intercom.startTalkSession.useMutation;x.intercom.pushTalkAudio.useMutation;x.intercom.endTalkSession.useMutation;x.intercom.getStatus.useQuery;x.lawnMowerControl.startMowing.useMutation;x.lawnMowerControl.pause.useMutation;x.lawnMowerControl.dock.useMutation;x.lawnMowerControl.getStatus.useQuery;x.llm.generate.useMutation;x.llm.generateVision.useMutation;x.llm.cancel.useMutation;x.llm.listProfileKinds.useQuery;x.llm.listProfiles.useQuery;x.llm.upsertProfile.useMutation;x.llm.deleteProfile.useMutation;x.llm.testProfile.useMutation;x.llm.listModels.useQuery;x.llm.getDefaults.useQuery;x.llm.setDefault.useMutation;x.llm.getUsage.useQuery;x.llm.listModelCatalog.useQuery;x.llm.listRuntimeNodes.useQuery;x.llm.listNodeModels.useQuery;x.llm.resolveModelRef.useMutation;x.llm.installModel.useMutation;x.llm.deleteModel.useMutation;x.llm.getRuntimeStatus.useQuery;x.llm.startRuntime.useMutation;x.llm.stopRuntime.useMutation;x.localNetwork.list.useQuery;x.localNetwork.getPreferred.useQuery;x.localNetwork.getConnectionEndpoints.useQuery;x.localNetwork.getNotificationEndpoint.useQuery;x.localNetwork.setNotificationEndpoint.useMutation;x.localNetwork.getAllowedAddresses.useQuery;x.localNetwork.setAllowedAddresses.useMutation;x.localNetwork.resetAllowlistToBestMatch.useMutation;x.lockControl.lock.useMutation;x.lockControl.unlock.useMutation;x.lockControl.open.useMutation;x.lockControl.getStatus.useQuery;x.mediaPlayer.play.useMutation;x.mediaPlayer.pause.useMutation;x.mediaPlayer.stop.useMutation;x.mediaPlayer.next.useMutation;x.mediaPlayer.previous.useMutation;x.mediaPlayer.seek.useMutation;x.mediaPlayer.setVolume.useMutation;x.mediaPlayer.setMute.useMutation;x.mediaPlayer.setShuffle.useMutation;x.mediaPlayer.setRepeat.useMutation;x.mediaPlayer.selectSource.useMutation;x.mediaPlayer.playMedia.useMutation;x.mediaPlayer.getStatus.useQuery;x.meshNetwork.getStatus.useQuery;x.meshNetwork.join.useMutation;x.meshNetwork.startLogin.useMutation;x.meshNetwork.leave.useMutation;x.meshNetwork.logout.useMutation;x.meshNetwork.listPeers.useQuery;x.meshNetwork.testConnection.useMutation;x.metricsProvider.collectSnapshot.useQuery;x.metricsProvider.getCached.useQuery;x.metricsProvider.getCurrent.useQuery;x.metricsProvider.getDiskSpace.useQuery;x.metricsProvider.getGpuInfo.useQuery;x.metricsProvider.getCpuTemperature.useQuery;x.metricsProvider.getProcessStats.useQuery;x.metricsProvider.listAddonInstances.useQuery;x.metricsProvider.getAddonStats.useQuery;x.metricsProvider.listNodeProcesses.useQuery;x.metricsProvider.killProcess.useMutation;x.metricsProvider.dumpHeapSnapshot.useMutation;x.motion.isDetected.useQuery;x.motion.getStatus.useQuery;x.motionDetection.analyze.useMutation;x.motionDetection.removeCamera.useMutation;x.motionDetection.reset.useMutation;x.motionDetection.getDeviceSettingsContribution.useQuery;x.motionDetection.getDeviceLiveContribution.useQuery;x.motionDetection.applyDeviceSettingsPatch.useMutation;x.motionTrigger.setMotionTrigger.useMutation;x.motionTrigger.getStatus.useQuery;x.motionZones.getOptions.useQuery;x.motionZones.setZone.useMutation;x.motionZones.getStatus.useQuery;x.mqttBroker.listBrokers.useQuery;x.mqttBroker.getBrokerConfig.useQuery;x.mqttBroker.addBroker.useMutation;x.mqttBroker.removeBroker.useMutation;x.mqttBroker.testConnection.useMutation;x.mqttBroker.startEmbeddedBroker.useMutation;x.mqttBroker.stopEmbeddedBroker.useMutation;x.mqttBroker.getStatus.useQuery;x.nativeObjectDetection.setEnabled.useMutation;x.nativeObjectDetection.getStatus.useQuery;x.networkAccess.start.useMutation;x.networkAccess.stop.useMutation;x.networkAccess.getEndpoint.useQuery;x.networkAccess.getStatus.useQuery;x.networkAccess.listEndpoints.useQuery;x.networkQuality.getDeviceStats.useQuery;x.networkQuality.getAllStats.useQuery;x.networkQuality.reportClientStats.useMutation;x.nodes.topology.useQuery;x.nodes.deployAddon.useMutation;x.nodes.undeployAddon.useMutation;x.nodes.restartAddon.useMutation;x.nodes.restartProcess.useMutation;x.nodes.restartNode.useMutation;x.nodes.shutdownNode.useMutation;x.nodes.renameNode.useMutation;x.nodes.clusterAddonStatus.useQuery;x.nodes.getCapUsageGraph.useQuery;x.nodes.getNodeAddons.useQuery;x.nodes.setProcessLogLevel.useMutation;x.nodes.executeQuery.useMutation;x.notificationOutput.listTargetKinds.useQuery;x.notificationOutput.listTargets.useQuery;x.notificationOutput.discoverTargets.useQuery;x.notificationOutput.send.useMutation;x.notificationOutput.testTarget.useMutation;x.notificationOutput.upsertTarget.useMutation;x.notificationOutput.deleteTarget.useMutation;x.notificationOutput.setTargetEnabled.useMutation;x.notificationRules.listRules.useQuery;x.notificationRules.getRule.useQuery;x.notificationRules.createRule.useMutation;x.notificationRules.updateRule.useMutation;x.notificationRules.deleteRule.useMutation;x.notificationRules.setRuleEnabled.useMutation;x.notificationRules.listDeviceMutes.useQuery;x.notificationRules.setDeviceMuted.useMutation;x.notificationRules.testRule.useMutation;x.notificationRules.getConditionCatalog.useQuery;x.notificationRules.getHistory.useQuery;x.notificationRules.listSnoozes.useQuery;x.notificationRules.createSnooze.useMutation;x.notificationRules.cancelSnooze.useMutation;x.notificationRules.getAlarmConfig.useQuery;x.notificationRules.setAlarmConfig.useMutation;x.notifier.send.useMutation;x.notifier.cancel.useMutation;x.notifier.getStatus.useQuery;x.numericSensor.getStatus.useQuery;x.osd.setOverlay.useMutation;x.osd.getStatus.useQuery;x.osdManager.getDeviceOsd.useQuery;x.osdManager.getSourceCatalog.useQuery;x.osdManager.getConditionSupport.useQuery;x.osdManager.setSlotBinding.useMutation;x.osdManager.clearSlotBinding.useMutation;x.osdManager.copyDeviceConfiguration.useMutation;x.osdManager.previewSlot.useMutation;x.osdManager.renderDevice.useMutation;x.petFeeder.feed.useMutation;x.petFeeder.cancelFeed.useMutation;x.petFeeder.resetDesiccant.useMutation;x.petFeeder.markFoodReplenished.useMutation;x.petFeeder.callPet.useMutation;x.petFeeder.playSound.useMutation;x.petFeeder.setChildLock.useMutation;x.petFeeder.setIndicatorLight.useMutation;x.petFeeder.setFeedSound.useMutation;x.petFeeder.setVolume.useMutation;x.petFeeder.getStatus.useQuery;x.pipelineAnalytics.getActiveTracks.useQuery;x.pipelineAnalytics.getTrack.useQuery;x.pipelineAnalytics.listTracks.useQuery;x.pipelineAnalytics.listRecentTracks.useQuery;x.pipelineAnalytics.clearTracks.useMutation;x.pipelineAnalytics.getMotionEvents.useQuery;x.pipelineAnalytics.getObjectEvents.useQuery;x.pipelineAnalytics.getAudioEvents.useQuery;x.pipelineAnalytics.listEventKinds.useQuery;x.pipelineAnalytics.listEventKindsBatch.useQuery;x.pipelineAnalytics.getSensorEvents.useQuery;x.pipelineAnalytics.getKeyEvents.useQuery;x.pipelineAnalytics.getEventDensity.useQuery;x.pipelineAnalytics.pruneEventsBefore.useMutation;x.pipelineAnalytics.pruneTracksBefore.useMutation;x.pipelineAnalytics.wipeAllAnalytics.useMutation;x.pipelineAnalytics.deleteTracks.useMutation;x.pipelineAnalytics.setTrackFlags.useMutation;x.pipelineAnalytics.getEventStoreFootprint.useQuery;x.pipelineAnalytics.pruneEvents.useMutation;x.pipelineAnalytics.deleteDeviceEvents.useMutation;x.pipelineAnalytics.pauseForStorageMigration.useMutation;x.pipelineAnalytics.resumeForStorageMigration.useMutation;x.pipelineAnalytics.refreshStorageLocationsForMigration.useMutation;x.pipelineAnalytics.startStorageMigrationMove.useMutation;x.pipelineAnalytics.getStorageMigrationMoveStatus.useQuery;x.pipelineAnalytics.cancelStorageMigrationMove.useMutation;x.pipelineAnalytics.listOpsLog.useQuery;x.pipelineAnalytics.getTrainingExportSummary.useQuery;x.pipelineAnalytics.getTrainingExportUrl.useQuery;x.pipelineAnalytics.listRetrainStaging.useQuery;x.pipelineAnalytics.listRetrainFrames.useQuery;x.pipelineAnalytics.selectRetrainFrames.useMutation;x.pipelineAnalytics.deselectRetrainFrame.useMutation;x.pipelineAnalytics.getRetrainFrameImage.useQuery;x.pipelineAnalytics.proposeRetrainAnnotations.useMutation;x.pipelineAnalytics.listRetrainAnnotations.useQuery;x.pipelineAnalytics.saveRetrainAnnotations.useMutation;x.pipelineAnalytics.completeRetrainTrack.useMutation;x.pipelineAnalytics.restageRetrainTrack.useMutation;x.pipelineAnalytics.getRetrainExportUrl.useQuery;x.pipelineAnalytics.getEventMedia.useQuery;x.pipelineAnalytics.getTrackMedia.useQuery;x.pipelineAnalytics.listTrackMedia.useQuery;x.pipelineAnalytics.searchObjectEvents.useQuery;x.pipelineAnalytics.wipeObjectEmbeddings.useMutation;x.pipelineAnalytics.rebuildObjectEmbeddings.useMutation;x.pipelineAnalytics.getObjectEmbeddingRebuildStatus.useQuery;x.pipelineAnalytics.getDeviceSettingsContribution.useQuery;x.pipelineAnalytics.getDeviceLiveContribution.useQuery;x.pipelineAnalytics.applyDeviceSettingsPatch.useMutation;x.pipelineExecutor.getAvailableEngines.useQuery;x.pipelineExecutor.getSelectedEngine.useQuery;x.pipelineExecutor.getDefaultSteps.useQuery;x.pipelineExecutor.getEngineProvisioning.useQuery;x.pipelineExecutor.getVideoPipelineSteps.useQuery;x.pipelineExecutor.setVideoPipelineSteps.useMutation;x.pipelineExecutor.clearDeviceOverrides.useMutation;x.pipelineExecutor.getSchema.useQuery;x.pipelineExecutor.getGlobalSteps.useQuery;x.pipelineExecutor.getGlobalPipelineConfig.useQuery;x.pipelineExecutor.getOrchestratorConfigSchema.useQuery;x.pipelineExecutor.validatePipeline.useQuery;x.pipelineExecutor.listTemplates.useQuery;x.pipelineExecutor.saveTemplate.useMutation;x.pipelineExecutor.updateTemplate.useMutation;x.pipelineExecutor.deleteTemplate.useMutation;x.pipelineExecutor.getCapabilities.useQuery;x.pipelineExecutor.getAddonModels.useQuery;x.pipelineExecutor.downloadModel.useMutation;x.pipelineExecutor.deleteModel.useMutation;x.pipelineExecutor.runPipeline.useMutation;x.pipelineExecutor.runPipelineBatch.useMutation;x.pipelineExecutor.cacheFrameInPool.useMutation;x.pipelineExecutor.inferCached.useMutation;x.pipelineExecutor.uncacheFrame.useMutation;x.pipelineExecutor.getEffectiveTuning.useQuery;x.pipelineExecutor.listLoadedEngines.useQuery;x.pipelineExecutor.spinEngine.useMutation;x.pipelineExecutor.killEngine.useMutation;x.pipelineExecutor.listReferenceImages.useQuery;x.pipelineExecutor.getReferenceImage.useQuery;x.pipelineExecutor.getReferenceAudioFiles.useQuery;x.pipelineExecutor.getReferenceAudio.useQuery;x.pipelineExecutor.getAudioCapabilities.useQuery;x.pipelineExecutor.runAudioTest.useMutation;x.pipelineExecutor.getDetectionConfigSchema.useQuery;x.pipelineOrchestrator.pauseForStorageMigration.useMutation;x.pipelineOrchestrator.resumeForStorageMigration.useMutation;x.pipelineOrchestrator.assignPipeline.useMutation;x.pipelineOrchestrator.unassignPipeline.useMutation;x.pipelineOrchestrator.setPipelineDevicePin.useMutation;x.pipelineOrchestrator.getPipelineDevicePin.useQuery;x.pipelineOrchestrator.rebalance.useMutation;x.pipelineOrchestrator.getPipelineAssignments.useQuery;x.pipelineOrchestrator.getPipelineAssignment.useQuery;x.pipelineOrchestrator.getAgentLoad.useQuery;x.pipelineOrchestrator.getGlobalMetrics.useQuery;x.pipelineOrchestrator.getCameraMetrics.useQuery;x.pipelineOrchestrator.getCapabilityBindings.useQuery;x.pipelineOrchestrator.setCapabilityBinding.useMutation;x.pipelineOrchestrator.getIngestOwner.useQuery;x.pipelineOrchestrator.assignAudio.useMutation;x.pipelineOrchestrator.unassignAudio.useMutation;x.pipelineOrchestrator.getAudioAssignment.useQuery;x.pipelineOrchestrator.getAudioNodeLoad.useQuery;x.pipelineOrchestrator.getAudioAssignments.useQuery;x.pipelineOrchestrator.getAgentSettings.useQuery;x.pipelineOrchestrator.listAgentSettings.useQuery;x.pipelineOrchestrator.removeAgentSettings.useMutation;x.pipelineOrchestrator.setAgentMaxCameras.useMutation;x.pipelineOrchestrator.setAgentDetectWeight.useMutation;x.pipelineOrchestrator.setAgentCapabilities.useMutation;x.pipelineOrchestrator.setAgentReachableHost.useMutation;x.pipelineOrchestrator.setAgentInferenceDevices.useMutation;x.pipelineOrchestrator.getNodeInferenceDevices.useQuery;x.pipelineOrchestrator.resetNodePipelineDefaults.useMutation;x.pipelineOrchestrator.getCameraSettings.useQuery;x.pipelineOrchestrator.setCameraStepToggle.useMutation;x.pipelineOrchestrator.getCameraStepOverrides.useQuery;x.pipelineOrchestrator.setCameraStepOverride.useMutation;x.pipelineOrchestrator.setCameraPipelineForAgent.useMutation;x.pipelineOrchestrator.resolvePipeline.useQuery;x.pipelineOrchestrator.getCameraSwitches.useQuery;x.pipelineOrchestrator.setCameraSwitch.useMutation;x.pipelineOrchestrator.getCameraStatus.useQuery;x.pipelineOrchestrator.getCameraStatuses.useQuery;x.pipelineOrchestrator.listTemplates.useQuery;x.pipelineOrchestrator.saveTemplate.useMutation;x.pipelineOrchestrator.updateTemplate.useMutation;x.pipelineOrchestrator.deleteTemplate.useMutation;x.pipelineOrchestrator.getDeviceSettingsContribution.useQuery;x.pipelineOrchestrator.getDeviceLiveContribution.useQuery;x.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation;x.pipelineRunner.attachCamera.useMutation;x.pipelineRunner.detachCamera.useMutation;x.pipelineRunner.reportMotion.useMutation;x.pipelineRunner.getLocalLoad.useQuery;x.pipelineRunner.getLocalMetrics.useQuery;x.pipelineRunner.getCameraMetrics.useQuery;x.pipelineRunner.getAllCameraMetrics.useQuery;x.pipelineRunner.getLocalCameras.useQuery;x.pipelineRunner.getNativeCrop.useQuery;x.pipelineRunner.runDetailSubtree.useMutation;x.pipelineRunner.runStatelessStep.useMutation;x.plateGallery.listPlates.useQuery;x.plateGallery.getPlateByTrack.useQuery;x.plateGallery.getPlateMedia.useQuery;x.plateGallery.searchPlates.useQuery;x.plateGallery.suggestPlateClusters.useQuery;x.plateGallery.correctPlateText.useMutation;x.plateGallery.deletePlate.useMutation;x.plateGallery.listVehicles.useQuery;x.plateGallery.createVehicle.useMutation;x.plateGallery.renameVehicle.useMutation;x.plateGallery.deleteVehicle.useMutation;x.plateGallery.listVehicleSamples.useQuery;x.plateGallery.removeVehicleSample.useMutation;x.plateGallery.assignPlate.useMutation;x.plateGallery.unassignPlate.useMutation;x.plateGallery.assignPlates.useMutation;x.plateGallery.unassignPlates.useMutation;x.powerMeter.getStatus.useQuery;x.presence.getStatus.useQuery;x.pressureSensor.getStatus.useQuery;x.privacyMask.getOptions.useQuery;x.privacyMask.setMask.useMutation;x.privacyMask.setAudioEnabled.useMutation;x.privacyMask.getStatus.useQuery;x.ptz.move.useMutation;x.ptz.continuousMove.useMutation;x.ptz.stop.useMutation;x.ptz.getPresets.useQuery;x.ptz.goToPreset.useMutation;x.ptz.savePreset.useMutation;x.ptz.deletePreset.useMutation;x.ptz.getOptions.useQuery;x.ptz.goHome.useMutation;x.ptz.getPosition.useQuery;x.ptz.setAutofocus.useMutation;x.ptz.getStatus.useQuery;x.ptzAutotrack.getStatus.useQuery;x.ptzAutotrack.setEnabled.useMutation;x.ptzAutotrack.getSettings.useQuery;x.ptzAutotrack.setSettings.useMutation;x.reboot.reboot.useMutation;x.recording.getAvailability.useQuery;x.recording.getDaysWithRecordings.useQuery;x.recording.getPlaybackManifest.useQuery;x.recording.getStorageUsage.useQuery;x.recording.getDeviceConfig.useQuery;x.recording.locateSegment.useQuery;x.recording.readSegmentBytes.useQuery;x.recording.readGopBytes.useQuery;x.recording.setDeviceConfig.useMutation;x.recording.rescanStorage.useMutation;x.recording.pruneFootage.useMutation;x.recording.deleteFootprint.useMutation;x.recording.listOpsLog.useQuery;x.recording.renderGif.useMutation;x.recording.renderClip.useMutation;x.recording.pauseForStorageMigration.useMutation;x.recording.resumeForStorageMigration.useMutation;x.recording.refreshStorageLocationsForMigration.useMutation;x.recording.startStorageMigrationMove.useMutation;x.recording.getStorageMigrationMoveStatus.useQuery;x.recording.cancelStorageMigrationMove.useMutation;x.recording.relocateFootage.useMutation;x.recording.listRelocateJobs.useQuery;x.recording.cancelRelocateJob.useMutation;x.recording.planStorageRebalance.useQuery;x.recording.startStorageRebalance.useMutation;x.recording.getStatus.useQuery;x.recording.getDeviceSettingsContribution.useQuery;x.recording.getDeviceLiveContribution.useQuery;x.recording.applyDeviceSettingsPatch.useMutation;x.recordingExport.createExport.useMutation;x.recordingExport.listExports.useQuery;x.recordingExport.getExport.useQuery;x.recordingExport.cancelExport.useMutation;x.recordingExport.deleteExport.useMutation;x.recordingExport.getDownloadUrl.useQuery;x.recordingExport.readExportBytes.useQuery;x.sceneMonitor.listScenes.useQuery;x.sceneMonitor.createScene.useMutation;x.sceneMonitor.updateScene.useMutation;x.sceneMonitor.deleteScene.useMutation;x.sceneMonitor.captureReference.useMutation;x.sceneMonitor.deleteReference.useMutation;x.sceneMonitor.recheckNow.useMutation;x.sceneMonitor.resetScene.useMutation;x.sceneMonitor.getStatus.useQuery;x.scriptRunner.run.useMutation;x.scriptRunner.stop.useMutation;x.scriptRunner.getStatus.useQuery;x.serverManagement.getServerPackageStatus.useQuery;x.serverManagement.checkServerUpdate.useMutation;x.serverManagement.applyServerUpdate.useMutation;x.serverManagement.rollbackServerUpdate.useMutation;x.serverManagement.restartServer.useMutation;x.settingsStore.get.useQuery;x.settingsStore.set.useMutation;x.settingsStore.query.useQuery;x.settingsStore.insert.useMutation;x.settingsStore.update.useMutation;x.settingsStore.delete.useMutation;x.settingsStore.deleteWhere.useMutation;x.settingsStore.updateWhere.useMutation;x.settingsStore.count.useQuery;x.settingsStore.histogram.useQuery;x.settingsStore.isEmpty.useQuery;x.settingsStore.declareCollection.useMutation;x.smoke.getStatus.useQuery;x.snapshot.getSnapshot.useQuery;x.snapshot.invalidateCache.useMutation;x.snapshot.getSnapshotOverview.useQuery;x.snapshot.getDebugState.useQuery;x.snapshot.getSnapshotLinks.useQuery;x.snapshot.getStatus.useQuery;x.snapshot.getDeviceSettingsContribution.useQuery;x.snapshot.getDeviceLiveContribution.useQuery;x.snapshot.applyDeviceSettingsPatch.useMutation;x.storage.resolve.useQuery;x.storage.write.useMutation;x.storage.read.useQuery;x.storage.exists.useQuery;x.storage.list.useQuery;x.storage.delete.useMutation;x.storage.getAvailableSpace.useQuery;x.storage.beginUpload.useMutation;x.storage.writeChunk.useMutation;x.storage.finalizeUpload.useMutation;x.storage.abortUpload.useMutation;x.storage.beginDownload.useMutation;x.storage.readChunk.useQuery;x.storage.endDownload.useMutation;x.storage.listLocations.useQuery;x.storage.getDefaultLocation.useQuery;x.storage.listLocationDeclarations.useQuery;x.storage.upsertLocation.useMutation;x.storage.deleteLocation.useMutation;x.storage.testLocation.useQuery;x.storage.listProviders.useQuery;x.storage.testConfig.useQuery;x.storageMigration.plan.useQuery;x.storageMigration.start.useMutation;x.storageMigration.status.useQuery;x.storageMigration.cancel.useMutation;x.streamBroker.publishCameraStream.useMutation;x.streamBroker.retractCameraStream.useMutation;x.streamBroker.assignProfile.useMutation;x.streamBroker.unassignProfile.useMutation;x.streamBroker.renderPreBufferClip.useMutation;x.streamBroker.produceEventMedia.useMutation;x.streamBroker.fetchEventMedia.useMutation;x.streamBroker.listAllCameraStreams.useQuery;x.streamBroker.listAllProfileSlots.useQuery;x.streamBroker.getBrokerStats.useQuery;x.streamBroker.probeStream.useMutation;x.streamBroker.listClients.useQuery;x.streamBroker.killClient.useMutation;x.streamBroker.restartProfile.useMutation;x.streamBroker.getStreamUrl.useQuery;x.streamBroker.getStreamWithCodec.useMutation;x.streamBroker.releaseStreamWithCodec.useMutation;x.streamBroker.acquireEgressTranscode.useMutation;x.streamBroker.releaseEgressTranscode.useMutation;x.streamBroker.subscribeAudioChunks.useMutation;x.streamBroker.pullAudioChunks.useQuery;x.streamBroker.unsubscribeAudioChunks.useMutation;x.streamBroker.subscribeFrames.useMutation;x.streamBroker.pullFrameHandles.useQuery;x.streamBroker.unsubscribeFrames.useMutation;x.streamBroker.setPreBufferDuration.useMutation;x.streamBroker.getPreBufferInfo.useQuery;x.streamBroker.getRtspPort.useQuery;x.streamBroker.getAllRtspEntries.useQuery;x.streamBroker.getRtspEntry.useQuery;x.streamBroker.regenerateRtspToken.useMutation;x.streamBroker.setRtspEnabled.useMutation;x.streamBroker.isRtspEnabled.useQuery;x.streamBroker.getDeviceAudioMute.useQuery;x.streamBroker.setDeviceAudioMute.useMutation;x.streamBroker.getDeviceSettingsContribution.useQuery;x.streamBroker.getDeviceLiveContribution.useQuery;x.streamBroker.applyDeviceSettingsPatch.useMutation;x.streamCatalog.getCatalog.useQuery;x.streamParams.getOptions.useQuery;x.streamParams.setProfile.useMutation;x.streamParams.getConfigSchema.useQuery;x.streamParams.getStatus.useQuery;x.switch.setState.useMutation;x.switch.getStatus.useQuery;x.system.info.useQuery;x.system.health.useQuery;x.system.featureFlags.useQuery;x.system.networkAddresses.useQuery;x.system.getRetentionConfig.useQuery;x.system.setRetentionConfig.useMutation;x.system.forceRetentionCleanup.useMutation;x.system.getSiteLocation.useQuery;x.system.setSiteLocation.useMutation;x.system.detectSiteLocation.useMutation;x.tamper.getStatus.useQuery;x.temperatureSensor.getStatus.useQuery;x.terminalSession.listProfiles.useQuery;x.terminalSession.listInstances.useQuery;x.terminalSession.createInstance.useMutation;x.terminalSession.deleteInstance.useMutation;x.terminalSession.setInstanceEnabled.useMutation;x.terminalSession.listLegacyCameras.useQuery;x.terminalSession.adoptLegacyMonitor.useMutation;x.terminalSession.listSessions.useQuery;x.terminalSession.openSession.useMutation;x.terminalSession.resize.useMutation;x.terminalSession.pullOutput.useMutation;x.terminalSession.writeInput.useMutation;x.terminalSession.close.useMutation;x.toast.onToast.useSubscription;x.turnProvider.getTurnServers.useQuery;x.update.installUpdate.useMutation;x.update.getStatus.useQuery;x.userManagement.listUsers.useQuery;x.userManagement.createUser.useMutation;x.userManagement.updateUser.useMutation;x.userManagement.deleteUser.useMutation;x.userManagement.resetPassword.useMutation;x.userManagement.setUserScopes.useMutation;x.userManagement.validateCredentials.useMutation;x.userManagement.listApiKeys.useQuery;x.userManagement.createApiKey.useMutation;x.userManagement.revokeApiKey.useMutation;x.userManagement.validateApiKey.useMutation;x.userManagement.createScopedToken.useMutation;x.userManagement.revokeScopedToken.useMutation;x.userManagement.validateScopedToken.useQuery;x.userManagement.listScopedTokens.useQuery;x.userManagement.setupTotp.useMutation;x.userManagement.confirmTotp.useMutation;x.userManagement.disableTotp.useMutation;x.userManagement.getTotpStatus.useQuery;x.userManagement.verifyTotp.useMutation;x.userManagement.oauthIssueCode.useMutation;x.userManagement.oauthExchangeCode.useMutation;x.userManagement.oauthRefresh.useMutation;x.userManagement.oauthVerifyAccessToken.useQuery;x.userManagement.listOauthSessions.useQuery;x.userManagement.revokeOauthSession.useMutation;x.vacuumControl.start.useMutation;x.vacuumControl.pause.useMutation;x.vacuumControl.stop.useMutation;x.vacuumControl.returnToBase.useMutation;x.vacuumControl.locate.useMutation;x.vacuumControl.setFanSpeed.useMutation;x.vacuumControl.getStatus.useQuery;x.valve.open.useMutation;x.valve.close.useMutation;x.valve.stop.useMutation;x.valve.setPosition.useMutation;x.valve.getStatus.useQuery;x.vibration.getStatus.useQuery;x.videoclips.listClips.useQuery;x.videoclips.getClipPlayback.useQuery;x.waterHeater.setTargetTemp.useMutation;x.waterHeater.setOperationMode.useMutation;x.waterHeater.setAway.useMutation;x.waterHeater.getStatus.useQuery;x.weather.getStatus.useQuery;x.webrtcSession.listStreams.useQuery;x.webrtcSession.createSession.useMutation;x.webrtcSession.handleOffer.useMutation;x.webrtcSession.handleAnswer.useMutation;x.webrtcSession.addIceCandidate.useMutation;x.webrtcSession.getIceCandidates.useQuery;x.webrtcSession.closeSession.useMutation;x.webrtcSession.hasAdaptiveBitrate.useQuery;x.webrtcSession.getSessionState.useQuery;x.zoneAnalytics.getCurrentSnapshot.useQuery;x.zoneAnalytics.getZoneHistory.useQuery;x.zoneAnalytics.getCameraHistory.useQuery;x.zoneAnalytics.getUnzonedHistory.useQuery;x.zoneRules.listRules.useQuery;x.zoneRules.setRules.useMutation;x.zones.listZones.useQuery;x.zones.addZone.useMutation;x.zones.removeZone.useMutation;x.zones.updateZone.useMutation;ui("camstack:custom-field-renderers",{});ui("camstack:confirm-dialog",null);ui("camstack:device-context",null);var Cte="FEDERATION_DEBUG",dy=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),Or=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function YI(){return Or}function XI(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function Ate(){try{if(YI()&&window.localStorage)return!!localStorage.getItem(Cte)}catch{return!1}return!1}function my(){return typeof process<"u"&&yg&&yg.FEDERATION_DEBUG?!!yg.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Ate()}var Ete="[ Federation Runtime ]",JI=function(...e){return e.length?e.reduce((t,n)=>n?t?`${t}:${n}`:n:t,""):""},py=(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?!YI()&&!XI()&&"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),"")},eT=e=>{console.warn(`${Ete}: ${e}`)};function tT(e){try{return JSON.stringify(e,null,2)}catch{return""}}var xg=(e,t)=>{if(!e)return t;const a=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const m=s.slice(1);return m.endsWith("/")?m.slice(0,-1):m}return s})(e);return a?a.endsWith("/")?`${a}${t}`:`${a}/${t}`:t};function Rte(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function _te(e,t={}){const{remotes:n={},overrides:a={},version:s}=t;let m;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&s?Rte(s):e.metaData.publicPath:e.metaData.getPublicPath,p=Object.keys(a);let h={};Object.keys(n).length||(h=e.remotes?.reduce((z,q)=>{let L;const K=q.federationContainerName;return p.includes(K)?L=a[K]:"version"in q?L=q.version:L=q.entry,z[K]={matchedVersion:L},z},{})||{}),Object.keys(n).forEach(z=>h[z]={matchedVersion:p.includes(z)?a[z]:n[z]});const{remoteEntry:{path:u,name:S,type:w},types:C={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:E},globalName:R,ssrRemoteEntry:T}=e.metaData,{exposes:j}=e;let D={version:s||"",buildVersion:E,globalName:R,remoteEntry:xg(u,S),remoteEntryType:w,remoteTypes:xg(C.path,C.name),remoteTypesZip:C.zip||"",remoteTypesAPI:C.api||"",remotesInfo:h,shared:e?.shared.map(z=>({assets:z.assets,sharedName:z.name,version:z.version,usedExports:z.referenceExports||[]})),modules:j?.map(z=>({moduleName:z.name,modulePath:z.path,assets:z.assets}))};if("publicPath"in e.metaData?(m={...D,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(m.ssrPublicPath=e.metaData.ssrPublicPath)):m={...D,getPublicPath:f()},T){const z=xg(T.path,T.name);m.ssrRemoteEntry=z,m.ssrRemoteEntryType=T.type||"commonjs-module"}return m}function nT(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Ite="[ Module Federation ]",ac=console,Tte=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Nte(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
75
- `),n=t.filter(a=>!Tte.some(s=>a.includes(s)));return n.length?`Stack trace:
76
- ${n.slice(0,5).join(`
77
- `)}`:void 0}catch{return}}var aT=class{constructor(e,t=ac){this.prefix=e,this.delegate=t??ac}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??ac}emit(e,t){const n=this.delegate,a=my()?Nte():void 0,s=a?[...t,a]:t,m=(()=>{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 m){const p=n[f];if(typeof p=="function"){p.call(n,this.prefix,...s);return}}for(const f of m){const p=ac[f];if(typeof p=="function"){p.call(ac,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){my()&&this.emit("debug",e)}};function Ote(e){return new aT(e)}function jte(e){const t=new aT(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}jte(Ite);async function iT(e,t){try{return await e()}catch(n){eT(n);return}}function fy(e,t){const n=/^(https?:)?\/\//i;return e.replace(n,"").replace(/\/$/,"")===t.replace(n,"").replace(/\/$/,"")}function rT(e){let t=null,n=!0,a=2e4,s;const m=document.getElementsByTagName("script");for(let u=0;u<m.length;u++){const S=m[u],w=S.getAttribute("src");if(w&&fy(w,e.url)){t=S,n=!1;break}}if(!t){const u=e.attrs;t=document.createElement("script"),t.type=u?.type==="module"?"module":"text/javascript";let S;e.createScriptHook&&(S=e.createScriptHook(e.url,e.attrs),S instanceof HTMLScriptElement?t=S:typeof S=="object"&&("script"in S&&S.script&&(t=S.script),"timeout"in S&&S.timeout&&(a=S.timeout))),t.src||(t.src=e.url),u&&!S&&Object.keys(u).forEach(w=>{t&&(w==="async"||w==="defer"?t[w]=u[w]:t.getAttribute(w)||t.setAttribute(w,u[w]))})}let f=null;const p=typeof window<"u"?u=>{if(u.filename&&fy(u.filename,e.url)){const S=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${u.message} (${u.filename}:${u.lineno}:${u.colno})`);S.name="ScriptExecutionError",f=S}}:null;p&&window.addEventListener("error",p);const h=async(u,S)=>{clearTimeout(s),p&&window.removeEventListener("error",p);const w=()=>{if(S?.type==="error"){const C=new Error(S?.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,iT(()=>{const{needDeleteScript:C=!0}=e;C&&t?.parentNode&&t.parentNode.removeChild(t)}),u&&typeof u=="function")){const C=u(S);if(C instanceof Promise){const E=await C;return w(),E}return w(),C}w()};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 Pte(e){let t=null,n=!0,a=2e4,s;const m=document.getElementsByTagName("link");for(let p=0;p<m.length;p++){const h=m[p],u=h.getAttribute("href"),S=h.getAttribute("rel");if(u&&fy(u,e.url)&&S===e.attrs.rel){t=h,n=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let p,h=!0;const u=e.attrs;e.createLinkHook&&(p=e.createLinkHook(e.url,u),p instanceof HTMLLinkElement?(t=p,h=!1):typeof p=="object"&&("link"in p&&p.link&&(t=p.link,h=!1),"timeout"in p&&p.timeout&&(a=p.timeout))),u&&h&&Object.keys(u).forEach(S=>{t&&!t.getAttribute(S)&&t.setAttribute(S,u[S])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};const f=(p,h)=>{s&&clearTimeout(s);const u=()=>{if(h?.type==="error"){const S=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.`);S.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(S)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,iT(()=>{const{needDeleteLink:S=!0}=e;S&&t?.parentNode&&t.parentNode.removeChild(t)}),p)){const S=p(h);return u(),S}u()};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 Dte(e,t){const{attrs:n={},createScriptHook:a}=t;return new Promise((s,m)=>{const{script:f,needAttach:p}=rT({url:e,cb:s,onErrorCallback:m,attrs:{fetchpriority:"high",...n},createScriptHook:a,needDeleteScript:!0});p&&document.head.appendChild(f)})}var Td=new Map;function ws(e){if(!e)throw new Error("import specifier is required");if(Td.has(e))return Td.get(e);const t=new Function("name","return import(name)")(e).then(n=>n).catch(n=>{throw console.error(`Error importing module ${e}:`,n),Td.delete(e),n});return Td.set(e,t),t}var oT=async()=>{const e=await ws("node-fetch");return e.default||e},zte=async(e,t,n)=>{const s=await((m,f)=>n.lifecycle.fetch.emit(m,f))(e,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await oT():fetch)(e,t||{}):s},Lte=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,n,a)=>{if(a?.createScriptHook){const p=a.createScriptHook(e);p&&typeof p=="object"&&"url"in p&&(e=p.url)}let s;try{s=new URL(e)}catch(p){console.error("Error constructing URL:",p),t(new Error(`Invalid URL: ${p}`));return}const m=async()=>a?.fetch?(p,h)=>zte(p,h,a):typeof fetch>"u"?oT():fetch,f=async(p,h)=>{try{const u=await(await p(h.href)).text(),[S,w]=await Promise.all([ws("path"),ws("vm")]),C={exports:{},module:{exports:{}}},E=h.pathname.split("/").slice(0,-1).join("/"),R=S.basename(h.pathname),T=new w.Script(`(function(exports, module, require, __dirname, __filename) {${u}
78
- })`,{filename:R,importModuleDynamically:w.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??ws});let j;j=(await ws("node:module")).createRequire(h.protocol==="file:"||h.protocol==="node:"?h.href:S.join(process.cwd(),"__mf_require_base__.js")),T.runInThisContext()(C.exports,C.module,j,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(u){t(u instanceof Error?u:new Error(`Script execution error: ${u}`))}};m().then(async p=>{if(n?.type==="esm"||n?.type==="module")return hy(s.href,{fetch:p,vm:await ws("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(p,s)}).catch(p=>{t(p)})}:(e,t,n,a)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},qte=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((n,a)=>{Lte(e,(s,m)=>{if(s)a(s);else{const f=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[f]=m)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},kg=new Map;async function hy(e,t){if(kg.has(e))return kg.get(e);const{fetch:n,vm:a}=t,s=await(await n(e)).text(),m=new a.SourceTextModule(s,{importModuleDynamically:async(f,p)=>{const h=new URL(f,e).href;return hy(h,t)}});return kg.set(e,m),await m.link(async f=>{const p=new URL(f,e).href;return await hy(p,t)}),m}var Bte=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,sT=(e,t,n,a)=>{const s=[`${[t[e]]} #${e}`];return n&&s.push(`args: ${JSON.stringify(n)}`),s.push(Bte(e)),a&&s.push(`Original Error Message:
79
- ${a}`),s.join(`
80
- `)};function Ute(e,t,n,a,s,m){return a(sT(e,t,n,s))}var fo="[ Federation Runtime ]",gy=Ote(fo);function Di(e,t,n,a,s){e||Qt(t)}function Qt(e,t,n,a,s){if(t!==void 0)return Ute(e,t,n??{},f=>{throw new Error(`${fo}: ${f}`)},a);const m=e;throw m instanceof Error?(m.message.startsWith(fo)||(m.message=`${fo}: ${m.message}`),m):new Error(`${fo}: ${m}`)}function Nc(e){e instanceof Error&&(e.message.startsWith(fo)||(e.message=`${fo}: ${e.message}`)),gy.warn(e)}function Fte(e,t){return e.findIndex(n=>n===t)===-1&&e.push(t),e}function qm(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Gb(e){return typeof e.entry<"u"}function lT(e){return!e.entry.includes(".json")}function Zb(e){return e&&typeof e=="object"}var Hte=Object.prototype.toString;function $te(e){return Hte.call(e)==="[object Object]"}function cT(e){return Array.isArray(e)?e:[e]}function uT(e){const t={url:"",type:"global",globalName:""};return Or||XI()||!("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 Qte=(e,t)=>{let n;return e.endsWith("/")?n=e.slice(0,-1):n=e,t.startsWith(".")&&(t=t.slice(1)),n=n+t,n},jn=typeof globalThis=="object"?globalThis:window,Ua=(()=>{try{return document.defaultView}catch{return jn}})(),Oc=Ua;function sm(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function lm(e,t){return Object.hasOwnProperty.call(e,t)}lm(jn,"__GLOBAL_LOADING_REMOTE_ENTRY__")||sm(jn,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var Ts=jn.__GLOBAL_LOADING_REMOTE_ENTRY__;function dT(e){lm(e,"__VMOK__")&&!lm(e,"__FEDERATION__")&&sm(e,"__FEDERATION__",e.__VMOK__),lm(e,"__FEDERATION__")||(sm(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),sm(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}dT(jn);dT(Ua);function Vte(e,t=my()){t&&(jn.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,jn.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.5.1")}function Zs(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,m]=a.split(":"),f=`${s}:${t}`,p=e[f];if(p)return{value:p,key:f}}return{value:void 0,key:t}}}else Qt(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var OM=()=>Ua.__FEDERATION__.moduleInfo,Gte=(e,t)=>{const n=Zs(t,qm(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,m=qm(s),f=Zs(Ua.__FEDERATION__.moduleInfo,m).value;if(f?.version===a)return f}},cm=e=>Gte(e,Ua.__FEDERATION__.moduleInfo),jM=(e,t)=>{const n=qm(e);return Ua.__FEDERATION__.moduleInfo[n]=t,Ua.__FEDERATION__.moduleInfo},Zte=e=>(Ua.__FEDERATION__.moduleInfo={...Ua.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const n of t)delete Ua.__FEDERATION__.moduleInfo[n]}),Kb=(e,t)=>{const n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:jn[n]}},Kte=()=>Ua.__FEDERATION__.__GLOBAL_PLUGIN__,Wte=e=>jn.__FEDERATION__.__PRELOADED_MAP__.get(e),Yte=e=>jn.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),PM="[0-9A-Za-z-]+",Wb=`(?:\\+(${PM}(?:\\.${PM})*))`,gc="0|[1-9]\\d*",um="[0-9]+",mT="\\d*[a-zA-Z-][a-zA-Z0-9-]*",DM=`(?:${um}|${mT})`,Xte=`(?:-?(${DM}(?:\\.${DM})*))`,zM=`(?:${gc}|${mT})`,pT=`(?:-(${zM}(?:\\.${zM})*))`,wg=`${gc}|x|X|\\*`,Ks=`[v=\\s]*(${wg})(?:\\.(${wg})(?:\\.(${wg})(?:${pT})?${Wb}?)?)?`,Jte=`^\\s*(${Ks})\\s+-\\s+(${Ks})\\s*$`,ene=`[v=\\s]*${`(${um})\\.(${um})\\.(${um})`}${Xte}?${Wb}?`,Yb="((?:<|>)?=?)",tne=`(\\s*)${Yb}\\s*(${ene}|${Ks})`,fT="(?:~>?)",nne=`(\\s*)${fT}\\s+`,hT="(?:\\^)",ane=`(\\s*)${hT}\\s+`,ine="(<|>)?=?\\s*\\*",rne=`^${hT}${Ks}$`,one=`v?${`(${gc})\\.(${gc})\\.(${gc})`}${pT}?${Wb}?`,sne=`^${fT}${Ks}$`,lne=`^${Yb}\\s*${Ks}$`,cne=`^${Yb}\\s*(${one})$|^$`,une="^\\s*>=\\s*0.0.0\\s*$";function di(e){return new RegExp(e)}function Vn(e){return!e||e.toLowerCase()==="x"||e==="*"}function gT(...e){return t=>e.reduce((n,a)=>a(n),t)}function LM(e){return e.match(di(cne))}function qM(e,t,n,a){const s=`${e}.${t}.${n}`;return a?`${s}-${a}`:s}function dne(e){return e.replace(di(Jte),(t,n,a,s,m,f,p,h,u,S,w,C)=>(Vn(a)?n="":Vn(s)?n=`>=${a}.0.0`:Vn(m)?n=`>=${a}.${s}.0`:n=`>=${n}`,Vn(u)?h="":Vn(S)?h=`<${Number(u)+1}.0.0-0`:Vn(w)?h=`<${u}.${Number(S)+1}.0-0`:C?h=`<=${u}.${S}.${w}-${C}`:h=`<=${h}`,`${n} ${h}`.trim()))}function mne(e){return e.replace(di(tne),"$1$2$3")}function pne(e){return e.replace(di(nne),"$1~")}function fne(e){return e.replace(di(ane),"$1^")}function hne(e){return e.trim().split(/\s+/).map(t=>t.replace(di(rne),(n,a,s,m,f)=>Vn(a)?"":Vn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Vn(m)?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}.${m}-${f} <${a}.${s}.${Number(m)+1}-0`:`>=${a}.${s}.${m}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${m}-${f} <${Number(a)+1}.0.0-0`:a==="0"?s==="0"?`>=${a}.${s}.${m} <${a}.${s}.${Number(m)+1}-0`:`>=${a}.${s}.${m} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${m} <${Number(a)+1}.0.0-0`)).join(" ")}function gne(e){return e.trim().split(/\s+/).map(t=>t.replace(di(sne),(n,a,s,m,f)=>Vn(a)?"":Vn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Vn(m)?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:f?`>=${a}.${s}.${m}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${m} <${a}.${Number(s)+1}.0-0`)).join(" ")}function vne(e){return e.split(/\s+/).map(t=>t.trim().replace(di(lne),(n,a,s,m,f,p)=>{const h=Vn(s),u=h||Vn(m),S=u||Vn(f);return a==="="&&S&&(a=""),p="",h?a===">"||a==="<"?"<0.0.0-0":"*":a&&S?(u&&(m=0),f=0,a===">"?(a=">=",u?(s=Number(s)+1,m=0,f=0):(m=Number(m)+1,f=0)):a==="<="&&(a="<",u?s=Number(s)+1:m=Number(m)+1),a==="<"&&(p="-0"),`${a+s}.${m}.${f}${p}`):u?`>=${s}.0.0${p} <${Number(s)+1}.0.0-0`:S?`>=${s}.${m}.0${p} <${s}.${Number(m)+1}.0-0`:n})).join(" ")}function yne(e){return e.trim().replace(di(ine),"")}function bne(e){return e.trim().replace(di(une),"")}function dm(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Sne(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,m=n.length;s<=m;s++){const f=n[s],p=a[s];if(f!==p)return f===void 0&&p===void 0?0:f?p?dm(f,p):-1:1}return 0}function Nd(e,t){return dm(e.major,t.major)||dm(e.minor,t.minor)||dm(e.patch,t.patch)||Sne(e,t)}function Mg(e,t){return e.version===t.version}function xne(e,t){switch(e.operator){case"":case"=":return Mg(e,t);case">":return Nd(e,t)<0;case">=":return Mg(e,t)||Nd(e,t)<0;case"<":return Nd(e,t)>0;case"<=":return Mg(e,t)||Nd(e,t)>0;case void 0:return!0;default:return!1}}function kne(e){return gT(hne,gne,vne,yne)(e)}function wne(e){return gT(dne,mne,pne,fne)(e.trim()).split(/\s+/).join(" ")}function dc(e,t){if(!e)return!1;const n=LM(e);if(!n)return!1;const[,a,,s,m,f,p]=n,h={operator:a,version:qM(s,m,f,p),major:s,minor:m,patch:f,preRelease:p?.split(".")},u=t.split("||");for(const S of u){const w=S.trim();if(!w||w==="*"||w==="x")return!0;try{const C=wne(w);if(!C.trim())return!0;const E=C.split(" ").map(j=>kne(j)).join(" ");if(!E.trim())return!0;const R=E.split(/\s+/).map(j=>bne(j)).filter(Boolean);if(R.length===0)continue;let T=!0;for(const j of R){const D=LM(j);if(!D){T=!1;break}const[,z,,q,L,K,J]=D;if(!xne({operator:z,version:qM(q,L,K,J),major:q,minor:L,patch:K,preRelease:J?.split(".")},h)){T=!1;break}}if(T)return!0}catch(C){console.error(`[semver] Error processing range part "${w}":`,C);continue}}return!1}var gp="default",Mne="global";function Cne(e,t,n,a){let s;return"get"in e?s=e.get:"lib"in e?s=()=>Promise.resolve(e.lib):s=()=>Promise.resolve(()=>{Qt(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Qt(`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??dy.UNKNOWN,useIn:[]}:void 0}}function vT(e,t){const n=t.shared||{},a=t.name,s=Object.keys(n).reduce((f,p)=>{const h=cT(n[p]);return f[p]=f[p]||[],h.forEach(u=>{f[p].push(Cne(u,a,p,t.shareStrategy))}),f},{}),m={...e.shared};return Object.keys(s).forEach(f=>{m[f]?s[f].forEach(p=>{m[f].find(h=>h.version===p.version)||m[f].push(p)}):m[f]=s[f]}),{allShareInfos:m,newShareInfos:s}}function jc(e,t){if(!e)return!1;const{status:n,mode:a}=e;return n===dy.NO_USE?!1:n===dy.CALCULATED?!0:a==="runtime-infer"?t?Ene(e,t):!0:!1}function yo(e,t){const n=a=>{if(!Number.isNaN(Number(a))){const s=a.split(".");let m=a;for(let f=0;f<3-s.length;f++)m+=".0";return m}return a};return!!dc(n(e),`<=${n(t)}`)}var Pc=(e,t)=>{const n=t||function(a,s){return yo(a,s)};return Object.keys(e).reduce((a,s)=>!a||n(a,s)||a==="0"?s:a,0)},Bm=e=>!!e.loaded||typeof e.lib=="function",Ane=e=>!!e.loading,Ene=(e,t)=>{if(!e||!t)return!1;const{usedExports:n}=e;return n?!!t.every(a=>n.includes(a)):!1};function Rne(e,t,n,a){const s=e[t][n];let m="",f=jc(a);const p=function(h,u){return f?s[h].treeShaking?s[u].treeShaking?!Bm(s[h].treeShaking)&&yo(h,u):!1:!0:!Bm(s[h])&&yo(h,u)};if(f){if(m=Pc(e[t][n],p),m)return{version:m,useTreesShaking:f};f=!1}return{version:Pc(e[t][n],p),useTreesShaking:f}}var bs=e=>Bm(e)||Ane(e);function _ne(e,t,n,a){const s=e[t][n];let m="",f=jc(a);const p=function(h,u){if(f){if(!s[h].treeShaking)return!0;if(!s[u].treeShaking)return!1;if(bs(s[u].treeShaking))return bs(s[h].treeShaking)?!!yo(h,u):!0;if(bs(s[h].treeShaking))return!1}return bs(s[u])?bs(s[h])?!!yo(h,u):!0:bs(s[h])?!1:yo(h,u)};if(f){if(m=Pc(e[t][n],p),m)return{version:m,useTreesShaking:f};f=!1}return{version:Pc(e[t][n],p),useTreesShaking:f}}function Ine(e){return e==="loaded-first"?_ne:Rne}function mm(e,t,n,a){if(!e)return;const{shareConfig:s,scope:m=gp,strategy:f,treeShaking:p}=n,h=Array.isArray(m)?m:[m];for(const u of h)if(s&&e[u]&&e[u][t]){const{requiredVersion:S}=s,{version:w,useTreesShaking:C}=Ine(f)(e,u,t,p),E=()=>{const T=e[u][t][w];if(s.singleton){if(typeof S=="string"&&!dc(w,S)){const j=`Version ${w} from ${w&&T.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${S})`;s.strictVersion?Qt(j):Nc(j)}return{shared:T,useTreesShaking:C}}else{if(S===!1||S==="*")return{shared:T,useTreesShaking:C};if(dc(w,S))return{shared:T,useTreesShaking:C};const j=jc(p);if(j){for(const[D,z]of Object.entries(e[u][t]))if(jc(z.treeShaking,p?.usedExports)&&dc(D,S))return{shared:z,useTreesShaking:j}}for(const[D,z]of Object.entries(e[u][t]))if(dc(D,S))return{shared:z,useTreesShaking:!1}}},R={shareScopeMap:e,scope:u,pkgName:t,version:w,GlobalFederation:Oc.__FEDERATION__,shareInfo:n,resolver:E};return(a.emit(R)||R).resolver()}}function yT(){return Oc.__FEDERATION__.__SHARE__}function BM(e){const{pkgName:t,extraOptions:n,shareInfos:a}=e,s=h=>{if(!h)return;const u={};return h.forEach(w=>{u[w.version]=w}),u[Pc(u,function(w,C){return!Bm(u[w])&&yo(w,C)})]},m=n?.resolver??s,f=h=>h!==null&&typeof h=="object"&&!Array.isArray(h),p=(...h)=>{const u={};for(const S of h)if(S)for(const[w,C]of Object.entries(S)){const E=u[w];f(E)&&f(C)?u[w]=p(E,C):C!==void 0&&(u[w]=C)}return u};return p(m(a[t]),n?.customShareInfo)}var Ss=(e,t)=>{e.useIn||(e.useIn=[]),Fte(e.useIn,t)};function Od(e,t){return t&&e.treeShaking?e.treeShaking:e}function Xb(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function UM(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 p=n.name;return s=`.${s}`,{pkgNameOrAlias:p,expose:s,remote:n}}else if(s==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const m=n.alias&&t.startsWith(n.alias);let f=n.alias&&t.replace(n.alias,"");if(n.alias&&m){if(f&&f.startsWith("/")){const p=n.alias;return f=`.${f}`,{pkgNameOrAlias:p,expose:f,remote:n}}else if(f==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function Tne(e,t){for(const n of e)if(t===n.name||n.alias&&t===n.alias)return n}var bT="RUNTIME-001",ST="RUNTIME-002",xT="RUNTIME-003",kT="RUNTIME-004",wT="RUNTIME-005",vy="RUNTIME-006",MT="RUNTIME-007",CT="RUNTIME-008",Nne="RUNTIME-009",AT="RUNTIME-010",ET="RUNTIME-011",One="RUNTIME-012",RT="RUNTIME-013",_T="RUNTIME-014",IT="RUNTIME-015",ia={[bT]:"Failed to get remoteEntry exports.",[ST]:'The remote entry interface does not contain "init"',[xT]:"Failed to get manifest.",[kT]:"Failed to locate remote.",[wT]:"Invalid loadShareSync function call from bundler runtime",[vy]:"Invalid loadShareSync function call from runtime",[MT]:"Failed to get remote snapshot.",[CT]:"Failed to load script resources.",[Nne]:"Please call createInstance first.",[AT]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[ET]:"The remoteEntry URL is missing from the remote snapshot.",[One]:'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.',[RT]:"The manifest is not a valid Module Federation manifest.",[_T]:"The remote does not expose the requested module.",[IT]:"Remote container initialization failed."};({...ia});var TT=".then(callbacks[0]).catch(callbacks[1])";async function jne({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${TT}`)([n,a]):import(e).then(n).catch(a)}catch(s){Qt(`Failed to load ESM entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}async function Pne({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}")${TT}`)([n,a])}catch(s){Qt(`Failed to load SystemJS entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}function NT(e,t,n){const{remoteEntryKey:a,entryExports:s}=Kb(e,t);return s||Qt(bT,ia,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:a}),s}async function Dne({name:e,globalName:t,entry:n,remoteInfo:a,loaderHook:s,getEntryUrl:m,resourceContext:f}){const{entryExports:p}=Kb(e,t);if(p)return p;const h=m?m(n):n;return Dte(h,{attrs:{},createScriptHook:(u,S)=>{const w=s.lifecycle.createScript.emit({url:u,attrs:S,remoteInfo:a,resourceContext:f?{...f,url:u}:void 0});if(w&&(w instanceof HTMLScriptElement||"script"in w||"timeout"in w))return w}}).then(()=>NT(e,t,n),u=>{const S=u instanceof Error?u.message:String(u);Qt(CT,ia,{remoteName:e,resourceUrl:h},S)})}async function zne({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:a,resourceContext:s}){const{entry:m,entryGlobalName:f,name:p,type:h}=e;switch(h){case"esm":case"module":return jne({entry:m,remoteEntryExports:t});case"system":return Pne({entry:m,remoteEntryExports:t});default:return Dne({entry:m,globalName:f,name:p,remoteInfo:e,loaderHook:n,getEntryUrl:a,resourceContext:s})}}async function Lne({remoteInfo:e,loaderHook:t,resourceContext:n}){const{entry:a,entryGlobalName:s,name:m,type:f}=e,{entryExports:p}=Kb(m,s);return p||qte(a,{attrs:{name:m,globalName:s,type:f},loaderHook:{createScriptHook:(h,u={})=>{const S=t.lifecycle.createScript.emit({url:h,attrs:u,remoteInfo:e,resourceContext:n?{...n,url:h}:void 0});if(S&&"url"in S)return S}}}).then(()=>NT(m,s,a)).catch(h=>{Qt(`Failed to load Node.js entry for remote "${m}" from "${a}". ${h instanceof Error?h.message:String(h)}`)})}function yy(e){const{entry:t,name:n}=e;return JI(n,t)}async function Jb(e){const{origin:t,remoteEntryExports:n,remoteInfo:a,getEntryUrl:s,resourceContext:m,_inErrorHandling:f=!1}=e,p=yy(a);if(n)return n;if(!Ts[p]){const h=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook;Ts[p]=h.emit({origin:t,loaderHook:u,remoteInfo:a,remoteEntryExports:n}).then(S=>S||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":Or)?zne({remoteInfo:a,remoteEntryExports:n,loaderHook:u,getEntryUrl:s,resourceContext:m}):Lne({remoteInfo:a,loaderHook:u,resourceContext:m}))).then(async S=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:S}),S)).catch(async S=>{const w=yy(a),C=S instanceof Error&&S.message.includes("ScriptExecutionError");if(S instanceof Error&&S.message.includes("RUNTIME-008")&&!C&&!f){const E=T=>Jb({...T,_inErrorHandling:!0}),R=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:E,origin:t,remoteInfo:a,remoteEntryExports:n,globalLoading:Ts,uniqueKey:w});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:S}),S})}return Ts[p]}function Ns(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function qne(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Bne(e,t){const n=Kte(),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(m=>m.name!==s.name)&&e.push(s)}),e&&e.length>0&&e.forEach(s=>{a.forEach(m=>{m.applyPlugin(s,t)})}),e}function Une(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 Li(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(Une)??[],shared:t}}}function OT(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Fne(e,t){return t.map(n=>{const a=Tne(e,n.nameOrAlias);return Di(a,`Unable to preload ${n.nameOrAlias} as it is not included in ${!a&&tT({remoteInfo:a,remotes:e})}`),{remote:a,preloadConfig:OT(n)}})}function Hne(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function e0(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function bo(e,t,n,a){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:a}}async function $ne(e,t,n,a){const s=e.moduleCache.get(n.name),m=n.entry;if(s?.remoteEntryExports)return bo(a,m,"cached");try{if(!await Jb({origin:e,remoteInfo:n,remoteEntryExports:s?.remoteEntryExports,resourceContext:{...a,url:m}}))throw new Error(`Failed to load remoteEntry "${m}".`);return bo(a,m,"success")}catch(f){return bo(a,m,e0(f)?"timeout":"error",f)}}function Cg({host:e,remoteInfo:t,url:n,attrs:a,context:s,needDeleteLink:m}){return new Promise(f=>{const{link:p,needAttach:h}=Pte({url:n,cb:()=>{f(bo(s,n,h?"success":"cached"))},onErrorCallback:u=>{f(bo(s,n,e0(u)?"timeout":"error",u))},attrs:a,createLinkHook:(u,S)=>{const w=e.loaderHook.lifecycle.createLink.emit({url:u,attrs:S,remoteInfo:t,resourceContext:{...s,url:u}});return w instanceof HTMLLinkElement,w},needDeleteLink:m});h&&document.head.appendChild(p)})}function Qne({host:e,remoteInfo:t,url:n,attrs:a,context:s}){return new Promise(m=>{const{script:f,needAttach:p}=rT({url:n,cb:()=>{m(bo(s,n,p?"success":"cached"))},onErrorCallback:h=>{m(bo(s,n,e0(h)?"timeout":"error",h))},attrs:a,createScriptHook:(h,u)=>{const S=e.loaderHook.lifecycle.createScript.emit({url:h,attrs:u,remoteInfo:t,resourceContext:{...s,url:h}});return S instanceof HTMLScriptElement,S},needDeleteScript:!0});p&&document.head.appendChild(f)})}function ic(e,t){return{...e,resourceType:t}}function jT(e,t,n,a=!0,s={initiator:"preloadRemote",id:e.name}){const{cssAssets:m,jsAssetsWithoutEntry:f,entryAssets:p}=n,h=[];if(t.options.inBrowser){if(p.forEach(u=>{const{moduleInfo:S}=u;h.push($ne(t,e,S,ic(s,"remoteEntry")))}),a){const u={rel:"preload",as:"style"};m.forEach(S=>{h.push(Cg({host:t,remoteInfo:e,url:S,attrs:u,context:ic(s,"css")}))})}else{const u={rel:"stylesheet",type:"text/css"};m.forEach(S=>{h.push(Cg({host:t,remoteInfo:e,url:S,attrs:u,needDeleteLink:!1,context:ic(s,"css")}))})}if(a){const u={rel:"preload",as:"script"};f.forEach(S=>{h.push(Cg({host:t,remoteInfo:e,url:S,attrs:u,context:ic(s,"js")}))})}else{const u={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};f.forEach(S=>{h.push(Qne({host:t,remoteInfo:e,url:S,attrs:u,context:ic(s,"js")}))})}}return Promise.all(h)}function Vne(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 Gne(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 m={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?s:e.shareScope||"default"};return Object.defineProperty(m,"shareScopeMap",{value:a,enumerable:!1}),{remoteEntryInitOptions:m,shareScope:a[s[0]],initScope:n??[]}}var PT=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 Jb({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:Xb(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return Di(t,`remoteEntryExports is undefined
81
- ${tT(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(m){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:m,cached:!0,origin:this.host}),m}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:m,shareScope:f,initScope:p}=Gne(this.remoteInfo,this.host.shareScopeMap,n),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:f,remoteEntryInitOptions:m,initScope:p,remoteInfo:this.remoteInfo,origin:this.host});typeof s?.init>"u"&&Qt(ST,ia,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Li(this.host.options));try{await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions)}catch(u){Qt(IT,ia,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,Li(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(m){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:m,origin:this.host}),m}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,n,a){const{loadFactory:s=!0}=n||{loadFactory:!0},m=await this.init(e,a,void 0,t);this.lib=m,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:m,origin:this.host});let f;try{const u=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:m,expose:t,moduleInfo:this.remoteInfo});f=typeof u=="function"?u:void 0,f||(f=await m.get(t)),f||Qt(_T,ia,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Vne(a)},void 0,Li(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:m,moduleFactory:f,origin:this.host})}catch(u){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:m,error:u,origin:this.host}),u}const p=Qte(this.remoteInfo.name,t),h=this.wraperFactory(f,p);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 u=await h();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,exposeModule:u,origin:this.host}),u}catch(u){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,error:u,origin:this.host}),u}}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)}}},na=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()}},yn=class extends na{emit(...e){let t;const n=Array.from(this.listeners);if(n.length>0){let a=0;const s=m=>m===!1?!1:a<n.length?Promise.resolve(n[a++].apply(null,e)).then(f=>f===void 0||e.length===1&&f===e[0]?s(m):s(f)):m;t=s()}return Promise.resolve(t)}};function DT(e,t){if(!Zb(t))return!1;if(e!==t){for(const n in e)if(!(n in t))return!1}return!0}var Ds=class extends na{constructor(e){super(),this.onerror=Qt,this.type=e}emit(e){Zb(e)||Qt(`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(DT(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){Nc(n),this.onerror(n)}return e}},Cr=class extends na{constructor(e){super(),this.onerror=Qt,this.type=e}emit(e){Zb(e)||Qt(`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=m=>(Nc(m),this.onerror(m),e),s=m=>{if(m!==void 0&&DT(e,m))e=m;else if(m!==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)}},zs=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Di($te(e),"Plugin configuration is invalid.");const n=e.name;Di(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){Di(e,"A name is required.");const t=this.registerPlugins[e];Di(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(t[n])})}};function zT(e,t){const n=uT(t);n.url||Qt(ET,ia,{remoteName:e.name});let a=py(t,n.url);!Or&&!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 Zne(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:n,expose:a,origin:s,remoteInfo:m,id:f}=e;if(!Gb(t)||!lT(t)){const{remoteSnapshot:p,globalSnapshot:h}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Xb(t.name,a)});zT(m,p);const u={remote:t,preloadConfig:{nameOrAlias:n,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},S=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:u,remoteInfo:m,remote:t,remoteSnapshot:p,globalSnapshot:h});return S&&jT(m,s,S,!1,{initiator:"loadRemote",id:f}).catch(()=>{}),{...e,remoteSnapshot:p}}return e}}}function Kne(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 LT(e,t,n,a,s={},m){const{value:f}=Zs(e,qm(t)),p=m||f;if(p&&!nT(p)&&(n(p,t,a),p.remotesInfo)){const h=Object.keys(p.remotesInfo);for(const u of h){if(s[u])continue;s[u]=!0;const S=Kne(u),w=p.remotesInfo[u];LT(e,{name:S.name,version:w.matchedVersion},n,!1,s,void 0)}}}var Ag=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function Wne(e,t,n,a,s){const m=[],f=[],p=[],h=new Set,u=new Set,{options:S}=e,{preloadConfig:w}=t,{depsRemote:C}=w;if(LT(a,n,(R,T,j)=>{let D;if(j)D=w;else if(Array.isArray(C)){const J=C.find($=>$.nameOrAlias===T.name||$.nameOrAlias===T.alias);if(!J)return;D=OT(J)}else if(C===!0)D=w;else return;const z=py(R,uT(R).url);z&&p.push({name:T.name,moduleInfo:{name:T.name,entry:z,type:"remoteEntryType"in R?R.remoteEntryType:"global",entryGlobalName:"globalName"in R?R.globalName:T.name,shareScope:"",version:"version"in R?R.version:void 0},url:z});let q="modules"in R?R.modules:[];const L=Hne(D.exposes);L.length&&"modules"in R&&(q=R?.modules?.reduce((J,$)=>(L?.indexOf($.moduleName)!==-1&&J.push($),J),[]));function K(J){const $=J.map(F=>py(R,F));return D.filter?$.filter(D.filter):$}if(q){const J=q.length;for(let $=0;$<J;$++){const F=q[$],ue=`${T.name}/${F.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:F.moduleName==="."?T.name:ue,name:T.name,remoteSnapshot:R,preloadConfig:D,remote:T,origin:e}),!Wte(ue)&&(D.resourceCategory==="all"?(m.push(...K(F.assets.css.async)),m.push(...K(F.assets.css.sync)),f.push(...K(F.assets.js.async)),f.push(...K(F.assets.js.sync))):D.resourceCategory==="sync"&&(m.push(...K(F.assets.css.sync)),f.push(...K(F.assets.js.sync))),Yte(ue))}}},!0,{},s),s.shared&&s.shared.length>0){const R=(T,j)=>{const{shared:D}=mm(e.shareScopeMap,j.sharedName,T,e.sharedHandler.hooks.lifecycle.resolveShare)||{};D&&typeof D.lib=="function"&&(j.assets.js.sync.forEach(z=>{h.add(z)}),j.assets.css.sync.forEach(z=>{u.add(z)}))};s.shared.forEach(T=>{const j=S.shared?.[T.sharedName];if(!j)return;const D=T.version?j.find(z=>z.version===T.version):j;D&&cT(D).forEach(z=>{R(z,T)})})}const E=f.filter(R=>!h.has(R)&&!Ag("script",R));return{cssAssets:m.filter(R=>!u.has(R)&&!Ag("link",R)),jsAssetsWithoutEntry:E,entryAssets:p.filter(R=>!Ag("script",R.url))}}var Yne=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:n,remoteInfo:a,remote:s,globalSnapshot:m,remoteSnapshot:f}=e;return Or?Gb(s)&&lT(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:a.name,entry:s.entry,type:a.type||"global",entryGlobalName:"",shareScope:""}}]}:(zT(a,f),Wne(t,n,a,m,f)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function qT(e,t){const n=cm({name:t.name,version:t.options.version}),a=n&&"remotesInfo"in n&&n.remotesInfo&&Zs(n.remotesInfo,e.name).value;return a&&a.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:OM(),remoteSnapshot:cm({name:e.name,version:a.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:OM(),remoteSnapshot:cm({name:e.name,version:"version"in e?e.version:void 0})}}var Xne=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new zs({beforeLoadRemoteSnapshot:new yn("beforeLoadRemoteSnapshot"),loadSnapshot:new Cr("loadGlobalSnapshot"),loadRemoteSnapshot:new Cr("loadRemoteSnapshot"),afterLoadSnapshot:new Cr("afterLoadSnapshot")}),this.manifestLoading=Oc.__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=cm({name:this.HostInstance.options.name,version:this.HostInstance.options.version});s||(s={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Zte({[this.HostInstance.options.name]:s})),s&&"remotesInfo"in s&&!Zs(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:m,remoteSnapshot:f,globalSnapshot:p}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:a,moduleInfo:e,hostGlobalSnapshot:m,remoteSnapshot:f,globalSnapshot:p});let S,w;if(h)if(nT(h)){const C=Or?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",E=await this.loadManifestSnapshot(C,e,{},{initiator:n,id:t||e.name}),R=jM({...e,entry:C},E);S=E,w=R}else{const{remoteSnapshot:C}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});S=C,w=u}else if(Gb(e)){const C=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),E=jM(e,C);S=C,w=E}else Qt(MT,ia,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,Li(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:a,moduleInfo:e,remoteSnapshot:S}),{remoteSnapshot:S,globalSnapshot:w}}getGlobalRemoteInfo(e){return qT(e,this.HostInstance)}async getManifestJson(e,t,n,a){return(async()=>{const m=Ns(t);let f=this.manifestCache.get(e);if(f)return f;try{let h=await this.loaderHook.lifecycle.fetch.emit(e,{},m,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:m,origin:this.HostInstance}),f||(delete this.manifestLoading[e],Qt(xT,ia,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,Li(this.HostInstance.options)))}const p=[!f.metaData&&"metaData",!f.exposes&&"exposes",!f.shared&&"shared"].filter(Boolean);return p.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: ${p.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:m,origin:this.HostInstance}),p.length>0&&Qt(RT,ia,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:p.join(",")},void 0,Li(this.HostInstance.options)),this.manifestCache.set(e,f),f})()}async loadManifestSnapshot(e,t,n,a){const s=async()=>{const m=await this.getManifestJson(e,t,n,a),f=_te(m,{version:e}),{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:m,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return p};return this.manifestLoading[e]||(this.manifestLoading[e]=s().then(m=>m)),this.manifestLoading[e]}},Jne=class{constructor(e){this.hooks=new zs({beforeRegisterShare:new Ds("beforeRegisterShare"),afterResolve:new Cr("afterResolve"),beforeLoadShare:new Cr("beforeLoadShare"),loadShare:new yn,afterLoadShare:new na("afterLoadShare"),errorLoadShare:new na("errorLoadShare"),resolveShare:new Ds("resolveShare"),initContainerShareScopeMap:new Ds("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){Nc(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(m){Nc(m)}}registerShared(e,t){const{newShareInfos:n,allShareInfos:a}=vT(e,t);return Object.keys(n).forEach(s=>{n[s].forEach(m=>{m.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:s,shared:m}),this.shareScopeMap[f]?.[s]||this.setShared({pkgName:s,lib:m.lib,get:m.get,loaded:m.loaded||!!m.lib,shared:m,from:t.name})})})}),{newShareInfos:n,allShareInfos:a}}async loadShare(e,t){const{host:n}=this,a=BM({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,Di(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 m=s,{shared:f,useTreesShaking:p}=mm(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(f){const h=Od(f,p);if(h.lib)return Ss(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:m,selectedShared:f}),h.lib;if(h.loading&&!h.loaded){const u=await h.loading;return h.loaded=!0,h.lib||(h.lib=u),Ss(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:m,selectedShared:f}),u}else{const S=(async()=>{const C=await h.get();return Ss(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:S,treeShaking:p?h:void 0});const w=await S;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:m,selectedShared:f}),w}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:m,recovered:!0}),!1;const h=jc(m.treeShaking),u=Od(m,h),w=(async()=>{const E=await u.get();u.lib=E,u.loaded=!0,Ss(u,n.options.name);const{shared:R,useTreesShaking:T}=mm(this.shareScopeMap,e,m,this.hooks.lifecycle.resolveShare)||{};if(R){const j=Od(R,T);j.lib=E,j.loaded=!0,R.from=m.from}return E})();this.setShared({pkgName:e,loaded:!1,shared:m,from:n.options.name,lib:null,loading:w,treeShaking:h?u:void 0});const C=await w;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:m,selectedShared:m}),C}}catch(m){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:m}),m}}initializeSharing(e=gp,t){const{host:n}=this,a=t?.from,s=t?.strategy;let m=t?.initScope;const f=[];if(a!=="build"){const{initTokens:C}=this;m||(m=[]);let E=C[e];if(E||(E=C[e]={from:this.host.name}),m.indexOf(E)>=0)return f;m.push(E)}const p=this.shareScopeMap,h=n.options.name;p[e]||(p[e]={});const u=p[e],S=(C,E)=>{const{version:R,eager:T}=E;u[C]=u[C]||{};const j=u[C],D=j[R]&&Od(j[R]),z=!!(D&&("eager"in D&&D.eager||"shareConfig"in D&&D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!T!=!z?T:h>j[R].from))&&(j[R]=E)},w=async C=>{const{module:E}=await n.remoteHandler.getRemoteModuleAndOptions({id:C});let R;try{R=await E.getEntry()}catch(T){if(R=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:C,error:T,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,m))}};return Object.keys(n.options.shared).forEach(C=>{n.options.shared[C].forEach(E=>{E.scope.includes(e)&&S(C,E)})}),(n.options.shareStrategy==="version-first"||s==="version-first")&&n.options.remotes.forEach(C=>{C.shareScope===e&&f.push(w(C.name))}),f}loadShareSync(e,t){const{host:n}=this,a=BM({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{a?.scope&&a.scope.forEach(m=>{this.initializeSharing(m,{strategy:a.strategy})});const{shared:s}=mm(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){if(typeof s.lib=="function")return Ss(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 m=s.get();if(!(m instanceof Promise))return Ss(s,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:m,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),m}}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 m=a.get();return m instanceof Promise&&Qt(t?.from==="build"?wT:vy,ia,{hostName:n.options.name,sharedPkgName:e},void 0,Li(n.options)),a.lib=m,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}Qt(vy,ia,{hostName:n.options.name,sharedPkgName:e},void 0,Li(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:m,get:f,treeShaking:p}){const{version:h,scope:u="default",...S}=t,w=Array.isArray(u)?u:[u],C=E=>{const R=(j,D,z)=>{z&&!j[D]&&(j[D]=z)},T=p?E.treeShaking:E;R(T,"loaded",m),R(T,"loading",s),R(T,"get",f)};w.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],...S,lib:a});const R=this.shareScopeMap[E][e][h];C(R),n&&R.from!==n&&(R.from=n)})}_setGlobalShareScopeMap(e){const t=yT(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},eae=class{constructor(e){this.hooks=new zs({beforeRegisterRemote:new Ds("beforeRegisterRemote"),registerRemote:new Ds("registerRemote"),beforeRequest:new Cr("beforeRequest"),afterMatchRemote:new yn("afterMatchRemote"),onLoad:new yn("onLoad"),afterLoadRemote:new yn("afterLoadRemote"),handlePreloadModule:new na("handlePreloadModule"),errorLoadRemote:new yn("errorLoadRemote"),beforePreloadRemote:new yn("beforePreloadRemote"),generatePreloadAssets:new yn("generatePreloadAssets"),afterPreloadRemote:new yn("afterPreloadRemote"),loadEntry:new yn}),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:m}=n;if(this.idToRemoteMap[e]={name:n.name,expose:a},m&&e.startsWith(s)){const f=e.replace(s,m);this.idToRemoteMap[f]={name:n.name,expose:a};return}if(m&&e.startsWith(m)){const f=e.replace(m,s);this.idToRemoteMap[f]={name:n.name,expose:a}}}async loadRemote(e,t){const{host:n}=this,a=UM(n.options.remotes,e);let s=e,m=a?.expose,f=a?Ns(a.remote):void 0,p;try{const{loadFactory:h=!0}=t||{loadFactory:!0},{module:u,moduleOptions:S,remoteMatchInfo:w}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:C,remote:E,expose:R,id:T,remoteSnapshot:j}=w;s=T,m=R,f=Ns(E);const D=await u.get(T,R,t,j),z=await this.hooks.lifecycle.onLoad.emit({id:T,pkgNameOrAlias:C,expose:R,exposeModule:h?D:void 0,exposeModuleFactory:h?void 0:D,remote:E,options:S,moduleInstance:u,origin:n});return this.setIdToRemoteMap(e,w),p={id:s,expose:m,remote:f,options:t,origin:n},typeof z=="function"?z:D}catch(h){const{from:u="runtime"}=t||{from:"runtime"};let S;try{S=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:u,lifecycle:"onLoad",expose:m,remote:f,origin:n})}catch(w){throw p={id:s,expose:m,remote:f,options:t,error:w,origin:n},w}if(!S)throw p={id:s,expose:m,remote:f,options:t,error:h,origin:n},h;return p={id:s,expose:m,remote:f,options:t,error:h,origin:n,recovered:!0},S}finally{p&&await this.hooks.lifecycle.afterLoadRemote.emit(p)}}async preloadRemote(e){const{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const a=Fne(t.options.remotes,e),s=p=>{const{preloadConfig:h,remote:u}=p,S=h.exposes||[];return S.length?S.map(w=>({ops:{...p,preloadConfig:{...h,exposes:[w]}},id:Xb(u.name,w)})):[{ops:p,id:`${u.name}/*`}]};let m;await Promise.all(a.flatMap(s).map(async p=>{const{ops:h,id:u}=p,{remote:S,preloadConfig:w}=h,C=Ns(S);try{const{globalSnapshot:E,remoteSnapshot:R}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:S,id:u,initiator:"preloadRemote"}),T=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:h,remote:S,remoteInfo:C,globalSnapshot:E,remoteSnapshot:R});if(!T)return;const j=await jT(C,t,T,!0,{initiator:"preloadRemote",id:u});n.push({remote:S,remoteInfo:C,preloadConfig:w,id:u,results:j})}catch(E){n.push({remote:S,remoteInfo:C,preloadConfig:w,id:u,results:[{url:C.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(C.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:u,error:E}]})}}));const f=n.flatMap(p=>p.results.filter(h=>h.status==="error"||h.status==="timeout"));if(f.length>0&&(m=new Error(`preloadRemote failed to load ${f.length} resource(s).`),Object.assign(m,{results:n,failedResults:f})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:m}),m)throw m}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,m=UM(t.options.remotes,s);if(!m)try{Qt(kT,ia,{hostName:t.options.name,requestId:s},void 0,Li(t.options))}catch(E){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:s,options:t.options,error:E,origin:t}),E}const{remote:f}=m,p=Ns(f);await this.hooks.lifecycle.afterMatchRemote.emit({id:s,...m,options:t.options,remoteInfo:p,origin:t});const h=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:s,...m,options:t.options,origin:t,remoteInfo:p}),{remote:u,expose:S}=h;Di(u&&S,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${s}.`);let w=t.moduleCache.get(u.name);const C={host:t,remoteInfo:p};return w||(w=new PT(C),t.moduleCache.set(u.name,w)),{module:w,moduleOptions:C,remoteMatchInfo:h}}registerRemote(e,t,n){const{host:a}=this,s=()=>{if(e.alias){const f=t.find(p=>e.alias&&(p.name.startsWith(e.alias)||p.alias?.startsWith(e.alias)));Di(!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&&Or&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=gp),e.type||(e.type=Mne)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:a});const m=t.find(f=>f.name===e.name);if(!m)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(m),s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a}),eT(f.join(" ")))}}removeRemote(e){try{const{host:t}=this,{name:n}=e,a=t.options.remotes.findIndex(m=>m.name===n);a!==-1&&t.options.remotes.splice(a,1);const s=t.moduleCache.get(e.name);if(s){const m=s.remoteInfo,f=m.entryGlobalName;jn[f]&&(Object.getOwnPropertyDescriptor(jn,f)?.configurable?delete jn[f]:jn[f]=void 0);const p=yy(s.remoteInfo);Ts[p]&&delete Ts[p],t.snapshotHandler.manifestCache.delete(m.entry);let h=m.buildVersion?JI(m.name,m.buildVersion):m.name;const u=jn.__FEDERATION__.__INSTANCES__.findIndex(w=>m.buildVersion?w.options.id===h:w.name===h);if(u!==-1){const w=jn.__FEDERATION__.__INSTANCES__[u];h=w.options.id||h;const C=yT();let E=!0;const R=[];Object.keys(C).forEach(T=>{const j=C[T];j&&Object.keys(j).forEach(D=>{const z=j[D];z&&Object.keys(z).forEach(q=>{const L=z[q];L&&Object.keys(L).forEach(K=>{const J=L[K];J&&typeof J=="object"&&J.from===m.name&&(J.loaded||J.loading?(J.useIn=J.useIn.filter($=>$!==m.name),J.useIn.length?E=!1:R.push([T,D,q,K])):R.push([T,D,q,K]))})})})}),E&&(w.shareScopeMap={},delete C[h]),R.forEach(([T,j,D,z])=>{delete C[T]?.[j]?.[D]?.[z]}),jn.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:S}=qT(e,t);if(S){const w=S&&"remotesInfo"in S&&S.remotesInfo&&Zs(S.remotesInfo,e.name).key;w&&(delete S.remotesInfo[w],Oc.__FEDERATION__.__MANIFEST_LOADING__[w]&&delete Oc.__FEDERATION__.__MANIFEST_LOADING__[w])}t.moduleCache.delete(e.name)}}catch(t){gy.error(`removeRemote failed: ${t instanceof Error?t.message:String(t)}`)}}},tae=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,nae=class{constructor(e){this.hooks=new zs({beforeInit:new Ds("beforeInit"),init:new na,beforeInitContainer:new Cr("beforeInitContainer"),initContainer:new Cr("initContainer")}),this.version="2.5.1",this.moduleCache=new Map,this.loaderHook=new zs({getModuleInfo:new na,createScript:new na,createLink:new na,fetch:new yn,loadEntryError:new yn,afterLoadEntry:new yn("afterLoadEntry"),beforeInitRemote:new yn("beforeInitRemote"),afterInitRemote:new yn("afterInitRemote"),beforeGetExpose:new yn("beforeGetExpose"),afterGetExpose:new yn("afterGetExpose"),beforeExecuteFactory:new yn("beforeExecuteFactory"),afterExecuteFactory:new yn("afterExecuteFactory"),getModuleFactory:new yn}),this.bridgeHook=new zs({beforeBridgeRender:new na,afterBridgeRender:new na,beforeBridgeDestroy:new na,afterBridgeDestroy:new na});const t=tae?[Zne(),Yne()]:[],n={id:qne(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:Or};this.name=e.name,this.options=n,this.snapshotHandler=new Xne(this),this.sharedHandler=new Jne(this),this.remoteHandler=new eae(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&&Qt(sT(AT,ia)),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=gp,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){const a=Ns({name:e,entry:t}),s=new PT({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}=vT(e,t),{userOptions:a,options:s}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),m=this.remoteHandler.formatAndRegisterRemote(s,a),{allShareInfos:f}=this.sharedHandler.registerShared(s,a),p=[...s.plugins];a.plugins&&a.plugins.forEach(u=>{p.includes(u)||p.push(u)});const h={...e,...t,plugins:p,remotes:m,shared:f,id:a.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:h}),h}registerPlugins(e){const t=Bne(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})}};Vte(nae);ui("camstack:widget-registry",null);function vfe({title:e,icon:t,headerRight:n,collapsible:a=!1,defaultOpen:s=!0,bodyClassName:m="p-3",children:f}){const[p,h]=I.useState(s),u=!a||p,S=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?p?v.jsx(Eo,{className:"h-3.5 w-3.5 text-foreground-subtle"}):v.jsx(vee,{className:"h-3.5 w-3.5 text-foreground-subtle"}):n]}),w=`px-4 py-2 flex items-center justify-between ${u?"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 ${w}`,children:S}):v.jsx("div",{className:w,children:S}),u?v.jsx("div",{className:m,children:f}):null]})}var aae="capability.binding-changed";function eu(e,t){const[n,a]=I.useState(null);return I.useEffect(()=>{if(t===null){a(null);return}let s=!1;const m=async()=>{try{const p=await e.deviceManager.getBindings.query({deviceId:t});s||a(p)}catch{s||a(p=>p)}};m();const f=e.live?.onEvent.subscribe({category:aae},{onData:p=>{const h=p.data?.source;if(!h){m();return}h.type==="device"&&h.id===t&&m()}});return()=>{s=!0,f?.unsubscribe()}},[e,t]),I.useMemo(()=>n?IE(e,n):null,[e,n])}function So(e){const t=I.useCallback(a=>e?e.subscribe(()=>a()):()=>{},[e]),n=I.useCallback(()=>e?.value,[e]);return I.useSyncExternalStore(t,n,n)}function ut(e){const t=eu(e.trpc,e.deviceId),n=So(t!==null?e.slice(t):void 0),a=t!==null?e.cap(t):void 0,s=So(t!==null?t.state.deviceStatus:void 0),m=s?.online??!0,f=m?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&&m,online:m,offlineSince:f}}function iae(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 yfe(e){const t=iae(e);return t!==null?t==="no-provider"||t==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}function BT(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=BT(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function UT(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=BT(e))&&(a&&(a+=" "),a+=t);return a}var rae=(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},oae=(e,t)=>({classGroupId:e,validator:t}),FT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Um="-",FM=[],sae="arbitrary..",lae=e=>{const t=uae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return cae(f);const p=f.split(Um);return HT(p,p[0]===""&&p.length>1?1:0,t)},getConflictingClassGroupIds:(f,p)=>{if(p){const h=a[f],u=n[f];return h?u?rae(u,h):h:u||FM}return n[f]||FM}}},HT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=HT(e,t+1,s);if(h)return h}const m=n.validators;if(m===null)return;const f=t===0?e.join(Um):e.slice(t).join(Um),p=m.length;for(let h=0;h<p;h++){const u=m[h];if(u.validator(f))return u.classGroupId}},cae=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?sae+a:void 0})(),uae=e=>{const{theme:t,classGroups:n}=e;return dae(n,t)},dae=(e,t)=>{const n=FT();for(const a in e){const s=e[a];t0(s,n,a,t)}return n},t0=(e,t,n,a)=>{const s=e.length;for(let m=0;m<s;m++){const f=e[m];mae(f,t,n,a)}},mae=(e,t,n,a)=>{if(typeof e=="string"){pae(e,t,n);return}if(typeof e=="function"){fae(e,t,n,a);return}hae(e,t,n,a)},pae=(e,t,n)=>{const a=e===""?t:$T(t,e);a.classGroupId=n},fae=(e,t,n,a)=>{if(gae(e)){t0(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(oae(n,e))},hae=(e,t,n,a)=>{const s=Object.entries(e),m=s.length;for(let f=0;f<m;f++){const[p,h]=s[f];t0(h,$T(t,p),n,a)}},$T=(e,t)=>{let n=e;const a=t.split(Um),s=a.length;for(let m=0;m<s;m++){const f=a[m];let p=n.nextPart.get(f);p||(p=FT(),n.nextPart.set(f,p)),n=p}return n},gae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,vae=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(m,f)=>{n[m]=f,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(m){let f=n[m];if(f!==void 0)return f;if((f=a[m])!==void 0)return s(m,f),f},set(m,f){m in n?n[m]=f:s(m,f)}}},by="!",HM=":",yae=[],$M=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),bae=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const m=[];let f=0,p=0,h=0,u;const S=s.length;for(let T=0;T<S;T++){const j=s[T];if(f===0&&p===0){if(j===HM){m.push(s.slice(h,T)),h=T+1;continue}if(j==="/"){u=T;continue}}j==="["?f++:j==="]"?f--:j==="("?p++:j===")"&&p--}const w=m.length===0?s:s.slice(h);let C=w,E=!1;w.endsWith(by)?(C=w.slice(0,-1),E=!0):w.startsWith(by)&&(C=w.slice(1),E=!0);const R=u&&u>h?u-h:void 0;return $M(m,E,C,R)};if(t){const s=t+HM,m=a;a=f=>f.startsWith(s)?m(f.slice(s.length)):$M(yae,!1,f,void 0,!0)}if(n){const s=a;a=m=>n({className:m,parseClassName:s})}return a},Sae=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let m=0;m<n.length;m++){const f=n[m],p=f[0]==="[",h=t.has(f);p||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}},xae=e=>({cache:vae(e.cacheSize),parseClassName:bae(e),sortModifiers:Sae(e),postfixLookupClassGroupIds:kae(e),...lae(e)}),kae=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},wae=/\s+/,Mae=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:m,postfixLookupClassGroupIds:f}=t,p=[],h=e.trim().split(wae);let u="";for(let S=h.length-1;S>=0;S-=1){const w=h[S],{isExternal:C,modifiers:E,hasImportantModifier:R,baseClassName:T,maybePostfixModifierPosition:j}=n(w);if(C){u=w+(u.length>0?" "+u:u);continue}let D=!!j,z;if(D){z=a(T.substring(0,j));const $=z&&f[z]?a(T):void 0;$&&$!==z&&(z=$,D=!1)}else z=a(T);if(!z){if(!D){u=w+(u.length>0?" "+u:u);continue}if(z=a(T),!z){u=w+(u.length>0?" "+u:u);continue}D=!1}const q=E.length===0?"":E.length===1?E[0]:m(E).join(":"),L=R?q+by:q,K=L+z;if(p.indexOf(K)>-1)continue;p.push(K);const J=s(z,D);for(let $=0;$<J.length;++$){const F=J[$];p.push(L+F)}u=w+(u.length>0?" "+u:u)}return u},Cae=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=QT(n))&&(s&&(s+=" "),s+=a);return s},QT=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=QT(e[a]))&&(n&&(n+=" "),n+=t);return n},Aae=(e,...t)=>{let n,a,s,m;const f=h=>(n=xae(t.reduce((u,S)=>S(u),e())),a=n.cache.get,s=n.cache.set,m=p,p(h)),p=h=>{const u=a(h);if(u)return u;const S=Mae(h,n);return s(h,S),S};return m=f,(...h)=>m(Cae(...h))},Eae=[],wn=e=>{const t=n=>n[e]||Eae;return t.isThemeGetter=!0,t},VT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_ae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Iae=/\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$/,Tae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Nae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gr=e=>Rae.test(e),ot=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>!!e&&Number.isInteger(Number(e)),Eg=e=>e.endsWith("%")&&ot(e.slice(0,-1)),Ti=e=>_ae.test(e),ZT=()=>!0,jae=e=>Iae.test(e)&&!Tae.test(e),n0=()=>!1,Pae=e=>Nae.test(e),Dae=e=>Oae.test(e),zae=e=>!je(e)&&!Pe(e),Lae=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)),qae=e=>jr(e,YT,n0),je=e=>VT.test(e),ro=e=>jr(e,XT,jae),QM=e=>jr(e,Gae,ot),Bae=e=>jr(e,e4,ZT),Uae=e=>jr(e,JT,n0),VM=e=>jr(e,KT,n0),Fae=e=>jr(e,WT,Dae),jd=e=>jr(e,t4,Pae),Pe=e=>GT.test(e),rc=e=>_o(e,XT),Hae=e=>_o(e,JT),GM=e=>_o(e,KT),$ae=e=>_o(e,YT),Qae=e=>_o(e,WT),Pd=e=>_o(e,t4,!0),Vae=e=>_o(e,e4,!0),jr=(e,t,n)=>{const a=VT.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},_o=(e,t,n=!1)=>{const a=GT.exec(e);return a?a[1]?t(a[1]):n:!1},KT=e=>e==="position"||e==="percentage",WT=e=>e==="image"||e==="url",YT=e=>e==="length"||e==="size"||e==="bg-size",XT=e=>e==="length",Gae=e=>e==="number",JT=e=>e==="family-name",e4=e=>e==="number"||e==="weight",t4=e=>e==="shadow",Zae=()=>{const e=wn("color"),t=wn("font"),n=wn("text"),a=wn("font-weight"),s=wn("tracking"),m=wn("leading"),f=wn("breakpoint"),p=wn("container"),h=wn("spacing"),u=wn("radius"),S=wn("shadow"),w=wn("inset-shadow"),C=wn("text-shadow"),E=wn("drop-shadow"),R=wn("blur"),T=wn("perspective"),j=wn("aspect"),D=wn("ease"),z=wn("animate"),q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...L(),Pe,je],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],F=()=>[Pe,je,h],ue=()=>[gr,"full","auto",...F()],we=()=>[ni,"none","subgrid",Pe,je],Ee=()=>["auto",{span:["full",ni,Pe,je]},ni,Pe,je],Me=()=>[ni,"auto",Pe,je],ce=()=>["auto","min","max","fr",Pe,je],Se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Re=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...F()],me=()=>[gr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],xe=()=>[gr,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Ce=()=>[gr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],re=()=>[e,Pe,je],B=()=>[...L(),GM,VM,{position:[Pe,je]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",$ae,qae,{size:[Pe,je]}],ge=()=>[Eg,rc,ro],H=()=>["","none","full",u,Pe,je],ee=()=>["",ot,rc,ro],Te=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ie=()=>[ot,Eg,GM,VM],vt=()=>["","none",R,Pe,je],He=()=>["none",ot,Pe,je],Ae=()=>["none",ot,Pe,je],$e=()=>[ot,Pe,je],Oe=()=>[gr,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ti],breakpoint:[Ti],color:[ZT],container:[Ti],"drop-shadow":[Ti],ease:["in","out","in-out"],font:[zae],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ti],shadow:[Ti],spacing:["px",ot],text:[Ti],"text-shadow":[Ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gr,je,Pe,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Pe,je]}],"container-named":[Lae],columns:[{columns:[ot,je,Pe,p]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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:K()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ue()}],"inset-x":[{"inset-x":ue()}],"inset-y":[{"inset-y":ue()}],start:[{"inset-s":ue(),start:ue()}],end:[{"inset-e":ue(),end:ue()}],"inset-bs":[{"inset-bs":ue()}],"inset-be":[{"inset-be":ue()}],top:[{top:ue()}],right:[{right:ue()}],bottom:[{bottom:ue()}],left:[{left:ue()}],visibility:["visible","invisible","collapse"],z:[{z:[ni,"auto",Pe,je]}],basis:[{basis:[gr,"full","auto",p,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ot,gr,"auto","initial","none",je]}],grow:[{grow:["",ot,Pe,je]}],shrink:[{shrink:["",ot,Pe,je]}],order:[{order:[ni,"first","last","none",Pe,je]}],"grid-cols":[{"grid-cols":we()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Me()}],"col-end":[{"col-end":Me()}],"grid-rows":[{"grid-rows":we()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Me()}],"row-end":[{"row-end":Me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...Se(),"normal"]}],"justify-items":[{"justify-items":[...Re(),"normal"]}],"justify-self":[{"justify-self":["auto",...Re()]}],"align-content":[{content:["normal",...Se()]}],"align-items":[{items:[...Re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Re(),{baseline:["","last"]}]}],"place-content":[{"place-content":Se()}],"place-items":[{"place-items":[...Re(),"baseline"]}],"place-self":[{"place-self":["auto",...Re()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:me()}],"inline-size":[{inline:["auto",...xe()]}],"min-inline-size":[{"min-inline":["auto",...xe()]}],"max-inline-size":[{"max-inline":["none",...xe()]}],"block-size":[{block:["auto",...Ce()]}],"min-block-size":[{"min-block":["auto",...Ce()]}],"max-block-size":[{"max-block":["none",...Ce()]}],w:[{w:[p,"screen",...me()]}],"min-w":[{"min-w":[p,"screen","none",...me()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...me()]}],h:[{h:["screen","lh",...me()]}],"min-h":[{"min-h":["screen","lh","none",...me()]}],"max-h":[{"max-h":["screen","lh",...me()]}],"font-size":[{text:["base",n,rc,ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Vae,Bae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Eg,je]}],"font-family":[{font:[Hae,Uae,t]}],"font-features":[{"font-features":[je]}],"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,je]}],"line-clamp":[{"line-clamp":[ot,"none",Pe,QM]}],leading:[{leading:[m,...F()]}],"list-image":[{"list-image":["none",Pe,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Te(),"wavy"]}],"text-decoration-thickness":[{decoration:[ot,"from-font","auto",Pe,ro]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[ot,"auto",Pe,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"tab-size":[{tab:[ni,Pe,je]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,je]}],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,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ni,Pe,je],radial:["",Pe,je],conic:[ni,Pe,je]},Qae,Fae]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Te(),"hidden","none"]}],"divide-style":[{divide:[...Te(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-bs":[{"border-bs":re()}],"border-color-be":[{"border-be":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...Te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ot,Pe,je]}],"outline-w":[{outline:["",ot,rc,ro]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",S,Pd,jd]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",w,Pd,jd]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[ot,ro]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",C,Pd,jd]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[ot,Pe,je]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"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":[ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ie()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":Ie()}],"mask-image-t-to-pos":[{"mask-t-to":Ie()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":Ie()}],"mask-image-r-to-pos":[{"mask-r-to":Ie()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":Ie()}],"mask-image-b-to-pos":[{"mask-b-to":Ie()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":Ie()}],"mask-image-l-to-pos":[{"mask-l-to":Ie()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":Ie()}],"mask-image-x-to-pos":[{"mask-x-to":Ie()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":Ie()}],"mask-image-y-to-pos":[{"mask-y-to":Ie()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[Pe,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ie()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ie()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,je]}],filter:[{filter:["","none",Pe,je]}],blur:[{blur:vt()}],brightness:[{brightness:[ot,Pe,je]}],contrast:[{contrast:[ot,Pe,je]}],"drop-shadow":[{"drop-shadow":["","none",E,Pd,jd]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",ot,Pe,je]}],"hue-rotate":[{"hue-rotate":[ot,Pe,je]}],invert:[{invert:["",ot,Pe,je]}],saturate:[{saturate:[ot,Pe,je]}],sepia:[{sepia:["",ot,Pe,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,je]}],"backdrop-blur":[{"backdrop-blur":vt()}],"backdrop-brightness":[{"backdrop-brightness":[ot,Pe,je]}],"backdrop-contrast":[{"backdrop-contrast":[ot,Pe,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ot,Pe,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ot,Pe,je]}],"backdrop-invert":[{"backdrop-invert":["",ot,Pe,je]}],"backdrop-opacity":[{"backdrop-opacity":[ot,Pe,je]}],"backdrop-saturate":[{"backdrop-saturate":[ot,Pe,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ot,Pe,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ot,"initial",Pe,je]}],ease:[{ease:["linear","initial",D,Pe,je]}],delay:[{delay:[ot,Pe,je]}],animate:[{animate:["none",z,Pe,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Pe,je]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[Pe,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],zoom:[{zoom:[ni,Pe,je]}],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"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,je]}],"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":re()}],"scrollbar-track-color":[{"scrollbar-track":re()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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,je]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[ot,rc,ro,QM]}],stroke:[{stroke:["none",...re()]}],"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"]}},Kae=Aae(Zae);function se(...e){return Kae(UT(e))}ui("camstack:vod-playback",{request:null,play:()=>{},clear:()=>{}});ui("camstack:recorded-playback",{bindControlChannel:null,channelOpen:!1,mode:"live",positionMs:null,send:()=>!1});I.lazy(()=>qs(()=>import("./MotionZonesSettings-DNdnFHso-B_fslMFv.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings}))),I.lazy(()=>qs(()=>import("./PrivacyMaskSettings-DNSLc6ww-CD2tFrNb.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));var Wae=Object.defineProperty,Fm=Object.getOwnPropertySymbols,n4=Object.prototype.hasOwnProperty,a4=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Wae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sy=(e,t)=>{for(var n in t||(t={}))n4.call(t,n)&&ZM(e,n,t[n]);if(Fm)for(var n of Fm(t))a4.call(t,n)&&ZM(e,n,t[n]);return e},xy=(e,t)=>{var n={};for(var a in e)n4.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Fm)for(var a of Fm(e))t.indexOf(a)<0&&a4.call(e,a)&&(n[a]=e[a]);return n};var ko;(e=>{const t=class ct{constructor(h,u,S,w){if(this.version=h,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],h<ct.MIN_VERSION||h>ct.MAX_VERSION)throw new RangeError("Version value out of range");if(w<-1||w>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(S);if(this.drawCodewords(E),w==-1){let R=1e9;for(let T=0;T<8;T++){this.applyMask(T),this.drawFormatBits(T);const j=this.getPenaltyScore();j<R&&(w=T,R=j),this.applyMask(T)}}s(0<=w&&w<=7),this.mask=w,this.applyMask(w),this.drawFormatBits(w),this.isFunction=[]}static encodeText(h,u){const S=e.QrSegment.makeSegments(h);return ct.encodeSegments(S,u)}static encodeBinary(h,u){const S=e.QrSegment.makeBytes(h);return ct.encodeSegments([S],u)}static encodeSegments(h,u,S=1,w=40,C=-1,E=!0){if(!(ct.MIN_VERSION<=S&&S<=w&&w<=ct.MAX_VERSION)||C<-1||C>7)throw new RangeError("Invalid value");let R,T;for(R=S;;R++){const q=ct.getNumDataCodewords(R,u)*8,L=f.getTotalBits(h,R);if(L<=q){T=L;break}if(R>=w)throw new RangeError("Data too long")}for(const q of[ct.Ecc.MEDIUM,ct.Ecc.QUARTILE,ct.Ecc.HIGH])E&&T<=ct.getNumDataCodewords(R,q)*8&&(u=q);let j=[];for(const q of h){n(q.mode.modeBits,4,j),n(q.numChars,q.mode.numCharCountBits(R),j);for(const L of q.getData())j.push(L)}s(j.length==T);const D=ct.getNumDataCodewords(R,u)*8;s(j.length<=D),n(0,Math.min(4,D-j.length),j),n(0,(8-j.length%8)%8,j),s(j.length%8==0);for(let q=236;j.length<D;q^=253)n(q,8,j);let z=[];for(;z.length*8<j.length;)z.push(0);return j.forEach((q,L)=>z[L>>>3]|=q<<7-(L&7)),new ct(R,u,z,C)}getModule(h,u){return 0<=h&&h<this.size&&0<=u&&u<this.size&&this.modules[u][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let S=0;S<this.size;S++)this.setFunctionModule(6,S,S%2==0),this.setFunctionModule(S,6,S%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),u=h.length;for(let S=0;S<u;S++)for(let w=0;w<u;w++)S==0&&w==0||S==0&&w==u-1||S==u-1&&w==0||this.drawAlignmentPattern(h[S],h[w]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const u=this.errorCorrectionLevel.formatBits<<3|h;let S=u;for(let C=0;C<10;C++)S=S<<1^(S>>>9)*1335;const w=(u<<10|S)^21522;s(w>>>15==0);for(let C=0;C<=5;C++)this.setFunctionModule(8,C,a(w,C));this.setFunctionModule(8,7,a(w,6)),this.setFunctionModule(8,8,a(w,7)),this.setFunctionModule(7,8,a(w,8));for(let C=9;C<15;C++)this.setFunctionModule(14-C,8,a(w,C));for(let C=0;C<8;C++)this.setFunctionModule(this.size-1-C,8,a(w,C));for(let C=8;C<15;C++)this.setFunctionModule(8,this.size-15+C,a(w,C));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let S=0;S<12;S++)h=h<<1^(h>>>11)*7973;const u=this.version<<12|h;s(u>>>18==0);for(let S=0;S<18;S++){const w=a(u,S),C=this.size-11+S%3,E=Math.floor(S/3);this.setFunctionModule(C,E,w),this.setFunctionModule(E,C,w)}}drawFinderPattern(h,u){for(let S=-4;S<=4;S++)for(let w=-4;w<=4;w++){const C=Math.max(Math.abs(w),Math.abs(S)),E=h+w,R=u+S;0<=E&&E<this.size&&0<=R&&R<this.size&&this.setFunctionModule(E,R,C!=2&&C!=4)}}drawAlignmentPattern(h,u){for(let S=-2;S<=2;S++)for(let w=-2;w<=2;w++)this.setFunctionModule(h+w,u+S,Math.max(Math.abs(w),Math.abs(S))!=1)}setFunctionModule(h,u,S){this.modules[u][h]=S,this.isFunction[u][h]=!0}addEccAndInterleave(h){const u=this.version,S=this.errorCorrectionLevel;if(h.length!=ct.getNumDataCodewords(u,S))throw new RangeError("Invalid argument");const w=ct.NUM_ERROR_CORRECTION_BLOCKS[S.ordinal][u],C=ct.ECC_CODEWORDS_PER_BLOCK[S.ordinal][u],E=Math.floor(ct.getNumRawDataModules(u)/8),R=w-E%w,T=Math.floor(E/w);let j=[];const D=ct.reedSolomonComputeDivisor(C);for(let q=0,L=0;q<w;q++){let K=h.slice(L,L+T-C+(q<R?0:1));L+=K.length;const J=ct.reedSolomonComputeRemainder(K,D);q<R&&K.push(0),j.push(K.concat(J))}let z=[];for(let q=0;q<j[0].length;q++)j.forEach((L,K)=>{(q!=T-C||K>=R)&&z.push(L[q])});return s(z.length==E),z}drawCodewords(h){if(h.length!=Math.floor(ct.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let S=this.size-1;S>=1;S-=2){S==6&&(S=5);for(let w=0;w<this.size;w++)for(let C=0;C<2;C++){const E=S-C,R=(S+1&2)==0?this.size-1-w:w;!this.isFunction[R][E]&&u<h.length*8&&(this.modules[R][E]=a(h[u>>>3],7-(u&7)),u++)}}s(u==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let u=0;u<this.size;u++)for(let S=0;S<this.size;S++){let w;switch(h){case 0:w=(S+u)%2==0;break;case 1:w=u%2==0;break;case 2:w=S%3==0;break;case 3:w=(S+u)%3==0;break;case 4:w=(Math.floor(S/3)+Math.floor(u/2))%2==0;break;case 5:w=S*u%2+S*u%3==0;break;case 6:w=(S*u%2+S*u%3)%2==0;break;case 7:w=((S+u)%2+S*u%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[u][S]&&w&&(this.modules[u][S]=!this.modules[u][S])}}getPenaltyScore(){let h=0;for(let C=0;C<this.size;C++){let E=!1,R=0,T=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[C][j]==E?(R++,R==5?h+=ct.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,T),E||(h+=this.finderPenaltyCountPatterns(T)*ct.PENALTY_N3),E=this.modules[C][j],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,T)*ct.PENALTY_N3}for(let C=0;C<this.size;C++){let E=!1,R=0,T=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][C]==E?(R++,R==5?h+=ct.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,T),E||(h+=this.finderPenaltyCountPatterns(T)*ct.PENALTY_N3),E=this.modules[j][C],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,T)*ct.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+=ct.PENALTY_N2)}let u=0;for(const C of this.modules)u=C.reduce((E,R)=>E+(R?1:0),u);const S=this.size*this.size,w=Math.ceil(Math.abs(u*20-S*10)/S)-1;return s(0<=w&&w<=9),h+=w*ct.PENALTY_N4,s(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let S=[6];for(let w=this.size-7;S.length<h;w-=u)S.splice(1,0,w);return S}}static getNumRawDataModules(h){if(h<ct.MIN_VERSION||h>ct.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*h+128)*h+64;if(h>=2){const S=Math.floor(h/7)+2;u-=(25*S-10)*S-55,h>=7&&(u-=36)}return s(208<=u&&u<=29648),u}static getNumDataCodewords(h,u){return Math.floor(ct.getNumRawDataModules(h)/8)-ct.ECC_CODEWORDS_PER_BLOCK[u.ordinal][h]*ct.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let u=[];for(let w=0;w<h-1;w++)u.push(0);u.push(1);let S=1;for(let w=0;w<h;w++){for(let C=0;C<u.length;C++)u[C]=ct.reedSolomonMultiply(u[C],S),C+1<u.length&&(u[C]^=u[C+1]);S=ct.reedSolomonMultiply(S,2)}return u}static reedSolomonComputeRemainder(h,u){let S=u.map(w=>0);for(const w of h){const C=w^S.shift();S.push(0),u.forEach((E,R)=>S[R]^=ct.reedSolomonMultiply(E,C))}return S}static reedSolomonMultiply(h,u){if(h>>>8||u>>>8)throw new RangeError("Byte out of range");let S=0;for(let w=7;w>=0;w--)S=S<<1^(S>>>7)*285,S^=(u>>>w&1)*h;return s(S>>>8==0),S}finderPenaltyCountPatterns(h){const u=h[1];s(u<=this.size*3);const S=u>0&&h[2]==u&&h[3]==u*3&&h[4]==u&&h[5]==u;return(S&&h[0]>=u*4&&h[6]>=u?1:0)+(S&&h[6]>=u*4&&h[0]>=u?1:0)}finderPenaltyTerminateAndCount(h,u,S){return h&&(this.finderPenaltyAddHistory(u,S),u=0),u+=this.size,this.finderPenaltyAddHistory(u,S),this.finderPenaltyCountPatterns(S)}finderPenaltyAddHistory(h,u){u[0]==0&&(h+=this.size),u.pop(),u.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(p,h,u){if(h<0||h>31||p>>>h)throw new RangeError("Value out of range");for(let S=h-1;S>=0;S--)u.push(p>>>S&1)}function a(p,h){return(p>>>h&1)!=0}function s(p){if(!p)throw new Error("Assertion error")}const m=class nn{constructor(h,u,S){if(this.mode=h,this.numChars=u,this.bitData=S,u<0)throw new RangeError("Invalid argument");this.bitData=S.slice()}static makeBytes(h){let u=[];for(const S of h)n(S,8,u);return new nn(nn.Mode.BYTE,h.length,u)}static makeNumeric(h){if(!nn.isNumeric(h))throw new RangeError("String contains non-numeric characters");let u=[];for(let S=0;S<h.length;){const w=Math.min(h.length-S,3);n(parseInt(h.substring(S,S+w),10),w*3+1,u),S+=w}return new nn(nn.Mode.NUMERIC,h.length,u)}static makeAlphanumeric(h){if(!nn.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let u=[],S;for(S=0;S+2<=h.length;S+=2){let w=nn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(S))*45;w+=nn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(S+1)),n(w,11,u)}return S<h.length&&n(nn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(S)),6,u),new nn(nn.Mode.ALPHANUMERIC,h.length,u)}static makeSegments(h){return h==""?[]:nn.isNumeric(h)?[nn.makeNumeric(h)]:nn.isAlphanumeric(h)?[nn.makeAlphanumeric(h)]:[nn.makeBytes(nn.toUtf8ByteArray(h))]}static makeEci(h){let u=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)n(h,8,u);else if(h<16384)n(2,2,u),n(h,14,u);else if(h<1e6)n(6,3,u),n(h,21,u);else throw new RangeError("ECI assignment value out of range");return new nn(nn.Mode.ECI,0,u)}static isNumeric(h){return nn.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return nn.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,u){let S=0;for(const w of h){const C=w.mode.numCharCountBits(u);if(w.numChars>=1<<C)return 1/0;S+=4+C+w.bitData.length}return S}static toUtf8ByteArray(h){h=encodeURI(h);let u=[];for(let S=0;S<h.length;S++)h.charAt(S)!="%"?u.push(h.charCodeAt(S)):(u.push(parseInt(h.substring(S+1,S+3),16)),S+=2);return u}};m.NUMERIC_REGEX=/^[0-9]*$/,m.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,m.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=m;e.QrSegment=m})(ko||(ko={}));(e=>{(t=>{const n=class{constructor(s,m){this.ordinal=s,this.formatBits=m}};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={}))})(ko||(ko={}));(e=>{(t=>{const n=class{constructor(s,m){this.modeBits=s,this.numBitsCharCount=m}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={}))})(ko||(ko={}));var Os=ko;var Yae={L:Os.QrCode.Ecc.LOW,M:Os.QrCode.Ecc.MEDIUM,Q:Os.QrCode.Ecc.QUARTILE,H:Os.QrCode.Ecc.HIGH},i4=128,r4="L",o4="#FFFFFF",s4="#000000",l4=!1,c4=1,Xae=4,Jae=0,eie=.1;function u4(e,t=0){const n=[];return e.forEach(function(a,s){let m=null;a.forEach(function(f,p){if(!f&&m!==null){n.push(`M${m+t} ${s+t}h${p-m}v1H${m+t}z`),m=null;return}if(p===a.length-1){if(!f)return;m===null?n.push(`M${p+t},${s+t} h1v1H${p+t}z`):n.push(`M${m+t},${s+t} h${p+1-m}v1H${m+t}z`);return}f&&m===null&&(m=p)})}),n.join("")}function d4(e,t){return e.slice().map((n,a)=>a<t.y||a>=t.y+t.h?n:n.map((s,m)=>m<t.x||m>=t.x+t.w?s:!1))}function tie(e,t,n,a){if(a==null)return null;const s=e.length+n*2,m=Math.floor(t*eie),f=s/t,p=(a.width||m)*f,h=(a.height||m)*f,u=a.x==null?e.length/2-p/2:a.x*f,S=a.y==null?e.length/2-h/2:a.y*f,w=a.opacity==null?1:a.opacity;let C=null;if(a.excavate){let R=Math.floor(u),T=Math.floor(S);C={x:R,y:T,w:Math.ceil(p+u-R),h:Math.ceil(h+S-T)}}const E=a.crossOrigin;return{x:u,y:S,h,w:p,excavation:C,opacity:w,crossOrigin:E}}function nie(e,t){return t!=null?Math.max(Math.floor(t),0):e?Xae:Jae}function m4({value:e,level:t,minVersion:n,includeMargin:a,marginSize:s,imageSettings:m,size:f,boostLevel:p}){let h=vn.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((R,T)=>(R.push(...Os.QrSegment.makeSegments(T)),R),[]);return Os.QrCode.encodeSegments(E,Yae[t],n,void 0,void 0,p)},[e,t,n,p]);const{cells:u,margin:S,numCells:w,calculatedImageSettings:C}=vn.useMemo(()=>{let E=h.getModules();const R=nie(a,s);return{cells:E,margin:R,numCells:E.length+R*2,calculatedImageSettings:tie(E,f,R,m)}},[h,f,m,a,s]);return{qrcode:h,margin:S,cells:u,numCells:w,calculatedImageSettings:C}}var aie=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),iie=vn.forwardRef(function(t,n){const a=t,{value:s,size:m=i4,level:f=r4,bgColor:p=o4,fgColor:h=s4,includeMargin:u=l4,minVersion:S=c4,boostLevel:w,marginSize:C,imageSettings:E}=a,R=xy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:T}=R,j=xy(R,["style"]),D=E?.src,z=vn.useRef(null),q=vn.useRef(null),L=vn.useCallback(ce=>{z.current=ce,typeof n=="function"?n(ce):n&&(n.current=ce)},[n]),[K,J]=vn.useState(!1),{margin:$,cells:F,numCells:ue,calculatedImageSettings:we}=m4({value:s,level:f,minVersion:S,boostLevel:w,includeMargin:u,marginSize:C,imageSettings:E,size:m});vn.useEffect(()=>{if(z.current!=null){const ce=z.current,Se=ce.getContext("2d");if(!Se)return;let Re=F;const Q=q.current,me=we!=null&&Q!==null&&Q.complete&&Q.naturalHeight!==0&&Q.naturalWidth!==0;me&&we.excavation!=null&&(Re=d4(F,we.excavation));const xe=window.devicePixelRatio||1;ce.height=ce.width=m*xe;const Ce=m/ue*xe;Se.scale(Ce,Ce),Se.fillStyle=p,Se.fillRect(0,0,ue,ue),Se.fillStyle=h,aie?Se.fill(new Path2D(u4(Re,$))):F.forEach(function(re,B){re.forEach(function(ae,pe){ae&&Se.fillRect(pe+$,B+$,1,1)})}),we&&(Se.globalAlpha=we.opacity),me&&Se.drawImage(Q,we.x+$,we.y+$,we.w,we.h)}}),vn.useEffect(()=>{J(!1)},[D]);const Ee=Sy({height:m,width:m},T);let Me=null;return D!=null&&(Me=vn.createElement("img",{src:D,key:D,style:{display:"none"},onLoad:()=>{J(!0)},ref:q,crossOrigin:we?.crossOrigin})),vn.createElement(vn.Fragment,null,vn.createElement("canvas",Sy({style:Ee,height:m,width:m,ref:L,role:"img"},j)),Me)});iie.displayName="QRCodeCanvas";var rie=vn.forwardRef(function(t,n){const a=t,{value:s,size:m=i4,level:f=r4,bgColor:p=o4,fgColor:h=s4,includeMargin:u=l4,minVersion:S=c4,boostLevel:w,title:C,marginSize:E,imageSettings:R}=a,T=xy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:D,numCells:z,calculatedImageSettings:q}=m4({value:s,level:f,minVersion:S,boostLevel:w,includeMargin:u,marginSize:E,imageSettings:R,size:m});let L=D,K=null;R!=null&&q!=null&&(q.excavation!=null&&(L=d4(D,q.excavation)),K=vn.createElement("image",{href:R.src,height:q.h,width:q.w,x:q.x+j,y:q.y+j,preserveAspectRatio:"none",opacity:q.opacity,crossOrigin:q.crossOrigin}));const J=u4(L,j);return vn.createElement("svg",Sy({height:m,width:m,viewBox:`0 0 ${z} ${z}`,ref:n,role:"img"},T),!!C&&vn.createElement("title",null,C),vn.createElement("path",{fill:p,d:`M0,0 h${z}v${z}H0z`,shapeRendering:"crispEdges"}),vn.createElement("path",{fill:h,d:J,shapeRendering:"crispEdges"}),K)});rie.displayName="QRCodeSVG";var KM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WM=UT,Io=(e,t)=>n=>{var a;if(t?.variants==null)return WM(e,n?.class,n?.className);const{variants:s,defaultVariants:m}=t,f=Object.keys(s).map(h=>{const u=n?.[h],S=m?.[h];if(u===null)return null;const w=KM(u)||KM(S);return s[h][w]}),p=n&&Object.entries(n).reduce((h,u)=>{let[S,w]=u;return w===void 0||(h[S]=w),h},{});return WM(e,f,t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,u)=>{let{class:S,className:w,...C}=u;return Object.entries(C).every(E=>{let[R,T]=E;return Array.isArray(T)?T.includes({...m,...p}[R]):{...m,...p}[R]===T})?[...h,S,w]:h},[]),n?.class,n?.className)},oie=Io("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"}}),ky=I.forwardRef(({className:e,variant:t,size:n,...a},s)=>v.jsx("button",{ref:s,className:se(oie({variant:t,size:n}),e),...a}));ky.displayName="Button";var sie=Io("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"}}),lie=I.forwardRef(({className:e,variant:t,size:n,icon:a,...s},m)=>v.jsx("button",{ref:m,className:se(sie({variant:t,size:n}),e),...s,children:v.jsx(a,{className:"h-4 w-4"})}));lie.displayName="IconButton";var cie=Io("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"}}),uie=I.forwardRef(({className:e,variant:t,style:n,...a},s)=>v.jsx("span",{ref:s,className:se(cie({variant:t,styleVariant:n}),e),...a}));uie.displayName="Badge";var die=Io("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),mie=I.forwardRef(({className:e,variant:t,...n},a)=>v.jsx("div",{ref:a,className:se(die({variant:t}),e),...n}));mie.displayName="Card";var pie=I.forwardRef(({className:e,...t},n)=>v.jsx("label",{ref:n,className:se("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...t}));pie.displayName="Label";var fie=Io("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),hie=I.forwardRef(({className:e,orientation:t,...n},a)=>v.jsx("div",{ref:a,role:"separator",className:se(fie({orientation:t}),e),...n}));hie.displayName="Separator";var gie=I.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:se("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...t}));gie.displayName="Skeleton";var YM=Io("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"}}),vie=I.forwardRef(({className:e,state:t,leftSlot:n,rightSlot:a,...s},m)=>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:m,className:se(YM({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:m,className:se(YM({state:t}),e),...s}));vie.displayName="Input";var yie=I.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:se("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(m=>v.jsx("option",{value:m.value,children:m.label},m.value))}),v.jsx("div",{className:se("absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",n===!0?"opacity-50":""),children:v.jsx(Eo,{className:"h-3.5 w-3.5"})})]}));yie.displayName="Select";var bie=I.forwardRef(({className:e,...t},n)=>v.jsx("input",{ref:n,type:"checkbox",className:se("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...t}));bie.displayName="Checkbox";var Sie=I.forwardRef(({className:e,checked:t,onCheckedChange:n,label:a,...s},m)=>v.jsxs("button",{ref:m,role:"switch","aria-checked":t,type:"button",onClick:()=>n(!t),className:se("inline-flex items-center gap-2",e),...s,children:[v.jsx("span",{className:se("w-8 h-4 rounded-full transition-colors",t?"bg-primary":"bg-surface-hover"),children:v.jsx("span",{className:se("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})]}));Sie.displayName="Switch";var p4=I.createContext(null);function xie(){const e=I.useContext(p4);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function f4({children:e,open:t,onOpenChange:n}){const[a,s]=I.useState(!1),m=t??a,f=I.useId(),p=I.useCallback(h=>{n?.(h),t===void 0&&s(h)},[t,n]);return v.jsx(p4.Provider,{value:{open:m,setOpen:p,contentId:f},children:e})}var kie=Io("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"}}),a0=I.forwardRef(({className:e,width:t,placement:n,scroll:a,children:s,...m},f)=>{const{open:p,setOpen:h,contentId:u}=xie(),S=I.useRef(null),w=f??S;I.useEffect(()=>{const E=w.current;E&&(p&&!E.open&&E.showModal(),!p&&E.open&&E.close())},[p,w]);const C=E=>{E.target===E.currentTarget&&h(!1)};return v.jsx("dialog",{ref:w,id:u,className:se(kie({width:t,placement:n,scroll:a}),e),onClick:C,onClose:()=>h(!1),...m,children:s})});a0.displayName="DialogContent";function wie({className:e,...t}){return v.jsx("div",{className:se("flex flex-col gap-1 mb-3 shrink-0",e),...t})}function Mie({className:e,...t}){return v.jsx("div",{className:se("flex justify-end gap-2 mt-4 shrink-0",e),...t})}function Cie({className:e,...t}){return v.jsx("h2",{className:se("text-sm font-semibold text-foreground",e),...t})}function Aie({className:e,...t}){return v.jsx("p",{className:se("text-xs text-foreground-muted",e),...t})}I.createContext(null);I.createContext(null);I.createContext(null);I.createContext(null);var Eie=I.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:se("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...t}));Eie.displayName="ScrollArea";var Rg={baseDelayMs:1500,maxDelayMs:15e3,maxAttempts:40};function Rie(e,t=Math.random){if(e>=Rg.maxAttempts)return{kind:"exhausted",attempts:e};const n=Math.min(Rg.maxDelayMs,Rg.baseDelayMs*2**e);return{kind:"retry",delayMs:Math.round(n*(.8+t()*.4))}}function oo(e,t){e.muted=t;const n=e.srcObject;if(n instanceof MediaStream)for(const a of n.getAudioTracks())a.enabled=!t}function _ie(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function Iie(e,t,n){let f=0;for(let p=0;p<8;p++)for(let h=0;h<8;h++){const u=Math.min(t-1,Math.floor((h+.5)/8*t)),S=Math.min(n-1,Math.floor((p+.5)/8*n)),{data:w}=e.getImageData(u,S,1,1);.2126*(w[0]??0)+.7152*(w[1]??0)+.0722*(w[2]??0)>12&&f++}return f<=1}function _g(e){const t={};if(typeof window<"u"){if(e){const a=e.getBoundingClientRect();a.width>0&&a.height>0&&(t.viewportWidth=Math.round(a.width),t.viewportHeight=Math.round(a.height))}t.viewportWidth===void 0&&(t.viewportWidth=window.innerWidth,t.viewportHeight=window.innerHeight),t.devicePixelRatio=window.devicePixelRatio||1;const n=navigator.connection;n?.downlink&&n.downlink>0&&(t.downlinkMbps=n.downlink)}return t}var Tie=8e3;function h4({serverUrl:e,streamKey:t,label:n,autoPlay:a=!0,muted:s=!0,showControls:m=!0,showStats:f=!1,onPlaybackStats:p,onClientNetworkSample:h,onConnectTiming:u,className:S="",onStateChange:w,onError:C,onReconnectAttempt:E,overlay:R,createSession:T,sendAnswer:j,handleOffer:D,getIceServers:z,addIceCandidate:q,getIceCandidates:L,closeSession:K,getSessionState:J,reoffer:$,posterUrl:F,hintsOverride:ue,reconnectSignal:we,onControlChannel:Ee,onVideoElement:Me}){const ce=I.useRef(null),Se=I.useRef(null),Re=I.useRef(null),Q=I.useRef(new Set),me=I.useRef(null),xe=I.useRef(null),Ce=I.useRef(0),re=I.useRef(!0),B=I.useRef(Ee);B.current=Ee;const ae=I.useRef(Me);ae.current=Me,I.useEffect(()=>(ae.current?.(ce.current),()=>ae.current?.(null)),[]);const pe=I.useRef(null),ge=I.useRef(null),H=I.useRef(0),ee=I.useRef(!1),Te=I.useRef(async()=>{}),[ke,Ie]=I.useState("idle"),[vt,He]=I.useState(""),[Ae,$e]=I.useState(s),Oe=I.useRef(Ae);Oe.current=Ae;const[At,Vt]=I.useState(!1),[Pn,Sa]=I.useState(!1),Zn=_ie(),[qn,Cn]=I.useState(!0),oa=I.useRef(null),xa=I.useRef(!1);(j||T)&&(xa.current=!0);const Xt=xa.current,be=I.useRef(!1);D&&(be.current=!0);const _e=be.current,[Nt,An]=I.useState(!1),$a=I.useRef(null),[Ye,En]=I.useState(null),[mi,Oa]=I.useState(!1),_n=I.useCallback(()=>{const he=ce.current;if(!(!he||he.readyState<2||!he.videoWidth||!he.videoHeight))try{const Be=document.createElement("canvas");Be.width=he.videoWidth,Be.height=he.videoHeight;const Xe=Be.getContext("2d");if(!Xe||(Xe.drawImage(he,0,0),Iie(Xe,Be.width,Be.height)))return;$a.current=Be.toDataURL("image/jpeg",.6)}catch{}},[]),Ot=I.useCallback(he=>{Ie(he),he==="playing"&&An(!0),w?.(he)},[w]),Jt=I.useCallback(()=>{if(me.current?.abort(),me.current=null,xe.current&&(clearTimeout(xe.current),xe.current=null),ge.current&&(clearTimeout(ge.current),ge.current=null),pe.current=null,ee.current=!1,H.current=0,Re.current&&(Re.current.close(),Re.current=null),K&&Q.current.size>0){for(const he of Q.current)K(he).catch(()=>{});Q.current.clear()}},[K]),To=I.useCallback(()=>{me.current?.abort(),me.current=null,xe.current&&(clearTimeout(xe.current),xe.current=null),ge.current&&(clearTimeout(ge.current),ge.current=null),pe.current=null,ee.current=!1,H.current=0},[]),au=1e3,Dr=I.useCallback(he=>{if(!J||!$)return;ge.current&&(clearTimeout(ge.current),ge.current=null);const Be=async()=>{if(re.current&&pe.current===he){if(!ee.current)try{const{pendingRenegotiation:Xe}=await J(he);if(re.current&&pe.current===he&&Xe&&Xe.epoch>H.current&&!ee.current){H.current=Xe.epoch,await Te.current(he,Xe.target);return}}catch{}!re.current||pe.current!==he||(ge.current=setTimeout(()=>{Be()},au))}};ge.current=setTimeout(()=>{Be()},au)},[J,$]),zr=I.useCallback(async(he=!1)=>{if(!re.current||!T||!j)return;const Be=he?Re.current:null,Xe=he?new Set(Q.current):null;he?To():Jt(),Ot("connecting");const kt=new AbortController;me.current=kt;try{const{sessionId:Je,sdpOffer:Ve,iceServers:qe}=await T({..._g(Se.current),...ue});if(Q.current.add(Je),!re.current||kt.signal.aborted){K?.(Je).catch(()=>{}),Q.current.delete(Je);return}const it=new RTCPeerConnection({iceServers:[...qe??[],{urls:"stun:stun.l.google.com:19302"}]});he||(Re.current=it);const We=new MediaStream;let jt=!1;const qt=()=>{if(!(jt||!re.current)){if(jt=!0,Re.current=it,ce.current&&(ce.current.srcObject=We,oo(ce.current,Oe.current),ce.current.play().catch(()=>{})),Be&&Be!==it)try{Be.close()}catch{}if(Xe)for(const nt of Xe)Q.current.delete(nt),K?.(nt).catch(()=>{})}};it.ontrack=nt=>{if(console.debug("[WebRTC] ontrack",nt.track.kind,nt.track.readyState),We.addTrack(nt.track),he){qt();return}ce.current&&(ce.current.srcObject=We,oo(ce.current,Oe.current),ce.current.play().catch(()=>{}))},it.oniceconnectionstatechange=()=>{if(!re.current)return;const nt=it.iceConnectionState;if(console.debug("[WebRTC] ICE state:",nt),nt==="connected"||nt==="completed")Ce.current=0,he&&qt(),Ot("playing"),ce.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),ce.current.play().catch(()=>{}));else if(nt==="failed"||nt==="disconnected"||nt==="closed"){if(he&&!jt)try{it.close()}catch{}Ot("disconnected"),ja()}},it.onicecandidateerror=nt=>{console.debug("[WebRTC] ICE candidate error:",nt)},console.debug("[WebRTC] Setting remote description (server offer)..."),await it.setRemoteDescription({type:"offer",sdp:Ve});const Kt=await it.createAnswer();if(await it.setLocalDescription(Kt),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await XM(it),!re.current)return;const sn=(it.localDescription?.sdp??"").split(`
82
- `).filter(nt=>nt.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:sn,sessionId:Je.slice(0,8)}),await j(Je,it.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const Mt=it,Sn=()=>{const nt=Mt.connectionState;if(nt==="closed"||nt==="failed")return;const yt=ce.current;yt&&yt.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${Mt.iceConnectionState})`)};setTimeout(Sn,3e3),setTimeout(Sn,8e3)}catch(Je){if(!re.current)return;const Ve=Je instanceof Error?Je.message:String(Je);He(Ve),Ot("error"),C?.(Ve),ja()}},[e,t,T,j,Jt,To,K,Ot,C,ue]),No=I.useCallback(async()=>{if(re.current){Jt(),Ot("connecting");try{const he=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});Re.current=he,he.addTransceiver("video",{direction:"recvonly"}),he.addTransceiver("audio",{direction:"recvonly"});const Be=new MediaStream;he.ontrack=qe=>{Be.addTrack(qe.track),ce.current&&(ce.current.srcObject=Be,oo(ce.current,Oe.current),ce.current.play().catch(()=>{}))},he.oniceconnectionstatechange=()=>{if(!re.current)return;const qe=he.iceConnectionState;qe==="connected"||qe==="completed"?(Ce.current=0,Ot("playing"),ce.current?.paused&&ce.current.play().catch(()=>{})):(qe==="failed"||qe==="disconnected"||qe==="closed")&&(Ot("disconnected"),ja())};const Xe=await he.createOffer();if(await he.setLocalDescription(Xe),await XM(he),!re.current)return;const kt=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,Je=await fetch(kt,{method:"POST",headers:{"Content-Type":"application/sdp"},body:he.localDescription?.sdp??""});if(!Je.ok)throw new Error(`WHEP ${Je.status}: ${Je.statusText}`);const Ve=await Je.text();await he.setRemoteDescription({type:"answer",sdp:Ve})}catch(he){if(!re.current)return;const Be=he instanceof Error?he.message:String(he);He(Be),Ot("error"),C?.(Be),ja()}}},[e,t,Jt,Ot,C]),Lr=I.useCallback(async(he=!1)=>{if(!re.current||!D)return;const Be=he?Re.current:null,Xe=he?new Set(Q.current):null;he?To():Jt(),Ot("connecting");const kt=new AbortController;me.current=kt;const Je=performance.now(),Ve=()=>Math.round(performance.now()-Je),qe={};try{const it=await z?.();if(qe.iceServersMs=Ve(),!re.current||kt.signal.aborted)return;const We=new RTCPeerConnection({iceServers:[...it??[],{urls:"stun:stun.l.google.com:19302"}]});he||(Re.current=We);const jt=new MediaStream;let qt=!1;const Kt=()=>{if(!(qt||!re.current)){if(qt=!0,Re.current=We,ce.current&&(ce.current.srcObject=jt,oo(ce.current,Oe.current),ce.current.play().catch(()=>{})),Be&&Be!==We)try{Be.close()}catch{}if(Xe)for(const Et of Xe)Q.current.delete(Et),K?.(Et).catch(()=>{})}};We.ontrack=Et=>{if(qe.firstTrackMs===void 0&&(qe.firstTrackMs=Ve()),console.debug("[WebRTC] ontrack (client-offer)",Et.track.kind,Et.track.readyState),jt.addTrack(Et.track),he){Kt();return}ce.current&&(ce.current.srcObject=jt,oo(ce.current,Oe.current),ce.current.play().catch(()=>{}))};let sn=!1;We.oniceconnectionstatechange=()=>{if(!re.current)return;const Et=We.iceConnectionState;if(console.debug("[WebRTC] ICE state (client-offer):",Et),Et==="connected"||Et==="completed"){if(!sn){sn=!0,qe.iceConnectedMs=Ve(),console.info("[WebRTC timing] client-offer connected",{streamKey:t,...qe}),u?.({...qe});const Ge=ce.current;Ge&&"requestVideoFrameCallback"in Ge&&(Ge.requestVideoFrameCallback(()=>{qe.firstFrameMs=Ve(),console.info("[WebRTC timing] first decoded frame",{streamKey:t,firstFrameMs:qe.firstFrameMs}),u?.({...qe})}),setTimeout(()=>{re.current&&qe.firstFrameMs===void 0&&(console.warn("[WebRTC timing] NO decoded frame (stalled)",{streamKey:t,sinceIceConnectedMs:Ve()-(qe.iceConnectedMs??0),iceConnectedMs:qe.iceConnectedMs,firstTrackMs:qe.firstTrackMs}),nl.current("no decoded frame after connect"),ja())},Tie))}Ce.current=0,he&&Kt(),Ot("playing"),ce.current?.paused&&ce.current.play().catch(()=>{})}else if(Et==="failed"||Et==="disconnected"||Et==="closed"){if(he&&!qt)try{We.close()}catch{}Ot("disconnected"),ja()}};let Mt=null;const Sn=[];if(We.onicecandidate=Et=>{if(!Et.candidate)return;const Ge=Et.candidate.toJSON();Mt&&q?q(Mt,Ge).catch(()=>{}):Sn.push(Ge)},We.addTransceiver("video",{direction:"recvonly"}),We.addTransceiver("audio",{direction:"recvonly"}),B.current){const Et=We.createDataChannel("camstack-control");B.current(Et)}const nt=await We.createOffer();if(qe.offerCreatedMs=Ve(),await We.setLocalDescription(nt),qe.localSetMs=Ve(),!re.current||kt.signal.aborted)return;const yt={..._g(Se.current),...ue},xn=Ve(),{sessionId:Bt,sdpAnswer:Ga}=await D(We.localDescription?.sdp??nt.sdp??"",void 0,yt);if(qe.signalingRttMs=Ve()-xn,Mt=Bt,Q.current.add(Bt),pe.current=Bt,!re.current||kt.signal.aborted){K?.(Bt).catch(()=>{}),Q.current.delete(Bt);return}if(q)for(const Et of Sn)q(Bt,Et).catch(()=>{});if(Sn.length=0,await We.setRemoteDescription({type:"answer",sdp:Ga}),qe.answerSetMs=Ve(),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:Bt.slice(0,8)}),L){const Et=new Set,Ge=Date.now(),ka=async()=>{if(!(!re.current||kt.signal.aborted)&&!(We.connectionState==="closed"||We.signalingState==="closed")){try{const{candidates:jo,done:Dn}=await L(Bt);for(const Vi of jo){const Za=Vi.candidate??"";Za&&!Et.has(Za)&&(Et.add(Za),We.addIceCandidate(new RTCIceCandidate(Vi)).catch(()=>{}))}const Qi=We.iceConnectionState;if(Dn||Date.now()-Ge>1e4||Qi==="connected"||Qi==="completed")return}catch{}setTimeout(()=>{ka()},200)}};ka()}Dr(Bt)}catch(it){if(!re.current)return;const We=it instanceof Error?it.message:String(it);He(We),Ot("error"),C?.(We),ja()}},[D,z,q,L,K,Jt,To,Ot,C,Dr,ue]);Te.current=I.useCallback(async(he,Be)=>{const Xe=$;if(!re.current||!Xe)return;const kt=Re.current;ee.current=!0;try{let Je=function(){if(We||!re.current){Mt();return}We=!0,Re.current=qe,ce.current&&(ce.current.srcObject=it,ce.current.play().catch(()=>{})),kt&&kt!==qe&&kt.close(),Mt()};const Ve=await z?.();if(!re.current)return;const qe=new RTCPeerConnection({iceServers:[...Ve??[],{urls:"stun:stun.l.google.com:19302"}]}),it=new MediaStream;let We=!1,jt=!1,qt=null,Kt,sn;const Mt=()=>{sn!==void 0&&(clearTimeout(sn),sn=void 0);const Ge=qt;if(qt=null,!!Ge){Kt!==void 0&&typeof Ge.cancelVideoFrameCallback=="function"&&Ge.cancelVideoFrameCallback(Kt),Ge.removeEventListener("loadeddata",Je);try{Ge.srcObject=null}catch{}Ge.remove()}},Sn=()=>{if(jt||We||!re.current)return;if(jt=!0,typeof document>"u"){Je();return}const Ge=document.createElement("video");Ge.muted=!0,Ge.playsInline=!0,Ge.autoplay=!0,Ge.style.cssText="position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",Ge.srcObject=it,qt=Ge,(Se.current??document.body).appendChild(Ge),Ge.play().catch(()=>{}),typeof Ge.requestVideoFrameCallback=="function"&&(Kt=Ge.requestVideoFrameCallback(()=>Je())),Ge.addEventListener("loadeddata",Je,{once:!0}),sn=setTimeout(()=>Je(),1800)};qe.ontrack=Ge=>{console.debug("[WebRTC] ontrack (reoffer)",Ge.track.kind,Ge.track.readyState),it.addTrack(Ge.track),Sn()},qe.oniceconnectionstatechange=()=>{if(!re.current)return;const Ge=qe.iceConnectionState;console.debug("[WebRTC] ICE state (reoffer):",Ge),Ge==="connected"||Ge==="completed"?(Ce.current=0,Sn(),Ot("playing"),ce.current?.paused&&ce.current.play().catch(()=>{})):(Ge==="failed"||Ge==="closed")&&(Mt(),!We&&Ge==="failed"&&qe.close(),Ot("disconnected"),ja())};let nt=null;const yt=[];if(qe.onicecandidate=Ge=>{if(!Ge.candidate)return;const ka=Ge.candidate.toJSON();nt&&q?q(nt,ka).catch(()=>{}):yt.push(ka)},qe.addTransceiver("video",{direction:"recvonly"}),qe.addTransceiver("audio",{direction:"recvonly"}),B.current){const Ge=qe.createDataChannel("camstack-control");B.current(Ge)}const xn=await qe.createOffer();if(await qe.setLocalDescription(xn),!re.current){qe.close();return}const Bt={..._g(Se.current),...ue},{sessionId:Ga,sdpAnswer:Et}=await Xe(he,qe.localDescription?.sdp??xn.sdp??"",Be,Bt);if(!re.current){qe.close();return}if(nt=Ga,Q.current.add(Ga),pe.current=Ga,q)for(const Ge of yt)q(Ga,Ge).catch(()=>{});if(yt.length=0,await qe.setRemoteDescription({type:"answer",sdp:Et}),L){const Ge=new Set,ka=Date.now(),jo=async()=>{if(re.current&&!(qe.connectionState==="closed"||qe.signalingState==="closed")){try{const{candidates:Dn,done:Qi}=await L(Ga);for(const Za of Dn){const Ka=Za.candidate??"";Ka&&!Ge.has(Ka)&&(Ge.add(Ka),qe.addIceCandidate(new RTCIceCandidate(Za)).catch(()=>{}))}const Vi=qe.iceConnectionState;if(Qi||Date.now()-ka>1e4||Vi==="connected"||Vi==="completed")return}catch{}setTimeout(()=>{jo()},200)}};jo()}Dr(Ga)}catch(Je){console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll",Je instanceof Error?Je.message:String(Je)),Dr(he)}finally{ee.current=!1}},[$,z,q,L,Ot,Dr,ue]);const Bn=_e?Lr:Xt?zr:No,qr=I.useRef(()=>{}),Hi=I.useRef(E);Hi.current=E;const nl=I.useRef(()=>{});nl.current=he=>{console.warn("[WebRTC] hard error",{streamKey:t,msg:he}),He(he),C?.(he),Ot("error")},qr.current=Bn;const ja=I.useCallback(()=>{if(!re.current)return;const he=Ce.current,Be=Rie(he);if(Hi.current?.(Be),Be.kind==="exhausted"){nl.current(`reconnect attempts exhausted (${Be.attempts})`);return}Ce.current+=1,xe.current=setTimeout(()=>{re.current&&qr.current()},Be.delayMs)},[]);I.useEffect(()=>(re.current=!0,Ce.current=0,a&&Bn(),()=>{re.current=!1,Jt()}),[]);const Oo=I.useRef(!1);I.useEffect(()=>{if(a){if(_e){if(!D)return}else if(Xt){if(!T||!j)return}else return;Oo.current||Re.current||(Oo.current=!0,Bn())}},[a,_e,Xt,D,T,j,Bn]);const $i=()=>{Ce.current=0,Bn()},iu=()=>{if(Ce.current=0,Re.current&&_e){Lr(!0);return}if(Re.current&&Xt){zr(!0);return}Bn()},al=I.useRef(e),il=I.useRef(t);I.useEffect(()=>{const he=al.current!==e,Be=il.current!==t;if(al.current=e,il.current=t,!(!he&&!Be)&&re.current){if(Ce.current=0,he){Jt(),Bn();return}iu()}},[e,t]);const rl=I.useRef(we);I.useEffect(()=>{rl.current!==we&&(rl.current=we,re.current&&iu())},[we]);const ol=()=>{if(ce.current){const he=!ce.current.muted;oo(ce.current,he),$e(he)}},sl=async()=>{if(Se.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(Se.current.requestFullscreen){await Se.current.requestFullscreen();return}const he=ce.current;he?.webkitEnterFullscreen&&he.webkitEnterFullscreen()}catch(he){console.warn(`Fullscreen toggle failed: ${he instanceof Error?he.message:he}`)}},ru=async()=>{const he=ce.current;if(he)try{if(typeof he.webkitSetPresentationMode=="function"){he.webkitSetPresentationMode(he.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture");return}document.pictureInPictureElement?await document.exitPictureInPicture():await he.requestPictureInPicture()}catch(Be){console.warn(`PiP toggle failed: ${Be instanceof Error?Be.message:String(Be)}`)}},ou=()=>{if(!ce.current)return;const he=document.createElement("canvas");he.width=ce.current.videoWidth||1280,he.height=ce.current.videoHeight||720;const Be=he.getContext("2d");if(!Be)return;Be.drawImage(ce.current,0,0);const Xe=document.createElement("a");Xe.download=`${t.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,Xe.href=he.toDataURL("image/jpeg",.92),Xe.click()};I.useEffect(()=>{const he=()=>Vt(!!document.fullscreenElement);document.addEventListener("fullscreenchange",he);const Be=ce.current;return Be?.addEventListener("webkitbeginfullscreen",he),Be?.addEventListener("webkitendfullscreen",he),()=>{document.removeEventListener("fullscreenchange",he),Be?.removeEventListener("webkitbeginfullscreen",he),Be?.removeEventListener("webkitendfullscreen",he)}},[]),I.useEffect(()=>{const he=ce.current,Be=typeof document<"u"&&document.pictureInPictureEnabled===!0,Xe=he!==null&&typeof he.webkitSetPresentationMode=="function";Sa(Be||Xe)},[]);const[Pa,mn]=I.useState(""),on=I.useRef(null);I.useEffect(()=>{if(!f){mn(""),on.current=null;return}const he=async()=>{const Xe=Re.current;if(Xe)try{const kt=await Xe.getStats();let Je=0,Ve=0,qe=0,it=0,We=0,jt=0;kt.forEach(sn=>{const Mt=sn;Mt.type==="inbound-rtp"&&(Mt.kind??Mt.mediaType)==="video"?(Je=Mt.bytesReceived??0,Ve=Mt.timestamp,qe=Mt.framesPerSecond??0,it=Mt.frameWidth??0,We=Mt.frameHeight??0):Mt.type==="candidate-pair"&&Mt.nominated&&typeof Mt.currentRoundTripTime=="number"&&(jt=Mt.currentRoundTripTime)});let qt=0;on.current&&Ve>on.current.ts&&(qt=Math.round((Je-on.current.bytes)*8/(Ve-on.current.ts))),on.current={bytes:Je,ts:Ve};const Kt=[];it&&We&&Kt.push(`${it}×${We}`),qe&&Kt.push(`${Math.round(qe)}fps`),qt>0&&Kt.push(`${qt} kbps`),jt&&Kt.push(`${Math.round(jt*1e3)}ms`),mn(Kt.join(" · "))}catch{}};he();const Be=setInterval(()=>{he()},1e3);return()=>clearInterval(Be)},[f]);const Qa=I.useRef(null);I.useEffect(()=>{if(!h){Qa.current=null;return}const he=async()=>{const Xe=Re.current;if(Xe)try{const kt=await Xe.getStats();let Je=0,Ve=0,qe=0,it=0,We=0,jt=0;kt.forEach(nt=>{const yt=nt;yt.type==="inbound-rtp"&&(yt.kind??yt.mediaType)==="video"?(Je=yt.packetsLost??0,Ve=yt.packetsReceived??0,qe=yt.bytesReceived??0,it=yt.timestamp,We=yt.jitter??0):yt.type==="candidate-pair"&&yt.nominated&&typeof yt.currentRoundTripTime=="number"&&(jt=yt.currentRoundTripTime)});const qt=Qa.current;if(Qa.current={lost:Je,recv:Ve,bytes:qe,ts:it},!qt||it<=qt.ts)return;const Kt=Math.max(0,Je-qt.lost),sn=Kt+Math.max(0,Ve-qt.recv),Mt=sn>0?Math.min(100,Kt/sn*100):0,Sn=Math.max(0,Math.round((qe-qt.bytes)*8/(it-qt.ts)));h({rttMs:Math.round(jt*1e3),jitterMs:Math.round(We*1e3),estimatedBandwidthKbps:Sn,packetLossPercent:Mt})}catch{}},Be=setInterval(()=>{he()},2e3);return()=>clearInterval(Be)},[h]);const Br=I.useRef(null);I.useEffect(()=>{if(!p){Br.current=null;return}const he=async()=>{const Xe=Re.current,kt=ce.current;if(Xe)try{const Je=await Xe.getStats();let Ve=0,qe=0,it=0,We=0,jt=0,qt=0,Kt=0,sn=0;Je.forEach(xn=>{const Bt=xn;Bt.type==="inbound-rtp"&&(Bt.kind??Bt.mediaType)==="video"&&(Ve=Bt.framesReceived??0,qe=Bt.framesDecoded??0,it=Bt.framesDropped??0,We=Bt.framesPerSecond??0,jt=Bt.freezeCount??0,qt=Bt.totalFreezesDuration??0,Kt=Bt.jitterBufferDelay??0,sn=Bt.jitterBufferEmittedCount??0)});const Mt=kt?.currentTime??0,Sn=Date.now(),nt=Br.current,yt=sn>0?Math.round(Kt/sn*1e3):0;nt&&p({dRecv:Ve-nt.recv,dDec:qe-nt.dec,dDrop:it-nt.drop,fps:Math.round(We),dFreeze:jt-nt.freeze,freezeTotalMs:Math.round(qt*1e3),avgJitterMs:yt,dCtMs:Math.round((Mt-nt.ct)*1e3),dtMs:Sn-nt.ts,readyState:kt?.readyState??-1}),Br.current={recv:Ve,dec:qe,drop:it,freeze:jt,ct:Mt,ts:Sn}}catch{}};he();const Be=setInterval(()=>{he()},1e3);return()=>clearInterval(Be)},[p]),I.useEffect(()=>{$e(s);const he=ce.current;he&&(oo(he,s),s||he.play().catch(()=>{}))},[s]);const su=()=>{Zn||(Cn(!0),oa.current&&clearTimeout(oa.current),oa.current=setTimeout(()=>Cn(!1),3e3))},xp=()=>{Cn(he=>!he),oa.current&&clearTimeout(oa.current)};I.useEffect(()=>{if(ke==="playing"){_n();const he=setInterval(_n,2e3);return()=>clearInterval(he)}Nt&&$a.current&&En($a.current)},[ke,Nt,_n]),I.useEffect(()=>{if(ke!=="playing"){Oa(!1);return}const he=ce.current;if(!he)return;let Be=!1;const Xe=()=>{Be||Oa(!0)};let kt;typeof he.requestVideoFrameCallback=="function"&&(kt=he.requestVideoFrameCallback(()=>Xe())),he.addEventListener("loadeddata",Xe,{once:!0});const Je=setTimeout(Xe,12e3);return()=>{Be=!0,clearTimeout(Je),kt!==void 0&&typeof he.cancelVideoFrameCallback=="function"&&he.cancelVideoFrameCallback(kt),he.removeEventListener("loadeddata",Xe)}},[ke]);const Va=Nt&&Ye?Ye:F??null,Ur=!mi&&Va!==null;return v.jsxs("div",{ref:Se,className:`relative isolate bg-black overflow-hidden group ${S}`,onMouseMove:su,onMouseEnter:su,onTouchStart:xp,children:[v.jsx("video",{ref:ce,autoPlay:a,muted:Ae,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),Ur&&Va&&v.jsx("img",{src:Va,alt:"",className:"absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"}),n&&ke==="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&&Pa&&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:Pa}),R,m&&!Va&&ke==="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…"})]}),m&&!Va&&(ke==="error"||ke==="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:ke==="error"?vt||"Connection failed":"Disconnected"}),v.jsx("button",{onClick:$i,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"})]}),m&&Va&&(ke==="connecting"||ke==="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]"})})}),m&&Va&&ke==="error"&&v.jsx("button",{onClick:$i,title:vt||"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"})]})}),m&&ke!=="idle"&&ke!=="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 ${Zn||qn?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Dd,{onClick:ol,title:Ae?"Unmute":"Mute",children:Ae?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(Dd,{onClick:ou,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"})]})}),Pn&&v.jsx(Dd,{onClick:ru,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(Dd,{onClick:sl,title:At?"Exit fullscreen":"Fullscreen",children:At?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 Dd({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 XM(e){if(e.iceGatheringState!=="complete")return new Promise(t=>{let n=!1,a;const s=()=>{n||(n=!0,a&&clearInterval(a),e.removeEventListener("icegatheringstatechange",m),t())},m=()=>{e.iceGatheringState==="complete"&&s()};e.addEventListener("icegatheringstatechange",m);const f=Date.now();a=setInterval(()=>{const p=e.localDescription?.sdp??"";/ typ host/.test(p)&&Date.now()-f>=600&&s()},100),setTimeout(s,2500)})}var Ig=["day","ir"],Nie={day:"Daylight",ir:"Night (IR)",night:"Night",dawn:"Dawn",dusk:"Dusk"};function pm(e){return Nie[e]??e}function xfe(e){const t=new Set(e.coveredConditions),n=Ig.map(f=>`${pm(f)} ${t.has(f)?"✓":"✗"}`),a=[...t].filter(f=>!Ig.some(p=>p===f));for(const f of a)n.push(`${pm(f)} ✓`);const s=Ig.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 m=s.map(f=>pm(f).toLowerCase()).join(" and ");return e.onUncoveredCondition==="judge-anyway"?`${n.join(" · ")} — ${m} judged against the references you do have.`:`${n.join(" · ")} — optional; checks in ${m} are skipped.`}function Oie(e){if(e.suspendedCondition===null)return null;const t=pm(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 jie={"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 kfe(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?jie[e.unavailable]:"can’t tell right now.";const n=e.verdict==="diverged"?e.divergedAt:e.armedAt,a=n!==null?` for ${Die(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=Oie(e);return s!==null?s:e.verdict==="diverged"?`CHANGED${a}`:`Normal${a}`}function wfe(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 Pie=.4;function Mfe(e){return e.width*e.height>Pie}function Die(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 Cfe="text-[10px] text-foreground-subtle",zie={face:"#a855f7",plate:"#ec4899"};Object.freeze({...Object.fromEntries(Object.values(fb).filter(e=>e.category==="detection"||e.kind==="motion").map(e=>[e.kind,e.color])),...zie});var Lie=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()}},g4=class{constructor(e){this.generateIdentifier=e,this.kv=new Lie}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)}},qie=class extends g4{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 Bie(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 Uie(e,t){const n=Bie(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const m=a[s];if(t(m))return m}}function Ws(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function fm(e,t){return e.indexOf(t)!==-1}function JM(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var Fie=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Uie(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Hie=e=>Object.prototype.toString.call(e).slice(8,-1),v4=e=>typeof e>"u",$ie=e=>e===null,Dc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,wy=e=>Dc(e)&&Object.keys(e).length===0,_r=e=>Array.isArray(e),Qie=e=>typeof e=="string",Vie=e=>typeof e=="number"&&!isNaN(e),Gie=e=>typeof e=="boolean",Zie=e=>e instanceof RegExp,zc=e=>e instanceof Map,Lc=e=>e instanceof Set,y4=e=>Hie(e)==="Symbol",Kie=e=>e instanceof Date&&!isNaN(e.valueOf()),b4=e=>e instanceof Error,eC=e=>typeof e=="number"&&isNaN(e),Wie=e=>Gie(e)||$ie(e)||v4(e)||Vie(e)||Qie(e)||y4(e),Yie=e=>typeof e=="bigint",Xie=e=>e===1/0||e===-1/0,Jie=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),ere=e=>e instanceof URL,My=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Tg=e=>e.map(String).map(My).join("."),vc=(e,t)=>{const n=[];let a="";for(let m=0;m<e.length;m++){let f=e.charAt(m);if(!t&&f==="\\"){const p=e.charAt(m+1);if(p==="\\"){a+="\\",m++;continue}else if(p!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(m+1)==="."){a+=".",m++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function ai(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var S4=[ai(v4,"undefined",()=>null,()=>{}),ai(Yie,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ai(Kie,"Date",e=>e.toISOString(),e=>new Date(e)),ai(b4,"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}),ai(Zie,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ai(Lc,"set",e=>[...e.values()],e=>new Set(e)),ai(zc,"map",e=>[...e.entries()],e=>new Map(e)),ai(e=>eC(e)||Xie(e),"number",e=>eC(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ai(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ai(ere,"URL",e=>e.toString(),e=>new URL(e))];function vp(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var x4=vp((e,t)=>y4(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}),tre=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),k4=vp(Jie,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=tre[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function w4(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var M4=vp(w4,(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)}),C4=vp((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)}),nre=[M4,x4,C4,k4],tC=(e,t)=>{const n=JM(nre,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=JM(S4,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},A4={};S4.forEach(e=>{A4[e.annotation]=e});var are=(e,t,n)=>{if(_r(t))switch(t[0]){case"symbol":return x4.untransform(e,t,n);case"class":return M4.untransform(e,t,n);case"custom":return C4.untransform(e,t,n);case"typed-array":return k4.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=A4[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},js=(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 E4(e){if(fm(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(fm(e,"prototype"))throw new Error("prototype is not allowed as a property");if(fm(e,"constructor"))throw new Error("constructor is not allowed as a property")}var ire=(e,t)=>{E4(t);for(let n=0;n<t.length;n++){const a=t[n];if(Lc(e))e=js(e,+a);else if(zc(e)){const s=+a,m=+t[++n]==0?"key":"value",f=js(e,s);switch(m){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},Cy=(e,t,n)=>{if(E4(t),t.length===0)return n(e);let a=e;for(let m=0;m<t.length-1;m++){const f=t[m];if(_r(a)){const p=+f;a=a[p]}else if(Dc(a))a=a[f];else if(Lc(a)){const p=+f;a=js(a,p)}else if(zc(a)){if(m===t.length-2)break;const p=+f,h=+t[++m]==0?"key":"value",u=js(a,p);switch(h){case"key":a=u;break;case"value":a=a.get(u);break}}}const s=t[t.length-1];if(_r(a)?a[+s]=n(a[+s]):Dc(a)&&(a[s]=n(a[s])),Lc(a)){const m=js(a,+s),f=n(m);m!==f&&(a.delete(m),a.add(f))}if(zc(a)){const m=+t[t.length-2],f=js(a,m);switch(+s==0?"key":"value"){case"key":{const p=n(f);a.set(p,a.get(f)),p!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},R4=e=>e<1;function Ay(e,t,n,a=[]){if(!e)return;const s=R4(n);if(!_r(e)){Ws(e,(p,h)=>Ay(p,t,n,[...a,...vc(h,s)]));return}const[m,f]=e;f&&Ws(f,(p,h)=>{Ay(p,t,n,[...a,...vc(h,s)])}),t(m,a)}function rre(e,t,n,a){return Ay(t,(s,m)=>{e=Cy(e,m,f=>are(f,s,a))},n),e}function ore(e,t,n){const a=R4(n);function s(m,f){const p=ire(e,vc(f,a));m.map(h=>vc(h,a)).forEach(h=>{e=Cy(e,h,()=>p)})}if(_r(t)){const[m,f]=t;m.forEach(p=>{e=Cy(e,vc(p,a),()=>e)}),f&&Ws(f,s)}else Ws(t,s);return e}var sre=(e,t)=>Dc(e)||_r(e)||zc(e)||Lc(e)||b4(e)||w4(e,t);function lre(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function cre(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(p=>p.map(String)).sort((p,h)=>p.length-h.length));const[m,...f]=s;m.length===0?a=f.map(Tg):n[Tg(m)]=f.map(Tg)}),a?wy(n)?[a]:[a,n]:wy(n)?void 0:n}var _4=(e,t,n,a,s=[],m=[],f=new Map)=>{const p=Wie(e);if(!p){lre(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!sre(e,n)){const E=tC(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return p||f.set(e,R),R}if(fm(m,e))return{transformedValue:null};const h=tC(e,n),u=h?.value??e,S=_r(u)?[]:{},w={};Ws(u,(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 T=_4(E,t,n,a,[...s,R],[...m,e],f);S[R]=T.transformedValue,_r(T.annotations)?w[My(R)]=T.annotations:Dc(T.annotations)&&Ws(T.annotations,(j,D)=>{w[My(R)+"."+D]=j})});const C=wy(w)?{transformedValue:S,annotations:h?[h.type]:void 0}:{transformedValue:S,annotations:h?[h.type,w]:w};return p||f.set(e,C),C};function I4(e){return Object.prototype.toString.call(e).slice(8,-1)}function nC(e){return I4(e)==="Array"}function ure(e){if(I4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function dre(e,t,n,a,s){const m={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";m==="enumerable"&&(e[t]=n),s&&m==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Ey(e,t={}){if(nC(e))return e.map(s=>Ey(s,t));if(!ure(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,m)=>{if(m==="__proto__"||nC(t.props)&&!t.props.includes(m))return s;const f=e[m];return dre(s,m,Ey(f,t),e,t.nonenumerable),s},{})}var Ft=class{constructor({dedupe:e=!1}={}){this.classRegistry=new qie,this.symbolRegistry=new g4(t=>t.description??""),this.customTransformerRegistry=new Fie,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=_4(e,t,this,this.dedupe),a={json:n.transformedValue};n.annotations&&(a.meta={...a.meta,values:n.annotations});const s=cre(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:Ey(n);return a?.values&&(s=rre(s,a.values,a.v??0,this)),a?.referentialEqualities&&(s=ore(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)}};Ft.defaultInstance=new Ft;Ft.serialize=Ft.defaultInstance.serialize.bind(Ft.defaultInstance);Ft.deserialize=Ft.defaultInstance.deserialize.bind(Ft.defaultInstance);Ft.stringify=Ft.defaultInstance.stringify.bind(Ft.defaultInstance);Ft.parse=Ft.defaultInstance.parse.bind(Ft.defaultInstance);Ft.registerClass=Ft.defaultInstance.registerClass.bind(Ft.defaultInstance);Ft.registerSymbol=Ft.defaultInstance.registerSymbol.bind(Ft.defaultInstance);Ft.registerCustom=Ft.defaultInstance.registerCustom.bind(Ft.defaultInstance);Ft.allowErrorProps=Ft.defaultInstance.allowErrorProps.bind(Ft.defaultInstance);I.createContext(null);Ke.AddonStarted+"",Ke.AddonInstalled+"",Ke.AddonRestarted+"",Ke.AddonUpdated+"",Ke.AddonStopped+"",Ke.AddonUninstalled+"",Ke.AddonCrashed+"",Ke.AddonError+"",Ke.DetectionPhaseTransition+"",Ke.DetectionResult+"",Ke.DetectionEvent+"",Ke.DetectionCameraNative+"",Ke.ProviderMotion+"",Ke.MotionOnMotionChanged+"",Ke.MotionAnalysis+"",Ke.MotionZonesRaw+"",Ke.ProviderDetection+"",Ke.PipelineAudioInferenceResult+"",Ke.AgentOnline+"",Ke.AgentOffline+"",Ke.DeviceRegistered+"",Ke.DeviceUnregistered+"",Ke.DeviceStateChanged+"",Ke.EventEmitted+"";var mre=Object.freeze([...new Set(Object.values(Ke))].toSorted()),pre=Object.freeze([Ke.PipelineCameraMetricsSnapshot,Ke.PipelineRunnerLoadSnapshot,Ke.PipelineEngineMetricsSnapshot,Ke.PipelineInferenceResult,Ke.PipelineTrace,Ke.PipelineProgress,Ke.StreamBrokerMetricsSnapshot,Ke.MetricsNodeResourcesSnapshot,Ke.MetricsNodeProcessesSnapshot,Ke.ClusterTopologySnapshot,Ke.MotionAnalysis,Ke.MotionZonesRaw,Ke.DetectionResult,Ke.PipelineAudioInferenceResult,Ke.PlatformProbePhase,Ke.BenchmarkProgress,Ke.ModelDownloadProgress]),fre=new Set(pre);Object.freeze(mre.filter(e=>!fre.has(e)));Object.freeze([...new Set(DY.filter(e=>e.scope==="device").map(e=>e.name))].toSorted());function T4({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 hre({on:e,targetLabel:t,onConfirm:n}){const a=I.useRef(null),s=I.useRef(!1);return v.jsxs("div",{className:se("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:m=>{m.currentTarget.setPointerCapture?.(m.pointerId),a.current=m.clientX,s.current=!1},onPointerMove:m=>{a.current!==null&&Math.abs(m.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 gre=2,aC=270,vre=315;function yre(e){const t=(e-135+360)%360;return t>aC?t<=vre?1:0:t/aC}function hm({fraction:e,color:t,knobTopPx:n,onDragFraction:a}){const s=-135+e*270,m=I.useRef(null),[f,p]=I.useState(!1),h=a!==void 0,u=n??gre,S=E=>{a!==void 0&&(E.preventDefault(),E.stopPropagation(),E.currentTarget.setPointerCapture?.(E.pointerId),p(!0))},w=E=>{if(a===void 0||!f)return;const R=m.current;if(R===null)return;const T=R.getBoundingClientRect(),j=T.left+T.width/2,D=T.top+T.height/2;a(yre(Math.atan2(E.clientY-D,E.clientX-j)*180/Math.PI))},C=E=>{a!==void 0&&(E.currentTarget.releasePointerCapture?.(E.pointerId),p(!1))};return v.jsx("div",{ref:m,className:"absolute inset-0",style:{transform:`rotate(${s}deg)`},children:v.jsx("div",{className:se("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:u,border:`3px solid ${t}`},...h?{onPointerDown:S,onPointerMove:w,onPointerUp:C,onPointerCancel:C}:{}})})}function Ry({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 Ni=150,gm=64,bre=Ni/2,_y=2*Math.PI*gm,Ng=_y*(270/360);function N4({fraction:e,color:t,children:n,onDragFraction:a}){const s=Math.min(1,Math.max(0,e)),m=Ni/2,f=Ni/2,p=_y-Ng,h=s*Ng;return v.jsxs("div",{className:"relative",style:{width:Ni,height:Ni},children:[v.jsxs("svg",{width:Ni,height:Ni,viewBox:`0 0 ${Ni} ${Ni}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:m,cy:f,r:gm,fill:"none",stroke:"var(--color-border)",strokeWidth:11,strokeDasharray:`${Ng} ${p}`,strokeLinecap:"round"}),v.jsx("circle",{cx:m,cy:f,r:gm,fill:"none",stroke:t,strokeWidth:11,strokeDasharray:`${h} ${_y-h}`,strokeLinecap:"round"})]}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(hm,{fraction:s,color:t,knobTopPx:bre-gm-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 i0({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:se("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:se("absolute h-6 w-6 rounded-full transition-all",e?"bg-success":"bg-foreground-subtle"),style:a})})}function Sre({trpc:e,deviceId:t}){const n=eu(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:m=>{m.stopPropagation(),s()},className:se("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(zI,{className:"h-3 w-3"}),v.jsx("span",{children:"Press"})]})}function xre({trpc:e,deviceId:t}){const n=eu(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:se("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(zI,{className:"h-6 w-6"})}),v.jsx("span",{className:"text-sm font-medium text-foreground",children:"Press"})]})}var kre=4e3;function iC(e){if(e!==void 0)return e!==null&&typeof e=="object"&&"lastChangedAt"in e&&typeof e.lastChangedAt=="number"?e.lastChangedAt:e}function It(e,t){const n=t?.enabled!==!1,a=t?.timeoutMs??kre,[s,m]=I.useState(void 0),f=I.useRef(void 0),p=I.useRef(void 0),h=I.useRef(!1),u=I.useRef(void 0),S=I.useCallback(()=>{u.current!==void 0&&(clearTimeout(u.current),u.current=void 0),f.current=void 0,h.current=!1,p.current=void 0,m(void 0)},[]);I.useEffect(()=>{if(!n||!h.current)return;const C=iC(e),E=p.current;C!==void 0&&C!==E&&S()}),I.useEffect(()=>()=>{u.current!==void 0&&clearTimeout(u.current)},[]);const w=I.useCallback(C=>{if(!n)return;u.current!==void 0&&(clearTimeout(u.current),u.current=void 0);const E=f.current??e;if(E!==void 0){const R={...E,...C};f.current=R,m(R)}p.current=iC(e),h.current=!0,u.current=setTimeout(S,a)},[n,e,S,a]);return n?{display:s!==void 0?s:e,applyOptimistic:w}:{display:e,applyOptimistic:()=>{}}}function wre(e){return e instanceof Error?e.message:String(e)}function Mre({trpc:e,deviceId:t,layout:n,optimistic:a,features:s}){const{cap:m,slice:f,available:p}=ut({trpc:e,deviceId:t,cap:Q=>Q.lockControl,slice:Q=>Q.state.lockControl}),{display:h,applyOptimistic:u}=It(f,{enabled:a??!0}),[S,w]=I.useState(null),[C,E]=I.useState(!1),[R,T]=I.useState(null);if(h===void 0)return null;const j=h.state==="locked"||h.state==="locking",D=!p||h.state==="jammed",z=s?.includes(aa.LockOpen)===!0,q=n==="compact",L=()=>{u({state:"locking"}),m?.lock({})},K=()=>{u({state:"unlocking"}),m?.unlock({})},J=()=>{m?.open({})},$=()=>{if(!D){if(!j){L();return}if(q){T(null),w("unlock");return}K()}},F=()=>{if(!D){if(q){T(null),w("open");return}J()}},ue=()=>{C||w(null)},we=async()=>{if(!(C||S===null)){T(null),E(!0);try{S==="unlock"?(u({state:"unlocking"}),await m?.unlock({})):await m?.open({}),w(null)}catch(Q){T(wre(Q))}finally{E(!1)}}},Ee=j?"Unlock":"Lock",Me=S==="open"?"Open door?":"Unlock device?",ce=S==="open"?"This will release the latch and open the door.":"This will unlock the device.",Se=S==="open"?"Confirm open":"Confirm unlock",Re=S==="open"?v.jsx(Vs,{className:"h-4 w-4 text-amber-400"}):v.jsx(cy,{className:"h-4 w-4 text-amber-400"});return v.jsxs("div",{className:se("inline-flex items-center",n==="full"?"gap-2":"gap-1"),children:[v.jsxs("button",{type:"button","aria-label":Ee,title:h.state==="jammed"?"Jammed":Ee,disabled:D,onClick:Q=>{Q.stopPropagation(),$()},className:se("inline-flex items-center justify-center rounded transition-colors",n==="full"?"h-7 gap-1.5 px-2 text-xs":"h-5 w-5",j?"text-success":"text-warning",D&&"opacity-40 cursor-not-allowed","hover:bg-surface-hover"),children:[j?v.jsx(Kc,{className:"h-3.5 w-3.5"}):v.jsx(cy,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:h.state})]}),z&&v.jsxs("button",{type:"button","aria-label":"Open door",title:"Open door",disabled:D,onClick:Q=>{Q.stopPropagation(),F()},className:se("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(Vs,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:"Open"})]}),q&&v.jsx(f4,{open:S!==null,onOpenChange:Q=>{Q||ue()},children:v.jsxs(a0,{width:"sm",onClick:Q=>Q.stopPropagation(),children:[v.jsxs(wie,{children:[v.jsxs(Cie,{className:"flex items-center gap-2",children:[Re,Me]}),v.jsx(Aie,{children:ce})]}),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(Mie,{children:[v.jsx(ky,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:()=>ue(),children:"Cancel"}),v.jsxs(ky,{type:"button",variant:"danger",size:"sm","aria-label":Se,disabled:C,onClick:()=>{we()},children:[C&&v.jsx(Hb,{className:"h-3.5 w-3.5 animate-spin"}),Se]})]})]})})]})}function r0({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:R=>R.switch,slice:R=>R.state.switch}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0}),[h,u]=I.useState(!1);if(f===void 0)return null;const S=f.on===!0,w=h||!m,C={transform:S?"translateX(14px)":"translateX(2px)"},E=async()=>{if(w||!a)return;const R=!S;p({on:R}),u(!0);try{await a.setState({on:R})}finally{u(!1)}};return v.jsx("button",{type:"button","aria-pressed":S,title:S?"Turn off":"Turn on",disabled:w,onClick:R=>{R.stopPropagation(),E()},className:se("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",S?"bg-success/30 border-success/50":"bg-surface-hover border-border",w&&"opacity-60"),children:v.jsx("span",{className:se("absolute h-3 w-3 rounded-full transition-all",S?"bg-success":"bg-foreground-subtle"),style:C})})}function Cre({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:S=>S.brightness,slice:S=>S.state.brightness}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(p===void 0)return null;const u=!f;return v.jsxs("label",{className:se("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:p.percentage,disabled:u,onChange:S=>{const w=Number(S.target.value);h({percentage:w}),u||s?.setBrightness({percentage:w})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[p.percentage,"%"]})]})}function Are({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:m,slice:f,available:p}=ut({trpc:e,deviceId:t,cap:T=>T.fanControl,slice:T=>T.state.fanControl}),{display:h,applyOptimistic:u}=It(f,{enabled:s??!0});if(h===void 0)return null;const S=!p,w=n??[],C=w.includes("fan-speed"),E=w.includes("fan-preset"),R=f?.percentageStep!=null&&f.percentageStep>0?f.percentageStep:1;return v.jsxs("div",{className:se("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:S,onChange:T=>{const j=Number(T.target.value),D=Math.min(100,Math.max(0,Math.round(j/R)*R));u({percentage:D}),S||m?.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:S,onChange:T=>{const j=T.target.value;!S&&j&&(u({preset:j}),m?.setPreset({preset:j}))},className:"bg-surface border border-border rounded px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(T=>v.jsx("option",{value:T,children:T},T))]})})]})}var o0={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"},O4={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"},Ere={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 Rre({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:m,slice:f,available:p}=ut({trpc:e,deviceId:t,cap:E=>E.climateControl,slice:E=>E.state.climateControl}),{display:h,applyOptimistic:u}=It(f,{enabled:s??!0});if(m===void 0||h===void 0)return null;const S=!p;if(a==="compact")return v.jsxs("div",{"data-mode":h.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",O4[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:S,onClick:E=>{if(E.stopPropagation(),!S&&h.target!==null){const R=h.target-1;u({target:R}),m.setTarget({target:R})}},className:se("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",S&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:S,onClick:E=>{if(E.stopPropagation(),!S&&h.target!==null){const R=h.target+1;u({target:R}),m.setTarget({target:R})}},className:se("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",S&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:h.mode,disabled:S,onChange:E=>{E.stopPropagation();const R=E.target.value;S||(u({mode:R}),m.setMode({mode:R}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",S&&"opacity-40 cursor-not-allowed"),children:h.availableModes.map(E=>v.jsx("option",{value:E,children:E},E))})]});const w=h.mode==="heat_cool"||h.targetLow!==null&&h.targetHigh!==null,C=!w&&h.target!==null;return v.jsxs("div",{"data-mode":h.mode,className:se("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",o0[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:S,onClick:E=>{if(E.stopPropagation(),!S&&h.target!==null){const R=h.target-1;u({target:R}),m.setTarget({target:R})}},className:se("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",S&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:S,onClick:E=>{if(E.stopPropagation(),!S&&h.target!==null){const R=h.target+1;u({target:R}),m.setTarget({target:R})}},className:se("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",S&&"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:S,onClick:R=>{R.stopPropagation(),S||(u({mode:E}),m.setMode({mode:E}))},className:se("rounded px-1.5 py-0.5 text-xs transition-colors",E===h.mode?Ere[E]:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",S&&"opacity-40 cursor-not-allowed"),children:E},E))}),w&&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:S,onChange:E=>{if(!S){const R=Number(E.target.value),T=h.targetHigh??R;u({targetLow:R}),m.setTargetRange({targetLow:R,targetHigh:T})}},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:S,onChange:E=>{if(!S){const R=Number(E.target.value),T=h.targetLow??R;u({targetHigh:R}),m.setTargetRange({targetLow:T,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:S,onChange:E=>{const R=E.target.value;!S&&R&&(u({fanMode:R}),m.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:S,onChange:E=>{const R=E.target.value;!S&&R&&(u({preset:R}),m.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:S,onChange:E=>{const R=Number(E.target.value);u({targetHumidity:R}),S||m.setTargetHumidity({targetHumidity:R})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.targetHumidity,"%"]})]})]})}var _re={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"},Ire={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"},j4=["off","all","one"];function Tre(e){return j4.includes(e)}var Nre={off:"Off",all:"All",one:"One"};function Ore(e){return e==="playing"||e==="buffering"?"pause":"play"}function jre({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:m,slice:f,available:p}=ut({trpc:e,deviceId:t,cap:C=>C.mediaPlayer,slice:C=>C.state.mediaPlayer}),{display:h,applyOptimistic:u}=It(f,{enabled:s??!0});if(h===void 0)return null;const S=!p,w=Ore(h.state);return v.jsxs("div",{"data-state":h.state,className:se("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",_re[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:se("inline-block h-2 w-2 rounded-full flex-shrink-0",Ire[h.state])}),v.jsx("button",{type:"button","aria-label":w==="play"?"Play":"Pause",disabled:S,onClick:C=>{C.stopPropagation(),!S&&(w==="play"?(u({state:"playing"}),m?.play({})):(u({state:"paused"}),m?.pause({})))},className:se("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",S&&"opacity-40 cursor-not-allowed"),children:w==="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:S,onClick:C=>{C.stopPropagation(),S||m?.previous({})},className:se("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",S&&"opacity-40 cursor-not-allowed"),children:"⏮"}),v.jsx("button",{type:"button","aria-label":"Next",disabled:S,onClick:C=>{C.stopPropagation(),S||m?.next({})},className:se("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",S&&"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:S,onChange:C=>{const E=Number(C.target.value);u({volumeLevel:E}),S||m?.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:S,onClick:C=>{if(C.stopPropagation(),!S&&h.isMuted!==null){const E=!h.isMuted;u({isMuted:E}),m?.setMute({muted:E})}},className:se("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",S&&"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:S,onChange:C=>{const E=C.target.value;!S&&E&&(u({source:E}),m?.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:S,onClick:C=>{if(C.stopPropagation(),!S&&h.shuffle!==null){const E=!h.shuffle;u({shuffle:E}),m?.setShuffle({shuffle:E})}},className:se("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",S&&"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:S,onChange:C=>{const E=C.target.value;!S&&Tre(E)&&(u({repeat:E}),m?.setRepeat({repeat:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:j4.map(C=>v.jsx("option",{value:C,children:Nre[C]},C))})]})]})]})}function yc(e,t){return t!==void 0?e.toFixed(t):Number.isInteger(e)?String(e):e.toFixed(1)}var Pre=/^(\d{4})-(\d{2})-(\d{2})/,Dre=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function zre(e,t){const n=Pre.exec(e);if(n===null)return e;const a=Number(n[1]),s=Number(n[2]),m=Number(n[3]),f=new Date(a,s-1,m);if(Number.isNaN(f.getTime()))return e;try{return f.toLocaleDateString(t)}catch{return e}}function Lre(e,t){const n=Dre.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 qre(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 s0(e,t,n){return e===""?e:t==="date"?zre(e,n):t==="time"?Lre(e,n):qre(e,n)}function Bre(e){return e.slice(0,10)}function Ure(e){return e.slice(0,5)}function Fre(e){return(e.includes("T")?e:e.replace(" ","T")).slice(0,16)}function Hre({value:e,busy:t,onCommit:n,unit:a,min:s,max:m,step:f,precision:p}){const[h,u]=I.useState(yc(e,p)),S=Number(h),w=h!==""&&!Number.isNaN(S),C=f??1,E=T=>{let j=T;return s!==void 0&&(j=Math.max(s,j)),m!==void 0&&(j=Math.min(m,j)),j},R=()=>{!t&&w&&n(E(S))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Decrement",disabled:t,onClick:T=>{if(T.stopPropagation(),!t){const j=E(e-C);u(yc(j,p)),n(j)}},className:se("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:T=>{u(T.target.value);const j=Number(T.target.value);T.target.value!==""&&!Number.isNaN(j)&&(t||n(E(j)))},onBlur:R,onKeyDown:T=>{T.key==="Enter"&&R()},className:se("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:T=>{if(T.stopPropagation(),!t){const j=E(e+C);u(yc(j,p)),n(j)}},className:se("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 $re({value:e,busy:t,onCommit:n}){const[a,s]=I.useState(e);return v.jsx("input",{type:"text",disabled:t,value:a,onChange:m=>s(m.target.value),onBlur:()=>{t||n(a)},onKeyDown:m=>{m.key==="Enter"&&!t&&n(a)},className:se("rounded border border-border bg-surface px-2 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}function Qre({slice:e,busy:t,setValueFn:n,layout:a}){switch(e.kind){case"numeric":return v.jsx(Hre,{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:se("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($re,{value:String(e.value),busy:t,onCommit:s=>{n({control:{kind:"text",value:s}})}});case"datetime":{const s=String(e.value),m=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:s0(s,m)}):v.jsx("input",{type:m==="date"?"date":m==="time"?"time":"datetime-local","aria-label":"Control value",disabled:t,value:m==="date"?Bre(s):m==="time"?Ure(s):Fre(s),onChange:f=>{f.stopPropagation(),t||n({control:{kind:"datetime",value:f.target.value}})},className:se("rounded border border-border bg-surface px-1 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}default:return null}}function P4({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:m,slice:f,available:p}=ut({trpc:e,deviceId:t,cap:C=>C.control,slice:C=>C.state.control}),{display:h,applyOptimistic:u}=It(f,{enabled:s??!0});if(h===void 0)return null;const S=!p,w=C=>{!S&&m&&(u({value:C.control.value}),m.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(Qre,{slice:h,busy:S,setValueFn:w,layout:a})})}var Vre=e=>e;function D4(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&&KY(a,s)?{unit:s,precision:n,toDisplayValue:m=>ZY(m,a,s)??m}:{unit:a??"",precision:n,toDisplayValue:Vre}}var z4={kind:"binary",field:"on",onLabel:"Low",offLabel:"Normal"};function L4(e){return e==="battery-sensor"}function q4(e,t){if(!U4(e))return!1;const n=e[t];if(typeof n!="number")return!1;const a=e.lastFetchedAt;return!(n===0&&a===0)}var B4={"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 U4(e){return typeof e=="object"&&e!==null}function Gre(e){return typeof e=="object"&&e!==null}function Zre(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function bc(e){return typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string"}function F4(e){if(typeof e!="object"||e===null)return;const t=e.format;if(t==="date"||t==="time"||t==="datetime")return t}function Kre(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}function Wre({trpc:e,device:t}){const n=t.role!=null?B4[t.role]:void 0,a=L4(t.role),{data:s}=KI({},{staleTime:6e4}),m=eu(e,t.id),f=So(m!==null&&n!==void 0?n.getSliceHandle(m.state):void 0),p=So(m!==null&&n?.kind==="numeric"?m.state.enumSensor:void 0),h=So(m!==null&&a?m.state.binary:void 0),u=a&&n?.kind==="numeric"&&!q4(f,n.field)&&h!==void 0,S=u?z4:n,w=u?h:f;if(S===void 0||w===void 0)return null;if(S.kind==="numeric"){if(!U4(w))return null;const E=w[S.field];if(typeof E!="number")return null;const R=w.lastFetchedAt,T=E===0&&R===0;if(T&&bc(p)&&p.value!=="")return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:p.value});if(T)return null;const j=w,D=typeof j.unit=="string"?j.unit:void 0,z=typeof j.precision=="number"?j.precision:void 0,q=D4({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:z,canonicalUnit:S.canonicalUnit}),L=q.unit,K=yc(q.toDisplayValue(E),q.precision);return v.jsxs("span",{className:se("inline-flex items-baseline gap-0.5 tabular-nums text-xs text-foreground"),children:[v.jsx("span",{children:K}),L&&v.jsx("span",{className:"text-foreground-subtle",children:L})]})}if(S.kind==="binary"){if(!Gre(w))return null;const R=!!w[S.field],T=R?S.onLabel:S.offLabel;return v.jsx("span",{className:se("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:T})}if(S.kind==="string")return!bc(w)||w.value===""?null:v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:w.value});if(S.kind==="datetime"){if(!bc(w)||w.value==="")return null;const E=F4(w)??S.format,R=s0(w.value,E);return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:R})}if(!Zre(w))return null;const C=Kre(w.state);return v.jsx("span",{className:se("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",w.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:C})}function yp(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 Yre(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Og({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",Yre(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Xre({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:w=>w.cover,slice:w=>w.state.cover}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0)return null;const h=yp(f?.state),u=!m,S=(w,C)=>{u||!w||(C!==void 0&&p(C),w({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Og,{label:"Open",busy:u,variant:h.up,onClick:()=>S(a?.open,{state:"opening"}),children:v.jsx(dp,{className:"h-3.5 w-3.5"})}),v.jsx(Og,{label:"Stop",busy:u,variant:h.stop,onClick:()=>S(a?.stop,{state:"stopped"}),children:v.jsx(Xc,{className:"h-3 w-3"})}),v.jsx(Og,{label:"Close",busy:u,variant:h.down,onClick:()=>S(a?.close,{state:"closing"}),children:v.jsx(Eo,{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 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:m=>{m.stopPropagation(),a()},className:se("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 H4(){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 Jre({position:e,interactive:t,onSetPosition:n}){const a=(1-e/100)*100,s=I.useRef(null),m=I.useRef(!1),f=I.useRef(null),p=C=>{const E=s.current;if(E===null)return e;const R=E.getBoundingClientRect();if(R.height<=0)return e;const T=(C-R.top)/R.height,j=Math.round(100-T*100);return Math.min(100,Math.max(0,j))},h=C=>{if(n===void 0)return;const E=p(C);f.current!==E&&(f.current=E,n(E))},u=C=>{t&&(C.stopPropagation(),C.preventDefault(),m.current=!0,f.current=null,C.currentTarget.setPointerCapture(C.pointerId),h(C.clientY))},S=C=>{!t||!m.current||(C.stopPropagation(),h(C.clientY))},w=C=>{!t||!m.current||(C.stopPropagation(),m.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?u:void 0,onPointerMove:t?S:void 0,onPointerUp:t?w:void 0,onPointerCancel:t?w:void 0,className:se("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(H4,{}),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:se("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 eoe({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(H4,{}),!e&&v.jsx("div",{className:"absolute inset-0",style:{background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)"}})]})}function toe({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:z=>z.cover,slice:z=>z.state.cover}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0)return null;const u=!f,S=(n??[]).includes(aa.CoverPositionable),w=(n??[]).includes(aa.CoverTilt),C=yp(p?.state),E=p?.position??null,R=E!==null,T=p?.state==="open"||p?.state==="opening",j=(z,q)=>{u||!z||(q!==void 0&&h(q),z({}))},D=z=>{u||(h({position:z}),s?.setPosition({position:z}))};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(Jre,{position:E,interactive:S,onSetPosition:S?D:void 0}):v.jsx(eoe,{isOpen:T}),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:p?.state??"—"})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(jg,{label:"Open",busy:u,variant:C.up,onClick:()=>j(s?.open,{state:"opening"}),children:v.jsx(dp,{className:"h-5 w-5"})}),v.jsx(jg,{label:"Stop",busy:u,variant:C.stop,onClick:()=>j(s?.stop,{state:"stopped"}),children:v.jsx(Xc,{className:"h-4 w-4"})}),v.jsx(jg,{label:"Close",busy:u,variant:C.down,onClick:()=>j(s?.close,{state:"closing"}),children:v.jsx(Eo,{className:"h-5 w-5"})})]})]})]}),S&&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:u,className:"flex-1",onChange:z=>{D(Number(z.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!S&&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,"%"]})]}),w&&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:p?.tiltPosition??0,disabled:u,className:"flex-1",onChange:z=>{const q=Number(z.target.value);h({tiltPosition:q}),u||s?.setTiltPosition({tiltPosition:q})}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[p?.tiltPosition??"—","%"]})]})]})}function noe(e){return v.jsx("span",{className:"text-foreground-subtle text-xs select-none","aria-hidden":"true",children:"—"})}function aoe(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 ioe(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 roe({trpc:e,deviceId:t}){const{data:n}=WI({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(Wre,{trpc:e,device:ioe(n)})}function ooe(e){return typeof e=="object"&&e!==null}function soe(e){return typeof e=="object"&&e!==null}function loe(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function coe(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}var uoe={low:"bg-danger",medium:"bg-warning",high:"bg-success"};function doe(e){return e<=20?"low":e<=50?"medium":"high"}function moe({percent:e}){const t=Math.min(100,Math.max(0,e)),n=doe(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:se("h-full rounded-full transition-all",uoe[n]),style:{width:`${t}%`}})})}function poe({trpc:e,device:t}){const n=t.role!=null?B4[t.role]:void 0,a=L4(t.role),{data:s}=KI({},{staleTime:6e4}),m=eu(e,t.id),f=So(m!==null&&n!==void 0?n.getSliceHandle(m.state):void 0),p=So(m!==null&&a?m.state.binary:void 0),h=a&&n?.kind==="numeric"&&!q4(f,n.field)&&p!==void 0,u=h?z4:n,S=h?p:f;if(u===void 0||S===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(u.kind==="numeric"){if(!ooe(S))return null;const C=S[u.field];if(typeof C!="number")return null;const E=S,R=typeof E.unit=="string"?E.unit:void 0,T=typeof E.precision=="number"?E.precision:void 0,j=D4({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:T,canonicalUnit:u.canonicalUnit}),D=j.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:yc(j.toDisplayValue(C),j.precision)}),D&&v.jsx("span",{className:"text-base text-foreground-subtle",children:D})]}),a&&v.jsx(moe,{percent:C}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(u.kind==="binary"){if(!soe(S))return null;const E=!!S[u.field],R=E?u.onLabel:u.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:se("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(u.kind==="datetime"){if(!bc(S))return null;if(S.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=F4(S)??u.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:s0(S.value,C)}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(u.kind==="string")return!bc(S)||S.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:S.value}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]});if(!loe(S))return null;const w=coe(S.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:se("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",S.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:w}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}function foe({trpc:e,deviceId:t}){const{data:n}=WI({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(poe,{trpc:e,device:n})}function $4(e){return e===void 0||e.inProgress?!1:e.availableVersion!==null&&e.currentVersion!==null&&e.availableVersion!==e.currentVersion}function Q4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.update,slice:n=>n.state.update})}function hoe({trpc:e,deviceId:t}){const{cap:n,slice:a}=Q4(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(Hb,{className:"h-3.5 w-3.5 animate-spin"}),"Updating…"]}):$4(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(NI,{className:"h-3 w-3"}),"Update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[v.jsx(EI,{className:"h-3 w-3 text-success"}),a?.currentVersion??"Up to date"]})}function goe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=Q4(e,t);if(n===void 0)return null;const m=a?.inProgress===!0,f=$4(a),p=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:p}),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})]})]}),m?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(Hb,{className:"h-4 w-4 animate-spin"}),"Installing…"]}):f?v.jsxs("button",{type:"button",onClick:u=>{u.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(NI,{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(EI,{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 voe(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 V4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.vacuumControl,slice:n=>n.state.vacuumControl})}function Pg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("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 yoe(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 boe=`
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 Soe({state:e,batteryLevel:t}){const n=yoe(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,m=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:m?{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:boe}),v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:se("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:se(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:se((s||m)&&"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:se(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 G4({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(jm,{className:"h-3.5 w-3.5"}),e,"%"]})}function xoe(e){switch(e){case"cleanWater":return!0;case"detergent":return!0;case"dirtyWater":return!1;case"dustBin":return!1;default:return e}}function koe(e,t){const n=xoe(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 woe(e){switch(e){case"cleanWater":return{label:"Clean water",icon:v.jsx(Fb,{className:"h-3.5 w-3.5"})};case"dirtyWater":return{label:"Dirty water",icon:v.jsx(tl,{className:"h-3.5 w-3.5"})};case"detergent":return{label:"Detergent",icon:v.jsx(Ree,{className:"h-3.5 w-3.5"})};case"dustBin":return{label:"Dust bin",icon:v.jsx(cte,{className:"h-3.5 w-3.5"})};default:return e}}function Moe({kind:e,tank:t}){if(t===null)return null;const n=woe(e),a=koe(e,t)==="warning";return t.level!==null?v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:se("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:se("absolute inset-y-0 left-0 rounded-full transition-all",a?"bg-warning":"bg-primary"),style:{width:`${t.level}%`}})}),v.jsxs("span",{className:se("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:se("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:se("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 Coe({cleanWater:e,dirtyWater:t,detergent:n,dustBin:a}){const s=[["cleanWater",e],["dirtyWater",t],["detergent",n],["dustBin",a]];return s.some(([,m])=>m!==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(([m,f])=>v.jsx(Moe,{kind:m,tank:f},m))}):null}function Aoe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=V4(e,t);if(n===void 0)return null;const m=!s,f=a?.state,p=f==="cleaning",h=u=>{m||u===void 0||u({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Pg,{label:"Start",busy:m,active:p,onClick:()=>h(n.start),children:v.jsx(Ro,{className:"h-3 w-3"})}),v.jsx(Pg,{label:"Pause",busy:m,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(Wc,{className:"h-3 w-3"})}),v.jsx(Pg,{label:"Return to base",busy:m,active:f==="returning"||f==="docked",onClick:()=>h(n.returnToBase),children:v.jsx(mp,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(G4,{level:a.batteryLevel})})]})}function oc({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("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 Eoe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=V4(e,t);if(n===void 0)return null;const m=!s,f=a?.state,p=voe(f),h=a?.availableFanSpeeds??[],u=w=>{m||w===void 0||w({})},S=w=>{m||w===""||n.setFanSpeed({speed:w})};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(Soe,{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:se("text-3xl font-semibold",p.tone),children:p.label}),a?.batteryLevel!=null&&v.jsx(G4,{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(Gs,{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(oc,{label:"Start",busy:m,active:f==="cleaning",onClick:()=>u(n.start),children:v.jsx(Ro,{className:"h-5 w-5"})}),v.jsx(oc,{label:"Pause",busy:m,active:f==="paused",onClick:()=>u(n.pause),children:v.jsx(Wc,{className:"h-5 w-5"})}),v.jsx(oc,{label:"Stop",busy:m,active:!1,onClick:()=>u(n.stop),children:v.jsx(Xc,{className:"h-4 w-4"})}),v.jsx(oc,{label:"Return to base",busy:m,active:f==="returning"||f==="docked",onClick:()=>u(n.returnToBase),children:v.jsx(mp,{className:"h-5 w-5"})}),v.jsx(oc,{label:"Locate",busy:m,active:!1,onClick:()=>u(n.locate),children:v.jsx(PI,{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:m,onChange:w=>{S(w.target.value)},onClick:w=>{w.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(w=>v.jsx("option",{value:w,children:w},w))]})]}),v.jsx(Coe,{cleanWater:a?.cleanWater??null,dirtyWater:a?.dirtyWater??null,detergent:a?.detergent??null,dustBin:a?.dustBin??null})]})}function Roe(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 Z4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.lawnMowerControl,slice:n=>n.state.lawnMowerControl})}function _oe(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 Ioe=`
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 Toe({activity:e,batteryLevel:t}){const n=_oe(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,m=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:m?{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:Ioe}),v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:se("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:se(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:se((s||m)&&"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:se(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 Noe(e){switch(e){case"error":return"text-destructive";case"warning":return"text-warning";case"info":return"text-foreground-subtle"}}function Ooe({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 joe({code:e,label:t,severity:n}){return v.jsxs("div",{className:se("inline-flex items-center gap-1 text-xs",Noe(n)),children:[n!=="info"&&v.jsx(Gs,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:t??`Code ${e}`})]})}function K4({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(jm,{className:"h-3.5 w-3.5"}),e,"%"]})}function Dg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("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 Poe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=Z4(e,t);if(n===void 0)return null;const m=!s,f=a?.activity,p=h=>{m||h===void 0||h({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Dg,{label:"Mow",busy:m,active:f==="mowing",onClick:()=>p(n.startMowing),children:v.jsx(Ro,{className:"h-3 w-3"})}),v.jsx(Dg,{label:"Pause",busy:m,active:f==="paused",onClick:()=>p(n.pause),children:v.jsx(Wc,{className:"h-3 w-3"})}),v.jsx(Dg,{label:"Dock",busy:m,active:f==="docked",onClick:()=>p(n.dock),children:v.jsx(mp,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(K4,{level:a.batteryLevel})})]})}function zg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("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 Doe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=Z4(e,t);if(n===void 0)return null;const m=!s,f=a?.activity,p=Roe(f),h=u=>{m||u===void 0||u({})};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(Toe,{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:se("text-3xl font-semibold",p.tone),children:p.label}),a?.batteryLevel!=null&&v.jsx(K4,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsx(Ooe,{percent:a.progressPercent}),a?.currentCode!=null&&v.jsx(joe,{code:a.currentCode,label:a.currentCodeLabel,severity:a.severity}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(zg,{label:"Start mowing",busy:m,active:f==="mowing",onClick:()=>h(n.startMowing),children:v.jsx(Ro,{className:"h-5 w-5"})}),v.jsx(zg,{label:"Pause",busy:m,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(Wc,{className:"h-5 w-5"})}),v.jsx(zg,{label:"Dock",busy:m,active:f==="docked",onClick:()=>h(n.dock),children:v.jsx(mp,{className:"h-5 w-5"})})]})]})]})})}function zoe(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 W4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.valve,slice:n=>n.state.valve})}function Y4(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Lg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("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",Y4(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Loe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=W4(e,t),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0)return null;const h=!m,u=yp(f?.state),S=(w,C)=>{h||!w||(C!==void 0&&p(C),w({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Lg,{label:"Open",busy:h,variant:u.up,onClick:()=>S(a.open,{state:"opening"}),children:v.jsx(dp,{className:"h-3.5 w-3.5"})}),v.jsx(Lg,{label:"Stop",busy:h,variant:u.stop,onClick:()=>S(a.stop,{state:"stopped"}),children:v.jsx(Xc,{className:"h-3 w-3"})}),v.jsx(Lg,{label:"Close",busy:h,variant:u.down,onClick:()=>S(a.close,{state:"closing"}),children:v.jsx(Eo,{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 qoe(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 Boe(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 Uoe({state:e,position:t,interactive:n,onSetPosition:a}){const s=qoe(e),m=t!==null?1-t/100:Boe(e),f=41+m*8,p=-90*(1-m),h=I.useRef(null),u=I.useRef(!1),S=I.useRef(null),w=j=>{const D=t??0,z=h.current;if(z===null)return D;const q=z.getBoundingClientRect();if(q.height<=0)return D;const L=(j-q.top)/q.height,K=Math.round(100-L*100);return Math.min(100,Math.max(0,K))},C=j=>{if(a===void 0)return;const D=w(j);S.current!==D&&(S.current=D,a(D))},E=j=>{n&&(j.stopPropagation(),j.preventDefault(),u.current=!0,S.current=null,j.currentTarget.setPointerCapture(j.pointerId),C(j.clientY))},R=j=>{!n||!u.current||(j.stopPropagation(),C(j.clientY))},T=j=>{!n||!u.current||(j.stopPropagation(),u.current=!1,S.current=null,j.currentTarget.hasPointerCapture(j.pointerId)&&j.currentTarget.releasePointerCapture(j.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?T:void 0,onPointerCancel:n?T:void 0,className:se("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:se("absolute inset-0 transition-colors duration-300",s.glow)}),v.jsx("div",{className:se("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(${p}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 qg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),a()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",Y4(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Foe({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:m,available:f}=W4(e,t),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0)return null;const u=!f,S=(n??[]).includes(aa.ValvePositionable),w=yp(p?.state),C=zoe(p?.state),E=p?.position??null,R=E!==null,T=(D,z)=>{u||!D||(z!==void 0&&h(z),D({}))},j=D=>{u||(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(Uoe,{state:p?.state,position:E,interactive:S&&R,onSetPosition:S&&R?j: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:se("text-3xl font-semibold",C.tone),children:C.label})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(qg,{label:"Open",busy:u,variant:w.up,onClick:()=>T(s.open,{state:"opening"}),children:v.jsx(dp,{className:"h-5 w-5"})}),v.jsx(qg,{label:"Stop",busy:u,variant:w.stop,onClick:()=>T(s.stop,{state:"stopped"}),children:v.jsx(Xc,{className:"h-4 w-4"})}),v.jsx(qg,{label:"Close",busy:u,variant:w.down,onClick:()=>T(s.close,{state:"closing"}),children:v.jsx(Eo,{className:"h-5 w-5"})})]})]})]}),S&&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:u,className:"flex-1",onChange:D=>{j(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!S&&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 Hoe(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 X4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.humidifier,slice:n=>n.state.humidifier})}function $oe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=X4(e,t),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0)return null;const h=!m,u=f?.on??!1,S=()=>{h||(p({on:!u}),a.setOn({on:!u}))};return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":u?"Turn off":"Turn on",title:u?"Turn off":"Turn on",disabled:h,onClick:w=>{w.stopPropagation(),S()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-xs transition-colors",u?"bg-primary text-primary-foreground":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:v.jsx(Yc,{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 Qoe({fillPct:e,tint:t}){const n=82-Math.min(100,Math.max(0,e))/100*56,a=`humidifier-droplet-clip-${I.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:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("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 Voe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=X4(e,t),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!m,u=Hoe(f.on,f.action),S=f.minHumidity??0,w=f.maxHumidity??100,C=f.targetHumidity,E=f.currentHumidity,R=E??C??0,T=()=>{h||(p({on:!f.on}),a.setOn({on:!f.on}))},j=D=>{h||(p({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(Qoe,{fillPct:R,tint:u}),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(),T()},className:se("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(Yc,{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:S,max:w,step:1,value:C??S,disabled:h,className:"flex-1",onChange:D=>{j(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 z=f.availableModes.find(q=>q===D.target.value);!h&&z!==void 0&&(p({mode:z}),a.setMode({mode:z}))},className:se("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 Goe(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 Zoe(e,t,n){return e===null||e==="off"?"off":t!==null&&n!==null&&t<n?"heating":"idle"}function J4(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.waterHeater,slice:n=>n.state.waterHeater})}function Koe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s}=J4(e,t),{display:m}=It(s,{enabled:n??!0});return a===void 0||m===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:[m.currentTemp!==null&&v.jsxs(v.Fragment,{children:[m.currentTemp,"°",v.jsx("span",{className:"mx-0.5",children:"→"})]}),m.targetTemp!==null?`${m.targetTemp}°`:"—"]}),m.operationMode!==null&&v.jsxs("span",{className:"capitalize text-foreground-subtle/80",children:["· ",m.operationMode.replace(/_/g," ")]})]})}function Woe({fillPct:e,tint:t}){const n=86-Math.min(100,Math.max(0,e))/100*68,a=`water-heater-tank-clip-${I.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:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("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 Yoe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=J4(e,t),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!m,u=Zoe(f.operationMode,f.currentTemp,f.targetTemp),S=Goe(u),w=f.currentTemp,C=f.targetTemp,E=f.minTemp,R=f.maxTemp,T=w!==null&&C!==null&&C>0?Math.min(100,w/C*100):w!==null&&R!==null&&R>0?Math.min(100,w/R*100):50,j=q=>{let L=q;return E!==null&&(L=Math.max(E,L)),R!==null&&(L=Math.min(R,L)),L},D=q=>{if(h||C===null)return;const L=j(C+q);p({targetTemp:L}),a.setTargetTemp({temp:L})},z=()=>{h||f.away===null||(p({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(Woe,{fillPct:T,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:w!==null?w:"—"}),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:["· ",u]})]}),C!==null&&v.jsx("div",{className:"w-[180px]",children:v.jsx(T4,{value:C,unit:"°",onDelta:D})})]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Operation mode",value:f.operationMode??"",disabled:h,onChange:q=>{q.stopPropagation();const L=f.availableModes.find(K=>K===q.target.value);!h&&L!==void 0&&(p({operationMode:L}),a.setOperationMode({mode:L}))},className:se("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(q=>v.jsx("option",{value:q,children:q},q))}),f.away!==null&&v.jsxs("button",{type:"button","aria-label":f.away?"Disable away mode":"Enable away mode",disabled:h,onClick:q=>{q.stopPropagation(),z()},className:se("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(Yc,{className:"h-4 w-4"}),"Away ",f.away?"on":"off"]})]})}function eN(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 tN(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 Xoe(e){const t="h-4 w-4";switch(e){case"sun":return v.jsx(FI,{className:t});case"clear-night":return v.jsx($b,{className:t});case"partly-cloudy":return v.jsx(II,{className:t});case"cloudy":return v.jsx(kee,{className:t});case"rain":return v.jsx(_I,{className:t});case"snow":return v.jsx(_M,{className:t});case"lightning":return v.jsx(xee,{className:t});case"fog":return v.jsx(See,{className:t});case"wind":return v.jsx(zi,{className:t});case"hail":return v.jsx(_M,{className:t});default:return null}}function nN(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.weather,slice:n=>n.state.weather})}function Joe(e,t){return e===null?"—":`${Math.round(e)}${t??"°"}`}function ese({trpc:e,deviceId:t}){const{slice:n}=nN(e,t);if(n===void 0)return null;const a=eN(n.condition);return v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsx("span",{className:se("inline-flex",tN(n.condition).accent),title:a.label,"aria-label":a.label,children:Xoe(a.glyph)}),v.jsx("span",{className:"tabular-nums",children:Joe(n.temperature,n.temperatureUnit)})]})}function tse({glyph:e,tint:t}){const n=I.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:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("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:nse(e,n)})})]})}function so({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 nse(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(so,{cx:58,cy:60})]});case"cloudy":return v.jsxs("g",{children:[v.jsx(so,{cx:40,cy:44,scale:.9}),v.jsx(so,{cx:62,cy:58})]});case"rain":return v.jsxs("g",{children:[v.jsx(so,{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(so,{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(so,{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(so,{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 Bg({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 ase({trpc:e,deviceId:t}){const{slice:n}=nN(e,t);if(n===void 0)return null;const a=eN(n.condition),s=tN(n.condition),m=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(tse,{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:m}),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(Bg,{icon:v.jsx(tl,{className:"h-3.5 w-3.5"}),label:"Humidity",value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&v.jsx(Bg,{icon:n.windBearing!==null?v.jsx(Uee,{className:"h-3.5 w-3.5",style:{transform:`rotate(${n.windBearing}deg)`}}):v.jsx(zi,{className:"h-3.5 w-3.5"}),label:"Wind",value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??""}`.trim()}),n.pressure!==null&&v.jsx(Bg,{icon:v.jsx(om,{className:"h-3.5 w-3.5"}),label:"Pressure",value:`${Math.round(n.pressure)} ${n.pressureUnit??""}`.trim()})]})]})]})})}function aN(e,t){return ut({trpc:e,deviceId:t,cap:n=>n.image,slice:n=>n.state.image})}var rC=1,oC=6,sC=.5;function iN({url:e,alt:t,open:n,onOpenChange:a}){const[s,m]=I.useState(1);I.useEffect(()=>{n&&m(1)},[n,e]);const f=I.useCallback(()=>m(u=>Math.min(oC,u+sC)),[]),p=I.useCallback(()=>m(u=>Math.max(rC,u-sC)),[]),h=I.useCallback(()=>m(1),[]);return v.jsx(f4,{open:n,onOpenChange:a,children:v.jsxs(a0,{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(zd,{label:"Zoom out",disabled:s<=rC,onClick:p,children:v.jsx(Ste,{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(zd,{label:"Zoom in",disabled:s>=oC,onClick:f,children:v.jsx(bte,{className:"h-4 w-4"})}),v.jsx(zd,{label:"Reset zoom",disabled:s===1,onClick:h,children:v.jsx(Zee,{className:"h-4 w-4"})}),v.jsx(zd,{label:"Close",onClick:()=>a(!1),children:v.jsx(yte,{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 zd({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 ise({trpc:e,deviceId:t}){const{slice:n}=aN(e,t),[a,s]=I.useState(!1);if(n===void 0)return null;const m=n.url;return m===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(jI,{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:m,alt:"Image",className:"h-7 w-7 rounded object-cover"})}),v.jsx(iN,{url:m,alt:"Image",open:a,onOpenChange:s})]})}function rse({trpc:e,deviceId:t,deviceName:n}){const{slice:a}=aN(e,t),[s,m]=I.useState(!1),[f,p]=I.useState(!1),h=a?.url??null;return I.useEffect(()=>{m(!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:()=>p(!0),className:"flex w-full cursor-zoom-in items-center justify-center",children:v.jsx("img",{src:a.url,alt:n??"Image",onError:()=>m(!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(jI,{className:"h-8 w-8","aria-hidden":"true"}),v.jsx("span",{className:"text-xs",children:"No image"})]})}),h!==null&&!s&&v.jsx(iN,{url:h,alt:n??"Image",open:f,onOpenChange:p})]})}var Ld=20,lC=9,rN="#f59e0b",oN="#ef4444";function Sc(e){return Math.min(jb,Math.max(g_,e))}var ose=`
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 sN({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:L=>L.petFeeder,slice:L=>L.state.petFeeder}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0}),[u,S]=I.useState(Ld),[w,C]=I.useState(Ld),[E,R]=I.useState(Ld);if(s===void 0||p===void 0)return null;const T=!f,j=p.error&&p.error!=="no_error"?p.error:null,D=p.status==="offline",z=p.status==="on_batteries";if(n==="compact")return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[(j!==null||D)&&v.jsx("span",{className:"inline-flex items-center text-destructive",title:j??"Offline","aria-label":j??"Offline",children:D?v.jsx(NM,{className:"h-3.5 w-3.5","aria-hidden":!0}):v.jsx(Gs,{className:"h-3.5 w-3.5","aria-hidden":!0})}),v.jsxs("span",{className:se("inline-flex items-center gap-1 text-xs tabular-nums font-medium",p.lowFood?"text-destructive":"text-foreground"),children:[v.jsx(TM,{className:"h-3.5 w-3.5","aria-hidden":!0}),p.foodLevel??"—",v.jsx("span",{className:"text-foreground-subtle",children:"g"})]}),p.batteryPower!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 text-xs tabular-nums text-foreground-subtle",children:[v.jsx(jm,{className:"h-3.5 w-3.5","aria-hidden":!0}),p.batteryPower,"%"]}),v.jsxs("button",{type:"button","aria-label":"Feed now",disabled:T||p.feeding,onClick:L=>{L.stopPropagation(),!(T||p.feeding)&&(h({feeding:!0}),s.feed({grams:Ld}))},className:se("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",(T||p.feeding)&&"opacity-40 cursor-not-allowed"),children:[v.jsx(ha,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feed"]})]});const q=L=>{T||p.feeding||(h({feeding:!0}),s.feed({grams:Sc(L)}))};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:ose}),v.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3",children:[v.jsx(sse,{grams:p.foodLevel,low:p.lowFood,eating:p.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:p.lowFood?oN:rN},children:p.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:[p.batteryPower!==null&&v.jsx(uC,{icon:v.jsx(jm,{className:"h-3.5 w-3.5"}),label:`${p.batteryPower}%`}),p.desiccantLeftDays!==null&&v.jsx(uC,{icon:v.jsx(zi,{className:"h-3.5 w-3.5"}),label:`${p.desiccantLeftDays}d desiccant`}),z&&v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-amber-500",children:[v.jsx(dee,{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(NM,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Offline"]}):p.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(ha,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feeding…"]}):p.lowFood?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(ly,{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(yee,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Ready"]})]})]})]}),j!==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(Gs,{className:"mt-px h-4 w-4 shrink-0","aria-hidden":!0}),v.jsx("span",{className:"min-w-0 break-words",children:j})]}),p.isDualHopper?v.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[v.jsx(Ug,{label:"Hopper 1",grams:w,busy:T||p.feeding,onGrams:C,onFeed:()=>{T||p.feeding||(h({feeding:!0}),s.feed({hopper1:Sc(w)}))}}),v.jsx(Ug,{label:"Hopper 2",grams:E,busy:T||p.feeding,onGrams:R,onFeed:()=>{T||p.feeding||(h({feeding:!0}),s.feed({hopper2:Sc(E)}))}})]}):v.jsx(Ug,{label:"Manual feed",grams:u,busy:T||p.feeding,onGrams:S,onFeed:()=>q(u)}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(Fg,{icon:v.jsx(ha,{className:"h-4 w-4"}),label:"Call pet",busy:T,onClick:()=>{s.callPet({})}}),v.jsx(Fg,{icon:v.jsx(Qb,{className:"h-4 w-4"}),label:"Reset desiccant",busy:T,onClick:()=>{s.resetDesiccant({})}}),v.jsx(Fg,{icon:v.jsx(TM,{className:"h-4 w-4"}),label:"Mark refilled",busy:T,onClick:()=>{s.markFoodReplenished({})}})]}),p.feeding&&v.jsxs("button",{type:"button",disabled:T,onClick:()=>{h({feeding:!1}),s.cancelFeed({})},className:se("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",T&&"opacity-40 cursor-not-allowed"),children:[v.jsx(ly,{className:"h-4 w-4","aria-hidden":!0}),"Cancel feed"]}),v.jsx(cC,{label:"Settings",children:v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(Hg,{icon:v.jsx(Kc,{className:"h-4 w-4"}),label:"Child lock",on:p.childLock,busy:T,onToggle:L=>{h({childLock:L}),s.setChildLock({on:L})}}),v.jsx(Hg,{icon:v.jsx(pp,{className:"h-4 w-4"}),label:"Light",on:p.indicatorLight,busy:T,onToggle:L=>{h({indicatorLight:L}),s.setIndicatorLight({on:L})}}),v.jsx(Hg,{icon:v.jsx(Pm,{className:"h-4 w-4"}),label:"Feed sound",on:p.feedSound,busy:T,onToggle:L=>{h({feedSound:L}),s.setFeedSound({on:L})}})]})}),v.jsx(cC,{label:"Volume",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Jc,{className:"h-4 w-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),v.jsx(Hm,{label:"Decrease volume",symbol:"−",disabled:T||p.volume<=0,onClick:()=>{const L=Math.max(0,p.volume-1);h({volume:L}),s.setVolume({level:L})}}),v.jsx("span",{className:"w-6 text-center text-lg font-semibold tabular-nums text-foreground",children:p.volume}),v.jsx(Hm,{label:"Increase volume",symbol:"+",disabled:T||p.volume>=lC,onClick:()=>{const L=Math.min(lC,p.volume+1);h({volume:L}),s.setVolume({level:L})}})]})})]})}function cC({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 uC({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 sse({grams:e,low:t,eating:n}){const a=Math.min(1,Math.max(0,(e??0)/jb)),s=t?oN:rN,m=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:m,width:"44",height:"34",fill:s,opacity:.9}),v.jsx("ellipse",{cx:"36",cy:m,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 Ug({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(Hm,{label:`Decrease ${e} portion`,symbol:"−",disabled:n||t<=g_,onClick:()=>a(Sc(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(Hm,{label:`Increase ${e} portion`,symbol:"+",disabled:n||t>=jb,onClick:()=>a(Sc(t+1))})]}),v.jsxs("button",{type:"button",disabled:n,onClick:s,className:se("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(ha,{className:"h-4 w-4","aria-hidden":!0}),"Feed"]})]})]})}function Hm({label:e,symbol:t,disabled:n,onClick:a}){return v.jsx("button",{type:"button","aria-label":e,disabled:n,onClick:a,className:se("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 Fg({icon:e,label:t,busy:n,onClick:a}){return v.jsxs("button",{type:"button",disabled:n,onClick:a,className:se("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 Hg({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:se("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 lse({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(sN,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})}function cse({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(sN,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}var $g={cool:"Cool",heat:"Heat",auto:"Auto",heat_cool:"Heat·Cool",fan_only:"Fan",dry:"Dry",off:"Off"},use={cool:BI,heat:zm,auto:UI,heat_cool:hp,fan_only:Dm,dry:tl,off:Yc},dse={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#a1a1aa"},mse=16,pse=30;function dC(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}function fse(e){switch(e){case"turbo":return kr;case"quiet":return Aee;case"sleep":return $b;case"eco":return Oee;case"8c_heat":return BI;case"none":return ly;default:return UI}}function hse(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 gse=`
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 lN({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:z=>z.climateControl,slice:z=>z.state.climateControl}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0||p===void 0)return null;const u=!f;if(n==="compact")return v.jsxs("div",{"data-mode":p.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",O4[p.mode]),children:p.target!==null?v.jsxs(v.Fragment,{children:[p.target,"°",p.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",p.currentTemp,"°)"]})]}):p.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[p.currentTemp,"°"]}):null}),p.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:u,onClick:z=>{if(z.stopPropagation(),!u&&p.target!==null){const q=p.target-1;h({target:q}),s.setTarget({target:q})}},className:se("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",u&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:u,onClick:z=>{if(z.stopPropagation(),!u&&p.target!==null){const q=p.target+1;h({target:q}),s.setTarget({target:q})}},className:se("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",u&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:p.mode,disabled:u,onChange:z=>{z.stopPropagation();const q=p.availableModes.find(L=>L===z.target.value);!u&&q&&(h({mode:q}),s.setMode({mode:q}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",u&&"opacity-40 cursor-not-allowed"),children:p.availableModes.map(z=>v.jsx("option",{value:z,children:$g[z]},z))})]});const S=dse[p.mode],w=p.mode!=="off",C=fse(p.preset),E=p.preset==="turbo",R=Math.max(.55,hse(p.fanMode)*(E?.6:1)),T=p.swingVertical!==null,j=p.swingHorizontal!==null,D=w&&(p.swingVertical===!0||p.swingHorizontal===!0);return v.jsxs("div",{"data-mode":p.mode,className:se("relative flex flex-col items-stretch gap-2.5 overflow-hidden rounded-lg border p-3 transition-colors",o0[p.mode]),children:[v.jsx("style",{children:gse}),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(bse,{mode:p.mode,accent:S,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"}),w&&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:S,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:S},children:[v.jsx(mC,{mode:p.mode,className:"h-3.5 w-3.5"}),$g[p.mode],p.currentTemp!==null&&v.jsxs("span",{className:"normal-case text-foreground-subtle",children:["· ",p.currentTemp,"° now"]}),p.currentHumidity!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 normal-case text-foreground-subtle",children:[v.jsx(tl,{className:"h-3 w-3"}),p.currentHumidity,"%"]})]}),p.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:u,onClick:()=>{if(u||p.target===null)return;const z=p.target-1;h({target:z}),s.setTarget({target:z})}}),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:S},children:p.target}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]}),v.jsx(pC,{label:"Increase target",symbol:"+",disabled:u,onClick:()=>{if(u||p.target===null)return;const z=p.target+1;h({target:z}),s.setTarget({target:z})}})]}),v.jsx("div",{className:"relative z-10 w-36",children:v.jsx(yse,{value:p.target,min:mse,max:pse,accent:S})})]}):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:p.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(Qg,{label:"Mode",icon:v.jsx("span",{style:{color:S},className:"flex",children:v.jsx(mC,{mode:p.mode,className:"h-4 w-4"})}),value:p.mode,options:p.availableModes.map(z=>({value:z,label:$g[z]})),disabled:u,onChange:z=>{const q=p.availableModes.find(L=>L===z);q&&(h({mode:q}),s.setMode({mode:q}))}}),p.availableFanModes.length>0&&v.jsx(Qg,{label:"Fan",icon:v.jsx(zi,{className:"h-4 w-4 text-sky-500"}),value:p.fanMode,options:p.availableFanModes.map(z=>({value:z,label:dC(z)})),disabled:u,onChange:z=>{h({fanMode:z}),s.setFanMode({fanMode:z})}}),p.availablePresets.length>0&&v.jsx(Qg,{label:"Preset",icon:v.jsx(C,{className:"h-4 w-4 text-emerald-500"}),value:p.preset,options:p.availablePresets.map(z=>({value:z,label:dC(z)})),disabled:u,onChange:z=>{h({preset:z}),s.setPreset({preset:z})}})]}),(T||j)&&v.jsx(vse,{label:"Swing",children:v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[T&&v.jsx(fC,{axis:"vertical",on:p.swingVertical??!1,busy:u,onToggle:z=>{h({swingVertical:z}),s.setSwingVertical({on:z})}}),j&&v.jsx(fC,{axis:"horizontal",on:p.swingHorizontal??!1,busy:u,onToggle:z=>{h({swingHorizontal:z}),s.setSwingHorizontal({on:z})}})]})})]})}function vse({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 mC({mode:e,className:t}){const n=use[e];return v.jsx(n,{className:t,"aria-hidden":!0})}function Qg({label:e,icon:t,value:n,options:a,disabled:s,onChange:m}){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:se("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||m(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(Eo,{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:se("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 yse({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 bse({mode:e,accent:t,periodSec:n,swaying:a}){const s=[0,1,2,3,4,5],m=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(p=>v.jsx("span",{className:"h-8 w-1 rounded-full bg-foreground-subtle opacity-40"},p))}):e==="fan_only"?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx(Sse,{color:t,periodSec:Math.max(.5,n*.7),size:56})}):v.jsx("div",{className:se("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(p=>v.jsx("span",{className:"acv-streak absolute rounded-full",style:{left:`${8+p*15}%`,width:f?"0.4rem":"0.3rem",height:f?"0.4rem":"1.9rem",background:t,boxShadow:`0 0 6px ${t}`,animationName:m?"acv-rise":"acv-fall",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${n}s`,animationDelay:`${p%3*(n/3)+p*.05}s`}},p))})})}function Sse({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 fC({axis:e,on:t,busy:n,onToggle:a}){const s=e==="vertical"?"Vertical":"Horizontal",m=e==="vertical"?Bee:qee,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:se("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(m,{className:"acv-swing h-4 w-4","aria-hidden":!0,style:t?{animation:`${f} 1.4s ease-in-out infinite`}:void 0}),s]})}var xse=5,kse=35;function Vg(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function Gg(e,t,n){return Math.round(t+e*(n-t))}var Oi=176,$m=76,vm=2*Math.PI*$m,sc=vm*(270/360),Zg=Oi/2-$m-10;function hC(e){const t=Oi/2,n=Oi/2,a=vm-sc,s=e.mode==="band"?(()=>{const m=e.band.from*sc,f=Math.max(0,(e.band.to-e.band.from)*sc);return{dasharray:`${f} ${vm-f}`,dashoffset:-m}})():(()=>{const m=e.fraction*sc;return{dasharray:`${m} ${vm-m}`,dashoffset:void 0}})();return v.jsxs("svg",{width:Oi,height:Oi,viewBox:`0 0 ${Oi} ${Oi}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:t,cy:n,r:$m,fill:"none",stroke:"var(--color-border)",strokeWidth:12,strokeDasharray:`${sc} ${a}`,strokeLinecap:"round"}),v.jsx("circle",{cx:t,cy:n,r:$m,fill:"none",stroke:e.color,strokeWidth:12,strokeDasharray:s.dasharray,...s.dashoffset!==void 0?{strokeDashoffset:s.dashoffset}:{},strokeLinecap:"round"})]})}var wse={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#d4d4d8"};function Mse({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:D=>D.climateControl,slice:D=>D.state.climateControl}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0||p===void 0)return null;const u=!f,S=wse[p.mode],w=p.mode==="heat_cool"||p.targetLow!==null&&p.targetHigh!==null,C=xse,E=kse,R=!w&&p.target!==null?Vg(p.target,C,E):0,T=w&&p.targetLow!==null?Vg(p.targetLow,C,E):0,j=w&&p.targetHigh!==null?Vg(p.targetHigh,C,E):0;return v.jsxs("div",{"data-mode":p.mode,className:se("flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4 transition-colors",o0[p.mode]),children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs("div",{className:"relative",style:{width:Oi,height:Oi},children:[w?v.jsx(hC,{mode:"band",band:{from:T,to:j},color:S}):v.jsx(hC,{mode:"fill",fraction:R,color:S}),w?v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(hm,{fraction:T,color:S,knobTopPx:Zg,onDragFraction:D=>{if(u||p.targetHigh===null)return;const z=Math.min(Gg(D,C,E),p.targetHigh);h({targetLow:z}),s.setTargetRange({targetLow:z,targetHigh:p.targetHigh})}})}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(hm,{fraction:j,color:S,knobTopPx:Zg,onDragFraction:D=>{if(u||p.targetLow===null)return;const z=Math.max(Gg(D,C,E),p.targetLow);h({targetHigh:z}),s.setTargetRange({targetLow:p.targetLow,targetHigh:z})}})})]}):v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(hm,{fraction:R,color:S,knobTopPx:Zg,onDragFraction:D=>{if(u)return;const z=Gg(D,C,E);h({target:z}),s.setTarget({target:z})}})}),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:[p.currentTemp!==null?p.currentTemp:"—",v.jsx("span",{className:"text-lg text-foreground-subtle font-normal ml-0.5",children:"°"})]}),!w&&p.target!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:S},children:["set ",p.target,"°"]}),w&&p.targetLow!==null&&p.targetHigh!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:S},children:[p.targetLow,"° – ",p.targetHigh,"°"]})]})]}),!w&&p.target!==null&&v.jsx("div",{className:"w-[200px]",children:v.jsx(T4,{value:`${p.target}°`,onDelta:D=>{if(u||p.target===null)return;const z=p.target+D;h({target:z}),s.setTarget({target:z})}})})]}),v.jsx("select",{"aria-label":"Mode",value:p.mode,disabled:u,onChange:D=>{D.stopPropagation();const z=D.target.value;!u&&z&&(h({mode:p.availableModes.find(q=>q===z)??p.mode}),s.setMode({mode:p.availableModes.find(q=>q===z)??p.mode}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",u&&"opacity-40 cursor-not-allowed"),children:p.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function Cse(e){return e==="locked"||e==="locking"}function cN(e){return e==="jammed"}var Ase={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 Ese({state:e}){const t=Ase[e];return v.jsx("div",{"data-testid":"lock-glyph","data-state":e,className:se("flex h-16 w-16 items-center justify-center rounded-full border-2",t.colorClass),children:t.icon==="locked"?v.jsx(Kc,{className:"h-8 w-8","aria-hidden":"true"}):v.jsx(cy,{className:"h-8 w-8","aria-hidden":"true"})})}function Rse({state:e}){return v.jsx("span",{className:se("text-sm font-medium capitalize",cN(e)?"text-danger":"text-foreground-muted"),children:e})}function _se({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:se("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(Vs,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Open"]})}function Ise({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:T=>T.lockControl,slice:T=>T.state.lockControl}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0||p===void 0)return null;const u=Cse(p.state),S=cN(p.state)||!f,w=n?.includes(aa.LockOpen)===!0,C=()=>{S||(u?(h({state:"unlocking"}),s.unlock({})):(h({state:"locking"}),s.lock({})))},E=()=>{S||s.open({})},R=u?"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(Ese,{state:p.state}),v.jsx(Rse,{state:p.state})]}),v.jsx("div",{className:se(S&&"pointer-events-none opacity-40"),children:v.jsx(hre,{on:u,targetLabel:R,onConfirm:C})}),w&&v.jsx("div",{className:"flex justify-center",children:v.jsx(_se,{busy:S,onOpen:E})})]})}var Iy=500,uN=150,Tse="linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)";function Nse(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function Ose(e){return Nse(e,uN,Iy)}var jse="#f4b740",Pse="#d4d4d8";function Dse({trpc:e,deviceId:t,features:n,optimistic:a}){const s=ut({trpc:e,deviceId:t,cap:L=>L.switch,slice:L=>L.state.switch}),m=ut({trpc:e,deviceId:t,cap:L=>L.brightness,slice:L=>L.state.brightness}),f=ut({trpc:e,deviceId:t,cap:L=>L.color,slice:L=>L.state.color}),p=It(s.slice,{enabled:a??!0}),h=It(m.slice,{enabled:a??!0}),u=It(f.slice,{enabled:a??!0});if(s.cap===void 0||p.display===void 0)return null;const S=p.display.on===!0,w=!s.available,C=h.display?.percentage??0,E=!m.available,R=S?C/100:0,T=S?jse:Pse,j=(n?.includes(aa.LightColorMired)??!1)&&f.cap!==void 0,D=u.display?.mireds,z=!f.available,q=()=>{if(w)return;const L=!S;p.applyOptimistic({on:L}),s.cap?.setState({on: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 flex-col items-center gap-3",children:[v.jsxs(N4,{fraction:R,color:T,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(pp,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}),m.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||!S,onChange:L=>{const K=Number(L.target.value);h.applyOptimistic({percentage:K}),E||m.cap?.setBrightness({percentage:K})}}),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:S?"On":"Off"}),v.jsx(i0,{on:S,busy:w,onToggle:q})]}),j&&v.jsxs("div",{className:"flex items-center gap-2","data-testid":"color-temp-strip",children:[v.jsx(hp,{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:uN,max:Iy,step:1,className:"w-full",value:D??Iy,disabled:z||!S,onChange:L=>{const K=Number(L.target.value);u.applyOptimistic({mode:"mired",mireds:K}),z||f.cap?.setColor({color:{mode:"mired",mireds:K}})}}),v.jsx("div",{className:"pointer-events-none mt-1",children:v.jsx(Ry,{fraction:D!==void 0?Ose(D):.5,color:Tse})})]})]})]})}var zse="#3aa6a0",Lse="#d4d4d8";function qse({trpc:e,deviceId:t,features:n,optimistic:a}){const s=ut({trpc:e,deviceId:t,cap:F=>F.switch,slice:F=>F.state.switch}),m=ut({trpc:e,deviceId:t,cap:F=>F.fanControl,slice:F=>F.state.fanControl}),f=It(s.slice,{enabled:a??!0}),p=It(m.slice,{enabled:a??!0});if(s.cap===void 0||f.display===void 0)return null;const h=f.display.on===!0,u=!s.available,S=p.display?.percentage??0,w=!m.available,C=h?S/100:0,E=h?zse:Lse,R=n?.includes(aa.FanSpeed)??!1,T=(n?.includes(aa.FanOscillating)??!1)&&m.cap!==void 0,j=p.display?.availablePresets??[],D=(n?.includes(aa.FanPreset)??!1)&&m.cap!==void 0&&j.length>0,z=p.display?.preset??"",q=p.display?.oscillating===!0,L=()=>{if(u)return;const F=!h;f.applyOptimistic({on:F}),s.cap?.setState({on:F})},K=()=>{if(w)return;const F=!q;p.applyOptimistic({oscillating:F}),m.cap?.setOscillating({oscillating:F})},J=F=>{if(w)return;const ue=p.display;if(ue===void 0)return;const we=ue.percentageStep!==void 0&&ue.percentageStep>0?ue.percentageStep:1,Ee=Math.min(100,Math.max(0,Math.round(F*100/we)*we));p.applyOptimistic({percentage:Ee}),m.cap?.setPercentage({percentage:Ee})},$=F=>{w||F===""||(p.applyOptimistic({preset:F}),m.cap?.setPreset({preset:F}))};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(N4,{fraction:C,color:E,onDragFraction:J,children:[v.jsxs("div",{"data-testid":"speed-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[S,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(Dm,{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(Dm,{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:z,disabled:w,onChange:F=>{F.stopPropagation(),$(F.target.value)},className:se("bg-surface border border-border rounded px-1 py-0.5",w&&"opacity-40 cursor-not-allowed"),children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),j.map(F=>v.jsx("option",{value:F,children:F},F))]})]})}),v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[T?v.jsxs("button",{type:"button","aria-label":"Oscillate","aria-pressed":q,disabled:w,onClick:F=>{F.stopPropagation(),K()},className:se("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors",q?"border-success/50 bg-success/10 text-success":"border-border text-foreground-muted hover:bg-surface-hover",w&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Qb,{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(i0,{on:h,busy:u,onToggle:L})]})]})}function Bse({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:w=>w.switch,slice:w=>w.state.switch}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=f.on===!0,u=!m,S=()=>{if(u)return;const w=!h;p({on:w}),a.setState({on:w})};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:se("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(Yc,{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(i0,{on:h,busy:u,onToggle:S})]})}function Use(e){return e==="playing"||e==="buffering"?"pause":"play"}function Fse(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function gC(e){if(e===null)return"--:--";const t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function Hse({title:e,subtitle:t}){return v.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v.jsx(LI,{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 Kg({label:e,busy:t,onPress:n,children:a,primary:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:m=>{m.stopPropagation(),t||n()},className:se("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 $se({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:m,available:f}=ut({trpc:e,deviceId:t,cap:q=>q.mediaPlayer,slice:q=>q.state.mediaPlayer}),{display:p,applyOptimistic:h}=It(m,{enabled:a??!0});if(s===void 0||p===void 0)return null;const u=!f,S=Use(p.state),w=(n?.includes(aa.MediaPlayerSeek)??!1)&&p.durationMs!==null&&p.durationMs>0,C=n?.includes(aa.MediaPlayerNext)??!1,E=n?.includes(aa.MediaPlayerPrevious)??!1,R=(n?.includes(aa.MediaPlayerVolume)??!1)&&p.volumeLevel!==null,T=()=>{u||(S==="play"?(h({state:"playing"}),s.play({})):(h({state:"paused"}),s.pause({})))},j=p.currentMedia?.artist??p.currentMedia?.album??null,D=Fse(p.positionMs,p.durationMs),z=p.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(Hse,{title:p.currentMedia?.title??null,subtitle:j}),w&&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:p.durationMs??0,step:1e3,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:p.positionMs??0,disabled:u,onChange:q=>{if(u)return;const L=Number(q.target.value);h({positionMs:L}),s.seek({positionMs:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Ry,{fraction:D})})]}),v.jsxs("div",{className:"flex justify-between text-[11px] tabular-nums text-foreground-subtle",children:[v.jsx("span",{children:gC(p.positionMs)}),v.jsx("span",{children:gC(p.durationMs)})]})]}),v.jsxs("div",{className:"flex items-center justify-center gap-4",children:[E&&v.jsx(Kg,{label:"Previous",busy:u,onPress:()=>{s.previous({})},children:v.jsx(ete,{className:"h-5 w-5","aria-hidden":"true"})}),v.jsx(Kg,{label:S==="play"?"Play":"Pause",busy:u,onPress:T,primary:!0,children:S==="play"?v.jsx(Ro,{className:"h-6 w-6","aria-hidden":"true"}):v.jsx(Wc,{className:"h-6 w-6","aria-hidden":"true"})}),C&&v.jsx(Kg,{label:"Next",busy:u,onPress:()=>{s.next({})},children:v.jsx(tte,{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":p.isMuted===!0?"Unmute":"Mute",title:p.isMuted===!0?"Unmute":"Mute",disabled:u,onClick:q=>{if(q.stopPropagation(),u||p.isMuted===null)return;const L=!p.isMuted;h({isMuted:L}),s.setMute({muted:L})},className:se("inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",u&&"opacity-40 cursor-not-allowed"),children:p.isMuted===!0?v.jsx(QI,{className:"h-4 w-4","aria-hidden":"true"}):v.jsx(Jc,{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:z,disabled:u,onChange:q=>{if(u)return;const L=Number(q.target.value);h({volumeLevel:L}),s.setVolume({volumeLevel:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Ry,{fraction:z/100})})]}),v.jsxs("span",{className:"w-9 text-right text-[11px] tabular-nums text-foreground-subtle",children:[z,"%"]})]})]})}var dN={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"}},mN={home:"Home",away:"Away",night:"Night",vacation:"Vacation",custom_bypass:"Bypass"};function pN(e){return e.startsWith("armed_")}function l0(e){return e==="arming"||e==="disarming"}function fN({icon:e,sizeClass:t="h-8 w-8"}){return e==="disarmed"?v.jsx(Xee,{className:t,"aria-hidden":"true"}):e==="triggered"?v.jsx(fp,{className:t,"aria-hidden":"true"}):e==="pending"?v.jsx(Jee,{className:t,"aria-hidden":"true"}):v.jsx(Yee,{className:t,"aria-hidden":"true"})}function vC({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:se("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 Qse({state:e,availableModes:t,busy:n,onDisarm:a,onArm:s}){const m=pN(e),f=l0(e);return v.jsxs("div",{className:se("flex min-w-0 items-stretch gap-1 rounded-lg border border-border bg-surface-subtle p-1"),children:[v.jsx(vC,{label:"Disarm",active:!m&&!f,busy:n,onSelect:a}),t.map(p=>v.jsx(vC,{label:mN[p],active:!f&&e===`armed_${p}`,busy:n,onSelect:()=>s(p)},p))]})}function hN(e,t,n){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:w=>w.alarmPanel,slice:w=>w.state.alarmPanel}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0}),h=!m;return{display:f,capPresent:a!==void 0,busy:h,handleDisarm:()=>{a===void 0||h||(p({state:"disarming"}),a.disarm({}))},handleArm:w=>{a===void 0||h||(p({state:"arming"}),a.arm({mode:w}))}}}function Vse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,handleDisarm:f,handleArm:p}=hN(e,t,n);if(!s||a===void 0)return null;const h=dN[a.state],u=pN(a.state)?a.state.replace("armed_",""):"";return v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsxs("span",{className:se("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,l0(a.state)&&"animate-pulse"),children:[v.jsx(fN,{icon:h.icon,sizeClass:"h-3 w-3"}),h.label]}),v.jsxs("select",{"aria-label":"Alarm mode",disabled:m,value:u,onClick:S=>S.stopPropagation(),onChange:S=>{S.stopPropagation();const w=S.target.value;w===""?f():p(w)},className:se("min-w-0 shrink rounded-md border border-border bg-surface-subtle px-1.5 py-0.5 text-xs text-foreground-muted",m&&"cursor-not-allowed opacity-40"),children:[v.jsx("option",{value:"",children:"Disarm"}),a.availableModes.map(S=>v.jsx("option",{value:S,children:mN[S]},S))]})]})}function Gse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,handleDisarm:f,handleArm:p}=hN(e,t,n);if(!s||a===void 0)return null;const h=dN[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:se("flex h-16 w-16 items-center justify-center rounded-full border-2",h.colorClass,l0(a.state)&&"animate-pulse"),children:v.jsx(fN,{icon:h.icon})}),v.jsx("span",{className:se("text-sm font-medium",h.colorClass,"border-0 bg-transparent"),children:h.label})]}),v.jsx(Qse,{state:a.state,availableModes:a.availableModes,busy:m,onDisarm:f,onArm:p})]})}function Zse(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 c0({atMs:e,neverLabel:t}){const n=Zse(e,Date.now());return v.jsx("span",{className:"text-xs text-foreground-subtle","data-testid":"last-run",children:n===null?t:n})}function gN({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(Gs,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),v.jsx("span",{className:"truncate",children:e})]})}function vN(e,t,n){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:S=>S.scriptRunner,slice:S=>S.state.scriptRunner}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0}),h=!m,u=f?.isRunning===!0;return{display:f,capPresent:a!==void 0,busy:h,running:u,run:()=>{a===void 0||h||u||(p({isRunning:!0}),a.run({}))},stop:()=>{a===void 0||h||!u||(p({isRunning:!1}),a.stop({}))}}}function yN({running:e,busy:t,large:n,onRun:a,onStop:s}){const m=e?"Stop":"Run";return v.jsxs("button",{type:"button","aria-label":m,title:m,disabled:t,"data-testid":"script-run","data-running":e?"true":"false",onClick:f=>{f.stopPropagation(),e?s():a()},className:se("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(bee,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}):v.jsx(Ro,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:m})]})}function Kse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,running:f,run:p,stop:h}=vN(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(yN,{running:f,busy:m,large:!1,onRun:p,onStop:h}),v.jsx(c0,{atMs:a.lastRunAt,neverLabel:"never run"})]})}function Wse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,running:f,run:p,stop:h}=vN(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:se("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(Ro,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:f?"Running":"Idle"}),v.jsx(c0,{atMs:a.lastRunAt,neverLabel:"never run"}),v.jsx(gN,{error:a.lastError})]}),v.jsx("div",{className:"flex justify-center",children:v.jsx(yN,{running:f,busy:m,large:!0,onRun:p,onStop:h})})]})}function bN(e,t,n){const{cap:a,slice:s,available:m}=ut({trpc:e,deviceId:t,cap:u=>u.automationControl,slice:u=>u.state.automationControl}),{display:f,applyOptimistic:p}=It(s,{enabled:n??!0}),h=!m;return{display:f,capPresent:a!==void 0,busy:h,setEnabled:u=>{a===void 0||h||(p({enabled:u}),u?a.enable({}):a.disable({}))},trigger:()=>{a===void 0||h||a.trigger({})}}}function SN({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:se("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 xN({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:se("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(kr,{className:t?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:"Trigger"})]})}function Yse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,setEnabled:f,trigger:p}=bN(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(SN,{enabled:a.enabled,busy:m,onToggle:f}),v.jsx(xN,{busy:m,large:!1,onTrigger:p})]})}function Xse({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:m,setEnabled:f,trigger:p}=bN(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:se("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(kr,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:a.enabled?"Enabled":"Disabled"}),v.jsx(c0,{atMs:a.lastTriggeredAt,neverLabel:"never triggered"}),v.jsx(gN,{error:a.lastError})]}),v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx(SN,{enabled:a.enabled,busy:m,onToggle:f}),v.jsx(xN,{busy:m,large:!0,onTrigger:p})]})]})}function Jse({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 kN(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.switch,slice:a=>a.state.switch});return n!==void 0}function ele({trpc:e,deviceId:t,features:n,optimistic:a}){return kN(e,t)?v.jsx(r0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function tle(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.lockControl,slice:a=>a.state.lockControl});return n!==void 0}function nle({trpc:e,deviceId:t,features:n,optimistic:a}){return tle(e,t)?v.jsx(Mre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function ale({trpc:e,deviceId:t,features:n,optimistic:a}){return kN(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(r0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(Cre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function ile(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.fanControl,slice:a=>a.state.fanControl});return n!==void 0}function rle({trpc:e,deviceId:t,features:n,optimistic:a}){return ile(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(r0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(Are,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function u0(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.climateControl,slice:a=>a.state.climateControl});return n!==void 0}function ole({trpc:e,deviceId:t,features:n,optimistic:a}){return u0(e,t)?v.jsx(Rre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function sle({trpc:e,deviceId:t,features:n,optimistic:a}){return u0(e,t)?v.jsx(lN,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function lle({trpc:e,deviceId:t,features:n,optimistic:a}){return u0(e,t)?v.jsx(lN,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a}):null}function cle(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.mediaPlayer,slice:a=>a.state.mediaPlayer});return n!==void 0}function ule({trpc:e,deviceId:t,features:n,optimistic:a}){return cle(e,t)?v.jsx(jre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function wN(e,t){const{cap:n}=ut({trpc:e,deviceId:t,cap:a=>a.control,slice:a=>a.state.control});return n!==void 0}function dle({trpc:e,deviceId:t,features:n,optimistic:a}){return wN(e,t)?v.jsx(P4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function mle({trpc:e,deviceId:t,features:n,optimistic:a}){return wN(e,t)?v.jsx(Jse,{children:v.jsx(P4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}):null}var ple={cover:{InlineControl:Xre,HeroCard:toe},valve:{InlineControl:Loe,HeroCard:Foe},humidifier:{InlineControl:$oe,HeroCard:Voe},"water-heater":{InlineControl:Koe,HeroCard:Yoe},switch:{InlineControl:ele,HeroCard:Bse},light:{InlineControl:ale,HeroCard:Dse},fan:{InlineControl:rle,HeroCard:qse},sensor:{InlineControl:roe,HeroCard:foe},thermostat:{InlineControl:ole,HeroCard:Mse},climate:{InlineControl:sle,HeroCard:lle},button:{InlineControl:Sre,HeroCard:xre},update:{InlineControl:hoe,HeroCard:goe},lock:{InlineControl:nle,HeroCard:Ise},"media-player":{InlineControl:ule,HeroCard:$se},alarm:{InlineControl:Vse,HeroCard:Gse},control:{InlineControl:dle,HeroCard:mle},weather:{InlineControl:ese,HeroCard:ase},vacuum:{InlineControl:Aoe,HeroCard:Eoe},"lawn-mower":{InlineControl:Poe,HeroCard:Doe},image:{InlineControl:ise,HeroCard:rse},"pet-feeder":{InlineControl:lse,HeroCard:cse},script:{InlineControl:Kse,HeroCard:Wse},automation:{InlineControl:Yse,HeroCard:Xse},dummy:{InlineControl:noe,HeroCard:aoe}};Object.fromEntries(Object.values(V).map(e=>[e,ple[RY[e]]]));V.Cover+"",V.Valve+"",V.Thermostat+"",V.Climate+"",V.Control+"",V.Button+"",V.MediaPlayer+"",V.AlarmPanel+"",V.Lock+"",V.Vacuum+"",V.LawnMower+"",V.Humidifier+"",V.Switch+"",V.Siren+"",V.Light+"",V.Fan+"",V.WaterHeater+"",V.Sensor+"",V.Presence+"",V.EventEmitter+"",V.Notifier+"",V.Script+"",V.Automation+"",V.Camera+"",V.Hub+"",V.Update+"",V.Generic+"",V.Weather+"",V.Container+"",V.Image+"",V.PetFeeder+"";new Set(Object.values(V));var MN={[V.Camera]:{icon:gee,label:"Camera"},[V.Hub]:{icon:Fee,label:"Hub"},[V.Light]:{icon:pp,label:"Light"},[V.Siren]:{icon:Lm,label:"Siren"},[V.Switch]:{icon:uy,label:"Switch"},[V.Sensor]:{icon:AI,label:"Sensor"},[V.Thermostat]:{icon:hp,label:"Thermostat"},[V.Climate]:{icon:see,label:"Air conditioner"},[V.Button]:{icon:RI,label:"Button"},[V.EventEmitter]:{icon:kr,label:"Event Emitter"},[V.Update]:{icon:Qb,label:"Update"},[V.Generic]:{icon:AM,label:"Generic"},[V.Notifier]:{icon:Pm,label:"Notifier"},[V.Script]:{icon:Wee,label:"Script"},[V.Automation]:{icon:vte,label:"Automation"},[V.Lock]:{icon:Kc,label:"Lock"},[V.Cover]:{icon:mee,label:"Cover"},[V.Valve]:{icon:Qee,label:"Valve"},[V.Humidifier]:{icon:hte,label:"Humidifier"},[V.WaterHeater]:{icon:uee,label:"Water heater"},[V.Fan]:{icon:Dm,label:"Fan"},[V.MediaPlayer]:{icon:Lee,label:"Media player"},[V.AlarmPanel]:{icon:fp,label:"Alarm panel"},[V.Control]:{icon:Vb,label:"Control"},[V.Presence]:{icon:zee,label:"Presence"},[V.Weather]:{icon:II,label:"Weather"},[V.Vacuum]:{icon:fee,label:"Vacuum"},[V.LawnMower]:{icon:ste,label:"Lawn mower"},[V.Container]:{icon:AM,label:"Container"},[V.Image]:{icon:Tee,label:"Image"},[V.PetFeeder]:{icon:pee,label:"Pet feeder"}},fle={[Fe.Siren]:{icon:Lm,label:"Siren"},[Fe.Floodlight]:{icon:pp,label:"Floodlight"},[Fe.Spotlight]:{icon:Eee,label:"Spotlight"},[Fe.PirSensor]:{icon:qI,label:"PIR sensor"},[Fe.Chime]:{icon:Pm,label:"Chime"},[Fe.Autotrack]:{icon:TI,label:"Auto-track"},[Fe.Nightvision]:{icon:$b,label:"Night vision"},[Fe.PrivacyMask]:{icon:Cee,label:"Privacy mask"},[Fe.Doorbell]:{icon:Mee,label:"Doorbell"},[Fe.BinaryHelper]:{icon:uy,label:"Binary helper"},[Fe.MotionSensor]:{icon:OI,label:"Motion sensor"},[Fe.ContactSensor]:{icon:Vs,label:"Contact sensor"},[Fe.LeakSensor]:{icon:Fb,label:"Leak sensor"},[Fe.SmokeSensor]:{icon:lee,label:"Smoke sensor"},[Fe.COSensor]:{icon:zi,label:"CO sensor"},[Fe.GasSensor]:{icon:zm,label:"Gas sensor"},[Fe.TamperSensor]:{icon:fp,label:"Tamper sensor"},[Fe.VibrationSensor]:{icon:$I,label:"Vibration sensor"},[Fe.ConnectivitySensor]:{icon:gte,label:"Connectivity"},[Fe.SoundSensor]:{icon:Jc,label:"Sound sensor"},[Fe.BinarySensor]:{icon:uy,label:"Binary sensor"},[Fe.TemperatureSensor]:{icon:hp,label:"Temperature"},[Fe.HumiditySensor]:{icon:tl,label:"Humidity"},[Fe.AmbientLightSensor]:{icon:FI,label:"Ambient light"},[Fe.PressureSensor]:{icon:om,label:"Pressure"},[Fe.WindSensor]:{icon:zi,label:"Wind"},[Fe.RainSensor]:{icon:_I,label:"Rain"},[Fe.UvSensor]:{icon:ite,label:"UV index"},[Fe.SolarRadiationSensor]:{icon:rte,label:"Solar radiation"},[Fe.SoilMoistureSensor]:{icon:ate,label:"Soil moisture"},[Fe.PowerSensor]:{icon:kr,label:"Power"},[Fe.EnergySensor]:{icon:kr,label:"Energy"},[Fe.VoltageSensor]:{icon:kr,label:"Voltage"},[Fe.CurrentSensor]:{icon:kr,label:"Current"},[Fe.AirQualitySensor]:{icon:zi,label:"Air quality"},[Fe.BatterySensor]:{icon:om,label:"Battery"},[Fe.NumericSensor]:{icon:Iee,label:"Numeric sensor"},[Fe.EnumSensor]:{icon:Pee,label:"Enum sensor"},[Fe.DateTimeSensor]:{icon:RM,label:"Date / time"},[Fe.GenericSensor]:{icon:om,label:"Sensor"},[Fe.NumericControl]:{icon:Vb,label:"Numeric control"},[Fe.SelectControl]:{icon:jee,label:"Select control"},[Fe.TextControl]:{icon:dte,label:"Text control"},[Fe.DateTimeControl]:{icon:RM,label:"Date / time control"},[Fe.MobilePushNotifier]:{icon:nte,label:"Mobile push"},[Fe.MessagingNotifier]:{icon:DI,label:"Messaging"},[Fe.EmailNotifier]:{icon:Dee,label:"Email"},[Fe.GenericNotifier]:{icon:Pm,label:"Notifier"}},hle=new Set(Object.values(V));new Set(Object.values(Fe));function gle(e){return hle.has(e)}var yC=MN[V.Generic];fle[Fe.GenericSensor];function vle(e){return gle(e)?MN[e]??yC:yC}Object.values(V).map(e=>{const t=vle(e);return{id:e,label:t.label,icon:t.icon}});I.createContext(null);V.Sensor,V.Presence;var yle="/addon/snapshot/media";function Afe(e,t={}){const{width:n,baseUrl:a}=t,[s,m]=I.useState(0);return{src:I.useMemo(()=>{if(e===null||e<=0)return null;const f=a!==void 0?a.replace(/\/+$/,""):"",p=new URLSearchParams;n!==void 0&&Number.isInteger(n)&&n>0&&p.set("w",String(n)),s>0&&(p.set("force","1"),p.set("r",String(s)));const h=p.toString();return`${f}${yle}/${String(e)}.jpg${h.length>0?`?${h}`:""}`},[e,n,a,s]),loading:!1,refresh:I.useCallback(()=>{m(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:M(o()).optional(),isCamera:A().optional(),sourceInfo:el.optional()});var bC={motion:AI,audio:Jc,person:pte,vehicle:Sg,animal:ha,package:Hee,sensor:Gee,control:Vb,car:Sg,truck:ute,bus:hee,motorcycle:MM,bicycle:MM,airplane:Vee,boat:Kee,train:lte,bird:CM,cat:EM,dog:IM,horse:ha,sheep:ha,cow:ha,elephant:ha,bear:ha,zebra:ha,giraffe:ha,door:Vs,pir:qI,smoke:zm,water:Fb,gas:zi,vibration:$I,tamper:fp,presence:mte,generic:HI,lock:Kc,siren:Lm,switch:ote,doorbell:bg,button:RI,"audio-speech":DI,"audio-scream":PI,"audio-crying":cee,"audio-laughter":Nee,"audio-music":LI,"audio-dog":IM,"audio-cat":EM,"audio-bird":CM,"audio-animal":ha,"audio-alarm":bg,"audio-doorbell":bg,"audio-glass_breaking":Gs,"audio-gunshot":TI,"audio-vehicle":Sg,"audio-siren":Lm,"audio-fire":zm,"audio-water":tl,"audio-wind":zi,"audio-door":Vs,"audio-footsteps":OI,"audio-crowd":fte,"audio-telephone":$ee,"audio-engine":wee,"audio-tools":_ee,"audio-silence":QI};function SC(e){return Object.hasOwn(bC,e)?bC[e]:e.startsWith("audio-")?Jc:HI}ui("camstack:player-overlays-state",null);var ble=ui("camstack:player-overlays-actions",null);function Efe(e){const t=I.useContext(ble);I.useEffect(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}ui("camstack:zone-editing",null);var xC=500,Wg=800;function lc(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 qd(e,t){return e?.id===t}function Sle(e,t){const[n,a]=I.useState(null),[s,m]=I.useState(null),[f,p]=I.useState(null),[h,u]=I.useState("watching"),S=I.useRef(void 0),w=I.useRef(void 0),C=I.useRef(void 0),E=I.useRef(0);return I.useEffect(()=>{if(t===null)return;const R=lc(e,"detection.motion-analysis",T=>{const j=T;if(!qd(j?.source,t))return;const D=j.data;!D?.regions||D.regions.length===0||(a({zones:D.regions.map(z=>({...z.bbox,intensity:z.intensity})),frameWidth:D.frameWidth,frameHeight:D.frameHeight}),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>a(null),xC))});return()=>{R?.unsubscribe(),S.current&&clearTimeout(S.current)}},[e,t]),I.useEffect(()=>{if(t===null)return;const R=lc(e,"detection.motion-zones-raw",T=>{const j=T;if(!qd(j?.source,t))return;const D=j.data;D?.zones&&(m({boxes:D.zones.map(z=>({bbox:z.bbox,changeScore:z.changeScore})),frameWidth:D.frameSize?.width??0,frameHeight:D.frameSize?.height??0,motionScore:D.zones.length>0?D.zones.reduce((z,q)=>z+q.changeScore,0)/D.zones.length:0}),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>m(null),xC))});return()=>{R?.unsubscribe(),w.current&&clearTimeout(w.current)}},[e,t]),I.useEffect(()=>{if(E.current=0,t===null)return;const R=lc(e,"pipeline-analytics.frame-tracked",T=>{const j=T?.data;!j||j.deviceId!==t||j.detections?.length&&typeof j.detections[0]?.kind=="string"&&(E.current=Date.now(),p({detections:j.detections,frameWidth:j.frameWidth,frameHeight:j.frameHeight}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>p(null),Wg))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),I.useEffect(()=>{if(t===null)return;const R=lc(e,"detection.result",T=>{const j=T;if(!qd(j?.source,t)||Date.now()-E.current<Wg)return;const D=j.data?.frame;D?.detections?.length&&(p({detections:D.detections,frameWidth:D.width,frameHeight:D.height}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>p(null),Wg))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),I.useEffect(()=>{if(t===null)return;const R=lc(e,"detection.phase-transition",T=>{const j=T;qd(j?.source,t)&&j.data?.to&&u(j.data.to)});return()=>{R?.unsubscribe()}},[e,t]),{motion:n,motionRaw:s,detection:f,phase:h}}var xle=5*6e4,kle=720*6e4,wle="camstack:turn-servers:v1";function Mle(){const e=globalThis;try{return e.localStorage??null}catch{return null}}function Cle(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 Ale=class{freshTtlMs;staleCapMs;storage;now;storageKey;memory=new WeakMap;inflight=new WeakMap;constructor(e={}){this.freshTtlMs=e.freshTtlMs??xle,this.staleCapMs=e.staleCapMs??kle,this.storage="storage"in e?e.storage??null:Mle(),this.now=e.now??(()=>Date.now()),this.storageKey=e.storageKey??wle}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 m=await t();if(m.length>0){const f={servers:m,fetchedAt:this.now()};this.memory.set(e,f),this.writeStorage(f)}return m}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 Cle(t)?t:void 0}catch{return}}writeStorage(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(e))}catch{}}},Ele=new Ale;function CN(e,t,n=5e3){const[a,s]=I.useState([]);I.useEffect(()=>{if(t===null)return;let E=!1;const R=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(j=>{E||s(j)}).catch(()=>{})};R();const T=setInterval(R,n);return()=>{E=!0,clearInterval(T)}},[e,t,n]);const[m,f]=I.useState(null);I.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]),si("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:p,hasWebrtc:h}=I.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]),u=I.useCallback(async()=>{const E=e.turnProvider;if(E)return Ele.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]);I.useEffect(()=>{u()},[u]);const S=I.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");const T=await e.webrtcSession.createSession.mutate({deviceId:t,target:E,hints:R}),j=await u();return{sessionId:T.sessionId,sdpOffer:T.sdpOffer,...j?{iceServers:j}:{}}},[e,t,u]),w=I.useCallback(async(E,R,T,j)=>{if(t===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:t,target:E,sdpOffer:R,...T!==void 0?{sessionId:T}:{},...j!==void 0?{hints:j}:{}})},[e,t]),C=I.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:p,hasWebrtc:h,pipelineMetrics:m,createSession:S,handleOffer:w,getIceServers:u,addIceCandidate:I.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:I.useCallback(async E=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:E}),[e,t]),sendAnswer:C,closeSession:I.useCallback(async E=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:E}).catch(()=>{})},[e,t]),getSessionState:I.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])}}I.lazy(()=>qs(()=>import("./MaskShapeCanvas-DI4BY7W2-FBlH4Wq_.js"),[],import.meta.url).then(e=>({default:e.MaskShapeCanvas})));I.lazy(()=>qs(()=>import("./MotionZonesSettings-DNdnFHso-B_fslMFv.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings})));I.lazy(()=>qs(()=>import("./SceneMonitorEditor-d_A4kO-M-BsQK-gmH.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>({default:e.SceneMonitorEditor})));I.lazy(()=>qs(()=>import("./PrivacyMaskSettings-DNSLc6ww-CD2tFrNb.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));const AN=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Rle=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _le=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const kC=e=>{const t=_le(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ile={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 Tle=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Nle=I.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:m,iconNode:f,...p},h)=>I.createElement("svg",{ref:h,...Ile,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:AN("lucide",s),...!m&&!Tle(p)&&{"aria-hidden":"true"},...p},[...f.map(([u,S])=>I.createElement(u,S)),...Array.isArray(m)?m:[m]]));const Ole=(e,t)=>{const n=I.forwardRef(({className:a,...s},m)=>I.createElement(Nle,{ref:m,iconNode:t,className:AN(`lucide-${Rle(kC(e))}`,`lucide-${e}`,a),...s}));return n.displayName=kC(e),n};const jle=[["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"}]],Ple=Ole("scan-face",jle),Qm={unassignedFace:"unassigned face",reviewed:"reviewed",debug:"debug",train:"train",favourite:"favourite",active:"active",loadingMore:"Loading more events"},Dle=Object.keys(Qm),EN=X(o(),o());function zle(e){if(e===null||typeof e!="object")return Qm;const t=e,n={...Qm};for(const a of Dle){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 Lle=O(["reel","gallery"]),qle=O(["small","medium","large"]),Ble=O(["time","importance"]),Ule=O(["text","semantic"]),Fle=["face","plate"],d0=O(Fle),Hle=O(["auto","dark","light"]),$le=tt([G("auto"),l().int().min(1).max(12)]),Qle=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()});d({view:Lle,rows:l().int().min(1).max(6).optional(),columns:$le.optional(),thumb:qle,deviceIds:M(l().int().nonnegative()),classes:M(o()).optional(),attrs:M(d0).optional(),search:o().optional(),searchMode:Ule.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:Ble.optional(),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),deviceNames:X(o(),o()).optional(),fields:Qle,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:Hle});const RN=O(["reel","gallery"]),Vle=O(["tracks","groups"]),_N=O(["small","medium","large"]),IN=O(["auto","dark","light"]),TN=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()}),NN={label:!0,sublabel:!0,camera:!0,time:!0,badges:!0},ON=O(["time","importance"]),jN=O(["text","semantic"]),PN=tt([G("auto"),l().int().min(1).max(12)]),Gle=60,Zle=600,Kle=0,Wle=720*60*60*1e3,Yle=d({serverUrl:o().min(1),token:o().min(1),entity:Vle.default("tracks"),view:RN.default("reel"),rows:l().int().min(1).max(6).default(1),columns:PN.default("auto"),thumbSize:_N.default("medium"),fields:TN.default(NN),deviceIds:M(l().int().nonnegative()).default([]),classes:M(o()).default([]),attrs:M(d0).catch([]).default([]),deviceNames:X(o(),o()).default({}),kindLabels:X(o(),o()).default({}),labels:EN.default({}),strings:d({empty:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional()}).default({}),search:o().default(""),searchMode:jN.default("text"),semanticLimit:l().int().min(1).max(200).default(50),semanticMinScore:l().min(0).max(1).default(.2),sort:ON.default("time"),filterDebug:A().default(!1),filterTrain:A().default(!1),filterFavourited:A().default(!1),showStationary:A().default(!1),reviewedTrackIds:M(o()).default([]),showAdminFlags:A().default(!1),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),pageSize:l().int().min(1).max(500).default(Gle),maxRows:l().int().min(1).max(5e3).default(Zle),refreshMs:l().int().min(0).max(6e5).default(Kle),maxAgeMs:l().int().min(6e4).default(Wle),theme:IN.default("auto"),nativePullToRefresh:A().default(!1)}),DN=d({view:RN.optional(),rows:l().int().min(1).max(6).optional(),columns:PN.optional(),thumbSize:_N.optional(),fields:TN.partial().optional(),deviceIds:M(l().int().nonnegative()).optional(),classes:M(o()).optional(),attrs:M(d0).optional(),deviceNames:X(o(),o()).optional(),kindLabels:X(o(),o()).optional(),labels:EN.optional(),strings:d({empty:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional()}).optional(),search:o().optional(),searchMode:jN.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:ON.optional(),filterDebug:A().optional(),filterTrain:A().optional(),filterFavourited:A().optional(),showStationary:A().optional(),reviewedTrackIds:M(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:IN.optional(),nativePullToRefresh:A().optional()});function m0(e){return e==="small"?80:e==="large"?132:106}function Xle(e,t=1){const n=Number.isFinite(t)&&t>0?t:1,a=Math.round(m0(e)*n);return Math.max(Jle,Math.min(ece,a))}const Jle=64,ece=320,ym=3,bm=14,tce=4;function nce(e){return m0(e)+ym*2+bm}function zN(e){if(e==null)return{ok:!1,error:"config is required"};const t=Yle.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 Ty(e,t){const n=t.fields!==void 0?{...e.fields,...t.fields}:e.fields,{sinceMs:a,untilMs:s,...m}=t,{sinceMs:f,untilMs:p,...h}=e,u=wC(a,f),S=wC(s,p);return{...h,...m,fields:n,...u!==void 0?{sinceMs:u}:{},...S!==void 0?{untilMs:S}:{}}}function wC(e,t){if(e!==null)return e??t}function ace(e,t,n){const a=n[String(e)];return a!==void 0&&a.trim().length>0?a:t}const ice={empty:"No events",error:"Couldn't load events",retry:"Retry",end:"·"};function Bd(e,t){const n=e.strings[t];return n!==void 0&&n.trim().length>0?n:ice[t]}const rce="/addon/pipeline-analytics/event-media",MC=64,oce=320;function sce(e){return e.replace(/\/+$/,"")}function lce(e){const t=Math.round(e);return Number.isFinite(t)?Math.max(MC,Math.min(oce,t)):MC}function LN(e,t,n){return`${sce(e)}${rce}/${t}?kind=thumbnailSmall&variant=thumb&size=${lce(n)}`}const cce="audio";function Vm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function uce(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!Vm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!Vm(s))continue;const m=s.kind;if(typeof m!="string"||m.length===0)continue;const f=s.parentKind;t.set(m,typeof f=="string"&&f.length>0?f:m)}}return t}function qN(e,t){return t.get(e)??e}const CC="audio-",AC="audio";function tu(e){const t=e.toLowerCase();return t.startsWith(CC)?t:`${CC}${t}`}function dce(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!Vm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!Vm(s))continue;const m=s.kind,f=s.iconId;typeof m!="string"||m.length===0||typeof f!="string"||f.length===0||t.set(m,f)}}return t}function mce(e,t,n=!1){if(n){const s=t.get(e);if(s!==void 0)return s;if(e.toLowerCase()===AC)return AC;const m=tu(e);return t.get(m)??m}const a=e.toLowerCase();return t.get(e)??t.get(a)??a}function pce(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 p0=new Map;function Sm(e,t){return t.get(e)??t.get(e.toLowerCase())??e}function BN(e,t){const n=tu(e);return t.get(n)??t.get(e)??e}const EC={background:"#09090b",card:"#18181b",cardHover:"#27272a",border:"#27272a",text:"#fafafa",textMuted:"#a1a1aa",skeleton:"#27272a",chip:"#3f3f46",colorScheme:"dark"},RC={background:"#ffffff",card:"#f4f4f5",cardHover:"#e4e4e7",border:"#e4e4e7",text:"#18181b",textMuted:"#71717a",skeleton:"#e4e4e7",chip:"#d4d4d8",colorScheme:"light"};function UN(e,t){return e==="light"?RC:e==="dark"||t?EC:RC}const Ny="#f472b6";function fce(e,t=!1){if(t)return Ny;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")?Ny:n.includes("motion")?"#94a3b8":"#71717a"}function hce(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function gce(e,t){const n=new Date(e),a=new Date(t),s=String(n.getHours()).padStart(2,"0"),m=String(n.getMinutes()).padStart(2,"0");if(n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate())return`${s}:${m}`;const p=String(n.getDate()).padStart(2,"0"),h=String(n.getMonth()+1).padStart(2,"0");return`${p}/${h} ${s}:${m}`}const vce=/[_\-/.]+/g;function FN(e){return e.toLowerCase().replace(vce," ").replace(/\s+/g," ").trim()}function yce(e){if(e===void 0)return[];const t=e.trim().toLowerCase();if(t.length===0)return[];const n=FN(e);return n===t||n.length===0?[t]:[t,n]}const bp=new Map,bce=new Set(["plate-detection","plate-ocr","operator:plate-gallery"]),_C=new Set(["face-recognizer","face-embedding","operator:face-gallery"]),Sce=[];function Yg(e,t){if(!f0(e))return!1;const n=e.stepId;return typeof n=="string"&&t.has(n)}function HN(e){return e.source==="audio"}function f0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function br(e){return typeof e=="string"&&e.length>0?e:void 0}function Xg(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 xce(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const a=f0(n)?br(n.label):void 0;a!==void 0&&!t.includes(a)&&t.push(a)}return t}function kce(e,t){if(!f0(e))return null;const n=br(e.trackId),a=br(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=br(e.label),m=br(e.subLabel),f=br(e.producingDeviceName),p=br(e.source),h=Xg(e.classes);return{trackId:n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...s!==void 0?{label:s}:{},...m!==void 0?{subLabel:m}:{},...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:Xg(e.zonesVisited),zoneNames:Xg(e.zoneNames),classes:h.includes(a)?h:[a,...h],audioLabels:xce(e.audioLabels),bestEventId:br(e.bestEventId)??n,...f!==void 0?{producingDeviceName:f}:{},...p!==void 0?{source:p}:{},...e.hasEmbeddedFace===!0||Yg(e.subLabelMeta,_C)?{hasAssignableFace:!0}:{},...e.hasEmbeddedFace===!0&&!Yg(e.subLabelMeta,_C)?{hasUnassignedFace:!0}:{},...Yg(e.subLabelMeta,bce)?{hasPlate:!0}:{},...e.debug===!0?{debug:!0}:{},...e.markForTrain===!0?{markForTrain:!0}:{},...e.favourited===!0?{favourited:!0}:{}}}function IC(e,t){if(!Array.isArray(e))return[];const n=[];for(const a of e){const s=kce(a,t);s!==null&&n.push(s)}return n}function wce(e,t){const n=new Set;for(const a of[e.className,...e.classes])a.length!==0&&(n.add(a),n.add(qN(a,t)));if(e.audioLabels.length>0){n.add(cce);for(const a of e.audioLabels)n.add(tu(a))}return n}function Mce(e,t,n=bp){if(t.size===0)return!0;const a=wce(e,n);for(const s of t)if(a.has(s))return!0;return!1}function Cce(e,t=bp){const n=new Set,a=s=>{for(const m of yce(s))n.add(m)};for(const s of[e.className,...e.classes])a(s),s.length>0&&a(qN(s,t));a(e.label),a(e.subLabel),a(e.cameraName),a(e.producingDeviceName);for(const s of e.audioLabels)a(s),a(tu(s));for(const s of e.zoneNames)a(s);for(const s of[e.label,e.subLabel]){if(s===void 0)continue;const m=t.get(s.trim().toLowerCase());m!==void 0&&a(m)}return n}function Ace(e,t,n=bp){const a=t.trim().toLowerCase();if(a.length===0)return!0;const s=FN(t);for(const m of Cce(e,n))if(m.includes(a)||s.length>0&&m.includes(s))return!0;return!1}function Ece(e,t){return!!(t.size===0||t.has("face")&&e.hasAssignableFace===!0||t.has("plate")&&e.hasPlate===!0)}function Rce(e,t={}){const n=t.debug===!0,a=t.train===!0,s=t.favourited===!0;if(!n&&!a&&!s)return!0;const m=t.reviewedTrackIds?.includes(e.trackId)===!0;return!!(n&&e.debug===!0&&!m||a&&e.markForTrain===!0||s&&e.favourited===!0)}function TC(e,t,n,a=bp,s=Sce,m={}){const f=new Set(t),p=new Set(s);return e.filter(h=>Mce(h,f,a)&&Ece(h,p)&&Ace(h,n,a)&&Rce(h,m))}function _ce(e,t=p0){return e.producingDeviceName!==void 0?{text:Sm(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:Sm(e.label,t),tier:"kind"}:{text:Sm(e.className,t),tier:"class"}}function Ice(e,t,n,a=p0){if(t)return"";const s=[n];for(const m of e.audioLabels){if(m===e.className||m===e.label)continue;const f=BN(m,a);s.includes(f)||s.push(f)}return s.join(" · ")}function NC(e,t){let n=!1;const a=e.map(s=>{const m=t.get(s.deviceId);return m===void 0||m===s.cameraName?s:(n=!0,{...s,cameraName:m})});return n?a:e}function OC(e,t){if(Object.keys(t).length===0)return e;let a=!1;const s=e.map(m=>{const f=t[m.trackId];if(f===void 0)return m;const p=Nce(m,f);return p!==m&&(a=!0),p});return a?s:e}function Tce(e){const{debug:t,markForTrain:n,favourited:a,...s}=e;return s}function Nce(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:{...Tce(e),...n===!0?{debug:!0}:{},...a===!0?{markForTrain:!0}:{},...s===!0?{favourited:!0}:{}}}function Oce(e){const t=e.filter(n=>n.isCamera===!0).map(n=>n.id);return t.length>0?t:e.map(n=>n.id)}const Oy=11,jC=9,Jg=3,jce=8,Pce=12,Dce=24,zce=.58,Lce=.85;function qce(e,t){return[...e].length*t*zce}function Bce(e){return Math.max(Dce,e-jce-Pce)}function PC(e,t,n){const a=Bce(t),s=n.maxLines===1?a:a*n.maxLines*Lce;return qce(e,n.fontSizePx)<=s}function Uce(e,t){for(let n=1;n<=Jg;n+=1){const a={fontSizePx:Oy,maxLines:n};if(PC(e,t,a))return a}for(let n=Oy-1;n>=jC;n-=1){const a={fontSizePx:n,maxLines:Jg};if(PC(e,t,a))return a}return{fontSizePx:jC,maxLines:Jg}}const Fce=1e4;function $N(){try{return window.parent!==window}catch{return!0}}let jy=null;function QN(e){jy=e}function Hce(e){if(jy===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:jy,...n}}}function an(e){const t=Hce(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}$N()&&window.parent.postMessage(t,"*")}function nu(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 $ce(e,t,n,a,s){const m=t();if(m!=null)return Promise.resolve(n(m));if(s?.urlFirst===!0){const f=a!==void 0?a():null;if(f!==null)return Promise.resolve(f)}if(!$N()){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 p;const h=u=>{const S=u.data;if(typeof S!="object"||S===null)return;const w=S;w.type==="embed-config"&&(clearTimeout(p),window.removeEventListener("message",h),f(n(w.config)))};window.addEventListener("message",h),p=setTimeout(()=>{window.removeEventListener("message",h),f({ok:!1,error:"config handshake timed out"})},Fce),window.parent.postMessage({type:"embed-ready",mode:e},"*")})}function Sp(e,t,n,a,s){const[m,f]=I.useState(null),p=I.useRef(t);p.current=t;const h=I.useRef(n);h.current=n;const u=I.useRef(a);u.current=a;const S=s?.urlFirst===!0;return I.useEffect(()=>{let w=!0;return $ce(e,()=>p.current(),C=>h.current(C),()=>u.current!==void 0?u.current():null,{urlFirst:S}).then(C=>{w&&f(C)}),()=>{w=!1}},[e,S]),m}const li=1,Qce=["window","sort","semantic-search","macro-classes","device-names","kind-labels","heartbeat","track-list","attr-filters","flag-filters","debug-status","native-pull-refresh"];function Vce(e){return{v:li,type:"ready",view:e,features:[...Qce]}}function Gce(e){return{v:li,type:"error",message:e}}function xm(e,t){return t!==void 0?{v:li,type:"state",state:e,message:t}:{v:li,type:"state",state:e}}function Zce(e){return{v:li,type:"trackClick",...e}}function Kce(e){return{v:li,type:"trackList",tracks:e}}function DC(e,t,n,a="feed"){return{v:li,type:"countChanged",loaded:e,shown:t,hasMore:n,mode:a}}function Wce(){return{v:li,type:"heartbeat"}}function Yce(e){return{v:li,type:"scroll",atTop:e}}function Xce(){return{v:li,type:"refreshed"}}function Ta(e){an(e)}function oi(e,t,n="feed"){an({type:"log",scope:n,msg:e,...t!==void 0?{data:t}:{}})}const Jce=d({debug:A().optional(),markForTrain:A().optional(),favourited:A().optional()}),eue=X(o(),Jce);function Ud(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=tue.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==="setTrackFlagPatches"){const s=eue.safeParse(t.patches);return s.success?{type:"setTrackFlagPatches",patches:s.data}:null}if(n!=="setConfig")return null;const a=DN.safeParse(t.patch);return a.success?{type:"setConfig",patch:a.data}:null}const tue=d({sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional()});function nue(e){return{...e.sinceMs!==void 0?{sinceMs:e.sinceMs}:{},...e.untilMs!==void 0?{untilMs:e.untilMs}:{}}}const aue={blockedMs:0,maxLagMs:0,samples:0};function iue(e,t,n){if(n<=t)return aue;let a=0,s=0,m=0;for(const f of e){const p=f.at-f.lagMs,h=Math.min(f.at,n)-Math.max(p,t);h<=0||(a+=h,s=Math.max(s,f.lagMs),m+=1)}return{blockedMs:Math.round(a),maxLagMs:Math.round(s),samples:m}}function Py(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 rue=250,zC=600,oue=8;let Ms=[],LC=null;function sue(e){e.lagMs<oue||(Ms.push(e),Ms.length>zC&&(Ms=Ms.slice(Ms.length-zC)))}function Dy(e,t){return iue(Ms,e,t)}function lue(e=rue,t=()=>performance.now(),n=(a,s)=>{const m=setInterval(a,s);return()=>clearInterval(m)}){if(LC!==null)return;let a=t()+e;LC={stop:n(()=>{const m=t();sue({at:m,lagMs:Math.max(0,m-a)}),a=m+e},e)}}function cue(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 uue(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 due(){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 mue(e,t,n=due()){if(n===null)return null;try{const a=uue(n.getEntriesByName(e,"resource"),t);return a===null?null:cue(a)}catch{return null}}const pue=250,Pi=new Map,ev=new Map,fue=6,hue=1e4,gue=5e3,tv=[250,750];let nv=40;const qC=32;function vue(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,qC);return{origin:"(unparseable)",path:e.length>qC?`${t}…`:t,query:""}}}function yue(e){return e instanceof Error?{errorName:e.name,errorMessage:e.message}:{errorName:"unknown",errorMessage:String(e)}}let Gm=0,VN=[];async function bue(){if(Gm<fue){Gm+=1;return}await new Promise(e=>{VN.push(e)})}function Sue(){const e=VN.shift();if(e!==void 0){e();return}Gm=Math.max(0,Gm-1)}function xue(e,t){for(Pi.set(e,t);Pi.size>pue;){const n=Pi.keys().next();if(n.done===!0)break;const a=Pi.get(n.value);Pi.delete(n.value),a!==void 0&&URL.revokeObjectURL(a)}}async function GN(e,t){const n=Pi.get(e);if(n!==void 0)return Pi.delete(e),Pi.set(e,n),{status:"ready",src:n};const a=ev.get(e);if(a!==void 0)return a;const s=(async()=>{const m=performance.now(),f=vue(e);let p={lastStatus:null,errorName:null,errorMessage:null},h=0;try{for(let u=0;u<=tv.length;u+=1){const S=performance.now();await bue(),h+=performance.now()-S;const w=performance.now(),C=new AbortController,E=setTimeout(()=>C.abort(),hue);try{const T=await fetch(e,{headers:{Authorization:`Bearer ${t}`},signal:C.signal});if(T.ok){const j=Math.round(performance.now()-w),D=await T.blob(),z=Math.round(performance.now()-m),q=Math.round(performance.now()-w),L=URL.createObjectURL(D);if(xue(e,L),nv>0||z>=500){nv=Math.max(0,nv-1);const K=mue(e,w),J=Py(performance.now()-w,Dy(w,performance.now()));oi("thumbnail ready",{ms:z,queuedMs:Math.round(h),headersMs:j,blobMs:q-j,blockedMs:J.blockedMs,maxLagMs:J.maxLagMs,netTotalMs:K?.totalMs??null,netQueuedMs:K?.queuedMs??null,netTtfbMs:K?.ttfbMs??null,bytes:D.size,attempt:u+1,serverTiming:T.headers?.get("server-timing")??null},"media")}return{status:"ready",src:L}}if(T.status===401||T.status===403||T.status===404)return oi("thumbnail missing",{ms:Math.round(performance.now()-m),queuedMs:Math.round(h),status:T.status,attempt:u+1,...f},"media"),{status:"missing"};p={lastStatus:T.status,errorName:null,errorMessage:null}}catch(T){p={lastStatus:null,...yue(T)}}finally{clearTimeout(E),Sue()}const R=tv[u];R!==void 0&&await new Promise(T=>setTimeout(T,R))}return oi("thumbnail transient failure",{ms:Math.round(performance.now()-m),queuedMs:Math.round(h),attempts:tv.length+1,...p,...f},"media"),{status:"transient-failure"}}finally{ev.delete(e)}})();return ev.set(e,s),s}async function kue(e,t){const n=await GN(e,t);return n.status==="ready"?n.src:null}function wue(e,t){const[n,a]=I.useState({status:"loading"}),[s,m]=I.useState(0);return I.useEffect(()=>{if(e===null){a({status:"loading"});return}const f=Pi.get(e);if(f!==void 0){a({status:"ready",src:f});return}let p=!0,h;return a({status:"loading"}),GN(e,t).then(u=>{if(p){if(u.status==="ready"){a({status:"ready",src:u.src});return}if(u.status==="missing"){a({status:"failed"});return}h=setTimeout(()=>m(S=>S+1),gue)}}),()=>{p=!1,h!==void 0&&clearTimeout(h)}},[e,t,s]),n}function Mue(e){const t=e?.clientHeight??0;return t>0?t:600}function Cue(e,t){const{root:n,disabled:a}=t,[s,m]=I.useState(a===!0),f=I.useRef(s);return f.current=s,I.useEffect(()=>{if(f.current)return;if(a===!0){m(!0);return}const p=e.current;if(!p||typeof IntersectionObserver!="function"){m(!0);return}const h=new IntersectionObserver(u=>{u.some(S=>S.isIntersecting)&&(m(!0),h.disconnect())},{root:n,rootMargin:`${Mue(n)}px`});return h.observe(p),()=>h.disconnect()},[e,n,a]),s}const Fd={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},Aue=I.memo(function({row:t,serverUrl:n,token:a,thumbPx:s,width:m,heroPx:f,fields:p,palette:h,nowMs:u,variant:S,iconId:w,kindLabels:C=p0,labels:E=Qm,scrollRoot:R,eagerImages:T,showAdminFlags:j,onClick:D}){const z=I.useRef(null),L=Cue(z,{root:R,...T===!0?{disabled:!0}:{}})?LN(n,t.bestEventId,s):null,K=wue(L,a),J=fce(t.className,HN(t)),$=S==="reel",F=f+ym*2+bm,ue=_ce(t,C),we=ue.tier!=="class",Ee=!we,Me=Uce(ue.text,f),ce=p.label,Se=Ice(t,ce,ue.text,C),Re=SC(w),Q=v.jsxs("div",{style:{position:"relative",width:$?f:"100%",height:$?f:void 0,aspectRatio:$?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:K.status==="loading"?"events-skeleton":void 0,"data-testid":"card-image-backing",style:{position:"absolute",inset:0,background:K.status==="failed"?`${J}22`:h.skeleton,boxShadow:`inset 0 0 0 1px ${h.border}`}}),K.status==="ready"?v.jsx("img",{src:K.src,alt:"",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null,p.label&&v.jsxs("div",{style:{position:"absolute",left:4,right:4,bottom:4,display:"flex",flexWrap:$?"nowrap":"wrap",gap:3,alignItems:"center",pointerEvents:"none"},children:[Ee&&v.jsx("span",{"data-testid":"card-class-glyph",title:Sm(t.className,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${J}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(Re,{size:13,color:"#fff"})}),we&&v.jsx("span",{"data-testid":"card-title",title:ue.fullText??ue.text,style:{background:"#000000B3",color:"#fff",fontSize:$?Oy:Me.fontSizePx,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,overflow:"hidden",minWidth:0,...$?{textOverflow:"ellipsis",whiteSpace:"nowrap"}:{display:"-webkit-box",WebkitLineClamp:Me.maxLines,WebkitBoxOrient:"vertical",whiteSpace:"normal",overflowWrap:"anywhere"}},children:ue.text}),t.hasUnassignedFace===!0&&v.jsxs("span",{"data-testid":"card-face-unassigned",title:E.unassignedFace,style:{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(Ple,{size:13,color:"#fff"}),"?"]}),!$&&t.audioLabels.filter(re=>re!==t.className&&re!==t.label).map(re=>{const B=tu(re),ae=SC(B);return v.jsx("span",{title:BN(re,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${Ny}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(ae,{size:13,color:"#fff"})},`audio-${re}`)})]}),(j===!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:p.badges&&t.active?16:4,display:"inline-flex",gap:2,zIndex:2},children:[j===!0&&t.reviewed===!0&&v.jsx("span",{title:E.reviewed,style:Fd,children:"✓"}),j===!0&&t.debug===!0&&t.reviewed!==!0&&v.jsx("span",{title:E.debug,style:Fd,children:"D"}),j===!0&&t.markForTrain===!0&&v.jsx("span",{title:E.train,style:Fd,children:"T"}),t.favourited===!0&&v.jsx("span",{title:E.favourite,style:{...Fd,color:"#fbbf24"},children:"★"})]}),p.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)"}}),p.badges&&!$&&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($)return v.jsxs("button",{ref:z,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:m,height:F,minWidth:m,minHeight:F,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:[Q,v.jsxs("div",{style:{paddingTop:ym,paddingBottom:ym,paddingLeft:4,paddingRight:4,display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"100%",boxSizing:"border-box"},children:[p.camera&&t.producingDeviceName!==void 0&&v.jsx("span",{style:{fontSize:11,lineHeight:`${bm}px`,fontWeight:600,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.producingDeviceName}),p.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:`${bm}px`,color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:hce(t.lastSeen)})]})]});const me=p.camera,xe=t.cameraName,Ce=me||p.time||p.sublabel&&Se.length>0;return v.jsxs("button",{ref:z,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:m,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:[Q,Ce&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0,paddingTop:2,paddingBottom:2},children:[p.sublabel&&Se.length>0&&v.jsx("span",{style:{fontSize:11,color:h.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Se}),me&&v.jsx("span",{"data-testid":"card-camera",title:xe,style:{fontSize:12,fontWeight:600,lineHeight:"15px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:xe}),p.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:gce(t.lastSeen,u)}),p.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 ZN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Eue(e){if(e===null||e.length===0)return;const t=e.split("?")[0]??e,n=t.lastIndexOf("/"),a=n>=0?t.slice(n+1):t;return a.length>0?a:void 0}function Rue(e){if(!ZN(e))return null;const t=typeof e.id=="string"&&e.id.length>0?e.id:null,n=typeof e.className=="string"&&e.className.length>0?e.className:null;if(t===null||n===null||typeof e.deviceId!="number"||typeof e.openedAt!="number"||typeof e.closedAt!="number")return null;const a=Array.isArray(e.classes)?e.classes.filter(p=>typeof p=="string"&&p.length>0):[],s=Array.isArray(e.memberTrackIds)?e.memberTrackIds.filter(p=>typeof p=="string"&&p.length>0):[],m=typeof e.mediaUrl=="string"?e.mediaUrl:null,f=Eue(m)??s[0]??t;return{trackId:t,deviceId:e.deviceId,className:n,classes:a.includes(n)?a:[n,...a],firstSeen:e.openedAt,lastSeen:e.closedAt,bestEventId:f,state:"left",active:!1,label:n}}function _ue(e){if(!ZN(e)||!Array.isArray(e.groups))return{groups:[],nextCursor:null};const t=e.nextCursor,n=typeof t=="string"&&t.length>0?t:null;return{groups:e.groups,nextCursor:n}}function Iue(e){const t=_ue(e),n=[];for(const a of t.groups){const s=Rue(a);s!==null&&n.push(s)}return{tracks:n,nextCursor:t.nextCursor}}function Tue(e){return async t=>{const n=await e({deviceIds:[...t.deviceIds],since:t.since,...t.until!==void 0?{until:t.until}:{},limit:t.limit,...t.cursor!==void 0?{cursor:t.cursor}:{}});return Iue(n)}}function Nue(e){const t=e.trpcClient.pipelineAnalytics;return n=>t.listGroups.query(n)}function Oue(e,t="tracks"){return{listRecentTracks:t==="groups"?Tue(Nue(e)):a=>e.trpcClient.pipelineAnalytics.listRecentTracks.query(a),listDevices:()=>e.trpcClient.deviceManager.listAll.query({isCamera:!0,projection:"slim"}),searchObjectEvents:a=>e.trpcClient.pipelineAnalytics.searchObjectEvents.query(a),listEventKinds:a=>e.trpcClient.pipelineAnalytics.listEventKindsBatch.query({deviceIds:a})}}const jue=2e3,Pue=1e3;function BC(e,t){const n=Math.max(1,Math.floor(e)),a=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(jue/a));return Math.min(n,Pue,s)}function h0(e,t){return e.lastSeen!==t.lastSeen?t.lastSeen-e.lastSeen:e.trackId===t.trackId?0:e.trackId<t.trackId?1:-1}const mc={rows:[],cursor:null,exhausted:!1,rebuild:null},Due=8;function zy(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(h0)}function zue(e,t,n){const a=e.rebuild;if(a===null)return{rows:zy(e.rows,t),cursor:n,exhausted:n===null,rebuild:null};const s=zy(a.rows,t),m=a.pages+1,f=s.length>=a.floor;return n===null||f||m>=Due?{rows:s,cursor:n,exhausted:n===null,rebuild:null}:{...e,rebuild:{rows:s,cursor:n,exhausted:!1,floor:a.floor,pages:m}}}function Lue(e){return e.rows.length===0?mc:{...e,rebuild:{rows:[],cursor:null,exhausted:!1,floor:e.rows.length,pages:0}}}function que(e){return e.rebuild===null?e:{...e,rebuild:null}}function Bue(e){return e.rebuild!==null}function UC(e){return e.rebuild!==null?e.rebuild.cursor:e.cursor}function Uue(e,t,n){const a=new Set(e.rows.map(m=>m.trackId));let s=0;for(const m of t)a.has(m.trackId)||(s+=1);return{state:{...e,rows:zy(e.rows,t)},gap:n!==null,deltaCursor:n,added:s}}function Fue(e){const t=e.rows[0];return t!==void 0?t.lastSeen:null}function FC(e,t){const n=e.rebuild??e;return!n.exhausted&&n.rows.length<Math.max(1,t)}function Hue(e,t){return Math.max(0,e-Math.max(0,t))}function $ue(e){const t=e.sinceMs??Hue(e.anchorMs,e.maxAgeMs);return e.untilMs!==void 0?{since:t,until:e.untilMs}:{since:t}}function Que(e,t){return e===void 0||e>t}function KN(e,t){return t==="time"?e:[...e].sort((n,a)=>{const s=n.importance??-1,m=a.importance??-1;return s!==m?m-s:h0(n,a)})}function Vue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xs(e){return typeof e=="string"&&e.length>0?e:void 0}function Gue(e,t){if(!Vue(e))return null;const n=xs(e.id),a=xs(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=xs(e.trackId),m=xs(e.mediaKey),f=xs(e.label),p=xs(e.subLabel);return{trackId:s??n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...f!==void 0?{label:f}:{},...p!==void 0?{subLabel:p}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.timestamp,lastSeen:e.timestamp,state:"idle",active:!1,zonesVisited:[],zoneNames:[],classes:[a],audioLabels:[],bestEventId:m??s??n,score:e.score}}function Zue(e,t){if(!Array.isArray(e))return[];const n=new Map;for(const a of e){const s=Gue(a,t);if(s===null)continue;const m=n.get(s.trackId);(m===void 0||s.score>m.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 Kue(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 KN([...a.values()].sort(h0),n)}function Wue(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)),m=t.viewportWidth>0?t.viewportWidth:t.cardWidth,f=Math.max(s+1,Math.ceil((Math.max(0,t.scrollLeft)+m*2)/a));return e.slice(s*n,Math.min(e.length,f*n))}const Yue=24,Xue=12,Jue=34;function ede(e,t){if(e.length===0)return e;const n=Math.max(0,t.gap),a=Math.max(1,t.cardWidth);if(t.viewportWidth<=0||t.viewportHeight<=0)return e.slice(0,Math.min(e.length,Xue));const s=Math.max(1,Math.floor((t.viewportWidth+n)/(a+n))),m=(t.viewportWidth-(s-1)*n)/s,f=Math.max(1,m+Jue+n),p=Math.max(0,Math.floor(Math.max(0,t.scrollTop)/f)),h=Math.max(1,Math.ceil(t.viewportHeight*2/f)),u=p*s,S=Math.min(e.length,u+Math.min(h*s,Yue));return e.slice(u,S)}const tde=1,nde=["label","sublabel","camera","time","badges"];function ks(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 ade(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 Ly(e){if(e!==null)return e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function ide(e){if(e===null)return;const t=new Set((Ly(e)??[]).map(a=>a.toLowerCase())),n={};for(const a of nde)n[a]=t.has(a.toLowerCase());return n}function rde(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 ode(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 m;try{m=decodeURIComponent(n.slice(a+1))}catch{continue}m.trim().length!==0&&(t[s]=m)}return t}function HC(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 sde(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 lde(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 WN(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)!==tde)return{ok:!1,error:`unsupported events URL version "${n}"`};const s={},m=t.get("view");m!==null&&(s.view=m);const f=ks(t,"rows");f!==void 0&&(s.rows=f);const p=sde(t.get("cols"));p!==void 0&&(s.columns=p);const h=t.get("thumb");h!==null&&(s.thumbSize=h);const u=ide(t.get("fields"));u!==void 0&&(s.fields=u);const S=ade(t.get("devices"));S!==void 0&&(s.deviceIds=S);const w=Ly(t.get("classes"));w!==void 0&&(s.classes=w);const C=Ly(t.get("attrs"));C!==void 0&&(s.attrs=C);const E=t.get("q");E!==null&&(s.search=E);const R=ks(t,"page");R!==void 0&&(s.pageSize=R);const T=ks(t,"max");T!==void 0&&(s.maxRows=T);const j=ks(t,"refresh");j!==void 0&&(s.refreshMs=j);const D=ks(t,"age");D!==void 0&&(s.maxAgeMs=D);const z=t.get("theme");z!==null&&(s.theme=z);const q=t.get("sort");q!==null&&(s.sort=q);const L=t.get("smode");L!==null&&(s.searchMode=L);const K=ks(t,"slimit");K!==void 0&&(s.semanticLimit=K);const J=t.get("sscore");if(J!==null&&J.trim()!==""){const Ee=Number.parseFloat(J);Number.isFinite(Ee)&&(s.semanticMinScore=Ee)}const $=HC(t,"since");$!==void 0&&(s.sinceMs=$);const F=HC(t,"until");F!==void 0&&(s.untilMs=F);const ue=ode(rde(e,"names"));ue!==void 0&&(s.deviceNames=ue);const we=DN.safeParse(s);return we.success?{ok:!0,patch:we.data}:{ok:!1,error:we.error.issues.map(Ee=>`${Ee.path.join(".")||"(root)"}: ${Ee.message}`).join("; ")}}function cde(e,t,n){const a=WN(e);if(a===null)return null;if(!a.ok)return{ok:!1,error:a.error};const s=lde(t);return s===null?null:zN({serverUrl:n,token:s,fields:NN,...a.patch})}function ude(){const e=cde(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}function dde(){const e=WN(location.search);return e===null||!e.ok?null:e.patch}function mde(e,t){return!e.ok||t===null?e:{ok:!0,config:Ty(e.config,t)}}const $C=5,QC=3,pde=[300,900];let fde=0;function hde(e){if(typeof e!="object"||e===null)return!1;const t=e;return"tracks"in t&&(t.nextCursor===null||typeof t.nextCursor=="string")}const gde=/^(10\.|127\.|192\.168\.|169\.254\.|172\.(1[6-9]|2\d|3[01])\.)/;function vde(e){let t;try{t=new URL(e).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}`:gde.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 yde(e){const{client:t,deviceIds:n,nameById:a,pageSize:s,maxRows:m,refreshMs:f,maxAgeMs:p}=e,{sinceMs:h,untilMs:u,devicesResolved:S}=e,w=e.includeStationary===!0,[C,E]=I.useState(mc),[R,T]=I.useState(!1),[j,D]=I.useState(!1),[z,q]=I.useState(null),[L,K]=I.useState(0),J=I.useRef(mc);J.current=C;const $=I.useRef(!1),F=I.useRef(!1),ue=I.useRef(0),we=I.useRef(null),Ee=I.useRef(Date.now()),Me=I.useRef(a);Me.current=a;const ce=I.useRef(e.channel);ce.current=e.channel;const Se=I.useRef(null);I.useEffect(()=>{lue()},[]);const Re=n.join(","),Q=I.useCallback(async(ke,Ie=0)=>{const vt=`feed-${String(++fde)}`,He=performance.now();try{const Ae=await t.listRecentTracks(ke),$e=performance.now(),Oe=Py($e-He,Dy(He,$e)),At={requestId:vt,waitMs:Math.round(Ie),...Oe};return hde(Ae)?{ok:!0,page:Ae,timing:At}:(oi("request invalid",{...At,channel:ce.current}),{ok:!1,message:"unexpected response shape"})}catch(Ae){const $e=Ae instanceof Error?Ae.message:String(Ae),Oe=performance.now();return oi("listRecentTracks failed",{error:$e,devices:ke.deviceIds.length,limit:ke.limit,since:ke.since,cursor:ke.cursor??null,requestId:vt,channel:ce.current,waitMs:Math.round(Ie),...Py(Oe-He,Dy(He,Oe))}),{ok:!1,message:$e}}},[t]),me=I.useCallback((ke,Ie)=>{oi("request complete",{...ke,channel:ce.current,...Ie})},[]),xe=I.useCallback(()=>{if($.current){F.current=!0,Se.current===null&&(Se.current=performance.now());return}const ke=J.current;if(!FC(ke,m)||n.length===0)return;const Ie=Se.current;Se.current=null;const vt=Ie===null?0:performance.now()-Ie;$.current=!0,D(!0);const He=BC(s,n.length),Ae=$ue({anchorMs:Ee.current,maxAgeMs:p,...h!==void 0?{sinceMs:h}:{},...u!==void 0?{untilMs:u}:{}}),$e=UC(ke)!==null;Q({deviceIds:[...n],since:Ae.since,limit:He,projection:"slim",...w?{includeStationary:!0}:{},...Ae.until!==void 0?{until:Ae.until}:{},...(()=>{const Oe=UC(ke);return Oe!==null?{cursor:Oe}:{}})()},vt).then(Oe=>{if(Oe.ok){const Sa=performance.now(),Zn=IC(Oe.page.tracks,Me.current),qn=zue(J.current,Zn,Oe.page.nextCursor);J.current=qn,E(qn),me(Oe.timing,{rows:Zn.length,devices:n.length,limit:He,paged:$e,parseMs:Math.round(performance.now()-Sa)}),ue.current=0,q(null),T(!0);return}const At=ue.current,Vt=pde[At];if(At+1<QC&&Vt!==void 0){ue.current=At+1,oi("page failed — retrying",{attempt:At+1,of:QC,backoffMs:Vt}),we.current=setTimeout(()=>{we.current=null,Ce.current()},Vt);return}ue.current=0;const Pn=que(J.current);J.current=Pn,E(Pn),q(Oe.message),T(!0)}).finally(()=>{if($.current=!1,D(!1),Bue(J.current)){Ce.current();return}F.current&&(F.current=!1,Ce.current())})},[Q,me,n,Re,s,m,p,h,u,w]),Ce=I.useRef(xe);Ce.current=xe;const re=I.useCallback(()=>{if($.current||n.length===0)return Promise.resolve();const ke=Fue(J.current);if(ke===null)return pe.current(),Promise.resolve();$.current=!0;const Ie=BC(s,n.length);return(async()=>{let vt=null,He=0,Ae=!0;for(;Ae&&He<$C;){const $e=await Q({deviceIds:[...n],since:ke,limit:Ie,projection:"slim",...w?{includeStationary:!0}:{},...u!==void 0?{until:u}:{},...vt!==null?{cursor:vt}:{}});if(!$e.ok)return;const Oe=$e.page,At=performance.now(),Vt=IC(Oe.tracks,Me.current),Pn=Uue(J.current,Vt,Oe.nextCursor);J.current=Pn.state,E(Pn.state),me($e.timing,{rows:Vt.length,devices:n.length,limit:Ie,paged:vt!==null,delta:!0,parseMs:Math.round(performance.now()-At)}),q(null),Ae=Pn.gap,vt=Pn.deltaCursor,He+=1}Ae&&oi("delta drain hit its page bound — newer rows may be missing",{since:ke,pages:He,bound:$C})})().finally(()=>{$.current=!1,F.current&&(F.current=!1,Ce.current())})},[Q,me,n,Re,s,xe,u,w]),B=I.useCallback(()=>{we.current!==null&&(clearTimeout(we.current),we.current=null),ue.current=0},[]),ae=I.useCallback(()=>{B(),q(null),T(!1),Ce.current()},[B]),pe=I.useRef(()=>{}),ge=I.useCallback(()=>{B(),Ee.current=Date.now(),F.current=!1,J.current=mc,E(mc),T(!1),D(!1),q(null),K(ke=>ke+1)},[B]),H=I.useCallback(()=>{B(),Ee.current=Date.now(),F.current=!1;const ke=Lue(J.current);J.current=ke,E(ke),ke.rows.length===0&&T(!1),D(!1),q(null),K(Ie=>Ie+1)},[B]),ee=`${Re}|${p}|${h??""}|${u??""}|${w?"1":"0"}`,Te=I.useRef(ee);return I.useEffect(()=>{Te.current!==ee&&(Te.current=ee,!(J.current.rows.length===0&&!R)&&ge())},[ee,ge,R]),I.useEffect(()=>{if(n.length===0){S&&T(!0);return}xe()},[L,Re,S]),I.useEffect(()=>{if(f<=0||n.length===0||!Que(u,Date.now()))return;const ke=setInterval(()=>{re()},f);return()=>clearInterval(ke)},[f,re,n.length,u]),pe.current=ae,I.useEffect(()=>B,[B]),{rows:C.rows,retry:ae,loading:!R,loadingMore:j&&R,error:z,hasMore:FC(C,m),loadMore:xe,refresh:re,reload:H}}const bde=3,Sde=250;function xde(e){const{urls:t,token:n,paused:a,enabled:s}=e,m=I.useRef(0),f=I.useRef(0),p=I.useRef(!1),h=I.useRef(t),u=I.useRef(t[0]??"");h.current=t;const S=t[0]??"";u.current!==S&&(u.current=S,m.current=0),I.useEffect(()=>{if(p.current=!1,!s||a)return;let w=!1;const C=()=>{if(!(w||p.current))for(;f.current<bde;){const E=h.current,R=m.current;if(R>=E.length)return;m.current=R+1;const T=E[R];T===void 0||T.length===0||(f.current+=1,kue(T,n).finally(()=>{f.current=Math.max(0,f.current-1),C()}))}};return C(),()=>{w=!0,p.current=!0}},[s,a,n,t.length])}const kde=.5,YN=56,wde=88;function Mde(e){return e<=0?0:Math.min(e*kde,wde)}function VC(e){return e>=YN}function Cde(e,t,n){return e==="gallery"&&!t&&!n}function Ade(e){const{root:t,onRefresh:n,enabled:a}=e,[s,m]=I.useState(0),f=I.useRef(null),p=I.useRef(0);p.current=s;const h=I.useRef(n);h.current=n;const u=I.useCallback(()=>{f.current=null,m(0)},[]);return I.useEffect(()=>{if(!a||t===null)return;const S=R=>{if(t.scrollTop>0){f.current=null;return}const T=R.touches[0];f.current=T!==void 0?T.clientY:null},w=R=>{const T=f.current;if(T===null)return;const j=R.touches[0];if(j!==void 0){if(t.scrollTop>0){f.current=null,m(0);return}m(Mde(j.clientY-T))}},C=()=>{if(f.current===null)return;const R=p.current;u(),VC(R)&&h.current()},E={passive:!0};return t.addEventListener("touchstart",S,E),t.addEventListener("touchmove",w,E),t.addEventListener("touchend",C,E),t.addEventListener("touchcancel",u,E),()=>{t.removeEventListener("touchstart",S),t.removeEventListener("touchmove",w),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",u)}},[t,a,u]),{distance:s,armed:VC(s)}}const Hd=8,GC=10,Ede=400,Rde=8;function ZC({message:e,palette:t}){return I.useEffect(()=>{Ta(Gce(e)),Ta(xm("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 _de({client:e,initialConfig:t}){const[n,a]=I.useState(t),[s,m]=I.useState({}),[f,p]=I.useState(()=>window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0),[h,u]=I.useState(()=>Date.now()),[S,w]=I.useState(null);I.useEffect(()=>{let be=!1;return e.listDevices().then(_e=>{be||w(_e)}).catch(()=>{be||w([])}),()=>{be=!0}},[e]);const C=I.useMemo(()=>{const be=new Map;for(const _e of S??[])be.set(_e.id,ace(_e.id,_e.name??`Camera ${_e.id}`,n.deviceNames));for(const[_e,Nt]of Object.entries(n.deviceNames)){const An=Number(_e);Number.isInteger(An)&&!be.has(An)&&Nt.trim().length>0&&be.set(An,Nt)}return be},[S,n.deviceNames]),[E,R]=I.useState(()=>new Map),[T,j]=I.useState(()=>new Map),D=I.useMemo(()=>pce(n.kindLabels),[n.kindLabels]),z=I.useMemo(()=>zle(n.labels),[n.labels]),q=I.useMemo(()=>n.deviceIds.length>0?n.deviceIds:S===null?[]:Oce(S),[n.deviceIds,S]);I.useEffect(()=>{if(q.length===0)return;let be=!1;return e.listEventKinds([...q]).then(_e=>{be||(R(uce(_e)),j(dce(_e)))}).catch(()=>{oi("event-kind taxonomy unavailable — class filter is exact-id only")}),()=>{be=!0}},[e,q]);const L=yde({client:e,deviceIds:q,nameById:C,pageSize:n.pageSize,maxRows:n.maxRows,refreshMs:n.refreshMs,maxAgeMs:n.maxAgeMs,channel:vde(n.serverUrl),devicesResolved:n.deviceIds.length>0||S!==null,...n.showStationary?{includeStationary:!0}:{},...n.sinceMs!==void 0?{sinceMs:n.sinceMs}:{},...n.untilMs!==void 0?{untilMs:n.untilMs}:{}}),K=n.searchMode==="semantic"?n.search.trim():"",[J,$]=I.useState({query:"",rows:[],loading:!1});I.useEffect(()=>{if(K.length===0||q.length===0){$({query:"",rows:[],loading:!1});return}let be=!1;return $(_e=>({..._e,query:K,loading:!0})),e.searchObjectEvents({text:K,limit:n.semanticLimit,minScore:n.semanticMinScore,...q.length===1&&q[0]!==void 0?{deviceId:q[0]}:{},...n.sinceMs!==void 0?{since:n.sinceMs}:{},...n.untilMs!==void 0?{until:n.untilMs}:{}}).then(_e=>{be||$({query:K,rows:Zue(_e,C),loading:!1})}).catch(_e=>{be||(oi("searchObjectEvents failed",{error:_e instanceof Error?_e.message:String(_e)}),$({query:K,rows:[],loading:!1}))}),()=>{be=!0}},[e,K,q,C,n.semanticLimit,n.semanticMinScore,n.sinceMs,n.untilMs]);const F=K.length>0,ue=I.useMemo(()=>new Set(n.reviewedTrackIds),[n.reviewedTrackIds]),we=be=>ue.size===0?[...be]:be.map(_e=>ue.has(_e.trackId)?{..._e,reviewed:!0}:_e),Ee=I.useMemo(()=>we(OC(NC(L.rows,C),s)),[L.rows,C,ue,s]),Me=I.useMemo(()=>we(OC(NC(J.rows,C),s)),[J.rows,C,ue,s]),ce=I.useMemo(()=>{const be={debug:n.filterDebug,train:n.filterTrain,favourited:n.filterFavourited,reviewedTrackIds:n.reviewedTrackIds},_e=TC(Ee,n.classes,n.search,E,n.attrs,be);if(F){const Nt=TC(Me,n.classes,"",E,n.attrs,be);return Kue(Nt,_e,n.sort)}return KN(_e,n.sort)},[F,Me,Ee,n.classes,n.attrs,n.filterDebug,n.filterTrain,n.filterFavourited,n.reviewedTrackIds,n.search,n.sort,E]),Se=UN(n.theme,f),Re=I.useRef(null),[Q,me]=I.useState(null),xe=I.useRef(null),Ce=I.useRef(L.loadMore);Ce.current=L.loadMore;const re=I.useRef(L.refresh);re.current=L.refresh;const B=I.useRef(L.reload);B.current=L.reload;const ae=I.useCallback(be=>{if(be.type==="setConfig"){a(_e=>Ty(_e,be.patch));return}if(be.type==="setWindow"){a(_e=>Ty(_e,nue(be)));return}if(be.type==="setTrackFlagPatches"){m(be.patches);return}if(be.type==="refresh"){re.current().finally(()=>Ta(Xce()));return}if(be.type==="reload"){B.current();return}if(be.type==="loadMore"){Ce.current();return}if(be.type==="ping"){Ta(Wce());return}Re.current?.scrollTo({top:0,left:0,behavior:"smooth"})},[]);I.useEffect(()=>(window.__camstackEvents={setConfig:be=>{const _e=Ud({type:"setConfig",patch:be});_e!==null&&ae(_e)},setWindow:be=>{const _e=Ud({type:"setWindow",...be});_e!==null&&ae(_e)},setTrackFlagPatches:be=>{const _e=Ud({type:"setTrackFlagPatches",patches:be});_e!==null&&ae(_e)},refresh:()=>ae({type:"refresh"}),reload:()=>ae({type:"reload"}),loadMore:()=>ae({type:"loadMore"}),scrollToTop:()=>ae({type:"scrollToTop"}),ping:()=>ae({type:"ping"})},nu(be=>{const _e=Ud(be);_e!==null&&ae(_e)})),[ae]),I.useEffect(()=>{Ta(Vce(n.view))},[]),I.useEffect(()=>{Ta(F?DC(J.rows.length,ce.length,!1,"semantic"):DC(L.rows.length,ce.length,L.hasMore,"feed"))},[L.rows.length,ce.length,L.hasMore,F,J.rows.length]);const pe=ce.map(be=>be.trackId).join("|");I.useEffect(()=>{Ta(Kce(ce.map(be=>({trackId:be.trackId,deviceId:be.deviceId,bestEventId:be.bestEventId,className:be.className,firstSeen:be.firstSeen,lastSeen:be.lastSeen}))))},[pe]),I.useEffect(()=>{if(L.error!==null&&!F){Ta(xm("error",L.error));return}if(F?J.loading:L.loading){Ta(xm("loading"));return}Ta(xm(ce.length===0?"empty":"ready"))},[L.loading,L.error,ce.length,F,J.loading]),I.useEffect(()=>{const be=window.matchMedia?.("(prefers-color-scheme: dark)");if(!be)return;const _e=Nt=>p(Nt.matches);return be.addEventListener("change",_e),()=>be.removeEventListener("change",_e)},[]),I.useEffect(()=>{document.documentElement.style.colorScheme=Se.colorScheme,document.body.style.background=Se.background},[Se]),I.useEffect(()=>{const be="camstack-events-keyframes";if(document.getElementById(be)!==null)return;const _e=document.createElement("style");_e.id=be,_e.textContent="@keyframes camstack-spin{to{transform:rotate(360deg)}}",document.head.appendChild(_e)},[]),I.useEffect(()=>{const be=setInterval(()=>u(Date.now()),6e4);return()=>clearInterval(be)},[]);const ge=ce.length>0;I.useEffect(()=>{const be=Re.current,_e=xe.current;if(!be||!_e||F||!ge)return;const Nt=new IntersectionObserver(An=>{An.some($a=>$a.isIntersecting)&&Ce.current()},{root:be,rootMargin:`${Ede}px`});return Nt.observe(_e),()=>Nt.disconnect()},[n.view,L.hasMore,F,ge]);const H=I.useRef(0);I.useEffect(()=>{if(F||L.loading||L.loadingMore||!L.hasMore)return;const be=Re.current;if(!be||ce.length===0)return;const _e=n.view==="reel";if((_e?be.clientWidth:be.clientHeight)===0)return;if(_e?be.scrollWidth>be.clientWidth+1:be.scrollHeight>be.clientHeight+1){H.current=0;return}H.current>=Rde||(H.current+=1,Ce.current())},[ce.length,L.loading,L.loadingMore,L.hasMore,F,n.view]);const ee=Ade({root:Q,enabled:Cde(n.view,F,n.nativePullToRefresh),onRefresh:()=>{re.current()}}),Te=I.useRef(null);I.useEffect(()=>{const be=Q;if(!n.nativePullToRefresh||be===null){Te.current=null;return}const _e=()=>{const Nt=n.view==="gallery"&&!F&&be.scrollTop<=0;Te.current!==Nt&&(Te.current=Nt,Ta(Yce(Nt)))};return _e(),be.addEventListener("scroll",_e,{passive:!0}),()=>be.removeEventListener("scroll",_e)},[Q,n.nativePullToRefresh,n.view,F]);const ke=m0(n.thumbSize),Ie=nce(n.thumbSize),vt=Xle(n.thumbSize,window.devicePixelRatio||1),He=n.view==="reel",[Ae,$e]=I.useState(!1),[Oe,At]=I.useState({scrollLeft:0,scrollTop:0,viewportWidth:0,viewportHeight:0});I.useEffect(()=>{const be=Q;if(be===null)return;let _e=null;const Nt=()=>{At({scrollLeft:be.scrollLeft,scrollTop:be.scrollTop,viewportWidth:be.clientWidth,viewportHeight:be.clientHeight})},An=()=>{Nt(),$e(!0),_e!==null&&clearTimeout(_e),_e=setTimeout(()=>$e(!1),Sde)};return Nt(),be.addEventListener("scroll",An,{passive:!0}),window.addEventListener("resize",Nt),()=>{be.removeEventListener("scroll",An),window.removeEventListener("resize",Nt),_e!==null&&clearTimeout(_e)}},[Q]);const Vt=I.useMemo(()=>He?Wue(ce,{scrollLeft:Oe.scrollLeft,viewportWidth:Oe.viewportWidth,cardWidth:ke,gap:Hd,rowsPerColumn:n.rows}):ede(ce,{scrollTop:Oe.scrollTop,viewportWidth:Oe.viewportWidth,viewportHeight:Oe.viewportHeight,cardWidth:ke,gap:Hd}),[He,ce,Oe,ke,n.rows]),Pn=I.useMemo(()=>Vt.map(be=>LN(n.serverUrl,be.bestEventId,vt)),[Vt,n.serverUrl,vt]);xde({urls:Pn,token:n.token,paused:Ae,enabled:!L.loading&&ce.length>0});const Sa=I.useCallback(be=>{Ta(Zce({trackId:be.trackId,deviceId:be.deviceId,bestEventId:be.bestEventId,className:be.className,firstSeen:be.firstSeen,lastSeen:be.lastSeen}))},[]),Zn=He?{display:"grid",gridTemplateRows:`repeat(${n.rows}, ${Ie}px)`,gridAutoFlow:"column",gridAutoColumns:`${ke}px`,gap:Hd,alignContent:"start"}:{display:"grid",gridTemplateColumns:n.columns==="auto"?`repeat(auto-fill, minmax(${ke}px, 1fr))`:`repeat(${n.columns}, minmax(0, 1fr))`,gap:Hd,alignContent:"start"},qn=F?J.loading:L.loading,Cn=!F&&L.loadingMore&&ce.length>0,oa=!F&&!L.hasMore&&!L.loadingMore&&ce.length>0,xa=!F&&L.error!==null,Xt=!qn&&!xa&&ce.length===0;return v.jsxs("div",{ref:be=>{Re.current=be,me(_e=>_e===be?_e:be)},"data-testid":"events-scroller",className:He?"events-reel-scroller":void 0,style:{position:"fixed",inset:0,background:Se.background,color:Se.text,fontFamily:"system-ui, -apple-system, sans-serif",overflowX:He?"auto":"hidden",overflowY:He?"hidden":"auto",padding:He?`${tce}px ${GC}px`:GC,boxSizing:"border-box",WebkitOverflowScrolling:"touch"},children:[ee.distance>0&&v.jsx("div",{"data-testid":"pull-indicator","data-armed":ee.armed?"true":"false","aria-hidden":!0,style:{position:"absolute",top:Math.max(0,ee.distance-28),left:0,right:0,display:"flex",justifyContent:"center",pointerEvents:"none",zIndex:2,opacity:Math.min(1,ee.distance/YN)},children:v.jsx("span",{style:{width:22,height:22,borderRadius:999,border:`2px solid ${Se.chip}`,borderTopColor:Se.textMuted,background:Se.card,boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transform:`rotate(${ee.distance*4}deg)`,animation:L.loadingMore?"camstack-spin 700ms linear infinite":void 0}})}),xa&&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:Bd(n,"error")}),v.jsx("button",{type:"button","data-testid":"state-retry",onClick:()=>L.retry(),style:{marginTop:10,font:"inherit",fontSize:12,color:Se.text,background:Se.card,border:`1px solid ${Se.border}`,borderRadius:8,padding:"5px 14px",cursor:"pointer"},children:Bd(n,"retry")})]}),Xt&&v.jsx("div",{"data-testid":"state-empty",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:Se.textMuted,fontSize:13},children:Bd(n,"empty")}),qn&&ce.length===0&&v.jsx("div",{"data-testid":"state-loading",style:Zn,children:Array.from({length:He?8:12},(be,_e)=>v.jsx("div",{style:{width:He?ke:"100%",height:He?Ie:void 0,aspectRatio:He?void 0:"1 / 1",borderRadius:10,background:Se.skeleton,border:`1px solid ${Se.border}`,boxSizing:"border-box",opacity:.6}},`skeleton-${_e}`))}),v.jsxs("div",{style:Zn,children:[ce.map((be,_e)=>v.jsx(Aue,{row:be,eagerImages:!He&&_e<8,serverUrl:n.serverUrl,token:n.token,thumbPx:vt,width:He?`${ke}px`:"100%",heroPx:ke,variant:He?"reel":"gallery",iconId:mce(be.className,T,HN(be)),kindLabels:D,labels:z,scrollRoot:Q,fields:n.fields,showAdminFlags:n.showAdminFlags===!0,palette:Se,nowMs:h,onClick:Sa},be.trackId)),Cn&&v.jsx("div",{"data-testid":"tail-loading","aria-label":z.loadingMore,style:{width:He?ke:"100%",height:He?Ie:void 0,aspectRatio:He?void 0:"1 / 1",borderRadius:10,background:Se.skeleton,border:`1px solid ${Se.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 ${Se.chip}`,borderTopColor:Se.textMuted,animation:"camstack-spin 700ms linear infinite"}})}),oa&&v.jsx("div",{"data-testid":"tail-end",style:{display:"flex",alignItems:"center",justifyContent:"center",color:Se.textMuted,fontSize:11,opacity:.75,padding:He?"0 12px":"10px 0",width:He?"max-content":"100%",height:He?ke:void 0,gridColumn:He?"auto":"1 / -1",whiteSpace:"nowrap"},children:Bd(n,"end")}),v.jsx("div",{ref:xe,style:{width:1,height:1,gridRow:He?1:"auto"},"aria-hidden":!0})]})]})}function Ide(){const e=Sp("events",()=>window.__CAMSTACK_EVENTS__,zN,ude,{urlFirst:!0}),t=I.useMemo(()=>dde(),[]),n=I.useMemo(()=>e===null?null:mde(e,t),[e,t]),a=I.useMemo(()=>{if(n===null||!n.ok)return null;const m=cp({serverUrl:n.config.serverUrl,token:n.config.token});return{system:m,client:Oue(m,n.config.entity)}},[n]);I.useEffect(()=>{if(a)return()=>a.system.close()},[a]);const s=UN(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(_de,{client:a.client,initialConfig:n.config}):v.jsx(ZC,{message:"Failed to initialise the events embed",palette:s}):v.jsx(ZC,{message:n.error,palette:s})}const Zm={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"},Tde=Object.keys(Zm),Nde=X(o(),o()).optional();function Ode(e){if(e===null||typeof e!="object")return Zm;const t=e,n={...Zm};for(const a of Tde){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return n}const XN=O(["auto","high","mid","low"]).catch("auto"),jde=tt([G("auto"),l().int().min(1)]),JN=d({enabled:A(),motion:A(),motionHoldSec:l().optional(),audio:O(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:M(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),av=O(["off","top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"]),Pde=d({motionBoxes:A().optional(),motionBadge:av.optional(),audioMeter:av.optional(),occupancy:av.optional(),stats:A().optional()}),Dde=d({cw:l(),ch:l()}),zde=d({serverUrl:o().min(1),token:o().min(1),devices:M(l().int().nonnegative()).min(1),layout:jde,quality:XN,showName:A(),showBadges:A(),muted:A(),paused:A(),highlight:JN.optional(),activeOnly:A().optional(),showBoxes:A().optional(),audioOnIds:M(l().int().nonnegative()).optional(),pausedIds:M(l().int().nonnegative()).optional(),snapshots:X(o(),o()).optional(),ptzIds:M(l().int().nonnegative()).optional(),overlays:X(o(),Pde).optional(),editable:A().optional(),spans:X(o(),Dde).optional(),labels:Nde});function e5(e){if(e==null)return{ok:!1,error:"config is required"};const t=zde.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 Lde=1,t5=O(["auto","high","mid","low"]),qde=tt([G("auto"),l().int().min(1)]),n5=d({enabled:A(),motion:A(),audio:O(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:M(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),Bde=d({devices:M(l().int().nonnegative()).min(1),layout:qde,quality:t5,showName:A(),audioOnIds:M(l().int().nonnegative()).optional(),activeOnly:A().optional(),boxes:A().optional(),highlight:n5.optional()}),Ude="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Fde(e){let t="",n=0;for(;n<e.length;){const a=e[n];if(a===void 0)return null;let s,m;if(a<128)s=a,m=0;else if((a&224)===192)s=a&31,m=1;else if((a&240)===224)s=a&15,m=2;else if((a&248)===240)s=a&7,m=3;else return null;for(let f=1;f<=m;f++){const p=e[n+f];if(p===void 0||(p&192)!==128)return null;s=s<<6|p&63}n+=m+1,t+=String.fromCodePoint(s)}return t}function Hde(e){if(e.length%4===1)return null;const t=[];for(const s of e){const m=Ude.indexOf(s);if(m<0)return null;t.push(m)}const n=[];for(let s=0;s<t.length;s+=4){const m=t[s],f=t[s+1];if(m===void 0||f===void 0)return null;const p=t[s+2],h=t[s+3];n.push(m<<2|f>>4),p!==void 0&&n.push((f&15)<<4|p>>2),h!==void 0&&p!==void 0&&n.push((p&3)<<6|h)}const a=Fde(n);if(a===null)return null;try{return JSON.parse(a)}catch{return null}}function g0(e,t){return e.startsWith(t)?e.slice(t.length):e}function a5(e){const n=new URLSearchParams(g0(e,"#")).get("t");return n!==null&&n.length>0?n:null}function $de(e,t){return new URLSearchParams(g0(e,"?")).has("v")||a5(t)!==null}function KC(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 qa(e){return{ok:!1,error:e}}function Qde(e,t){const n=new URLSearchParams(g0(e,"?")),a=n.get("mode");if(a!==null&&a!=="grid")return qa(`unsupported mode "${a}"`);const s=n.get("v");if(s===null)return qa("missing share-link version (v)");if(s!==String(Lde))return qa(`unsupported share-link version "${s}"`);const m=n.get("devices"),f=m===null?null:KC(m);if(f===null||f.length===0)return qa("invalid or missing devices list");const p=n.get("layout");let h;if(p===null||p==="auto")h="auto";else if(/^\d+$/.test(p)&&Number(p)>=1)h=Number(p);else return qa(`invalid layout "${p}"`);const u=n.get("q")??"auto",S=t5.safeParse(u),w=S.success?S.data:"auto",C=n.get("names")??"0";if(C!=="0"&&C!=="1")return qa(`invalid names flag "${C}"`);const E=n.get("audio");let R;if(E!==null){const $=KC(E);if($===null)return qa(`invalid audio list "${E}"`);R=$}const T=n.get("activeOnly");if(T!==null&&T!=="0"&&T!=="1")return qa(`invalid activeOnly flag "${T}"`);const j=T==="1",D=n.get("boxes");if(D!==null&&D!=="0"&&D!=="1")return qa(`invalid boxes flag "${D}"`);const z=D==="1",q=n.get("hl");let L;if(q!==null){const $=Hde(q),F=n5.safeParse($);if($===null||!F.success)return qa("invalid highlight config (hl)");L=F.data}const K={devices:[...f],layout:h,quality:w,showName:C==="1",...R!==void 0&&R.length>0?{audioOnIds:[...R]}:{},...j?{activeOnly:!0}:{},...z?{boxes:!0}:{},...L!==void 0?{highlight:L}:{}},J=Bde.safeParse(K);return J.success?{ok:!0,params:J.data,token:a5(t)}:qa(J.error.issues.map($=>`${$.path.join(".")||"(root)"}: ${$.message}`).join("; "))}function Vde(e,t,n){if(!$de(e,t))return null;const a=Qde(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,m={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 e5(m)}function Gde(){const e=Vde(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}const Km=16/9,WC={cols:0,rows:0,cellW:0,cellH:0,wallW:0,wallH:0};function YC(e,t,n,a,s){const m=Math.min(a/e,s/t*Km),f=m/Km;return{cols:e,rows:t,cellW:m,cellH:f,wallW:Math.min(e,n)*m,wallH:t*f,empty:e*t-n}}function XC(e){return{cols:e.cols,rows:e.rows,cellW:e.cellW,cellH:e.cellH,wallW:e.wallW,wallH:e.wallH}}const JC=1e-9;function Zde(e,t){const n=e.cellW*e.cellH,a=t.cellW*t.cellH,s=Math.max(n,a,1);return n-a>s*JC?!0:a-n>s*JC?!1:e.empty!==t.empty?e.empty<t.empty:e.rows<t.rows}function Kde(e,t,n,a){if(e<=0||t<=0||n<=0)return WC;if(typeof a=="number"&&a>=1){const m=Math.floor(a);return XC(YC(m,Math.ceil(e/m),e,t,n))}let s=null;for(let m=1;m<=e;m++){const f=Math.ceil(e/m);if(Math.ceil(e/f)!==m)continue;const p=YC(f,m,e,t,n);(s===null||Zde(p,s))&&(s=p)}return s===null?WC:XC(s)}function Wde(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 Yde(e,t){if(e.length===0||t.cellW<=0||t.cellH<=0)return[];const n=[];return Wde(e,t.cols).forEach((s,m)=>{const f=(t.wallW-s.length*t.cellW)/2;s.forEach((p,h)=>{n.push({deviceId:p,x:f+h*t.cellW,y:m*t.cellH,w:t.cellW,h:t.cellH})})}),n}const eA={wallW:0,wallH:0,placements:[]};function Xde(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 Jde(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 eme(e,t,n){const a=new Set,s=[];let m=0;const f=(p,h,u,S)=>{for(let w=p;w<p+S;w++)for(let C=h;C<h+u;C++)if(a.has(`${w}:${C}`))return!1;return!0};for(const p of e){const{cw:h,ch:u}=Xde(t[String(p)],n),S=m+u+e.length;let w=!1;for(let C=0;C<=S&&!w;C++)for(let E=0;E+h<=n;E++)if(f(C,E,h,u)){for(let R=C;R<C+u;R++)for(let T=E;T<E+h;T++)a.add(`${R}:${T}`);s.push({deviceId:p,col:E,row:C,cw:h,ch:u}),m=Math.max(m,C+u),w=!0;break}}return{cells:s,rows:m,cols:n}}function tme(e,t,n,a,s){const m=Kde(e.length,t,n,a);if(!Jde(s)||m.cols<=0)return{wallW:m.wallW,wallH:m.wallH,placements:Yde(e,m)};if(e.length===0||t<=0||n<=0)return eA;const f=eme(e,s??{},m.cols);if(f.rows<=0)return eA;const p=Math.min(t/f.cols,n/f.rows*Km),h=p/Km;return{wallW:f.cells.reduce((S,w)=>Math.max(S,w.col+w.cw),0)*p,wallH:f.rows*h,placements:f.cells.map(S=>({deviceId:S.deviceId,x:S.col*p,y:S.row*h,w:S.cw*p,h:S.ch*h}))}}function i5(){const[e,t]=I.useState(null),[n,a]=I.useState("idle"),s=I.useRef(null),m=I.useRef(null),f=I.useRef(null),p=I.useRef(0),h=I.useRef(null),u=kte(),S=wte(),w=Mte(),C=I.useRef({start:u.mutateAsync,answer:S.mutateAsync,stop:w.mutateAsync});C.current={start:u.mutateAsync,answer:S.mutateAsync,stop:w.mutateAsync};const E=I.useCallback(()=>{if(s.current){try{s.current.close()}catch{}s.current=null}if(m.current){for(const D of m.current.getTracks())try{D.stop()}catch{}m.current=null}},[]),R=I.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=I.useCallback(async D=>{if(h.current===D){p.current+=1,h.current=null,t(null),a("idle"),await R();return}p.current+=1;const z=p.current;h.current=D,t(D),a("starting");let q;try{q=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{z===p.current&&(h.current=null,t(null),a("error"));return}if(z!==p.current){for(const K of q.getTracks())K.stop();return}if(await R(),z!==p.current){for(const K of q.getTracks())K.stop();return}let L=null;try{m.current=q;const K=await C.current.start({deviceId:D});if(z!==p.current){try{await C.current.stop({deviceId:D,sessionId:K.sessionId})}catch{}E();return}f.current={deviceId:D,sessionId:K.sessionId},L=new RTCPeerConnection,s.current=L,L.oniceconnectionstatechange=()=>{if(z!==p.current||!L)return;const $=L.iceConnectionState;$==="connected"||$==="completed"?a("talking"):($==="failed"||$==="closed"||$==="disconnected")&&(h.current=null,t(null),a("idle"),R())};for(const $ of q.getAudioTracks())L.addTrack($,q);await L.setRemoteDescription({type:"offer",sdp:K.sdpOffer});const J=await L.createAnswer();if(await L.setLocalDescription(J),z!==p.current)return;await C.current.answer({deviceId:D,sessionId:K.sessionId,sdpAnswer:L.localDescription?.sdp??J.sdp??""})}catch{if(L)try{L.close()}catch{}E();const K=f.current;if(f.current=null,K)try{await C.current.stop({deviceId:K.deviceId,sessionId:K.sessionId})}catch{}z===p.current&&(h.current=null,t(null),a("error"))}},[R,E]),j=I.useCallback(D=>{if(D===null){p.current+=1,h.current=null,t(null),a("idle"),R();return}h.current!==D&&T(D)},[R,T]);return I.useEffect(()=>()=>{p.current+=1,R()},[R]),{activeMicId:e,micState:n,toggleMic:D=>{T(D)},setActiveMic:j}}const nme=6e3,ame=500;function ime(e,t){const n=I.useRef(new Map),[,a]=I.useState(0),s=t?.motion??!1,m=t?.audio??"off",f=t?.audioDb??-30,p=t?.audioHoldSec??5,h=t?.detection??!1,u=t?.detectionHoldSec??3,S=t?.detectionClasses??[],w=(R,T)=>{n.current.set(R,Date.now()+T),a(j=>j+1)};si(Ke.MotionOnMotionChanged,R=>{if(!s)return;const T=R.data;T&&T.detected&&w(T.deviceId,nme)}),si(Ke.PipelineAudioInferenceResult,R=>{if(m==="off")return;const T=R.data;if(!T)return;(m==="sensor"?T.frame.detections.length>0:(T.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=f)&&w(T.deviceId,p*1e3)}),si(Ke.DetectionResult,R=>{if(!h)return;const T=R.data;if(!T)return;T.frame.detections.some(D=>S.length===0||S.includes(D.macroClass))&&w(T.frame.deviceId,u*1e3)}),I.useEffect(()=>{const R=setInterval(()=>a(T=>T+1),ame);return()=>clearInterval(R)},[]);const C=Date.now(),E=new Set;for(const R of e){const T=n.current.get(R);T!==void 0&&C<T&&E.add(R)}return E}function rme(e){return{type:"tileOpen",deviceId:e}}function ome(e){return{type:"audioToggle",deviceId:e}}function sme(e){return{type:"pauseToggle",deviceId:e}}function lme(e){return{type:"ptzOpen",deviceId:e}}function cme(e,t){return{type:"cellPanelOpen",deviceId:e,panel:t}}function ume(e){return{type:"tileRemove",deviceId:e}}function dme(e,t,n){return{type:"tileResize",deviceId:e,cw:t,ch:n}}function r5(e,t,n){return{type:"state",state:e,...t!==void 0?{message:t}:{},...n!==void 0?{commands:n}:{}}}function mme(e){return{type:"layout",tiles:e}}function ii(e){an(e)}const pme=["top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"];function tA(e){return typeof e=="string"&&pme.includes(e)}const fme={"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 o5(e){return{position:"absolute",display:"flex",...fme[e]}}const s5=[-60,-53,-46,-39,-32,-24],hme=s5.length,iv=["#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444"];function gme(e){const t=Math.min(Math.max(0,e),iv.length-1);return iv[t]??iv[0]}function vme(e){if(e===null||!Number.isFinite(e))return 0;let t=0;for(const n of s5)e>=n&&(t+=1);return t}function yme(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 nA=[8,11,14,17,21,26],rv={horizontal:{width:8,height:16},vertical:{width:24,height:7},compactWidth:4};function bme(e,t){if(e==="vertical")return rv.vertical;if(e==="horizontal")return rv.horizontal;const n=nA[t]??nA[0];return{width:rv.compactWidth,height:n}}function Sme(e){const t=Array.from({length:hme},(n,a)=>a);return e==="vertical"?[...t].reverse():t}function ho(e){return typeof e=="object"&&e!==null}function xme(e){if(!ho(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 m of a){if(!ho(m)||!ho(m.bbox))continue;const{x:f,y:p,w:h,h:u}=m.bbox;typeof f!="number"||typeof p!="number"||typeof h!="number"||typeof u!="number"||!(h>0)||!(u>0)||s.push({x:f/t,y:p/n,w:h/t,h:u/n,pixelCount:typeof m.pixelCount=="number"?m.pixelCount:0})}return s}function kme(e){return!Number.isFinite(e)||e<=0?.08:Math.min(.28,.08+e/4e3*.28)}function aA(e){if(!ho(e))return[];const t=ho(e.frame)?e.frame.byClass:void 0,n=ho(t)?t:e.byClass;if(!ho(n))return[];const a=[];for(const[s,m]of Object.entries(n))typeof m!="number"||!Number.isFinite(m)||m<=0||a.push({className:s,count:Math.round(m)});return a.sort((s,m)=>m.count-s.count||s.className.localeCompare(m.className))}function wme(e,t,n){if(n<=0)return 0;const a=t-e;return a<=0?0:Math.round(a*1e3/n)}function Mme(e){if(e===null)return"—";const t=[e.resolution,`${e.fps}fps`];return e.dropped>0&&t.push(`${e.dropped} dropped`),t.join(" · ")}const Cme=1200,Ame=1e3;function Eme({deviceId:e}){const[t,n]=I.useState([]),a=I.useRef(void 0);return si(Ke.MotionAnalysis,s=>{const m=s.data;!m||m.deviceId!==e||(n(xme(m)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),Cme))}),I.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,m)=>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,${kme(s.pixelCount)})`}},`${s.x}:${s.y}:${s.w}:${s.h}:${m}`))})}function Rme({deviceId:e,anchor:t}){const[n,a]=I.useState(null);si(Ke.PipelineAudioInferenceResult,h=>{const u=h.data;!u||u.deviceId!==e||a(u.frame.level?.dbfs??null)});const s=vme(n),m=yme(t);if(m===null)return null;const f=m==="horizontal",p=m==="vertical";return v.jsx("div",{style:{...o5(t),pointerEvents:"none"},children:v.jsx("span",{style:{display:"flex",flexDirection:p?"column":"row",alignItems:p||f?"center":"flex-end",gap:p||f?4:3,padding:f||p?"4px 8px":"3px 6px",borderRadius:8,background:"rgba(0,0,0,0.7)"},children:Sme(m).map(h=>{const u=h<s,S=bme(m,h);return v.jsx("span",{style:{width:S.width,height:S.height,borderRadius:2,background:u?gme(h):"#71717a",opacity:u?1:.35}},h)})})})}function _me(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 m=s.call(a,{deviceId:t});return m instanceof Promise?m:Promise.resolve(m)}function Ime({system:e,deviceId:t,anchor:n}){const[a,s]=I.useState([]);return I.useEffect(()=>{let m=!1;const f=_me(e.trpcClient,t);if(f!==null)return f.then(p=>{m||s(aA(p))}).catch(()=>{m||s([])}),()=>{m=!0}},[e,t]),si(Ke.ZoneAnalyticsOccupancyChanged,m=>{const f=m.data;f.deviceId===t&&s(aA(f))}),a.length===0?null:v.jsx("div",{style:{...o5(n),gap:4,pointerEvents:"none"},children:a.slice(0,4).map(m=>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:`${m.className} ${m.count}`},m.className))})}function Tme({containerRef:e}){const[t,n]=I.useState(null),a=I.useRef(null);return I.useEffect(()=>{const s=()=>{const f=e.current?.querySelector("video");if(!f){n(null);return}const p=typeof f.getVideoPlaybackQuality=="function"?f.getVideoPlaybackQuality():null,h=p?.totalVideoFrames??0,u=Date.now(),S=a.current;a.current={frames:h,at:u},n({resolution:f.videoWidth>0?`${f.videoWidth}x${f.videoHeight}`:"—",fps:S===null?0:wme(S.frames,h,u-S.at),dropped:p?.droppedVideoFrames??0})};s();const m=setInterval(s,Ame);return()=>{clearInterval(m),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:Mme(t)})}const Nme=1e4,iA=1e3,rA=[0,5e3,15e3,3e4],Ome=4;function jme(e){const t=Math.max(0,Math.min(e,rA.length-1));return rA[t]??0}function Pme(e){return!e.playing||e.lastFrameAt===null?!1:e.nowMs-e.lastFrameAt>=e.stallMs}function Dme(e){const{containerRef:t,playing:n,onRecover:a,stallMs:s=Nme}=e,m=e.now??Date.now,[f,p]=I.useState({recovering:!1,attempts:0}),h=I.useRef(null),u=I.useRef(0),S=I.useRef(0),w=I.useRef(a);w.current=a;const C=I.useRef(m);C.current=m;const E=I.useCallback(()=>{const R=C.current(),T=h.current;h.current=R,u.current>0&&T!==null&&R-T<s&&(u.current=0,p({recovering:!1,attempts:0}))},[s]);return I.useEffect(()=>{if(!n){h.current=null;return}const T=t.current?.querySelector("video");if(!T)return;let j=!1,D=null;if(typeof T.requestVideoFrameCallback=="function"){const L=()=>{j||(E(),D=T.requestVideoFrameCallback?.(L)??null)};return D=T.requestVideoFrameCallback(L),()=>{j=!0,D!==null&&T.cancelVideoFrameCallback?.(D)}}let z=T.currentTime;const q=setInterval(()=>{if(j)return;const L=T.currentTime;L!==z&&(z=L,E())},iA);return()=>{j=!0,clearInterval(q)}},[n,t,E]),I.useEffect(()=>{if(!n)return;const R=setInterval(()=>{const T=C.current();if(T<S.current||!Pme({lastFrameAt:h.current,nowMs:T,stallMs:s,playing:n})||u.current>=Ome)return;const j=u.current;u.current=j+1,h.current=T,S.current=T+jme(j+1)+s,p({recovering:!0,attempts:j+1}),w.current()},iA);return()=>clearInterval(R)},[n,s]),f}const zme=300,Lme=130,qme=["devices","viewOptions"],Bme={inline:qme,overflow:!1},Ume={inline:[],overflow:!0};function Fme(e,t){return e>=zme&&t>=Lme?Bme:Ume}const Hme=120,$me=68;function Qme(e,t,n){return e&&t>=Hme&&n>=$me}const Vme=16/9,Gme={left:0,top:0,width:0,height:0},oA=.5;function Zme(e,t,n){if(!(e>0)||!(t>0))return Gme;const a={left:0,top:0,width:e,height:t};if(!Number.isFinite(n))return a;const s=Math.min(e,t*n),m=s/n;return e-s<oA&&t-m<oA?a:{left:(e-s)/2,top:(t-m)/2,width:s,height:m}}const Kme=500;function l5(e,t,n){const{motion:a,detection:s}=Sle(e.trpcClient,t),m=I.useRef(0),f=I.useRef(0),p=I.useRef(0),h=I.useRef(!1),[,u]=I.useState(0),S=n?.audio??"off",w=n?.audioDb??-30,C=n?.audioHoldSec??5,E=n?.motionHoldSec??0,R=n?.detectionHoldSec??3,T=n?.detectionClasses??[],j=T.join(",");if(si(Ke.MotionOnMotionChanged,z=>{const q=z.data;!q||q.deviceId!==t||!n?.motion||(q.detected===!0?(p.current=Date.now()+Math.max(1,E)*1e3,h.current=!0,u(L=>L+1)):q.detected===!1&&h.current&&(p.current=Date.now()+E*1e3,h.current=!1,u(L=>L+1)))}),si(Ke.PipelineAudioInferenceResult,z=>{const q=z.data;if(!q||q.deviceId!==t||S==="off")return;(S==="sensor"?q.frame.detections.length>0:(q.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=w)&&(m.current=Date.now()+C*1e3,u(K=>K+1))}),I.useEffect(()=>{if(!s)return;s.detections.some(q=>T.length===0||T.includes(q.macroClass))&&(f.current=Date.now()+R*1e3,u(q=>q+1))},[s,R,j]),I.useEffect(()=>{const z=a!==null;(z||h.current)&&(p.current=Date.now()+E*1e3,z||u(q=>q+1)),h.current=z},[a,E]),I.useEffect(()=>{const z=setInterval(()=>u(q=>q+1),Kme);return()=>clearInterval(z)},[]),!n?.enabled)return null;const D=Date.now();return n.detection&&D<f.current?"detection":S!=="off"&&D<m.current?"audio":n.motion&&(a!==null||D<p.current)?"motion":null}const Ls={motion:"#DC2626",audio:"#3B82F6",detection:"#22C55E"},Wme=2500,Yme={person:"#f59e0b",vehicle:"#3b82f6",animal:"#22c55e",face:"#a855f7",plate:"#ec4899"},Xme="#ef4444";function Jme(e){return Yme[e]??Xme}function $d(e){return e<0?0:e>1?1:e}function epe(e){if(e.width<=0||e.height<=0)return[];const t=[];for(const n of e.detections){const{bbox:a}=n,s=$d(a.x/e.width),m=$d(a.y/e.height),f=$d((a.x+a.width)/e.width),p=$d((a.y+a.height)/e.height);f<=s||p<=m||t.push({label:n.macroClass,score:n.score,x1:s,y1:m,x2:f,y2:p})}return t}function tpe({deviceId:e}){const[t,n]=I.useState([]),a=I.useRef(void 0);return si(Ke.DetectionResult,s=>{const m=s.data;!m||m.frame.deviceId!==e||(n(epe(m.frame)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),Wme))}),I.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,m)=>{const f=Jme(s.label),p=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} ${p}%`})},`${s.label}-${m}`)})})}function npe(e,t,n,a){const s=Number.isFinite(e)&&e>0?e:0,m=Number.isFinite(t)&&t>0?t:0;if(!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)return{width:s,height:m};const f=Math.min(s/n,m/a);return{width:n*f,height:a*f}}function ape(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function sA(e,t,n,a){if(!Number.isFinite(e))return 0;const s=ape(t,n,a);return Math.max(-s,Math.min(s,e))}const ipe=4,lA=8,rpe=300;function cA(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function ope({children:e,onTap:t}){const n=I.useRef(null),a=I.useRef(null),s=I.useRef(new Map),m=I.useRef(1),f=I.useRef(0),p=I.useRef(0),h=I.useRef(null),u=I.useRef(null),S=I.useRef(0),w=()=>{const D=a.current;D&&(D.style.transform=`translate(${f.current}px, ${p.current}px) scale(${m.current})`)},C=()=>{const D=n.current?.getBoundingClientRect();if(!D||D.width<=0||D.height<=0)return;const z=a.current?.querySelector("video")??null,q=z?null:a.current?.querySelector("img")??null,L=z?.videoWidth??q?.naturalWidth??0,K=z?.videoHeight??q?.naturalHeight??0,J=npe(D.width,D.height,L,K);f.current=sA(f.current,D.width,J.width,m.current),p.current=sA(p.current,D.height,J.height,m.current)},E=()=>{m.current=1,f.current=0,p.current=0,w()},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 z=[...s.current.values()],q=z[0],L=z[1];q&&L&&(h.current={dist:cA(q,L),scale:m.current,cx:(q.x+L.x)/2,cy:(q.y+L.y)/2,tx:f.current,ty:p.current}),u.current=null}else s.current.size===1&&(u.current={x:D.clientX,y:D.clientY,tx:f.current,ty:p.current,moved:!1})},T=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 q=[...s.current.values()],L=q[0],K=q[1];if(!L||!K)return;const J=cA(L,K);h.current.dist>0&&(m.current=Math.max(1,Math.min(ipe,h.current.scale*(J/h.current.dist))));const $=(L.x+K.x)/2,F=(L.y+K.y)/2;f.current=h.current.tx+($-h.current.cx),p.current=h.current.ty+(F-h.current.cy),C(),w();return}const z=u.current;if(s.current.size===1&&z){const q=D.clientX-z.x,L=D.clientY-z.y;(Math.abs(q)>lA||Math.abs(L)>lA)&&(z.moved=!0),m.current>1&&(f.current=z.tx+q,p.current=z.ty+L,C(),w())}},j=D=>{const z=s.current.size===1,q=u.current;if(s.current.delete(D.pointerId),s.current.size<2&&(h.current=null),s.current.size===0&&(u.current=null,z&&q&&!q.moved)){const L=Date.now();L-S.current<rpe?(S.current=0,E()):(S.current=L,t())}};return v.jsx("div",{ref:n,style:{position:"absolute",inset:0,overflow:"hidden",touchAction:"none"},onPointerDown:R,onPointerMove:T,onPointerUp:j,onPointerCancel:j,children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%",transformOrigin:"center center",willChange:"transform"},children:e})})}function spe(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 lpe(e,t){const n=t[0];return n===void 0?null:spe(e,n.url)}const cpe=3500;function upe(e){return e==="auto"?{kind:"adaptive"}:{kind:"profile",profile:e}}function dpe({system:e,deviceId:t,name:n,online:a,quality:s,muted:m,paused:f,showName:p,audioActive:h,micActive:u,onTogglePause:S,onToggleAudio:w,onToggleMic:C,onOpen:E,ptzSupported:R,onPtz:T,cellW:j,cellH:D,onCellPanel:z,highlight:q,showBoxes:L,overlay:K,reconnectSignal:J,onStall:$,posterUrl:F,labels:ue=Zm,editable:we,span:Ee,onRemove:Me,onResize:ce}){const{handleOffer:Se,getIceServers:Re,addIceCandidate:Q,getIceCandidates:me,closeSession:xe,getSessionState:Ce}=CN(e.trpcClient,t),re=l5(e,t,q),B=I.useRef(null),[ae,pe]=I.useState(0),[ge,H]=I.useState("idle"),ee=Dme({containerRef:B,playing:ge==="playing"&&!f,onRecover:()=>{pe(Ye=>Ye+1),$?.(t)}}),[Te,ke]=I.useState(void 0);I.useEffect(()=>{if(F||f)return;let Ye=!1;const En=j!==void 0&&j>0?Math.round(j):void 0;return e.trpcClient.snapshot.getSnapshotLinks.query({targets:[{deviceId:t,...En!==void 0?{width:En}:{}}]}).then(mi=>{if(Ye)return;const Oa=lpe(e.serverUrl,mi??[]);Oa!==null&&ke(Oa)}).catch(()=>{}),()=>{Ye=!0}},[F,f,e,t,j]);const Ie=F??Te,vt=I.useMemo(()=>upe(s),[s]),He=`grid:${t}:${s}`,Ae=I.useMemo(()=>(Ye,En)=>Se(vt,Ye,En),[Se,vt]),$e=I.useMemo(()=>(Ye,En,mi)=>Se(mi,En,Ye),[Se]),[Oe,At]=I.useState(!1),Vt=I.useRef(null),Pn=()=>{Vt.current&&clearTimeout(Vt.current),Vt.current=setTimeout(()=>At(!1),cpe)},Sa=()=>{At(!0),Pn()},Zn=()=>{At(Ye=>{const En=!Ye;return En&&Pn(),En})},qn=Fme(j??0,D??0),Cn=Ye=>{Ye.stopPropagation(),Sa()},oa=j!==void 0&&D!==void 0&&j>0&&D>0,xa=Zme(j??0,D??0,Vme),Xt=oa?{position:"absolute",left:xa.left,top:xa.top,width:xa.width,height:xa.height}:{position:"absolute",inset:0},be=Math.max(1,Math.round(Ee?.cw??1)),_e=Math.max(1,Math.round(Ee?.ch??1)),Nt=oa&&j!==void 0?j/be:0,An=oa&&D!==void 0?D/_e:0,$a=Qme(we===!0,j??0,D??0);return I.useEffect(()=>()=>{Vt.current&&clearTimeout(Vt.current)},[]),v.jsxs("div",{ref:B,"data-stall-recovering":ee.recovering?"true":void 0,style:{position:"relative",width:"100%",height:"100%",background:"#000"},children:[v.jsxs("div",{style:Xt,children:[v.jsx(ope,{onTap:Zn,children:f?v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#fafaf9"},children:v.jsx(dA,{size:28})}):v.jsx(h4,{serverUrl:e.serverUrl,streamKey:He,autoPlay:!0,muted:m,showControls:!1,className:"w-full h-full",handleOffer:Ae,reoffer:$e,getSessionState:Ce,getIceServers:Re,addIceCandidate:Q,getIceCandidates:me,closeSession:xe,reconnectSignal:(J??0)+ae,onStateChange:H,posterUrl:Ie,onClientNetworkSample:s==="auto"?Ye=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...Ye}).catch(()=>{})}:void 0},He)}),L&&!f?v.jsx(tpe,{deviceId:t}):null,K?.motionBoxes===!0&&!f?v.jsx(Eme,{deviceId:t}):null]}),tA(K?.audioMeter)&&!f?v.jsx(Rme,{deviceId:t,anchor:K.audioMeter}):null,tA(K?.occupancy)&&!f?v.jsx(Ime,{system:e,deviceId:t,anchor:K.occupancy}):null,K?.stats===!0&&!f?v.jsx(Tme,{containerRef:B}):null,re&&(()=>{const Ye=q?.appearance,En=re==="motion"?Ye?.motionColor??Ls.motion:re==="audio"?Ye?.audioColor??Ls.audio:Ye?.detectionColor??Ls.detection,mi=Ye?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${mi}px solid ${En}`,boxShadow:`inset 0 0 12px ${En}`,pointerEvents:"none"}})})(),(p||Oe)&&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:p||Oe?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:Oe?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(vr,{label:f?ue.play:ue.pause,big:!0,enabled:Oe,onClick:Ye=>{Cn(Ye),S(t)},children:f?v.jsx(dA,{size:22}):v.jsx(mpe,{size:22})})}),v.jsxs("div",{style:{position:"absolute",left:8,bottom:8,display:"flex",gap:8,pointerEvents:"none"},children:[v.jsx(vr,{label:h?ue.mute:ue.listen,active:h,enabled:Oe,onClick:Ye=>{Cn(Ye),w(t)},children:h?v.jsx(ppe,{size:18}):v.jsx(fpe,{size:18})}),v.jsx(vr,{label:u?ue.stopTalk:ue.talk,active:u,enabled:Oe,onClick:Ye=>{Cn(Ye),C(t)},children:v.jsx(hpe,{size:18,muted:!u})}),R&&T&&(!z||!qn.overflow)?v.jsx(vr,{label:ue.ptz,enabled:Oe,onClick:Ye=>{Cn(Ye),T(t)},children:v.jsx(xpe,{size:18})}):null,z?qn.inline.map(Ye=>v.jsx(vr,{label:Ye==="devices"?ue.linkedDevices:ue.viewOptions,enabled:Oe,onClick:En=>{Cn(En),z(t,Ye)},children:Ye==="devices"?v.jsx(vpe,{size:18}):v.jsx(ype,{size:18})},Ye)):null,z&&qn.overflow?v.jsx(vr,{label:ue.moreActions,enabled:Oe,onClick:Ye=>{Cn(Ye),z(t,"actions")},children:v.jsx(bpe,{size:18})}):null]}),v.jsx("div",{style:{position:"absolute",right:8,bottom:8,pointerEvents:"none"},children:v.jsx(vr,{label:ue.open,enabled:Oe,onClick:Ye=>{Cn(Ye),E(t)},children:v.jsx(gpe,{size:18})})}),$a&&Me?v.jsx("div",{style:{position:"absolute",right:8,top:8,pointerEvents:"none"},children:v.jsx(vr,{label:ue.removeFromView,enabled:Oe,onClick:Ye=>{Cn(Ye),Me(t)},children:v.jsx(Spe,{size:18})})}):null,$a&&ce?v.jsxs(v.Fragment,{children:[v.jsx(uA,{axis:"x",label:ue.resizeWidth,enabled:Oe,track:Nt,span:be,onSpan:Ye=>{Sa(),ce(t,Ye,_e)}}),v.jsx(uA,{axis:"y",label:ue.resizeHeight,enabled:Oe,track:An,span:_e,onSpan:Ye=>{Sa(),ce(t,be,Ye)}})]}):null]})]})}function uA({axis:e,label:t,enabled:n,track:a,span:s,onSpan:m}){const f=I.useRef(null),p=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:p(h),base:s}},onPointerMove:h=>{if(f.current===null||!(a>0))return;h.stopPropagation();const u=Math.round((p(h)-f.current.origin)/a),S=Math.max(1,f.current.base+u);S!==s&&m(S)},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 vr({children:e,label:t,onClick:n,big:a=!1,active:s=!1,enabled:m=!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:m?"auto":"none"},children:e})}const Pr={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function dA({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 mpe({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 ppe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 fpe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 hpe({size:e,muted:t}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 gpe({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 vpe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 ype({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 bpe({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 Spe({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,children:v.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function xpe({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Pr,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 kpe({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 mA({message:e}){return I.useEffect(()=>ii(r5("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 wpe=["setDevices","setSpans"];function Mpe(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function Cpe({system:e,config:t}){const[n,a]=I.useState(t.devices),[s,m]=I.useState(()=>new Set(t.audioOnIds??[])),f=i5(),p=I.useRef(f.setActiveMic);p.current=f.setActiveMic;const[h,u]=I.useState(()=>new Set(t.pausedIds??[])),[S,w]=I.useState(t.highlight),[C,E]=I.useState(t.activeOnly??!1),[R,T]=I.useState(t.showBoxes??!1),[j,D]=I.useState(()=>t.overlays??{}),[z,q]=I.useState(()=>t.spans??{}),L=ime(n,S),K=I.useMemo(()=>C?n.filter(H=>L.has(H)):n,[C,n,L]),[J,$]=I.useState(t.quality),[F,ue]=I.useState(t.layout),[we,Ee]=I.useState(t.showName),[Me,ce]=I.useState(0),Se=I.useMemo(()=>Ode(t.labels),[t.labels]),[Re,Q]=I.useState(()=>t.snapshots??{}),me=I.useMemo(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[xe,Ce]=I.useState({w:window.innerWidth,h:window.innerHeight}),re=Se.camera,[B,ae]=I.useState({});I.useEffect(()=>{let H=!1;return e.trpcClient.deviceManager.listAll.query({deviceIds:[...n],projection:"slim"}).then(ee=>{if(H)return;const Te={};for(const ke of ee)Te[ke.id]={name:ke.name??`${re} ${ke.id}`,online:ke.online??!1};ae(Te)}).catch(()=>{}),()=>{H=!0}},[e,n,re]),I.useEffect(()=>(window.__camstackGrid={setAudioOn:H=>m(new Set(H)),setMutedAll:H=>{H&&m(new Set)},setActiveMic:H=>p.current(H),setHighlight:H=>w(H),setActiveOnly:H=>E(H),setShowBoxes:H=>T(H),setOverlays:H=>D(H),setPaused:H=>u(new Set(H)),setDevices:H=>a(ee=>Mpe(ee,H)?ee:[...H]),setSpans:H=>q(H),setQuality:H=>$(H),setLayout:H=>ue(H),setShowName:Ee,setShowBadges:()=>{},setSnapshots:H=>Q(H),fit:(H,ee)=>Ce({w:H,h:ee}),reconnect:()=>ce(H=>H+1)},ii(r5("ready",void 0,wpe)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),I.useEffect(()=>nu(H=>{const ee=window.__camstackGrid;if(!ee)return;switch(H.kind){case"setAudioOn":ee.setAudioOn(H.value);break;case"setMutedAll":ee.setMutedAll(H.value);break;case"setActiveMic":ee.setActiveMic(H.value);break;case"setHighlight":ee.setHighlight(H.value);break;case"setActiveOnly":ee.setActiveOnly(H.value);break;case"setShowBoxes":ee.setShowBoxes(H.value===!0);break;case"setOverlays":ee.setOverlays(H.value);break;case"setPaused":ee.setPaused(H.value);break;case"setDevices":ee.setDevices(H.value);break;case"setSpans":ee.setSpans(H.value);break;case"setQuality":ee.setQuality(XN.parse(H.value));break;case"setLayout":ee.setLayout(H.value);break;case"setShowName":ee.setShowName(H.value);break;case"setShowBadges":ee.setShowBadges(H.value);break;case"setSnapshots":ee.setSnapshots(H.value);break;case"fit":ee.fit(H.w,H.h);break;case"reconnect":ee.reconnect();break}}),[]);const pe=I.useMemo(()=>tme(K,xe.w,xe.h,F,z),[K,xe.w,xe.h,F,z]),ge=I.useRef(null);return I.useEffect(()=>{const H=ge.current;if(!H)return;const ee=[];H.querySelectorAll("[data-device-id]").forEach(Te=>{const ke=Number(Te.dataset.deviceId),Ie=Te.getBoundingClientRect();ee.push({deviceId:ke,rect:{x:Ie.x,y:Ie.y,w:Ie.width,h:Ie.height}})}),ee.length&&ii(mme(ee))},[pe,K]),v.jsxs("div",{ref:ge,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:[C&&K.length===0&&v.jsx("div",{style:{color:"#a1a1aa",fontFamily:"system-ui, sans-serif",fontSize:14,padding:24,textAlign:"center"},children:Se.noActiveCameras}),v.jsx(kpe,{wall:pe,renderTile:(H,ee,Te)=>v.jsx(dpe,{system:e,deviceId:H,name:B[H]?.name??`${Se.camera} ${H}`,online:B[H]?.online??!1,quality:J,muted:!s.has(H),paused:h.has(H),showName:we,audioActive:s.has(H),micActive:f.activeMicId===H,onTogglePause:ke=>ii(sme(ke)),onToggleAudio:ke=>ii(ome(ke)),onToggleMic:f.toggleMic,onOpen:ke=>ii(rme(ke)),ptzSupported:me.has(H),onPtz:ke=>ii(lme(ke)),cellW:ee,cellH:Te,onCellPanel:(ke,Ie)=>ii(cme(ke,Ie)),highlight:S,showBoxes:R,overlay:j[String(H)],reconnectSignal:Me,posterUrl:Re[String(H)],editable:t.editable===!0,span:z[String(H)],onRemove:ke=>ii(ume(ke)),onResize:(ke,Ie,vt)=>ii(dme(ke,Ie,vt)),labels:Se})})]})}function Ape(){const e=Sp("grid",()=>window.__CAMSTACK_GRID__,e5,Gde),t=I.useMemo(()=>{if(e===null||!e.ok)return null;const n=cp({serverUrl:e.config.serverUrl,token:e.config.token}),a=new uI({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:n,queryClient:a}},[e]);return I.useEffect(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?v.jsx(ZI,{system:t.system,children:v.jsx(mI,{client:t.queryClient,children:v.jsx(x.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:v.jsx(Cpe,{system:t.system,config:e.config})})})}):v.jsx(mA,{message:"Failed to initialise the grid embed"}):v.jsx(mA,{message:e.error})}const v0=tt([d({kind:G("adaptive")}),d({kind:G("profile"),profile:Mn})]),Epe=d({deviceId:l().int().nonnegative(),target:v0.optional(),muted:A().optional(),stats:A().optional(),snapshot:o().optional()});function Rpe(e){const t=Epe.safeParse(e);return t.success?t.data:null}const _pe=["live","loading","playing","paused","gap","ended","error"];function Ipe(e){return typeof e=="string"&&_pe.includes(e)}const lo="low",pA=5e3;class Tpe{constructor(t){this.deps=t,this.deps.channel.addEventListener("message",this.onMessage)}deps;begun=!1;disposed=!1;lastSentProfile=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==="state"&&Ipe(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,m){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=m,this.deps.onLog?.("playback:intent",{kind:s,deviceId:t,epochMs:n,profile:a,dragId:m})),f}maybeArmPlaybackUpgrade(){if(this.pendingUpgrade===null||this.upgradeTimer!==null||this.disposed)return;this.upgradeTimer=setTimeout(()=>this.firePlaybackUpgrade(),pA);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,pA-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:lo,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,lo,"land",s)?(this.lastCursorMs=n,a!==lo&&(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=lo){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!==lo&&(this.lastSentProfile=lo,this.send({t:"setProfile",profile:lo})),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 Npe(e,t,n,a){return e?.isOpen()?(e.warm(n),e.playRecorded(t,n,a)):!1}const Ope=24e4;function jpe(e,t=Ope){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 Ppe=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus"],fA=["video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp8","video/webm"];function Dpe(e=n=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(n),t){const n=t?.audio?[...Ppe,...fA]:fA;for(const a of n)try{if(e(a))return a}catch{}return""}function zpe(e,t){const n=[...e.getVideoTracks()],a=t?.getAudioTracks()??[],s=a.length>0?a.map(m=>{const f=m.clone();return"enabled"in f&&(f.enabled=!0),f}):[...e.getAudioTracks()];return[...n,...s]}function Lpe(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 qpe(e,t)}function qpe(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 m=()=>{if(s){try{a.drawImage(e,0,0,n.width,n.height)}catch{}requestAnimationFrame(m)}};m();const f=n.captureStream(t),p=f.getVideoTracks()[0];if(p){const h=p.stop.bind(p);p.stop=()=>{s=!1,h()}}return f}function Bpe(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const s=String(a.result??""),m=s.indexOf(",");t(m>=0?s.slice(m+1):s)},a.onerror=()=>n(a.error??new Error("read failed")),a.readAsDataURL(e)})}function Upe(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function Fpe(e){let t=null,n=[],a=null,s="",m=!1;const f=()=>{if(t=null,n=[],m=!1,a){for(const h of a.getTracks())try{h.stop()}catch{}a=null}},p=h=>{f(),e.emit({type:"liveCaptureError",message:h})};return{start(){if(t)return;const h=e.getVideo();if(!h){p("no video");return}if(typeof MediaRecorder>"u"){p("MediaRecorder missing");return}const u=Lpe(h);if(!u){p("no video");return}const S=h.srcObject instanceof MediaStream?h.srcObject:null,w=zpe(u,S);if(S&&S.getAudioTracks().length>0)for(const T of u.getAudioTracks())try{T.stop()}catch{}const C=new MediaStream(w);a=C;const E=w.some(T=>T.kind==="audio"),R=Dpe(void 0,{audio:E});try{t=R?new MediaRecorder(C,{mimeType:R,videoBitsPerSecond:25e5,...E?{audioBitsPerSecond:128e3}:{}}):new MediaRecorder(C)}catch(T){p(T instanceof Error?T.message:"MediaRecorder missing");return}n=[],s=Upe(),m=!1,t.ondataavailable=T=>{T.data&&T.data.size>0&&n.push(T.data)},t.onerror=()=>p("MediaRecorder missing");try{t.start(1e3)}catch(T){p(T instanceof Error?T.message:"MediaRecorder missing")}},stop(){const h=t;if(!h||m){h||p("no video");return}m=!0;const u=s,S=h.mimeType||"video/mp4";h.onstop=()=>{const w=new Blob(n,{type:S});if(f(),w.size===0){e.emit({type:"liveCaptureError",message:"empty capture"});return}Bpe(w).then(C=>{e.emit({type:"liveCaptureStart",id:u,mime:S});const E=jpe(C),R=E.length;E.forEach((T,j)=>{e.emit({type:"liveCaptureChunk",id:u,index:j,total:R,data:T})}),e.emit({type:"liveCaptureDone",id:u})}).catch(C=>{e.emit({type:"liveCaptureError",message:C instanceof Error?C.message:"encode failed"})})};try{typeof h.requestData=="function"&&h.requestData(),h.stop()}catch(w){p(w instanceof Error?w.message:"stop failed")}},abort(){if(t&&t.state!=="inactive")try{t.stop()}catch{}f()}}}const Hpe=8,$pe=2.5;function Qpe(e){return e>=Hpe?"high":e>=$pe?"mid":"low"}function Vpe(e,t){return e.kind==="profile"?e.profile:"low"}function Gpe(e,t){return e.kind==="profile"?e.profile:Qpe(t)}const Zpe=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),target:v0,muted:A(),stats:A().optional(),highlight:JN.optional(),snapshot:o().optional(),initialSeekMs:l().positive().optional()});function qy(e,t){an(t!==void 0?{type:"state",state:e,message:t}:{type:"state",state:e})}function Kpe(e){switch(e){case"playing":return"playing";case"error":return"error";case"connecting":case"disconnected":case"idle":return"connecting"}}function hA(e,t){return Vpe(e)}async function Wpe(){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 m=await s.arrayBuffer(),f=Math.max(1,performance.now()-a);return m.byteLength<1024?null:m.byteLength*8/f/1e3}catch{return null}finally{window.clearTimeout(n)}}function gA(e,t,n,a){a.kind==="adaptive"&&Wpe().then(s=>{if(s===null)return;const m=Gpe(a,s);e.upgradePlayback(t,n,m)})}function Ype(e){return e.kind==="adaptive"?{kind:"adaptive"}:{kind:"profile",profile:e.profile}}function Xpe(e){return e.kind==="adaptive"?"embed:adaptive":`embed:profile:${e.profile}`}function Jpe(e){const t=Zpe.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 vA({message:e}){return I.useEffect(()=>{qy("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 efe({system:e,deviceId:t,initialTarget:n,initialMuted:a,initialStats:s,initialHighlight:m,initialSnapshot:f,initialSeekMs:p}){const[h,u]=I.useState(n);I.useEffect(()=>QN(t),[t]);const S=I.useRef(h);S.current=h;const[w,C]=I.useState(a),[E,R]=I.useState(s),[T,j]=I.useState(m),[D,z]=I.useState(f),[q,L]=I.useState(0),[K,J]=I.useState({w:window.innerWidth,h:window.innerHeight}),$=l5(e,t,T),F=i5(),ue=I.useRef(F.setActiveMic);ue.current=F.setActiveMic;const{handleOffer:we,getIceServers:Ee,addIceCandidate:Me,getIceCandidates:ce,closeSession:Se,getSessionState:Re}=CN(e.trpcClient,t),Q=I.useMemo(()=>Ype(h),[h]),me=I.useMemo(()=>(H,ee,Te)=>we(Q,H,ee,Te),[we,Q]),xe=I.useMemo(()=>(H,ee,Te,ke)=>we(Te,ee,H,ke),[we]),Ce=I.useRef(null),re=I.useRef(null),B=I.useRef("low"),ae=I.useRef(!1),pe=I.useRef(p??null);I.useEffect(()=>{if(!w)return;const H=setInterval(()=>{let ee=0;for(const Te of Array.from(document.querySelectorAll("video"))){Te.muted||(Te.muted=!0,ee++);const ke=Te.srcObject;if(ke instanceof MediaStream)for(const Ie of ke.getAudioTracks())Ie.enabled&&(Ie.enabled=!1,ee++)}ee>0&&an({type:"log",scope:"live-audio",msg:"re-muted",data:{corrected:ee}})},1e3);return()=>clearInterval(H)},[w]),I.useEffect(()=>()=>Ce.current?.dispose(),[]),I.useEffect(()=>{const H=()=>{const Ae=Ce.current;return Ae?.isOpen()?Ae:null},ee=()=>hA(S.current,B.current),Te=(Ae,$e)=>{gA(Ae,t,$e,S.current)},ke=Ae=>{ae.current||(ae.current=!0,an({type:"log",scope:"recorded:session",msg:"pointer move with no open session",data:{what:Ae}}),an({type:"recState",state:"error"}))},Ie=(Ae,$e)=>{const Oe=H();return!Oe||!$e(Oe)?(ke(Ae),!1):(ae.current=!1,!0)},vt=(Ae,$e)=>{Ie("scrubCommit",Oe=>{const At=Oe.landFromScrub(t,Ae,ee(),$e);return At&&Te(Oe,Ae),At})},He=Fpe({emit:an,getVideo:()=>re.current});return window.__camstackEmbed={setMuted:Ae=>C(Ae),setTarget:Ae=>{const $e=v0.safeParse(Ae);$e.success&&u($e.data)},setStats:Ae=>R(Ae),setHighlight:Ae=>j(Ae),setSnapshot:Ae=>z(Ae),setMic:Ae=>ue.current(Ae?t:null),fit:(Ae,$e)=>J({w:Ae,h:$e}),reconnect:()=>L(Ae=>Ae+1),playRecorded:(Ae,$e,Oe)=>{Number.isFinite($e)&&Ie("playRecorded",At=>At.playRecorded(Ae,$e,Oe))},seek:Ae=>{Number.isFinite(Ae)&&Ie("seek",$e=>{const Oe=$e.playRecorded(t,Ae,ee());return Oe&&Te($e,Ae),Oe})},scrubCommit:(Ae,$e)=>{Number.isFinite(Ae)&&vt(Ae,$e)},scrubStart:Ae=>{an({type:"log",scope:"recorded:scrub",msg:"scrubStart",data:{dragId:Ae}}),Ie("scrubStart",$e=>$e.begin(Ae))},scrubTo:(Ae,$e,Oe)=>{if(!Number.isFinite(Ae))return;const At=($e==="fine"||$e==="coarse")&&Number.isFinite(Oe)?{mode:$e,velocityPxPerS:Oe}:void 0;Ie("scrubTo",Vt=>Vt.isActive()?(Vt.retarget(Ae,At),!0):!1)},timelineWarm:Ae=>{Number.isFinite(Ae)&&H()?.warm(Ae)},scrubEnd:Ae=>{Number.isFinite(Ae)&&vt(Ae)},setRate:Ae=>{Number.isFinite(Ae)&&Ie("setRate",$e=>$e.setRate(Ae))},stepFrame:Ae=>{Ae!==1&&Ae!==-1||Ie("stepFrame",$e=>$e.stepFrame(Ae))},goLive:()=>{Ie("goLive",Ae=>Ae.goLive())&&an({type:"recState",state:"live"})},startLiveCapture:()=>He.start(),stopLiveCapture:()=>He.stop()},()=>{He.abort(),window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),I.useEffect(()=>{an({type:"micState",state:F.micState})},[F.micState]),I.useEffect(()=>nu(H=>{const ee=window.__camstackEmbed;if(!ee)return;switch(H.kind){case"setMuted":ee.setMuted(H.value);break;case"setTarget":ee.setTarget(H.value);break;case"setStats":ee.setStats(H.value);break;case"setHighlight":ee.setHighlight(H.value);break;case"setSnapshot":ee.setSnapshot(H.value);break;case"setMic":ee.setMic(H.value);break;case"fit":ee.fit(H.w,H.h);break;case"reconnect":ee.reconnect();break;case"playRecorded":ee.playRecorded(H.deviceId,H.epochMs,H.profile);break;case"seek":ee.seek(H.epochMs??H.value);break;case"scrubCommit":ee.scrubCommit(H.epochMs??H.value,H.dragId);break;case"scrubStart":ee.scrubStart(H.dragId);break;case"scrubTo":ee.scrubTo(H.epochMs??H.value,H.m,H.v);break;case"scrubEnd":ee.scrubEnd(H.epochMs??H.value);break;case"timelineWarm":ee.timelineWarm(H.epochMs??H.value);break;case"setRate":ee.setRate(H.rate??H.value);break;case"stepFrame":{const ke=H.dir;(ke===1||ke===-1)&&ee.stepFrame(ke);break}case"goLive":ee.goLive();break;case"startLiveCapture":ee.startLiveCapture();break;case"stopLiveCapture":ee.stopLiveCapture();break}}),[]);const ge=Xpe(h);return v.jsxs("div",{style:{position:"fixed",left:0,top:0,width:K.w,height:K.h,background:"#000"},children:[v.jsx(h4,{serverUrl:e.serverUrl,streamKey:ge,autoPlay:!0,muted:w,showControls:!1,showStats:E,onPlaybackStats:H=>an({type:"log",scope:"playback",msg:"stats",data:H}),onConnectTiming:H=>an({type:"log",scope:"webrtc-timing",msg:"connect",data:H}),onClientNetworkSample:h.kind==="adaptive"?H=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...H}).catch(()=>{})}:void 0,className:"w-full h-full",handleOffer:me,reoffer:xe,getSessionState:Re,getIceServers:Ee,addIceCandidate:Me,getIceCandidates:ce,closeSession:Se,reconnectSignal:q,posterUrl:D,onStateChange:H=>qy(Kpe(H)),onError:H=>qy("error",H),onReconnectAttempt:H=>an({type:"log",scope:"live:retry",msg:H.kind==="retry"?"auto-retry scheduled":"auto-retry exhausted",data:H}),onControlChannel:H=>{if(Ce.current?.dispose(),ae.current=!1,Ce.current=new Tpe({channel:H,video:()=>re.current,onState:ee=>an({type:"recState",state:ee}),onPosition:ee=>an({type:"position",positionMs:ee}),onLiveProfile:ee=>{B.current=ee,an({type:"log",scope:"adaptive",msg:"live-profile",data:{profile:ee}})},onFirstFrame:()=>an({type:"scrubDrawn"}),onLog:(ee,Te)=>an({type:"log",scope:ee.startsWith("playback:")?"playback":"scrub",msg:ee,data:Te})}),pe.current!==null){const ee=()=>{const Te=pe.current;if(Te===null)return;const ke=hA(S.current,B.current);Npe(Ce.current,t,Te,ke)&&(pe.current=null,Ce.current&&gA(Ce.current,t,Te,S.current),an({type:"log",scope:"recorded:initial-seek",msg:"config-carried seek fired",data:{epochMs:Te,profile:ke}}))};H.readyState==="open"?ee():H.addEventListener("open",ee,{once:!0})}},onVideoElement:H=>{re.current=H}}),$&&(()=>{const H=T?.appearance,ee=$==="motion"?H?.motionColor??Ls.motion:$==="audio"?H?.audioColor??Ls.audio:H?.detectionColor??Ls.detection,Te=H?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${Te}px solid ${ee}`,boxShadow:`inset 0 0 12px ${ee}`,pointerEvents:"none",transform:"translateZ(0)"}})})()]})}function tfe(){const e=Sp("player",()=>window.__CAMSTACK_EMBED__,Jpe),[t,n]=I.useState(null);I.useEffect(()=>{const u=w=>{const C=Rpe(w);C&&n(C)};window.__camstackEmbedPage={setDevice:u};const S=nu(w=>{w.kind==="setDevice"&&u(w.value)});return()=>{window.__camstackEmbedPage&&delete window.__camstackEmbedPage,S()}},[]);const a=I.useMemo(()=>{if(e===null||!e.ok)return null;const u=cp({serverUrl:e.config.serverUrl,token:e.config.token}),S=new uI({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:u,queryClient:S}},[e]);if(I.useEffect(()=>{if(a)return()=>{a.system.close()}},[a]),e===null)return null;if(!e.ok)return v.jsx(vA,{message:e.error});if(!a)return v.jsx(vA,{message:"Failed to initialise the embed player"});const s=t?.deviceId??e.config.deviceId,m=t?.target??e.config.target,f=t?.muted??e.config.muted,p=t?.stats??e.config.stats??!1,h=t!==null?t.snapshot:e.config.snapshot;return v.jsx(ZI,{system:a.system,children:v.jsx(mI,{client:a.queryClient,children:v.jsx(x.Provider,{client:a.system.trpcClient,queryClient:a.queryClient,children:v.jsx(efe,{system:a.system,deviceId:s,initialTarget:m,initialMuted:f,initialStats:p,initialHighlight:e.config.highlight,initialSnapshot:h,initialSeekMs:t===null?e.config.initialSeekMs:void 0},s)})})})}const nfe=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),startMs:l().int().nonnegative().optional()});function afe(e){if(e==null)return{ok:!1,error:"config is required"};const t=nfe.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 ife(e,t){const n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}const yA=360*60*1e3,rfe="scrub unavailable: no open RecordedTrackSession";function Ba(e){an(e)}function un(e,t,n){try{an({type:"log",scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??"")}catch{}}function ofe({system:e,config:t}){I.useEffect(()=>QN(t.deviceId),[t.deviceId]);const n=I.useRef(null),a=I.useRef(0),s=I.useRef(0),m=I.useRef(0),[f,p]=I.useState({w:window.innerWidth,h:window.innerHeight}),h=I.useMemo(()=>async u=>{const S=n.current;if(!S)return;const w=++m.current;s.current=performance.now(),un("loadAt","start",{epochMs:u,window:yA}),Ba({type:"state",state:"loading"});try{const C=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:u,toMs:u+yA});if(w!==m.current){un("loadAt","superseded",{epochMs:u});return}if(un("loadAt","manifest",{playbackUrl:C?.playbackUrl??null,endpoints:C?.playbackEndpoints?.length??0,localMaster:!!C?.localMasterPath}),!C?.playbackUrl){Ba({type:"state",state:"error",message:"no footage"});return}S.src=C.playbackUrl;const E=()=>{if(w!==m.current)return;const R=typeof S.getStartDate=="function"?S.getStartDate():null,T=R instanceof Date&&!Number.isNaN(R.getTime())?R.getTime():u;a.current=T;const j=ife(u,T);if(j>0)try{S.currentTime=j}catch(D){un("loadAt","seek-failed",{msg:String(D)})}S.play().catch(D=>{un("loadAt","play-rejected",{msg:String(D)})}),un("loadAt","seek",{epochMs:u,media0Ms:T,offsetSec:j})};S.readyState>=HTMLMediaElement.HAVE_METADATA?E():S.addEventListener("loadedmetadata",E,{once:!0}),un("loadAt","src-set",{src:C.playbackUrl})}catch(C){un("loadAt","error",{msg:C instanceof Error?C.message:String(C)}),Ba({type:"state",state:"error",message:C instanceof Error?C.message:String(C)})}},[e,t.deviceId]);return I.useEffect(()=>{un("init","mounted",{deviceId:t.deviceId,startMs:t.startMs??null,ua:navigator.userAgent});const u=(S,w)=>{un("scrub","unavailable",{command:S,...w===void 0?{}:{epochMs:w}}),Ba({type:"state",state:"error",message:rfe})};return window.__camstackRecording={seekTo:S=>{un("cmd","seekTo",{epochMs:S}),h(S)},play:()=>{un("cmd","play"),n.current?.play().catch(()=>{})},pause:()=>{un("cmd","pause"),n.current?.pause()},setRate:S=>{un("cmd","setRate",{rate:S}),n.current&&(n.current.playbackRate=S)},fit:(S,w)=>{un("cmd","fit",{w:S,h:w}),p({w:S,h:w})},scrubStart:()=>{un("cmd","scrubStart"),u("scrubStart")},scrubTo:S=>{un("cmd","scrubTo",{epochMs:S}),u("scrubTo",S)},scrubEnd:S=>{un("cmd","scrubEnd",{epochMs:S}),u("scrubEnd",S)}},t.startMs&&t.startMs>0&&h(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording}},[h,t.startMs,t.deviceId]),I.useEffect(()=>nu(u=>{const S=window.__camstackRecording;if(!S)return;switch(u.kind){case"seekTo":S.seekTo(u.value);break;case"play":S.play();break;case"pause":S.pause();break;case"setRate":S.setRate(u.value);break;case"scrubStart":S.scrubStart();break;case"scrubTo":S.scrubTo(u.value);break;case"scrubEnd":S.scrubEnd(u.value);break;case"fit":S.fit(u.w,u.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:u=>un("video","loadedmetadata",{w:u.currentTarget.videoWidth,h:u.currentTarget.videoHeight,dur:u.currentTarget.duration}),onPlaying:()=>{un("video","playing",{vodStartMs:Math.round(performance.now()-s.current)}),Ba({type:"state",state:"playing"})},onPause:()=>Ba({type:"state",state:"paused"}),onEnded:()=>Ba({type:"state",state:"ended"}),onError:u=>{const S=u.currentTarget.error;un("video","error",{code:S?.code??null,message:S?.message??null}),Ba({type:"state",state:"error",message:S?.message||"video error"})},onTimeUpdate:u=>Ba({type:"position",positionMs:a.current+u.currentTarget.currentTime*1e3})})})}function sfe(){const e=Sp("recording",()=>window.__CAMSTACK_RECORDING__,afe),t=I.useMemo(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,cp({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return I.useEffect(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?v.jsx(ofe,{system:t,config:e.config}):(Ba({type:"state",state:"error",message:"init failed"}),null):(Ba({type:"state",state:"error",message:e.error}),null)}function lfe(){const e=window.__CAMSTACK_EMBED_MODE__??new URLSearchParams(location.search).get("mode")??"grid";return e==="player"?v.jsx(tfe,{}):e==="recording"?v.jsx(sfe,{}):e==="events"?v.jsx(Ide,{}):v.jsx(Ape,{})}const bA=document.getElementById("root");bA&&Mj.createRoot(bA).render(v.jsx(lfe,{}));export{gee as C,Cee as E,jI as I,gfe as M,Zee as R,Xc as S,Cfe as T,vfe as W,xte as a,Efe as b,W as c,cte as d,So as e,Afe as f,Mfe as g,wfe as h,yfe as i,v as j,xfe as k,Ig as l,By as m,bj as n,hj as o,vn as p,I as r,kfe as s,eu as u,pm as v};