@camstack/addon-pipeline-orchestrator 1.2.135 → 1.2.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. package/assets/viewer/.viewer-current-files.json +7 -7
  2. package/assets/viewer/.viewer-version +1 -1
  3. package/assets/viewer/_expo/static/js/web/{index-6e7b8880d828dbf6b1980d1155c379b1.js → index-8db91eec14cb0cfa27d39c44f5b6ae16.js} +4 -4
  4. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-FBlH4Wq_.js → MaskShapeCanvas-DI4BY7W2-nd65Mp4-.js} +1 -1
  5. package/assets/viewer/embed/assets/{MotionZonesSettings-DNdnFHso-B_fslMFv.js → MotionZonesSettings-DNdnFHso-NM6J-UWF.js} +1 -1
  6. package/assets/viewer/embed/assets/{PrivacyMaskSettings-DNSLc6ww-CD2tFrNb.js → PrivacyMaskSettings-DNSLc6ww-B3J9k853.js} +1 -1
  7. package/assets/viewer/embed/assets/{SceneMonitorEditor-d_A4kO-M-BsQK-gmH.js → SceneMonitorEditor-d_A4kO-M-Foei8N6A.js} +1 -1
  8. package/assets/viewer/embed/assets/index-ByrygvKy.js +115 -0
  9. package/assets/viewer/embed/assets/index-CXJTH6mq.css +1 -0
  10. package/assets/viewer/embed/index.html +2 -2
  11. package/assets/viewer/index.html +1 -1
  12. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-C79iNoLr.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-BP4opZs8.mjs} +3 -3
  13. package/dist/{hostInit-BCaKh4Yb.mjs → hostInit-D6Zsohl6.mjs} +3 -3
  14. package/dist/index.js +38 -2
  15. package/dist/index.mjs +38 -2
  16. package/dist/remoteEntry.js +1 -1
  17. package/package.json +1 -1
  18. package/assets/viewer/embed/assets/index-0taReYko.css +0 -1
  19. package/assets/viewer/embed/assets/index-CIim4zo0.js +0 -115
@@ -0,0 +1,115 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-DNdnFHso-NM6J-UWF.js","./MaskShapeCanvas-DI4BY7W2-nd65Mp4-.js","./PrivacyMaskSettings-DNSLc6ww-B3J9k853.js","./SceneMonitorEditor-d_A4kO-M-Foei8N6A.js"])))=>i.map(i=>d[i]);
2
+ function xj(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const p=Object.getOwnPropertyDescriptor(a,s);p&&Object.defineProperty(e,s,p.get?p:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const p of s)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function n(s){const p={};return s.integrity&&(p.integrity=s.integrity),s.referrerPolicy&&(p.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?p.credentials="include":s.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function a(s){if(s.ep)return;s.ep=!0;const p=n(s);fetch(s.href,p)}})();function kj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ph={exports:{}},ec={};var ik;function wj(){if(ik)return ec;ik=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,p){var f=null;if(p!==void 0&&(f=""+p),s.key!==void 0&&(f=""+s.key),"key"in s){p={};for(var m in s)m!=="key"&&(p[m]=s[m])}else p=s;return s=p.ref,{$$typeof:e,type:a,key:f,ref:s!==void 0?s:null,props:p}}return ec.Fragment=t,ec.jsx=n,ec.jsxs=n,ec}var rk;function Mj(){return rk||(rk=1,Ph.exports=wj()),Ph.exports}var v=Mj(),Dh={exports:{}},tc={},zh={exports:{}},Lh={};var ok;function Cj(){return ok||(ok=1,(function(e){function t(H,ce){var ke=H.length;H.push(ce);e:for(;0<ke;){var Ee=ke-1>>>1,me=H[Ee];if(0<s(me,ce))H[Ee]=ce,H[ke]=me,ke=Ee;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var ce=H[0],ke=H.pop();if(ke!==ce){H[0]=ke;e:for(var Ee=0,me=H.length,L=me>>>1;Ee<L;){var te=2*(Ee+1)-1,ge=H[te],Se=te+1,ee=H[Se];if(0>s(ge,ke))Se<me&&0>s(ee,ge)?(H[Ee]=ee,H[Se]=ke,Ee=Se):(H[Ee]=ge,H[te]=ke,Ee=te);else if(Se<me&&0>s(ee,ke))H[Ee]=ee,H[Se]=ke,Ee=Se;else break e}}return ce}function s(H,ce){var ke=H.sortIndex-ce.sortIndex;return ke!==0?ke:H.id-ce.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var f=Date,m=f.now();e.unstable_now=function(){return f.now()-m}}var h=[],u=[],x=1,w=null,C=3,E=!1,R=!1,I=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function q(H){for(var ce=n(u);ce!==null;){if(ce.callback===null)a(u);else if(ce.startTime<=H)a(u),ce.sortIndex=ce.expirationTime,t(h,ce);else break;ce=n(u)}}function Z(H){if(I=!1,q(H),!R)if(n(h)!==null)R=!0,J||(J=!0,Me());else{var ce=n(u);ce!==null&&Te(Z,ce.startTime-H)}}var J=!1,$=-1,F=5,de=-1;function we(){return j?!0:!(e.unstable_now()-de<F)}function Ce(){if(j=!1,J){var H=e.unstable_now();de=H;var ce=!0;try{e:{R=!1,I&&(I=!1,z($),$=-1),E=!0;var ke=C;try{t:{for(q(H),w=n(h);w!==null&&!(w.expirationTime>H&&we());){var Ee=w.callback;if(typeof Ee=="function"){w.callback=null,C=w.priorityLevel;var me=Ee(w.expirationTime<=H);if(H=e.unstable_now(),typeof me=="function"){w.callback=me,q(H),ce=!0;break t}w===n(h)&&a(h),q(H)}else a(h);w=n(h)}if(w!==null)ce=!0;else{var L=n(u);L!==null&&Te(Z,L.startTime-H),ce=!1}}break e}finally{w=null,C=ke,E=!1}ce=void 0}}finally{ce?Me():J=!1}}}var Me;if(typeof B=="function")Me=function(){B(Ce)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,oe=Ae.port2;Ae.port1.onmessage=Ce,Me=function(){oe.postMessage(null)}}else Me=function(){D(Ce,0)};function Te(H,ce){$=D(function(){H(e.unstable_now())},ce)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(H){switch(C){case 1:case 2:case 3:var ce=3;break;default:ce=C}var ke=C;C=ce;try{return H()}finally{C=ke}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,ce){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ke=C;C=H;try{return ce()}finally{C=ke}},e.unstable_scheduleCallback=function(H,ce,ke){var Ee=e.unstable_now();switch(typeof ke=="object"&&ke!==null?(ke=ke.delay,ke=typeof ke=="number"&&0<ke?Ee+ke:Ee):ke=Ee,H){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=ke+me,H={id:x++,callback:ce,priorityLevel:H,startTime:ke,expirationTime:me,sortIndex:-1},ke>Ee?(H.sortIndex=ke,t(u,H),n(h)===null&&H===n(u)&&(I?(z($),$=-1):I=!0,Te(Z,ke-Ee))):(H.sortIndex=me,t(h,H),R||E||(R=!0,J||(J=!0,Me()))),H},e.unstable_shouldYield=we,e.unstable_wrapCallback=function(H){var ce=C;return function(){var ke=C;C=ce;try{return H.apply(this,arguments)}finally{C=ke}}}})(Lh)),Lh}var sk;function Aj(){return sk||(sk=1,zh.exports=Cj()),zh.exports}var qh={exports:{}},tt={};var lk;function Ej(){if(lk)return tt;lk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),C=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=C&&L[C]||L["@@iterator"],typeof L=="function"?L:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,j={};function D(L,te,ge){this.props=L,this.context=te,this.refs=j,this.updater=ge||R}D.prototype.isReactComponent={},D.prototype.setState=function(L,te){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,te,"setState")},D.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function z(){}z.prototype=D.prototype;function B(L,te,ge){this.props=L,this.context=te,this.refs=j,this.updater=ge||R}var q=B.prototype=new z;q.constructor=B,I(q,D.prototype),q.isPureReactComponent=!0;var Z=Array.isArray;function J(){}var $={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function de(L,te,ge){var Se=ge.ref;return{$$typeof:e,type:L,key:te,ref:Se!==void 0?Se:null,props:ge}}function we(L,te){return de(L.type,te,L.props)}function Ce(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function Me(L){var te={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ge){return te[ge]})}var Ae=/\/+/g;function oe(L,te){return typeof L=="object"&&L!==null&&L.key!=null?Me(""+L.key):te.toString(36)}function Te(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(J,J):(L.status="pending",L.then(function(te){L.status==="pending"&&(L.status="fulfilled",L.value=te)},function(te){L.status==="pending"&&(L.status="rejected",L.reason=te)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function H(L,te,ge,Se,ee){var ye=typeof L;(ye==="undefined"||ye==="boolean")&&(L=null);var Oe=!1;if(L===null)Oe=!0;else switch(ye){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(L.$$typeof){case e:case t:Oe=!0;break;case x:return Oe=L._init,H(Oe(L._payload),te,ge,Se,ee)}}if(Oe)return ee=ee(L),Oe=Se===""?"."+oe(L,0):Se,Z(ee)?(ge="",Oe!=null&&(ge=Oe.replace(Ae,"$&/")+"/"),H(ee,te,ge,"",function($e){return $e})):ee!=null&&(Ce(ee)&&(ee=we(ee,ge+(ee.key==null||L&&L.key===ee.key?"":(""+ee.key).replace(Ae,"$&/")+"/")+Oe)),te.push(ee)),1;Oe=0;var X=Se===""?".":Se+":";if(Z(L))for(var he=0;he<L.length;he++)Se=L[he],ye=X+oe(Se,he),Oe+=H(Se,te,ge,ye,ee);else if(he=E(L),typeof he=="function")for(L=he.call(L),he=0;!(Se=L.next()).done;)Se=Se.value,ye=X+oe(Se,he++),Oe+=H(Se,te,ge,ye,ee);else if(ye==="object"){if(typeof L.then=="function")return H(Te(L),te,ge,Se,ee);throw te=String(L),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function ce(L,te,ge){if(L==null)return L;var Se=[],ee=0;return H(L,Se,"","",function(ye){return te.call(ge,ye,ee++)}),Se}function ke(L){if(L._status===-1){var te=L._result;te=te(),te.then(function(ge){(L._status===0||L._status===-1)&&(L._status=1,L._result=ge)},function(ge){(L._status===0||L._status===-1)&&(L._status=2,L._result=ge)}),L._status===-1&&(L._status=0,L._result=te)}if(L._status===1)return L._result.default;throw L._result}var Ee=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},me={map:ce,forEach:function(L,te,ge){ce(L,function(){te.apply(this,arguments)},ge)},count:function(L){var te=0;return ce(L,function(){te++}),te},toArray:function(L){return ce(L,function(te){return te})||[]},only:function(L){if(!Ce(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return tt.Activity=w,tt.Children=me,tt.Component=D,tt.Fragment=n,tt.Profiler=s,tt.PureComponent=B,tt.StrictMode=a,tt.Suspense=h,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,tt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},tt.cache=function(L){return function(){return L.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(L,te,ge){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Se=I({},L.props),ee=L.key;if(te!=null)for(ye in te.key!==void 0&&(ee=""+te.key),te)!F.call(te,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&te.ref===void 0||(Se[ye]=te[ye]);var ye=arguments.length-2;if(ye===1)Se.children=ge;else if(1<ye){for(var Oe=Array(ye),X=0;X<ye;X++)Oe[X]=arguments[X+2];Se.children=Oe}return de(L.type,ee,Se)},tt.createContext=function(L){return L={$$typeof:f,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:p,_context:L},L},tt.createElement=function(L,te,ge){var Se,ee={},ye=null;if(te!=null)for(Se in te.key!==void 0&&(ye=""+te.key),te)F.call(te,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(ee[Se]=te[Se]);var Oe=arguments.length-2;if(Oe===1)ee.children=ge;else if(1<Oe){for(var X=Array(Oe),he=0;he<Oe;he++)X[he]=arguments[he+2];ee.children=X}if(L&&L.defaultProps)for(Se in Oe=L.defaultProps,Oe)ee[Se]===void 0&&(ee[Se]=Oe[Se]);return de(L,ye,ee)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(L){return{$$typeof:m,render:L}},tt.isValidElement=Ce,tt.lazy=function(L){return{$$typeof:x,_payload:{_status:-1,_result:L},_init:ke}},tt.memo=function(L,te){return{$$typeof:u,type:L,compare:te===void 0?null:te}},tt.startTransition=function(L){var te=$.T,ge={};$.T=ge;try{var Se=L(),ee=$.S;ee!==null&&ee(ge,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(J,Ee)}catch(ye){Ee(ye)}finally{te!==null&&ge.types!==null&&(te.types=ge.types),$.T=te}},tt.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},tt.use=function(L){return $.H.use(L)},tt.useActionState=function(L,te,ge){return $.H.useActionState(L,te,ge)},tt.useCallback=function(L,te){return $.H.useCallback(L,te)},tt.useContext=function(L){return $.H.useContext(L)},tt.useDebugValue=function(){},tt.useDeferredValue=function(L,te){return $.H.useDeferredValue(L,te)},tt.useEffect=function(L,te){return $.H.useEffect(L,te)},tt.useEffectEvent=function(L){return $.H.useEffectEvent(L)},tt.useId=function(){return $.H.useId()},tt.useImperativeHandle=function(L,te,ge){return $.H.useImperativeHandle(L,te,ge)},tt.useInsertionEffect=function(L,te){return $.H.useInsertionEffect(L,te)},tt.useLayoutEffect=function(L,te){return $.H.useLayoutEffect(L,te)},tt.useMemo=function(L,te){return $.H.useMemo(L,te)},tt.useOptimistic=function(L,te){return $.H.useOptimistic(L,te)},tt.useReducer=function(L,te,ge){return $.H.useReducer(L,te,ge)},tt.useRef=function(L){return $.H.useRef(L)},tt.useState=function(L){return $.H.useState(L)},tt.useSyncExternalStore=function(L,te,ge){return $.H.useSyncExternalStore(L,te,ge)},tt.useTransition=function(){return $.H.useTransition()},tt.version="19.2.3",tt}var ck;function Zy(){return ck||(ck=1,qh.exports=Ej()),qh.exports}var Bh={exports:{}},Dn={};var uk;function Rj(){if(uk)return Dn;uk=1;var e=Zy();function t(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)u+="&args[]="+encodeURIComponent(arguments[x])}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 p(h,u,x){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:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Dn.createPortal=function(h,u){var x=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 p(h,u,null,x)},Dn.flushSync=function(h){var u=f.T,x=a.p;try{if(f.T=null,a.p=2,h)return h()}finally{f.T=u,a.p=x,a.d.f()}},Dn.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))},Dn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Dn.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var x=u.as,w=m(x,u.crossOrigin),C=typeof u.integrity=="string"?u.integrity:void 0,E=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;x==="style"?a.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:w,integrity:C,fetchPriority:E}):x==="script"&&a.d.X(h,{crossOrigin:w,integrity:C,fetchPriority:E,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Dn.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var x=m(u.as,u.crossOrigin);a.d.M(h,{crossOrigin:x,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)},Dn.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var x=u.as,w=m(x,u.crossOrigin);a.d.L(h,x,{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})}},Dn.preloadModule=function(h,u){if(typeof h=="string")if(u){var x=m(u.as,u.crossOrigin);a.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:x,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else a.d.m(h)},Dn.requestFormReset=function(h){a.d.r(h)},Dn.unstable_batchedUpdates=function(h,u){return h(u)},Dn.useFormState=function(h,u,x){return f.H.useFormState(h,u,x)},Dn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Dn.version="19.2.3",Dn}var dk;function EA(){if(dk)return Bh.exports;dk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bh.exports=Rj(),Bh.exports}var pk;function _j(){if(pk)return tc;pk=1;var e=Aj(),t=Zy(),n=EA();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 p(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 m(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(p(i)!==i)throw Error(a(188))}function u(i){var r=i.alternate;if(!r){if(r=p(i),r===null)throw Error(a(188));return r!==i?null:i}for(var c=i,g=r;;){var b=c.return;if(b===null)break;var k=b.alternate;if(k===null){if(g=b.return,g!==null){c=g;continue}break}if(b.child===k.child){for(k=b.child;k;){if(k===c)return h(b),i;if(k===g)return h(b),r;k=k.sibling}throw Error(a(188))}if(c.return!==g.return)c=b,g=k;else{for(var _=!1,P=b.child;P;){if(P===c){_=!0,c=b,g=k;break}if(P===g){_=!0,g=b,c=k;break}P=P.sibling}if(!_){for(P=k.child;P;){if(P===c){_=!0,c=k,g=b;break}if(P===g){_=!0,g=k,c=b;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 x(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=x(i),r!==null)return r;i=i.sibling}return null}var w=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),B=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function Me(i){return i===null||typeof i!="object"?null:(i=Ce&&i[Ce]||i["@@iterator"],typeof i=="function"?i:null)}var Ae=Symbol.for("react.client.reference");function oe(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ae?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case I:return"Fragment";case D:return"Profiler";case j:return"StrictMode";case Z:return"Suspense";case J:return"SuspenseList";case de:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case R:return"Portal";case B:return i.displayName||"Context";case z:return(i._context.displayName||"Context")+".Consumer";case q:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case $:return r=i.displayName||null,r!==null?r:oe(i.type)||"Memo";case F:r=i._payload,i=i._init;try{return oe(i(r))}catch{}}return null}var Te=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ke={pending:!1,data:null,method:null,action:null},Ee=[],me=-1;function L(i){return{current:i}}function te(i){0>me||(i.current=Ee[me],Ee[me]=null,me--)}function ge(i,r){me++,Ee[me]=i.current,i.current=r}var Se=L(null),ee=L(null),ye=L(null),Oe=L(null);function X(i,r){switch(ge(ye,r),ge(ee,i),ge(Se,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Ex(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Ex(r),i=Rx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}te(Se),ge(Se,i)}function he(){te(Se),te(ee),te(ye)}function $e(i){i.memoizedState!==null&&ge(Oe,i);var r=Se.current,c=Rx(r,i.type);r!==c&&(ge(ee,i),ge(Se,c))}function Ne(i){ee.current===i&&(te(Se),te(ee)),Oe.current===i&&(te(Oe),Wl._currentValue=ke)}var nt,Ve;function Xe(i){if(nt===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);nt=r&&r[1]||"",Ve=-1<c.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+nt+i+Ve}var Re=!1;function Ke(i,r){if(!i||Re)return"";Re=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ue){var re=ue}Reflect.construct(i,[],be)}else{try{be.call()}catch(ue){re=ue}i.call(be.prototype)}}else{try{throw Error()}catch(ue){re=ue}(be=i())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ue){if(ue&&re&&typeof ue.stack=="string")return[ue.stack,re.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.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(b=g=0;g<U.length&&!U[g].includes("DetermineComponentFrameRoot");)g++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(g===U.length||b===ie.length)for(g=U.length-1,b=ie.length-1;1<=g&&0<=b&&U[g]!==ie[b];)b--;for(;1<=g&&0<=b;g--,b--)if(U[g]!==ie[b]){if(g!==1||b!==1)do if(g--,b--,0>b||U[g]!==ie[b]){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<=b);break}}}finally{Re=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Xe(c):""}function vt(i,r){switch(i.tag){case 26:case 27:case 5:return Xe(i.type);case 16:return Xe("Lazy");case 13:return i.child!==r&&r!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return Ke(i.type,!1);case 11:return Ke(i.type.render,!1);case 1:return Ke(i.type,!0);case 31:return Xe("Activity");default:return""}}function An(i){try{var r="",c=null;do r+=vt(i,c),c=i,i=i.return;while(i);return r}catch(g){return`
8
+ Error generating stack: `+g.message+`
9
+ `+g.stack}}var Yt=Object.prototype.hasOwnProperty,ln=e.unstable_scheduleCallback,Oa=e.unstable_cancelCallback,Va=e.unstable_shouldYield,Ki=e.unstable_requestPaint,tn=e.unstable_now,xe=e.unstable_getCurrentPriorityLevel,_e=e.unstable_ImmediatePriority,Rt=e.unstable_UserBlockingPriority,fn=e.unstable_NormalPriority,We=e.unstable_LowPriority,jn=e.unstable_IdlePriority,Ga=e.log,Wi=e.unstable_setDisableYieldValue,Qr=null,Rn=null;function ja(i){if(typeof Ga=="function"&&Wi(i),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode(Qr,i)}catch{}}var Ln=Math.clz32?Math.clz32:ll,_m=Math.log,du=Math.LN2;function ll(i){return i>>>=0,i===0?32:31-(_m(i)/du|0)|0}var Zt=256,sa=262144,mi=4194304;function Za(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 Ka(i,r,c){var g=i.pendingLanes;if(g===0)return 0;var b=0,k=i.suspendedLanes,_=i.pingedLanes;i=i.warmLanes;var P=g&134217727;return P!==0?(g=P&~k,g!==0?b=Za(g):(_&=P,_!==0?b=Za(_):c||(c=P&~i,c!==0&&(b=Za(c))))):(P=g&~k,P!==0?b=Za(P):_!==0?b=Za(_):c||(c=g&~i,c!==0&&(b=Za(c)))),b===0?0:r!==0&&r!==b&&(r&k)===0&&(k=b&-b,c=r&-r,k>=c||k===32&&(c&4194048)!==0)?r:b}function fi(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Tm(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 Lo(){var i=mi;return mi<<=1,(mi&62914560)===0&&(mi=4194304),i}function Pa(i){for(var r=[],c=0;31>c;c++)r.push(i);return r}function Yi(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function pu(i,r,c,g,b,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-Ln(c),be=1<<fe;P[fe]=0,U[fe]=-1;var re=ie[fe];if(re!==null)for(ie[fe]=null,fe=0;fe<re.length;fe++){var ue=re[fe];ue!==null&&(ue.lane&=-536870913)}c&=~be}g!==0&&qo(i,g,0),k!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=k&~(_&~r))}function qo(i,r,c){i.pendingLanes|=r,i.suspendedLanes&=~r;var g=31-Ln(r);i.entangledLanes|=r,i.entanglements[g]=i.entanglements[g]|1073741824|c&261930}function Da(i,r){var c=i.entangledLanes|=r;for(i=i.entanglements;c;){var g=31-Ln(c),b=1<<g;b&r|i[g]&r&&(i[g]|=r),c&=~b}}function cl(i,r){var c=r&-r;return c=(c&42)!==0?1:Bo(c),(c&(i.suspendedLanes|r))!==0?0:c}function Bo(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 Uo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ul(){var i=ce.p;return i!==0?i:(i=window.event,i===void 0?32:Yx(i.type))}function dl(i,r){var c=ce.p;try{return ce.p=i,r()}finally{ce.p=c}}var za=Math.random().toString(36).slice(2),kn="__reactFiber$"+za,Pn="__reactProps$"+za,Xi="__reactContainer$"+za,pl="__reactEvents$"+za,mu="__reactListeners$"+za,fu="__reactHandles$"+za,hi="__reactResources$"+za,gi="__reactMarker$"+za;function Vr(i){delete i[kn],delete i[Pn],delete i[pl],delete i[mu],delete i[fu]}function vi(i){var r=i[kn];if(r)return r;for(var c=i.parentNode;c;){if(r=c[Xi]||c[kn]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(i=Px(i);i!==null;){if(c=i[kn])return c;i=Px(i)}return r}i=c,c=i.parentNode}return null}function Ji(i){if(i=i[kn]||i[Xi]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function la(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function er(i){var r=i[hi];return r||(r=i[hi]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function le(i){i[gi]=!0}var qe=new Set,Je={};function kt(i,r){Ye(i,r),Ye(i+"Capture",r)}function Ye(i,r){for(Je[i]=r,i=0;i<r.length;i++)qe.add(r[i])}var _t=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]*$"),Ue={},at={};function Ht(i){return Yt.call(at,i)?!0:Yt.call(Ue,i)?!1:_t.test(i)?at[i]=!0:(Ue[i]=!0,!1)}function $t(i,r,c){if(Ht(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 Fe(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 wt(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 bt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Tt(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Gn(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 b=g.get,k=g.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return b.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 Xt(i){if(!i._valueTracker){var r=Tt(i)?"checked":"value";i._valueTracker=Gn(i,r,""+i[r])}}function Dt(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var c=r.getValue(),g="";return i&&(g=Tt(i)?i.checked?"true":"false":i.value),i=g,i!==c?(r.setValue(i),!0):!1}function qn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var rt=/[\n"\\]/g;function cn(i){return i.replace(rt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ka(i,r,c,g,b,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=""+bt(r)):i.value!==""+bt(r)&&(i.value=""+bt(r)):_!=="submit"&&_!=="reset"||i.removeAttribute("value"),r!=null?et(i,_,bt(r)):c!=null?et(i,_,bt(c)):g!=null&&i.removeAttribute("value"),b==null&&k!=null&&(i.defaultChecked=!!k),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.name=""+bt(P):i.removeAttribute("name")}function Zn(i,r,c,g,b,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)){Xt(i);return}c=c!=null?""+bt(c):"",r=r!=null?""+bt(r):c,P||r===i.value||(i.value=r),i.defaultValue=r}g=g??b,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=_),Xt(i)}function et(i,r,c){r==="number"&&qn(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function ct(i,r,c,g){if(i=i.options,r){r={};for(var b=0;b<c.length;b++)r["$"+c[b]]=!0;for(c=0;c<i.length;c++)b=r.hasOwnProperty("$"+i[c].value),i[c].selected!==b&&(i[c].selected=b),b&&g&&(i[c].defaultSelected=!0)}else{for(c=""+bt(c),r=null,b=0;b<i.length;b++){if(i[b].value===c){i[b].selected=!0,g&&(i[b].defaultSelected=!0);return}r!==null||i[b].disabled||(r=i[b])}r!==null&&(r.selected=!0)}}function Kn(i,r,c){if(r!=null&&(r=""+bt(r),r!==i.value&&(i.value=r),c==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=c!=null?""+bt(c):""}function Gr(i,r,c,g){if(r==null){if(g!=null){if(c!=null)throw Error(a(92));if(Te(g)){if(1<g.length)throw Error(a(93));g=g[0]}c=g}c==null&&(c=""),r=c}c=bt(r),i.defaultValue=c,g=i.textContent,g===c&&g!==""&&g!==null&&(i.value=g),Xt(i)}function Wa(i,r){if(r){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=r;return}}i.textContent=r}var Fo=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 tr(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||Fo.has(r)?r==="float"?i.cssFloat=c:i[r]=(""+c).trim():i[r]=c+"px"}function yi(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 b in r)g=r[b],r.hasOwnProperty(b)&&c[b]!==g&&tr(i,b,g)}else for(var k in r)r.hasOwnProperty(k)&&tr(i,k,r[k])}function Zr(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 v5=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"]]),y5=/^[\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 hu(i){return y5.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function bi(){}var Im=null;function Nm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ho=null,$o=null;function A0(i){var r=Ji(i);if(r&&(i=r.stateNode)){var c=i[Pn]||null;e:switch(i=r.stateNode,r.type){case"input":if(ka(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="'+cn(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var g=c[r];if(g!==i&&g.form===i.form){var b=g[Pn]||null;if(!b)throw Error(a(90));ka(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(r=0;r<c.length;r++)g=c[r],g.form===i.form&&Dt(g)}break e;case"textarea":Kn(i,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&ct(i,!!c.multiple,r,!1)}}}var Om=!1;function E0(i,r,c){if(Om)return i(r,c);Om=!0;try{var g=i(r);return g}finally{if(Om=!1,(Ho!==null||$o!==null)&&(nd(),Ho&&(r=Ho,i=$o,$o=Ho=null,A0(r),i)))for(r=0;r<i.length;r++)A0(i[r])}}function ml(i,r){var c=i.stateNode;if(c===null)return null;var g=c[Pn]||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 Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jm=!1;if(Si)try{var fl={};Object.defineProperty(fl,"passive",{get:function(){jm=!0}}),window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{jm=!1}var nr=null,Pm=null,gu=null;function R0(){if(gu)return gu;var i,r=Pm,c=r.length,g,b="value"in nr?nr.value:nr.textContent,k=b.length;for(i=0;i<c&&r[i]===b[i];i++);var _=c-i;for(g=1;g<=_&&r[c-g]===b[k-g];g++);return gu=b.slice(i,1<g?1-g:void 0)}function vu(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 yu(){return!0}function _0(){return!1}function Wn(i){function r(c,g,b,k,_){this._reactName=c,this._targetInst=b,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)?yu:_0,this.isPropagationStopped=_0,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=yu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),r}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bu=Wn(Kr),hl=w({},Kr,{view:0,detail:0}),b5=Wn(hl),Dm,zm,gl,Su=w({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qm,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!==gl&&(gl&&i.type==="mousemove"?(Dm=i.screenX-gl.screenX,zm=i.screenY-gl.screenY):zm=Dm=0,gl=i),Dm)},movementY:function(i){return"movementY"in i?i.movementY:zm}}),T0=Wn(Su),S5=w({},Su,{dataTransfer:0}),x5=Wn(S5),k5=w({},hl,{relatedTarget:0}),Lm=Wn(k5),w5=w({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),M5=Wn(w5),C5=w({},Kr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),A5=Wn(C5),E5=w({},Kr,{data:0}),I0=Wn(E5),R5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_5={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"},T5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I5(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=T5[i])?!!r[i]:!1}function qm(){return I5}var N5=w({},hl,{key:function(i){if(i.key){var r=R5[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=vu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?_5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qm,charCode:function(i){return i.type==="keypress"?vu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?vu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),O5=Wn(N5),j5=w({},Su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),N0=Wn(j5),P5=w({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qm}),D5=Wn(P5),z5=w({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),L5=Wn(z5),q5=w({},Su,{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}),B5=Wn(q5),U5=w({},Kr,{newState:0,oldState:0}),F5=Wn(U5),H5=[9,13,27,32],Bm=Si&&"CompositionEvent"in window,vl=null;Si&&"documentMode"in document&&(vl=document.documentMode);var $5=Si&&"TextEvent"in window&&!vl,O0=Si&&(!Bm||vl&&8<vl&&11>=vl),j0=" ",P0=!1;function D0(i,r){switch(i){case"keyup":return H5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Qo=!1;function Q5(i,r){switch(i){case"compositionend":return z0(r);case"keypress":return r.which!==32?null:(P0=!0,j0);case"textInput":return i=r.data,i===j0&&P0?null:i;default:return null}}function V5(i,r){if(Qo)return i==="compositionend"||!Bm&&D0(i,r)?(i=R0(),gu=Pm=nr=null,Qo=!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 O0&&r.locale!=="ko"?null:r.data;default:return null}}var G5={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 L0(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!G5[i.type]:r==="textarea"}function q0(i,r,c,g){Ho?$o?$o.push(g):$o=[g]:Ho=g,r=cd(r,"onChange"),0<r.length&&(c=new bu("onChange","change",null,c,g),i.push({event:c,listeners:r}))}var yl=null,bl=null;function Z5(i){xx(i,0)}function xu(i){var r=la(i);if(Dt(r))return i}function B0(i,r){if(i==="change")return r}var U0=!1;if(Si){var Um;if(Si){var Fm="oninput"in document;if(!Fm){var F0=document.createElement("div");F0.setAttribute("oninput","return;"),Fm=typeof F0.oninput=="function"}Um=Fm}else Um=!1;U0=Um&&(!document.documentMode||9<document.documentMode)}function H0(){yl&&(yl.detachEvent("onpropertychange",$0),bl=yl=null)}function $0(i){if(i.propertyName==="value"&&xu(bl)){var r=[];q0(r,bl,i,Nm(i)),E0(Z5,r)}}function K5(i,r,c){i==="focusin"?(H0(),yl=r,bl=c,yl.attachEvent("onpropertychange",$0)):i==="focusout"&&H0()}function W5(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xu(bl)}function Y5(i,r){if(i==="click")return xu(r)}function X5(i,r){if(i==="input"||i==="change")return xu(r)}function J5(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ca=typeof Object.is=="function"?Object.is:J5;function Sl(i,r){if(ca(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 b=c[g];if(!Yt.call(r,b)||!ca(i[b],r[b]))return!1}return!0}function Q0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V0(i,r){var c=Q0(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=Q0(c)}}function G0(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?G0(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Z0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=qn(i.document);r instanceof i.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)i=r.contentWindow;else break;r=qn(i.document)}return r}function Hm(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 eO=Si&&"documentMode"in document&&11>=document.documentMode,Vo=null,$m=null,xl=null,Qm=!1;function K0(i,r,c){var g=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Qm||Vo==null||Vo!==qn(g)||(g=Vo,"selectionStart"in g&&Hm(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}),xl&&Sl(xl,g)||(xl=g,g=cd($m,"onSelect"),0<g.length&&(r=new bu("onSelect","select",null,r,c),i.push({event:r,listeners:g}),r.target=Vo)))}function Wr(i,r){var c={};return c[i.toLowerCase()]=r.toLowerCase(),c["Webkit"+i]="webkit"+r,c["Moz"+i]="moz"+r,c}var Go={animationend:Wr("Animation","AnimationEnd"),animationiteration:Wr("Animation","AnimationIteration"),animationstart:Wr("Animation","AnimationStart"),transitionrun:Wr("Transition","TransitionRun"),transitionstart:Wr("Transition","TransitionStart"),transitioncancel:Wr("Transition","TransitionCancel"),transitionend:Wr("Transition","TransitionEnd")},Vm={},W0={};Si&&(W0=document.createElement("div").style,"AnimationEvent"in window||(delete Go.animationend.animation,delete Go.animationiteration.animation,delete Go.animationstart.animation),"TransitionEvent"in window||delete Go.transitionend.transition);function Yr(i){if(Vm[i])return Vm[i];if(!Go[i])return i;var r=Go[i],c;for(c in r)if(r.hasOwnProperty(c)&&c in W0)return Vm[i]=r[c];return i}var Y0=Yr("animationend"),X0=Yr("animationiteration"),J0=Yr("animationstart"),tO=Yr("transitionrun"),nO=Yr("transitionstart"),aO=Yr("transitioncancel"),e1=Yr("transitionend"),t1=new Map,Gm="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(" ");Gm.push("scrollEnd");function La(i,r){t1.set(i,r),kt(r,[i])}var ku=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=[],Zo=0,Zm=0;function wu(){for(var i=Zo,r=Zm=Zo=0;r<i;){var c=wa[r];wa[r++]=null;var g=wa[r];wa[r++]=null;var b=wa[r];wa[r++]=null;var k=wa[r];if(wa[r++]=null,g!==null&&b!==null){var _=g.pending;_===null?b.next=b:(b.next=_.next,_.next=b),g.pending=b}k!==0&&n1(c,b,k)}}function Mu(i,r,c,g){wa[Zo++]=i,wa[Zo++]=r,wa[Zo++]=c,wa[Zo++]=g,Zm|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Km(i,r,c,g){return Mu(i,r,c,g),Cu(i)}function Xr(i,r){return Mu(i,null,null,r),Cu(i)}function n1(i,r,c){i.lanes|=c;var g=i.alternate;g!==null&&(g.lanes|=c);for(var b=!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||(b=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,b&&r!==null&&(b=31-Ln(c),i=k.hiddenUpdates,g=i[b],g===null?i[b]=[r]:g.push(r),r.lane=c|536870912),k):null}function Cu(i){if(50<Hl)throw Hl=0,rh=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Ko={};function iO(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 ua(i,r,c,g){return new iO(i,r,c,g)}function Wm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xi(i,r){var c=i.alternate;return c===null?(c=ua(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 a1(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 Au(i,r,c,g,b,k){var _=0;if(g=i,typeof i=="function")Wm(i)&&(_=1);else if(typeof i=="string")_=cj(i,c,Se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case de:return i=ua(31,c,r,b),i.elementType=de,i.lanes=k,i;case I:return Jr(c.children,b,k,r);case j:_=8,b|=24;break;case D:return i=ua(12,c,r,b|2),i.elementType=D,i.lanes=k,i;case Z:return i=ua(13,c,r,b),i.elementType=Z,i.lanes=k,i;case J:return i=ua(19,c,r,b),i.elementType=J,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:_=10;break e;case z:_=9;break e;case q:_=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=ua(_,c,r,b),r.elementType=i,r.type=g,r.lanes=k,r}function Jr(i,r,c,g){return i=ua(7,i,g,r),i.lanes=c,i}function Ym(i,r,c){return i=ua(6,i,null,r),i.lanes=c,i}function i1(i){var r=ua(18,null,null,0);return r.stateNode=i,r}function Xm(i,r,c){return r=ua(4,i.children!==null?i.children:[],i.key,r),r.lanes=c,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var r1=new WeakMap;function Ma(i,r){if(typeof i=="object"&&i!==null){var c=r1.get(i);return c!==void 0?c:(r={value:i,source:r,stack:An(r)},r1.set(i,r),r)}return{value:i,source:r,stack:An(r)}}var Wo=[],Yo=0,Eu=null,kl=0,Ca=[],Aa=0,ar=null,Ya=1,Xa="";function ki(i,r){Wo[Yo++]=kl,Wo[Yo++]=Eu,Eu=i,kl=r}function o1(i,r,c){Ca[Aa++]=Ya,Ca[Aa++]=Xa,Ca[Aa++]=ar,ar=i;var g=Ya;i=Xa;var b=32-Ln(g)-1;g&=~(1<<b),c+=1;var k=32-Ln(r)+b;if(30<k){var _=b-b%5;k=(g&(1<<_)-1).toString(32),g>>=_,b-=_,Ya=1<<32-Ln(r)+b|c<<b|g,Xa=k+i}else Ya=1<<k|c<<b|g,Xa=i}function Jm(i){i.return!==null&&(ki(i,1),o1(i,1,0))}function ef(i){for(;i===Eu;)Eu=Wo[--Yo],Wo[Yo]=null,kl=Wo[--Yo],Wo[Yo]=null;for(;i===ar;)ar=Ca[--Aa],Ca[Aa]=null,Xa=Ca[--Aa],Ca[Aa]=null,Ya=Ca[--Aa],Ca[Aa]=null}function s1(i,r){Ca[Aa++]=Ya,Ca[Aa++]=Xa,Ca[Aa++]=ar,Ya=r.id,Xa=r.overflow,ar=i}var _n=null,Qt=null,yt=!1,ir=null,Ea=!1,tf=Error(a(519));function rr(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wl(Ma(r,i)),tf}function l1(i){var r=i.stateNode,c=i.type,g=i.memoizedProps;switch(r[kn]=i,r[Pn]=g,c){case"dialog":dt("cancel",r),dt("close",r);break;case"iframe":case"object":case"embed":dt("load",r);break;case"video":case"audio":for(c=0;c<Ql.length;c++)dt(Ql[c],r);break;case"source":dt("error",r);break;case"img":case"image":case"link":dt("error",r),dt("load",r);break;case"details":dt("toggle",r);break;case"input":dt("invalid",r),Zn(r,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":dt("invalid",r);break;case"textarea":dt("invalid",r),Gr(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||Cx(r.textContent,c)?(g.popover!=null&&(dt("beforetoggle",r),dt("toggle",r)),g.onScroll!=null&&dt("scroll",r),g.onScrollEnd!=null&&dt("scrollend",r),g.onClick!=null&&(r.onclick=bi),r=!0):r=!1,r||rr(i,!0)}function c1(i){for(_n=i.return;_n;)switch(_n.tag){case 5:case 31:case 13:Ea=!1;return;case 27:case 3:Ea=!0;return;default:_n=_n.return}}function Xo(i){if(i!==_n)return!1;if(!yt)return c1(i),yt=!0,!1;var r=i.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Sh(i.type,i.memoizedProps)),c=!c),c&&Qt&&rr(i),c1(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Qt=jx(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Qt=jx(i)}else r===27?(r=Qt,br(i.type)?(i=Ch,Ch=null,Qt=i):Qt=r):Qt=_n?_a(i.stateNode.nextSibling):null;return!0}function eo(){Qt=_n=null,yt=!1}function nf(){var i=ir;return i!==null&&(ea===null?ea=i:ea.push.apply(ea,i),ir=null),i}function wl(i){ir===null?ir=[i]:ir.push(i)}var af=L(null),to=null,wi=null;function or(i,r,c){ge(af,r._currentValue),r._currentValue=c}function Mi(i){i._currentValue=af.current,te(af)}function rf(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 of(i,r,c,g){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var k=b.dependencies;if(k!==null){var _=b.child;k=k.firstContext;e:for(;k!==null;){var P=k;k=b;for(var U=0;U<r.length;U++)if(P.context===r[U]){k.lanes|=c,P=k.alternate,P!==null&&(P.lanes|=c),rf(k.return,c,i),g||(_=null);break e}k=P.next}}else if(b.tag===18){if(_=b.return,_===null)throw Error(a(341));_.lanes|=c,k=_.alternate,k!==null&&(k.lanes|=c),rf(_,c,i),_=null}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===i){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}}function Jo(i,r,c,g){i=null;for(var b=r,k=!1;b!==null;){if(!k){if((b.flags&524288)!==0)k=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var _=b.alternate;if(_===null)throw Error(a(387));if(_=_.memoizedProps,_!==null){var P=b.type;ca(b.pendingProps.value,_.value)||(i!==null?i.push(P):i=[P])}}else if(b===Oe.current){if(_=b.alternate,_===null)throw Error(a(387));_.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Wl):i=[Wl])}b=b.return}i!==null&&of(r,i,c,g),r.flags|=262144}function Ru(i){for(i=i.firstContext;i!==null;){if(!ca(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function no(i){to=i,wi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Tn(i){return u1(to,i)}function _u(i,r){return to===null&&no(i),u1(i,r)}function u1(i,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},wi===null){if(i===null)throw Error(a(308));wi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else wi=wi.next=r;return c}var rO=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()})}},oO=e.unstable_scheduleCallback,sO=e.unstable_NormalPriority,hn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new rO,data:new Map,refCount:0}}function Ml(i){i.refCount--,i.refCount===0&&oO(sO,function(){i.controller.abort()})}var Cl=null,lf=0,es=0,ts=null;function lO(i,r){if(Cl===null){var c=Cl=[];lf=0,es=dh(),ts={status:"pending",value:void 0,then:function(g){c.push(g)}}}return lf++,r.then(d1,d1),r}function d1(){if(--lf===0&&Cl!==null){ts!==null&&(ts.status="fulfilled");var i=Cl;Cl=null,es=0,ts=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function cO(i,r){var c=[],g={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return i.then(function(){g.status="fulfilled",g.value=r;for(var b=0;b<c.length;b++)(0,c[b])(r)},function(b){for(g.status="rejected",g.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),g}var p1=H.S;H.S=function(i,r){KS=tn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&lO(i,r),p1!==null&&p1(i,r)};var ao=L(null);function cf(){var i=ao.current;return i!==null?i:Bt.pooledCache}function Tu(i,r){r===null?ge(ao,ao.current):ge(ao,r.pool)}function m1(){var i=cf();return i===null?null:{parent:hn._currentValue,pool:i}}var ns=Error(a(460)),uf=Error(a(474)),Iu=Error(a(542)),Nu={then:function(){}};function f1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function h1(i,r,c){switch(c=i[c],c===void 0?i.push(r):c!==r&&(r.then(bi,bi),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,v1(i),i;default:if(typeof r.status=="string")r.then(bi,bi);else{if(i=Bt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(g){if(r.status==="pending"){var b=r;b.status="fulfilled",b.value=g}},function(g){if(r.status==="pending"){var b=r;b.status="rejected",b.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,v1(i),i}throw ro=r,ns}}function io(i){try{var r=i._init;return r(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ro=c,ns):c}}var ro=null;function g1(){if(ro===null)throw Error(a(459));var i=ro;return ro=null,i}function v1(i){if(i===ns||i===Iu)throw Error(a(483))}var as=null,Al=0;function Ou(i){var r=Al;return Al+=1,as===null&&(as=[]),h1(as,i,r)}function El(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function ju(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 y1(i){function r(W,G){if(i){var ae=W.deletions;ae===null?(W.deletions=[G],W.flags|=16):ae.push(G)}}function c(W,G){if(!i)return null;for(;G!==null;)r(W,G),G=G.sibling;return null}function g(W){for(var G=new Map;W!==null;)W.key!==null?G.set(W.key,W):G.set(W.index,W),W=W.sibling;return G}function b(W,G){return W=xi(W,G),W.index=0,W.sibling=null,W}function k(W,G,ae){return W.index=ae,i?(ae=W.alternate,ae!==null?(ae=ae.index,ae<G?(W.flags|=67108866,G):ae):(W.flags|=67108866,G)):(W.flags|=1048576,G)}function _(W){return i&&W.alternate===null&&(W.flags|=67108866),W}function P(W,G,ae,ve){return G===null||G.tag!==6?(G=Ym(ae,W.mode,ve),G.return=W,G):(G=b(G,ae),G.return=W,G)}function U(W,G,ae,ve){var Qe=ae.type;return Qe===I?fe(W,G,ae.props.children,ve,ae.key):G!==null&&(G.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===F&&io(Qe)===G.type)?(G=b(G,ae.props),El(G,ae),G.return=W,G):(G=Au(ae.type,ae.key,ae.props,null,W.mode,ve),El(G,ae),G.return=W,G)}function ie(W,G,ae,ve){return G===null||G.tag!==4||G.stateNode.containerInfo!==ae.containerInfo||G.stateNode.implementation!==ae.implementation?(G=Xm(ae,W.mode,ve),G.return=W,G):(G=b(G,ae.children||[]),G.return=W,G)}function fe(W,G,ae,ve,Qe){return G===null||G.tag!==7?(G=Jr(ae,W.mode,ve,Qe),G.return=W,G):(G=b(G,ae),G.return=W,G)}function be(W,G,ae){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Ym(""+G,W.mode,ae),G.return=W,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return ae=Au(G.type,G.key,G.props,null,W.mode,ae),El(ae,G),ae.return=W,ae;case R:return G=Xm(G,W.mode,ae),G.return=W,G;case F:return G=io(G),be(W,G,ae)}if(Te(G)||Me(G))return G=Jr(G,W.mode,ae,null),G.return=W,G;if(typeof G.then=="function")return be(W,Ou(G),ae);if(G.$$typeof===B)return be(W,_u(W,G),ae);ju(W,G)}return null}function re(W,G,ae,ve){var Qe=G!==null?G.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Qe!==null?null:P(W,G,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case E:return ae.key===Qe?U(W,G,ae,ve):null;case R:return ae.key===Qe?ie(W,G,ae,ve):null;case F:return ae=io(ae),re(W,G,ae,ve)}if(Te(ae)||Me(ae))return Qe!==null?null:fe(W,G,ae,ve,null);if(typeof ae.then=="function")return re(W,G,Ou(ae),ve);if(ae.$$typeof===B)return re(W,G,_u(W,ae),ve);ju(W,ae)}return null}function ue(W,G,ae,ve,Qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return W=W.get(ae)||null,P(G,W,""+ve,Qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case E:return W=W.get(ve.key===null?ae:ve.key)||null,U(G,W,ve,Qe);case R:return W=W.get(ve.key===null?ae:ve.key)||null,ie(G,W,ve,Qe);case F:return ve=io(ve),ue(W,G,ae,ve,Qe)}if(Te(ve)||Me(ve))return W=W.get(ae)||null,fe(G,W,ve,Qe,null);if(typeof ve.then=="function")return ue(W,G,ae,Ou(ve),Qe);if(ve.$$typeof===B)return ue(W,G,ae,_u(G,ve),Qe);ju(G,ve)}return null}function ze(W,G,ae,ve){for(var Qe=null,Mt=null,Be=G,st=G=0,ht=null;Be!==null&&st<ae.length;st++){Be.index>st?(ht=Be,Be=null):ht=Be.sibling;var Ct=re(W,Be,ae[st],ve);if(Ct===null){Be===null&&(Be=ht);break}i&&Be&&Ct.alternate===null&&r(W,Be),G=k(Ct,G,st),Mt===null?Qe=Ct:Mt.sibling=Ct,Mt=Ct,Be=ht}if(st===ae.length)return c(W,Be),yt&&ki(W,st),Qe;if(Be===null){for(;st<ae.length;st++)Be=be(W,ae[st],ve),Be!==null&&(G=k(Be,G,st),Mt===null?Qe=Be:Mt.sibling=Be,Mt=Be);return yt&&ki(W,st),Qe}for(Be=g(Be);st<ae.length;st++)ht=ue(Be,W,st,ae[st],ve),ht!==null&&(i&&ht.alternate!==null&&Be.delete(ht.key===null?st:ht.key),G=k(ht,G,st),Mt===null?Qe=ht:Mt.sibling=ht,Mt=ht);return i&&Be.forEach(function(Mr){return r(W,Mr)}),yt&&ki(W,st),Qe}function Ge(W,G,ae,ve){if(ae==null)throw Error(a(151));for(var Qe=null,Mt=null,Be=G,st=G=0,ht=null,Ct=ae.next();Be!==null&&!Ct.done;st++,Ct=ae.next()){Be.index>st?(ht=Be,Be=null):ht=Be.sibling;var Mr=re(W,Be,Ct.value,ve);if(Mr===null){Be===null&&(Be=ht);break}i&&Be&&Mr.alternate===null&&r(W,Be),G=k(Mr,G,st),Mt===null?Qe=Mr:Mt.sibling=Mr,Mt=Mr,Be=ht}if(Ct.done)return c(W,Be),yt&&ki(W,st),Qe;if(Be===null){for(;!Ct.done;st++,Ct=ae.next())Ct=be(W,Ct.value,ve),Ct!==null&&(G=k(Ct,G,st),Mt===null?Qe=Ct:Mt.sibling=Ct,Mt=Ct);return yt&&ki(W,st),Qe}for(Be=g(Be);!Ct.done;st++,Ct=ae.next())Ct=ue(Be,W,st,Ct.value,ve),Ct!==null&&(i&&Ct.alternate!==null&&Be.delete(Ct.key===null?st:Ct.key),G=k(Ct,G,st),Mt===null?Qe=Ct:Mt.sibling=Ct,Mt=Ct);return i&&Be.forEach(function(Sj){return r(W,Sj)}),yt&&ki(W,st),Qe}function qt(W,G,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===I&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case E:e:{for(var Qe=ae.key;G!==null;){if(G.key===Qe){if(Qe=ae.type,Qe===I){if(G.tag===7){c(W,G.sibling),ve=b(G,ae.props.children),ve.return=W,W=ve;break e}}else if(G.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===F&&io(Qe)===G.type){c(W,G.sibling),ve=b(G,ae.props),El(ve,ae),ve.return=W,W=ve;break e}c(W,G);break}else r(W,G);G=G.sibling}ae.type===I?(ve=Jr(ae.props.children,W.mode,ve,ae.key),ve.return=W,W=ve):(ve=Au(ae.type,ae.key,ae.props,null,W.mode,ve),El(ve,ae),ve.return=W,W=ve)}return _(W);case R:e:{for(Qe=ae.key;G!==null;){if(G.key===Qe)if(G.tag===4&&G.stateNode.containerInfo===ae.containerInfo&&G.stateNode.implementation===ae.implementation){c(W,G.sibling),ve=b(G,ae.children||[]),ve.return=W,W=ve;break e}else{c(W,G);break}else r(W,G);G=G.sibling}ve=Xm(ae,W.mode,ve),ve.return=W,W=ve}return _(W);case F:return ae=io(ae),qt(W,G,ae,ve)}if(Te(ae))return ze(W,G,ae,ve);if(Me(ae)){if(Qe=Me(ae),typeof Qe!="function")throw Error(a(150));return ae=Qe.call(ae),Ge(W,G,ae,ve)}if(typeof ae.then=="function")return qt(W,G,Ou(ae),ve);if(ae.$$typeof===B)return qt(W,G,_u(W,ae),ve);ju(W,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,G!==null&&G.tag===6?(c(W,G.sibling),ve=b(G,ae),ve.return=W,W=ve):(c(W,G),ve=Ym(ae,W.mode,ve),ve.return=W,W=ve),_(W)):c(W,G)}return function(W,G,ae,ve){try{Al=0;var Qe=qt(W,G,ae,ve);return as=null,Qe}catch(Be){if(Be===ns||Be===Iu)throw Be;var Mt=ua(29,Be,null,W.mode);return Mt.lanes=ve,Mt.return=W,Mt}}}var oo=y1(!0),b1=y1(!1),sr=!1;function df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(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 lr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function cr(i,r,c){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Et&2)!==0){var b=g.pending;return b===null?r.next=r:(r.next=b.next,b.next=r),g.pending=r,r=Cu(i),n1(i,null,c),r}return Mu(i,g,r,c),Cu(i)}function Rl(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,Da(i,c)}}function mf(i,r){var c=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,c===g)){var b=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?b=k=_:k=k.next=_,c=c.next}while(c!==null);k===null?b=k=r:k=k.next=r}else b=k=r;c={baseState:g.baseState,firstBaseUpdate:b,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 ff=!1;function _l(){if(ff){var i=ts;if(i!==null)throw i}}function Tl(i,r,c,g){ff=!1;var b=i.updateQueue;sr=!1;var k=b.firstBaseUpdate,_=b.lastBaseUpdate,P=b.shared.pending;if(P!==null){b.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 be=b.baseState;_=0,fe=ie=U=null,P=k;do{var re=P.lane&-536870913,ue=re!==P.lane;if(ue?(ft&re)===re:(g&re)===re){re!==0&&re===es&&(ff=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var ze=i,Ge=P;re=r;var qt=c;switch(Ge.tag){case 1:if(ze=Ge.payload,typeof ze=="function"){be=ze.call(qt,be,re);break e}be=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ge.payload,re=typeof ze=="function"?ze.call(qt,be,re):ze,re==null)break e;be=w({},be,re);break e;case 2:sr=!0}}re=P.callback,re!==null&&(i.flags|=64,ue&&(i.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[re]:ue.push(re))}else ue={lane:re,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(ie=fe=ue,U=be):fe=fe.next=ue,_|=re;if(P=P.next,P===null){if(P=b.shared.pending,P===null)break;ue=P,P=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);fe===null&&(U=be),b.baseState=U,b.firstBaseUpdate=ie,b.lastBaseUpdate=fe,k===null&&(b.shared.lanes=0),fr|=_,i.lanes=_,i.memoizedState=be}}function S1(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function x1(i,r){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)S1(c[i],r)}var is=L(null),Pu=L(0);function k1(i,r){i=Oi,ge(Pu,i),ge(is,r),Oi=i|r.baseLanes}function hf(){ge(Pu,Oi),ge(is,is.current)}function gf(){Oi=Pu.current,te(is),te(Pu)}var da=L(null),Ra=null;function ur(i){var r=i.alternate;ge(un,un.current&1),ge(da,i),Ra===null&&(r===null||is.current!==null||r.memoizedState!==null)&&(Ra=i)}function vf(i){ge(un,un.current),ge(da,i),Ra===null&&(Ra=i)}function w1(i){i.tag===22?(ge(un,un.current),ge(da,i),Ra===null&&(Ra=i)):dr()}function dr(){ge(un,un.current),ge(da,da.current)}function pa(i){te(da),Ra===i&&(Ra=null),te(un)}var un=L(0);function Du(i){for(var r=i;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||wh(c)||Mh(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 Ci=0,ot=null,zt=null,gn=null,zu=!1,rs=!1,so=!1,Lu=0,Il=0,os=null,uO=0;function nn(){throw Error(a(321))}function yf(i,r){if(r===null)return!1;for(var c=0;c<r.length&&c<i.length;c++)if(!ca(i[c],r[c]))return!1;return!0}function bf(i,r,c,g,b,k){return Ci=k,ot=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=i===null||i.memoizedState===null?oS:jf,so=!1,k=c(g,b),so=!1,rs&&(k=C1(r,c,g,b)),M1(i),k}function M1(i){H.H=jl;var r=zt!==null&&zt.next!==null;if(Ci=0,gn=zt=ot=null,zu=!1,Il=0,os=null,r)throw Error(a(300));i===null||vn||(i=i.dependencies,i!==null&&Ru(i)&&(vn=!0))}function C1(i,r,c,g){ot=i;var b=0;do{if(rs&&(os=null),Il=0,rs=!1,25<=b)throw Error(a(301));if(b+=1,gn=zt=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}H.H=sS,k=r(c,g)}while(rs);return k}function dO(){var i=H.H,r=i.useState()[0];return r=typeof r.then=="function"?Nl(r):r,i=i.useState()[0],(zt!==null?zt.memoizedState:null)!==i&&(ot.flags|=1024),r}function Sf(){var i=Lu!==0;return Lu=0,i}function xf(i,r,c){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~c}function kf(i){if(zu){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}zu=!1}Ci=0,gn=zt=ot=null,rs=!1,Il=Lu=0,os=null}function Bn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?ot.memoizedState=gn=i:gn=gn.next=i,gn}function dn(){if(zt===null){var i=ot.alternate;i=i!==null?i.memoizedState:null}else i=zt.next;var r=gn===null?ot.memoizedState:gn.next;if(r!==null)gn=r,zt=i;else{if(i===null)throw ot.alternate===null?Error(a(467)):Error(a(310));zt=i,i={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},gn===null?ot.memoizedState=gn=i:gn=gn.next=i}return gn}function qu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nl(i){var r=Il;return Il+=1,os===null&&(os=[]),i=h1(os,i,r),r=ot,(gn===null?r.memoizedState:gn.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?oS:jf),i}function Bu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Nl(i);if(i.$$typeof===B)return Tn(i)}throw Error(a(438,String(i)))}function wf(i){var r=null,c=ot.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var g=ot.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(b){return b.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=qu(),ot.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 Ai(i,r){return typeof r=="function"?r(i):r}function Uu(i){var r=dn();return Mf(r,zt,i)}function Mf(i,r,c){var g=i.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=c;var b=i.baseQueue,k=g.pending;if(k!==null){if(b!==null){var _=b.next;b.next=k.next,k.next=_}r.baseQueue=b=k,g.pending=null}if(k=i.baseState,b===null)i.memoizedState=k;else{r=b.next;var P=_=null,U=null,ie=r,fe=!1;do{var be=ie.lane&-536870913;if(be!==ie.lane?(ft&be)===be:(Ci&be)===be){var re=ie.revertLane;if(re===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),be===es&&(fe=!0);else if((Ci&re)===re){ie=ie.next,re===es&&(fe=!0);continue}else be={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(P=U=be,_=k):U=U.next=be,ot.lanes|=re,fr|=re;be=ie.action,so&&c(k,be),k=ie.hasEagerState?ie.eagerState:c(k,be)}else re={lane:be,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(P=U=re,_=k):U=U.next=re,ot.lanes|=be,fr|=be;ie=ie.next}while(ie!==null&&ie!==r);if(U===null?_=k:U.next=P,!ca(k,i.memoizedState)&&(vn=!0,fe&&(c=ts,c!==null)))throw c;i.memoizedState=k,i.baseState=_,i.baseQueue=U,g.lastRenderedState=k}return b===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Cf(i){var r=dn(),c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=i;var g=c.dispatch,b=c.pending,k=r.memoizedState;if(b!==null){c.pending=null;var _=b=b.next;do k=i(k,_.action),_=_.next;while(_!==b);ca(k,r.memoizedState)||(vn=!0),r.memoizedState=k,r.baseQueue===null&&(r.baseState=k),c.lastRenderedState=k}return[k,g]}function A1(i,r,c){var g=ot,b=dn(),k=yt;if(k){if(c===void 0)throw Error(a(407));c=c()}else c=r();var _=!ca((zt||b).memoizedState,c);if(_&&(b.memoizedState=c,vn=!0),b=b.queue,Rf(_1.bind(null,g,b,i),[i]),b.getSnapshot!==r||_||gn!==null&&gn.memoizedState.tag&1){if(g.flags|=2048,ss(9,{destroy:void 0},R1.bind(null,g,b,c,r),null),Bt===null)throw Error(a(349));k||(Ci&127)!==0||E1(g,r,c)}return c}function E1(i,r,c){i.flags|=16384,i={getSnapshot:r,value:c},r=ot.updateQueue,r===null?(r=qu(),ot.updateQueue=r,r.stores=[i]):(c=r.stores,c===null?r.stores=[i]:c.push(i))}function R1(i,r,c,g){r.value=c,r.getSnapshot=g,T1(r)&&I1(i)}function _1(i,r,c){return c(function(){T1(r)&&I1(i)})}function T1(i){var r=i.getSnapshot;i=i.value;try{var c=r();return!ca(i,c)}catch{return!0}}function I1(i){var r=Xr(i,2);r!==null&&ta(r,i,2)}function Af(i){var r=Bn();if(typeof i=="function"){var c=i;if(i=c(),so){ja(!0);try{c()}finally{ja(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},r}function N1(i,r,c,g){return i.baseState=c,Mf(i,zt,typeof g=="function"?g:Ai)}function pO(i,r,c,g,b){if($u(i))throw Error(a(485));if(i=r.action,i!==null){var k={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){k.listeners.push(_)}};H.T!==null?c(!0):k.isTransition=!1,g(k),c=r.pending,c===null?(k.next=r.pending=k,O1(r,k)):(k.next=c.next,r.pending=c.next=k)}}function O1(i,r){var c=r.action,g=r.payload,b=i.state;if(r.isTransition){var k=H.T,_={};H.T=_;try{var P=c(b,g),U=H.S;U!==null&&U(_,P),j1(i,r,P)}catch(ie){Ef(i,r,ie)}finally{k!==null&&_.types!==null&&(k.types=_.types),H.T=k}}else try{k=c(b,g),j1(i,r,k)}catch(ie){Ef(i,r,ie)}}function j1(i,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(g){P1(i,r,g)},function(g){return Ef(i,r,g)}):P1(i,r,c)}function P1(i,r,c){r.status="fulfilled",r.value=c,D1(r),i.state=c,r=i.pending,r!==null&&(c=r.next,c===r?i.pending=null:(c=c.next,r.next=c,O1(i,c)))}function Ef(i,r,c){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=c,D1(r),r=r.next;while(r!==g)}i.action=null}function D1(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function z1(i,r){return r}function L1(i,r){if(yt){var c=Bt.formState;if(c!==null){e:{var g=ot;if(yt){if(Qt){t:{for(var b=Qt,k=Ea;b.nodeType!==8;){if(!k){b=null;break t}if(b=_a(b.nextSibling),b===null){b=null;break t}}k=b.data,b=k==="F!"||k==="F"?b:null}if(b){Qt=_a(b.nextSibling),g=b.data==="F!";break e}}rr(g)}g=!1}g&&(r=c[0])}}return c=Bn(),c.memoizedState=c.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z1,lastRenderedState:r},c.queue=g,c=aS.bind(null,ot,g),g.dispatch=c,g=Af(!1),k=Of.bind(null,ot,!1,g.queue),g=Bn(),b={state:r,dispatch:null,action:i,pending:null},g.queue=b,c=pO.bind(null,ot,b,k,c),b.dispatch=c,g.memoizedState=i,[r,c,!1]}function q1(i){var r=dn();return B1(r,zt,i)}function B1(i,r,c){if(r=Mf(i,r,z1)[0],i=Uu(Ai)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Nl(r)}catch(_){throw _===ns?Iu:_}else g=r;r=dn();var b=r.queue,k=b.dispatch;return c!==r.memoizedState&&(ot.flags|=2048,ss(9,{destroy:void 0},mO.bind(null,b,c),null)),[g,k,i]}function mO(i,r){i.action=r}function U1(i){var r=dn(),c=zt;if(c!==null)return B1(r,c,i);dn(),r=r.memoizedState,c=dn();var g=c.queue.dispatch;return c.memoizedState=i,[r,g,!1]}function ss(i,r,c,g){return i={tag:i,create:c,deps:g,inst:r,next:null},r=ot.updateQueue,r===null&&(r=qu(),ot.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 F1(){return dn().memoizedState}function Fu(i,r,c,g){var b=Bn();ot.flags|=i,b.memoizedState=ss(1|r,{destroy:void 0},c,g===void 0?null:g)}function Hu(i,r,c,g){var b=dn();g=g===void 0?null:g;var k=b.memoizedState.inst;zt!==null&&g!==null&&yf(g,zt.memoizedState.deps)?b.memoizedState=ss(r,k,c,g):(ot.flags|=i,b.memoizedState=ss(1|r,k,c,g))}function H1(i,r){Fu(8390656,8,i,r)}function Rf(i,r){Hu(2048,8,i,r)}function fO(i){ot.flags|=4;var r=ot.updateQueue;if(r===null)r=qu(),ot.updateQueue=r,r.events=[i];else{var c=r.events;c===null?r.events=[i]:c.push(i)}}function $1(i){var r=dn().memoizedState;return fO({ref:r,nextImpl:i}),function(){if((Et&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function Q1(i,r){return Hu(4,2,i,r)}function V1(i,r){return Hu(4,4,i,r)}function G1(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 Z1(i,r,c){c=c!=null?c.concat([i]):null,Hu(4,4,G1.bind(null,r,i),c)}function _f(){}function K1(i,r){var c=dn();r=r===void 0?null:r;var g=c.memoizedState;return r!==null&&yf(r,g[1])?g[0]:(c.memoizedState=[i,r],i)}function W1(i,r){var c=dn();r=r===void 0?null:r;var g=c.memoizedState;if(r!==null&&yf(r,g[1]))return g[0];if(g=i(),so){ja(!0);try{i()}finally{ja(!1)}}return c.memoizedState=[g,r],g}function Tf(i,r,c){return c===void 0||(Ci&1073741824)!==0&&(ft&261930)===0?i.memoizedState=r:(i.memoizedState=c,i=YS(),ot.lanes|=i,fr|=i,c)}function Y1(i,r,c,g){return ca(c,r)?c:is.current!==null?(i=Tf(i,c,g),ca(i,r)||(vn=!0),i):(Ci&42)===0||(Ci&1073741824)!==0&&(ft&261930)===0?(vn=!0,i.memoizedState=c):(i=YS(),ot.lanes|=i,fr|=i,r)}function X1(i,r,c,g,b){var k=ce.p;ce.p=k!==0&&8>k?k:8;var _=H.T,P={};H.T=P,Of(i,!1,r,c);try{var U=b(),ie=H.S;if(ie!==null&&ie(P,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var fe=cO(U,g);Ol(i,r,fe,ha(i))}else Ol(i,r,g,ha(i))}catch(be){Ol(i,r,{then:function(){},status:"rejected",reason:be},ha())}finally{ce.p=k,_!==null&&P.types!==null&&(_.types=P.types),H.T=_}}function hO(){}function If(i,r,c,g){if(i.tag!==5)throw Error(a(476));var b=J1(i).queue;X1(i,b,r,ke,c===null?hO:function(){return eS(i),c(g)})}function J1(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:ke,baseState:ke,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:ke},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:c},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function eS(i){var r=J1(i);r.next===null&&(r=i.alternate.memoizedState),Ol(i,r.next.queue,{},ha())}function Nf(){return Tn(Wl)}function tS(){return dn().memoizedState}function nS(){return dn().memoizedState}function gO(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var c=ha();i=lr(c);var g=cr(r,i,c);g!==null&&(ta(g,r,c),Rl(g,r,c)),r={cache:sf()},i.payload=r;return}r=r.return}}function vO(i,r,c){var g=ha();c={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},$u(i)?iS(r,c):(c=Km(i,r,c,g),c!==null&&(ta(c,i,g),rS(c,r,g)))}function aS(i,r,c){var g=ha();Ol(i,r,c,g)}function Ol(i,r,c,g){var b={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if($u(i))iS(r,b);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(b.hasEagerState=!0,b.eagerState=P,ca(P,_))return Mu(i,r,b,0),Bt===null&&wu(),!1}catch{}if(c=Km(i,r,b,g),c!==null)return ta(c,i,g),rS(c,r,g),!0}return!1}function Of(i,r,c,g){if(g={lane:2,revertLane:dh(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},$u(i)){if(r)throw Error(a(479))}else r=Km(i,c,g,2),r!==null&&ta(r,i,2)}function $u(i){var r=i.alternate;return i===ot||r!==null&&r===ot}function iS(i,r){rs=zu=!0;var c=i.pending;c===null?r.next=r:(r.next=c.next,c.next=r),i.pending=r}function rS(i,r,c){if((c&4194048)!==0){var g=r.lanes;g&=i.pendingLanes,c|=g,r.lanes=c,Da(i,c)}}var jl={readContext:Tn,use:Bu,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};jl.useEffectEvent=nn;var oS={readContext:Tn,use:Bu,useCallback:function(i,r){return Bn().memoizedState=[i,r===void 0?null:r],i},useContext:Tn,useEffect:H1,useImperativeHandle:function(i,r,c){c=c!=null?c.concat([i]):null,Fu(4194308,4,G1.bind(null,r,i),c)},useLayoutEffect:function(i,r){return Fu(4194308,4,i,r)},useInsertionEffect:function(i,r){Fu(4,2,i,r)},useMemo:function(i,r){var c=Bn();r=r===void 0?null:r;var g=i();if(so){ja(!0);try{i()}finally{ja(!1)}}return c.memoizedState=[g,r],g},useReducer:function(i,r,c){var g=Bn();if(c!==void 0){var b=c(r);if(so){ja(!0);try{c(r)}finally{ja(!1)}}}else b=r;return g.memoizedState=g.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},g.queue=i,i=i.dispatch=vO.bind(null,ot,i),[g.memoizedState,i]},useRef:function(i){var r=Bn();return i={current:i},r.memoizedState=i},useState:function(i){i=Af(i);var r=i.queue,c=aS.bind(null,ot,r);return r.dispatch=c,[i.memoizedState,c]},useDebugValue:_f,useDeferredValue:function(i,r){var c=Bn();return Tf(c,i,r)},useTransition:function(){var i=Af(!1);return i=X1.bind(null,ot,i.queue,!0,!1),Bn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,c){var g=ot,b=Bn();if(yt){if(c===void 0)throw Error(a(407));c=c()}else{if(c=r(),Bt===null)throw Error(a(349));(ft&127)!==0||E1(g,r,c)}b.memoizedState=c;var k={value:c,getSnapshot:r};return b.queue=k,H1(_1.bind(null,g,k,i),[i]),g.flags|=2048,ss(9,{destroy:void 0},R1.bind(null,g,k,c,r),null),c},useId:function(){var i=Bn(),r=Bt.identifierPrefix;if(yt){var c=Xa,g=Ya;c=(g&~(1<<32-Ln(g)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Lu++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=uO++,r="_"+r+"r_"+c.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Nf,useFormState:L1,useActionState:L1,useOptimistic:function(i){var r=Bn();r.memoizedState=r.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=Of.bind(null,ot,!0,c),c.dispatch=r,[i,r]},useMemoCache:wf,useCacheRefresh:function(){return Bn().memoizedState=gO.bind(null,ot)},useEffectEvent:function(i){var r=Bn(),c={impl:i};return r.memoizedState=c,function(){if((Et&2)!==0)throw Error(a(440));return c.impl.apply(void 0,arguments)}}},jf={readContext:Tn,use:Bu,useCallback:K1,useContext:Tn,useEffect:Rf,useImperativeHandle:Z1,useInsertionEffect:Q1,useLayoutEffect:V1,useMemo:W1,useReducer:Uu,useRef:F1,useState:function(){return Uu(Ai)},useDebugValue:_f,useDeferredValue:function(i,r){var c=dn();return Y1(c,zt.memoizedState,i,r)},useTransition:function(){var i=Uu(Ai)[0],r=dn().memoizedState;return[typeof i=="boolean"?i:Nl(i),r]},useSyncExternalStore:A1,useId:tS,useHostTransitionStatus:Nf,useFormState:q1,useActionState:q1,useOptimistic:function(i,r){var c=dn();return N1(c,zt,i,r)},useMemoCache:wf,useCacheRefresh:nS};jf.useEffectEvent=$1;var sS={readContext:Tn,use:Bu,useCallback:K1,useContext:Tn,useEffect:Rf,useImperativeHandle:Z1,useInsertionEffect:Q1,useLayoutEffect:V1,useMemo:W1,useReducer:Cf,useRef:F1,useState:function(){return Cf(Ai)},useDebugValue:_f,useDeferredValue:function(i,r){var c=dn();return zt===null?Tf(c,i,r):Y1(c,zt.memoizedState,i,r)},useTransition:function(){var i=Cf(Ai)[0],r=dn().memoizedState;return[typeof i=="boolean"?i:Nl(i),r]},useSyncExternalStore:A1,useId:tS,useHostTransitionStatus:Nf,useFormState:U1,useActionState:U1,useOptimistic:function(i,r){var c=dn();return zt!==null?N1(c,zt,i,r):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:wf,useCacheRefresh:nS};sS.useEffectEvent=$1;function Pf(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 Df={enqueueSetState:function(i,r,c){i=i._reactInternals;var g=ha(),b=lr(g);b.payload=r,c!=null&&(b.callback=c),r=cr(i,b,g),r!==null&&(ta(r,i,g),Rl(r,i,g))},enqueueReplaceState:function(i,r,c){i=i._reactInternals;var g=ha(),b=lr(g);b.tag=1,b.payload=r,c!=null&&(b.callback=c),r=cr(i,b,g),r!==null&&(ta(r,i,g),Rl(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var c=ha(),g=lr(c);g.tag=2,r!=null&&(g.callback=r),r=cr(i,g,c),r!==null&&(ta(r,i,c),Rl(r,i,c))}};function lS(i,r,c,g,b,k,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,k,_):r.prototype&&r.prototype.isPureReactComponent?!Sl(c,g)||!Sl(b,k):!0}function cS(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&&Df.enqueueReplaceState(r,r.state,null)}function lo(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 b in i)c[b]===void 0&&(c[b]=i[b])}return c}function uS(i){ku(i)}function dS(i){console.error(i)}function pS(i){ku(i)}function Qu(i,r){try{var c=i.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function mS(i,r,c){try{var g=i.onCaughtError;g(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function zf(i,r,c){return c=lr(c),c.tag=3,c.payload={element:null},c.callback=function(){Qu(i,r)},c}function fS(i){return i=lr(i),i.tag=3,i}function hS(i,r,c,g){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var k=g.value;i.payload=function(){return b(k)},i.callback=function(){mS(r,c,g)}}var _=c.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(i.callback=function(){mS(r,c,g),typeof b!="function"&&(hr===null?hr=new Set([this]):hr.add(this));var P=g.stack;this.componentDidCatch(g.value,{componentStack:P!==null?P:""})})}function yO(i,r,c,g,b){if(c.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=c.alternate,r!==null&&Jo(r,c,b,!0),c=da.current,c!==null){switch(c.tag){case 31:case 13:return Ra===null?ad():c.alternate===null&&an===0&&(an=3),c.flags&=-257,c.flags|=65536,c.lanes=b,g===Nu?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([g]):r.add(g),lh(i,g,b)),!1;case 22:return c.flags|=65536,g===Nu?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)),lh(i,g,b)),!1}throw Error(a(435,c.tag))}return lh(i,g,b),ad(),!1}if(yt)return r=da.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=b,g!==tf&&(i=Error(a(422),{cause:g}),wl(Ma(i,c)))):(g!==tf&&(r=Error(a(423),{cause:g}),wl(Ma(r,c))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,g=Ma(g,c),b=zf(i.stateNode,g,b),mf(i,b),an!==4&&(an=2)),!1;var k=Error(a(520),{cause:g});if(k=Ma(k,c),Fl===null?Fl=[k]:Fl.push(k),an!==4&&(an=2),r===null)return!0;g=Ma(g,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,i=b&-b,c.lanes|=i,i=zf(c.stateNode,g,i),mf(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"&&(hr===null||!hr.has(k))))return c.flags|=65536,b&=-b,c.lanes|=b,b=fS(b),hS(b,i,c,g),mf(c,b),!1}c=c.return}while(c!==null);return!1}var Lf=Error(a(461)),vn=!1;function In(i,r,c,g){r.child=i===null?b1(r,null,c,g):oo(r,i.child,c,g)}function gS(i,r,c,g,b){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 no(r),g=bf(i,r,c,_,k,b),P=Sf(),i!==null&&!vn?(xf(i,r,b),Ei(i,r,b)):(yt&&P&&Jm(r),r.flags|=1,In(i,r,g,b),r.child)}function vS(i,r,c,g,b){if(i===null){var k=c.type;return typeof k=="function"&&!Wm(k)&&k.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=k,yS(i,r,k,g,b)):(i=Au(c.type,null,g,r,r.mode,b),i.ref=r.ref,i.return=r,r.child=i)}if(k=i.child,!Vf(i,b)){var _=k.memoizedProps;if(c=c.compare,c=c!==null?c:Sl,c(_,g)&&i.ref===r.ref)return Ei(i,r,b)}return r.flags|=1,i=xi(k,g),i.ref=r.ref,i.return=r,r.child=i}function yS(i,r,c,g,b){if(i!==null){var k=i.memoizedProps;if(Sl(k,g)&&i.ref===r.ref)if(vn=!1,r.pendingProps=g=k,Vf(i,b))(i.flags&131072)!==0&&(vn=!0);else return r.lanes=i.lanes,Ei(i,r,b)}return qf(i,r,c,g,b)}function bS(i,r,c,g){var b=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,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~k}else g=0,r.child=null;return SS(i,r,k,c,g)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Tu(r,k!==null?k.cachePool:null),k!==null?k1(r,k):hf(),w1(r);else return g=r.lanes=536870912,SS(i,r,k!==null?k.baseLanes|c:c,c,g)}else k!==null?(Tu(r,k.cachePool),k1(r,k),dr(),r.memoizedState=null):(i!==null&&Tu(r,null),hf(),dr());return In(i,r,b,c),r.child}function Pl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function SS(i,r,c,g,b){var k=cf();return k=k===null?null:{parent:hn._currentValue,pool:k},r.memoizedState={baseLanes:c,cachePool:k},i!==null&&Tu(r,null),hf(),w1(r),i!==null&&Jo(i,r,g,!0),r.childLanes=b,null}function Vu(i,r){return r=Zu({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function xS(i,r,c){return oo(r,i.child,null,c),i=Vu(r,r.pendingProps),i.flags|=2,pa(r),r.memoizedState=null,i}function bO(i,r,c){var g=r.pendingProps,b=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(yt){if(g.mode==="hidden")return i=Vu(r,g),r.lanes=536870912,Pl(null,i);if(vf(r),(i=Qt)?(i=Ox(i,Ea),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:ar!==null?{id:Ya,overflow:Xa}:null,retryLane:536870912,hydrationErrors:null},c=i1(i),c.return=r,r.child=c,_n=r,Qt=null)):i=null,i===null)throw rr(r);return r.lanes=536870912,null}return Vu(r,g)}var k=i.memoizedState;if(k!==null){var _=k.dehydrated;if(vf(r),b)if(r.flags&256)r.flags&=-257,r=xS(i,r,c);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(vn||Jo(i,r,c,!1),b=(c&i.childLanes)!==0,vn||b){if(g=Bt,g!==null&&(_=cl(g,c),_!==0&&_!==k.retryLane))throw k.retryLane=_,Xr(i,_),ta(g,i,_),Lf;ad(),r=xS(i,r,c)}else i=k.treeContext,Qt=_a(_.nextSibling),_n=r,yt=!0,ir=null,Ea=!1,i!==null&&s1(r,i),r=Vu(r,g),r.flags|=4096;return r}return i=xi(i.child,{mode:g.mode,children:g.children}),i.ref=r.ref,r.child=i,i.return=r,i}function Gu(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 qf(i,r,c,g,b){return no(r),c=bf(i,r,c,g,void 0,b),g=Sf(),i!==null&&!vn?(xf(i,r,b),Ei(i,r,b)):(yt&&g&&Jm(r),r.flags|=1,In(i,r,c,b),r.child)}function kS(i,r,c,g,b,k){return no(r),r.updateQueue=null,c=C1(r,g,c,b),M1(i),g=Sf(),i!==null&&!vn?(xf(i,r,k),Ei(i,r,k)):(yt&&g&&Jm(r),r.flags|=1,In(i,r,c,k),r.child)}function wS(i,r,c,g,b){if(no(r),r.stateNode===null){var k=Ko,_=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=Df,r.stateNode=k,k._reactInternals=r,k=r.stateNode,k.props=g,k.state=r.memoizedState,k.refs={},df(r),_=c.contextType,k.context=typeof _=="object"&&_!==null?Tn(_):Ko,k.state=r.memoizedState,_=c.getDerivedStateFromProps,typeof _=="function"&&(Pf(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&&Df.enqueueReplaceState(k,k.state,null),Tl(r,g,k,b),_l(),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=lo(c,P);k.props=U;var ie=k.context,fe=c.contextType;_=Ko,typeof fe=="object"&&fe!==null&&(_=Tn(fe));var be=c.getDerivedStateFromProps;fe=typeof be=="function"||typeof k.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,fe||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P||ie!==_)&&cS(r,k,g,_),sr=!1;var re=r.memoizedState;k.state=re,Tl(r,g,k,b),_l(),ie=r.memoizedState,P||re!==ie||sr?(typeof be=="function"&&(Pf(r,c,be,g),ie=r.memoizedState),(U=sr||lS(r,c,U,g,re,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,pf(i,r),_=r.memoizedProps,fe=lo(c,_),k.props=fe,be=r.pendingProps,re=k.context,ie=c.contextType,U=Ko,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"||(_!==be||re!==U)&&cS(r,k,g,U),sr=!1,re=r.memoizedState,k.state=re,Tl(r,g,k,b),_l();var ue=r.memoizedState;_!==be||re!==ue||sr||i!==null&&i.dependencies!==null&&Ru(i.dependencies)?(typeof P=="function"&&(Pf(r,c,P,g),ue=r.memoizedState),(fe=sr||lS(r,c,fe,g,re,ue,U)||i!==null&&i.dependencies!==null&&Ru(i.dependencies))?(ie||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ue,U),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ue,U)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||_===i.memoizedProps&&re===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&re===i.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=ue),k.props=g,k.state=ue,k.context=U,g=fe):(typeof k.componentDidUpdate!="function"||_===i.memoizedProps&&re===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&re===i.memoizedState||(r.flags|=1024),g=!1)}return k=g,Gu(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=oo(r,i.child,null,b),r.child=oo(r,null,c,b)):In(i,r,c,b),r.memoizedState=k.state,i=r.child):i=Ei(i,r,b),i}function MS(i,r,c,g){return eo(),r.flags|=256,In(i,r,c,g),r.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uf(i){return{baseLanes:i,cachePool:m1()}}function Ff(i,r,c){return i=i!==null?i.childLanes&~c:0,r&&(i|=fa),i}function CS(i,r,c){var g=r.pendingProps,b=!1,k=(r.flags&128)!==0,_;if((_=k)||(_=i!==null&&i.memoizedState===null?!1:(un.current&2)!==0),_&&(b=!0,r.flags&=-129),_=(r.flags&32)!==0,r.flags&=-33,i===null){if(yt){if(b?ur(r):dr(),(i=Qt)?(i=Ox(i,Ea),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:ar!==null?{id:Ya,overflow:Xa}:null,retryLane:536870912,hydrationErrors:null},c=i1(i),c.return=r,r.child=c,_n=r,Qt=null)):i=null,i===null)throw rr(r);return Mh(i)?r.lanes=32:r.lanes=536870912,null}var P=g.children;return g=g.fallback,b?(dr(),b=r.mode,P=Zu({mode:"hidden",children:P},b),g=Jr(g,b,c,null),P.return=r,g.return=r,P.sibling=g,r.child=P,g=r.child,g.memoizedState=Uf(c),g.childLanes=Ff(i,_,c),r.memoizedState=Bf,Pl(null,g)):(ur(r),Hf(r,P))}var U=i.memoizedState;if(U!==null&&(P=U.dehydrated,P!==null)){if(k)r.flags&256?(ur(r),r.flags&=-257,r=$f(i,r,c)):r.memoizedState!==null?(dr(),r.child=i.child,r.flags|=128,r=null):(dr(),P=g.fallback,b=r.mode,g=Zu({mode:"visible",children:g.children},b),P=Jr(P,b,c,null),P.flags|=2,g.return=r,P.return=r,g.sibling=P,r.child=g,oo(r,i.child,null,c),g=r.child,g.memoizedState=Uf(c),g.childLanes=Ff(i,_,c),r.memoizedState=Bf,r=Pl(null,g));else if(ur(r),Mh(P)){if(_=P.nextSibling&&P.nextSibling.dataset,_)var ie=_.dgst;_=ie,g=Error(a(419)),g.stack="",g.digest=_,wl({value:g,source:null,stack:null}),r=$f(i,r,c)}else if(vn||Jo(i,r,c,!1),_=(c&i.childLanes)!==0,vn||_){if(_=Bt,_!==null&&(g=cl(_,c),g!==0&&g!==U.retryLane))throw U.retryLane=g,Xr(i,g),ta(_,i,g),Lf;wh(P)||ad(),r=$f(i,r,c)}else wh(P)?(r.flags|=192,r.child=i.child,r=null):(i=U.treeContext,Qt=_a(P.nextSibling),_n=r,yt=!0,ir=null,Ea=!1,i!==null&&s1(r,i),r=Hf(r,g.children),r.flags|=4096);return r}return b?(dr(),P=g.fallback,b=r.mode,U=i.child,ie=U.sibling,g=xi(U,{mode:"hidden",children:g.children}),g.subtreeFlags=U.subtreeFlags&65011712,ie!==null?P=xi(ie,P):(P=Jr(P,b,c,null),P.flags|=2),P.return=r,g.return=r,g.sibling=P,r.child=g,Pl(null,g),g=r.child,P=i.child.memoizedState,P===null?P=Uf(c):(b=P.cachePool,b!==null?(U=hn._currentValue,b=b.parent!==U?{parent:U,pool:U}:b):b=m1(),P={baseLanes:P.baseLanes|c,cachePool:b}),g.memoizedState=P,g.childLanes=Ff(i,_,c),r.memoizedState=Bf,Pl(i.child,g)):(ur(r),c=i.child,i=c.sibling,c=xi(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 Hf(i,r){return r=Zu({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function Zu(i,r){return i=ua(22,i,null,r),i.lanes=0,i}function $f(i,r,c){return oo(r,i.child,null,c),i=Hf(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function AS(i,r,c){i.lanes|=r;var g=i.alternate;g!==null&&(g.lanes|=r),rf(i.return,r,c)}function Qf(i,r,c,g,b,k){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:c,tailMode:b,treeForkCount:k}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=g,_.tail=c,_.tailMode=b,_.treeForkCount=k)}function ES(i,r,c){var g=r.pendingProps,b=g.revealOrder,k=g.tail;g=g.children;var _=un.current,P=(_&2)!==0;if(P?(_=_&1|2,r.flags|=128):_&=1,ge(un,_),In(i,r,g,c),g=yt?kl:0,!P&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&AS(i,c,r);else if(i.tag===19)AS(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(b){case"forwards":for(c=r.child,b=null;c!==null;)i=c.alternate,i!==null&&Du(i)===null&&(b=c),c=c.sibling;c=b,c===null?(b=r.child,r.child=null):(b=c.sibling,c.sibling=null),Qf(r,!1,b,c,k,g);break;case"backwards":case"unstable_legacy-backwards":for(c=null,b=r.child,r.child=null;b!==null;){if(i=b.alternate,i!==null&&Du(i)===null){r.child=b;break}i=b.sibling,b.sibling=c,c=b,b=i}Qf(r,!0,c,null,k,g);break;case"together":Qf(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function Ei(i,r,c){if(i!==null&&(r.dependencies=i.dependencies),fr|=r.lanes,(c&r.childLanes)===0)if(i!==null){if(Jo(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=xi(i,i.pendingProps),r.child=c,c.return=r;i.sibling!==null;)i=i.sibling,c=c.sibling=xi(i,i.pendingProps),c.return=r;c.sibling=null}return r.child}function Vf(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Ru(i)))}function SO(i,r,c){switch(r.tag){case 3:X(r,r.stateNode.containerInfo),or(r,hn,i.memoizedState.cache),eo();break;case 27:case 5:$e(r);break;case 4:X(r,r.stateNode.containerInfo);break;case 10:or(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,vf(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(ur(r),r.flags|=128,null):(c&r.child.childLanes)!==0?CS(i,r,c):(ur(r),i=Ei(i,r,c),i!==null?i.sibling:null);ur(r);break;case 19:var b=(i.flags&128)!==0;if(g=(c&r.childLanes)!==0,g||(Jo(i,r,c,!1),g=(c&r.childLanes)!==0),b){if(g)return ES(i,r,c);r.flags|=128}if(b=r.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ge(un,un.current),g)break;return null;case 22:return r.lanes=0,bS(i,r,c,r.pendingProps);case 24:or(r,hn,i.memoizedState.cache)}return Ei(i,r,c)}function RS(i,r,c){if(i!==null)if(i.memoizedProps!==r.pendingProps)vn=!0;else{if(!Vf(i,c)&&(r.flags&128)===0)return vn=!1,SO(i,r,c);vn=(i.flags&131072)!==0}else vn=!1,yt&&(r.flags&1048576)!==0&&o1(r,kl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var g=r.pendingProps;if(i=io(r.elementType),r.type=i,typeof i=="function")Wm(i)?(g=lo(i,g),r.tag=1,r=wS(null,r,i,g,c)):(r.tag=0,r=qf(null,r,i,g,c));else{if(i!=null){var b=i.$$typeof;if(b===q){r.tag=11,r=gS(null,r,i,g,c);break e}else if(b===$){r.tag=14,r=vS(null,r,i,g,c);break e}}throw r=oe(i)||i,Error(a(306,r,""))}}return r;case 0:return qf(i,r,r.type,r.pendingProps,c);case 1:return g=r.type,b=lo(g,r.pendingProps),wS(i,r,g,b,c);case 3:e:{if(X(r,r.stateNode.containerInfo),i===null)throw Error(a(387));g=r.pendingProps;var k=r.memoizedState;b=k.element,pf(i,r),Tl(r,g,null,c);var _=r.memoizedState;if(g=_.cache,or(r,hn,g),g!==k.cache&&of(r,[hn],c,!0),_l(),g=_.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:_.cache},r.updateQueue.baseState=k,r.memoizedState=k,r.flags&256){r=MS(i,r,g,c);break e}else if(g!==b){b=Ma(Error(a(424)),r),wl(b),r=MS(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,Qt=_a(i.firstChild),_n=r,yt=!0,ir=null,Ea=!0,c=b1(r,null,g,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(eo(),g===b){r=Ei(i,r,c);break e}In(i,r,g,c)}r=r.child}return r;case 26:return Gu(i,r),i===null?(c=qx(r.type,null,r.pendingProps,null))?r.memoizedState=c:yt||(c=r.type,i=r.pendingProps,g=ud(ye.current).createElement(c),g[kn]=r,g[Pn]=i,Nn(g,c,i),le(g),r.stateNode=g):r.memoizedState=qx(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return $e(r),i===null&&yt&&(g=r.stateNode=Dx(r.type,r.pendingProps,ye.current),_n=r,Ea=!0,b=Qt,br(r.type)?(Ch=b,Qt=_a(g.firstChild)):Qt=b),In(i,r,r.pendingProps.children,c),Gu(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&yt&&((b=g=Qt)&&(g=WO(g,r.type,r.pendingProps,Ea),g!==null?(r.stateNode=g,_n=r,Qt=_a(g.firstChild),Ea=!1,b=!0):b=!1),b||rr(r)),$e(r),b=r.type,k=r.pendingProps,_=i!==null?i.memoizedProps:null,g=k.children,Sh(b,k)?g=null:_!==null&&Sh(b,_)&&(r.flags|=32),r.memoizedState!==null&&(b=bf(i,r,dO,null,null,c),Wl._currentValue=b),Gu(i,r),In(i,r,g,c),r.child;case 6:return i===null&&yt&&((i=c=Qt)&&(c=YO(c,r.pendingProps,Ea),c!==null?(r.stateNode=c,_n=r,Qt=null,i=!0):i=!1),i||rr(r)),null;case 13:return CS(i,r,c);case 4:return X(r,r.stateNode.containerInfo),g=r.pendingProps,i===null?r.child=oo(r,null,g,c):In(i,r,g,c),r.child;case 11:return gS(i,r,r.type,r.pendingProps,c);case 7:return In(i,r,r.pendingProps,c),r.child;case 8:return In(i,r,r.pendingProps.children,c),r.child;case 12:return In(i,r,r.pendingProps.children,c),r.child;case 10:return g=r.pendingProps,or(r,r.type,g.value),In(i,r,g.children,c),r.child;case 9:return b=r.type._context,g=r.pendingProps.children,no(r),b=Tn(b),g=g(b),r.flags|=1,In(i,r,g,c),r.child;case 14:return vS(i,r,r.type,r.pendingProps,c);case 15:return yS(i,r,r.type,r.pendingProps,c);case 19:return ES(i,r,c);case 31:return bO(i,r,c);case 22:return bS(i,r,c,r.pendingProps);case 24:return no(r),g=Tn(hn),i===null?(b=cf(),b===null&&(b=Bt,k=sf(),b.pooledCache=k,k.refCount++,k!==null&&(b.pooledCacheLanes|=c),b=k),r.memoizedState={parent:g,cache:b},df(r),or(r,hn,b)):((i.lanes&c)!==0&&(pf(i,r),Tl(r,null,null,c),_l()),b=i.memoizedState,k=r.memoizedState,b.parent!==g?(b={parent:g,cache:g},r.memoizedState=b,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=b),or(r,hn,g)):(g=k.cache,or(r,hn,g),g!==b.cache&&of(r,[hn],c,!0))),In(i,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Ri(i){i.flags|=4}function Gf(i,r,c,g,b){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(tx())i.flags|=8192;else throw ro=Nu,uf}else i.flags&=-16777217}function _S(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!$x(r))if(tx())i.flags|=8192;else throw ro=Nu,uf}function Ku(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Lo():536870912,i.lanes|=r,ds|=r)}function Dl(i,r){if(!yt)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 Vt(i){var r=i.alternate!==null&&i.alternate.child===i.child,c=0,g=0;if(r)for(var b=i.child;b!==null;)c|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)c|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=g,i.childLanes=c,r}function xO(i,r,c){var g=r.pendingProps;switch(ef(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(r),null;case 1:return Vt(r),null;case 3:return c=r.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),Mi(hn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Xo(r)?Ri(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,nf())),Vt(r),null;case 26:var b=r.type,k=r.memoizedState;return i===null?(Ri(r),k!==null?(Vt(r),_S(r,k)):(Vt(r),Gf(r,b,null,g,c))):k?k!==i.memoizedState?(Ri(r),Vt(r),_S(r,k)):(Vt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==g&&Ri(r),Vt(r),Gf(r,b,i,g,c)),null;case 27:if(Ne(r),c=ye.current,b=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&Ri(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Vt(r),null}i=Se.current,Xo(r)?l1(r):(i=Dx(b,g,c),r.stateNode=i,Ri(r))}return Vt(r),null;case 5:if(Ne(r),b=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&Ri(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Vt(r),null}if(k=Se.current,Xo(r))l1(r);else{var _=ud(ye.current);switch(k){case 1:k=_.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:k=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":k=_.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":k=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);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(b,{is:g.is}):_.createElement(b)}}k[kn]=r,k[Pn]=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(Nn(k,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ri(r)}}return Vt(r),Gf(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,c),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==g&&Ri(r);else{if(typeof g!="string"&&r.stateNode===null)throw Error(a(166));if(i=ye.current,Xo(r)){if(i=r.stateNode,c=r.memoizedProps,g=null,b=_n,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}i[kn]=r,i=!!(i.nodeValue===c||g!==null&&g.suppressHydrationWarning===!0||Cx(i.nodeValue,c)),i||rr(r,!0)}else i=ud(i).createTextNode(g),i[kn]=r,r.stateNode=i}return Vt(r),null;case 31:if(c=r.memoizedState,i===null||i.memoizedState!==null){if(g=Xo(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[kn]=r}else eo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Vt(r),i=!1}else c=nf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return r.flags&256?(pa(r),r):(pa(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Vt(r),null;case 13:if(g=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=Xo(r),g!==null&&g.dehydrated!==null){if(i===null){if(!b)throw Error(a(318));if(b=r.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(a(317));b[kn]=r}else eo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Vt(r),b=!1}else b=nf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return r.flags&256?(pa(r),r):(pa(r),null)}return pa(r),(r.flags&128)!==0?(r.lanes=c,r):(c=g!==null,i=i!==null&&i.memoizedState!==null,c&&(g=r.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==b&&(g.flags|=2048)),c!==i&&c&&(r.child.flags|=8192),Ku(r,r.updateQueue),Vt(r),null);case 4:return he(),i===null&&hh(r.stateNode.containerInfo),Vt(r),null;case 10:return Mi(r.type),Vt(r),null;case 19:if(te(un),g=r.memoizedState,g===null)return Vt(r),null;if(b=(r.flags&128)!==0,k=g.rendering,k===null)if(b)Dl(g,!1);else{if(an!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(k=Du(i),k!==null){for(r.flags|=128,Dl(g,!1),i=k.updateQueue,r.updateQueue=i,Ku(r,i),r.subtreeFlags=0,i=c,c=r.child;c!==null;)a1(c,i),c=c.sibling;return ge(un,un.current&1|2),yt&&ki(r,g.treeForkCount),r.child}i=i.sibling}g.tail!==null&&tn()>ed&&(r.flags|=128,b=!0,Dl(g,!1),r.lanes=4194304)}else{if(!b)if(i=Du(k),i!==null){if(r.flags|=128,b=!0,i=i.updateQueue,r.updateQueue=i,Ku(r,i),Dl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!yt)return Vt(r),null}else 2*tn()-g.renderingStartTime>ed&&c!==536870912&&(r.flags|=128,b=!0,Dl(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=tn(),i.sibling=null,c=un.current,ge(un,b?c&1|2:c&1),yt&&ki(r,g.treeForkCount),i):(Vt(r),null);case 22:case 23:return pa(r),gf(),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&&(Vt(r),r.subtreeFlags&6&&(r.flags|=8192)):Vt(r),c=r.updateQueue,c!==null&&Ku(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&&te(ao),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Mi(hn),Vt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function kO(i,r){switch(ef(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Mi(hn),he(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Ne(r),null;case 31:if(r.memoizedState!==null){if(pa(r),r.alternate===null)throw Error(a(340));eo()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(pa(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));eo()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return te(un),null;case 4:return he(),null;case 10:return Mi(r.type),null;case 22:case 23:return pa(r),gf(),i!==null&&te(ao),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Mi(hn),null;case 25:return null;default:return null}}function TS(i,r){switch(ef(r),r.tag){case 3:Mi(hn),he();break;case 26:case 27:case 5:Ne(r);break;case 4:he();break;case 31:r.memoizedState!==null&&pa(r);break;case 13:pa(r);break;case 19:te(un);break;case 10:Mi(r.type);break;case 22:case 23:pa(r),gf(),i!==null&&te(ao);break;case 24:Mi(hn)}}function zl(i,r){try{var c=r.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var b=g.next;c=b;do{if((c.tag&i)===i){g=void 0;var k=c.create,_=c.inst;g=k(),_.destroy=g}c=c.next}while(c!==b)}}catch(P){Ot(r,r.return,P)}}function pr(i,r,c){try{var g=r.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var k=b.next;g=k;do{if((g.tag&i)===i){var _=g.inst,P=_.destroy;if(P!==void 0){_.destroy=void 0,b=r;var U=c,ie=P;try{ie()}catch(fe){Ot(b,U,fe)}}}g=g.next}while(g!==k)}}catch(fe){Ot(r,r.return,fe)}}function IS(i){var r=i.updateQueue;if(r!==null){var c=i.stateNode;try{x1(r,c)}catch(g){Ot(i,i.return,g)}}}function NS(i,r,c){c.props=lo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(g){Ot(i,r,g)}}function Ll(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(b){Ot(i,r,b)}}function Ja(i,r){var c=i.ref,g=i.refCleanup;if(c!==null)if(typeof g=="function")try{g()}catch(b){Ot(i,r,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){Ot(i,r,b)}else c.current=null}function OS(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(b){Ot(i,i.return,b)}}function Zf(i,r,c){try{var g=i.stateNode;$O(g,i.type,c,r),g[Pn]=r}catch(b){Ot(i,i.return,b)}}function jS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&br(i.type)||i.tag===4}function Kf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||jS(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&&br(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 Wf(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=bi));else if(g!==4&&(g===27&&br(i.type)&&(c=i.stateNode,r=null),i=i.child,i!==null))for(Wf(i,r,c),i=i.sibling;i!==null;)Wf(i,r,c),i=i.sibling}function Wu(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&&br(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Wu(i,r,c),i=i.sibling;i!==null;)Wu(i,r,c),i=i.sibling}function PS(i){var r=i.stateNode,c=i.memoizedProps;try{for(var g=i.type,b=r.attributes;b.length;)r.removeAttributeNode(b[0]);Nn(r,g,c),r[kn]=i,r[Pn]=c}catch(k){Ot(i,i.return,k)}}var _i=!1,yn=!1,Yf=!1,DS=typeof WeakSet=="function"?WeakSet:Set,En=null;function wO(i,r){if(i=i.containerInfo,yh=vd,i=Z0(i),Hm(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 b=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,be=i,re=null;t:for(;;){for(var ue;be!==c||b!==0&&be.nodeType!==3||(P=_+b),be!==k||g!==0&&be.nodeType!==3||(U=_+g),be.nodeType===3&&(_+=be.nodeValue.length),(ue=be.firstChild)!==null;)re=be,be=ue;for(;;){if(be===i)break t;if(re===c&&++ie===b&&(P=_),re===k&&++fe===g&&(U=_),(ue=be.nextSibling)!==null)break;be=re,re=be.parentNode}be=ue}c=P===-1||U===-1?null:{start:P,end:U}}else c=null}c=c||{start:0,end:0}}else c=null;for(bh={focusedElem:i,selectionRange:c},vd=!1,En=r;En!==null;)if(r=En,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,En=i;else for(;En!==null;){switch(r=En,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++)b=i[c],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,c=r,b=k.memoizedProps,k=k.memoizedState,g=c.stateNode;try{var ze=lo(c.type,b);i=g.getSnapshotBeforeUpdate(ze,k),g.__reactInternalSnapshotBeforeUpdate=i}catch(Ge){Ot(c,c.return,Ge)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,c=i.nodeType,c===9)kh(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":kh(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,En=i;break}En=r.return}}function zS(i,r,c){var g=c.flags;switch(c.tag){case 0:case 11:case 15:Ii(i,c),g&4&&zl(5,c);break;case 1:if(Ii(i,c),g&4)if(i=c.stateNode,r===null)try{i.componentDidMount()}catch(_){Ot(c,c.return,_)}else{var b=lo(c.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(b,r,i.__reactInternalSnapshotBeforeUpdate)}catch(_){Ot(c,c.return,_)}}g&64&&IS(c),g&512&&Ll(c,c.return);break;case 3:if(Ii(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{x1(i,r)}catch(_){Ot(c,c.return,_)}}break;case 27:r===null&&g&4&&PS(c);case 26:case 5:Ii(i,c),r===null&&g&4&&OS(c),g&512&&Ll(c,c.return);break;case 12:Ii(i,c);break;case 31:Ii(i,c),g&4&&BS(i,c);break;case 13:Ii(i,c),g&4&&US(i,c),g&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=NO.bind(null,c),XO(i,c))));break;case 22:if(g=c.memoizedState!==null||_i,!g){r=r!==null&&r.memoizedState!==null||yn,b=_i;var k=yn;_i=g,(yn=r)&&!k?Ni(i,c,(c.subtreeFlags&8772)!==0):Ii(i,c),_i=b,yn=k}break;case 30:break;default:Ii(i,c)}}function LS(i){var r=i.alternate;r!==null&&(i.alternate=null,LS(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Vr(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 Kt=null,Yn=!1;function Ti(i,r,c){for(c=c.child;c!==null;)qS(i,r,c),c=c.sibling}function qS(i,r,c){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(Qr,c)}catch{}switch(c.tag){case 26:yn||Ja(c,r),Ti(i,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:yn||Ja(c,r);var g=Kt,b=Yn;br(c.type)&&(Kt=c.stateNode,Yn=!1),Ti(i,r,c),Gl(c.stateNode),Kt=g,Yn=b;break;case 5:yn||Ja(c,r);case 6:if(g=Kt,b=Yn,Kt=null,Ti(i,r,c),Kt=g,Yn=b,Kt!==null)if(Yn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(c.stateNode)}catch(k){Ot(c,r,k)}else try{Kt.removeChild(c.stateNode)}catch(k){Ot(c,r,k)}break;case 18:Kt!==null&&(Yn?(i=Kt,Ix(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),bs(i)):Ix(Kt,c.stateNode));break;case 4:g=Kt,b=Yn,Kt=c.stateNode.containerInfo,Yn=!0,Ti(i,r,c),Kt=g,Yn=b;break;case 0:case 11:case 14:case 15:pr(2,c,r),yn||pr(4,c,r),Ti(i,r,c);break;case 1:yn||(Ja(c,r),g=c.stateNode,typeof g.componentWillUnmount=="function"&&NS(c,r,g)),Ti(i,r,c);break;case 21:Ti(i,r,c);break;case 22:yn=(g=yn)||c.memoizedState!==null,Ti(i,r,c),yn=g;break;default:Ti(i,r,c)}}function BS(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{bs(i)}catch(c){Ot(r,r.return,c)}}}function US(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{bs(i)}catch(c){Ot(r,r.return,c)}}function MO(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new DS),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new DS),r;default:throw Error(a(435,i.tag))}}function Yu(i,r){var c=MO(i);r.forEach(function(g){if(!c.has(g)){c.add(g);var b=OO.bind(null,i,g);g.then(b,b)}})}function Xn(i,r){var c=r.deletions;if(c!==null)for(var g=0;g<c.length;g++){var b=c[g],k=i,_=r,P=_;e:for(;P!==null;){switch(P.tag){case 27:if(br(P.type)){Kt=P.stateNode,Yn=!1;break e}break;case 5:Kt=P.stateNode,Yn=!1;break e;case 3:case 4:Kt=P.stateNode.containerInfo,Yn=!0;break e}P=P.return}if(Kt===null)throw Error(a(160));qS(k,_,b),Kt=null,Yn=!1,k=b.alternate,k!==null&&(k.return=null),b.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)FS(r,i),r=r.sibling}var qa=null;function FS(i,r){var c=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Xn(r,i),Jn(i),g&4&&(pr(3,i,i.return),zl(3,i),pr(5,i,i.return));break;case 1:Xn(r,i),Jn(i),g&512&&(yn||c===null||Ja(c,c.return)),g&64&&_i&&(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 b=qa;if(Xn(r,i),Jn(i),g&512&&(yn||c===null||Ja(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,b=b.ownerDocument||b;t:switch(g){case"title":k=b.getElementsByTagName("title")[0],(!k||k[gi]||k[kn]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=b.createElement(g),b.head.insertBefore(k,b.querySelector("head > title"))),Nn(k,g,c),k[kn]=i,le(k),g=k;break e;case"link":var _=Fx("link","href",b).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=b.createElement(g),Nn(k,g,c),b.head.appendChild(k);break;case"meta":if(_=Fx("meta","content",b).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=b.createElement(g),Nn(k,g,c),b.head.appendChild(k);break;default:throw Error(a(468,g))}k[kn]=i,le(k),g=k}i.stateNode=g}else Hx(b,i.type,i.stateNode);else i.stateNode=Ux(b,g,i.memoizedProps);else k!==g?(k===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):k.count--,g===null?Hx(b,i.type,i.stateNode):Ux(b,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Zf(i,i.memoizedProps,c.memoizedProps)}break;case 27:Xn(r,i),Jn(i),g&512&&(yn||c===null||Ja(c,c.return)),c!==null&&g&4&&Zf(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Xn(r,i),Jn(i),g&512&&(yn||c===null||Ja(c,c.return)),i.flags&32){b=i.stateNode;try{Wa(b,"")}catch(ze){Ot(i,i.return,ze)}}g&4&&i.stateNode!=null&&(b=i.memoizedProps,Zf(i,b,c!==null?c.memoizedProps:b)),g&1024&&(Yf=!0);break;case 6:if(Xn(r,i),Jn(i),g&4){if(i.stateNode===null)throw Error(a(162));g=i.memoizedProps,c=i.stateNode;try{c.nodeValue=g}catch(ze){Ot(i,i.return,ze)}}break;case 3:if(md=null,b=qa,qa=dd(r.containerInfo),Xn(r,i),qa=b,Jn(i),g&4&&c!==null&&c.memoizedState.isDehydrated)try{bs(r.containerInfo)}catch(ze){Ot(i,i.return,ze)}Yf&&(Yf=!1,HS(i));break;case 4:g=qa,qa=dd(i.stateNode.containerInfo),Xn(r,i),Jn(i),qa=g;break;case 12:Xn(r,i),Jn(i);break;case 31:Xn(r,i),Jn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Yu(i,g)));break;case 13:Xn(r,i),Jn(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ju=tn()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Yu(i,g)));break;case 22:b=i.memoizedState!==null;var U=c!==null&&c.memoizedState!==null,ie=_i,fe=yn;if(_i=ie||b,yn=fe||U,Xn(r,i),yn=fe,_i=ie,Jn(i),g&8192)e:for(r=i.stateNode,r._visibility=b?r._visibility&-2:r._visibility|1,b&&(c===null||U||_i||yn||co(i)),c=null,r=i;;){if(r.tag===5||r.tag===26){if(c===null){U=c=r;try{if(k=U.stateNode,b)_=k.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{P=U.stateNode;var be=U.memoizedProps.style,re=be!=null&&be.hasOwnProperty("display")?be.display:null;P.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ze){Ot(U,U.return,ze)}}}else if(r.tag===6){if(c===null){U=r;try{U.stateNode.nodeValue=b?"":U.memoizedProps}catch(ze){Ot(U,U.return,ze)}}}else if(r.tag===18){if(c===null){U=r;try{var ue=U.stateNode;b?Nx(ue,!0):Nx(U.stateNode,!1)}catch(ze){Ot(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,Yu(i,c))));break;case 19:Xn(r,i),Jn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Yu(i,g)));break;case 30:break;case 21:break;default:Xn(r,i),Jn(i)}}function Jn(i){var r=i.flags;if(r&2){try{for(var c,g=i.return;g!==null;){if(jS(g)){c=g;break}g=g.return}if(c==null)throw Error(a(160));switch(c.tag){case 27:var b=c.stateNode,k=Kf(i);Wu(i,k,b);break;case 5:var _=c.stateNode;c.flags&32&&(Wa(_,""),c.flags&=-33);var P=Kf(i);Wu(i,P,_);break;case 3:case 4:var U=c.stateNode.containerInfo,ie=Kf(i);Wf(i,ie,U);break;default:throw Error(a(161))}}catch(fe){Ot(i,i.return,fe)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function HS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;HS(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Ii(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)zS(i,r.alternate,r),r=r.sibling}function co(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:pr(4,r,r.return),co(r);break;case 1:Ja(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&NS(r,r.return,c),co(r);break;case 27:Gl(r.stateNode);case 26:case 5:Ja(r,r.return),co(r);break;case 22:r.memoizedState===null&&co(r);break;case 30:co(r);break;default:co(r)}i=i.sibling}}function Ni(i,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,b=i,k=r,_=k.flags;switch(k.tag){case 0:case 11:case 15:Ni(b,k,c),zl(4,k);break;case 1:if(Ni(b,k,c),g=k,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){Ot(g,g.return,ie)}if(g=k,b=g.updateQueue,b!==null){var P=g.stateNode;try{var U=b.shared.hiddenCallbacks;if(U!==null)for(b.shared.hiddenCallbacks=null,b=0;b<U.length;b++)S1(U[b],P)}catch(ie){Ot(g,g.return,ie)}}c&&_&64&&IS(k),Ll(k,k.return);break;case 27:PS(k);case 26:case 5:Ni(b,k,c),c&&g===null&&_&4&&OS(k),Ll(k,k.return);break;case 12:Ni(b,k,c);break;case 31:Ni(b,k,c),c&&_&4&&BS(b,k);break;case 13:Ni(b,k,c),c&&_&4&&US(b,k);break;case 22:k.memoizedState===null&&Ni(b,k,c),Ll(k,k.return);break;case 30:break;default:Ni(b,k,c)}r=r.sibling}}function Xf(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&&Ml(c))}function Jf(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ml(i))}function Ba(i,r,c,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)$S(i,r,c,g),r=r.sibling}function $S(i,r,c,g){var b=r.flags;switch(r.tag){case 0:case 11:case 15:Ba(i,r,c,g),b&2048&&zl(9,r);break;case 1:Ba(i,r,c,g);break;case 3:Ba(i,r,c,g),b&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ml(i)));break;case 12:if(b&2048){Ba(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){Ot(r,r.return,U)}}else Ba(i,r,c,g);break;case 31:Ba(i,r,c,g);break;case 13:Ba(i,r,c,g);break;case 23:break;case 22:k=r.stateNode,_=r.alternate,r.memoizedState!==null?k._visibility&2?Ba(i,r,c,g):ql(i,r):k._visibility&2?Ba(i,r,c,g):(k._visibility|=2,ls(i,r,c,g,(r.subtreeFlags&10256)!==0||!1)),b&2048&&Xf(_,r);break;case 24:Ba(i,r,c,g),b&2048&&Jf(r.alternate,r);break;default:Ba(i,r,c,g)}}function ls(i,r,c,g,b){for(b=b&&((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:ls(k,_,P,U,b),zl(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?ls(k,_,P,U,b):ql(k,_):(fe._visibility|=2,ls(k,_,P,U,b)),b&&ie&2048&&Xf(_.alternate,_);break;case 24:ls(k,_,P,U,b),b&&ie&2048&&Jf(_.alternate,_);break;default:ls(k,_,P,U,b)}r=r.sibling}}function ql(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=i,g=r,b=g.flags;switch(g.tag){case 22:ql(c,g),b&2048&&Xf(g.alternate,g);break;case 24:ql(c,g),b&2048&&Jf(g.alternate,g);break;default:ql(c,g)}r=r.sibling}}var Bl=8192;function cs(i,r,c){if(i.subtreeFlags&Bl)for(i=i.child;i!==null;)QS(i,r,c),i=i.sibling}function QS(i,r,c){switch(i.tag){case 26:cs(i,r,c),i.flags&Bl&&i.memoizedState!==null&&uj(c,qa,i.memoizedState,i.memoizedProps);break;case 5:cs(i,r,c);break;case 3:case 4:var g=qa;qa=dd(i.stateNode.containerInfo),cs(i,r,c),qa=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=Bl,Bl=16777216,cs(i,r,c),Bl=g):cs(i,r,c));break;default:cs(i,r,c)}}function VS(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 Ul(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];En=g,ZS(g,i)}VS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)GS(i),i=i.sibling}function GS(i){switch(i.tag){case 0:case 11:case 15:Ul(i),i.flags&2048&&pr(9,i,i.return);break;case 3:Ul(i);break;case 12:Ul(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,Xu(i)):Ul(i);break;default:Ul(i)}}function Xu(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];En=g,ZS(g,i)}VS(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:pr(8,r,r.return),Xu(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,Xu(r));break;default:Xu(r)}i=i.sibling}}function ZS(i,r){for(;En!==null;){var c=En;switch(c.tag){case 0:case 11:case 15:pr(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:Ml(c.memoizedState.cache)}if(g=c.child,g!==null)g.return=c,En=g;else e:for(c=i;En!==null;){g=En;var b=g.sibling,k=g.return;if(LS(g),g===c){En=null;break e}if(b!==null){b.return=k,En=b;break e}En=k}}}var CO={getCacheForType:function(i){var r=Tn(hn),c=r.data.get(i);return c===void 0&&(c=i(),r.data.set(i,c)),c},cacheSignal:function(){return Tn(hn).controller.signal}},AO=typeof WeakMap=="function"?WeakMap:Map,Et=0,Bt=null,ut=null,ft=0,Nt=0,ma=null,mr=!1,us=!1,eh=!1,Oi=0,an=0,fr=0,uo=0,th=0,fa=0,ds=0,Fl=null,ea=null,nh=!1,Ju=0,KS=0,ed=1/0,td=null,hr=null,wn=0,gr=null,ps=null,ji=0,ah=0,ih=null,WS=null,Hl=0,rh=null;function ha(){return(Et&2)!==0&&ft!==0?ft&-ft:H.T!==null?dh():ul()}function YS(){if(fa===0)if((ft&536870912)===0||yt){var i=sa;sa<<=1,(sa&3932160)===0&&(sa=262144),fa=i}else fa=536870912;return i=da.current,i!==null&&(i.flags|=32),fa}function ta(i,r,c){(i===Bt&&(Nt===2||Nt===9)||i.cancelPendingCommit!==null)&&(ms(i,0),vr(i,ft,fa,!1)),Yi(i,c),((Et&2)===0||i!==Bt)&&(i===Bt&&((Et&2)===0&&(uo|=c),an===4&&vr(i,ft,fa,!1)),ei(i))}function XS(i,r,c){if((Et&6)!==0)throw Error(a(327));var g=!c&&(r&127)===0&&(r&i.expiredLanes)===0||fi(i,r),b=g?_O(i,r):sh(i,r,!0),k=g;do{if(b===0){us&&!g&&vr(i,r,0,!1);break}else{if(c=i.current.alternate,k&&!EO(c)){b=sh(i,r,!1),k=!1;continue}if(b===2){if(k=r,i.errorRecoveryDisabledLanes&k)var _=0;else _=i.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){r=_;e:{var P=i;b=Fl;var U=P.current.memoizedState.isDehydrated;if(U&&(ms(P,_).flags|=256),_=sh(P,_,!1),_!==2){if(eh&&!U){P.errorRecoveryDisabledLanes|=k,uo|=k,b=4;break e}k=ea,ea=b,k!==null&&(ea===null?ea=k:ea.push.apply(ea,k))}b=_}if(k=!1,b!==2)continue}}if(b===1){ms(i,0),vr(i,r,0,!0);break}e:{switch(g=i,k=b,k){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:vr(g,r,fa,!mr);break e;case 2:ea=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(b=Ju+300-tn(),10<b)){if(vr(g,r,fa,!mr),Ka(g,0,!0)!==0)break e;ji=r,g.timeoutHandle=_x(JS.bind(null,g,c,ea,td,nh,r,fa,uo,ds,mr,k,"Throttled",-0,0),b);break e}JS(g,c,ea,td,nh,r,fa,uo,ds,mr,k,null,-0,0)}}break}while(!0);ei(i)}function JS(i,r,c,g,b,k,_,P,U,ie,fe,be,re,ue){if(i.timeoutHandle=-1,be=r.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bi},QS(r,k,be);var ze=(k&62914560)===k?Ju-tn():(k&4194048)===k?KS-tn():0;if(ze=dj(be,ze),ze!==null){ji=k,i.cancelPendingCommit=ze(sx.bind(null,i,r,k,c,g,b,_,P,U,fe,be,null,re,ue)),vr(i,k,_,!ie);return}}sx(i,r,k,c,g,b,_,P,U)}function EO(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 b=c[g],k=b.getSnapshot;b=b.value;try{if(!ca(k(),b))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 vr(i,r,c,g){r&=~th,r&=~uo,i.suspendedLanes|=r,i.pingedLanes&=~r,g&&(i.warmLanes|=r),g=i.expirationTimes;for(var b=r;0<b;){var k=31-Ln(b),_=1<<k;g[k]=-1,b&=~_}c!==0&&qo(i,c,r)}function nd(){return(Et&6)===0?($l(0),!1):!0}function oh(){if(ut!==null){if(Nt===0)var i=ut.return;else i=ut,wi=to=null,kf(i),as=null,Al=0,i=ut;for(;i!==null;)TS(i.alternate,i),i=i.return;ut=null}}function ms(i,r){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,GO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),ji=0,oh(),Bt=i,ut=c=xi(i.current,null),ft=r,Nt=0,ma=null,mr=!1,us=fi(i,r),eh=!1,ds=fa=th=uo=fr=an=0,ea=Fl=null,nh=!1,(r&8)!==0&&(r|=r&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=r;0<g;){var b=31-Ln(g),k=1<<b;r|=i[b],g&=~k}return Oi=r,wu(),c}function ex(i,r){ot=null,H.H=jl,r===ns||r===Iu?(r=g1(),Nt=3):r===uf?(r=g1(),Nt=4):Nt=r===Lf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ma=r,ut===null&&(an=1,Qu(i,Ma(r,i.current)))}function tx(){var i=da.current;return i===null?!0:(ft&4194048)===ft?Ra===null:(ft&62914560)===ft||(ft&536870912)!==0?i===Ra:!1}function nx(){var i=H.H;return H.H=jl,i===null?jl:i}function ax(){var i=H.A;return H.A=CO,i}function ad(){an=4,mr||(ft&4194048)!==ft&&da.current!==null||(us=!0),(fr&134217727)===0&&(uo&134217727)===0||Bt===null||vr(Bt,ft,fa,!1)}function sh(i,r,c){var g=Et;Et|=2;var b=nx(),k=ax();(Bt!==i||ft!==r)&&(td=null,ms(i,r)),r=!1;var _=an;e:do try{if(Nt!==0&&ut!==null){var P=ut,U=ma;switch(Nt){case 8:oh(),_=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(r=!0);var ie=Nt;if(Nt=0,ma=null,fs(i,P,U,ie),c&&us){_=0;break e}break;default:ie=Nt,Nt=0,ma=null,fs(i,P,U,ie)}}RO(),_=an;break}catch(fe){ex(i,fe)}while(!0);return r&&i.shellSuspendCounter++,wi=to=null,Et=g,H.H=b,H.A=k,ut===null&&(Bt=null,ft=0,wu()),_}function RO(){for(;ut!==null;)ix(ut)}function _O(i,r){var c=Et;Et|=2;var g=nx(),b=ax();Bt!==i||ft!==r?(td=null,ed=tn()+500,ms(i,r)):us=fi(i,r);e:do try{if(Nt!==0&&ut!==null){r=ut;var k=ma;t:switch(Nt){case 1:Nt=0,ma=null,fs(i,r,k,1);break;case 2:case 9:if(f1(k)){Nt=0,ma=null,rx(r);break}r=function(){Nt!==2&&Nt!==9||Bt!==i||(Nt=7),ei(i)},k.then(r,r);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:f1(k)?(Nt=0,ma=null,rx(r)):(Nt=0,ma=null,fs(i,r,k,7));break;case 5:var _=null;switch(ut.tag){case 26:_=ut.memoizedState;case 5:case 27:var P=ut;if(_?$x(_):P.stateNode.complete){Nt=0,ma=null;var U=P.sibling;if(U!==null)ut=U;else{var ie=P.return;ie!==null?(ut=ie,id(ie)):ut=null}break t}}Nt=0,ma=null,fs(i,r,k,5);break;case 6:Nt=0,ma=null,fs(i,r,k,6);break;case 8:oh(),an=6;break e;default:throw Error(a(462))}}TO();break}catch(fe){ex(i,fe)}while(!0);return wi=to=null,H.H=g,H.A=b,Et=c,ut!==null?0:(Bt=null,ft=0,wu(),an)}function TO(){for(;ut!==null&&!Va();)ix(ut)}function ix(i){var r=RS(i.alternate,i,Oi);i.memoizedProps=i.pendingProps,r===null?id(i):ut=r}function rx(i){var r=i,c=r.alternate;switch(r.tag){case 15:case 0:r=kS(c,r,r.pendingProps,r.type,void 0,ft);break;case 11:r=kS(c,r,r.pendingProps,r.type.render,r.ref,ft);break;case 5:kf(r);default:TS(c,r),r=ut=a1(r,Oi),r=RS(c,r,Oi)}i.memoizedProps=i.pendingProps,r===null?id(i):ut=r}function fs(i,r,c,g){wi=to=null,kf(r),as=null,Al=0;var b=r.return;try{if(yO(i,b,r,c,ft)){an=1,Qu(i,Ma(c,i.current)),ut=null;return}}catch(k){if(b!==null)throw ut=b,k;an=1,Qu(i,Ma(c,i.current)),ut=null;return}r.flags&32768?(yt||g===1?i=!0:us||(ft&536870912)!==0?i=!1:(mr=i=!0,(g===2||g===9||g===3||g===6)&&(g=da.current,g!==null&&g.tag===13&&(g.flags|=16384))),ox(r,i)):id(r)}function id(i){var r=i;do{if((r.flags&32768)!==0){ox(r,mr);return}i=r.return;var c=xO(r.alternate,r,Oi);if(c!==null){ut=c;return}if(r=r.sibling,r!==null){ut=r;return}ut=r=i}while(r!==null);an===0&&(an=5)}function ox(i,r){do{var c=kO(i.alternate,i);if(c!==null){c.flags&=32767,ut=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(i=i.sibling,i!==null)){ut=i;return}ut=i=c}while(i!==null);an=6,ut=null}function sx(i,r,c,g,b,k,_,P,U){i.cancelPendingCommit=null;do rd();while(wn!==0);if((Et&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(k=r.lanes|r.childLanes,k|=Zm,pu(i,c,k,_,P,U),i===Bt&&(ut=Bt=null,ft=0),ps=r,gr=i,ji=c,ah=k,ih=b,WS=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,jO(fn,function(){return px(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,b=ce.p,ce.p=2,_=Et,Et|=4;try{wO(i,r,c)}finally{Et=_,ce.p=b,H.T=g}}wn=1,lx(),cx(),ux()}}function lx(){if(wn===1){wn=0;var i=gr,r=ps,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=H.T,H.T=null;var g=ce.p;ce.p=2;var b=Et;Et|=4;try{FS(r,i);var k=bh,_=Z0(i.containerInfo),P=k.focusedElem,U=k.selectionRange;if(_!==P&&P&&P.ownerDocument&&G0(P.ownerDocument.documentElement,P)){if(U!==null&&Hm(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 be=P.ownerDocument||document,re=be&&be.defaultView||window;if(re.getSelection){var ue=re.getSelection(),ze=P.textContent.length,Ge=Math.min(U.start,ze),qt=U.end===void 0?Ge:Math.min(U.end,ze);!ue.extend&&Ge>qt&&(_=qt,qt=Ge,Ge=_);var W=V0(P,Ge),G=V0(P,qt);if(W&&G&&(ue.rangeCount!==1||ue.anchorNode!==W.node||ue.anchorOffset!==W.offset||ue.focusNode!==G.node||ue.focusOffset!==G.offset)){var ae=be.createRange();ae.setStart(W.node,W.offset),ue.removeAllRanges(),Ge>qt?(ue.addRange(ae),ue.extend(G.node,G.offset)):(ae.setEnd(G.node,G.offset),ue.addRange(ae))}}}}for(be=[],ue=P;ue=ue.parentNode;)ue.nodeType===1&&be.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<be.length;P++){var ve=be[P];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}vd=!!yh,bh=yh=null}finally{Et=b,ce.p=g,H.T=c}}i.current=r,wn=2}}function cx(){if(wn===2){wn=0;var i=gr,r=ps,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=H.T,H.T=null;var g=ce.p;ce.p=2;var b=Et;Et|=4;try{zS(i,r.alternate,r)}finally{Et=b,ce.p=g,H.T=c}}wn=3}}function ux(){if(wn===4||wn===3){wn=0,Ki();var i=gr,r=ps,c=ji,g=WS;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?wn=5:(wn=0,ps=gr=null,dx(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(hr=null),Uo(c),r=r.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(Qr,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=H.T,b=ce.p,ce.p=2,H.T=null;try{for(var k=i.onRecoverableError,_=0;_<g.length;_++){var P=g[_];k(P.value,{componentStack:P.stack})}}finally{H.T=r,ce.p=b}}(ji&3)!==0&&rd(),ei(i),b=i.pendingLanes,(c&261930)!==0&&(b&42)!==0?i===rh?Hl++:(Hl=0,rh=i):Hl=0,$l(0)}}function dx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Ml(r)))}function rd(){return lx(),cx(),ux(),px()}function px(){if(wn!==5)return!1;var i=gr,r=ah;ah=0;var c=Uo(ji),g=H.T,b=ce.p;try{ce.p=32>c?32:c,H.T=null,c=ih,ih=null;var k=gr,_=ji;if(wn=0,ps=gr=null,ji=0,(Et&6)!==0)throw Error(a(331));var P=Et;if(Et|=4,GS(k.current),$S(k,k.current,_,c),Et=P,$l(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(Qr,k)}catch{}return!0}finally{ce.p=b,H.T=g,dx(i,r)}}function mx(i,r,c){r=Ma(c,r),r=zf(i.stateNode,r,2),i=cr(i,r,2),i!==null&&(Yi(i,2),ei(i))}function Ot(i,r,c){if(i.tag===3)mx(i,i,c);else for(;r!==null;){if(r.tag===3){mx(r,i,c);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(hr===null||!hr.has(g))){i=Ma(c,i),c=fS(2),g=cr(r,c,2),g!==null&&(hS(c,g,r,i),Yi(g,2),ei(g));break}}r=r.return}}function lh(i,r,c){var g=i.pingCache;if(g===null){g=i.pingCache=new AO;var b=new Set;g.set(r,b)}else b=g.get(r),b===void 0&&(b=new Set,g.set(r,b));b.has(c)||(eh=!0,b.add(c),i=IO.bind(null,i,r,c),r.then(i,i))}function IO(i,r,c){var g=i.pingCache;g!==null&&g.delete(r),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,Bt===i&&(ft&c)===c&&(an===4||an===3&&(ft&62914560)===ft&&300>tn()-Ju?(Et&2)===0&&ms(i,0):th|=c,ds===ft&&(ds=0)),ei(i)}function fx(i,r){r===0&&(r=Lo()),i=Xr(i,r),i!==null&&(Yi(i,r),ei(i))}function NO(i){var r=i.memoizedState,c=0;r!==null&&(c=r.retryLane),fx(i,c)}function OO(i,r){var c=0;switch(i.tag){case 31:case 13:var g=i.stateNode,b=i.memoizedState;b!==null&&(c=b.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),fx(i,c)}function jO(i,r){return ln(i,r)}var od=null,hs=null,ch=!1,sd=!1,uh=!1,yr=0;function ei(i){i!==hs&&i.next===null&&(hs===null?od=hs=i:hs=hs.next=i),sd=!0,ch||(ch=!0,DO())}function $l(i,r){if(!uh&&sd){uh=!0;do for(var c=!1,g=od;g!==null;){if(i!==0){var b=g.pendingLanes;if(b===0)var k=0;else{var _=g.suspendedLanes,P=g.pingedLanes;k=(1<<31-Ln(42|i)+1)-1,k&=b&~(_&~P),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(c=!0,yx(g,k))}else k=ft,k=Ka(g,g===Bt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||fi(g,k)||(c=!0,yx(g,k));g=g.next}while(c);uh=!1}}function PO(){hx()}function hx(){sd=ch=!1;var i=0;yr!==0&&VO()&&(i=yr);for(var r=tn(),c=null,g=od;g!==null;){var b=g.next,k=gx(g,r);k===0?(g.next=null,c===null?od=b:c.next=b,b===null&&(hs=c)):(c=g,(i!==0||(k&3)!==0)&&(sd=!0)),g=b}wn!==0&&wn!==5||$l(i),yr!==0&&(yr=0)}function gx(i,r){for(var c=i.suspendedLanes,g=i.pingedLanes,b=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var _=31-Ln(k),P=1<<_,U=b[_];U===-1?((P&c)===0||(P&g)!==0)&&(b[_]=Tm(P,r)):U<=r&&(i.expiredLanes|=P),k&=~P}if(r=Bt,c=ft,c=Ka(i,i===r?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,c===0||i===r&&(Nt===2||Nt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&Oa(g),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||fi(i,c)){if(r=c&-c,r===i.callbackPriority)return r;switch(g!==null&&Oa(g),Uo(c)){case 2:case 8:c=Rt;break;case 32:c=fn;break;case 268435456:c=jn;break;default:c=fn}return g=vx.bind(null,i),c=ln(c,g),i.callbackPriority=r,i.callbackNode=c,r}return g!==null&&g!==null&&Oa(g),i.callbackPriority=2,i.callbackNode=null,2}function vx(i,r){if(wn!==0&&wn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(rd()&&i.callbackNode!==c)return null;var g=ft;return g=Ka(i,i===Bt?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(XS(i,g,r),gx(i,tn()),i.callbackNode!=null&&i.callbackNode===c?vx.bind(null,i):null)}function yx(i,r){if(rd())return null;XS(i,r,!0)}function DO(){ZO(function(){(Et&6)!==0?ln(_e,PO):hx()})}function dh(){if(yr===0){var i=es;i===0&&(i=Zt,Zt<<=1,(Zt&261888)===0&&(Zt=256)),yr=i}return yr}function bx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:hu(""+i)}function Sx(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 zO(i,r,c,g,b){if(r==="submit"&&c&&c.stateNode===b){var k=bx((b[Pn]||null).action),_=g.submitter;_&&(r=(r=_[Pn]||null)?bx(r.formAction):_.getAttribute("formAction"),r!==null&&(k=r,_=null));var P=new bu("action","action",null,g,b);i.push({event:P,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(yr!==0){var U=_?Sx(b,_):new FormData(b);If(c,{pending:!0,data:U,method:b.method,action:k},null,U)}}else typeof k=="function"&&(P.preventDefault(),U=_?Sx(b,_):new FormData(b),If(c,{pending:!0,data:U,method:b.method,action:k},k,U))},currentTarget:b}]})}}for(var ph=0;ph<Gm.length;ph++){var mh=Gm[ph],LO=mh.toLowerCase(),qO=mh[0].toUpperCase()+mh.slice(1);La(LO,"on"+qO)}La(Y0,"onAnimationEnd"),La(X0,"onAnimationIteration"),La(J0,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(tO,"onTransitionRun"),La(nO,"onTransitionStart"),La(aO,"onTransitionCancel"),La(e1,"onTransitionEnd"),Ye("onMouseEnter",["mouseout","mouseover"]),Ye("onMouseLeave",["mouseout","mouseover"]),Ye("onPointerEnter",["pointerout","pointerover"]),Ye("onPointerLeave",["pointerout","pointerover"]),kt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kt("onBeforeInput",["compositionend","keypress","textInput","paste"]),kt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="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(" "),BO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ql));function xx(i,r){r=(r&4)!==0;for(var c=0;c<i.length;c++){var g=i[c],b=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&&b.isPropagationStopped())break e;k=P,b.currentTarget=ie;try{k(b)}catch(fe){ku(fe)}b.currentTarget=null,k=U}else for(_=0;_<g.length;_++){if(P=g[_],U=P.instance,ie=P.currentTarget,P=P.listener,U!==k&&b.isPropagationStopped())break e;k=P,b.currentTarget=ie;try{k(b)}catch(fe){ku(fe)}b.currentTarget=null,k=U}}}}function dt(i,r){var c=r[pl];c===void 0&&(c=r[pl]=new Set);var g=i+"__bubble";c.has(g)||(kx(r,i,2,!1),c.add(g))}function fh(i,r,c){var g=0;r&&(g|=4),kx(c,i,g,r)}var ld="_reactListening"+Math.random().toString(36).slice(2);function hh(i){if(!i[ld]){i[ld]=!0,qe.forEach(function(c){c!=="selectionchange"&&(BO.has(c)||fh(c,!1,i),fh(c,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[ld]||(r[ld]=!0,fh("selectionchange",!1,r))}}function kx(i,r,c,g){switch(Yx(r)){case 2:var b=fj;break;case 8:b=hj;break;default:b=Th}c=b.bind(null,r,c,i),b=void 0,!jm||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(b=!0),g?b!==void 0?i.addEventListener(r,c,{capture:!0,passive:b}):i.addEventListener(r,c,!0):b!==void 0?i.addEventListener(r,c,{passive:b}):i.addEventListener(r,c,!1)}function gh(i,r,c,g,b){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===b)break;if(_===4)for(_=g.return;_!==null;){var U=_.tag;if((U===3||U===4)&&_.stateNode.containerInfo===b)return;_=_.return}for(;P!==null;){if(_=vi(P),_===null)return;if(U=_.tag,U===5||U===6||U===26||U===27){g=k=_;continue e}P=P.parentNode}}g=g.return}E0(function(){var ie=k,fe=Nm(c),be=[];e:{var re=t1.get(i);if(re!==void 0){var ue=bu,ze=i;switch(i){case"keypress":if(vu(c)===0)break e;case"keydown":case"keyup":ue=O5;break;case"focusin":ze="focus",ue=Lm;break;case"focusout":ze="blur",ue=Lm;break;case"beforeblur":case"afterblur":ue=Lm;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":ue=T0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=x5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=D5;break;case Y0:case X0:case J0:ue=M5;break;case e1:ue=L5;break;case"scroll":case"scrollend":ue=b5;break;case"wheel":ue=B5;break;case"copy":case"cut":case"paste":ue=A5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=N0;break;case"toggle":case"beforetoggle":ue=F5}var Ge=(r&4)!==0,qt=!Ge&&(i==="scroll"||i==="scrollend"),W=Ge?re!==null?re+"Capture":null:re;Ge=[];for(var G=ie,ae;G!==null;){var ve=G;if(ae=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ae===null||W===null||(ve=ml(G,W),ve!=null&&Ge.push(Vl(G,ve,ae))),qt)break;G=G.return}0<Ge.length&&(re=new ue(re,ze,null,c,fe),be.push({event:re,listeners:Ge}))}}if((r&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",ue=i==="mouseout"||i==="pointerout",re&&c!==Im&&(ze=c.relatedTarget||c.fromElement)&&(vi(ze)||ze[Xi]))break e;if((ue||re)&&(re=fe.window===fe?fe:(re=fe.ownerDocument)?re.defaultView||re.parentWindow:window,ue?(ze=c.relatedTarget||c.toElement,ue=ie,ze=ze?vi(ze):null,ze!==null&&(qt=p(ze),Ge=ze.tag,ze!==qt||Ge!==5&&Ge!==27&&Ge!==6)&&(ze=null)):(ue=null,ze=ie),ue!==ze)){if(Ge=T0,ve="onMouseLeave",W="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(Ge=N0,ve="onPointerLeave",W="onPointerEnter",G="pointer"),qt=ue==null?re:la(ue),ae=ze==null?re:la(ze),re=new Ge(ve,G+"leave",ue,c,fe),re.target=qt,re.relatedTarget=ae,ve=null,vi(fe)===ie&&(Ge=new Ge(W,G+"enter",ze,c,fe),Ge.target=ae,Ge.relatedTarget=qt,ve=Ge),qt=ve,ue&&ze)t:{for(Ge=UO,W=ue,G=ze,ae=0,ve=W;ve;ve=Ge(ve))ae++;ve=0;for(var Qe=G;Qe;Qe=Ge(Qe))ve++;for(;0<ae-ve;)W=Ge(W),ae--;for(;0<ve-ae;)G=Ge(G),ve--;for(;ae--;){if(W===G||G!==null&&W===G.alternate){Ge=W;break t}W=Ge(W),G=Ge(G)}Ge=null}else Ge=null;ue!==null&&wx(be,re,ue,Ge,!1),ze!==null&&qt!==null&&wx(be,qt,ze,Ge,!0)}}e:{if(re=ie?la(ie):window,ue=re.nodeName&&re.nodeName.toLowerCase(),ue==="select"||ue==="input"&&re.type==="file")var Mt=B0;else if(L0(re))if(U0)Mt=X5;else{Mt=W5;var Be=K5}else ue=re.nodeName,!ue||ue.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&Zr(ie.elementType)&&(Mt=B0):Mt=Y5;if(Mt&&(Mt=Mt(i,ie))){q0(be,Mt,c,fe);break e}Be&&Be(i,re,ie),i==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&et(re,"number",re.value)}switch(Be=ie?la(ie):window,i){case"focusin":(L0(Be)||Be.contentEditable==="true")&&(Vo=Be,$m=ie,xl=null);break;case"focusout":xl=$m=Vo=null;break;case"mousedown":Qm=!0;break;case"contextmenu":case"mouseup":case"dragend":Qm=!1,K0(be,c,fe);break;case"selectionchange":if(eO)break;case"keydown":case"keyup":K0(be,c,fe)}var st;if(Bm)e:{switch(i){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Qo?D0(i,c)&&(ht="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(ht="onCompositionStart");ht&&(O0&&c.locale!=="ko"&&(Qo||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Qo&&(st=R0()):(nr=fe,Pm="value"in nr?nr.value:nr.textContent,Qo=!0)),Be=cd(ie,ht),0<Be.length&&(ht=new I0(ht,i,null,c,fe),be.push({event:ht,listeners:Be}),st?ht.data=st:(st=z0(c),st!==null&&(ht.data=st)))),(st=$5?Q5(i,c):V5(i,c))&&(ht=cd(ie,"onBeforeInput"),0<ht.length&&(Be=new I0("onBeforeInput","beforeinput",null,c,fe),be.push({event:Be,listeners:ht}),Be.data=st)),zO(be,i,ie,c,fe)}xx(be,r)})}function Vl(i,r,c){return{instance:i,listener:r,currentTarget:c}}function cd(i,r){for(var c=r+"Capture",g=[];i!==null;){var b=i,k=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||k===null||(b=ml(i,c),b!=null&&g.unshift(Vl(i,b,k)),b=ml(i,r),b!=null&&g.push(Vl(i,b,k))),i.tag===3)return g;i=i.return}return[]}function UO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function wx(i,r,c,g,b){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,b?(ie=ml(c,k),ie!=null&&_.unshift(Vl(c,ie,U))):b||(ie=ml(c,k),ie!=null&&_.push(Vl(c,ie,U)))),c=c.return}_.length!==0&&i.push({event:r,listeners:_})}var FO=/\r\n?/g,HO=/\u0000|\uFFFD/g;function Mx(i){return(typeof i=="string"?i:""+i).replace(FO,`
10
+ `).replace(HO,"")}function Cx(i,r){return r=Mx(r),Mx(i)===r}function Lt(i,r,c,g,b,k){switch(c){case"children":typeof g=="string"?r==="body"||r==="textarea"&&g===""||Wa(i,g):(typeof g=="number"||typeof g=="bigint")&&r!=="body"&&Wa(i,""+g);break;case"className":Fe(i,"class",g);break;case"tabIndex":Fe(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Fe(i,c,g);break;case"style":yi(i,g,k);break;case"data":if(r!=="object"){Fe(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=hu(""+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"&&Lt(i,r,"name",b.name,b,null),Lt(i,r,"formEncType",b.formEncType,b,null),Lt(i,r,"formMethod",b.formMethod,b,null),Lt(i,r,"formTarget",b.formTarget,b,null)):(Lt(i,r,"encType",b.encType,b,null),Lt(i,r,"method",b.method,b,null),Lt(i,r,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=hu(""+g),i.setAttribute(c,g);break;case"onClick":g!=null&&(i.onclick=bi);break;case"onScroll":g!=null&&dt("scroll",i);break;case"onScrollEnd":g!=null&&dt("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(b.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=hu(""+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":dt("beforetoggle",i),dt("toggle",i),$t(i,"popover",g);break;case"xlinkActuate":wt(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":wt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":wt(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":wt(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":wt(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":wt(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":wt(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":wt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":wt(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":$t(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=v5.get(c)||c,$t(i,c,g))}}function vh(i,r,c,g,b,k){switch(c){case"style":yi(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(b.children!=null)throw Error(a(60));i.innerHTML=c}}break;case"children":typeof g=="string"?Wa(i,g):(typeof g=="number"||typeof g=="bigint")&&Wa(i,""+g);break;case"onScroll":g!=null&&dt("scroll",i);break;case"onScrollEnd":g!=null&&dt("scrollend",i);break;case"onClick":g!=null&&(i.onclick=bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Je.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),r=c.slice(2,b?c.length-7:void 0),k=i[Pn]||null,k=k!=null?k[c]:null,typeof k=="function"&&i.removeEventListener(r,k,b),typeof g=="function")){typeof k!="function"&&k!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(r,g,b);break e}c in i?i[c]=g:g===!0?i.setAttribute(c,""):$t(i,c,g)}}}function Nn(i,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",i),dt("load",i);var g=!1,b=!1,k;for(k in c)if(c.hasOwnProperty(k)){var _=c[k];if(_!=null)switch(k){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Lt(i,r,k,_,c,null)}}b&&Lt(i,r,"srcSet",c.srcSet,c,null),g&&Lt(i,r,"src",c.src,c,null);return;case"input":dt("invalid",i);var P=k=_=b=null,U=null,ie=null;for(g in c)if(c.hasOwnProperty(g)){var fe=c[g];if(fe!=null)switch(g){case"name":b=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:Lt(i,r,g,fe,c,null)}}Zn(i,k,P,U,ie,_,b,!1);return;case"select":dt("invalid",i),g=_=k=null;for(b in c)if(c.hasOwnProperty(b)&&(P=c[b],P!=null))switch(b){case"value":k=P;break;case"defaultValue":_=P;break;case"multiple":g=P;default:Lt(i,r,b,P,c,null)}r=k,c=_,i.multiple=!!g,r!=null?ct(i,!!g,r,!1):c!=null&&ct(i,!!g,c,!0);return;case"textarea":dt("invalid",i),k=b=g=null;for(_ in c)if(c.hasOwnProperty(_)&&(P=c[_],P!=null))switch(_){case"value":g=P;break;case"defaultValue":b=P;break;case"children":k=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:Lt(i,r,_,P,c,null)}Gr(i,g,b,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":Lt(i,r,U,g,c,null));return;case"dialog":dt("beforetoggle",i),dt("toggle",i),dt("cancel",i),dt("close",i);break;case"iframe":case"object":dt("load",i);break;case"video":case"audio":for(g=0;g<Ql.length;g++)dt(Ql[g],i);break;case"image":dt("error",i),dt("load",i);break;case"details":dt("toggle",i);break;case"embed":case"source":case"link":dt("error",i),dt("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:Lt(i,r,ie,g,c,null)}return;default:if(Zr(r)){for(fe in c)c.hasOwnProperty(fe)&&(g=c[fe],g!==void 0&&vh(i,r,fe,g,c,void 0));return}}for(P in c)c.hasOwnProperty(P)&&(g=c[P],g!=null&&Lt(i,r,P,g,c,null))}function $O(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 b=null,k=null,_=null,P=null,U=null,ie=null,fe=null;for(ue in c){var be=c[ue];if(c.hasOwnProperty(ue)&&be!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":U=be;default:g.hasOwnProperty(ue)||Lt(i,r,ue,null,g,be)}}for(var re in g){var ue=g[re];if(be=c[re],g.hasOwnProperty(re)&&(ue!=null||be!=null))switch(re){case"type":k=ue;break;case"name":b=ue;break;case"checked":ie=ue;break;case"defaultChecked":fe=ue;break;case"value":_=ue;break;case"defaultValue":P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,r));break;default:ue!==be&&Lt(i,r,re,ue,g,be)}}ka(i,_,P,U,ie,fe,k,b);return;case"select":ue=_=P=re=null;for(k in c)if(U=c[k],c.hasOwnProperty(k)&&U!=null)switch(k){case"value":break;case"multiple":ue=U;default:g.hasOwnProperty(k)||Lt(i,r,k,null,g,U)}for(b in g)if(k=g[b],U=c[b],g.hasOwnProperty(b)&&(k!=null||U!=null))switch(b){case"value":re=k;break;case"defaultValue":P=k;break;case"multiple":_=k;default:k!==U&&Lt(i,r,b,k,g,U)}r=P,c=_,g=ue,re!=null?ct(i,!!c,re,!1):!!g!=!!c&&(r!=null?ct(i,!!c,r,!0):ct(i,!!c,c?[]:"",!1));return;case"textarea":ue=re=null;for(P in c)if(b=c[P],c.hasOwnProperty(P)&&b!=null&&!g.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Lt(i,r,P,null,g,b)}for(_ in g)if(b=g[_],k=c[_],g.hasOwnProperty(_)&&(b!=null||k!=null))switch(_){case"value":re=b;break;case"defaultValue":ue=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(a(91));break;default:b!==k&&Lt(i,r,_,b,g,k)}Kn(i,re,ue);return;case"option":for(var ze in c)re=c[ze],c.hasOwnProperty(ze)&&re!=null&&!g.hasOwnProperty(ze)&&(ze==="selected"?i.selected=!1:Lt(i,r,ze,null,g,re));for(U in g)re=g[U],ue=c[U],g.hasOwnProperty(U)&&re!==ue&&(re!=null||ue!=null)&&(U==="selected"?i.selected=re&&typeof re!="function"&&typeof re!="symbol":Lt(i,r,U,re,g,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in c)re=c[Ge],c.hasOwnProperty(Ge)&&re!=null&&!g.hasOwnProperty(Ge)&&Lt(i,r,Ge,null,g,re);for(ie in g)if(re=g[ie],ue=c[ie],g.hasOwnProperty(ie)&&re!==ue&&(re!=null||ue!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:Lt(i,r,ie,re,g,ue)}return;default:if(Zr(r)){for(var qt in c)re=c[qt],c.hasOwnProperty(qt)&&re!==void 0&&!g.hasOwnProperty(qt)&&vh(i,r,qt,void 0,g,re);for(fe in g)re=g[fe],ue=c[fe],!g.hasOwnProperty(fe)||re===ue||re===void 0&&ue===void 0||vh(i,r,fe,re,g,ue);return}}for(var W in c)re=c[W],c.hasOwnProperty(W)&&re!=null&&!g.hasOwnProperty(W)&&Lt(i,r,W,null,g,re);for(be in g)re=g[be],ue=c[be],!g.hasOwnProperty(be)||re===ue||re==null&&ue==null||Lt(i,r,be,re,g,ue)}function Ax(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QO(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,c=performance.getEntriesByType("resource"),g=0;g<c.length;g++){var b=c[g],k=b.transferSize,_=b.initiatorType,P=b.duration;if(k&&P&&Ax(_)){for(_=0,P=b.responseEnd,g+=1;g<c.length;g++){var U=c[g],ie=U.startTime;if(ie>P)break;var fe=U.transferSize,be=U.initiatorType;fe&&Ax(be)&&(U=U.responseEnd,_+=fe*(U<P?1:(P-ie)/(U-ie)))}if(--g,r+=8*(k+_)/(b.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 yh=null,bh=null;function ud(i){return i.nodeType===9?i:i.ownerDocument}function Ex(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 Rx(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 Sh(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 xh=null;function VO(){var i=window.event;return i&&i.type==="popstate"?i===xh?!1:(xh=i,!0):(xh=null,!1)}var _x=typeof setTimeout=="function"?setTimeout:void 0,GO=typeof clearTimeout=="function"?clearTimeout:void 0,Tx=typeof Promise=="function"?Promise:void 0,ZO=typeof queueMicrotask=="function"?queueMicrotask:typeof Tx<"u"?function(i){return Tx.resolve(null).then(i).catch(KO)}:_x;function KO(i){setTimeout(function(){throw i})}function br(i){return i==="head"}function Ix(i,r){var c=r,g=0;do{var b=c.nextSibling;if(i.removeChild(c),b&&b.nodeType===8)if(c=b.data,c==="/$"||c==="/&"){if(g===0){i.removeChild(b),bs(r);return}g--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")g++;else if(c==="html")Gl(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Gl(c);for(var k=c.firstChild;k;){var _=k.nextSibling,P=k.nodeName;k[gi]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&k.rel.toLowerCase()==="stylesheet"||c.removeChild(k),k=_}}else c==="body"&&Gl(i.ownerDocument.body);c=b}while(c);bs(r)}function Nx(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 kh(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":kh(c),Vr(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function WO(i,r,c,g){for(;i.nodeType===1;){var b=c;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[gi])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!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var k=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=_a(i.nextSibling),i===null)break}return null}function YO(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 Ox(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 wh(i){return i.data==="$?"||i.data==="$~"}function Mh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function XO(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 Ch=null;function jx(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 Px(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 Dx(i,r,c){switch(r=ud(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 Gl(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Vr(i)}var Ta=new Map,zx=new Set;function dd(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Pi=ce.d;ce.d={f:JO,r:ej,D:tj,C:nj,L:aj,m:ij,X:oj,S:rj,M:sj};function JO(){var i=Pi.f(),r=nd();return i||r}function ej(i){var r=Ji(i);r!==null&&r.tag===5&&r.type==="form"?eS(r):Pi.r(i)}var gs=typeof document>"u"?null:document;function Lx(i,r,c){var g=gs;if(g&&typeof r=="string"&&r){var b=cn(r);b='link[rel="'+i+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),zx.has(b)||(zx.add(b),i={rel:i,crossOrigin:c,href:r},g.querySelector(b)===null&&(r=g.createElement("link"),Nn(r,"link",i),le(r),g.head.appendChild(r)))}}function tj(i){Pi.D(i),Lx("dns-prefetch",i,null)}function nj(i,r){Pi.C(i,r),Lx("preconnect",i,r)}function aj(i,r,c){Pi.L(i,r,c);var g=gs;if(g&&i&&r){var b='link[rel="preload"][as="'+cn(r)+'"]';r==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+cn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+cn(c.imageSizes)+'"]')):b+='[href="'+cn(i)+'"]';var k=b;switch(r){case"style":k=vs(i);break;case"script":k=ys(i)}Ta.has(k)||(i=w({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:i,as:r},c),Ta.set(k,i),g.querySelector(b)!==null||r==="style"&&g.querySelector(Zl(k))||r==="script"&&g.querySelector(Kl(k))||(r=g.createElement("link"),Nn(r,"link",i),le(r),g.head.appendChild(r)))}}function ij(i,r){Pi.m(i,r);var c=gs;if(c&&i){var g=r&&typeof r.as=="string"?r.as:"script",b='link[rel="modulepreload"][as="'+cn(g)+'"][href="'+cn(i)+'"]',k=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ys(i)}if(!Ta.has(k)&&(i=w({rel:"modulepreload",href:i},r),Ta.set(k,i),c.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Kl(k)))return}g=c.createElement("link"),Nn(g,"link",i),le(g),c.head.appendChild(g)}}}function rj(i,r,c){Pi.S(i,r,c);var g=gs;if(g&&i){var b=er(g).hoistableStyles,k=vs(i);r=r||"default";var _=b.get(k);if(!_){var P={loading:0,preload:null};if(_=g.querySelector(Zl(k)))P.loading=5;else{i=w({rel:"stylesheet",href:i,"data-precedence":r},c),(c=Ta.get(k))&&Ah(i,c);var U=_=g.createElement("link");le(U),Nn(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,pd(_,r,g)}_={type:"stylesheet",instance:_,count:1,state:P},b.set(k,_)}}}function oj(i,r){Pi.X(i,r);var c=gs;if(c&&i){var g=er(c).hoistableScripts,b=ys(i),k=g.get(b);k||(k=c.querySelector(Kl(b)),k||(i=w({src:i,async:!0},r),(r=Ta.get(b))&&Eh(i,r),k=c.createElement("script"),le(k),Nn(k,"link",i),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(b,k))}}function sj(i,r){Pi.M(i,r);var c=gs;if(c&&i){var g=er(c).hoistableScripts,b=ys(i),k=g.get(b);k||(k=c.querySelector(Kl(b)),k||(i=w({src:i,async:!0,type:"module"},r),(r=Ta.get(b))&&Eh(i,r),k=c.createElement("script"),le(k),Nn(k,"link",i),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(b,k))}}function qx(i,r,c,g){var b=(b=ye.current)?dd(b):null;if(!b)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=vs(c.href),c=er(b).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=vs(c.href);var k=er(b).hoistableStyles,_=k.get(i);if(_||(b=b.ownerDocument||b,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,_),(k=b.querySelector(Zl(i)))&&!k._p&&(_.instance=k,_.state.loading=5),Ta.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},Ta.set(i,c),k||lj(b,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=ys(c),c=er(b).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 vs(i){return'href="'+cn(i)+'"'}function Zl(i){return'link[rel="stylesheet"]['+i+"]"}function Bx(i){return w({},i,{"data-precedence":i.precedence,precedence:null})}function lj(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}),Nn(r,"link",c),le(r),i.head.appendChild(r))}function ys(i){return'[src="'+cn(i)+'"]'}function Kl(i){return"script[async]"+i}function Ux(i,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var g=i.querySelector('style[data-href~="'+cn(c.href)+'"]');if(g)return r.instance=g,le(g),g;var b=w({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),le(g),Nn(g,"style",b),pd(g,c.precedence,i),r.instance=g;case"stylesheet":b=vs(c.href);var k=i.querySelector(Zl(b));if(k)return r.state.loading|=4,r.instance=k,le(k),k;g=Bx(c),(b=Ta.get(b))&&Ah(g,b),k=(i.ownerDocument||i).createElement("link"),le(k);var _=k;return _._p=new Promise(function(P,U){_.onload=P,_.onerror=U}),Nn(k,"link",g),r.state.loading|=4,pd(k,c.precedence,i),r.instance=k;case"script":return k=ys(c.src),(b=i.querySelector(Kl(k)))?(r.instance=b,le(b),b):(g=c,(b=Ta.get(k))&&(g=w({},c),Eh(g,b)),i=i.ownerDocument||i,b=i.createElement("script"),le(b),Nn(b,"link",g),i.head.appendChild(b),r.instance=b);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,pd(g,c.precedence,i));return r.instance}function pd(i,r,c){for(var g=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,k=b,_=0;_<g.length;_++){var P=g[_];if(P.dataset.precedence===r)k=P;else if(k!==b)break}k?k.parentNode.insertBefore(i,k.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(i,r.firstChild))}function Ah(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Eh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var md=null;function Fx(i,r,c){if(md===null){var g=new Map,b=md=new Map;b.set(c,g)}else b=md,g=b.get(c),g||(g=new Map,b.set(c,g));if(g.has(i))return g;for(g.set(i,null),c=c.getElementsByTagName(i),b=0;b<c.length;b++){var k=c[b];if(!(k[gi]||k[kn]||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 Hx(i,r,c){i=i.ownerDocument||i,i.head.insertBefore(c,r==="title"?i.querySelector("head > title"):null)}function cj(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 $x(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function uj(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 b=vs(g.href),k=r.querySelector(Zl(b));if(k){r=k._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=fd.bind(i),r.then(i,i)),c.state.loading|=4,c.instance=k,le(k);return}k=r.ownerDocument||r,g=Bx(g),(b=Ta.get(b))&&Ah(g,b),k=k.createElement("link"),le(k);var _=k;_._p=new Promise(function(P,U){_.onload=P,_.onerror=U}),Nn(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=fd.bind(i),r.addEventListener("load",c),r.addEventListener("error",c))}}var Rh=0;function dj(i,r){return i.stylesheets&&i.count===0&&gd(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var g=setTimeout(function(){if(i.stylesheets&&gd(i,i.stylesheets),i.unsuspend){var k=i.unsuspend;i.unsuspend=null,k()}},6e4+r);0<i.imgBytes&&Rh===0&&(Rh=62500*QO());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&gd(i,i.stylesheets),i.unsuspend)){var k=i.unsuspend;i.unsuspend=null,k()}},(i.imgBytes>Rh?50:800)+r);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function fd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gd(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var hd=null;function gd(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,hd=new Map,r.forEach(pj,i),hd=null,fd.call(i))}function pj(i,r){if(!(r.state.loading&4)){var c=hd.get(i);if(c)var g=c.get(null);else{c=new Map,hd.set(i,c);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<b.length;k++){var _=b[k];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(c.set(_.dataset.precedence,_),g=_)}g&&c.set(null,g)}b=r.instance,_=b.getAttribute("data-precedence"),k=c.get(_)||g,k===g&&c.set(null,b),c.set(_,b),this.count++,g=fd.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),k?k.parentNode.insertBefore(b,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),r.state.loading|=4}}var Wl={$$typeof:B,Provider:null,Consumer:null,_currentValue:ke,_currentValue2:ke,_threadCount:0};function mj(i,r,c,g,b,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=Pa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pa(0),this.hiddenUpdates=Pa(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=k,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Qx(i,r,c,g,b,k,_,P,U,ie,fe,be){return i=new mj(i,r,c,_,U,ie,fe,be,P),r=1,k===!0&&(r|=24),k=ua(3,null,null,r),i.current=k,k.stateNode=i,r=sf(),r.refCount++,i.pooledCache=r,r.refCount++,k.memoizedState={element:g,isDehydrated:c,cache:r},df(k),i}function Vx(i){return i?(i=Ko,i):Ko}function Gx(i,r,c,g,b,k){b=Vx(b),g.context===null?g.context=b:g.pendingContext=b,g=lr(r),g.payload={element:c},k=k===void 0?null:k,k!==null&&(g.callback=k),c=cr(i,g,r),c!==null&&(ta(c,i,r),Rl(c,i,r))}function Zx(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<r?c:r}}function _h(i,r){Zx(i,r),(i=i.alternate)&&Zx(i,r)}function Kx(i){if(i.tag===13||i.tag===31){var r=Xr(i,67108864);r!==null&&ta(r,i,67108864),_h(i,67108864)}}function Wx(i){if(i.tag===13||i.tag===31){var r=ha();r=Bo(r);var c=Xr(i,r);c!==null&&ta(c,i,r),_h(i,r)}}var vd=!0;function fj(i,r,c,g){var b=H.T;H.T=null;var k=ce.p;try{ce.p=2,Th(i,r,c,g)}finally{ce.p=k,H.T=b}}function hj(i,r,c,g){var b=H.T;H.T=null;var k=ce.p;try{ce.p=8,Th(i,r,c,g)}finally{ce.p=k,H.T=b}}function Th(i,r,c,g){if(vd){var b=Ih(g);if(b===null)gh(i,r,g,yd,c),Xx(i,g);else if(vj(b,i,r,c,g))g.stopPropagation();else if(Xx(i,g),r&4&&-1<gj.indexOf(i)){for(;b!==null;){var k=Ji(b);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var _=Za(k.pendingLanes);if(_!==0){var P=k;for(P.pendingLanes|=2,P.entangledLanes|=2;_;){var U=1<<31-Ln(_);P.entanglements[1]|=U,_&=~U}ei(k),(Et&6)===0&&(ed=tn()+500,$l(0))}}break;case 31:case 13:P=Xr(k,2),P!==null&&ta(P,k,2),nd(),_h(k,2)}if(k=Ih(g),k===null&&gh(i,r,g,yd,c),k===b)break;b=k}b!==null&&g.stopPropagation()}else gh(i,r,g,null,c)}}function Ih(i){return i=Nm(i),Nh(i)}var yd=null;function Nh(i){if(yd=null,i=vi(i),i!==null){var r=p(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=m(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 yd=i,null}function Yx(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(xe()){case _e:return 2;case Rt:return 8;case fn:case We:return 32;case jn:return 268435456;default:return 32}default:return 32}}var Oh=!1,Sr=null,xr=null,kr=null,Yl=new Map,Xl=new Map,wr=[],gj="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 Xx(i,r){switch(i){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Yl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(r.pointerId)}}function Jl(i,r,c,g,b,k){return i===null||i.nativeEvent!==k?(i={blockedOn:r,domEventName:c,eventSystemFlags:g,nativeEvent:k,targetContainers:[b]},r!==null&&(r=Ji(r),r!==null&&Kx(r)),i):(i.eventSystemFlags|=g,r=i.targetContainers,b!==null&&r.indexOf(b)===-1&&r.push(b),i)}function vj(i,r,c,g,b){switch(r){case"focusin":return Sr=Jl(Sr,i,r,c,g,b),!0;case"dragenter":return xr=Jl(xr,i,r,c,g,b),!0;case"mouseover":return kr=Jl(kr,i,r,c,g,b),!0;case"pointerover":var k=b.pointerId;return Yl.set(k,Jl(Yl.get(k)||null,i,r,c,g,b)),!0;case"gotpointercapture":return k=b.pointerId,Xl.set(k,Jl(Xl.get(k)||null,i,r,c,g,b)),!0}return!1}function Jx(i){var r=vi(i.target);if(r!==null){var c=p(r);if(c!==null){if(r=c.tag,r===13){if(r=f(c),r!==null){i.blockedOn=r,dl(i.priority,function(){Wx(c)});return}}else if(r===31){if(r=m(c),r!==null){i.blockedOn=r,dl(i.priority,function(){Wx(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 bd(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var c=Ih(i.nativeEvent);if(c===null){c=i.nativeEvent;var g=new c.constructor(c.type,c);Im=g,c.target.dispatchEvent(g),Im=null}else return r=Ji(c),r!==null&&Kx(r),i.blockedOn=c,!1;r.shift()}return!0}function ek(i,r,c){bd(i)&&c.delete(r)}function yj(){Oh=!1,Sr!==null&&bd(Sr)&&(Sr=null),xr!==null&&bd(xr)&&(xr=null),kr!==null&&bd(kr)&&(kr=null),Yl.forEach(ek),Xl.forEach(ek)}function Sd(i,r){i.blockedOn===r&&(i.blockedOn=null,Oh||(Oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yj)))}var xd=null;function tk(i){xd!==i&&(xd=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xd===i&&(xd=null);for(var r=0;r<i.length;r+=3){var c=i[r],g=i[r+1],b=i[r+2];if(typeof g!="function"){if(Nh(g||c)===null)continue;break}var k=Ji(c);k!==null&&(i.splice(r,3),r-=3,If(k,{pending:!0,data:b,method:c.method,action:g},g,b))}}))}function bs(i){function r(U){return Sd(U,i)}Sr!==null&&Sd(Sr,i),xr!==null&&Sd(xr,i),kr!==null&&Sd(kr,i),Yl.forEach(r),Xl.forEach(r);for(var c=0;c<wr.length;c++){var g=wr[c];g.blockedOn===i&&(g.blockedOn=null)}for(;0<wr.length&&(c=wr[0],c.blockedOn===null);)Jx(c),c.blockedOn===null&&wr.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(g=0;g<c.length;g+=3){var b=c[g],k=c[g+1],_=b[Pn]||null;if(typeof k=="function")_||tk(c);else if(_){var P=null;if(k&&k.hasAttribute("formAction")){if(b=k,_=k[Pn]||null)P=_.formAction;else if(Nh(b)!==null)continue}else P=_.action;typeof P=="function"?c[g+1]=P:(c.splice(g,3),g-=3),tk(c)}}}function nk(){function i(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(_){return b=_})},focusReset:"manual",scroll:"manual"})}function r(){b!==null&&(b(),b=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,b=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),b!==null&&(b(),b=null)}}}function jh(i){this._internalRoot=i}kd.prototype.render=jh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var c=r.current,g=ha();Gx(c,g,i,r,null,null)},kd.prototype.unmount=jh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Gx(i.current,2,null,i,null,null),nd(),r[Xi]=null}};function kd(i){this._internalRoot=i}kd.prototype.unstable_scheduleHydration=function(i){if(i){var r=ul();i={blockedOn:null,target:i,priority:r};for(var c=0;c<wr.length&&r!==0&&r<wr[c].priority;c++);wr.splice(c,0,i),c===0&&Jx(i)}};var ak=t.version;if(ak!=="19.2.3")throw Error(a(527,ak,"19.2.3"));ce.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?x(i):null,i=i===null?null:i.stateNode,i};var bj={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wd.isDisabled&&wd.supportsFiber)try{Qr=wd.inject(bj),Rn=wd}catch{}}return tc.createRoot=function(i,r){if(!s(i))throw Error(a(299));var c=!1,g="",b=uS,k=dS,_=pS;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(b=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),r=Qx(i,1,!1,null,null,c,g,null,b,k,_,nk),i[Xi]=r.current,hh(i),new jh(r)},tc.hydrateRoot=function(i,r,c){if(!s(i))throw Error(a(299));var g=!1,b="",k=uS,_=dS,P=pS,U=null;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(b=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=Qx(i,1,!0,r,c??null,g,b,U,k,_,P,nk),r.context=Vx(null),c=r.current,g=ha(),g=Bo(g),b=lr(g),b.callback=null,cr(c,b,g),c=g,r.current.lanes=c,Yi(r,c),ei(r),i[Xi]=r.current,hh(i),new kd(r)},tc.version="19.2.3",tc}var mk;function Tj(){if(mk)return Dh.exports;mk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=_j(),Dh.exports}var Ij=Tj(),Nj=Object.create,RA=Object.defineProperty,Oj=Object.getOwnPropertyDescriptor,_A=Object.getOwnPropertyNames,jj=Object.getPrototypeOf,Pj=Object.prototype.hasOwnProperty,ui=(e,t)=>function(){return t||(0,e[_A(e)[0]])((t={exports:{}}).exports,t),t.exports},Dj=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=_A(t),p=0,f=s.length,m;p<f;p++)m=s[p],!Pj.call(e,m)&&m!==n&&RA(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=Oj(t,m))||a.enumerable});return e},mn=(e,t,n)=>(n=e!=null?Nj(jj(e)):{},Dj(t||!e||!e.__esModule?RA(n,"default",{value:e,enumerable:!0}):n,e)),TA=ui({"../../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}}),zj=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=TA().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Lj=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=TA().default,a=zj();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),To=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Lj();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),$a=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=To();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(p,u).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function il(e){const t={subscribe(n){let a=null,s=!1,p=!1,f=!1;function m(){if(a===null){f=!0;return}p||(p=!0,typeof a=="function"?a():a&&a.unsubscribe())}return a=e({next(h){var 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),m())},complete(){var h;s||(s=!0,(h=n.complete)===null||h===void 0||h.call(n),m())}}),f&&m(),{unsubscribe:m}},pipe(...n){return n.reduce(qj,t)}};return t}function qj(e,t){return t(e)}function Bj(e){const t=new AbortController;return new Promise((a,s)=>{let p=!1;function f(){p||(p=!0,m.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});const m=e.subscribe({next(h){p=!0,a(h),f()},error(h){s(h)},complete(){t.abort(),f()}})})}function Uj(e){return t=>{let n=0,a=null;const s=[];function p(){a||(a=t.subscribe({next(m){for(const u of s){var h;(h=u.next)===null||h===void 0||h.call(u,m)}},error(m){for(const u of s){var h;(h=u.error)===null||h===void 0||h.call(u,m)}},complete(){for(const h of s){var m;(m=h.complete)===null||m===void 0||m.call(h)}}}))}function f(){if(n===0&&a){const m=a;a=null,m.unsubscribe()}}return il(m=>(n++,s.push(m),p(),{unsubscribe(){n--,f();const h=s.findIndex(u=>u===m);h>-1&&s.splice(h,1)}}))}}function IA(e){let t=e;const n=[],a=f=>{t!==void 0&&f.next(t),n.push(f)},s=f=>{n.splice(n.indexOf(f),1)},p=il(f=>(a(f),()=>{s(f)}));return p.next=f=>{if(t!==f){t=f;for(const m of n)m.next(f)}},p.get=()=>t,p}function Fj(e){return il(t=>{function n(s=0,p=e.op){const f=e.links[s];if(!f)throw new Error("No more links to execute - did you forget to add an ending link?");return f({op:p,next(h){return n(s+1,h)}})}return n().subscribe(t)})}function Ro(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Hj(){return Object.create(null)}const $j=typeof Symbol=="function"&&!!Symbol.asyncIterator;function NA(e){return $j&&Ro(e)&&Symbol.asyncIterator in e}const fk=e=>e();function hk(e=0){return new Promise(t=>setTimeout(t,e))}var Qj=Object.create,OA=Object.defineProperty,Vj=Object.getOwnPropertyDescriptor,jA=Object.getOwnPropertyNames,Gj=Object.getPrototypeOf,Zj=Object.prototype.hasOwnProperty,Vc=(e,t)=>function(){return t||(0,e[jA(e)[0]])((t={exports:{}}).exports,t),t.exports},Kj=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=jA(t),p=0,f=s.length,m;p<f;p++)m=s[p],!Zj.call(e,m)&&m!==n&&OA(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=Vj(t,m))||a.enumerable});return e},im=(e,t,n)=>(n=e!=null?Qj(Gj(e)):{},Kj(OA(n,"default",{value:e,enumerable:!0}),e));const PA=()=>{},gk=e=>{Object.freeze&&Object.freeze(e)};function DA(e,t,n){var a;const s=t.join(".");return(a=n[s])!==null&&a!==void 0||(n[s]=new Proxy(PA,{get(p,f){if(!(typeof f!="string"||f==="then"))return DA(e,[...t,f],n)},apply(p,f,m){const h=t[t.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let u={args:m,path:t};return h==="call"?u={args:m.length>=2?[m[1]]:[],path:t.slice(0,-1)}:h==="apply"&&(u={args:m.length>=2?m[1]:[],path:t.slice(0,-1)}),gk(u.args),gk(u.path),e(u)}})),n[s]}const rm=e=>DA(e,[],Hj()),Ky=e=>new Proxy(PA,{get(t,n){if(n!=="then")return e(n)}});var zA=Vc({"../../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}}),Wj=Vc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=zA().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Yj=Vc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=zA().default,a=Wj();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),LA=Vc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Yj();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),Wy=Vc({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=LA();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(p,u).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});im(Wy());im(LA());var Md=im(Wy());function Xj(e,t){if("error"in e){const a=t.deserialize(e.error);return{ok:!1,error:(0,Md.default)((0,Md.default)({},e),{},{error:a})}}return{ok:!0,result:(0,Md.default)((0,Md.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Uh=class extends Error{constructor(){super("Unable to transform response from server")}};function qA(e,t){let n;try{n=Xj(e,t)}catch{throw new Uh}if(!n.ok&&(!Ro(n.error.error)||typeof n.error.error.code!="number"))throw new Uh;if(n.ok&&!Ro(n.result))throw new Uh;return n}im(Wy());var Cd=mn(To(),1),Ss=mn($a(),1);function Jj(e){return e instanceof Bi}function e3(e){return Ro(e)&&Ro(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function t3(e,t){return typeof e=="string"?e:Ro(e)&&typeof e.message=="string"?e.message:t}var Bi=class Xd extends Error{constructor(t,n){var a,s;const p=n?.cause;super(t,{cause:p}),(0,Cd.default)(this,"cause",void 0),(0,Cd.default)(this,"shape",void 0),(0,Cd.default)(this,"data",void 0),(0,Cd.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=p,this.shape=n==null||(a=n.result)===null||a===void 0?void 0:a.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Xd.prototype)}static from(t,n={}){const a=t;return Jj(a)?(n.meta&&(a.meta=(0,Ss.default)((0,Ss.default)({},a.meta),n.meta)),a):e3(a)?new Xd(a.error.message,(0,Ss.default)((0,Ss.default)({},n),{},{result:a,cause:n.cause})):new Xd(t3(a,"Unknown error"),(0,Ss.default)((0,Ss.default)({},n),{},{cause:a}))}};function BA(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 vk=e=>typeof e=="function";function n3(e){if(e)return e;if(typeof window<"u"&&vk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&vk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Sc=mn($a());function a3(e){return{url:e.url.toString(),fetch:e.fetch,transformer:BA(e.transformer),methodOverride:e.methodOverride}}function i3(e){const t={};for(let n=0;n<e.length;n++){const a=e[n];t[n]=a}return t}const r3={query:"GET",mutation:"POST",subscription:"PATCH"};function UA(e){return"input"in e?e.transformer.input.serialize(e.input):i3(e.inputs.map(t=>e.transformer.input.serialize(t)))}const fv=e=>{const t=e.url.split("?");let a=t[0].replace(/\/$/,"")+"/"+e.path;const s=[];if(t[1]&&s.push(t[1]),"inputs"in e&&s.push("batch=1"),e.type==="query"||e.type==="subscription"){const p=UA(e);p!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(p))}`)}return s.length&&(a+="?"+s.join("&")),a},o3=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=UA(e);return t!==void 0?JSON.stringify(t):void 0},s3=e=>hv((0,Sc.default)((0,Sc.default)({},e),{},{contentTypeHeader:"application/json",getUrl:fv,getBody:o3}));var l3=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const c3=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 l3};async function u3(e){var t,n;c3(e.signal);const a=e.getUrl(e),s=e.getBody(e),p=(t=e.methodOverride)!==null&&t!==void 0?t:r3[e.type],f=await(async()=>{const h=await e.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),m=(0,Sc.default)((0,Sc.default)((0,Sc.default)({},e.contentTypeHeader&&p!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),f);return n3(e.fetch)(a,{method:p,signal:e.signal,body:s,headers:m})}async function hv(e){const t={},n=await u3(e);t.response=n;const a=await n.json();return t.responseJSON=a,{json:a,meta:t}}function d3(e){return e instanceof Uint8Array||e instanceof Blob}function p3(e){return e instanceof FormData}var Ns=mn($a(),1);const m3=e=>{if("input"in e){const{input:t}=e;if(p3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return hv((0,Ns.default)((0,Ns.default)({},e),{},{contentTypeHeader:void 0,getUrl:fv,getBody:()=>t}))}if(d3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return hv((0,Ns.default)((0,Ns.default)({},e),{},{contentTypeHeader:"application/octet-stream",getUrl:fv,getBody:()=>t}))}}return s3(e)};function f3(e){const t=a3(e);return()=>n=>{const{op:a}=n;return il(s=>{const{path:p,input:f,type:m}=a;if(m==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=m3((0,Ns.default)((0,Ns.default)({},t),{},{type:m,path:p,input:f,signal:a.signal,headers(){return e.headers?typeof e.headers=="function"?e.headers({op:a}):e.headers:{}}}));let u;return h.then(x=>{u=x.meta;const w=qA(x.json,t.transformer.output);if(!w.ok){s.error(Bi.from(w.error,{meta:u}));return}s.next({context:x.meta,result:w.result}),s.complete()}).catch(x=>{s.error(Bi.from(x,{meta:u}))}),()=>{}})}}mn($a(),1);mn($a(),1);const h3={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)}},g3={enabled:!1,closeMs:0},v3={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},y3=e=>e===0?0:Math.min(1e3*2**e,3e4),FA=(e,...t)=>typeof e=="function"?e(...t):e;var b3=mn(To(),1),xs=class HA extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,HA.prototype)}},S3=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,b3.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 $A(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}async function x3(e){const t=await FA(e.url);if(!e.connectionParams)return t;const a=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+a}async function k3(e,t){const n={method:"connectionParams",data:await FA(e)};return t.encode(n)}var yk=mn(To(),1),w3=class{constructor(){(0,yk.default)(this,"outgoingRequests",new Array),(0,yk.default)(this,"pendingRequests",{})}register(e,t){const{promise:n,resolve:a}=$A();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}},Er=mn(To(),1);function M3(e){const{promise:t,resolve:n,reject:a}=$A();return e.addEventListener("open",()=>{e.removeEventListener("error",a),n()}),e.addEventListener("error",a),t}function C3(e,{intervalMs:t,pongTimeoutMs:n}){let a,s;function p(){a=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function f(){clearTimeout(a),p()}function m(){clearTimeout(s),f()}e.addEventListener("open",p),e.addEventListener("message",({data:h})=>{clearTimeout(a),p(),h==="PONG"&&m()}),e.addEventListener("close",()=>{clearTimeout(a),clearTimeout(s)})}var QA=class gv{constructor(t){var n;if((0,Er.default)(this,"id",++gv.connectCount),(0,Er.default)(this,"WebSocketPonyfill",void 0),(0,Er.default)(this,"urlOptions",void 0),(0,Er.default)(this,"keepAliveOpts",void 0),(0,Er.default)(this,"encoder",void 0),(0,Er.default)(this,"wsObservable",IA(null)),(0,Er.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=++gv.connectCount;const n=x3(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&&C3(a,t.keepAliveOpts),a.addEventListener("close",()=>{t.ws===a&&(t.ws=null)}),await M3(a),t.urlOptions.connectionParams&&a.send(await k3(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,Er.default)(QA,"connectCount",0);function A3(e){return e.isOpen()?{id:e.id,state:"open",ws:e.ws}:e.isClosed()?{id:e.id,state:"closed",ws:e.ws}:e.ws?{id:e.id,state:"connecting",ws:e.ws}:null}var ti=mn(To(),1),ks=mn($a(),1),E3=class{constructor(e){var t,n;(0,ti.default)(this,"connectionState",void 0),(0,ti.default)(this,"allowReconnect",!1),(0,ti.default)(this,"requestManager",new w3),(0,ti.default)(this,"activeConnection",void 0),(0,ti.default)(this,"reconnectRetryDelay",void 0),(0,ti.default)(this,"inactivityTimeout",void 0),(0,ti.default)(this,"callbacks",void 0),(0,ti.default)(this,"lazyMode",void 0),(0,ti.default)(this,"encoder",void 0),(0,ti.default)(this,"reconnecting",null),this.encoder=(t=e.experimental_encoder)!==null&&t!==void 0?t:h3,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const a=(0,ks.default)((0,ks.default)({},g3),e.lazy);this.inactivityTimeout=new S3(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},a.closeMs),this.activeConnection=new QA({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,ks.default)((0,ks.default)({},v3),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:y3,this.lazyMode=a.enabled,this.connectionState=IA({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 xs({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(Bi.from(new xs({message:"Closed before connection was established"}))):t.push(n.end);await Promise.all(t).catch(()=>null),await e.activeConnection.close().catch(()=>null),e.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:e,type:t,path:n,input:a,signal:s},transformer:p,lastEventId:f}){return il(m=>{const h=this.batchSend({id:e,method:t,params:{input:p.input.serialize(a),path:n,lastEventId:f}},(0,ks.default)((0,ks.default)({},m),{},{next(u){const x=qA(u,p.output);if(!x.ok){m.error(Bi.from(x.error));return}m.next({result:x.result})}}));return()=>{h(),t==="subscription"&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",h)}})}get connection(){return A3(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:"state",state:"connecting",error:Bi.from(e)}),this.reconnecting)return;const n=async a=>{try{await hk(t.reconnectRetryDelay(a)),t.allowReconnect&&(await t.activeConnection.close(),await t.activeConnection.open(),t.requestManager.hasPendingRequests()&&t.send(t.requestManager.getPendingRequests().map(({message:s})=>s))),t.reconnecting=null}catch{await n(a+1)}};this.reconnecting=n(0)}setupWebSocketListeners(e){var t=this;const n=a=>{const s=this.requestManager.getPendingRequests();for(const{message:p,callbacks:f}of s)p.method!=="subscription"&&(f.error(Bi.from(a??new xs({message:"WebSocket closed",cause:a}))),this.requestManager.delete(p.id))};e.addEventListener("open",()=>{fk(async()=>{var a,s;t.lazyMode&&t.inactivityTimeout.start(),(a=(s=t.callbacks).onOpen)===null||a===void 0||a.call(s),t.connectionState.next({type:"state",state:"pending",error:null})}).catch(a=>{e.close(3e3),n(a)})}),e.addEventListener("message",({data:a})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(a))return;const s=this.encoder.decode(a);if("method"in s){this.handleIncomingRequest(s);return}this.handleResponseMessage(s)}),e.addEventListener("close",a=>{var s,p;n(a),(s=(p=this.callbacks).onClose)===null||s===void 0||s.call(p,a),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new xs({message:"WebSocket closed",cause:a}))}),e.addEventListener("error",a=>{var s,p;n(a),(s=(p=this.callbacks).onError)===null||s===void 0||s.call(p,a),this.reconnect(new xs({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 xs({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(),fk(async()=>{n.activeConnection.isOpen()||await n.open(),await hk(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:a})=>a))}).catch(a=>{this.requestManager.delete(e.id),t.error(Bi.from(a))}),this.requestManager.register(e,t)}};function R3(e){return new E3(e)}function _3(e){const{client:t}=e,n=BA(e.transformer);return()=>({op:a})=>il(s=>{const p=a.type==="subscription"?t.connectionState.subscribe({next(m){s.next({result:m,context:a.context})}}):null,f=t.request({op:a,transformer:n}).subscribe(s);return()=>{f.unsubscribe(),p?.unsubscribe()}})}var Fh=mn(To(),1),bk=mn($a(),1),om=class{constructor(e){(0,Fh.default)(this,"links",void 0),(0,Fh.default)(this,"runtime",void 0),(0,Fh.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Fj({links:this.links,op:(0,bk.default)((0,bk.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Uj())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await Bj(n)).result.data}catch(n){throw Bi.from(n)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(s){switch(s.result.type){case"state":{var p;(p=n.onConnectionStateChange)===null||p===void 0||p.call(n,s.result);break}case"started":{var f;(f=n.onStarted)===null||f===void 0||f.call(n,{context:s.context});break}case"stopped":{var m;(m=n.onStopped)===null||m===void 0||m.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,s.result.data);break}}},error(s){var p;(p=n.onError)===null||p===void 0||p.call(n,s)},complete(){var s;(s=n.onComplete)===null||s===void 0||s.call(n)}})}};const VA=Symbol.for("trpc_untypedClient"),T3={query:"query",mutate:"mutation",subscribe:"subscription"},I3=e=>T3[e];function GA(e){const t=rm(({path:n,args:a})=>{const s=[...n],p=I3(s.pop()),f=s.join(".");return e[p](f,...a)});return Ky(n=>n===VA?e:t[n])}function vv(e){const t=new om(e);return GA(t)}function Yy(e){return e[VA]}mn($a(),1);mn($a(),1);var N3=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});mn(N3(),1);mn($a(),1);var O3=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var a=typeof SuppressedError=="function"?SuppressedError:function(m,h){var u=Error();return u.name="SuppressedError",u.error=m,u.suppressed=h,u},s={},p=[];function f(m,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(m)var u=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(u===void 0&&(u=h[Symbol.dispose||Symbol.for("Symbol.dispose")],m))var x=u;if(typeof u!="function")throw new TypeError("Object is not disposable.");x&&(u=function(){try{x.call(h)}catch(C){return Promise.reject(C)}}),p.push({v:h,d:u,a:m})}else m&&p.push({d:h,a:m});return h}return{e:s,u:f.bind(null,!1),a:f.bind(null,!0),d:function(){var h,u=this.e,x=0;function w(){for(;h=p.pop();)try{if(!h.a&&x===1)return x=0,p.push(h),Promise.resolve().then(w);if(h.d){var E=h.d.call(h.v);if(h.a)return x|=2,Promise.resolve(E).then(w,C)}else x|=1}catch(R){return C(R)}if(x===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}}),ZA=ui({"../../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}}),j3=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=ZA();function a(s){return new n(s,0)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),P3=ui({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=ZA();function a(p){return function(){return new s(p.apply(this,arguments))}}function s(p){var f,m;function h(x,w){try{var C=p[x](w),E=C.value,R=E instanceof n;Promise.resolve(R?E.v:E).then(function(I){if(R){var j=x==="return"?"return":"next";if(!E.k||I.done)return h(j,I);I=p[j](I).value}u(C.done?"return":"normal",I)},function(I){h("throw",I)})}catch(I){u("throw",I)}}function u(x,w){switch(x){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):m=null}this._invoke=function(x,w){return new Promise(function(C,E){var R={key:x,arg:w,resolve:C,reject:E,next:null};m?m=m.next=R:(f=m=R,h(x,w))})},typeof p.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(p){return this._invoke("next",p)},s.prototype.throw=function(p){return this._invoke("throw",p)},s.prototype.return=function(p){return this._invoke("return",p)},t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});mn(O3(),1);mn(j3(),1);mn(P3(),1);mn($a(),1);var Ze=(function(e){return e.SystemBoot="system.boot",e.SystemAddonsReady="system.addons-ready",e.SystemRestarting="system.restarting",e.SystemRestartCompleted="system.restart-completed",e.SystemTlsCertChanged="system.tls-cert-changed",e.UpdateAvailable="update.available",e.SystemReadyState="system.ready-state",e.AddonStarted="addon.started",e.AddonStopped="addon.stopped",e.AddonRestarted="addon.restarted",e.AddonUpdated="addon.updated",e.AddonInstalled="addon.installed",e.AddonUninstalled="addon.uninstalled",e.AddonCrashed="addon.crashed",e.AddonRunnerFailed="addon.runner-failed",e.AddonError="addon.error",e.AddonPageReady="addon.page-ready",e.AddonWidgetReady="addon.widget-ready",e.AddonLoadFailed="addon.load-failed",e.AddonLoadRecovered="addon.load-recovered",e.AddonRetryScheduled="addon.retry-scheduled",e.SystemLivenessFailed="system.liveness-failed",e.SystemLivenessRecovered="system.liveness-recovered",e.AddonRetryAttempting="addon.retry-attempting",e.DeviceRegistered="device.registered",e.DeviceUnregistered="device.unregistered",e.DeviceEnabled="device.enabled",e.DeviceDisabled="device.disabled",e.DeviceSettingsUpdated="device.settings-updated",e.DeviceBindingsChanged="device.bindings-changed",e.DeviceMetaChanged="device.meta-changed",e.DeviceSourceInfoChanged="device.source-info-changed",e.DeviceStreamsRegistered="device.streams-registered",e.DeviceProvisioned="device.provisioned",e.DeviceReady="device.ready",e.IntegrationEnabled="integration.enabled",e.IntegrationDisabled="integration.disabled",e.IntegrationDeleted="integration.deleted",e.BrokerStatusChanged="broker.status-changed",e.BrokerMessage="broker.message",e.ProviderStarted="provider.started",e.ProviderStopped="provider.stopped",e.ProcessCrashed="process.crashed",e.ProcessRestartScheduled="process.restart_scheduled",e.ProcessRestarted="process.restarted",e.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 D3="modulepreload",z3=function(e,t){return new URL(e,t).href},Sk={},Vs=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let u=function(x){return Promise.all(x.map(w=>Promise.resolve(w).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};const f=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");s=u(n.map(x=>{if(x=z3(x,a),x in Sk)return;Sk[x]=!0;const w=x.endsWith(".css"),C=w?'[rel="stylesheet"]':"";if(a)for(let R=f.length-1;R>=0;R--){const I=f[R];if(I.href===x&&(!w||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${C}`))return;const E=document.createElement("link");if(E.rel=w?"stylesheet":D3,w||(E.as="script"),E.crossOrigin="",E.href=x,h&&E.setAttribute("nonce",h),document.head.appendChild(E),w)return new Promise((R,I)=>{E.addEventListener("load",R),E.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${x}`)))})}))}function p(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return s.then(f=>{for(const m of f||[])m.status==="rejected"&&p(m.reason);return t().catch(p)})};var xk;function pe(e,t,n){function a(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,h);const u=f.prototype,x=Object.keys(u);for(let w=0;w<x.length;w++){const C=x[w];C in m||(m[C]=u[C].bind(m))}}const s=n?.Parent??Object;class p extends s{}Object.defineProperty(p,"name",{value:e});function f(m){var h;const u=n?.Parent?new p:this;a(u,m),(h=u._zod).deferred??(h.deferred=[]);for(const x of u._zod.deferred)x();return u}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Fs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class KA extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(xk=globalThis).__zod_globalConfig??(xk.__zod_globalConfig={});const Xy=globalThis.__zod_globalConfig;function Qi(e){return Xy}function WA(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 yv(e,t){return typeof t=="bigint"?t.toString():t}function sm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Jy(e){return e==null}function eb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function L3(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 kk=Symbol("evaluating");function St(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==kk)return a===void 0&&(a=kk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Io(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qr(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function wk(e){return JSON.stringify(e)}function q3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const YA="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Rc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const B3=sm(()=>{if(Xy.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Gs(e){if(Rc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Rc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function XA(e){return Gs(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const U3=new Set(["string","number","symbol"]);function Zs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(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 F3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const H3={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 $3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const p=qr(e._zod.def,{get shape(){const f={};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&(f[m]=n.shape[m])}return Io(this,"shape",f),f},checks:[]});return Gi(e,p)}function Q3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const p=qr(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&delete f[m]}return Io(this,"shape",f),f},checks:[]});return Gi(e,p)}function V3(e,t){if(!Gs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const p=e._zod.def.shape;for(const f in t)if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=qr(e._zod.def,{get shape(){const p={...e._zod.def.shape,...t};return Io(this,"shape",p),p}});return Gi(e,s)}function G3(e,t){if(!Gs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=qr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Io(this,"shape",a),a}});return Gi(e,n)}function Z3(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=qr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Io(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Gi(e,n)}function K3(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=qr(t._zod.def,{get shape(){const m=t._zod.def.shape,h={...m};if(n)for(const u in n){if(!(u in m))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(h[u]=e?new e({type:"optional",innerType:m[u]}):m[u])}else for(const u in m)h[u]=e?new e({type:"optional",innerType:m[u]}):m[u];return Io(this,"shape",h),h},checks:[]});return Gi(t,f)}function W3(e,t,n){const a=qr(t._zod.def,{get shape(){const s=t._zod.def.shape,p={...s};if(n)for(const f in n){if(!(f in p))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(p[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)p[f]=new e({type:"nonoptional",innerType:s[f]});return Io(this,"shape",p),p}});return Gi(t,a)}function Os(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 Y3(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 _r(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Ad(e){return typeof e=="string"?e:e?.message}function Vi(e,t,n){const a=e.message?e.message:Ad(e.inst?._zod.def?.error?.(e))??Ad(t?.error?.(e))??Ad(n.customError?.(e))??Ad(n.localeError?.(e))??"Invalid input",{inst:s,continue:p,input:f,...m}=e;return m.path??(m.path=[]),m.message=a,t?.reportInput&&(m.input=f),m}function tb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _c(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const JA=(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,yv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eE=pe("$ZodError",JA),tE=pe("$ZodError",JA,{Parent:Error});function X3(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 J3(e,t=n=>n.message){const n={_errors:[]},a=(s,p=[])=>{for(const f of s.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>a({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...p,...f.path]);else{const m=[...p,...f.path];if(m.length===0)n._errors.push(t(f));else{let h=n,u=0;for(;u<m.length;){const x=m[u];u===m.length-1?(h[x]=h[x]||{_errors:[]},h[x]._errors.push(t(f))):h[x]=h[x]||{_errors:[]},h=h[x],u++}}}};return a(e),n}const nb=e=>(t,n,a,s)=>{const p=a?{...a,async:!1}:{async:!1},f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise)throw new Fs;if(f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>Vi(h,p,Qi())));throw YA(m,s?.callee),m}return f.value},ab=e=>async(t,n,a,s)=>{const p=a?{...a,async:!0}:{async:!0};let f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise&&(f=await f),f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>Vi(h,p,Qi())));throw YA(m,s?.callee),m}return f.value},lm=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},p=t._zod.run({value:n,issues:[]},s);if(p instanceof Promise)throw new Fs;return p.issues.length?{success:!1,error:new(e??eE)(p.issues.map(f=>Vi(f,s,Qi())))}:{success:!0,data:p.value}},eP=lm(tE),cm=e=>async(t,n,a)=>{const s=a?{...a,async:!0}:{async:!0};let p=t._zod.run({value:n,issues:[]},s);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(f=>Vi(f,s,Qi())))}:{success:!0,data:p.value}},tP=cm(tE),nP=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return nb(e)(t,n,s)},aP=e=>(t,n,a)=>nb(e)(t,n,a),iP=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return ab(e)(t,n,s)},rP=e=>async(t,n,a)=>ab(e)(t,n,a),oP=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return lm(e)(t,n,s)},sP=e=>(t,n,a)=>lm(e)(t,n,a),lP=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return cm(e)(t,n,s)},cP=e=>async(t,n,a)=>cm(e)(t,n,a),uP=/^[cC][0-9a-z]{6,}$/,dP=/^[0-9a-z]+$/,pP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,mP=/^[0-9a-vA-V]{20}$/,fP=/^[A-Za-z0-9]{27}$/,hP=/^[a-zA-Z0-9_-]{21}$/,gP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vP=/^([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})$/,Mk=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)$/,yP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function SP(){return new RegExp(bP,"u")}const xP=/^(?:(?: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])$/,kP=/^(([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}|:))$/,wP=/^((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])$/,MP=/^(([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])$/,CP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nE=/^[A-Za-z0-9_-]*$/,AP=/^https?$/,EP=/^\+[1-9]\d{6,14}$/,aE="(?:(?:\\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])))",RP=new RegExp(`^${aE}$`);function iE(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 _P(e){return new RegExp(`^${iE(e)}$`)}function TP(e){const t=iE({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(`^${aE}T(?:${a})$`)}const IP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},NP=/^-?\d+$/,rE=/^-?\d+(?:\.\d+)?$/,OP=/^(?:true|false)$/i,jP=/^null$/i,PP=/^[^A-Z]*$/,DP=/^[^a-z]*$/,oa=pe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),oE={number:"number",bigint:"bigint",object:"date"},sE=pe("$ZodCheckLessThan",(e,t)=>{oa.init(e,t);const n=oE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<p&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lE=pe("$ZodCheckGreaterThan",(e,t)=>{oa.init(e,t);const n=oE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>p&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zP=pe("$ZodCheckMultipleOf",(e,t)=>{oa.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):L3(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})}}),LP=pe("$ZodCheckNumberFormat",(e,t)=>{oa.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,p]=H3[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=s,m.maximum=p,n&&(m.pattern=NP)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<s&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>p&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:e,continue:!t.abort})}}),qP=pe("$ZodCheckMaxLength",(e,t)=>{var n;oa.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jy(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=tb(s);a.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),BP=pe("$ZodCheckMinLength",(e,t)=>{var n;oa.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jy(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=tb(s);a.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),UP=pe("$ZodCheckLengthEquals",(e,t)=>{var n;oa.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jy(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,p=s.length;if(p===t.length)return;const f=tb(s),m=p>t.length;a.issues.push({origin:f,...m?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),um=pe("$ZodCheckStringFormat",(e,t)=>{var n,a;oa.init(e,t),e._zod.onattach.push(s=>{const p=s._zod.bag;p.format=t.format,t.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),FP=pe("$ZodCheckRegex",(e,t)=>{um.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})}}),HP=pe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=PP),um.init(e,t)}),$P=pe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=DP),um.init(e,t)}),QP=pe("$ZodCheckIncludes",(e,t)=>{oa.init(e,t);const n=Zs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const p=s._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),VP=pe("$ZodCheckStartsWith",(e,t)=>{oa.init(e,t);const n=new RegExp(`^${Zs(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})}}),GP=pe("$ZodCheckEndsWith",(e,t)=>{oa.init(e,t);const n=new RegExp(`.*${Zs(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})}}),ZP=pe("$ZodCheckOverwrite",(e,t)=>{oa.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class KP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
11
+ `).filter(f=>f),s=Math.min(...a.map(f=>f.length-f.trimStart().length)),p=a.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of p)this.content.push(f)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(p=>` ${p}`)];return new t(...n,s.join(`
12
+ `))}}const WP={major:4,minor:4,patch:3},It=pe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=WP;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const p of s._zod.onattach)p(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,m,h)=>{let u=Os(f),x;for(const w of m){if(w._zod.def.when){if(Y3(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 Fs;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,f.issues.length!==C&&(u||(u=Os(f,C)))});else{if(f.issues.length===C)continue;u||(u=Os(f,C))}}return x?x.then(()=>f):f},p=(f,m,h)=>{if(Os(f))return f.aborted=!0,f;const u=s(m,a,h);if(u instanceof Promise){if(h.async===!1)throw new Fs;return u.then(x=>e._zod.parse(x,h))}return e._zod.parse(u,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const u=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return u instanceof Promise?u.then(x=>p(x,f,m)):p(u,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Fs;return h.then(u=>s(u,a,m))}return s(h,a,m)}}St(e,"~standard",()=>({validate:s=>{try{const p=eP(e,s);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return tP(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),ib=pe("$ZodString",(e,t)=>{It.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??IP(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}}),Wt=pe("$ZodStringFormat",(e,t)=>{um.init(e,t),ib.init(e,t)}),YP=pe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vP),Wt.init(e,t)}),XP=pe("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mk(a))}else t.pattern??(t.pattern=Mk());Wt.init(e,t)}),JP=pe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yP),Wt.init(e,t)}),eD=pe("$ZodURL",(e,t)=>{Wt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim();if(!t.normalize&&t.protocol?.source===AP.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})}}}),tD=pe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=SP()),Wt.init(e,t)}),nD=pe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hP),Wt.init(e,t)}),aD=pe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uP),Wt.init(e,t)}),iD=pe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dP),Wt.init(e,t)}),rD=pe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=pP),Wt.init(e,t)}),oD=pe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=mP),Wt.init(e,t)}),sD=pe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fP),Wt.init(e,t)}),lD=pe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=TP(t)),Wt.init(e,t)}),cD=pe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=RP),Wt.init(e,t)}),uD=pe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_P(t)),Wt.init(e,t)}),dD=pe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gP),Wt.init(e,t)}),pD=pe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xP),Wt.init(e,t),e._zod.bag.format="ipv4"}),mD=pe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kP),Wt.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})}}}),fD=pe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wP),Wt.init(e,t)}),hD=pe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=MP),Wt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,p]=a;if(!p)throw new Error;const f=Number(p);if(`${f}`!==p)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function cE(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const gD=pe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=CP),Wt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{cE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function vD(e){if(!nE.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return cE(n)}const yD=pe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nE),Wt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{vD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),bD=pe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=EP),Wt.init(e,t)});function SD(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const xD=pe("$ZodJWT",(e,t)=>{Wt.init(e,t),e._zod.check=n=>{SD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),uE=pe("$ZodNumber",(e,t)=>{It.init(e,t),e._zod.pattern=e._zod.bag.pattern??rE,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const p=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...p?{received:p}:{}}),n}}),kD=pe("$ZodNumberFormat",(e,t)=>{LP.init(e,t),uE.init(e,t)}),wD=pe("$ZodBoolean",(e,t)=>{It.init(e,t),e._zod.pattern=OP,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}}),MD=pe("$ZodNull",(e,t)=>{It.init(e,t),e._zod.pattern=jP,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}}),CD=pe("$ZodAny",(e,t)=>{It.init(e,t),e._zod.parse=n=>n}),AD=pe("$ZodUnknown",(e,t)=>{It.init(e,t),e._zod.parse=n=>n}),ED=pe("$ZodNever",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),RD=pe("$ZodVoid",(e,t)=>{It.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}}),_D=pe("$ZodDate",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,p=s instanceof Date;return p&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...p?{received:"Invalid Date"}:{},inst:e}),n}});function Ck(e,t,n){e.issues.length&&t.issues.push(..._r(n,e.issues)),t.value[n]=e.value}const TD=pe("$ZodArray",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const p=[];for(let f=0;f<s.length;f++){const m=s[f],h=t.element._zod.run({value:m,issues:[]},a);h instanceof Promise?p.push(h.then(u=>Ck(u,n,f))):Ck(h,n,f)}return p.length?Promise.all(p).then(()=>n):n}});function Tp(e,t,n,a,s,p){const f=n in a;if(e.issues.length){if(s&&p&&!f)return;t.issues.push(..._r(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 dE(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=F3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function pE(e,t,n,a,s,p){const f=[],m=s.keySet,h=s.catchall._zod,u=h.def.type,x=h.optin==="optional",w=h.optout==="optional";for(const C in t){if(C==="__proto__"||m.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=>Tp(R,n,C,t,x,w))):Tp(E,n,C,t,x,w)}return f.length&&n.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:p}),e.length?Promise.all(e).then(()=>n):n}const ID=pe("$ZodObject",(e,t)=>{if(It.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const m=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...m};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=sm(()=>dE(t));St(e._zod,"propValues",()=>{const m=t.shape,h={};for(const u in m){const x=m[u]._zod;if(x.values){h[u]??(h[u]=new Set);for(const w of x.values)h[u].add(w)}}return h});const s=Rc,p=t.catchall;let f;e._zod.parse=(m,h)=>{f??(f=a.value);const u=m.value;if(!s(u))return m.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),m;m.value={};const x=[],w=f.shape;for(const C of f.keys){const E=w[C],R=E._zod.optin==="optional",I=E._zod.optout==="optional",j=E._zod.run({value:u[C],issues:[]},h);j instanceof Promise?x.push(j.then(D=>Tp(D,m,C,u,R,I))):Tp(j,m,C,u,R,I)}return p?pE(x,u,m,h,a.value,e):x.length?Promise.all(x).then(()=>m):m}}),ND=pe("$ZodObjectJIT",(e,t)=>{ID.init(e,t);const n=e._zod.parse,a=sm(()=>dE(t)),s=C=>{const E=new KP(["shape","payload","ctx"]),R=a.value,I=B=>{const q=wk(B);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};E.write("const input = payload.value;");const j=Object.create(null);let D=0;for(const B of R.keys)j[B]=`key_${D++}`;E.write("const newResult = {};");for(const B of R.keys){const q=j[B],Z=wk(B),J=C[B],$=J?._zod?.optin==="optional",F=J?._zod?.optout==="optional";E.write(`const ${q} = ${I(B)};`),$&&F?E.write(`
13
+ if (${q}.issues.length) {
14
+ if (${Z} in input) {
15
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
16
+ ...iss,
17
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
18
+ })));
19
+ }
20
+ }
21
+
22
+ if (${q}.value === undefined) {
23
+ if (${Z} in input) {
24
+ newResult[${Z}] = undefined;
25
+ }
26
+ } else {
27
+ newResult[${Z}] = ${q}.value;
28
+ }
29
+
30
+ `):$?E.write(`
31
+ if (${q}.issues.length) {
32
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
33
+ ...iss,
34
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
35
+ })));
36
+ }
37
+
38
+ if (${q}.value === undefined) {
39
+ if (${Z} in input) {
40
+ newResult[${Z}] = undefined;
41
+ }
42
+ } else {
43
+ newResult[${Z}] = ${q}.value;
44
+ }
45
+
46
+ `):E.write(`
47
+ const ${q}_present = ${Z} in input;
48
+ if (${q}.issues.length) {
49
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
50
+ ...iss,
51
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
52
+ })));
53
+ }
54
+ if (!${q}_present && !${q}.issues.length) {
55
+ payload.issues.push({
56
+ code: "invalid_type",
57
+ expected: "nonoptional",
58
+ input: undefined,
59
+ path: [${Z}]
60
+ });
61
+ }
62
+
63
+ if (${q}_present) {
64
+ if (${q}.value === undefined) {
65
+ newResult[${Z}] = undefined;
66
+ } else {
67
+ newResult[${Z}] = ${q}.value;
68
+ }
69
+ }
70
+
71
+ `)}E.write("payload.value = newResult;"),E.write("return payload;");const z=E.compile();return(B,q)=>z(C,B,q)};let p;const f=Rc,m=!Xy.jitless,u=m&&B3.value,x=t.catchall;let w;e._zod.parse=(C,E)=>{w??(w=a.value);const R=C.value;return f(R)?m&&u&&E?.async===!1&&E.jitless!==!0?(p||(p=s(t.shape)),C=p(C,E),x?pE([],R,C,E,w,e):C):n(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),C)}});function Ak(e,t,n,a){for(const p of e)if(p.issues.length===0)return t.value=p.value,t;const s=e.filter(p=>!Os(p));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(p=>p.issues.map(f=>Vi(f,a,Qi())))}),t)}const mE=pe("$ZodUnion",(e,t)=>{It.init(e,t),St(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),St(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),St(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),St(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=>eb(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(a,s)=>{if(n)return n(a,s);let p=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:a.value,issues:[]},s);if(h instanceof Promise)f.push(h),p=!0;else{if(h.issues.length===0)return h;f.push(h)}}return p?Promise.all(f).then(m=>Ak(m,a,e,s)):Ak(f,a,e,s)}}),OD=pe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mE.init(e,t);const n=e._zod.parse;St(e._zod,"propValues",()=>{const s={};for(const p of t.options){const f=p._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(const[m,h]of Object.entries(f)){s[m]||(s[m]=new Set);for(const u of h)s[m].add(u)}}return s});const a=sm(()=>{const s=t.options,p=new Map;for(const f of s){const m=f._zod.propValues?.[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(p.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);p.set(h,f)}}return p});e._zod.parse=(s,p)=>{const f=s.value;if(!Rc(f))return s.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),s;const m=a.value.get(f?.[t.discriminator]);return m?m._zod.run(s,p):t.unionFallback||p.direction==="backward"?n(s,p):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(a.value.keys()),input:f,path:[t.discriminator],inst:e}),s)}}),jD=pe("$ZodIntersection",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,p=t.left._zod.run({value:s,issues:[]},a),f=t.right._zod.run({value:s,issues:[]},a);return p instanceof Promise||f instanceof Promise?Promise.all([p,f]).then(([h,u])=>Ek(n,h,u)):Ek(n,p,f)}});function bv(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(Gs(e)&&Gs(t)){const n=Object.keys(t),a=Object.keys(e).filter(p=>n.indexOf(p)!==-1),s={...e,...t};for(const p of a){const f=bv(e[p],t[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};s[p]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],p=t[a],f=bv(s,p);if(!f.valid)return{valid:!1,mergeErrorPath:[a,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ek(e,t,n){const a=new Map;let s;for(const m of t.issues)if(m.code==="unrecognized_keys"){s??(s=m);for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(m);for(const m of n.issues)if(m.code==="unrecognized_keys")for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(m);const p=[...a].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(p.length&&s&&e.issues.push({...s,keys:p}),Os(e))return e;const f=bv(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 PD=pe("$ZodTuple",(e,t)=>{It.init(e,t);const n=t.items;e._zod.parse=(a,s)=>{const p=a.value;if(!Array.isArray(p))return a.issues.push({input:p,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];const f=[],m=Rk(n,"optin"),h=Rk(n,"optout");if(!t.rest){if(p.length<m)return a.issues.push({code:"too_small",minimum:m,inclusive:!0,input:p,inst:e,origin:"array"}),a;p.length>n.length&&a.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:p,inst:e,origin:"array"})}const u=new Array(n.length);for(let x=0;x<n.length;x++){const w=n[x]._zod.run({value:p[x],issues:[]},s);w instanceof Promise?f.push(w.then(C=>{u[x]=C})):u[x]=w}if(t.rest){let x=n.length-1;const w=p.slice(n.length);for(const C of w){x++;const E=t.rest._zod.run({value:C,issues:[]},s);E instanceof Promise?f.push(E.then(R=>_k(R,a,x))):_k(E,a,x)}}return f.length?Promise.all(f).then(()=>Tk(u,a,n,p,h)):Tk(u,a,n,p,h)}});function Rk(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function _k(e,t,n){e.issues.length&&t.issues.push(..._r(n,e.issues)),t.value[n]=e.value}function Tk(e,t,n,a,s){for(let p=0;p<n.length;p++){const f=e[p],m=p<a.length;if(f.issues.length){if(!m&&p>=s){t.value.length=p;break}t.issues.push(..._r(p,f.issues))}t.value[p]=f.value}for(let p=t.value.length-1;p>=a.length&&(n[p]._zod.optout==="optional"&&t.value[p]===void 0);p--)t.value.length=p;return t}const DD=pe("$ZodRecord",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Gs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const p=[],f=t.keyType._zod.values;if(f){n.value={};const m=new Set;for(const u of f)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){m.add(typeof u=="number"?u.toString():u);const x=t.keyType._zod.run({value:u,issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(x.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:x.issues.map(E=>Vi(E,a,Qi())),input:u,path:[u],inst:e});continue}const w=x.value,C=t.valueType._zod.run({value:s[u],issues:[]},a);C instanceof Promise?p.push(C.then(E=>{E.issues.length&&n.issues.push(..._r(u,E.issues)),n.value[w]=E.value})):(C.issues.length&&n.issues.push(..._r(u,C.issues)),n.value[w]=C.value)}let h;for(const u in s)m.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 m of Reflect.ownKeys(s)){if(m==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,m))continue;let h=t.keyType._zod.run({value:m,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&rE.test(m)&&h.issues.length){const w=t.keyType._zod.run({value:Number(m),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[m]=s[m]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(w=>Vi(w,a,Qi())),input:m,path:[m],inst:e});continue}const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?p.push(x.then(w=>{w.issues.length&&n.issues.push(..._r(m,w.issues)),n.value[h.value]=w.value})):(x.issues.length&&n.issues.push(..._r(m,x.issues)),n.value[h.value]=x.value)}}return p.length?Promise.all(p).then(()=>n):n}}),zD=pe("$ZodEnum",(e,t)=>{It.init(e,t);const n=WA(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>U3.has(typeof s)).map(s=>typeof s=="string"?Zs(s):s.toString()).join("|")})$`),e._zod.parse=(s,p)=>{const f=s.value;return a.has(f)||s.issues.push({code:"invalid_value",values:n,input:f,inst:e}),s}}),LD=pe("$ZodLiteral",(e,t)=>{if(It.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"?Zs(a):a?Zs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const p=a.value;return n.has(p)||a.issues.push({code:"invalid_value",values:t.values,input:p,inst:e}),a}}),qD=pe("$ZodTransform",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new KA(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 Fs;return n.value=s,n.fallback=!0,n}});function Ik(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const fE=pe("$ZodOptional",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",St(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${eb(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,p=t.innerType._zod.run(n,a);return p instanceof Promise?p.then(f=>Ik(f,s)):Ik(p,s)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),BD=pe("$ZodExactOptional",(e,t)=>{fE.init(e,t),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),UD=pe("$ZodNullable",(e,t)=>{It.init(e,t),St(e._zod,"optin",()=>t.innerType._zod.optin),St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${eb(n.source)}|null)$`):void 0}),St(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)}),FD=pe("$ZodDefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>Nk(p,t)):Nk(s,t)}});function Nk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const HD=pe("$ZodPrefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",St(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))}),$D=pe("$ZodNonOptional",(e,t)=>{It.init(e,t),St(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>Ok(p,e)):Ok(s,e)}});function Ok(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 QD=pe("$ZodCatch",(e,t)=>{It.init(e,t),e._zod.optin="optional",St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>(n.value=p.value,p.issues.length&&(n.value=t.catchValue({...n,error:{issues:p.issues.map(f=>Vi(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(p=>Vi(p,a,Qi()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),hE=pe("$ZodPipe",(e,t)=>{It.init(e,t),St(e._zod,"values",()=>t.in._zod.values),St(e._zod,"optin",()=>t.in._zod.optin),St(e._zod,"optout",()=>t.out._zod.optout),St(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const p=t.out._zod.run(n,a);return p instanceof Promise?p.then(f=>Ed(f,t.in,a)):Ed(p,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(p=>Ed(p,t.out,a)):Ed(s,t.out,a)}});function Ed(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 VD=pe("$ZodPreprocess",(e,t)=>{hE.init(e,t)}),GD=pe("$ZodReadonly",(e,t)=>{It.init(e,t),St(e._zod,"propValues",()=>t.innerType._zod.propValues),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"optin",()=>t.innerType?._zod?.optin),St(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(jk):jk(s)}});function jk(e){return e.value=Object.freeze(e.value),e}const ZD=pe("$ZodLazy",(e,t)=>{It.init(e,t),St(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),St(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),St(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),St(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),St(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,a)=>e._zod.innerType._zod.run(n,a)}),KD=pe("$ZodCustom",(e,t)=>{oa.init(e,t),It.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(p=>Pk(p,n,a,e));Pk(s,n,a,e)}});function Pk(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(_c(s))}}var Dk;class WD{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 YD(){return new WD}(Dk=globalThis).__zod_globalRegistry??(Dk.__zod_globalRegistry=YD());const gc=globalThis.__zod_globalRegistry;function XD(e,t){return new e({type:"string",...De(t)})}function gE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function zk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function JD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function e6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function t6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function n6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function vE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function a6(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function i6(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function r6(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function o6(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function s6(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function l6(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function c6(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function u6(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function d6(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function p6(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function m6(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function f6(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function h6(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function g6(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function v6(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function y6(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function b6(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function S6(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function x6(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function k6(e,t){return new e({type:"number",checks:[],...De(t)})}function w6(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function M6(e,t){return new e({type:"boolean",...De(t)})}function C6(e,t){return new e({type:"null",...De(t)})}function A6(e){return new e({type:"any"})}function E6(e){return new e({type:"unknown"})}function R6(e,t){return new e({type:"never",...De(t)})}function _6(e,t){return new e({type:"void",...De(t)})}function T6(e,t){return new e({type:"date",...De(t)})}function Lk(e,t){return new sE({check:"less_than",...De(t),value:e,inclusive:!1})}function Jd(e,t){return new sE({check:"less_than",...De(t),value:e,inclusive:!0})}function qk(e,t){return new lE({check:"greater_than",...De(t),value:e,inclusive:!1})}function ep(e,t){return new lE({check:"greater_than",...De(t),value:e,inclusive:!0})}function Bk(e,t){return new zP({check:"multiple_of",...De(t),value:e})}function yE(e,t){return new qP({check:"max_length",...De(t),maximum:e})}function Ip(e,t){return new BP({check:"min_length",...De(t),minimum:e})}function bE(e,t){return new UP({check:"length_equals",...De(t),length:e})}function I6(e,t){return new FP({check:"string_format",format:"regex",...De(t),pattern:e})}function N6(e){return new HP({check:"string_format",format:"lowercase",...De(e)})}function O6(e){return new $P({check:"string_format",format:"uppercase",...De(e)})}function j6(e,t){return new QP({check:"string_format",format:"includes",...De(t),includes:e})}function P6(e,t){return new VP({check:"string_format",format:"starts_with",...De(t),prefix:e})}function D6(e,t){return new GP({check:"string_format",format:"ends_with",...De(t),suffix:e})}function rl(e){return new ZP({check:"overwrite",tx:e})}function z6(e){return rl(t=>t.normalize(e))}function L6(){return rl(e=>e.trim())}function q6(){return rl(e=>e.toLowerCase())}function B6(){return rl(e=>e.toUpperCase())}function U6(){return rl(e=>q3(e))}function F6(e,t,n){return new e({type:"array",element:t,...De(n)})}function H6(e,t,n){const a=De(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function $6(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function Q6(e,t){const n=V6(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(_c(s,a.value,n._zod.def));else{const p=s;p.fatal&&(p.continue=!1),p.code??(p.code="custom"),p.input??(p.input=a.value),p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),a.issues.push(_c(p))}},e(a.value,a)),t);return n}function V6(e,t){const n=new oa({check:"custom",...De(t)});return n._zod.check=e,n}function SE(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??gc,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 Jt(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,p=t.seen.get(e);if(p)return p.count++,n.schemaPath.includes(e)&&(p.cycle=n.path),p.schema;const f={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,f);const m=e._zod.toJSONSchema?.();if(m)f.schema=m;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,f.schema,x);else{const C=f.schema,E=t.processors[s.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);E(e,t,C,x)}const w=e._zod.parent;w&&(f.ref||(f.ref=w),Jt(w,t,x),t.seen.get(w).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(f.schema,h),t.io==="input"&&Un(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 xE(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const f of e.seen.entries()){const m=e.metadataRegistry.get(f[0])?.id;if(m){const h=a.get(m);if(h&&h!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(m,f[0])}}const s=f=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const 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")}#/${m}/${E}`}}if(f[1]===n)return{ref:"#"};const u=`#/${m}/`,x=f[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:u+x}},p=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:h,defId:u}=s(f);m.def={...m.schema},u&&(m.defId=u);const x=m.schema;for(const w in x)delete x[w];x.$ref=h};if(e.cycles==="throw")for(const f of e.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
72
+
73
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const m=f[1];if(t===f[0]){p(f);continue}if(e.external){const u=e.external.registry.get(f[0])?.id;if(t!==f[0]&&u){p(f);continue}}if(e.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1&&e.reused==="ref"){p(f);continue}}}function kE(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=m=>{const h=e.seen.get(m);if(h.ref===null)return;const u=h.def??h.schema,x={...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,x),m._zod.parent===w)for(const j in u)j==="$ref"||j==="allOf"||j in x||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=m._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:m,jsonSchema:u,path:h.path??[]})};for(const m of[...e.seen.entries()].reverse())a(m[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const m=e.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(m)}Object.assign(s,n.def??n.schema);const p=e.metadataRegistry.get(t)?.id;p!==void 0&&s.id===p&&delete s.id;const f=e.external?.defs??{};for(const m of e.seen.entries()){const h=m[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,f[h.defId]=h.def)}e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?s.$defs=f:s.definitions=f);try{const m=JSON.parse(JSON.stringify(s));return Object.defineProperty(m,"~standard",{value:{...t["~standard"],jsonSchema:{input:Np(t,"input",e.processors),output:Np(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Un(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 Un(a.element,n);if(a.type==="set")return Un(a.valueType,n);if(a.type==="lazy")return Un(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 Un(a.innerType,n);if(a.type==="intersection")return Un(a.left,n)||Un(a.right,n);if(a.type==="record"||a.type==="map")return Un(a.keyType,n)||Un(a.valueType,n);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Un(a.in,n)||Un(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Un(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Un(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Un(s,n))return!0;return!!(a.rest&&Un(a.rest,n))}return!1}const G6=(e,t={})=>n=>{const a=SE({...n,processors:t});return Jt(e,a),xE(a,e),kE(a,e)},Np=(e,t,n={})=>a=>{const{libraryOptions:s,target:p}=a??{},f=SE({...s??{},target:p,io:t,processors:n});return Jt(e,f),xE(f,e),kE(f,e)},Z6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K6=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:p,maximum:f,format:m,patterns:h,contentEncoding:u}=e._zod.bag;if(typeof p=="number"&&(s.minLength=p),typeof f=="number"&&(s.maxLength=f),m&&(s.format=Z6[m]??m,s.format===""&&delete s.format,m==="time"&&delete s.format),u&&(s.contentEncoding=u),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(w=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},W6=(e,t,n,a)=>{const s=n,{minimum:p,maximum:f,format:m,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:x}=e._zod.bag;typeof m=="string"&&m.includes("int")?s.type="integer":s.type="number";const w=typeof x=="number"&&x>=(p??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=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x:typeof p=="number"&&(s.minimum=p),C?E?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof f=="number"&&(s.maximum=f),typeof h=="number"&&(s.multipleOf=h)},Y6=(e,t,n,a)=>{n.type="boolean"},X6=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},J6=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ez=(e,t,n,a)=>{n.not={}},tz=(e,t,n,a)=>{},nz=(e,t,n,a)=>{},az=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},iz=(e,t,n,a)=>{const s=e._zod.def,p=WA(s.entries);p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),n.enum=p},rz=(e,t,n,a)=>{const s=e._zod.def,p=[];for(const f of s.values)if(f===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");p.push(Number(f))}else p.push(f);if(p.length!==0)if(p.length===1){const f=p[0];n.type=f===null?"null":typeof f,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[f]:n.const=f}else p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),p.every(f=>typeof f=="boolean")&&(n.type="boolean"),p.every(f=>f===null)&&(n.type="null"),n.enum=p},oz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lz=(e,t,n,a)=>{const s=n,p=e._zod.def,{minimum:f,maximum:m}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof m=="number"&&(s.maxItems=m),s.type="array",s.items=Jt(p.element,t,{...a,path:[...a.path,"items"]})},cz=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object",s.properties={};const f=p.shape;for(const u in f)s.properties[u]=Jt(f[u],t,{...a,path:[...a.path,"properties",u]});const m=new Set(Object.keys(f)),h=new Set([...m].filter(u=>{const x=p.shape[u]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),p.catchall?._zod.def.type==="never"?s.additionalProperties=!1:p.catchall?p.catchall&&(s.additionalProperties=Jt(p.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},uz=(e,t,n,a)=>{const s=e._zod.def,p=s.inclusive===!1,f=s.options.map((m,h)=>Jt(m,t,{...a,path:[...a.path,p?"oneOf":"anyOf",h]}));p?n.oneOf=f:n.anyOf=f},dz=(e,t,n,a)=>{const s=e._zod.def,p=Jt(s.left,t,{...a,path:[...a.path,"allOf",0]}),f=Jt(s.right,t,{...a,path:[...a.path,"allOf",1]}),m=u=>"allOf"in u&&Object.keys(u).length===1,h=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=h},pz=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="array";const f=t.target==="draft-2020-12"?"prefixItems":"items",m=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",h=p.items.map((C,E)=>Jt(C,t,{...a,path:[...a.path,f,E]})),u=p.rest?Jt(p.rest,t,{...a,path:[...a.path,m,...t.target==="openapi-3.0"?[p.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,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:x,maximum:w}=e._zod.bag;typeof x=="number"&&(s.minItems=x),typeof w=="number"&&(s.maxItems=w)},mz=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object";const f=p.keyType,h=f._zod.bag?.patterns;if(p.mode==="loose"&&h&&h.size>0){const x=Jt(p.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const w of h)s.patternProperties[w.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Jt(p.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Jt(p.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const u=f._zod.values;if(u){const x=[...u].filter(w=>typeof w=="string"||typeof w=="number");x.length>0&&(s.required=x)}},fz=(e,t,n,a)=>{const s=e._zod.def,p=Jt(s.innerType,t,a),f=t.seen.get(e);t.target==="openapi-3.0"?(f.ref=s.innerType,n.nullable=!0):n.anyOf=[p,{type:"null"}]},hz=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},gz=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},vz=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},yz=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=f},bz=(e,t,n,a)=>{const s=e._zod.def,p=s.in._zod.traits.has("$ZodTransform"),f=t.io==="input"?p?s.out:s.in:s.out;Jt(f,t,a);const m=t.seen.get(e);m.ref=f},Sz=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.readOnly=!0},wE=(e,t,n,a)=>{const s=e._zod.def;Jt(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},xz=(e,t,n,a)=>{const s=e._zod.innerType;Jt(s,t,a);const p=t.seen.get(e);p.ref=s},kz=pe("ZodISODateTime",(e,t)=>{lD.init(e,t),en.init(e,t)});function wz(e){return y6(kz,e)}const Mz=pe("ZodISODate",(e,t)=>{cD.init(e,t),en.init(e,t)});function Cz(e){return b6(Mz,e)}const Az=pe("ZodISOTime",(e,t)=>{uD.init(e,t),en.init(e,t)});function Ez(e){return S6(Az,e)}const Rz=pe("ZodISODuration",(e,t)=>{dD.init(e,t),en.init(e,t)});function _z(e){return x6(Rz,e)}const Tz=(e,t)=>{eE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>J3(e,n)},flatten:{value:n=>X3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,yv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,yv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Na=pe("ZodError",Tz,{Parent:Error}),Iz=nb(Na),Nz=ab(Na),Oz=lm(Na),jz=cm(Na),Pz=nP(Na),Dz=aP(Na),zz=iP(Na),Lz=rP(Na),qz=oP(Na),Bz=sP(Na),Uz=lP(Na),Fz=cP(Na),Uk=new WeakMap;function Gc(e,t,n){const a=Object.getPrototypeOf(e);let s=Uk.get(a);if(s||(s=new Set,Uk.set(a,s)),!s.has(t)){s.add(t);for(const p in n){const f=n[p];Object.defineProperty(a,p,{configurable:!0,enumerable:!1,get(){const m=f.bind(this);return Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m}),m},set(m){Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m})}})}}}const Pt=pe("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Np(e,"input"),output:Np(e,"output")}}),e.toJSONSchema=G6(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,a)=>Iz(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>Oz(e,n,a),e.parseAsync=async(n,a)=>Nz(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>jz(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>Pz(e,n,a),e.decode=(n,a)=>Dz(e,n,a),e.encodeAsync=async(n,a)=>zz(e,n,a),e.decodeAsync=async(n,a)=>Lz(e,n,a),e.safeEncode=(n,a)=>qz(e,n,a),e.safeDecode=(n,a)=>Bz(e,n,a),e.safeEncodeAsync=async(n,a)=>Uz(e,n,a),e.safeDecodeAsync=async(n,a)=>Fz(e,n,a),Gc(e,"ZodType",{check(...n){const a=this.def;return this.clone(qr(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 Gi(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(LL(n,a))},superRefine(n,a){return this.check(qL(n,a))},overwrite(n){return this.check(rl(n))},optional(){return Qk(this)},exactOptional(){return CL(this)},nullable(){return Vk(this)},nullish(){return Qk(Vk(this))},nonoptional(n){return IL(this,n)},array(){return M(this)},or(n){return it([this,n])},and(n){return bL(this,n)},transform(n){return Gk(this,NE(n))},default(n){return RL(this,n)},prefault(n){return TL(this,n)},catch(n){return OL(this,n)},pipe(n){return Gk(this,n)},readonly(){return DL(this)},describe(n){const a=this.clone();return gc.add(a,{description:n}),a},meta(...n){if(n.length===0)return gc.get(this);const a=this.clone();return gc.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 gc.get(e)?.description},configurable:!0}),e)),ME=pe("_ZodString",(e,t)=>{ib.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>K6(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Gc(e,"_ZodString",{regex(...a){return this.check(I6(...a))},includes(...a){return this.check(j6(...a))},startsWith(...a){return this.check(P6(...a))},endsWith(...a){return this.check(D6(...a))},min(...a){return this.check(Ip(...a))},max(...a){return this.check(yE(...a))},length(...a){return this.check(bE(...a))},nonempty(...a){return this.check(Ip(1,...a))},lowercase(a){return this.check(N6(a))},uppercase(a){return this.check(O6(a))},trim(){return this.check(L6())},normalize(...a){return this.check(z6(...a))},toLowerCase(){return this.check(q6())},toUpperCase(){return this.check(B6())},slugify(){return this.check(U6())}})}),Hz=pe("ZodString",(e,t)=>{ib.init(e,t),ME.init(e,t),e.email=n=>e.check(gE(CE,n)),e.url=n=>e.check(vE(AE,n)),e.jwt=n=>e.check(v6(oL,n)),e.emoji=n=>e.check(a6(Vz,n)),e.guid=n=>e.check(zk(Fk,n)),e.uuid=n=>e.check(JD(Rd,n)),e.uuidv4=n=>e.check(e6(Rd,n)),e.uuidv6=n=>e.check(t6(Rd,n)),e.uuidv7=n=>e.check(n6(Rd,n)),e.nanoid=n=>e.check(i6(Gz,n)),e.guid=n=>e.check(zk(Fk,n)),e.cuid=n=>e.check(r6(Zz,n)),e.cuid2=n=>e.check(o6(Kz,n)),e.ulid=n=>e.check(s6(Wz,n)),e.base64=n=>e.check(f6(aL,n)),e.base64url=n=>e.check(h6(iL,n)),e.xid=n=>e.check(l6(Yz,n)),e.ksuid=n=>e.check(c6(Xz,n)),e.ipv4=n=>e.check(u6(Jz,n)),e.ipv6=n=>e.check(d6(eL,n)),e.cidrv4=n=>e.check(p6(tL,n)),e.cidrv6=n=>e.check(m6(nL,n)),e.e164=n=>e.check(g6(rL,n)),e.datetime=n=>e.check(wz(n)),e.date=n=>e.check(Cz(n)),e.time=n=>e.check(Ez(n)),e.duration=n=>e.check(_z(n))});function o(e){return XD(Hz,e)}const en=pe("ZodStringFormat",(e,t)=>{Wt.init(e,t),ME.init(e,t)}),CE=pe("ZodEmail",(e,t)=>{JP.init(e,t),en.init(e,t)});function $z(e){return gE(CE,e)}const Fk=pe("ZodGUID",(e,t)=>{YP.init(e,t),en.init(e,t)}),Rd=pe("ZodUUID",(e,t)=>{XP.init(e,t),en.init(e,t)}),AE=pe("ZodURL",(e,t)=>{eD.init(e,t),en.init(e,t)});function Qz(e){return vE(AE,e)}const Vz=pe("ZodEmoji",(e,t)=>{tD.init(e,t),en.init(e,t)}),Gz=pe("ZodNanoID",(e,t)=>{nD.init(e,t),en.init(e,t)}),Zz=pe("ZodCUID",(e,t)=>{aD.init(e,t),en.init(e,t)}),Kz=pe("ZodCUID2",(e,t)=>{iD.init(e,t),en.init(e,t)}),Wz=pe("ZodULID",(e,t)=>{rD.init(e,t),en.init(e,t)}),Yz=pe("ZodXID",(e,t)=>{oD.init(e,t),en.init(e,t)}),Xz=pe("ZodKSUID",(e,t)=>{sD.init(e,t),en.init(e,t)}),Jz=pe("ZodIPv4",(e,t)=>{pD.init(e,t),en.init(e,t)}),eL=pe("ZodIPv6",(e,t)=>{mD.init(e,t),en.init(e,t)}),tL=pe("ZodCIDRv4",(e,t)=>{fD.init(e,t),en.init(e,t)}),nL=pe("ZodCIDRv6",(e,t)=>{hD.init(e,t),en.init(e,t)}),aL=pe("ZodBase64",(e,t)=>{gD.init(e,t),en.init(e,t)}),iL=pe("ZodBase64URL",(e,t)=>{yD.init(e,t),en.init(e,t)}),rL=pe("ZodE164",(e,t)=>{bD.init(e,t),en.init(e,t)}),oL=pe("ZodJWT",(e,t)=>{xD.init(e,t),en.init(e,t)}),EE=pe("ZodNumber",(e,t)=>{uE.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>W6(e,a,s),Gc(e,"ZodNumber",{gt(a,s){return this.check(qk(a,s))},gte(a,s){return this.check(ep(a,s))},min(a,s){return this.check(ep(a,s))},lt(a,s){return this.check(Lk(a,s))},lte(a,s){return this.check(Jd(a,s))},max(a,s){return this.check(Jd(a,s))},int(a){return this.check(Hk(a))},safe(a){return this.check(Hk(a))},positive(a){return this.check(qk(0,a))},nonnegative(a){return this.check(ep(0,a))},negative(a){return this.check(Lk(0,a))},nonpositive(a){return this.check(Jd(0,a))},multipleOf(a,s){return this.check(Bk(a,s))},step(a,s){return this.check(Bk(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 k6(EE,e)}const sL=pe("ZodNumberFormat",(e,t)=>{kD.init(e,t),EE.init(e,t)});function Hk(e){return w6(sL,e)}const lL=pe("ZodBoolean",(e,t)=>{wD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y6(e,n,a)});function A(e){return M6(lL,e)}const cL=pe("ZodNull",(e,t)=>{MD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X6(e,n,a)});function RE(e){return C6(cL,e)}const uL=pe("ZodAny",(e,t)=>{CD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tz()});function _E(){return A6(uL)}const dL=pe("ZodUnknown",(e,t)=>{AD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nz()});function ne(){return E6(dL)}const pL=pe("ZodNever",(e,t)=>{ED.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ez(e,n,a)});function mL(e){return R6(pL,e)}const fL=pe("ZodVoid",(e,t)=>{RD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J6(e,n)});function N(e){return _6(fL,e)}const hL=pe("ZodDate",(e,t)=>{_D.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>az(e,a),e.min=(a,s)=>e.check(ep(a,s)),e.max=(a,s)=>e.check(Jd(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 Sv(e){return T6(hL,e)}const gL=pe("ZodArray",(e,t)=>{TD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lz(e,n,a,s),e.element=t.element,Gc(e,"ZodArray",{min(n,a){return this.check(Ip(n,a))},nonempty(n){return this.check(Ip(1,n))},max(n,a){return this.check(yE(n,a))},length(n,a){return this.check(bE(n,a))},unwrap(){return this.element}})});function M(e,t){return F6(gL,e,t)}const TE=pe("ZodObject",(e,t)=>{ND.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cz(e,n,a,s),St(e,"shape",()=>t.shape),Gc(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:ne()})},loose(){return this.clone({...this._zod.def,catchall:ne()})},strict(){return this.clone({...this._zod.def,catchall:mL()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return V3(this,n)},safeExtend(n){return G3(this,n)},merge(n){return Z3(this,n)},pick(n){return $3(this,n)},omit(n){return Q3(this,n)},partial(...n){return K3(OE,this,n[0])},required(...n){return W3(jE,this,n[0])}})});function d(e,t){const n={type:"object",shape:e??{},...De(t)};return new TE(n)}function $k(e,t){return new TE({type:"object",shape:e,catchall:ne(),...De(t)})}const IE=pe("ZodUnion",(e,t)=>{mE.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uz(e,n,a,s),e.options=t.options});function it(e,t){return new IE({type:"union",options:e,...De(t)})}const vL=pe("ZodDiscriminatedUnion",(e,t)=>{IE.init(e,t),OD.init(e,t)});function xt(e,t,n){return new vL({type:"union",options:t,discriminator:e,...De(n)})}const yL=pe("ZodIntersection",(e,t)=>{jD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dz(e,n,a,s)});function bL(e,t){return new yL({type:"intersection",left:e,right:t})}const SL=pe("ZodTuple",(e,t)=>{PD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pz(e,n,a,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Zc(e,t,n){const a=t instanceof It,s=a?n:t,p=a?t:null;return new SL({type:"tuple",items:e,rest:p,...De(s)})}const xv=pe("ZodRecord",(e,t)=>{DD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mz(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Y(e,t,n){return!t||!t._zod?new xv({type:"record",keyType:o(),valueType:e,...De(t)}):new xv({type:"record",keyType:e,valueType:t,...De(n)})}function xL(e,t,n){const a=Gi(e);return a._zod.values=void 0,new xv({type:"record",keyType:a,valueType:t,...De(n)})}const kv=pe("ZodEnum",(e,t)=>{zD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>iz(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const p={};for(const f of a)if(n.has(f))p[f]=t.entries[f];else throw new Error(`Key ${f} not found in enum`);return new kv({...t,checks:[],...De(s),entries:p})},e.exclude=(a,s)=>{const p={...t.entries};for(const f of a)if(n.has(f))delete p[f];else throw new Error(`Key ${f} not found in enum`);return new kv({...t,checks:[],...De(s),entries:p})}});function O(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new kv({type:"enum",entries:n,...De(t)})}const kL=pe("ZodLiteral",(e,t)=>{LD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rz(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 V(e,t){return new kL({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const wL=pe("ZodTransform",(e,t)=>{qD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sz(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new KA(e.constructor.name);n.addIssue=p=>{if(typeof p=="string")n.issues.push(_c(p,n.value,t));else{const f=p;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=n.value),f.inst??(f.inst=e),n.issues.push(_c(f))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(p=>(n.value=p,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function NE(e){return new wL({type:"transform",transform:e})}const OE=pe("ZodOptional",(e,t)=>{fE.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Qk(e){return new OE({type:"optional",innerType:e})}const ML=pe("ZodExactOptional",(e,t)=>{BD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wE(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function CL(e){return new ML({type:"optional",innerType:e})}const AL=pe("ZodNullable",(e,t)=>{UD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Vk(e){return new AL({type:"nullable",innerType:e})}const EL=pe("ZodDefault",(e,t)=>{FD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RL(e,t){return new EL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():XA(t)}})}const _L=pe("ZodPrefault",(e,t)=>{HD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function TL(e,t){return new _L({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():XA(t)}})}const jE=pe("ZodNonOptional",(e,t)=>{$D.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function IL(e,t){return new jE({type:"nonoptional",innerType:e,...De(t)})}const NL=pe("ZodCatch",(e,t)=>{QD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>yz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function OL(e,t){return new NL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const PE=pe("ZodPipe",(e,t)=>{hE.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bz(e,n,a,s),e.in=t.in,e.out=t.out});function Gk(e,t){return new PE({type:"pipe",in:e,out:t})}const jL=pe("ZodPreprocess",(e,t)=>{PE.init(e,t),VD.init(e,t)}),PL=pe("ZodReadonly",(e,t)=>{GD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Sz(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function DL(e){return new PL({type:"readonly",innerType:e})}const zL=pe("ZodLazy",(e,t)=>{ZD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xz(e,n,a,s),e.unwrap=()=>e._zod.def.getter()});function Kc(e){return new zL({type:"lazy",getter:e})}const rb=pe("ZodCustom",(e,t)=>{KD.init(e,t),Pt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oz(e,n)});function Qa(e,t){return H6(rb,(()=>!0),t)}function LL(e,t={}){return $6(rb,e,t)}function qL(e,t){return Q6(e,t)}function Ut(e,t={}){const n=new rb({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 BL(e,t){return new jL({type:"pipe",in:NE(e),out:t})}const ob={custom:"custom"};var UL=[{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(UL.map(e=>[e.id,e]));var Cn=O(["high","mid","low"]),sb=O(["pull-rtsp","pull-rtmp","pull-http","pull-flv","pull-rfc4571","push-annexb","derived"]),ol=d({width:l().int().positive(),height:l().int().positive()}),wv=d({camStreamId:o().min(1),deviceId:l().int().nonnegative(),kind:sb,url:o().optional(),codec:o().optional(),resolution:ol.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:Y(o(),ne()).optional()}),tp=O(["unassigned","idle","connecting","streaming","error"]),Mv=d({deviceId:l().int().nonnegative(),profile:Cn,brokerId:o(),sourceCamStreamId:o().nullable(),status:tp,resolution:ol.optional(),codec:o().optional(),preBufferSec:l().nonnegative().optional(),errorMessage:o().optional()}),FL=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:Cn.optional()});d({type:o(),url:o(),videoCodec:o().optional(),audioCodec:o().optional(),metadata:Y(o(),ne()).readonly().optional()});var HL=d({type:O(["video","audio"]),data:Ut(Uint8Array),pts:l(),dts:l(),keyframe:A(),codec:o()}),Zk=d({data:Ut(Uint8Array),width:l(),height:l(),format:O(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:l()}),Pr=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()}),$L=O(["rgb","bgr","yuv420","gray"]),QL=d({brokerId:o(),format:$L,maxFps:l().positive().optional(),tag:o().optional()}),VL=d({subscriptionId:o(),maxFps:l().nonnegative()}),GL=d({data:Ut(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),timestamp:l()}),ZL=d({brokerId:o(),tag:o().optional()}),KL=d({subscriptionId:o()}),WL=O(["idle","connecting","streaming","error","stopped"]),YL=d({status:WL,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()}),XL=d({profile:Cn,brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:ol.optional()}),JL=d({id:o(),title:o(),description:o().optional(),style:O(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:it([V(1),V(2),V(3),V(4)]).optional(),tab:o().optional(),location:O(["settings","top-tab"]).optional(),order:l().optional(),fields:M(_E())}),e8=d({id:o(),label:o(),icon:o(),order:l().optional()});d({tabs:M(e8).optional(),sections:M(JL)}).nullable();d({deviceId:l()}),d({deviceId:l()}),d({deviceId:l(),patch:Y(o(),ne())}),d({success:V(!0)});d({deviceId:l()}),ne().nullable();function S(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 Hh(e,t,n){return{...S(e,t,n),systemOnly:!0}}function wo(e){return{data:e}}var t8=d({staticDir:o()}),n8=d({version:o()}),a8={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:S(N(),t8,{auth:"admin"}),getVersion:S(N(),n8,{auth:"admin"})}},Q=(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})({}),ia=(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})({}),He=(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})({}),i8=d({staticDir:o()}),r8=d({version:o()}),o8={name:"viewer-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:S(N(),i8,{auth:"admin"}),getVersion:S(N(),r8,{auth:"admin"})}},s8=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:Cn.optional(),sdp:o().optional()}),l8=d({key:o(),value:ne()}),c8=d({source:o(),data:Y(o(),ne())}),u8={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:S(d({deviceId:l()}),M(s8)),getConfigEntries:S(d({deviceId:l()}),M(l8)),setConfig:S(d({deviceId:l(),values:Y(o(),ne())}),N(),{kind:"mutation"}),runAction:S(d({deviceId:l(),action:o().min(1),input:ne()}),ne(),{kind:"mutation"}),removeDevice:S(d({deviceId:l()}),N(),{kind:"mutation"}),getSettingsSchema:S(d({deviceId:l()}),ne().nullable()),getRawState:S(d({deviceId:l()}),c8.nullable(),{auth:"protected"})}},d8="device.state-changed";function DE(e){const t=new Map,n=new Map;let a=null;const s=(m,h)=>`${m}:${h}`,p=()=>{a||e.live?.onEvent&&(a=e.live.onEvent.subscribe({category:d8},{onData:m=>{const h=m.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 x=n.get(u);if(x)for(const w of x)try{w(h.slice)}catch{}}}))},f=()=>{a&&(n.size>0||(a.unsubscribe(),a=null))};return{read(m,h){return t.get(s(m,h))},async refresh(m,h){const u=await e.deviceState.getCapSlice.query({deviceId:m,capName:h}),x=s(m,h);t.set(x,u??void 0);const w=n.get(x);if(w)for(const C of w)try{C(u??void 0)}catch{}},watch(m,h,u){const x=s(m,h);let w=n.get(x);return w||(w=new Set,n.set(x,w)),w.add(u),p(),()=>{w.delete(u),w.size===0&&n.delete(x),f()}},async write(m,h,u){await e.deviceState.setCapSlice.mutate({deviceId:m,capName:h,slice:u})}}}function p8(e,t,n){const a=(s,p)=>`${s}:${p}`;return{read(s,p){return e.get(s)?.get(p)},async refresh(){},watch(s,p,f){const m=a(s,p);let h=t.get(m);return h||(h=new Set,t.set(m,h)),h.add(f),()=>{h.delete(f),h.size===0&&t.delete(m)}},async write(s,p,f){if(!n)throw new Error("createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source");await n.deviceState.setCapSlice.mutate({deviceId:s,capName:p,slice:f})}}}function Le(e,t,n){const a=m8(e)?e:DE(e);return{get value(){return a.read(t,n)},refresh(){return a.refresh(t,n)},subscribe(s){const p=a.watch(t,n,f=>{try{s(f)}catch{}});try{s(a.read(t,n))}catch{}return a.read(t,n)===void 0&&a.refresh(t,n).catch(()=>{}),p},async set(s){await a.write(t,n,s)},async patch(s){const p={...a.read(t,n),...s};await a.write(t,n,p)}}}function m8(e){return typeof e.read=="function"&&typeof e.watch=="function"}function zE(e,t,n){const a=e,s=n?.stateSource??DE(e);function p(u,x){const w=typeof u=="object"&&u!==null?u:{};return x!==void 0?{...w,deviceId:t.deviceId,nodeId:x}:{...w,deviceId:t.deviceId}}function f(u,x,w,C,E){const R=a[u]?.[x];if(!R)throw new Error(`DeviceProxy: api has no '${u}.${x}'`);const I=R;return w==="mutation"?I.mutate(C):w==="subscription"?I.subscribe(C,E):I.query(C)}function m(u,x,w,C,E,R){return f(x,w,C,p(E,t.entries.find(I=>I.capName===u)?.providerNodeId),R)}function h(u,x,w,C,E){return f(u,x,w,p(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=>m("accessories","accessories","setChildHidden","mutation",u),getStatus:u=>m("accessories","accessories","getStatus","query",u)},airQualitySensor:{getStatus:u=>m("air-quality-sensor","airQualitySensor","getStatus","query",u)},alarmPanel:{arm:u=>m("alarm-panel","alarmPanel","arm","mutation",u),disarm:u=>m("alarm-panel","alarmPanel","disarm","mutation",u),trigger:u=>m("alarm-panel","alarmPanel","trigger","mutation",u),getStatus:u=>m("alarm-panel","alarmPanel","getStatus","query",u)},ambientLightSensor:{getStatus:u=>m("ambient-light-sensor","ambientLightSensor","getStatus","query",u)},audioAnalysis:{resolveDeviceSettings:u=>m("audio-analysis","audioAnalysis","resolveDeviceSettings","query",u),getDeviceSettingsContribution:u=>m("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",u)},audioMetrics:{getCurrentSnapshot:u=>m("audio-metrics","audioMetrics","getCurrentSnapshot","query",u),getHistory:u=>m("audio-metrics","audioMetrics","getHistory","query",u)},automationControl:{enable:u=>m("automation-control","automationControl","enable","mutation",u),disable:u=>m("automation-control","automationControl","disable","mutation",u),trigger:u=>m("automation-control","automationControl","trigger","mutation",u),getStatus:u=>m("automation-control","automationControl","getStatus","query",u)},battery:{wakeForStream:u=>m("battery","battery","wakeForStream","mutation",u),getStatus:u=>m("battery","battery","getStatus","query",u)},binary:{getStatus:u=>m("binary","binary","getStatus","query",u)},brightness:{setBrightness:u=>m("brightness","brightness","setBrightness","mutation",u),getStatus:u=>m("brightness","brightness","getStatus","query",u)},button:{press:u=>m("button","button","press","mutation",u)},cameraCredentials:{getCredentials:u=>m("camera-credentials","cameraCredentials","getCredentials","query",u),getStatus:u=>m("camera-credentials","cameraCredentials","getStatus","query",u)},cameraStreams:{getCameraStreams:u=>m("camera-streams","cameraStreams","getCameraStreams","query",u),getBrokerStreams:u=>m("camera-streams","cameraStreams","getBrokerStreams","query",u),getRtspEntries:u=>m("camera-streams","cameraStreams","getRtspEntries","query",u),getProfileRtspEntries:u=>m("camera-streams","cameraStreams","getProfileRtspEntries","query",u),pickStream:u=>m("camera-streams","cameraStreams","pickStream","query",u)},carbonMonoxide:{getStatus:u=>m("carbon-monoxide","carbonMonoxide","getStatus","query",u)},climateControl:{setMode:u=>m("climate-control","climateControl","setMode","mutation",u),setFanMode:u=>m("climate-control","climateControl","setFanMode","mutation",u),setPreset:u=>m("climate-control","climateControl","setPreset","mutation",u),setTarget:u=>m("climate-control","climateControl","setTarget","mutation",u),setTargetRange:u=>m("climate-control","climateControl","setTargetRange","mutation",u),setTargetHumidity:u=>m("climate-control","climateControl","setTargetHumidity","mutation",u),setSwingVertical:u=>m("climate-control","climateControl","setSwingVertical","mutation",u),setSwingHorizontal:u=>m("climate-control","climateControl","setSwingHorizontal","mutation",u),getStatus:u=>m("climate-control","climateControl","getStatus","query",u)},color:{setColor:u=>m("color","color","setColor","mutation",u),getStatus:u=>m("color","color","getStatus","query",u)},connectivity:{getStatus:u=>m("connectivity","connectivity","getStatus","query",u)},consumables:{reset:u=>m("consumables","consumables","reset","mutation",u),getStatus:u=>m("consumables","consumables","getStatus","query",u)},contact:{getStatus:u=>m("contact","contact","getStatus","query",u)},control:{setValue:u=>m("control","control","setValue","mutation",u),getStatus:u=>m("control","control","getStatus","query",u)},cover:{open:u=>m("cover","cover","open","mutation",u),close:u=>m("cover","cover","close","mutation",u),stop:u=>m("cover","cover","stop","mutation",u),setPosition:u=>m("cover","cover","setPosition","mutation",u),setTiltPosition:u=>m("cover","cover","setTiltPosition","mutation",u),getStatus:u=>m("cover","cover","getStatus","query",u)},dayNight:{getOptions:u=>m("day-night","dayNight","getOptions","query",u),setSettings:u=>m("day-night","dayNight","setSettings","mutation",u),getStatus:u=>m("day-night","dayNight","getStatus","query",u)},detectionPipeline:{getDeviceSettingsContribution:u=>m("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",u)},deviceDiscovery:{listDiscovered:u=>m("device-discovery","deviceDiscovery","listDiscovered","query",u),refreshDiscovery:u=>m("device-discovery","deviceDiscovery","refreshDiscovery","mutation",u),adoptDevice:u=>m("device-discovery","deviceDiscovery","adoptDevice","mutation",u),releaseDevice:u=>m("device-discovery","deviceDiscovery","releaseDevice","mutation",u),getStatus:u=>m("device-discovery","deviceDiscovery","getStatus","query",u)},deviceOps:{getStreamSources:u=>m("device-ops","deviceOps","getStreamSources","query",u),getConfigEntries:u=>m("device-ops","deviceOps","getConfigEntries","query",u),setConfig:u=>m("device-ops","deviceOps","setConfig","mutation",u),runAction:u=>m("device-ops","deviceOps","runAction","mutation",u),removeDevice:u=>m("device-ops","deviceOps","removeDevice","mutation",u),getSettingsSchema:u=>m("device-ops","deviceOps","getSettingsSchema","query",u),getRawState:u=>m("device-ops","deviceOps","getRawState","query",u)},deviceStatus:{getStatus:u=>m("device-status","deviceStatus","getStatus","query",u)},doorbell:{getStatus:u=>m("doorbell","doorbell","getStatus","query",u),getDeviceSettingsContribution:u=>m("doorbell","doorbell","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("doorbell","doorbell","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("doorbell","doorbell","applyDeviceSettingsPatch","mutation",u)},enumSensor:{getStatus:u=>m("enum-sensor","enumSensor","getStatus","query",u)},eventEmitter:{getStatus:u=>m("event-emitter","eventEmitter","getStatus","query",u)},events:{getEvents:u=>m("events","events","getEvents","query",u),getEventThumbnail:u=>m("events","events","getEventThumbnail","query",u),getEventClipUrl:u=>m("events","events","getEventClipUrl","query",u)},fanControl:{setPercentage:u=>m("fan-control","fanControl","setPercentage","mutation",u),setPreset:u=>m("fan-control","fanControl","setPreset","mutation",u),setDirection:u=>m("fan-control","fanControl","setDirection","mutation",u),setOscillating:u=>m("fan-control","fanControl","setOscillating","mutation",u),getStatus:u=>m("fan-control","fanControl","getStatus","query",u)},featureProbe:{getStatus:u=>m("feature-probe","featureProbe","getStatus","query",u)},flood:{getStatus:u=>m("flood","flood","getStatus","query",u)},gas:{getStatus:u=>m("gas","gas","getStatus","query",u)},humidifier:{setOn:u=>m("humidifier","humidifier","setOn","mutation",u),setTargetHumidity:u=>m("humidifier","humidifier","setTargetHumidity","mutation",u),setMode:u=>m("humidifier","humidifier","setMode","mutation",u),getStatus:u=>m("humidifier","humidifier","getStatus","query",u)},humiditySensor:{getStatus:u=>m("humidity-sensor","humiditySensor","getStatus","query",u)},image:{getStatus:u=>m("image","image","getStatus","query",u)},imageSettings:{getOptions:u=>m("image-settings","imageSettings","getOptions","query",u),setSettings:u=>m("image-settings","imageSettings","setSettings","mutation",u),getStatus:u=>m("image-settings","imageSettings","getStatus","query",u)},intercom:{startSession:u=>m("intercom","intercom","startSession","mutation",u),handleAnswer:u=>m("intercom","intercom","handleAnswer","mutation",u),stopSession:u=>m("intercom","intercom","stopSession","mutation",u),startTalkSession:u=>m("intercom","intercom","startTalkSession","mutation",u),pushTalkAudio:u=>m("intercom","intercom","pushTalkAudio","mutation",u),endTalkSession:u=>m("intercom","intercom","endTalkSession","mutation",u),getStatus:u=>m("intercom","intercom","getStatus","query",u)},lawnMowerControl:{startMowing:u=>m("lawn-mower-control","lawnMowerControl","startMowing","mutation",u),pause:u=>m("lawn-mower-control","lawnMowerControl","pause","mutation",u),dock:u=>m("lawn-mower-control","lawnMowerControl","dock","mutation",u),getStatus:u=>m("lawn-mower-control","lawnMowerControl","getStatus","query",u)},lockControl:{lock:u=>m("lock-control","lockControl","lock","mutation",u),unlock:u=>m("lock-control","lockControl","unlock","mutation",u),open:u=>m("lock-control","lockControl","open","mutation",u),getStatus:u=>m("lock-control","lockControl","getStatus","query",u)},mediaPlayer:{play:u=>m("media-player","mediaPlayer","play","mutation",u),pause:u=>m("media-player","mediaPlayer","pause","mutation",u),stop:u=>m("media-player","mediaPlayer","stop","mutation",u),next:u=>m("media-player","mediaPlayer","next","mutation",u),previous:u=>m("media-player","mediaPlayer","previous","mutation",u),seek:u=>m("media-player","mediaPlayer","seek","mutation",u),setVolume:u=>m("media-player","mediaPlayer","setVolume","mutation",u),setMute:u=>m("media-player","mediaPlayer","setMute","mutation",u),setShuffle:u=>m("media-player","mediaPlayer","setShuffle","mutation",u),setRepeat:u=>m("media-player","mediaPlayer","setRepeat","mutation",u),selectSource:u=>m("media-player","mediaPlayer","selectSource","mutation",u),playMedia:u=>m("media-player","mediaPlayer","playMedia","mutation",u),getStatus:u=>m("media-player","mediaPlayer","getStatus","query",u)},motion:{isDetected:u=>m("motion","motion","isDetected","query",u),getStatus:u=>m("motion","motion","getStatus","query",u)},motionDetection:{analyze:u=>m("motion-detection","motionDetection","analyze","mutation",u),removeCamera:u=>m("motion-detection","motionDetection","removeCamera","mutation",u),reset:u=>m("motion-detection","motionDetection","reset","mutation",u),getDeviceSettingsContribution:u=>m("motion-detection","motionDetection","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("motion-detection","motionDetection","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",u)},motionTrigger:{setMotionTrigger:u=>m("motion-trigger","motionTrigger","setMotionTrigger","mutation",u),getStatus:u=>m("motion-trigger","motionTrigger","getStatus","query",u)},motionZones:{getOptions:u=>m("motion-zones","motionZones","getOptions","query",u),setZone:u=>m("motion-zones","motionZones","setZone","mutation",u),getStatus:u=>m("motion-zones","motionZones","getStatus","query",u)},nativeObjectDetection:{setEnabled:u=>m("native-object-detection","nativeObjectDetection","setEnabled","mutation",u),getStatus:u=>m("native-object-detection","nativeObjectDetection","getStatus","query",u)},notificationRules:{listRules:u=>m("notification-rules","notificationRules","listRules","query",u),getRule:u=>m("notification-rules","notificationRules","getRule","query",u),createRule:u=>m("notification-rules","notificationRules","createRule","mutation",u),updateRule:u=>m("notification-rules","notificationRules","updateRule","mutation",u),deleteRule:u=>m("notification-rules","notificationRules","deleteRule","mutation",u),setRuleEnabled:u=>m("notification-rules","notificationRules","setRuleEnabled","mutation",u),listDeviceMutes:u=>m("notification-rules","notificationRules","listDeviceMutes","query",u),setDeviceMuted:u=>m("notification-rules","notificationRules","setDeviceMuted","mutation",u),testRule:u=>m("notification-rules","notificationRules","testRule","mutation",u),getConditionCatalog:u=>m("notification-rules","notificationRules","getConditionCatalog","query",u),getHistory:u=>m("notification-rules","notificationRules","getHistory","query",u),resolveArtifactUrl:u=>m("notification-rules","notificationRules","resolveArtifactUrl","query",u),listSnoozes:u=>m("notification-rules","notificationRules","listSnoozes","query",u),createSnooze:u=>m("notification-rules","notificationRules","createSnooze","mutation",u),cancelSnooze:u=>m("notification-rules","notificationRules","cancelSnooze","mutation",u),getAlarmConfig:u=>m("notification-rules","notificationRules","getAlarmConfig","query",u),setAlarmConfig:u=>m("notification-rules","notificationRules","setAlarmConfig","mutation",u)},notifier:{send:u=>m("notifier","notifier","send","mutation",u),cancel:u=>m("notifier","notifier","cancel","mutation",u),getStatus:u=>m("notifier","notifier","getStatus","query",u)},numericSensor:{getStatus:u=>m("numeric-sensor","numericSensor","getStatus","query",u)},osd:{setOverlay:u=>m("osd","osd","setOverlay","mutation",u),getStatus:u=>m("osd","osd","getStatus","query",u)},petFeeder:{feed:u=>m("pet-feeder","petFeeder","feed","mutation",u),cancelFeed:u=>m("pet-feeder","petFeeder","cancelFeed","mutation",u),resetDesiccant:u=>m("pet-feeder","petFeeder","resetDesiccant","mutation",u),markFoodReplenished:u=>m("pet-feeder","petFeeder","markFoodReplenished","mutation",u),callPet:u=>m("pet-feeder","petFeeder","callPet","mutation",u),playSound:u=>m("pet-feeder","petFeeder","playSound","mutation",u),setChildLock:u=>m("pet-feeder","petFeeder","setChildLock","mutation",u),setIndicatorLight:u=>m("pet-feeder","petFeeder","setIndicatorLight","mutation",u),setFeedSound:u=>m("pet-feeder","petFeeder","setFeedSound","mutation",u),setVolume:u=>m("pet-feeder","petFeeder","setVolume","mutation",u),getStatus:u=>m("pet-feeder","petFeeder","getStatus","query",u)},pipelineAnalytics:{getActiveTracks:u=>m("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",u),getTrack:u=>m("pipeline-analytics","pipelineAnalytics","getTrack","query",u),listTracks:u=>m("pipeline-analytics","pipelineAnalytics","listTracks","query",u),listRecentTracks:u=>m("pipeline-analytics","pipelineAnalytics","listRecentTracks","query",u),clearTracks:u=>m("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",u),getMotionEvents:u=>m("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",u),getObjectEvents:u=>m("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",u),getAudioEvents:u=>m("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",u),listEventKinds:u=>m("pipeline-analytics","pipelineAnalytics","listEventKinds","query",u),listEventKindsBatch:u=>m("pipeline-analytics","pipelineAnalytics","listEventKindsBatch","query",u),getSensorEvents:u=>m("pipeline-analytics","pipelineAnalytics","getSensorEvents","query",u),getKeyEvents:u=>m("pipeline-analytics","pipelineAnalytics","getKeyEvents","query",u),getKeyEventsBatch:u=>m("pipeline-analytics","pipelineAnalytics","getKeyEventsBatch","query",u),getEventDensity:u=>m("pipeline-analytics","pipelineAnalytics","getEventDensity","query",u),pruneEventsBefore:u=>m("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",u),pruneTracksBefore:u=>m("pipeline-analytics","pipelineAnalytics","pruneTracksBefore","mutation",u),wipeAllAnalytics:u=>m("pipeline-analytics","pipelineAnalytics","wipeAllAnalytics","mutation",u),reconcileFromDisk:u=>m("pipeline-analytics","pipelineAnalytics","reconcileFromDisk","mutation",u),deleteTracks:u=>m("pipeline-analytics","pipelineAnalytics","deleteTracks","mutation",u),setTrackFlags:u=>m("pipeline-analytics","pipelineAnalytics","setTrackFlags","mutation",u),getEventStoreFootprint:u=>m("pipeline-analytics","pipelineAnalytics","getEventStoreFootprint","query",u),getEventMediaFootprintByKind:u=>m("pipeline-analytics","pipelineAnalytics","getEventMediaFootprintByKind","query",u),pruneEvents:u=>m("pipeline-analytics","pipelineAnalytics","pruneEvents","mutation",u),deleteDeviceEvents:u=>m("pipeline-analytics","pipelineAnalytics","deleteDeviceEvents","mutation",u),pauseForStorageMigration:u=>m("pipeline-analytics","pipelineAnalytics","pauseForStorageMigration","mutation",u),resumeForStorageMigration:u=>m("pipeline-analytics","pipelineAnalytics","resumeForStorageMigration","mutation",u),refreshStorageLocationsForMigration:u=>m("pipeline-analytics","pipelineAnalytics","refreshStorageLocationsForMigration","mutation",u),startStorageMigrationMove:u=>m("pipeline-analytics","pipelineAnalytics","startStorageMigrationMove","mutation",u),getStorageMigrationMoveStatus:u=>m("pipeline-analytics","pipelineAnalytics","getStorageMigrationMoveStatus","query",u),cancelStorageMigrationMove:u=>m("pipeline-analytics","pipelineAnalytics","cancelStorageMigrationMove","mutation",u),relocateMedia:u=>m("pipeline-analytics","pipelineAnalytics","relocateMedia","mutation",u),countUnstampedEventMedia:u=>m("pipeline-analytics","pipelineAnalytics","countUnstampedEventMedia","query",u),countRelocatableMedia:u=>m("pipeline-analytics","pipelineAnalytics","countRelocatableMedia","query",u),listRelocateMediaJobs:u=>m("pipeline-analytics","pipelineAnalytics","listRelocateMediaJobs","query",u),cancelRelocateMedia:u=>m("pipeline-analytics","pipelineAnalytics","cancelRelocateMedia","mutation",u),listOpsLog:u=>m("pipeline-analytics","pipelineAnalytics","listOpsLog","query",u),reclaimDebugMedia:u=>m("pipeline-analytics","pipelineAnalytics","reclaimDebugMedia","mutation",u),getMediaReclaimStatus:u=>m("pipeline-analytics","pipelineAnalytics","getMediaReclaimStatus","query",u),getTrainingExportSummary:u=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportSummary","query",u),getTrainingExportUrl:u=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportUrl","query",u),listRetrainStaging:u=>m("pipeline-analytics","pipelineAnalytics","listRetrainStaging","query",u),listRetrainFrames:u=>m("pipeline-analytics","pipelineAnalytics","listRetrainFrames","query",u),selectRetrainFrames:u=>m("pipeline-analytics","pipelineAnalytics","selectRetrainFrames","mutation",u),deselectRetrainFrame:u=>m("pipeline-analytics","pipelineAnalytics","deselectRetrainFrame","mutation",u),getRetrainFrameImage:u=>m("pipeline-analytics","pipelineAnalytics","getRetrainFrameImage","query",u),proposeRetrainAnnotations:u=>m("pipeline-analytics","pipelineAnalytics","proposeRetrainAnnotations","mutation",u),runReplayFrameProcessor:u=>m("pipeline-analytics","pipelineAnalytics","runReplayFrameProcessor","mutation",u),listRetrainAnnotations:u=>m("pipeline-analytics","pipelineAnalytics","listRetrainAnnotations","query",u),saveRetrainAnnotations:u=>m("pipeline-analytics","pipelineAnalytics","saveRetrainAnnotations","mutation",u),completeRetrainTrack:u=>m("pipeline-analytics","pipelineAnalytics","completeRetrainTrack","mutation",u),restageRetrainTrack:u=>m("pipeline-analytics","pipelineAnalytics","restageRetrainTrack","mutation",u),getRetrainExportUrl:u=>m("pipeline-analytics","pipelineAnalytics","getRetrainExportUrl","query",u),getEventMedia:u=>m("pipeline-analytics","pipelineAnalytics","getEventMedia","query",u),getTrackMedia:u=>m("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",u),listTrackMedia:u=>m("pipeline-analytics","pipelineAnalytics","listTrackMedia","query",u),listEventMedia:u=>m("pipeline-analytics","pipelineAnalytics","listEventMedia","query",u),searchObjectEvents:u=>m("pipeline-analytics","pipelineAnalytics","searchObjectEvents","query",u),wipeObjectEmbeddings:u=>m("pipeline-analytics","pipelineAnalytics","wipeObjectEmbeddings","mutation",u),rebuildObjectEmbeddings:u=>m("pipeline-analytics","pipelineAnalytics","rebuildObjectEmbeddings","mutation",u),getObjectEmbeddingRebuildStatus:u=>m("pipeline-analytics","pipelineAnalytics","getObjectEmbeddingRebuildStatus","query",u),getDeviceSettingsContribution:u=>m("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",u)},powerMeter:{getStatus:u=>m("power-meter","powerMeter","getStatus","query",u)},presence:{getStatus:u=>m("presence","presence","getStatus","query",u)},pressureSensor:{getStatus:u=>m("pressure-sensor","pressureSensor","getStatus","query",u)},privacyMask:{getOptions:u=>m("privacy-mask","privacyMask","getOptions","query",u),setMask:u=>m("privacy-mask","privacyMask","setMask","mutation",u),setAudioEnabled:u=>m("privacy-mask","privacyMask","setAudioEnabled","mutation",u),getStatus:u=>m("privacy-mask","privacyMask","getStatus","query",u)},ptz:{move:u=>m("ptz","ptz","move","mutation",u),continuousMove:u=>m("ptz","ptz","continuousMove","mutation",u),stop:u=>m("ptz","ptz","stop","mutation",u),getPresets:u=>m("ptz","ptz","getPresets","query",u),goToPreset:u=>m("ptz","ptz","goToPreset","mutation",u),savePreset:u=>m("ptz","ptz","savePreset","mutation",u),deletePreset:u=>m("ptz","ptz","deletePreset","mutation",u),getOptions:u=>m("ptz","ptz","getOptions","query",u),goHome:u=>m("ptz","ptz","goHome","mutation",u),getPosition:u=>m("ptz","ptz","getPosition","query",u),setAutofocus:u=>m("ptz","ptz","setAutofocus","mutation",u),getStatus:u=>m("ptz","ptz","getStatus","query",u)},ptzAutotrack:{getStatus:u=>m("ptz-autotrack","ptzAutotrack","getStatus","query",u),setEnabled:u=>m("ptz-autotrack","ptzAutotrack","setEnabled","mutation",u),getSettings:u=>m("ptz-autotrack","ptzAutotrack","getSettings","query",u),setSettings:u=>m("ptz-autotrack","ptzAutotrack","setSettings","mutation",u)},reboot:{reboot:u=>m("reboot","reboot","reboot","mutation",u)},sceneMonitor:{listScenes:u=>m("scene-monitor","sceneMonitor","listScenes","query",u),listScenesBatch:u=>m("scene-monitor","sceneMonitor","listScenesBatch","query",u),createScene:u=>m("scene-monitor","sceneMonitor","createScene","mutation",u),updateScene:u=>m("scene-monitor","sceneMonitor","updateScene","mutation",u),deleteScene:u=>m("scene-monitor","sceneMonitor","deleteScene","mutation",u),captureReference:u=>m("scene-monitor","sceneMonitor","captureReference","mutation",u),deleteReference:u=>m("scene-monitor","sceneMonitor","deleteReference","mutation",u),recheckNow:u=>m("scene-monitor","sceneMonitor","recheckNow","mutation",u),resetScene:u=>m("scene-monitor","sceneMonitor","resetScene","mutation",u),getStatus:u=>m("scene-monitor","sceneMonitor","getStatus","query",u)},scriptRunner:{run:u=>m("script-runner","scriptRunner","run","mutation",u),stop:u=>m("script-runner","scriptRunner","stop","mutation",u),getStatus:u=>m("script-runner","scriptRunner","getStatus","query",u)},smoke:{getStatus:u=>m("smoke","smoke","getStatus","query",u)},snapshot:{getSnapshot:u=>m("snapshot","snapshot","getSnapshot","query",u),invalidateCache:u=>m("snapshot","snapshot","invalidateCache","mutation",u),getSnapshotOverview:u=>m("snapshot","snapshot","getSnapshotOverview","query",u),getDebugState:u=>m("snapshot","snapshot","getDebugState","query",u),getSnapshotLinks:u=>m("snapshot","snapshot","getSnapshotLinks","query",u),getStatus:u=>m("snapshot","snapshot","getStatus","query",u),getDeviceSettingsContribution:u=>m("snapshot","snapshot","getDeviceSettingsContribution","query",u),getDeviceLiveContribution:u=>m("snapshot","snapshot","getDeviceLiveContribution","query",u),applyDeviceSettingsPatch:u=>m("snapshot","snapshot","applyDeviceSettingsPatch","mutation",u)},streamCatalog:{getCatalog:u=>m("stream-catalog","streamCatalog","getCatalog","query",u)},streamParams:{getOptions:u=>m("stream-params","streamParams","getOptions","query",u),setProfile:u=>m("stream-params","streamParams","setProfile","mutation",u),getConfigSchema:u=>m("stream-params","streamParams","getConfigSchema","query",u),getStatus:u=>m("stream-params","streamParams","getStatus","query",u)},switch:{setState:u=>m("switch","switch","setState","mutation",u),getStatus:u=>m("switch","switch","getStatus","query",u)},tamper:{getStatus:u=>m("tamper","tamper","getStatus","query",u)},temperatureSensor:{getStatus:u=>m("temperature-sensor","temperatureSensor","getStatus","query",u)},update:{installUpdate:u=>m("update","update","installUpdate","mutation",u),getStatus:u=>m("update","update","getStatus","query",u)},vacuumControl:{start:u=>m("vacuum-control","vacuumControl","start","mutation",u),pause:u=>m("vacuum-control","vacuumControl","pause","mutation",u),stop:u=>m("vacuum-control","vacuumControl","stop","mutation",u),returnToBase:u=>m("vacuum-control","vacuumControl","returnToBase","mutation",u),locate:u=>m("vacuum-control","vacuumControl","locate","mutation",u),setFanSpeed:u=>m("vacuum-control","vacuumControl","setFanSpeed","mutation",u),getStatus:u=>m("vacuum-control","vacuumControl","getStatus","query",u)},valve:{open:u=>m("valve","valve","open","mutation",u),close:u=>m("valve","valve","close","mutation",u),stop:u=>m("valve","valve","stop","mutation",u),setPosition:u=>m("valve","valve","setPosition","mutation",u),getStatus:u=>m("valve","valve","getStatus","query",u)},vibration:{getStatus:u=>m("vibration","vibration","getStatus","query",u)},videoclips:{listClips:u=>m("videoclips","videoclips","listClips","query",u),getClipPlayback:u=>m("videoclips","videoclips","getClipPlayback","query",u)},waterHeater:{setTargetTemp:u=>m("water-heater","waterHeater","setTargetTemp","mutation",u),setOperationMode:u=>m("water-heater","waterHeater","setOperationMode","mutation",u),setAway:u=>m("water-heater","waterHeater","setAway","mutation",u),getStatus:u=>m("water-heater","waterHeater","getStatus","query",u)},weather:{getStatus:u=>m("weather","weather","getStatus","query",u)},webrtcSession:{listStreams:u=>m("webrtc-session","webrtcSession","listStreams","query",u),createSession:u=>m("webrtc-session","webrtcSession","createSession","mutation",u),handleOffer:u=>m("webrtc-session","webrtcSession","handleOffer","mutation",u),handleAnswer:u=>m("webrtc-session","webrtcSession","handleAnswer","mutation",u),addIceCandidate:u=>m("webrtc-session","webrtcSession","addIceCandidate","mutation",u),getIceCandidates:u=>m("webrtc-session","webrtcSession","getIceCandidates","query",u),closeSession:u=>m("webrtc-session","webrtcSession","closeSession","mutation",u),hasAdaptiveBitrate:u=>m("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",u),getSessionState:u=>m("webrtc-session","webrtcSession","getSessionState","query",u)},zoneAnalytics:{getCurrentSnapshot:u=>m("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",u),getCurrentSnapshotBatch:u=>m("zone-analytics","zoneAnalytics","getCurrentSnapshotBatch","query",u),getZoneHistory:u=>m("zone-analytics","zoneAnalytics","getZoneHistory","query",u),getCameraHistory:u=>m("zone-analytics","zoneAnalytics","getCameraHistory","query",u),getUnzonedHistory:u=>m("zone-analytics","zoneAnalytics","getUnzonedHistory","query",u)},zoneRules:{listRules:u=>m("zone-rules","zoneRules","listRules","query",u),setRules:u=>m("zone-rules","zoneRules","setRules","mutation",u)},zones:{listZones:u=>m("zones","zones","listZones","query",u),addZone:u=>m("zones","zones","addZone","mutation",u),removeZone:u=>m("zones","zones","removeZone","mutation",u),updateZone:u=>m("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 f8=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()}),h8=it([V("passthrough"),d({codec:O(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:l().int().positive().optional(),sampleRateHz:l().int().positive().optional(),channels:it([V(1),V(2)]).optional()})]),LE=d({video:f8,audio:h8,inputArgs:M(o()).optional(),outputArgs:M(o()).optional()}),g8={video:{codec:"h264",profile:"baseline",level:"3.1",width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:"veryfast",tune:"zerolatency"}};({...g8.video});var v8=O(["singleton","device","widget"]),Kk=d({capName:o(),kind:v8,deviceId:l().optional(),reachable:A(),latencyMs:l(),error:o().optional()}),y8=d({addonId:o(),caps:M(Kk).readonly(),widgets:M(Kk).readonly()}),b8=d({nodeId:o(),addons:M(y8).readonly()});d({ok:A(),degraded:A(),checkedAt:o(),nodes:M(b8).readonly(),summary:d({total:l(),reachable:l(),unreachable:l()})});var S8=O(["running","done","failed","cancelled"]),x8=O(["adopted","already-adopted","failed","cancelled"]),k8=d({childNativeId:o(),outcome:x8,parentDeviceId:l().int().nonnegative().nullable(),accessoryCount:l().int().nonnegative(),error:o().nullable()}),w8=d({jobId:o(),addonId:o(),integrationId:o(),state:S8,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(k8).readonly(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),lb=O(["stream-broker","object-detection","privacy-mask","device-audio","broker-audio","audio-analysis","recording","notifications"]),M8=xt("kind",[d({kind:V("device-disabled")}),d({kind:V("wrapper-binding"),capName:o()}),d({kind:V("recording-config")}),d({kind:V("notification-mute")}),d({kind:V("camera-audio"),capName:o()}),d({kind:V("camera-mask"),capName:o()}),d({kind:V("broker-audio-mute")})]),C8=O(["no-provider","source-unreachable","not-configured"]),A8=d({id:lb,label:o(),costWhenOff:o(),available:A(),unavailableReason:C8.optional(),enabled:A(),authority:M8}),Wk=d({deviceId:l().int(),switches:M(A8).readonly(),fetchedAt:l()}),E8=O(["info","warn","error"]),qE=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:E8,perDevice:A()}),R8=d({channel:o().min(1),armedUntilMs:l(),deviceIds:M(l().int()).readonly().nullable()}),_8=O(["recording","events"]),T8=O(["prune","manual-delete","rescan","retention-run","relocate","orphan-audit"]),cb=O(["retention","quota","manual","operator","maintenance"]),BE=d({id:o(),at:l(),domain:_8,op:T8,reason:cb,deviceId:l().nullable(),nodeId:o(),itemsAffected:l(),bytesReclaimed:l(),detail:o().nullable(),actor:o()}),UE=d({deviceId:l().optional(),limit:l().int().min(1).max(1e3).optional()}),FE=d({id:o(),name:o(),category:o().optional(),description:o().optional(),icon:o().optional()}),I8=["person","vehicle","animal","package"],N8=["person","vehicle","animal"],HE=d({mapping:Y(o(),O(I8)),preserveOriginal:A()}),O8=l().int().min(0).max(6),Yk=/^([01]\d|2[0-3]):[0-5]\d$/,j8=O(["off","events","continuous"]),P8=O(N8),Xk=e=>new Set(e).size===e.length,D8=d({motion:A().optional(),audioThresholdDbfs:l().optional(),objectClasses:M(P8).min(1).refine(Xk,{message:"objectClasses must not repeat a class"}).optional(),sensorDeviceIds:M(l().int().positive()).min(1).max(16).refine(Xk,{message:"sensorDeviceIds must not repeat a device"}).optional()}),z8=O(["continuous","events"]),L8=D8,q8=d({days:M(O8),start:o().regex(Yk),end:o().regex(Yk),mode:z8,triggers:L8.optional(),preBufferSec:l().min(0).optional(),postBufferSec:l().min(0).optional()}),B8=d({maxAgeDays:l().min(0).optional(),maxSizeGb:l().min(0).optional()}),$h=d({enabled:A(),mode:j8.optional(),profiles:M(Cn).optional(),segmentSeconds:l().int().positive().optional(),bands:M(q8).default([]),retention:B8.optional()}).strict(),$E=O(["queued","running","done","failed","cancelled"]),Tc=d({jobId:o(),state:$E,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()}),QE=O(["recordings","recordingsLow"]),VE=d({fromLocationId:o(),toLocationId:o(),entities:M(O(["segments"])).optional(),footageClass:QE.optional(),deviceId:l().int().optional(),profiles:M(o()).optional(),throttleMbps:l().min(1).max(1e3).optional(),sinceMs:l().int().optional()}),Nr=d({leaseId:o().min(1)}),U8=VE.extend({leaseId:o().min(1)}),GE=O(["move","seal","gallery"]),ZE=d({toLocationId:o(),fromLocationId:o().optional(),throttleMbps:l().min(1).max(1e3).optional(),mode:GE.optional()}),Jk=d({present:A(),rows:l().int().nonnegative().nullable()}),F8=d({media:Jk,retrainFrames:Jk,anyPresent:A(),total:l().int().nonnegative().nullable()}).nullable(),H8=ZE.extend({leaseId:o().min(1)}),Wc=O(["recordings","recordingsLow","eventMedia","backups","galleryMedia"]),ub=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"}),db=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(),pb=O(["blocking","nonBlocking"]),ew=d({destinations:ub,sources:db,throttleMbps:l().min(1).max(1e3).optional(),mode:pb.optional()}),$8=O(["planning","sealing","pausing","moving","draining","verifying","repointing","refreshing","resuming","done","failed","cancelled"]),Q8=O(["pipeline","recorder","analytics"]),V8=d({filesMoved:l().int().nonnegative(),filesTotal:l().int().nonnegative().nullable(),bytesMoved:l().int().nonnegative(),rowsReconciled:l().int().nonnegative().optional(),startedAt:l(),observedAt:l()}),G8=d({storageClass:Wc,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional(),moverJobId:o().nullable(),state:$E.nullable(),error:o().nullable(),progress:V8.nullable()}),tw=d({jobId:o(),phase:$8,mode:pb,destinations:ub,sources:db,throttleMbps:l(),moves:M(G8),pauseLeaseId:o().nullable(),pausedParticipants:M(Q8),repointed:A(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),Z8=O(["sharesDeviceWithSource","deviceIdentityUnknown","unstampedEventMediaRows","blockingOnly","noMover"]),K8=d({code:Z8,storageClass:Wc,message:o()}),W8=d({destinations:ub,sources:db,mode:pb,moves:M(d({storageClass:Wc,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional()})),findings:M(K8)}),Y8=O(["footage","media"]),X8=d({lane:Y8,job:Tc,migrationJobId:o().nullable(),observedAt:l()}),J8=d({storageClass:Wc,fromLocationId:o(),toLocationId:o(),items:l().int().nonnegative().nullable(),bytes:l().int().nonnegative().nullable()}),eq=d({classes:M(Wc).min(1),throttleMbps:l().min(1).max(1e3).optional()}),tq=d({fromLocationId:o().min(1),footageClass:QE.optional()}),nq=d({segments:l().int().nonnegative(),bytes:l().int().nonnegative()}).nullable(),aq=d({locationId:o().min(1),apply:A().optional(),deviceId:l().int().positive().optional(),profiles:M(o().min(1)).optional()}),iq=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 rq=d({"live-tail":l().int().nonnegative(),"listing-error":l().int().nonnegative(),"path-mismatch":l().int().nonnegative(),"durable-refused":l().int().nonnegative()}),oq=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()}),sq=d({locationId:o(),applied:A(),refused:iq.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:rq,bounded:A(),byDevice:M(oq).readonly()}),lq=d({rows:l().int().nonnegative()}).nullable(),cq=d({toLocationId:o().min(1),fromLocationId:o().optional(),mode:GE.optional()}),uq=O(["orphans","debug-media","ghost-ledger","done","failed","cancelled"]),dq=d({includeDebugMedia:A().optional()}),pq=d({jobId:o(),phase:uq,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()}),mq=d({jobId:o().optional()}),Cv=o().regex(/^[a-z][a-zA-Z0-9-]*$/),ya=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:o(),displayName:o().min(1),providerId:o().min(1),config:Y(o(),ne()),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()}),Di=it([Cv,o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),fq=O(["local-path","cap-mediated"]),hq=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:fq.optional(),defaultsTo:o().optional(),defaultRoot:O(["data","media","backup"]).optional()}),gq=d({inputFps:l(),outputFps:l(),avgDecodeTimeMs:l(),droppedFrames:l(),lagMs:l().optional(),effectiveFps:l().optional(),adaptiveFps:l().optional()}),nw=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()}),dm=["onnx","coreml","openvino","tflite","pt","gguf"],ws=d({url:o(),sizeMB:l(),isDirectory:A().optional(),files:M(o()).readonly().optional(),runtimes:M(O(["node","python"])).readonly().optional()}),vq=d({url:o(),filename:o(),sizeMB:l()}),yq=d({onnx:ws.optional(),coreml:ws.optional(),openvino:ws.optional(),tflite:ws.optional(),pt:ws.optional(),gguf:ws.optional()}),KE=d({family:o(),tier:o(),precision:O(["fp32","int8"]).optional(),optimization:O(["standard","fast"]).optional(),resolution:l().int().positive().optional()}),bq=["camstack","frigate","scrypted","custom"],WE=O(bq),mb=d({id:o(),name:o(),description:o(),formats:yq,inputSize:d({width:l(),height:l()}),inputChannels:l().int().positive().optional(),labels:M(FE).readonly(),inputLayout:O(["nchw","nhwc"]).optional(),inputNormalization:O(["zero-one","imagenet","none"]).optional(),outputProbabilities:A().optional(),preprocessMode:O(["letterbox","resize"]).optional(),postprocessor:Qa().optional(),faceAlignment:A().optional(),extraFiles:M(vq).readonly().optional(),legacy:A().optional(),metrics:d({map50:l().optional(),p95LatencyMs:Y(o(),l()).optional()}).optional(),license:o().optional(),group:KE.optional(),provider:WE.optional(),classMap:HE.optional()}),Sq=xt("format",[d({format:V("openvino"),precisions:M(O(["fp16","int8"])).min(1).readonly()}),d({format:V("coreml")})]),xq=d({id:o().regex(/^[a-zA-Z0-9._-]+$/),name:o(),labels:M(FE).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:HE.optional()}),kq=d({format:O(dm),precision:O(["fp16","int8"]).optional(),sizeMB:l(),validated:A(),files:M(o()).readonly()}),wq=d({entry:mb,artifacts:M(kq).readonly()}),Hn=class extends Error{position;constructor(e,t){super(e),this.name="ExpressionParseError",this.position=t}},yo=class extends Error{constructor(e){super(e),this.name="ExpressionEvalError"}};function Fn(e,t,n){if(typeof e!="number"||!Number.isFinite(e))throw new yo(`${t}: argument ${n+1} must be a finite number`);return e}function aw(e,t,n){if(typeof e!="string")throw new yo(`${t}: argument ${n+1} must be a string`);return e}function ga(e,t){if(!Number.isFinite(e))throw new yo(`${t}: produced a non-finite result`);return e}function _d(e,t){return e.map((n,a)=>Fn(n,t,a))}var nc=Number.POSITIVE_INFINITY,YE={min:{minArgs:1,maxArgs:nc,apply:e=>ga(Math.min(..._d(e,"min")),"min")},max:{minArgs:1,maxArgs:nc,apply:e=>ga(Math.max(..._d(e,"max")),"max")},abs:{minArgs:1,maxArgs:1,apply:e=>ga(Math.abs(Fn(e[0],"abs",0)),"abs")},floor:{minArgs:1,maxArgs:1,apply:e=>ga(Math.floor(Fn(e[0],"floor",0)),"floor")},ceil:{minArgs:1,maxArgs:1,apply:e=>ga(Math.ceil(Fn(e[0],"ceil",0)),"ceil")},sqrt:{minArgs:1,maxArgs:1,apply:e=>ga(Math.sqrt(Fn(e[0],"sqrt",0)),"sqrt")},round:{minArgs:1,maxArgs:2,apply:e=>{const t=Fn(e[0],"round",0),n=e.length>1?Math.trunc(Fn(e[1],"round",1)):0;if(n<0||n>100)throw new yo("round: digits must be between 0 and 100");const a=10**n;return ga(Math.round(t*a)/a,"round")}},pow:{minArgs:2,maxArgs:2,apply:e=>ga(Fn(e[0],"pow",0)**Fn(e[1],"pow",1),"pow")},clamp:{minArgs:3,maxArgs:3,apply:e=>{const t=Fn(e[0],"clamp",0),n=Fn(e[1],"clamp",1),a=Fn(e[2],"clamp",2);if(n>a)throw new yo("clamp: lower bound is greater than upper bound");return ga(Math.min(a,Math.max(n,t)),"clamp")}},avg:{minArgs:1,maxArgs:nc,apply:e=>{const t=_d(e,"avg");return ga(t.reduce((n,a)=>n+a,0)/t.length,"avg")}},sum:{minArgs:1,maxArgs:nc,apply:e=>ga(_d(e,"sum").reduce((t,n)=>t+n,0),"sum")},coalesce:{minArgs:1,maxArgs:nc,apply:e=>{for(const t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>ga(Fn(e[0],"age",0)-Fn(e[1],"age",1),"age")},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{const n=Fn(e[0],"convert",0),a=aw(e[1],"convert",1).trim(),s=aw(e[2],"convert",2).trim();if(t.convert){const p=t.convert(n,a,s);if(p===null)throw new yo(`convert: cannot convert '${a}' to '${s}'`);return ga(p,"convert")}if(a===s)return n;throw new yo("convert: unit conversion table not installed")}}};Object.freeze(Object.assign(Object.create(null),YE));var XE=new Set(Object.keys(YE)),fb=2048,hb=/^[A-Za-z_][A-Za-z0-9_]*$/,Mq=new Set(["now","true","false","null"]),Cq=new Set(["true","false","null"]);function vc(e){return e>="0"&&e<="9"}function JE(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"}function Aq(e){return JE(e)||vc(e)}function Eq(e){return e===" "||e===" "||e===`
74
+ `||e==="\r"||e==="\f"||e==="\v"}function Rq(e){if(e.length>2048)throw new Hn(`expression too long (${e.length} > ${fb} chars)`,0);const t=[];let n=0;const a=e.length;for(;n<a;){const s=e[n];if(Eq(s)){n+=1;continue}if(vc(s)){const f=n;for(;n<a&&vc(e[n]);)n+=1;if(n<a&&e[n]==="."){if(n+1>=a||!vc(e[n+1]))throw new Hn("malformed number: decimal point needs a digit",n);for(n+=1;n<a&&vc(e[n]);)n+=1}const m=e.slice(f,n),h=Number(m);if(!Number.isFinite(h))throw new Hn(`malformed number: '${m}'`,f);t.push({type:"number",value:h,pos:f});continue}if(s==="'"||s==='"'){const f=s,m=n;n+=1;let h="",u=!1;for(;n<a;){const x=e[n];if(x==="\\"){const w=n+1<a?e[n+1]:"";if(w==="\\"||w==="'"||w==='"'){h+=w,n+=2;continue}throw new Hn(`invalid string escape: '\\${w}'`,n)}if(x===f){u=!0,n+=1;break}h+=x,n+=1}if(!u)throw new Hn("unterminated string literal",m);t.push({type:"string",value:h,pos:m});continue}if(JE(s)){const f=n;for(;n<a&&Aq(e[n]);)n+=1;const m=e.slice(f,n);Cq.has(m)?t.push({type:"keyword",keyword:_q(m),pos:f}):t.push({type:"identifier",name:m,pos:f});continue}const p=n+1<a?e.slice(n,n+2):"";if(p==="<="||p===">="||p==="=="||p==="!="||p==="&&"||p==="||"){t.push({type:"punct",punct:p,pos:n}),n+=2;continue}if(Tq(s)){t.push({type:"punct",punct:s,pos:n}),n+=1;continue}throw new Hn(`unexpected character '${s}'`,n)}return t.push({type:"eof",pos:a}),t}function _q(e){return e==="true"?"true":e==="false"?"false":"null"}function Tq(e){return e==="("||e===")"||e===","||e==="?"||e===":"||e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="!"||e==="<"||e===">"}var Iq={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function Nq(e){return e==="&&"||e==="||"}function Oq(e){return e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="=="||e==="!="||e==="<"||e==="<="||e===">"||e===">="}var jq=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 Hn("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 Hn(`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 Hn("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=Iq[n.punct];if(a===void 0||a<e)break;const s=n.punct;this.pos+=1;const p=this.parseBinary(a+1);if(this.countNode(),Nq(s))t={kind:"logical",op:s,left:t,right:p};else if(Oq(s))t={kind:"binary",op:s,left:t,right:p};else throw new Hn(`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 Hn(`unexpected token '${e.punct}'`,e.pos);case"eof":throw new Hn("unexpected end of expression",e.pos)}}parseCall(e,t){if(!XE.has(e))throw new Hn(`unknown function '${e}'`,t);this.expectPunct("(");const n=[];if(!this.matchPunct(")"))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new Hn(`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 Pq(e){return new jq(Rq(e)).parse()}var po=new Map;function Dq(e){const t=po.get(e);if(t!==void 0)return po.delete(e),po.set(e,t),t;let n;try{n={ok:!0,parsed:Pq(e)}}catch(a){n={ok:!1,error:a instanceof Hn?a.message:String(a)}}if(po.set(e,n),po.size>256){const a=po.keys().next().value;a!==void 0&&po.delete(a)}return n}function zq(e){return Dq(e)}function eR(e){const t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(const s of t){if(!hb.test(s))return`invalid binding name '${s}'`;if(Mq.has(s))return`binding name '${s}' is reserved`;if(XE.has(s))return`binding name '${s}' shadows a builtin function`}const n=zq(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 Lq=d({kind:V("field").optional(),sourceKey:o(),cap:o(),fieldPath:o()}),qq=d({kind:V("literal"),value:it([o(),l(),A(),RE()])}),Bq=d({kind:V("global"),sourceStableId:o(),cap:o(),fieldPath:o()}),tR=it([Lq,qq,Bq]);d({expr:o().min(1).max(fb),bindings:Y(o().regex(hb),tR)}).superRefine((e,t)=>{const n=eR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})});var Uq=O(["eq","ne","gt","gte","lt","lte","contains","in"]),Fq=d({kind:V("condition"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),operator:Uq,value:it([o(),l(),A(),M(it([o(),l()]))])}),Hq=d({kind:V("expression"),expr:o().min(1).max(fb),bindings:Y(o().regex(hb),tR)}).superRefine((e,t)=>{const n=eR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})}),np=Kc(()=>xt("kind",[d({kind:V("all"),children:M(np)}),d({kind:V("any"),children:M(np)}),d({kind:V("not"),child:np}),Fq,Hq])),$q=xt("kind",[d({kind:V("device-state"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),becomes:it([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:V("device-event"),category:o().min(1),deviceId:l().int().nonnegative().optional()}),d({kind:V("schedule"),cron:o().min(1).max(120)}),d({kind:V("manual")})]),Qq=xt("kind",[d({kind:V("wait"),seconds:l().min(0).max(300)}),d({kind:V("cap"),deviceId:it([l().int(),d({$var:o().min(1)})]),cap:o().min(1),method:o().min(1),args:Y(o(),ne()).optional()}),d({kind:V("code"),code:o().min(1).max(2e4)})]);d({triggers:M($q),conditions:np.optional(),actions:M(Qq)});var Vq=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),Gq=d({addonId:o(),page:Vq,bundleUrl:o()}),Zq={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:S(N(),M(Gq).readonly())}},Kq=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),Wq={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:S(N(),M(Kq).readonly(),{auth:"admin"})}},Yq=d({method:O(["GET","POST","PUT","DELETE","PATCH"]),path:o(),access:O(["public","authenticated","admin"]).optional(),description:o().optional()}),Xq=d({method:o(),path:o(),params:Y(o(),o()),query:Y(o(),o()),body:ne(),headers:Y(o(),o()),user:d({id:o(),username:o(),isAdmin:A()}).optional(),scopedToken:ne().optional()}),Jq=d({status:l().int(),headers:Y(o(),o()),redirectUrl:o().nullable(),body:ne().optional(),contentType:o().optional()}),e7={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:S(N(),M(Yq)),invoke:S(Xq,Jq,{kind:"mutation"})},mount:{kind:"skip"}},t7=d({id:o(),label:o(),icon:o(),order:l().optional()}),n7=d({id:o(),title:o(),description:o().optional(),style:O(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:it([V(1),V(2),V(3),V(4)]).optional(),tab:o().optional(),location:O(["settings","top-tab"]).optional(),order:l().optional(),fields:M(_E())}),bo=d({tabs:M(t7).optional(),sections:M(n7)}),iw=Y(o(),ne()),rw=d({success:V(!0)}),a7={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:S(d({addonId:o(),nodeId:o().optional(),overlay:Y(o(),ne()).optional(),cap:o().optional()}),bo.nullable()),updateGlobalSettings:S(d({addonId:o(),nodeId:o().optional(),patch:iw}),rw,{kind:"mutation",auth:"admin"}),getIntegrationSettings:S(d({addonId:o(),nodeId:o().optional()}),bo.nullable()),getDeviceSettings:S(d({addonId:o(),deviceId:l(),nodeId:o().optional()}),bo.nullable()),updateDeviceSettings:S(d({addonId:o(),deviceId:l(),nodeId:o().optional(),patch:iw}),rw,{kind:"mutation",auth:"admin"})}},i7=O(["device-tab","dashboard","integration-detail"]),ow=O(["xs","sm","md","lg","xl"]),nR=d({remoteName:o(),exposedModule:o(),componentKey:o().optional()}),aR=d({tab:o(),subTab:o().optional(),label:o(),order:l().optional(),kind:V("remote"),remote:nR,stableId:o(),description:o().optional(),icon:o().optional(),bundle:o(),hosts:M(i7).readonly(),requires:d({deviceContext:A().default(!1),integrationContext:A().default(!1)}),preAuth:A().optional().default(!1),defaultSize:ow.default("md"),allowedSizes:M(ow).readonly().default(["sm","md","lg"]),defaultColumns:l().int().min(1).max(12).default(6),defaultRows:l().int().min(1).max(12).default(1)}),r7={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:S(N(),M(aR).readonly(),{auth:"admin"})}},o7=aR.extend({addonId:o(),bundleUrl:o()}),s7={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:S(N(),M(o7).readonly())}},l7=O(["info","success","warning","error"]),c7=O(["active","in-progress","completed","failed","dismissed"]),u7=d({type:o(),id:o()}),Qh=d({id:o(),category:o(),severity:l7,title:o(),message:o(),status:c7,progress:l().optional(),read:A(),createdAt:l(),updatedAt:l(),source:u7.optional(),metadata:Y(o(),ne()).optional()}),d7={name:"alerts",scope:"system",mode:"singleton",methods:{emit:S(Qh,N(),{kind:"mutation"}),update:S(d({alertId:o(),patch:Qh.partial()}),N(),{kind:"mutation"}),list:S(d({unreadOnly:A().optional(),limit:l().optional()}).optional(),M(Qh).readonly()),getUnreadCount:S(N(),l()),markRead:S(d({alertId:o()}),N(),{kind:"mutation"}),markAllRead:S(N(),N(),{kind:"mutation"}),dismiss:S(d({alertId:o()}),N(),{kind:"mutation"})}},p7={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:S(d({deviceId:l()}),Qa())},events:{onAudioLevel:wo(d({deviceId:l(),rms:l(),dbfs:l()}))}},m7=O(["jpeg","rgb","bgr","yuv420","gray"]),Av=d({data:Qa(),format:m7,width:l(),height:l(),timestamp:l()}),Zi=d({x:l(),y:l(),w:l(),h:l()});d({class:o(),originalClass:o(),score:l(),bbox:Zi});var sw=d({data:Ut(Uint8Array),sampleRate:l(),channels:l(),timestamp:l(),deviceId:l().optional()}),f7=d({rms:l(),dbfs:l()}),Ev=d({className:o(),originalClass:o().optional(),score:l()}),h7=d({level:f7,classification:d({labels:M(Ev).readonly(),inferenceMs:l()}).optional(),timestamp:l()}),g7=d({minConfidence:l().min(0).max(1).default(.3),allowedClasses:M(o()).default([])}),v7=d({labels:M(Ev).readonly(),rawLabels:M(Ev).readonly().optional(),inferenceMs:l()}),y7={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:S(d({chunk:sw,settings:g7}),h7.nullable(),{kind:"mutation"}),classify:S(sw,v7,{timeoutMs:3e4}),isReady:S(N(),A()),dispose:S(N(),N(),{kind:"mutation"}),reprobeAudioEngine:S(N(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},pm=O(["f32le","s16le"]),b7=d({codec:o(),canDecode:A(),canEncode:A(),label:o().optional()}),S7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),extraData:Ut(Uint8Array).optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),targetFormat:pm.optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),x7=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),sourceFormat:pm.optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),bitrateKbps:l().int().positive().optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),k7=d({data:Ut(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),format:pm,pts:l()}),lw=d({data:Ut(Uint8Array),codec:o(),pts:l(),frameComplete:A()}),w7=d({sessionId:o(),kind:O(["decode","encode"]),codec:o(),sourceSampleRate:l(),sourceChannels:l(),targetSampleRate:l(),targetChannels:l(),format:pm,tag:o().optional(),createdAtMs:l(),lastActivityMs:l(),framesIn:l(),framesOut:l()}),M7={name:"audio-codec",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{listSupportedCodecs:S(N(),M(b7).readonly()),canHandle:S(d({codec:o(),kind:O(["decode","encode"])}),A()),createDecodeSession:S(S7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),createEncodeSession:S(x7,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),closeSession:S(d({sessionId:o(),nodeId:o().optional()}),N(),{kind:"mutation"}),pushEncodedFrame:S(d({sessionId:o(),nodeId:o().optional(),data:Ut(Uint8Array),pts:l().optional()}),N(),{kind:"mutation"}),pullPcm:S(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),M(k7)),pushPcm:S(d({sessionId:o(),nodeId:o().optional(),data:Ut(Uint8Array),pts:l().optional()}),N(),{kind:"mutation"}),pullEncoded:S(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),M(lw)),flushEncode:S(d({sessionId:o(),nodeId:o().optional()}),M(lw),{kind:"mutation"}),listActiveSessions:S(N(),M(w7).readonly())}},Vh=d({userId:o(),username:o(),email:o().optional(),displayName:o().optional(),isAdmin:A().default(!1)}),C7={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:S(d({username:o(),password:o()}),Vh.nullable(),{kind:"mutation"}),getLoginUrl:S(d({state:o()}),o()),handleCallback:S(Y(o(),o()),Vh,{kind:"mutation"}),validateToken:S(d({token:o()}),Vh.nullable())},mount:{kind:"skip"}},A7=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()}),E7=d({id:o(),filename:o(),createdAt:l(),sizeBytes:l(),label:o().optional(),locations:M(o()).readonly()}),cw=d({id:o(),destinationId:o().optional(),label:o().optional(),createdAt:l(),sizeBytes:l(),locations:M(o()).optional()}),R7=d({path:o(),kind:O(["file","dir","symlink"]),sizeBytes:l(),mtime:l()}),_7=d({archiveVersion:V(1),createdAt:l(),dataDir:o(),locations:M(o()),entries:M(R7),totalBytes:l(),totalFiles:l()}),T7=d({name:o(),sizeBytes:l(),fileCount:l(),present:A()}),uw=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()}),I7={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:S(N(),M(A7).readonly(),{auth:"admin"}),trigger:S(d({destinations:M(o()).optional(),locations:M(o()).optional(),label:o().optional(),retentionCount:l().int().min(1).max(1e3).optional()}).optional(),M(cw).readonly(),{kind:"mutation",auth:"admin"}),list:S(N(),M(cw).readonly(),{auth:"admin"}),listLocations:S(N(),M(T7).readonly(),{auth:"admin"}),getEntries:S(d({destinationId:o(),backupId:o()}),_7.nullable(),{auth:"admin"}),restore:S(d({destinationId:o(),backupId:o(),locations:M(o()).optional()}),N(),{kind:"mutation",auth:"admin"}),delete:S(d({destinationId:o(),backupId:o()}),N(),{kind:"mutation",auth:"admin"}),listArchives:S(d({destinationId:o()}),M(E7).readonly(),{auth:"admin"}),upsertDestinationPolicy:S(d({locationId:o(),enabled:A(),retentionCount:l().int().min(1).max(1e3),label:o().optional(),cron:o().optional()}),N(),{kind:"mutation",auth:"admin"}),previewSchedule:S(d({cron:o(),count:l().int().min(1).max(20).optional()}),d({ok:A(),error:o().optional(),nextRuns:M(l()).readonly()})),listSchedules:S(N(),M(uw).readonly(),{auth:"admin"}),upsertSchedule:S(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()}),uw,{kind:"mutation",auth:"admin"}),deleteSchedule:S(d({id:o()}),N(),{kind:"mutation",auth:"admin"})}},N7=O(["connected","disconnected","connecting","auth-failed","unreachable","error"]),dw=d({id:o(),addonId:o(),name:o(),kind:o(),status:N7,info:Y(o(),ne()),lastCheckedAt:l().nullable(),error:o().nullable()}),pw=d({brokerCount:l().int().nonnegative(),connectedCount:l().int().nonnegative()}),O7=d({addonId:o(),kinds:M(d({kind:o(),label:o()}))}),j7=d({kind:o().optional()}),Td=d({id:o()}),P7=d({kind:o().min(1),name:o().min(1),id:o().min(1).optional(),settings:Y(o(),ne())}),D7=d({id:o()}),z7=d({id:o()}),L7=xt("ok",[d({ok:V(!0),latencyMs:l().nonnegative()}),d({ok:V(!1),error:o()})]),ap=Y(o(),ne()),q7=d({kind:o()}),B7=d({kind:o(),settings:ap}),U7=xt("ok",[d({ok:V(!0),latencyMs:l().nonnegative().optional()}).strict(),d({ok:V(!1),error:o()})]),F7=ne().nullable(),H7=d({brokerId:o(),target:Y(o(),ne()),payload:ne().optional()}),$7=d({brokerId:o(),filter:Y(o(),ne())}),Q7=d({subscriptionId:o()}),V7=d({brokerId:o(),subscriptionId:o()}),G7=d({brokerId:o(),key:o()}),Z7={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:pw,kind:"poll"},methods:{list:S(j7,M(dw)),get:S(Td,dw.nullable()),listProviders:S(N(),M(O7),{auth:"admin"}),add:S(P7,D7,{kind:"mutation",auth:"admin"}),remove:S(z7,N(),{kind:"mutation",auth:"admin"}),testConnection:S(Td,L7,{kind:"mutation",auth:"admin"}),getSettings:S(Td,ap.nullable(),{auth:"admin"}),setSettings:S(d({id:o(),settings:ap}),N(),{kind:"mutation",auth:"admin"}),getBrokerConfig:S(Td,ap.nullable(),{auth:"admin"}),getSettingsSchema:S(q7,F7,{auth:"admin"}),testSettings:S(B7,U7,{kind:"mutation",auth:"admin"}),publish:S(H7,ne(),{kind:"mutation",auth:"admin"}),subscribe:S($7,Q7,{kind:"mutation",auth:"admin"}),unsubscribe:S(V7,N(),{kind:"mutation",auth:"admin"}),getState:S(G7,ne().nullable()),getStatus:S(N(),pw)}},K7={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{}},W7=O(["webrtc","hls","mjpeg","rtsp"]),iR=O(["mp4","gif"]),Y7=d({kind:iR,handle:o(),nodeId:o(),mime:o(),bytes:l().int(),width:l().int(),height:l().int()}),X7=d({fromTs:l(),toTs:l(),packets:l().int()}),J7=d({media:M(Y7).readonly(),coverage:X7,profile:Cn,video:O(["copy","encode"])}),Rv=d({brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:d({width:l().int().positive(),height:l().int().positive()}).optional()}),e9=d({sessionId:o(),remoteAddr:o(),userAgent:o().nullish(),playing:A(),muted:A(),connectedAt:l(),lastRtpAt:l(),bytesSent:l()}),t9=d({tag:o(),subscribedAt:l(),maxFps:l(),framesDelivered:l(),framesDropped:l()}),n9=d({tag:o(),subscribedAt:l(),chunksDelivered:l()}),a9=O(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),_v=d({kind:a9,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:Y(o(),o()).optional()}).readonly(),i9=d({id:o(),channel:O(["annexb","rtp"]),attribution:_v,subscribedAt:l(),packetsDelivered:l()}),r9=d({rtsp:M(e9).readonly(),decoded:M(t9).readonly(),audio:M(n9).readonly(),encoded:M(i9).readonly(),pipeClients:l(),encodedSubscribers:l()});O(["reconnecting","sleeping","offline","disabled","waking"]);var o9=O(["h264","h265","copy"]),s9=O(["aac","opus","pcmu","copy","none"]),l9=d({deviceId:l().int().nonnegative(),video:o9,audio:s9.optional(),profile:Cn.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()}),c9=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()}),u9=LE.omit({inputArgs:!0,outputArgs:!0}),d9=O(["tight","relaxed"]),p9=d({deviceId:l().int().nonnegative(),source:xt("kind",[d({kind:V("profile"),profile:Cn}),d({kind:V("cam-stream"),camStreamId:o().min(1)})]),encode:u9,rateControl:d9.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()}),m9=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()}),f9={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{publishCameraStream:S(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1),kind:sb,url:o().optional(),codec:o().optional(),resolution:ol.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:Y(o(),ne()).optional(),sourceCamStreamId:o().min(1).optional(),encodeProfile:LE.optional()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:S(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1)}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:S(d({deviceId:l().int().nonnegative(),profile:Cn,camStreamId:o().min(1)}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:S(d({deviceId:l().int().nonnegative(),profile:Cn}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),renderPreBufferClip:S(d({deviceId:l(),profile:Cn.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:Cn,durationMs:l()}),{kind:"mutation",auth:"admin"}),produceEventMedia:S(d({deviceId:l(),profile:Cn.optional(),aroundMs:l(),preSeconds:l().min(0).max(20).default(4),postSeconds:l().min(0).max(20).default(6),kinds:M(iR).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)}),J7,{kind:"mutation",auth:"admin"}),fetchEventMedia:S(d({handle:o()}),d({base64:o(),mime:o(),bytes:l().int()}).nullable(),{kind:"mutation",auth:"admin"}),listAllCameraStreams:S(N(),M(wv).readonly()),listAllProfileSlots:S(N(),M(Mv).readonly()),getBrokerStats:S(d({brokerId:o()}),YL),probeStream:S(d({brokerId:o()}),d({probed:A(),summary:o()}),{kind:"mutation",auth:"admin"}),listClients:S(d({brokerId:o()}),r9),killClient:S(d({brokerId:o(),channel:O(["rtsp","decoded","audio"]),handle:o()}),d({killed:A()}),{kind:"mutation",auth:"admin"}),restartProfile:S(d({deviceId:l().int().nonnegative(),profile:Cn}),d({success:A()}),{kind:"mutation",auth:"admin"}),getStreamUrl:S(d({streamId:o(),format:W7}),d({url:o()})),getStreamWithCodec:S(l9,c9,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:S(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),acquireEgressTranscode:S(p9,m9,{kind:"mutation",auth:"admin"}),releaseEgressTranscode:S(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:S(ZL,KL,{kind:"mutation"}),pullAudioChunks:S(d({subscriptionId:o(),maxCount:l().int().positive().default(8)}),M(GL).readonly()),unsubscribeAudioChunks:S(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),subscribeFrames:S(QL,VL,{kind:"mutation"}),pullFrameHandles:S(d({subscriptionId:o(),maxCount:l().int().positive().default(4)}),M(Pr).readonly()),unsubscribeFrames:S(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),setPreBufferDuration:S(d({brokerId:o(),seconds:l().min(0).max(30)}),N(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:S(d({brokerId:o()}),d({configuredSec:l(),bufferedMs:l(),packetCount:l()})),getRtspPort:S(N(),l()),getAllRtspEntries:S(d({hostname:o().optional()}),M(Rv).readonly()),getRtspEntry:S(d({brokerId:o(),hostname:o().optional()}),Rv.nullable()),regenerateRtspToken:S(d({brokerId:o()}),o().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:S(d({brokerId:o(),enabled:A()}),N(),{kind:"mutation",auth:"admin"}),isRtspEnabled:S(d({brokerId:o()}),A()),getDeviceAudioMute:S(d({deviceId:l().int()}),d({muted:A(),appliedBrokers:l().int().nonnegative()})),setDeviceAudioMute:S(d({deviceId:l().int(),muted:A()}),d({muted:A(),appliedBrokers:l().int().nonnegative()}),{kind:"mutation",auth:"admin"})},events:{onCamStreamDemand:wo(d({deviceId:l().int().nonnegative(),camStreamId:o(),profile:Cn})),onCamStreamIdle:wo(d({deviceId:l().int().nonnegative(),camStreamId:o()})),onRequestStreamSourceRefresh:wo(d({deviceId:l().int().nonnegative(),camStreamId:o(),brokerId:o()}))}},mw=O(["h264","h265","hevc","av1","mjpeg","vp8","vp9"]),h9=d({acceptCodecs:M(mw).readonly().optional(),minHeight:l().int().positive().optional(),minWidth:l().int().positive().optional(),excludeDerived:A().optional(),requireSiblingCodec:M(mw).readonly().optional()}).readonly(),g9=d({preferredProviders:M(o()).readonly().optional(),resolutionPreference:O(["highest","lowest"]).optional()}).readonly(),v9=d({camStreamId:o(),codec:o().optional(),resolution:ol.optional(),reason:o()}),y9={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],methods:{getCameraStreams:S(d({deviceId:l().int().nonnegative()}),M(wv).readonly()),getBrokerStreams:S(d({deviceId:l().int().nonnegative()}),M(Mv).readonly()),getRtspEntries:S(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),M(Rv).readonly()),getProfileRtspEntries:S(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),M(XL).readonly()),pickStream:S(d({deviceId:l().int().nonnegative(),requirements:h9,preferences:g9.optional()}),v9.nullable())},events:{onCamStreamsChanged:wo(d({deviceId:l().int().nonnegative(),camStreams:M(wv).readonly()})),onProfileSlotsChanged:wo(d({deviceId:l().int().nonnegative(),profileSlots:M(Mv).readonly()}))},runtimeState:d({online:A(),slotStatuses:d({high:tp.optional(),mid:tp.optional(),low:tp.optional()}),slotErrors:d({high:o().optional(),mid:o().optional(),low:o().optional()}),lastChangedAt:l()}),durability:"session"},b9=it([V("hub"),o().min(1)]),S9=O(["stopped","starting","running","failed"]),Tv=d({name:o().min(1).max(120),code:o().max(2e5),enabled:A(),placement:b9,integrationId:o().optional()}),Ms=Tv.extend({id:o(),createdAt:l(),updatedAt:l(),createdBy:o(),status:S9,lastError:o().optional(),lastChangedAt:l()}),x9=d({ok:A(),error:o().optional(),line:l().optional(),column:l().optional()}),k9={name:"core-blocks",scope:"system",mode:"singleton",methods:{list:S(d({}),d({blocks:M(Ms)}),{auth:"admin"}),get:S(d({blockId:o()}),d({block:Ms.nullable()}),{auth:"admin"}),create:S(d({block:Tv}),d({block:Ms}),{kind:"mutation",auth:"admin",caller:"required"}),update:S(d({blockId:o(),block:Tv.partial()}),d({block:Ms}),{kind:"mutation",auth:"admin",caller:"required"}),delete:S(d({blockId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setEnabled:S(d({blockId:o(),enabled:A()}),d({block:Ms}),{kind:"mutation",auth:"admin"}),restart:S(d({blockId:o()}),d({block:Ms}),{kind:"mutation",auth:"admin"}),compile:S(d({code:o()}),x9,{kind:"mutation",auth:"admin"}),getTypeDefs:S(d({}),d({libs:M(d({filePath:o(),content:o()}))}),{auth:"admin"})}},w9=d({stepId:o(),entry:mb}),M9={name:"custom-model-registry",scope:"system",mode:"collection",internal:!0,methods:{listModels:S(N(),M(w9).readonly(),{auth:"admin"})}},Tr=d({where:Y(o(),ne()).optional(),whereIn:Y(o(),M(ne())).optional(),whereBetween:Y(o(),Zc([ne(),ne()])).optional(),whereNot:Y(o(),ne()).optional(),orderBy:d({field:o(),direction:O(["asc","desc"])}).optional(),limit:l().optional(),offset:l().optional()}),Op=d({where:Y(o(),ne()).optional(),whereIn:Y(o(),M(ne())).optional(),whereBetween:Y(o(),Zc([ne(),ne()])).optional(),whereNot:Y(o(),ne()).optional()}),rR=d({as:o().min(1),field:o().min(1),op:O(["sum","min","max"])}),oR=d({count:l().int(),values:Y(o(),l().nullable())}),jp=d({id:o(),data:Y(o(),ne())}),sR=d({id:o().optional(),data:Y(o(),ne())}),lR=d({name:o(),type:O(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:A().optional(),notNull:A().optional(),unique:A().optional(),defaultValue:it([o(),l(),A()]).optional()}),cR=d({name:o(),columns:M(o()).readonly(),unique:A().optional()}),C9={name:"settings-store",scope:"system",mode:"singleton",methods:{get:S(d({namespace:o().optional(),collection:o(),key:o()}),ne()),set:S(d({namespace:o().optional(),collection:o(),key:o(),value:ne()}),N(),{kind:"mutation"}),query:S(d({namespace:o().optional(),collection:o(),filter:Tr.optional(),columns:M(o()).readonly().optional()}),M(jp).readonly()),insert:S(d({namespace:o().optional(),collection:o(),record:jp}),N(),{kind:"mutation"}),insertMany:S(d({namespace:o().optional(),collection:o(),records:M(sR).readonly()}),d({inserted:l().int()}),{kind:"mutation"}),update:S(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),ne())}),N(),{kind:"mutation"}),delete:S(d({namespace:o().optional(),collection:o(),key:o()}),N(),{kind:"mutation"}),deleteWhere:S(d({namespace:o().optional(),collection:o(),filter:Op}),d({deleted:l().int()}),{kind:"mutation"}),updateWhere:S(d({namespace:o().optional(),collection:o(),filter:Op,data:Y(o(),ne())}),d({updated:l().int()}),{kind:"mutation"}),count:S(d({namespace:o().optional(),collection:o(),filter:Tr.optional()}),l()),aggregate:S(d({namespace:o().optional(),collection:o(),fields:M(rR).readonly(),filter:Tr.optional()}),oR),histogram:S(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:Tr.optional()}),M(d({bucket:l().int(),count:l().int()})).readonly()),isEmpty:S(d({namespace:o().optional(),collection:o()}),A()),declareCollection:S(d({namespace:o().optional(),collection:o(),columns:M(lR).readonly(),indexes:M(cR).readonly().optional()}),N(),{kind:"mutation"})}},A9=d({engineId:o(),kind:O(["relational","vector"]),displayName:o()}),E9={name:"data-store-provider",scope:"system",mode:"collection",internal:!0,methods:{getEngineInfo:S(N(),A9,{auth:"admin"}),get:S(d({namespace:o().optional(),collection:o(),key:o()}),ne(),{auth:"admin"}),set:S(d({namespace:o().optional(),collection:o(),key:o(),value:ne()}),N(),{kind:"mutation",auth:"admin"}),query:S(d({namespace:o().optional(),collection:o(),filter:Tr.optional(),columns:M(o()).readonly().optional()}),M(jp).readonly(),{auth:"admin"}),insert:S(d({namespace:o().optional(),collection:o(),record:jp}),N(),{kind:"mutation",auth:"admin"}),insertMany:S(d({namespace:o().optional(),collection:o(),records:M(sR).readonly()}),d({inserted:l().int()}),{kind:"mutation",auth:"admin"}),update:S(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),ne())}),N(),{kind:"mutation",auth:"admin"}),delete:S(d({namespace:o().optional(),collection:o(),key:o()}),N(),{kind:"mutation",auth:"admin"}),deleteWhere:S(d({namespace:o().optional(),collection:o(),filter:Op}),d({deleted:l().int()}),{kind:"mutation",auth:"admin"}),updateWhere:S(d({namespace:o().optional(),collection:o(),filter:Op,data:Y(o(),ne())}),d({updated:l().int()}),{kind:"mutation",auth:"admin"}),count:S(d({namespace:o().optional(),collection:o(),filter:Tr.optional()}),l(),{auth:"admin"}),aggregate:S(d({namespace:o().optional(),collection:o(),fields:M(rR).readonly(),filter:Tr.optional()}),oR,{auth:"admin"}),histogram:S(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:Tr.optional()}),M(d({bucket:l().int(),count:l().int()})).readonly(),{auth:"admin"}),isEmpty:S(d({namespace:o().optional(),collection:o()}),A(),{auth:"admin"}),declareCollection:S(d({namespace:o().optional(),collection:o(),columns:M(lR).readonly(),indexes:M(cR).readonly().optional()}),N(),{kind:"mutation",auth:"admin"})}},R9=d({sessionId:o(),slotCount:l().int(),slotByteLength:l().int(),segmentBytes:l().int(),budgetMb:l().int(),framesWritten:l().int(),getFrameHits:l().int(),getFrameMisses:l().int()}),_9={name:"decoder",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{supportsCodec:S(d({codec:o()}),A()),getInfo:S(N(),d({id:o(),name:o(),isPullMode:A().optional(),priority:l().optional(),hwaccel:o().optional(),probedBestHwaccel:o().optional()})),createSession:S(nw,d({sessionId:o(),nodeId:o()})),destroySession:S(d({sessionId:o()}),N()),pushPacket:S(d({sessionId:o(),packet:HL}),N()),openStream:S(d({sessionId:o(),url:o()}),N()),pullFrames:S(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),M(Zk)),pullHandles:S(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),M(Pr)),getFrame:S(d({handle:Pr}),Zk.nullable()),getShmStats:S(d({sessionId:o()}),R9.nullable()),updateConfig:S(d({sessionId:o(),config:nw.partial()}),N()),getStats:S(d({sessionId:o()}),gq),listActiveSessions:S(N(),M(d({sessionId:o(),codec:o(),outputFormat:o(),createdAtMs:l()})).readonly()),reprobeHwaccel:S(N(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},T9={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{}},Yc=d({id:o(),system:o(),uniqueId:o().optional(),raw:Y(o(),ne()).optional()}),I9=O(["online","sleeping","offline","unknown"]),Ks=Kc(()=>d({childNativeId:o(),name:o(),type:O(Q),status:I9,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:Yc.optional(),children:M(Ks).readonly().optional()})),fw=d({discovered:M(Ks),lastDiscoveryAt:l().int().nonnegative().nullable(),lastError:o().nullable()}),N9={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Hub],status:{schema:fw,kind:"poll"},runtimeState:fw.extend({lastFetchedAt:l().int().nonnegative()}),durability:"session",methods:{listDiscovered:S(d({deviceId:l().int().nonnegative()}),M(Ks).readonly()),refreshDiscovery:S(d({deviceId:l().int().nonnegative()}),M(Ks).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:S(d({deviceId:l().int().nonnegative(),childNativeId:o(),name:o().optional()}),d({deviceId:l().int().nonnegative(),stableId:o()}),{kind:"mutation",auth:"admin"}),releaseDevice:S(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})}},uR=d({id:o(),label:o(),isDefault:A().optional()}),O9=d({search:o().optional(),area:o().optional(),manufacturer:o().optional(),adoptedOnly:A().optional(),unadoptedOnly:A().optional()}),dR=d({integrationId:o(),page:l().int().positive().default(1),pageSize:l().int().positive().max(2e4).default(50),filter:o().optional(),filterText:O9.optional()}),pR=d({candidates:M(Ks).readonly(),totalCount:l().int().nonnegative(),page:l().int().positive(),pageSize:l().int().positive()}),j9=d({integrationId:o(),childNativeId:o()}),Iv=d({lastDiscoveryAt:l().int().nonnegative().nullable(),candidateCount:l().int().nonnegative(),adoptedCount:l().int().nonnegative(),lastError:o().nullable()}),P9=d({name:o().min(1).optional(),hiddenChildIds:M(o()).optional()}),Nv=d({integrationId:o(),childNativeIds:M(o()).min(1),filter:o().optional(),importLocations:A().optional(),perCandidate:Y(o(),P9).optional()}),mR=d({adopted:M(d({childNativeId:o(),parentDeviceId:l().int().nonnegative(),accessoryDeviceIds:M(l().int().nonnegative()).readonly()})).readonly()}),fR=d({integrationId:o(),camDeviceId:l().int().nonnegative()}),hR=d({camDeviceId:l().int().nonnegative(),resetToSource:A().optional()}),gR=d({changed:A(),rebuiltChildren:l().int().nonnegative(),removedChildren:l().int().nonnegative().optional()}),D9={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:Iv,kind:"poll"},methods:{listCandidateFilters:S(d({integrationId:o()}),d({filters:M(uR)}),{auth:"admin"}),listCandidates:S(dR,pR,{auth:"admin"}),getCandidate:S(j9,Ks.nullable(),{auth:"admin"}),refresh:S(d({integrationId:o()}),Iv,{kind:"mutation",auth:"admin"}),adopt:S(Nv,mR,{kind:"mutation",auth:"admin"}),release:S(fR,N(),{kind:"mutation",auth:"admin"}),resync:S(hR,gR,{kind:"mutation",auth:"admin"})}},z9=O(["unlinked","linked","error"]),L9=d({label:o(),value:o(),secret:A().optional()}),q9=d({qr:o().optional(),fields:M(L9).readonly().optional(),note:o().optional()}),hw=d({linkState:z9,exposedDeviceCount:l(),error:o().optional(),setup:q9.optional()}),B9=o(),U9=d({deviceId:o(),exposedAs:o().optional(),capabilities:M(o()).optional()}),F9=d({deviceId:o(),capabilities:M(o()).optional()}),H9=d({deviceId:o()}),$9={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:hw,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:S(N(),hw),listSupportedDeviceKinds:S(N(),M(B9)),listExposedDevices:S(N(),M(U9)),exposeDevice:S(F9,N(),{kind:"mutation"}),unexposeDevice:S(H9,N(),{kind:"mutation"})}},Q9=d({connected:A(),deviceCount:l(),error:o().optional()});d({externalId:o(),name:o(),type:o(),metadata:Y(o(),ne()).optional()});var js=d({stableId:o(),type:O(Q),suggestedName:o(),prefilledConfig:Y(o(),ne()),sourceInfo:Yc.optional()}),Pp=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),parentDeviceId:l().nullable(),online:A(),features:M(o()),config:Y(o(),ne()),sourceInfo:Yc.optional()}),Ov=d({status:O(["ok","error"]),labels:M(o()).optional(),error:o().optional()}),gw=ne(),V9={name:"device-provider",scope:"system",mode:"collection",methods:{start:S(N(),N(),{kind:"mutation"}),stop:S(N(),N(),{kind:"mutation"}),getStatus:S(N(),Q9),getDevices:S(N(),M(d({id:o(),name:o(),type:o()}))),supportsDiscovery:S(d({}),A()),discoverDevices:S(d({params:Y(o(),ne()).optional()}),M(js),{kind:"mutation",auth:"admin"}),getDiscoveryParamsSchema:S(d({}),gw),getManualCreationType:S(d({}),d({deviceType:O(Q).nullable()})),adoptDiscoveredDevice:S(d({candidate:js}),Pp,{kind:"mutation",auth:"admin"}),supportsManualCreation:S(d({}),A()),getChildCreationSchema:S(d({type:O(Q)}),gw),createDevice:S(d({type:O(Q),config:Y(o(),ne())}),Pp,{kind:"mutation",auth:"admin"}),testCreationField:S(d({type:O(Q),key:o(),value:ne(),formValues:Y(o(),ne()).optional()}),Ov,{kind:"mutation",auth:"admin"})}},gb=d({childKey:o(),section:o(),order:l().optional(),collapsed:A().optional()}),G9=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional()}),vb=d({icon:o().min(1).optional(),label:o().min(1).optional(),unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),hidden:A().optional(),perCap:Y(o(),G9).optional()}),vw=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),icon:o().min(1).optional()}),Id=d({id:l(),stableId:o(),addonId:o(),type:O(Q),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:Y(o(),ne()),metadata:Y(o(),ne()).nullable().optional(),sourceInfo:Yc.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:M(gb).readonly().optional(),display:vb.optional()}),Z9=d({key:o(),value:ne(),description:o().optional()}),vR=O(["auto","manual"]),yR=d({deviceId:l(),name:o(),location:o().nullable(),features:M(o()),producesTrackedEvents:A().optional()}),K9=d({deviceId:l(),mode:vR,devices:M(yR)}),Gh=d({deviceId:l(),entries:M(d({capName:o(),kind:O(["native","wrapped"]),providerAddonId:o(),providerNodeId:o(),nativeAddonId:o()}))}),W9=d({id:l(),stableId:o(),type:o(),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional()}),Y9=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),userNamed:A().optional(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),metadata:Y(o(),ne()).nullable().optional(),sourceInfo:Yc.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:M(gb).readonly().optional(),role:o().nullable().optional(),display:vb.optional()}),X9=ne().nullable(),J9=d({streamId:o(),width:l().optional(),height:l().optional(),codec:o().optional(),fps:l().optional(),bitrateKbps:l().optional()}),eB=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:Y(o(),ne())}),tB=d({deviceId:l()}),nB=d({deviceId:l(),data:Y(o(),ne())}),aB={name:"device-manager",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{allocateDeviceId:S(d({addonId:o(),stableId:o()}),d({id:l()}),{kind:"mutation"}),registerDevice:S(eB,N(),{kind:"mutation"}),removeDevice:S(tB,N(),{kind:"mutation"}),persistConfig:S(nB,N(),{kind:"mutation"}),loadConfig:S(d({deviceId:l()}),Y(o(),ne())),loadRuntimeState:S(d({deviceId:l()}),Y(o(),ne())),loadMeta:S(d({deviceId:l()}),Y9.nullable()),setName:S(d({deviceId:l(),name:o()}),N(),{kind:"mutation",auth:"admin"}),setLocation:S(d({deviceId:l(),location:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),setType:S(d({deviceId:l(),type:O(Q)}),N(),{kind:"mutation",auth:"admin"}),setIntegrationId:S(d({deviceId:l(),integrationId:o()}),N(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:S(d({deviceId:l(),linkDeviceId:l().nullable()}),N(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:S(d({deviceId:l(),primaryChildEntityId:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),setChildLayout:S(d({deviceId:l(),childLayout:M(gb).readonly()}),N(),{kind:"mutation",auth:"admin"}),setDisplay:S(d({deviceId:l(),display:vb.nullable()}),N(),{kind:"mutation",auth:"admin"}),getRoleDisplayDefaults:S(d({}),d({defaults:Y(o(),vw)}),{kind:"query"}),setRoleDisplayDefaults:S(d({defaults:Y(o(),vw)}),N(),{kind:"mutation",auth:"admin"}),getWireableFields:S(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:S(d({deviceId:l(),role:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),applyInitialMeta:S(d({deviceId:l(),name:o().optional(),location:o().nullable().optional(),type:O(Q).optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),role:o().nullable().optional()}),N(),{kind:"mutation",auth:"admin"}),setMetadata:S(d({deviceId:l(),patch:Y(o(),ne())}),N(),{kind:"mutation",auth:"admin"}),listLocations:S(N(),M(o())),addLocation:S(d({name:o()}),N(),{kind:"mutation",auth:"admin"}),removeLocation:S(d({name:o(),cascade:A().optional()}),N(),{kind:"mutation",auth:"admin"}),renameLocation:S(d({from:o(),to:o()}),d({moved:l()}),{kind:"mutation",auth:"admin"}),setDisabled:S(d({deviceId:l(),disabled:A()}),N(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:S(d({addonId:o()}),M(W9)),listAll:S(d({addonId:o().optional(),projection:O(["full","slim"]).optional(),isCamera:A().optional(),deviceIds:M(l()).optional()}),M(Id)),getDevice:S(d({deviceId:l()}),Id.nullable()),getChildren:S(d({parentDeviceId:l()}),M(Id)),getChildrenBatch:S(d({parentDeviceIds:M(l()).max(256)}),Y(o(),M(Id))),getLinkedDevices:S(d({deviceId:l()}),d({mode:vR,devices:M(yR)})),getLinkedDevicesBatch:S(d({deviceIds:M(l())}),M(K9)),getStreamSources:S(d({deviceId:l()}),M(FL)),getConfigSchema:S(d({deviceId:l()}),M(Z9)),getSettingsSchema:S(d({deviceId:l()}),X9),updateConfig:S(d({deviceId:l(),values:Y(o(),ne())}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),enable:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),disable:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),remove:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:S(d({integrationId:o()}),d({removed:l()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:S(d({deviceId:l()}),Y(o(),o().nullable())),setStreamProfileMap:S(d({deviceId:l(),profileMap:Y(o(),o().nullable())}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:S(d({deviceId:l()}),M(J9),{kind:"mutation",auth:"admin"}),getBindings:S(d({deviceId:l()}),Gh),getBindingsBatch:S(d({deviceIds:M(l())}),M(Gh)),getAllBindings:S(d({}),M(Gh)),setWrapperActive:S(d({deviceId:l(),capName:o(),wrapperAddonId:o(),active:A()}),N(),{kind:"mutation",auth:"admin"}),listWrappersForCap:S(d({capName:o()}),M(o())),listBindableCapsForDeviceType:S(d({deviceType:o()}),M(d({capName:o(),wrappers:M(o())}))),getDeviceSettingsAggregate:S(d({deviceId:l()}),bo.nullable()),getDeviceLiveInfoAggregate:S(d({deviceId:l()}),bo.nullable()),getDeviceAggregate:S(d({deviceId:l()}),d({settings:bo.nullable(),live:bo.nullable()})),runDeviceAction:S(d({deviceId:l().int().nonnegative(),action:o().min(1),input:ne()}),ne(),{kind:"mutation"}),updateDeviceField:S(d({deviceId:l(),writerCapName:o(),writerAddonId:o(),key:o(),value:ne()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:S(d({deviceId:l(),changes:M(d({writerCapName:o(),writerAddonId:o(),key:o(),value:ne()}))}),d({success:V(!0),failures:M(d({writerCapName:o(),writerAddonId:o(),error:o()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:S(d({addonId:o()}),M(js),{kind:"mutation",auth:"admin"}),adoptDevice:S(d({addonId:o(),candidate:js,integrationId:o().optional()}),Pp,{kind:"mutation",auth:"admin"}),getCreationSchema:S(d({addonId:o(),type:O(Q)}),ne().nullable()),createDevice:S(d({addonId:o(),type:O(Q),config:Y(o(),ne()),integrationId:o().optional()}),Pp,{kind:"mutation",auth:"admin"}),testCreationField:S(d({addonId:o(),type:O(Q),key:o(),value:ne(),formValues:Y(o(),ne()).optional()}),Ov,{kind:"mutation",auth:"admin"}),adoptionListCandidateFilters:S(d({addonId:o(),integrationId:o()}),d({filters:M(uR)}),{auth:"admin"}),adoptionListCandidates:S(dR.extend({addonId:o()}),pR,{auth:"admin"}),adoptionRefresh:S(d({addonId:o(),integrationId:o()}),Iv,{kind:"mutation",auth:"admin"}),adoptionAdopt:S(Nv.extend({addonId:o()}),mR,{kind:"mutation",auth:"admin"}),adoptionRelease:S(fR.extend({addonId:o()}),N(),{kind:"mutation",auth:"admin"}),adoptionStartJob:S(Nv.extend({addonId:o()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),adoptionListJobs:S(d({addonId:o(),integrationId:o().optional()}),M(w8).readonly(),{auth:"admin"}),adoptionCancelJob:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),adoptionResync:S(hR,gR,{kind:"mutation",auth:"admin"}),discoveryProviders:S(d({}),d({providers:M(d({addonId:o(),label:o()})).readonly()}),{auth:"admin"}),discoverAllProviders:S(d({}),d({groups:M(d({addonId:o(),label:o(),candidates:M(js).readonly(),error:o().nullable()})).readonly()}),{kind:"mutation",auth:"admin"}),discoverProvider:S(d({addonId:o(),params:Y(o(),ne()).optional()}),d({candidates:M(js).readonly()}),{kind:"mutation",auth:"admin"}),providerCreationType:S(d({addonId:o()}),d({deviceType:O(Q).nullable()}),{auth:"admin"}),providerDiscoveryParamsSchema:S(d({addonId:o()}),ne(),{auth:"admin"}),testField:S(d({deviceId:l(),key:o(),value:ne()}),Ov,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:S(d({deviceId:l(),caps:M(o()).readonly().optional()}),Y(o(),ne().nullable())),getDeviceStatusAggregateBatch:S(d({deviceIds:M(l()).readonly(),caps:M(o()).readonly().optional()}),Y(o(),Y(o(),ne().nullable())))}},iB={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:S(d({deviceId:l()}),Y(o(),Y(o(),ne()))),getCapSlice:S(d({deviceId:l(),capName:o()}),Y(o(),ne()).nullable()),getAllSnapshots:S(d({}),Y(o(),Y(o(),Y(o(),ne())))),setCapSlice:S(d({deviceId:l(),capName:o(),slice:Y(o(),ne())}),N(),{kind:"mutation"})},events:{onChanged:wo(d({deviceId:l(),capName:o(),slice:Y(o(),ne())}))}},yw=d({embedding:M(l()),inferenceMs:l()}),rB=d({modelId:o(),embeddingDim:l(),ready:A()}),oB={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:S(d({crop:Ut(Uint8Array),width:l(),height:l()}),yw,{auth:"admin"}),encodeText:S(d({text:o()}),yw,{auth:"admin"}),getInfo:S(N(),rB,{auth:"admin"})}},sB=d({reason:o(),count:l().int().nonnegative()}),bR=d({family:o(),deviceId:l().int().positive(),variant:o().optional(),sinceMs:l(),atMs:l(),attempts:l().int().nonnegative(),succeeded:l().int().nonnegative(),reasons:M(sB).readonly()}),lB={name:"failure-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:S(N(),M(bR).readonly())},mount:{kind:"skip"}},cB=d({name:o(),path:o()}),uB=d({path:o(),entries:M(cB).readonly(),freeBytes:l(),totalBytes:l()}),dB={name:"filesystem-browse",scope:"system",mode:"singleton",internal:!0,methods:{listAllowedRoots:S(N(),M(o()).readonly(),{auth:"admin"}),browse:S(d({path:o()}),uB,{auth:"admin"}),createDir:S(d({path:o()}),d({path:o()}),{kind:"mutation",auth:"admin"})}},pB=d({inputTokens:l(),outputTokens:l()}),mB=O(["timeout","rate-limited","auth","refusal","bad-request","unavailable","no-profile","budget-exceeded","adapter-error"]),fB=d({ok:V(!0),text:o(),model:o(),usage:pB,truncated:A(),latencyMs:l()}),hB=d({ok:V(!1),code:mB,message:o(),retryAfterMs:l().optional()}),ip=xt("ok",[fB,hB]),SR=d({bytes:Ut(Uint8Array),mimeType:o()}),xR=d({enabled:A().default(!1),maxAttempts:l().int().min(1).max(5).default(1)}),yb=d({addonId:o().optional(),profileId:o().optional(),consumer:o(),system:o().optional(),prompt:o(),jsonSchema:Y(o(),ne()).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:xR.optional(),requestId:o().optional()}),gB=d({url:o(),filename:o(),sizeBytes:l(),sha256:o().optional()}),mm=xt("kind",[d({kind:V("catalog"),catalogId:o()}),d({kind:V("url"),url:o(),sha256:o().optional(),label:o().optional(),sizeBytes:l().optional(),extraFiles:M(gB).optional()}),d({kind:V("path"),path:o()})]),bb=d({nodeId:o(),engine:O(["llama-cpp"]),model:mm,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)}),vB=d({phase:O(["downloading","verifying"]),file:o(),fileIndex:l().int(),fileCount:l().int(),downloadedBytes:l(),totalBytes:l().optional()}),Ic=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:vB.optional(),lastError:o().optional(),crashesInWindow:l(),memoryBytes:l().optional(),vramBytes:l().optional()}),kR=d({file:o(),sizeBytes:l(),catalogId:o().optional(),installedAt:l().optional(),path:o().optional()}),wR=d({nodeId:o(),modelsBytes:l(),freeBytes:l().optional()}),yB=yb.extend({images:M(SR).optional(),runtime:bb,timeoutMs:l().int().positive().optional()}),bB={name:"llm-runtime",scope:"system",mode:"singleton",internal:!0,methods:{complete:S(yB,ip,{kind:"mutation",auth:"admin"}),ensureStarted:S(d({runtime:bb}),Ic,{kind:"mutation",auth:"admin"}),stop:S(d({}),N(),{kind:"mutation",auth:"admin"}),status:S(d({}),Ic,{auth:"admin"}),installModel:S(d({model:mm}),N(),{kind:"mutation",auth:"admin"}),deleteModel:S(d({file:o()}),N(),{kind:"mutation",auth:"admin"}),listLocalModels:S(d({}),M(kR),{auth:"admin"}),getDiskUsage:S(d({}),wR,{auth:"admin"})}},MR=O(["openai-compatible","openai","anthropic","google","managed-local"]),Zh=d({id:o(),name:o(),kind:MR,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:xR.default({enabled:!1,maxAttempts:1}),toolsEnabled:A().default(!1),extraHeaders:Y(o(),o()).optional(),runtime:bb.optional()}),SB=ne(),xB=d({kind:MR,label:o(),icon:o(),addonId:o(),configSchema:SB}),CR=it([d({consumer:o()}),d({purpose:O(["text","vision"])})]),kB=d({selector:CR,profileId:o()}),wB=d({day:o(),consumer:o(),profileId:o(),calls:l(),okCalls:l(),errorCalls:l(),inputTokens:l(),outputTokens:l(),avgLatencyMs:l()}),MB=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()}),CB=xt("ok",[d({ok:V(!0),model:mm,label:o(),repo:o(),quantization:o(),purpose:O(["text","vision"]),totalBytes:l(),extraFilenames:M(o())}),d({ok:V(!1),code:o(),message:o(),candidates:M(o()).optional(),requiredBytes:l().optional()})]),AB=d({nodeId:o(),reachable:A(),status:Ic.optional(),disk:wR.optional(),error:o().optional()}),EB=yb.extend({images:M(SR).min(1)}),Cs=d({addonId:o(),profileId:o()}),RB={name:"llm",scope:"system",mode:"collection",internal:!1,providerKind:"ai",nodeIdMode:"data",methods:{generate:S(yb,ip,{kind:"mutation"}),generateVision:S(EB,ip,{kind:"mutation"}),cancel:S(d({addonId:o().optional(),requestId:o()}),N(),{kind:"mutation"}),listProfileKinds:S(d({}),M(xB)),listProfiles:S(d({}),M(Zh)),upsertProfile:S(d({profile:Zh}),Zh,{kind:"mutation",auth:"admin"}),deleteProfile:S(Cs,N(),{kind:"mutation",auth:"admin"}),testProfile:S(Cs,ip,{kind:"mutation",auth:"admin"}),listModels:S(Cs,M(o())),getDefaults:S(d({}),M(kB)),setDefault:S(d({selector:CR,profileId:o().nullable()}),N(),{kind:"mutation",auth:"admin"}),getUsage:S(d({since:l().optional(),until:l().optional(),consumer:o().optional(),profileId:o().optional()}),M(wB)),listModelCatalog:S(d({}),M(MB)),listRuntimeNodes:S(d({}),M(AB)),listNodeModels:S(d({nodeId:o()}),M(kR)),resolveModelRef:S(d({ref:o(),maxBytes:l().positive().optional()}),CB,{kind:"mutation",auth:"admin"}),installModel:S(d({nodeId:o(),model:mm}),N(),{kind:"mutation",auth:"admin"}),deleteModel:S(d({nodeId:o(),file:o()}),N(),{kind:"mutation",auth:"admin"}),getRuntimeStatus:S(Cs,Ic),startRuntime:S(Cs,Ic,{kind:"mutation",auth:"admin"}),stopRuntime:S(Cs,N(),{kind:"mutation",auth:"admin"})}},_B=["decode","transcode","recording","streaming","detection"],TB=["measured","accounted","unattributable"],AR=d({role:O(_B),deviceId:l().int().positive().nullable(),attribution:O(TB),unit:o(),pid:l().int().positive().optional(),startedAtMs:l().optional(),cpuSeconds:l().optional(),rssBytes:l().optional()}),IB={name:"load-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:S(N(),M(AR).readonly())},mount:{kind:"skip"}},NB=d({armed:l().int().min(0),unknown:M(o()).readonly()}),OB={name:"log-channels",scope:"system",mode:"collection",internal:!0,methods:{list:S(N(),M(qE).readonly()),apply:S(d({windows:M(R8).readonly()}),NB,{kind:"mutation"})},mount:{kind:"skip"}},ER=O(["debug","info","warn","error"]),bw=d({timestamp:Sv(),level:ER,scope:M(o()),message:o(),meta:Y(o(),ne()).optional(),tags:Y(o(),o()).optional()}),jB={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:S(bw,N(),{kind:"mutation"}),query:S(d({scope:M(o()).optional(),level:ER.optional(),since:Sv().optional(),until:Sv().optional(),limit:l().optional(),tags:Y(o(),o()).optional()}),M(bw).readonly())},mount:{kind:"skip"}},Sb=O(["primary","second-factor"]),PB=d({kind:V("redirect"),id:o(),label:o(),icon:o().optional(),startUrl:o(),stage:Sb}),DB=d({kind:V("widget"),id:o(),addonId:o(),bundle:o(),remote:nR,stage:Sb}),zB=d({kind:V("passkey"),id:o(),label:o(),stage:Sb,rpId:o(),origin:o().nullable()}),LB=xt("kind",[PB,DB,zB]),qB={name:"login-method",scope:"system",mode:"collection",internal:!0,methods:{getLoginMethods:S(N(),M(LB).readonly())},mount:{kind:"skip"}},BB=d({total:l(),user:l(),system:l(),irq:l(),nice:l(),loadAvg:Zc([l(),l(),l()]),cores:l()}),UB=d({percent:l(),totalBytes:l(),usedBytes:l(),availableBytes:l(),swapUsedBytes:l(),swapTotalBytes:l()}),FB=d({readBytes:l(),writeBytes:l(),readOps:l(),writeOps:l(),timestampMs:l()}),HB=d({rxBytes:l(),txBytes:l(),rxPackets:l(),txPackets:l(),rxErrors:l(),txErrors:l(),timestampMs:l()}),RR=d({utilization:l(),model:o(),memoryUsedBytes:l(),memoryTotalBytes:l(),temperature:l().nullable()}),$B=d({openFds:l(),threadCount:l(),activeHandles:l(),activeRequests:l()}),Sw=d({avg10:l(),avg60:l(),avg300:l()}),Kh=d({some:Sw,full:Sw.nullable()}),xw=d({cpu:BB,memory:UB,gpu:RR.nullable(),network:HB,disk:FB,pressure:d({cpu:Kh.nullable(),memory:Kh.nullable(),io:Kh.nullable()}),process:$B,cpuTemperature:l().nullable(),timestampMs:l()}),QB=d({path:o(),totalBytes:l(),usedBytes:l(),availableBytes:l(),percent:l()}),kw=d({pid:l(),cpu:l(),memory:l(),privateBytes:l().optional(),sharedBytes:l().optional()}),VB=d({addonId:o(),nodeId:o(),role:O(["hub","worker"]),pid:l(),state:O(["starting","running","stopping","stopped","crashed"]),uptimeSec:l()}),GB=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()}),ZB=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()}),KB=d({addonId:o()}),WB=d({success:A(),path:o().optional(),pid:l().optional(),reason:o().optional()}),YB=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()}),XB=d({key:o(),kind:O(["addon","root","unattributed"]),points:M(YB).readonly()}),JB=d({nodeId:o(),series:M(XB).readonly(),containerMemory:M(ZB).readonly(),bucketMs:l(),retainedSamples:l(),oldestAtMs:l().nullable(),cadenceMs:l(),durable:A()}),eU=d({forNodeId:o(),sinceMs:l().optional(),maxPoints:l().int().positive().optional()}),tU=d({cpuPercent:l(),memoryPercent:l(),memoryUsedMB:l(),memoryTotalMB:l(),diskPercent:l().optional(),temperature:l().optional(),gpuPercent:l().optional(),gpuMemoryPercent:l().optional()}),nU={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:S(N(),xw),getCached:S(N(),xw.nullable()),getCurrent:S(N(),tU),getDiskSpace:S(d({dirPath:o()}),QB),getGpuInfo:S(N(),RR.nullable()),getCpuTemperature:S(N(),l().nullable()),getProcessStats:S(d({pids:M(l())}),M(kw)),listAddonInstances:S(N(),M(VB).readonly()),getAddonStats:S(d({addonId:o()}),kw.nullable()),listNodeProcesses:S(N(),M(GB).readonly()),getLoadSeries:S(eU,JB),dumpHeapSnapshot:S(KB,WB,{kind:"mutation",auth:"admin"})}},aU=d({sourceUrl:o(),metadata:xq,targets:M(Sq).min(1).readonly(),calibrationRef:o().optional(),sessionId:o().optional()}),iU={name:"model-convert",scope:"system",mode:"singleton",internal:!0,methods:{convert:S(aU,wq,{kind:"mutation",auth:"admin",timeoutMs:6e5})}},rU=d({nodeId:o(),modelId:o(),format:O(dm),entry:mb}),oU=d({ok:A(),sha256:o(),bytes:l(),path:o()}),sU={name:"model-distributor",scope:"system",mode:"singleton",internal:!0,methods:{distributeModel:S(rU,oU,{kind:"mutation",auth:"admin"})}},Dp=d({bbox:Zi,pixelCount:l(),intensity:l()}),lU=d({detected:A(),regionCount:l(),regions:M(Dp).readonly(),rawRegions:M(Dp).readonly(),frameWidth:l(),frameHeight:l(),analysisMs:l()}),cU={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{analyze:S(d({deviceId:l(),frame:Av.optional(),frameHandle:Pr.optional()}),lU,{kind:"mutation"}),removeCamera:S(d({deviceId:l()}),N(),{kind:"mutation"}),reset:S(N(),N(),{kind:"mutation"})},events:{onMotion:{data:d({deviceId:l(),detected:A(),regionCount:l()})}}},uU=O(["external","embedded"]),dU=O(["connected","disconnected","auth-failed","unreachable","tls-error"]),pU=d({id:o(),name:o(),url:o(),kind:uU,status:dU,latencyMs:l().nullable(),error:o().optional(),connectedClients:l().int().nonnegative().optional(),lastCheckedAt:l().optional()}),mU=d({url:o(),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),fU=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()}),hU=d({id:o()}),Nd=d({id:o()}),gU=xt("ok",[d({ok:V(!0),latencyMs:l()}),d({ok:V(!1),error:o()})]),vU=d({port:l().int().min(1).max(65535).default(1883),allowAnonymous:A().default(!1),username:o().optional(),password:o().optional()}),yU=d({id:o(),url:o()}),ww=d({brokerCount:l(),embeddedRunning:A()}),bU={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:ww,kind:"poll"},methods:{listBrokers:S(N(),M(pU)),getBrokerConfig:S(Nd,mU),addBroker:S(fU,hU,{kind:"mutation"}),removeBroker:S(Nd,N(),{kind:"mutation"}),testConnection:S(Nd,gU,{kind:"mutation"}),startEmbeddedBroker:S(vU,yU,{kind:"mutation"}),stopEmbeddedBroker:S(Nd,N(),{kind:"mutation"}),getStatus:S(N(),ww)}},zp=d({url:o(),hostname:o(),port:l(),protocol:O(["http","https"])}),SU=d({connected:A(),endpoint:zp.nullable(),error:o().optional()}),xU=zp.extend({id:o(),label:o(),mode:o().optional(),sourcePort:l().optional()}),kU={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:S(N(),zp,{kind:"mutation"}),stop:S(N(),N(),{kind:"mutation"}),getEndpoint:S(N(),zp.nullable()),getStatus:S(N(),SU),listEndpoints:S(N(),M(xU).readonly())}},_R=O(["image","video","gif","audio","icon"]),wU=d({mediaType:_R,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`"}),xb=O(["text","markdown","html"]),TR=O(["acknowledge","dismiss","silence","snooze","view","play","open","close","lock","unlock","arm","arm-home","arm-away","arm-night","disarm","light","alert","camera"]),MU=d({id:o(),label:o(),url:o().optional(),icon:TR.optional(),destructive:A().optional(),mode:O(["navigate","background"]).optional()}),Mw=d({body:o(),title:o().optional(),format:xb.default("text"),priority:l().int().min(1).max(5).default(3),level:o().optional(),attachments:M(wU).optional(),clickUrl:o().optional(),actions:M(MU).optional(),sound:o().optional(),ttl:l().optional(),tag:o().optional(),deviceId:l().optional(),eventId:o().optional(),metadata:Y(o(),ne()).optional()}),CU=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()}),AU=d({mediaTypes:M(_R),mode:O(["url","bytes","both"]),max:l().int().nonnegative(),maxBytes:l().int().positive().optional()}),EU=d({attachments:AU,actions:l().int().nonnegative(),actionIcons:A().optional(),levels:M(CU),format:M(xb),clickUrl:A(),sound:A(),ttl:A(),bodyMaxLen:l().int().positive()}),RU=ne(),_U=d({kind:o(),label:o(),icon:o(),addonId:o(),iconUrl:o().optional(),iconMediaType:o().optional(),configSchema:RU,supportsDiscovery:A(),caps:EU}),Wh=d({id:o(),name:o(),kind:o(),addonId:o(),enabled:A(),config:Y(o(),ne())}),TU=d({kind:o(),suggestedName:o(),config:Y(o(),ne())}),IU=d({level:o(),format:xb,attachmentsSent:l().int().nonnegative(),actionsSent:l().int().nonnegative(),truncated:A(),dropped:M(o())}),IR=d({success:A(),error:o().optional(),renderedAs:IU.optional()}),NU=IR,OU={name:"notification-output",scope:"system",mode:"collection",methods:{listTargetKinds:S(d({}),M(_U)),listTargets:S(d({}),M(Wh)),discoverTargets:S(d({kind:o(),config:Y(o(),ne()).optional()}),M(TU)),send:S(d({targetId:o(),notification:Mw}),IR,{kind:"mutation"}),testTarget:S(d({targetId:o(),sample:Mw.optional()}),NU,{kind:"mutation"}),upsertTarget:S(d({target:Wh}),Wh,{kind:"mutation"}),deleteTarget:S(d({targetId:o()}),N(),{kind:"mutation"}),setTargetEnabled:S(d({targetId:o(),enabled:A()}),N(),{kind:"mutation"})}},jU=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"},{id:"package",name:"Package"}];new Set(jU.map(e=>e.id));var PU={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"}},DU=[{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"}],zU={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"}},LU={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"}},NR=new Map;for(const[e,t]of Object.entries(zU.mapping))NR.set(e.toLowerCase(),t);for(const[e,t]of Object.entries(LU.mapping))NR.set(e.toLowerCase(),t);var Vn={motion:"#f59e0b",audio:"#06b6d4",person:"#22c55e",vehicle:"#3b82f6",animal:"#f97316",package:"#a855f7",sensor:"#8b5cf6",control:"#10b981",genericDetection:"#64748b"},qU={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 BU(e){return e.split(/[-_ ]/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var Xc=new Map;function Br(e,t,n,a,s){Xc.set(e,{kind:e,parentKind:null,level:"macro",category:t,color:n,iconId:a,labelKey:`eventKind.${e}`,label:s})}function xn(e,t,n,a,s,p){Xc.set(e,{kind:e,parentKind:t,level:"sub",category:n,color:a,iconId:s,labelKey:`eventKind.${e}`,label:p})}Br("motion","motion",Vn.motion,"motion","Motion");Br("audio","audio",Vn.audio,"audio","Audio");Br("person","detection",Vn.person,"person","Person");Br("vehicle","detection",Vn.vehicle,"vehicle","Vehicle");Br("animal","detection",Vn.animal,"animal","Animal");Br("package","package",Vn.package,"package","Package");Br("sensor","sensor",Vn.sensor,"sensor","Sensor");Br("control","control",Vn.control,"control","Control");for(const[e,t]of Object.entries(PU.mapping))t!=="vehicle"&&t!=="animal"||Xc.has(e)||xn(e,t,"detection",qU[e]??Vn.genericDetection,e,BU(e));xn("package-delivered","package","package",Vn.package,"package","Package delivered");xn("package-picked-up","package","package",Vn.package,"package","Package picked up");xn("contact","sensor","sensor","#f59e0b","door","Contact");xn("motion-sensor","sensor","sensor",Vn.sensor,"pir","Motion sensor");xn("smoke","sensor","sensor","#ef4444","smoke","Smoke");xn("flood","sensor","sensor","#3b82f6","water","Water leak");xn("gas","sensor","sensor","#ef4444","gas","Gas");xn("carbon-monoxide","sensor","sensor","#dc2626","smoke","Carbon monoxide");xn("vibration","sensor","sensor","#eab308","vibration","Vibration");xn("tamper","sensor","sensor","#f97316","tamper","Tamper");xn("presence","sensor","sensor","#22c55e","presence","Presence");xn("enum-sensor","sensor","sensor",Vn.sensor,"generic","Sensor state");xn("device-event","sensor","sensor","#10b981","button","Device event");xn("lock","control","control","#0ea5e9","lock","Lock");xn("switch","control","control",Vn.control,"switch","Switch");xn("siren","control","control","#dc2626","siren","Siren");xn("button","control","control","#10b981","button","Button");xn("doorbell","control","control","#a855f7","doorbell","Doorbell");for(const e of DU){const t=`audio-${e.id}`;Xc.has(t)||xn(t,"audio","audio",Vn.audio,t,e.name)}var kb=Object.freeze(Object.fromEntries(Xc)),Yh=d({kind:o(),label:o(),parentKind:o().nullable()}),UU=d({videoClasses:M(Yh),audioKinds:M(Yh),labels:M(Yh)});function Xh(e,t,n){return{kind:e,label:t,parentKind:n}}function FU(){const e=Object.values(kb);return{videoClasses:e.filter(t=>t.category==="detection").map(t=>Xh(t.kind,t.label,t.parentKind)),audioKinds:e.filter(t=>t.category==="audio"&&t.level==="sub").map(t=>Xh(t.kind,t.label,t.parentKind)),labels:e.filter(t=>t.category==="sensor"||t.category==="control").map(t=>Xh(t.kind,t.label,t.parentKind))}}Object.freeze(FU());var HU=O(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),wb=O(["home","away","night","vacation","custom_bypass"]),Cw=d({state:HU,availableModes:M(wb),requiresCode:A(),lastChangedAt:l()}),$U={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.AlarmPanel],methods:{arm:S(d({deviceId:l().int().nonnegative(),mode:wb,code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),disarm:S(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),trigger:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:Cw,kind:"push"},runtimeState:Cw,durability:"restored",volatileStateFields:["lastChangedAt"]},OR=d({x:l(),y:l()}),Ws=d({kind:V("rect"),x:l(),y:l(),width:l(),height:l()}),fm=d({kind:V("polygon"),points:M(OR)}),jR=d({kind:V("grid"),gridWidth:l(),gridHeight:l(),cells:M(A())}),QU=d({kind:V("line"),points:M(OR)});xt("kind",[Ws,fm,jR,QU]);var PR=O(["rect","polygon","grid","line"]),VU=d({min:l(),max:l()}),GU=d({width:l(),height:l()}),Mb=O(["immediate","track-end","device-event","package-event","system-event"]),Cb=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"]),ZU=new Set(["camera-online","camera-offline","camera-disabled","camera-enabled"]);Cb.options.filter(e=>!ZU.has(e));var KU=d({kinds:M(Cb).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()}),DR=1440,WU=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)}),hm=d({windows:M(WU).min(1),timezone:o().optional(),invert:A().optional()}),YU=d({values:M(o().min(1)),maxDistance:l().int().min(0).max(3).default(1)}),XU=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)}),JU=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()}),eF=O(["enter","exit","any"]),tF=d({ids:M(o().min(1)).min(1),match:O(["any","all"]).default("any")}),nF=xt("kind",[d({kind:V("wait"),seconds:l().min(0).max(300)}),d({kind:V("cap"),deviceId:l().int(),cap:o().min(1),method:o().min(1),args:Y(o(),ne()).optional()})]),aF=d({name:o().min(1).max(120),enabled:A(),minDelaySec:l().int().min(0).max(86400).optional(),actions:M(nF).min(1)}),iF=d({id:o().min(1).max(64),label:o().min(1).max(40),sequence:o().min(1).max(120),icon:TR.optional(),destructive:A().optional()}),rF=d({onTrigger:M(aF).optional(),buttons:M(iF).max(8).optional()}),oF=d({deviceId:l().int(),states:M(o().min(1)).min(1)}),sF=d({sceneId:o().min(1),deviceId:l().int().optional(),requiredState:O(["matched","diverged"]),latched:A().optional()}),Ab=d({deviceState:oF.optional(),scene:sF.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:tF.optional(),zonesExclude:M(o().min(1)).optional(),crossing:eF.optional(),labelEquals:M(o().min(1)).optional(),identities:M(o().min(1)).optional(),plates:YU.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:KU.optional(),customZones:M(fm).optional(),occupancy:XU.optional(),audio:JU.optional()}),zR=d({targetId:o().min(1),params:Y(o(),ne()).optional()}),lF=O(["cropped","full","boxed"]),LR=d({attach:O(["best","best-matching","keyFrame","none"]).default("best"),frame:lF.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:Cn.optional()}),cF=O(["shared","per-class"]),qR=d({cooldownSec:l().int().min(0).max(86400).default(60),scope:O(["rule","rule-device"]).default("rule-device"),granularity:cF.optional()}),uF=1e3,dF=2e4,pF=8e3,mF=d({op:O([">=",">","<=","<","=="]),count:l().int().min(0).max(1e3)}),fF=d({enabled:A().default(!1),profileId:o().optional(),prompt:o().max(1e3).optional(),expect:mF.optional(),timeoutMs:l().int().min(uF).max(dF).default(pF),onTimeout:O(["fire","suppress"]).default("fire"),maxImagePx:l().int().min(64).max(2048).default(448)}),Lp=d({name:o().min(1).max(200),enabled:A().default(!0),delivery:Mb,conditions:Ab.default({}),schedule:hm.optional(),targets:M(zR),targetUsers:M(o()).optional(),media:LR.default({attach:"best"}),throttle:qR.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(DR)).max(4).optional(),actions:rF.optional(),confirm:fF.optional(),waitForEnhancement:A().optional(),groupIdleSec:l().int().min(0).max(600).optional()}),hF=Lp.partial().extend({disabledTargetIds:M(o()).optional(),enabled:A().optional(),conditions:Ab.optional(),media:LR.optional(),throttle:qR.optional(),priority:l().int().min(1).max(5).optional()}),Od=Lp.extend({id:o(),createdBy:o(),createdAt:l(),updatedAt:l(),disabledTargetIds:M(o()).default([])}),gF=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()}),BR=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(Mb),phase:o(),description:o().optional(),options:M(d({value:o(),label:o(),hint:o().optional()})).readonly().optional()}),UR=O(["pending","sent","dead"]),vF=O(["object-event","track-end","device-event","package-event","system-event"]),yF=d({className:o(),label:o().optional(),confidence:l().optional(),zones:M(o()),timestamp:l(),systemEvent:d({kind:Cb,subject:o(),title:o(),body:o(),data:Y(o(),ne())}).optional()}),bF=d({id:o(),ruleId:o(),ruleName:o(),delivery:Mb,targetId:o(),deviceId:l(),recordKind:vF,recordId:o(),trackId:o().optional(),status:UR,attempts:l().int(),createdAt:l(),updatedAt:l(),error:o().optional(),subject:yF,artifactIds:M(o().min(1)).optional()}),SF=d({ruleId:o().optional(),deviceId:l().optional(),status:UR.optional(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100)}),FR=O(["rule","device","all"]),xF=d({scope:FR,ruleId:o().optional(),deviceId:l().int().optional(),classes:M(o().min(1)).min(1).optional(),durationMinutes:l().int().min(1).max(DR),global:A().optional(),summary:A().optional()}),Aw=d({id:o(),userId:o(),scope:FR,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 HR=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)}),kF=HR.partial(),wF=O(["muted","detection-off","offline"]),MF=d({deviceId:l().int(),reason:wF}),CF=d({mode:wb,ruleCount:l().int().min(0),allDevices:A(),deviceIds:M(l().int()),skippedDevices:M(MF).default([])}),Ew=d({deviceId:l().int().nullable(),settings:HR,coverage:M(CF)}),AF={name:"notification-rules",scope:"system",mode:"singleton",methods:{listRules:S(d({}),d({rules:M(Od)}),{auth:"admin"}),getRule:S(d({ruleId:o()}),d({rule:Od.nullable()}),{auth:"admin"}),createRule:S(d({rule:Lp}),d({rule:Od}),{kind:"mutation",auth:"admin",caller:"required"}),updateRule:S(d({ruleId:o(),patch:hF}),d({rule:Od}),{kind:"mutation",auth:"admin",caller:"required"}),deleteRule:S(d({ruleId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setRuleEnabled:S(d({ruleId:o(),enabled:A()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),listDeviceMutes:S(d({}),d({mutedDeviceIds:M(l().int()).readonly()}),{auth:"admin"}),setDeviceMuted:S(d({deviceId:l().int(),muted:A()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),testRule:S(d({rule:Lp,lookbackMinutes:l().int().min(1).max(1440).default(60)}),d({results:M(gF)}),{kind:"mutation",auth:"admin"}),getConditionCatalog:S(d({}),d({catalog:M(BR),taxonomy:UU.optional()})),getHistory:S(d({filter:SF.default({limit:100})}),d({entries:M(bF)}),{auth:"admin"}),resolveArtifactUrl:S(d({artifactId:o().min(1)}),d({url:o().nullable()}),{auth:"admin"}),listSnoozes:S(d({}),d({snoozes:M(Aw)}),{caller:"required"}),createSnooze:S(d({snooze:xF}),d({snooze:Aw}),{kind:"mutation",caller:"required"}),cancelSnooze:S(d({snoozeId:o()}),d({success:V(!0)}),{kind:"mutation",caller:"required"}),getAlarmConfig:S(d({}),Ew,{auth:"admin"}),setAlarmConfig:S(d({patch:kF}),Ew,{kind:"mutation",auth:"admin"})}},rp=O(["view","create","delete"]),$R=it([V("*"),M(o())]),QR=Y(o(),it([V("*"),M(o())])),EF=O(["device","system"]),RF=xt("kind",[d({kind:V("all")}),d({kind:V("ids"),ids:M(l().int()).min(1)}),d({kind:V("types"),types:M(O(Q)).min(1)}),d({kind:V("locations"),locations:M(o().min(1)).min(1)})]),_F=d({type:V("device"),selector:RF,access:M(rp).min(1),includeLinked:A().optional()});function TF(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 xa=BL(TF,xt("type",[d({type:V("category"),target:EF,access:M(rp).min(1)}),d({type:V("capability"),target:o(),access:M(rp).min(1)}),d({type:V("addon"),target:o(),access:M(rp).min(1)}),_F]));d({id:o(),username:o(),passwordHash:o(),isAdmin:A().default(!1),allowedProviders:$R,allowedDevices:QR,scopes:M(xa).default([]),createdAt:l(),updatedAt:l()});d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:$R,allowedDevices:QR,tokenHash:o(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()});d({id:o(),userId:o(),name:o(),tokenHash:o(),tokenPrefix:o(),scopes:M(xa),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()});var IF=d({integrationId:o(),displayName:o(),requestedScopes:M(xa),allowedRedirectPrefixes:M(o()).min(1),allowedPrivateHostPaths:M(o()).optional(),requiresPkce:A().optional(),hubUrl:o().optional(),refreshTokenTtlSec:it([l().int().positive(),V("never")]).optional()}),NF={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:S(N(),IF,{auth:"admin"})}},OF=d({handle:Pr,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 jF=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()}),jv=O(["onnx","coreml","openvino","tflite","pt","gguf"]),Nc=O(["detector","cropper","classifier","refiner","audio-classifier"]),na=d({runtime:O(["node","python"]),backend:o(),format:jv,device:o().optional()}),PF=d({id:o(),label:o(),description:o().optional()}),DF=d({engine:na,devices:M(PF).readonly(),defaultDevice:o()}),Pv=Kc(()=>d({addonId:o(),addonName:o(),slot:Nc,inputClasses:M(o()).readonly(),outputClasses:M(o()).readonly(),enabled:A(),modelId:o(),children:M(Pv).readonly(),group:o().optional(),settings:Y(o(),ne()).optional()})),qp=Kc(()=>d({addonId:o(),enabled:A(),modelId:o(),children:M(qp).readonly(),settings:Y(o(),ne()).optional()})),Jh=d({id:o(),name:o(),createdAt:o(),updatedAt:o(),engine:na,steps:M(qp).readonly()}),zF=d({id:o(),name:o(),formats:Y(o(),d({downloaded:A(),sizeMB:l()})),group:KE.optional(),legacy:A().optional(),provider:WE.optional()}),LF=Qa(),qF=d({id:o(),name:o(),slot:Nc,inputClasses:M(o()).readonly(),outputClasses:M(o()).readonly(),childSlots:M(Nc).readonly(),models:M(zF).readonly(),defaultModelId:o(),defaultModelIdByFormat:Y(o(),o()).optional(),enabledByDefault:A().optional(),backfillIntoExistingOverrides:A().optional(),defaultConfidence:l(),group:o().optional(),configSchema:M(LF).readonly().optional()}),BF=d({id:Nc,label:o(),priority:l(),parentSlot:Nc.nullable(),addons:M(qF).readonly()}),UF=d({availableEngines:M(DF).readonly(),selectedEngine:na,slots:M(BF).readonly()}),FF=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()}),Mo=Kc(()=>d({addonId:o(),modelId:o().optional(),enabled:A().default(!0),children:M(Mo).optional(),settings:Y(o(),ne()).optional(),jumpDeviceKey:o().optional()})),HF=d({addonId:o(),chosen:o(),running:o(),format:o()}),$F=d({addonId:o(),kind:O(["unknown-addon","no-format-build"]),detail:o()}),QF=d({ok:A(),issues:M($F).readonly(),substitutions:M(HF).readonly(),format:o()}),VF=d({filename:o(),stepIds:M(o()).readonly().optional()}),GF=d({base64:o(),filename:o()}),ZF=d({filename:o(),sizeKb:l()}),KF=d({base64:o()}),WF=d({id:o(),name:o(),description:o(),available:A(),rawLabels:M(o()).readonly().optional()}),YF=d({activeBackend:o(),availableBackends:M(WF).readonly(),sampleRate:l(),chunkDurationMs:l()}),XF=d({filePath:o(),sizeMB:l(),durationMs:l()}),JF=d({success:A(),error:o().optional(),frame:Qa().optional()}),eH=Qa(),tH=Qa(),nH=Qa(),aH=Qa(),iH=Qa(),Dv=Qa(),rH={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:S(N(),M(na)),getSelectedEngine:S(N(),na),getDefaultSteps:S(na,M(Pv)),getEngineProvisioning:S(d({nodeId:o()}),FF),getVideoPipelineSteps:S(N(),Y(o(),d({modelId:o(),settings:Y(o(),ne()).readonly()}))),setVideoPipelineSteps:S(d({steps:Y(o(),d({modelId:o(),settings:Y(o(),ne()).readonly()}))}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),clearDeviceOverrides:S(d({nodeId:o()}),d({success:V(!0),clearedDevices:l()}),{kind:"mutation",auth:"admin"}),getInferenceDeviceHealth:S(d({nodeId:o()}),d({unhealthy:M(d({deviceKey:o(),state:O(["failed","backoff"]),since:l(),deaths:l(),lastError:o()})).readonly()})),rearmInferenceDevice:S(d({nodeId:o(),deviceKey:o()}),d({rearmed:A()}),{kind:"mutation",auth:"admin"}),getSchema:S(N(),UF),getGlobalSteps:S(N(),M(Pv).readonly().nullable()),getGlobalPipelineConfig:S(N(),eH),getOrchestratorConfigSchema:S(N(),tH),validatePipeline:S(d({steps:M(Mo)}),QF),listTemplates:S(N(),M(Jh).readonly()),saveTemplate:S(d({name:o(),steps:M(qp).readonly(),engine:na}),Jh,{kind:"mutation"}),updateTemplate:S(d({id:o(),name:o().optional(),steps:M(qp).readonly().optional()}),Jh,{kind:"mutation"}),deleteTemplate:S(d({id:o()}),N(),{kind:"mutation"}),getCapabilities:S(N(),aH),getAddonModels:S(d({addonId:o()}),iH),downloadModel:S(d({addonId:o(),modelId:o(),format:jv}),XF,{kind:"mutation"}),deleteModel:S(d({addonId:o(),modelId:o(),format:jv}),d({success:V(!0)}),{kind:"mutation"}),runPipeline:S(d({engine:na.optional(),steps:M(Mo).min(1),frame:Av.optional(),frameRef:jF.optional(),frameHandle:Pr.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:OF.optional()}),Dv,{kind:"mutation"}),runPipelineBatch:S(d({engine:na.optional(),steps:M(Mo).min(1),frames:M(Av).min(1).max(255),deviceId:l().optional(),sessionId:o().optional(),frameId:l().int().nonnegative().optional(),deviceKey:o().optional()}),d({results:M(Dv).readonly()}),{kind:"mutation"}),cacheFrameInPool:S(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:S(d({stepId:o(),frameId:l().int()}),Y(o(),ne()),{kind:"mutation"}),uncacheFrame:S(d({frameId:l().int()}),N(),{kind:"mutation"}),getEffectiveTuning:S(N(),d({batchMode:o(),windowMs:l(),maxBatchSize:l(),concurrency:l()})),listLoadedEngines:S(N(),M(d({engineKey:o(),engine:na,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:S(d({engine:na}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),killEngine:S(d({engine:na,force:A().optional()}),d({success:A(),reason:o().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:S(N(),M(VF).readonly()),getReferenceImage:S(d({filename:o()}),GF.nullable()),getReferenceAudioFiles:S(N(),M(ZF).readonly()),getReferenceAudio:S(d({filename:o()}),KF.nullable()),getAudioCapabilities:S(N(),YF),runAudioTest:S(d({addonId:o(),modelId:o(),filename:o().optional(),settings:Y(o(),ne()).optional()}),JF,{kind:"mutation"}),getDetectionConfigSchema:S(N(),nH)}},oH=O(["include","exclude"]),vo=d({id:o(),name:o().optional(),zoneIds:M(o()).min(1).readonly(),mode:oH,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(vo).readonly();var sH=O(["polygon","tripwire"]),lH=d({x:l(),y:l()}),Ps=d({id:o(),name:o(),kind:sH.default("polygon"),polygon:M(lH).readonly(),color:o().default("#3b82f6")}),cH={name:"zones",scope:"device",mode:"singleton",deviceTypes:[Q.Camera],methods:{listZones:S(d({deviceId:l()}),M(Ps).readonly()),addZone:S(d({deviceId:l(),zone:Ps}),N(),{kind:"mutation",auth:"admin"}),removeZone:S(d({deviceId:l(),zoneId:o()}),N(),{kind:"mutation",auth:"admin"}),updateZone:S(d({deviceId:l(),zone:Ps}),N(),{kind:"mutation",auth:"admin"})},runtimeState:d({zones:M(Ps).readonly()}),durability:"restored"},Eb=O(["new","entered","left","moving","idle"]),uH=O(["motion","object","audio"]),dH=xt("kind",[Ws,fm]),pH=O(["motion","audio","person","vehicle","animal","door","pir","smoke","water","button","package","generic"]),mH=O(["motion","audio","detection","sensor","control","custom","package"]),fH=O(["macro","sub"]),VR=d({kind:o(),labelKey:o(),label:o(),color:o(),iconId:o(),icon:pH,category:mH,parentKind:o().nullable(),level:fH,source:d({capName:o(),deviceId:l()})}),hH=d({deviceId:l(),kinds:M(VR).readonly()}),gH=d({id:o(),deviceId:l(),sourceDeviceId:l(),kind:o(),value:Y(o(),ne()).nullable(),timestamp:l()}),GR=d({x:l(),y:l(),timestamp:l(),bbox:Zi}),vH=d({timestamp:l(),position:GR,mediaKey:o()}),yH=d({minX:l(),minY:l(),maxX:l(),maxY:l()}),ZR=O(["full","slim"]),bH=d({label:o(),peakScore:l(),count:l(),firstAt:l(),lastAt:l()}),SH=O(["pipeline","sensor","audio"]),Rb=O(["none","staging","trained"]),_b={markForTrain:A().optional(),debug:A().optional(),favourited:A().optional()},KR={retrainStatus:Rb.optional()},xH=d(_b),kH=d({trackId:o(),markForTrain:A(),debug:A(),favourited:A(),retrainStatus:Rb});it([V(1),V(2)]);var Rw=d({stepId:o(),modelId:o().optional(),decidedAt:l(),identityId:o().optional()}),Tb={label:o().optional(),labelScore:l().optional(),labelMeta:Rw.optional(),subLabel:o().optional(),subLabelScore:l().optional(),subLabelMeta:Rw.optional()},wH=d({deviceId:l(),tracks:l().int(),files:l().int(),bytes:l().int()}),MH=d({generatedAt:l(),trackCount:l().int(),fileCount:l().int(),byteCount:l().int(),truncated:A(),devices:M(wH).readonly()}),op=d({trackId:o(),deviceId:l(),className:o(),...Tb,producingDeviceName:o().optional(),source:SH.optional(),firstSeen:l(),lastSeen:l(),positions:M(GR).readonly(),snapshots:M(vH).readonly(),zonesVisited:M(o()).readonly(),zoneNames:M(o()).readonly().optional(),classes:M(o()).readonly().optional(),totalDistance:l(),state:Eb,active:A(),importance:l().optional(),bestEventId:o().optional(),importanceReason:o().optional(),audioLabels:M(bH).readonly().optional(),envelope:yH.optional(),hasFace:A().optional(),hasEmbeddedFace:A().optional(),hasRider:A().optional(),previewMissReason:o().optional(),..._b,...KR}),Ib={id:o(),deviceId:l(),timestamp:l()},CH=d({...Ib,kind:V("motion"),regionCount:l(),regions:M(d({bbox:Zi,pixelCount:l(),intensity:l()})).readonly().optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaUrl:o().optional()}),WR=O(["pipeline","onboard"]),AH=O(["enter","exit"]),EH=d({direction:AH,zoneId:o(),zoneName:o().optional()}),YR=d({...Ib,kind:V("object"),source:WR.optional(),frameId:o().optional(),trackId:o().optional(),className:o(),...Tb,confidence:l().optional(),bbox:Zi.optional(),zones:M(o()).readonly().optional(),state:Eb.optional(),zoneCrossing:EH.optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaKey:o().optional(),keyFrameMediaKey:o().optional(),mediaUrl:o().optional(),importance:l().optional()}),RH=d({...Ib,kind:V("audio"),rms:l(),dbfs:l(),classification:d({className:o(),originalClass:o().optional(),score:l()}).optional(),mediaUrl:o().optional()}),Ys=O(["crop","thumbnail","snapshot","firstFrame","lastFrame","fullFrame","fullFrameBoxed","faceCrop","plateCrop","keyFrame","keyFrameSmall","thumbnailSmall"]),_H=d({key:o(),kind:Ys,sizeBytes:l(),timestamp:l()}),zv=_H.extend({url:o(),base64:o()}),_w=zv.omit({base64:!0}),TH=O(["person","vehicle","animal","package","face","plate"]),IH=O(["subject","model_error"]),NH=O(["operator","assist"]),XR=d({x:l(),y:l(),w:l(),h:l()}),Lv=d({id:o(),trackId:o(),deviceId:l(),mediaKey:o(),bbox:XR,macroClass:TH,label:o().optional(),subLabel:o().optional(),kind:IH,source:NH,assistModelId:o().optional(),assistScore:l().optional(),exportedInBatch:o().optional(),createdAt:l()}),JR=Lv.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),OH=d({trackId:o(),deviceId:l(),className:o(),label:o().optional(),firstSeen:l(),lastSeen:l(),frameCount:l().int(),annotationCount:l().int()}),jH=d({mediaKey:o(),kind:Ys,timestamp:l(),sizeBytes:l().int(),copied:A()}),e_=d({frameId:o(),deviceId:l(),trackId:o(),sourceMediaKey:o(),sourceKind:Ys,sizeBytes:l().int(),width:l().int(),height:l().int(),copiedAt:l()}),PH=O(["source-missing","unreadable-image","write-failed"]),DH=d({copied:M(e_).readonly(),refused:M(d({sourceMediaKey:o(),reason:PH})).readonly()}),zH=d({candidates:M(jH).readonly(),copies:M(e_).readonly(),autoPickMediaKey:o().optional()}),LH=xt("kind",[d({kind:V("package"),zone:XR.optional()}),d({kind:V("objects"),modelId:o(),minScore:l().optional()})]),qH=xt("kind",[d({kind:V("proposed"),modelId:o(),stepId:o(),minScore:l(),proposals:M(JR).readonly(),belowThreshold:l().int()}),d({kind:V("refused"),reason:o(),detail:o().optional()})]),Tw=d({trackId:o(),retrainStatus:Rb,changed:A(),reason:O(["unknown-track","no-frames-copied","not-staging","not-trained","unchanged"]).optional()}),t_=1e3,n_=5e3,qv=d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(n_).default(t_),projection:O(["full","slim"]).optional()}),BH=qv.extend({classFilter:o().optional()}),UH=d({deviceIds:M(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(1e3).default(200),cursor:o().optional(),projection:ZR.optional(),includeStationary:A().optional()}),FH=d({tracks:M(op).readonly(),nextCursor:o().nullable()}),a_=50,i_=200,HH=d({deviceId:l(),since:l(),until:l(),limit:l().int().min(1).max(i_).default(a_),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),r_=d({id:o(),trackId:o(),timestamp:l(),className:o(),...Tb,importance:l(),bestEventId:o(),windowMs:l().optional(),..._b,...KR}),$H=d({deviceIds:M(l()).min(1).max(200),since:l(),until:l(),limit:l().int().min(1).max(i_).default(a_),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),QH=d({deviceId:l(),events:M(r_).readonly()});d({trackId:o(),className:o(),confidence:l(),bbox:Zi,zones:M(o()).readonly(),state:Eb});var VH=$k({id:o(),kind:O(["first-level","detail"]),macroClass:o(),score:l(),bbox:d({x:l(),y:l(),width:l(),height:l()}),labels:M($k({label:o(),score:l()})).readonly(),parentId:o().optional()}),GH=YR.extend({score:l()}),ZH=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)}),Iw=d({tracks:l().int(),events:l().int(),media:l().int(),faces:l().int(),plates:l().int(),embeddings:l().int()}),KH=d({mediaDropped:l().int(),tracks:l().int(),events:l().int()}),WH=d({deviceId:l(),rows:l().int(),bytes:l().int()}),YH=d({totalRows:l().int(),totalBytes:l().int(),devices:M(WH).readonly()}),XH=d({kind:Ys,rows:l().int(),bytes:l().int()}),JH=d({totalRows:l().int(),totalBytes:l().int(),kinds:M(XH).readonly(),unaccountedRows:l().int(),unaccountedBytes:l().int()}),Nw=d({motion:l().int(),object:l().int(),audio:l().int()}),e$=d({deviceId:l().optional(),since:l().optional(),until:l().optional(),maxTracks:l().int().positive().optional(),executeOnNodeId:o().optional(),pacingMs:l().int().nonnegative().optional()}),t$=d({deleted:l()}),n$=d({started:A(),alreadyRunning:A()}),a$=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()}),i$=d({started:A(),alreadyRunning:A()}),r$=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()}),o$=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()}),s$=d({timestamp:l(),frame:Dv}),l$=d({className:o(),firstSeenMs:l(),lastSeenMs:l(),bbox:Zi,framesMatched:l().int()}),c$=d({tracks:M(l$).readonly()}),u$={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:S(d({deviceId:l()}),M(op).readonly()),getTrack:S(d({deviceId:l(),trackId:o()}),op.nullable()),listTracks:S(d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().optional(),zone:dH.optional(),projection:ZR.optional(),includeStationary:A().optional()}),M(op).readonly()),listRecentTracks:S(UH,FH),clearTracks:S(d({deviceId:l()}),N(),{kind:"mutation",auth:"admin"}),getMotionEvents:S(qv,M(CH).readonly()),getObjectEvents:S(BH,M(YR).readonly()),getAudioEvents:S(qv,M(RH).readonly()),listEventKinds:S(d({deviceId:l()}),M(VR).readonly()),listEventKindsBatch:S(d({deviceIds:M(l()).min(1).max(200)}),M(hH).readonly()),getSensorEvents:S(d({deviceId:l(),since:l().optional(),until:l().optional(),kinds:M(o()).optional(),limit:l().int().min(1).max(n_).default(t_)}),M(gH).readonly()),getKeyEvents:S(HH,M(r_).readonly()),getKeyEventsBatch:S($H,M(QH).readonly()),getEventDensity:S(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:S(d({deviceId:l(),cutoffMs:l()}),d({motion:l().int(),object:l().int(),audio:l().int()}),{kind:"mutation",auth:"admin"}),pruneTracksBefore:S(d({deviceId:l(),cutoffMs:l()}),Iw,{kind:"mutation",auth:"admin"}),wipeAllAnalytics:S(d({deviceId:l()}),Iw,{kind:"mutation",auth:"admin"}),reconcileFromDisk:S(d({deviceId:l()}),KH,{kind:"mutation",auth:"admin"}),deleteTracks:S(d({deviceId:l(),trackIds:M(o()).min(1)}),d({deleted:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),setTrackFlags:S(d({deviceId:l(),trackId:o(),flags:xH}),kH,{kind:"mutation"}),getEventStoreFootprint:S(d({}),YH,{kind:"query",auth:"admin"}),getEventMediaFootprintByKind:S(d({deviceId:l().int().optional()}),JH,{kind:"query",auth:"admin"}),pruneEvents:S(d({olderThanMs:l(),reason:cb.optional()}),Nw,{kind:"mutation",auth:"admin"}),deleteDeviceEvents:S(d({deviceId:l()}),Nw,{kind:"mutation",auth:"admin"}),pauseForStorageMigration:S(Nr,d({paused:V(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:S(Nr,d({resumed:V(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:S(Nr,d({refreshed:V(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:S(H8,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:S(d({jobId:o()}),Tc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateMedia:S(ZE,d({jobId:o()}),{kind:"mutation",auth:"admin"}),countUnstampedEventMedia:S(d({}),F8,{auth:"admin"}),countRelocatableMedia:S(cq,lq,{kind:"query",auth:"admin"}),listRelocateMediaJobs:S(d({}),M(Tc).readonly(),{kind:"query",auth:"admin"}),cancelRelocateMedia:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),listOpsLog:S(UE,M(BE).readonly(),{kind:"query",auth:"admin"}),reclaimDebugMedia:S(r$,i$,{kind:"mutation",auth:"admin"}),getMediaReclaimStatus:S(d({}),o$,{kind:"query",auth:"admin"}),getTrainingExportSummary:S(d({deviceIds:M(l()).optional()}),MH,{kind:"query",auth:"admin"}),getTrainingExportUrl:S(d({deviceIds:M(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),listRetrainStaging:S(d({deviceIds:M(l()).optional(),limit:l().int().min(1).max(500).optional()}),M(OH).readonly(),{kind:"query",auth:"admin"}),listRetrainFrames:S(d({trackId:o()}),zH,{kind:"query",auth:"admin"}),selectRetrainFrames:S(d({deviceId:l(),trackId:o(),mediaKeys:M(o()).min(1)}),DH,{kind:"mutation",auth:"admin"}),deselectRetrainFrame:S(d({deviceId:l(),trackId:o(),frameId:o()}),d({removed:A(),removedAnnotations:l().int()}),{kind:"mutation",auth:"admin"}),getRetrainFrameImage:S(d({frameId:o()}),d({base64:o(),width:l().int(),height:l().int()}),{kind:"query",auth:"admin"}),proposeRetrainAnnotations:S(d({deviceId:l(),trackId:o(),frameId:o(),subject:LH,nodeId:o().optional()}),qH,{kind:"mutation",auth:"admin"}),runReplayFrameProcessor:S(d({deviceId:l(),source:WR,zones:M(Ps).readonly().optional(),detectionRules:M(vo).readonly().optional(),zoneMembershipMinOverlap:l().min(0).max(1).optional(),frames:M(s$).min(1)}),c$,{kind:"mutation",auth:"admin"}),listRetrainAnnotations:S(d({trackId:o()}),M(Lv).readonly(),{kind:"query",auth:"admin"}),saveRetrainAnnotations:S(d({deviceId:l(),trackId:o(),frameId:o(),annotations:M(JR)}),M(Lv).readonly(),{kind:"mutation",auth:"admin"}),completeRetrainTrack:S(d({deviceId:l(),trackId:o()}),Tw,{kind:"mutation",auth:"admin"}),restageRetrainTrack:S(d({deviceId:l(),trackId:o()}),Tw,{kind:"mutation",auth:"admin"}),getRetrainExportUrl:S(d({deviceIds:M(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),getEventMedia:S(d({eventId:o(),kind:Ys.optional(),deviceId:l()}),M(zv).readonly()),getTrackMedia:S(d({trackId:o(),kinds:M(Ys).optional(),deviceId:l()}),M(zv).readonly()),listTrackMedia:S(d({trackId:o(),deviceId:l()}),M(_w).readonly()),listEventMedia:S(d({eventId:o(),deviceId:l()}),M(_w).readonly()),searchObjectEvents:S(ZH,M(GH).readonly()),wipeObjectEmbeddings:S(d({}),t$,{kind:"mutation",auth:"admin"}),rebuildObjectEmbeddings:S(e$,n$,{kind:"mutation",auth:"admin"}),getObjectEmbeddingRebuildStatus:S(d({}),a$)},events:{onFrameTracked:{data:d({deviceId:l(),timestamp:l(),frameWidth:l(),frameHeight:l(),detections:M(VH).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:uH,eventId:o(),timestamp:l()})}}};d({activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()});var Nb=d({detectionMode:O(["disabled","always-on","on-motion"]),configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceTimeMs:l(),droppedFrames:l(),phase:O(["idle","watching","active"])}),d$=Nb.extend({deviceId:l()}),Bp=d({x:l(),y:l(),w:l(),h:l()}),p$=d({bytes:Ut(Uint8Array).optional(),jpeg:o().optional(),width:l().int().positive(),height:l().int().positive(),tier:O(["native","ram-fullframe"]).optional()}),m$=d({bbox:Bp,className:o()}),o_=d({stepId:o(),className:o(),score:l(),bbox:Bp.optional(),embedding:o().optional(),embeddingMagnitude:l().optional(),embeddingModelId:o().optional(),label:o().optional(),labelTier:it([V(1),V(2)]).optional(),labelModelId:o().optional(),alignedCropJpeg:o().optional(),nativeFaceShortSidePx:l().optional()}),f$=O(["unknown-step","model-not-servable","unreadable-frame","execution-failed"]),h$=xt("kind",[d({kind:V("ran"),nodeId:o(),modelId:o(),details:M(o_)}),d({kind:V("refused"),nodeId:o(),reason:f$,detail:o()})]),Ow={min:0,default:3e4},jw={min:0,max:6e5},Pw={min:5e3,max:6e5},eg={min:1,max:30,default:4},tg={min:1,max:30,default:10},ng={min:0,max:300,default:300},ag={min:1,max:10,default:4},Ob=O(["onboard","analyzer"]),g$=M(Ob),v$=d({deviceId:l(),detected:A(),source:Ob.default("analyzer"),regions:M(Dp).readonly().optional()}),y$=xt("kind",[d({kind:V("local-broker")}),d({kind:V("remote-restream"),ownerNodeId:o(),ownerReachableHost:o().optional(),hubHostnameOverride:o().optional()})]).describe("Per-camera frame-source mode for the runner (P2c)"),b$=d({deviceKey:o(),weight:l().positive().default(1),maxSessions:l().int().positive().nullable().default(null)}),S$=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(Ow.min).default(Ow.default),maxSessionHoldMs:l().min(jw.min).max(jw.max).optional(),audioMotionWindowMs:l().min(Pw.min).max(Pw.max).optional(),motionFps:l().min(eg.min).max(eg.max).default(eg.default),detectionFps:l().min(tg.min).max(tg.max).default(tg.default),motionStreamId:o(),detectionStreamId:o(),motionSources:g$.default(["analyzer"]),pipelineEnabled:A().default(!0),steps:M(Mo).readonly().optional(),audio:d({modelId:o().optional(),enabled:A()}).nullable().optional(),zones:M(Ps).readonly().default([]),onboardMotionDrivesAnalyzer:A().default(!0),occupancyRecheckEnabled:A().default(!0),occupancyRecheckSec:l().min(ng.min).max(ng.max).default(ng.default),occupancyRecheckFrames:l().min(ag.min).max(ag.max).default(ag.default),frameSource:y$.default({kind:"local-broker"}),deviceKey:o().optional(),inferenceDevices:M(b$).readonly().optional()}),s_=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()})}),Dw=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()}),x$=d({node:Dw,cameras:M(Dw.extend({deviceId:l()}))}),k$=d({nodeId:o(),activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l(),frameLazy:x$.optional()}),w$={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:S(S$,d({success:V(!0)}),{kind:"mutation"}),detachCamera:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation"}),reportMotion:S(v$,d({success:V(!0)}),{kind:"mutation"}),getLocalLoad:S(N(),s_),getLocalMetrics:S(N(),k$),getCameraMetrics:S(d({deviceId:l()}),Nb.nullable()),getAllCameraMetrics:S(N(),M(d$).readonly()),getLocalCameras:S(N(),M(l()).readonly()),getNativeCrop:S(d({handle:Pr,bbox:Bp,maxWidth:l().int().positive().optional(),encodeJpeg:A().optional()}),p$.nullable()),runDetailSubtree:S(d({deviceId:l(),frameHandle:Pr.optional(),frameJpeg:o().optional(),cropJpeg:o().optional(),parent:m$,steps:M(o()).optional()}),d({details:M(o_)}).nullable(),{kind:"mutation"}),runStatelessStep:S(d({stepId:o(),modelId:o(),frameJpeg:o(),bbox:Bp,className:o(),sourceDeviceId:l()}),h$,{kind:"mutation"})}},sp=d({engine:na.optional(),steps:M(Mo).readonly(),audio:d({engine:na.optional(),modelId:o().optional(),enabled:A(),settings:Y(o(),ne()).readonly().optional()}).nullable().optional()}),ig=d({id:o(),name:o(),description:o().optional(),config:sp,createdAt:o(),updatedAt:o()}),jb=d({modelId:o().optional(),settings:Y(o(),ne()).optional(),jumpDeviceKey:o().optional()}),zw=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:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),jb).optional()})).optional()}),l_=d({steps:M(Mo).readonly(),audio:d({modelId:o(),enabled:A()}).nullable()}),Bv=d({modelId:o().optional(),settings:Y(o(),ne()).readonly().optional()}),M$=d({pinnedAgentNodeId:o().optional(),stepToggles:Y(o(),A()).optional(),stepOverridesByDevice:Y(o(),Y(o(),Y(o(),Bv))).optional(),pipelineByAgent:Y(o(),l_).optional()}),Lw=d({deviceId:l(),agentNodeId:o(),pinned:A(),reason:O(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:l()}),C$=d({nodeId:o(),online:A(),load:s_,score:l(),decodeHwaccel:o().nullable()}),A$=d({totalAgents:l(),onlineAgents:l(),totalCameras:l(),attachedCameras:l(),activeCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()}),E$=Y(o(),o()),R$=d({ownerNodeId:o(),reachableHost:o().optional(),configIssue:o().optional()}),_$=d({camStreamId:o(),codec:o(),width:l(),height:l(),fps:l(),kind:o()}),T$=d({streams:M(_$).readonly()}),I$=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()})}),N$=d({profile:o(),status:o(),codec:o(),width:l(),height:l(),subscribers:l(),inFps:l(),outFps:l()}),O$=d({profiles:M(N$).readonly(),webrtcSessions:l(),rtspRestream:A()}),j$=d({framesWritten:l(),getFrameHits:l(),getFrameMisses:l(),budgetMb:l()}),P$=d({nodeId:o(),formats:M(o()).readonly(),sessionCount:l(),shm:j$}),D$=d({enabled:A(),fps:l()}),z$=O(["idle","installing","verifying","ready","failed"]),L$=d({state:z$,error:o().optional()}),q$=O(["idle","watching","active"]),B$=d({nodeId:o(),engine:d({backend:o(),device:o()}),phase:q$,configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceMs:l(),provisioning:L$}),U$=d({nodeId:o(),enabled:A()}),F$=O(["off","continuous","events"]),H$=d({mode:F$,active:A(),storageBytes:l()}),$$=O(["source","broker","detection","recording","switches"]),Q$=O(["timeout","error","partial"]),V$=d({stage:$$,reason:Q$,elapsedMs:l()}),qw=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()}),Bw=d({deviceId:l(),assignment:I$,source:T$,broker:O$.nullable(),decoder:P$.nullable(),motion:D$.nullable(),detection:B$.nullable(),audio:U$.nullable(),recording:H$.nullable(),switchedOff:M(lb).readonly(),degraded:M(V$).readonly(),fetchedAt:l()}),G$=["disabled","unavailable","cannot-host-camera-root","accelerator-preferred"],Z$=O(G$),K$=d({key:o(),backend:o(),device:o(),format:O(dm),available:A(),enabled:A(),weight:l(),maxSessions:l().nullable(),defaultModelId:o(),steps:Y(o(),jb).optional(),exclusion:Z$.nullable()}),W$=d({nodeId:o(),reachable:A(),devices:M(K$).readonly()}),Y$={name:"pipeline-orchestrator",scope:"system",mode:"singleton",nodeIdMode:"data",exposesDeviceSettings:!0,methods:{pauseForStorageMigration:S(Nr,d({paused:V(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:S(Nr,d({resumed:V(!0)}),{kind:"mutation",auth:"admin"}),assignPipeline:S(d({deviceId:l(),agentNodeId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setPipelineDevicePin:S(d({deviceId:l(),deviceKey:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getPipelineDevicePin:S(d({deviceId:l()}),d({deviceKey:o().nullable()})),rebalance:S(N(),d({migrated:l()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:S(N(),M(Lw).readonly()),getPipelineAssignment:S(d({deviceId:l()}),Lw.nullable()),getAgentLoad:S(N(),M(C$).readonly()),getGlobalMetrics:S(N(),A$),getCameraMetrics:S(d({deviceId:l()}),Nb.nullable()),getCapabilityBindings:S(d({nodeId:o()}),E$),setCapabilityBinding:S(d({nodeId:o(),capName:o(),addonId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getIngestOwner:S(N(),R$),assignAudio:S(d({deviceId:l(),nodeId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:S(d({deviceId:l()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:S(d({deviceId:l()}),d({nodeId:o(),pinned:A(),assignedAt:l()}).nullable()),getAudioNodeLoad:S(N(),M(d({nodeId:o(),deviceCount:l()}))),getAudioAssignments:S(N(),M(d({deviceId:l(),nodeId:o(),pinned:A(),assignedAt:l()}))),getAgentSettings:S(d({agentNodeId:o()}),zw.nullable()),listAgentSettings:S(N(),M(d({nodeId:o(),settings:zw})).readonly()),removeAgentSettings:S(d({agentNodeId:o()}),d({success:A(),removed:A()}),{kind:"mutation",auth:"admin"}),setAgentMaxCameras:S(d({agentNodeId:o(),maxCameras:l().int().nonnegative().nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setAgentDetectWeight:S(d({agentNodeId:o(),detectWeight:l().positive().nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setAgentCapabilities:S(d({agentNodeId:o(),detect:A().nullable().optional(),audio:A().nullable().optional(),ingest:A().nullable().optional()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setAgentReachableHost:S(d({agentNodeId:o(),reachableHost:o().nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setAgentInferenceDevices:S(d({agentNodeId:o(),inferenceDevices:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),jb).optional()}))}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getNodeInferenceDevices:S(d({nodeId:o()}),W$),resetNodePipelineDefaults:S(d({agentNodeId:o()}),d({success:V(!0),effectiveModelId:o().nullable(),clearedCameraOverrides:l()}),{kind:"mutation",auth:"admin"}),getCameraSettings:S(d({deviceId:l()}),M$.nullable()),setCameraStepToggle:S(d({deviceId:l(),addonId:o(),enabled:A().nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:S(d({deviceId:l()}),Y(o(),Y(o(),Y(o(),Bv))).nullable()),setCameraStepOverride:S(d({deviceId:l(),agentNodeId:o(),deviceKey:o(),addonId:o(),patch:Bv.nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:S(d({deviceId:l(),agentNodeId:o(),pipeline:l_.nullable()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:S(d({deviceId:l(),agentNodeId:o().optional()}),sp),getCameraSwitches:S(d({deviceId:l()}),Wk),setCameraSwitch:S(d({deviceId:l(),switchId:lb,enabled:A()}),Wk,{kind:"mutation",auth:"admin"}),getCameraStatus:S(d({deviceId:l()}),Bw),getCameraStatuses:S(d({deviceIds:M(l()).optional()}),M(Bw).readonly()),reconcileFromDisk:S(N(),qw,{kind:"mutation",auth:"admin"}),getReconcileFromDiskStatus:S(N(),qw,{auth:"admin"}),listTemplates:S(N(),M(ig).readonly()),saveTemplate:S(d({name:o(),description:o().optional(),config:sp}),ig,{kind:"mutation",auth:"admin"}),updateTemplate:S(d({id:o(),name:o().optional(),description:o().optional(),config:sp.optional()}),ig,{kind:"mutation",auth:"admin"}),deleteTemplate:S(d({id:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"})}},X$={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 J$(e){return X$[e]??"generic"}var eQ={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 tQ(e,t){const n=kb[t];if(n===void 0)throw new Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:J$(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(eQ).map(([e,t])=>[e,tQ(e,t)])));var nQ=O(["workspace","baked","data-root"]),aQ=O(["idle","checking","staging","pending-restart","awaiting-confirmation"]),iQ=O(["in-sync","behind-patch","behind-series","ahead","unknown"]),rQ=d({state:iQ,seedVersion:o().nullable(),contractVersion:o().nullable(),contractSource:O(["registry","running"]).nullable(),message:o()}),oQ=d({fromVersion:o(),toVersion:o().nullable(),atMs:l(),reason:o()}),sQ=d({packageName:o(),runningVersion:o().nullable(),nodeRuntimeVersion:o().nullable(),activeVersion:o().nullable(),previousVersion:o().nullable(),seedVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),bootMode:nQ,updateState:aQ,pendingVersion:o().nullable(),rolledBack:oQ.nullable(),stateFileCorrupt:A(),lastCheckedAtMs:l().nullable(),imageContract:rQ.optional()}),lQ=d({packageName:o(),runningVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),checkedAtMs:l(),error:o().nullable()}),rg=d({accepted:A(),targetVersion:o().nullable(),restarting:A(),message:o()}),cQ={name:"server-management",scope:"system",mode:"singleton",methods:{getServerPackageStatus:S(N(),sQ,{auth:"admin"}),checkServerUpdate:S(N(),lQ,{kind:"mutation",auth:"admin"}),applyServerUpdate:S(d({version:o().optional()}),rg,{kind:"mutation",auth:"admin",timeoutMs:16*6e4}),rollbackServerUpdate:S(N(),rg,{kind:"mutation",auth:"admin"}),restartServer:S(N(),rg,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},Ds=$z(),uQ=d({to:it([Ds,M(Ds).min(1)]),cc:M(Ds).optional(),bcc:M(Ds).optional(),from:o().optional(),replyTo:o().optional(),subject:o(),text:o(),html:o().optional()}),dQ=d({messageId:o(),accepted:M(Ds).default([]),rejected:M(Ds).default([])}),Uw=d({ready:A(),host:o(),error:o().optional(),lastVerifiedAt:l().optional()}),pQ={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:S(uQ,dQ,{kind:"mutation",auth:"admin",access:"create"}),verify:S(N(),Uw,{kind:"mutation",auth:"admin",access:"view"}),getStatus:S(N(),Uw,{auth:"admin"})}},mQ=d({base64:o(),contentType:o()}),fQ=d({lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),lastBytes:l().nullable(),lastStreamId:o().nullable()}),hQ={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:S(d({deviceId:l(),streamId:o().optional(),force:A().optional()}),mQ.nullable()),invalidateCache:S(d({deviceId:l()}),N(),{kind:"mutation",auth:"admin"}),getSnapshotOverview:Hh(d({deviceIds:M(l()).min(1).max(200)}),M(d({deviceId:l(),lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),etag:o().nullable()}))),getDebugState:Hh(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:Hh(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:fQ,kind:"poll"}},Fw=d({userId:o(),username:o(),isAdmin:A(),provider:o(),email:o().optional(),displayName:o().optional(),hubUrl:o().optional(),scopes:M(xa).optional(),redirectUri:o().optional(),integrationId:o().optional(),jti:o().optional(),codeChallenge:o().optional(),sessionId:o().optional(),refreshTtl:it([l().int().positive(),V("never")]).optional()}),gQ={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:S(d({claims:Fw,ttlSec:it([l().int().positive(),V("never")]).optional()}),d({token:o()}),{auth:"admin"}),verifyBridgeToken:S(d({token:o()}),Fw.nullable(),{auth:"admin"})}},vQ=xt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:ne(),nodeLocal:A(),shouldSaveDiskSpace:V(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:ne(),nodeLocal:A(),shouldSaveDiskSpace:V(!1),minFreePercent:V(null)})]),yQ={name:"storage",scope:"system",mode:"singleton",methods:{resolve:S(d({location:Di,relativePath:o()}),o()),write:S(d({location:Di,relativePath:o(),data:Ut(Uint8Array)}),N(),{kind:"mutation"}),read:S(d({location:Di,relativePath:o()}),Ut(Uint8Array)),exists:S(d({location:Di,relativePath:o()}),A()),list:S(d({location:Di,prefix:o().optional()}),M(o()).readonly()),delete:S(d({location:Di,relativePath:o()}),N(),{kind:"mutation"}),getAvailableSpace:S(d({location:Di}),l().nullable()),beginUpload:S(d({location:Di,relativePath:o(),sizeBytes:l().optional()}),d({uploadId:o()}),{kind:"mutation"}),writeChunk:S(d({uploadId:o(),offset:l(),data:Ut(Uint8Array)}),N(),{kind:"mutation"}),finalizeUpload:S(d({uploadId:o()}),N(),{kind:"mutation"}),abortUpload:S(d({uploadId:o()}),N(),{kind:"mutation"}),beginDownload:S(d({location:Di,relativePath:o()}),d({downloadId:o(),sizeBytes:l()}),{kind:"mutation"}),readChunk:S(d({downloadId:o(),offset:l(),length:l()}),Ut(Uint8Array)),endDownload:S(d({downloadId:o()}),N(),{kind:"mutation"}),listLocations:S(d({type:Cv.optional()}),M(ya).readonly()),getDefaultLocation:S(d({type:Cv}),ya.nullable()),listLocationDeclarations:S(N(),M(hq).readonly()),upsertLocation:S(ya.omit({createdAt:!0,updatedAt:!0}),ya,{kind:"mutation",auth:"admin"}),deleteLocation:S(d({id:o(),force:A().optional()}),N(),{kind:"mutation",auth:"admin"}),testLocation:S(d({id:o()}),d({ok:A(),error:o().optional()}),{auth:"admin"}),listProviders:S(N(),M(vQ).readonly()),testConfig:S(d({providerId:o(),locationId:o().optional(),config:Y(o(),ne())}),d({ok:A(),error:o().optional()}),{auth:"admin"})}},bQ=d({bytes:l().int().nonnegative()}),SQ=d({reclaimedBytes:l().int().nonnegative(),exhausted:A()}),xQ={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:S(d({locationId:o()}),bQ,{auth:"admin"}),evict:S(d({locationId:o(),targetBytes:l().int().positive()}),SQ,{kind:"mutation",auth:"admin"})}},kQ={name:"storage-migration",scope:"system",mode:"singleton",methods:{plan:S(ew,W8,{auth:"admin"}),start:S(ew,d({jobId:o()}),{kind:"mutation",auth:"admin"}),status:S(d({jobId:o().optional()}),tw.nullable(),{auth:"admin"}),cancel:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),movers:S(d({}),M(X8).readonly(),{auth:"admin"}),residue:S(d({}),M(J8).readonly(),{auth:"admin"}),drain:S(eq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStart:S(dq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStatus:S(mq,pq.nullable(),{auth:"admin"}),cleanupCancel:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),history:S(d({}),M(tw).readonly(),{auth:"admin"})}},wQ=xt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:ne(),nodeLocal:A(),shouldSaveDiskSpace:V(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:ne(),nodeLocal:A(),shouldSaveDiskSpace:V(!1),minFreePercent:V(null)})]),MQ=d({ok:A(),error:o().optional()}),CQ=d({location:ya,relativePath:o(),sizeBytes:l().optional()}),AQ=d({uploadId:o()}),EQ=d({uploadId:o(),offset:l(),data:Ut(Uint8Array)}),RQ=d({uploadId:o()}),_Q=d({uploadId:o()}),TQ=d({location:ya,relativePath:o()}),IQ=d({downloadId:o(),sizeBytes:l()}),NQ=d({downloadId:o(),offset:l(),length:l()}),OQ=d({downloadId:o()}),jQ={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:S(N(),wQ,{auth:"admin"}),testLocation:S(d({config:Y(o(),ne())}),MQ,{auth:"admin"}),resolve:S(d({location:ya,relativePath:o()}),o(),{auth:"admin"}),write:S(d({location:ya,relativePath:o(),data:Ut(Uint8Array)}),N(),{kind:"mutation",auth:"admin"}),read:S(d({location:ya,relativePath:o()}),Ut(Uint8Array),{auth:"admin"}),exists:S(d({location:ya,relativePath:o()}),A(),{auth:"admin"}),list:S(d({location:ya,prefix:o().optional()}),M(o()).readonly(),{auth:"admin"}),delete:S(d({location:ya,relativePath:o()}),N(),{kind:"mutation",auth:"admin"}),getAvailableSpace:S(d({location:ya}),l().nullable(),{auth:"admin"}),beginUpload:S(CQ,AQ,{kind:"mutation",auth:"admin"}),writeChunk:S(EQ,N(),{kind:"mutation",auth:"admin"}),finalizeUpload:S(RQ,N(),{kind:"mutation",auth:"admin"}),abortUpload:S(_Q,N(),{kind:"mutation",auth:"admin"}),beginDownload:S(TQ,IQ,{kind:"mutation",auth:"admin"}),readChunk:S(NQ,Ut(Uint8Array),{auth:"admin"}),endDownload:S(OQ,N(),{kind:"mutation",auth:"admin"})}},PQ=ne().nullable(),Uv=Y(o(),ne()),Hw=d({sessionId:o(),profileId:o(),label:o(),cols:l().int().positive(),rows:l().int().positive(),startedAt:l()}),DQ=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:PQ.optional()}),ac=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:Uv}),zQ=d({stableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),adoptable:A()}),LQ=xt("kind",[d({seq:l().int().positive(),kind:V("data"),data:o()}),d({seq:l().int().positive(),kind:V("exit"),exitCode:l().int(),signal:l().int().optional()})]),qQ=d({cursor:l().int().nonnegative(),reset:A(),snapshot:o().optional(),events:M(LQ).readonly()}),BQ={name:"terminal-session",scope:"system",mode:"singleton",methods:{listProfiles:S(N(),M(DQ).readonly(),{auth:"admin"}),listInstances:S(N(),M(ac).readonly(),{auth:"admin"}),createInstance:S(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:Uv.optional()}),ac,{kind:"mutation",auth:"admin"}),updateInstance:S(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:Uv.optional()}),ac,{kind:"mutation",auth:"admin"}),deleteInstance:S(d({instanceId:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setInstanceEnabled:S(d({instanceId:o().min(1),enabled:A()}),ac,{kind:"mutation",auth:"admin"}),listLegacyCameras:S(N(),M(zQ).readonly(),{auth:"admin"}),adoptLegacyMonitor:S(d({stableId:o().min(1),name:o().trim().min(1).max(160).optional()}),ac,{kind:"mutation",auth:"admin"}),listSessions:S(N(),M(Hw).readonly(),{auth:"admin"}),openSession:S(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()}),Hw,{kind:"mutation",auth:"admin"}),resize:S(d({sessionId:o(),cols:l().int().positive(),rows:l().int().positive()}),N(),{kind:"mutation",auth:"admin"}),pullOutput:S(d({sessionId:o(),afterSeq:l().int().nonnegative(),waitMs:l().int().min(0).max(2e3).default(0),waitForOutput:A().optional()}),qQ,{kind:"mutation",auth:"admin",timeoutMs:15e3}),writeInput:S(d({sessionId:o(),data:o().max(64*1024)}),N(),{kind:"mutation",auth:"admin"}),close:S(d({sessionId:o()}),N(),{kind:"mutation",auth:"admin"})}},UQ=d({urls:it([o(),M(o())]),username:o().optional(),credential:o().optional()}),FQ={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:S(N(),M(UQ).readonly())}},HQ=d({credentialId:o(),label:o(),createdAt:l(),lastUsedAt:l().nullable(),transports:M(o()).default([])}),$Q={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:S(d({userId:o(),username:o()}),d({optionsJSON:Y(o(),ne())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:S(d({userId:o(),response:Y(o(),ne()),label:o()}),d({success:V(!0),credentialId:o()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:S(d({userId:o().optional()}),d({optionsJSON:Y(o(),ne())}),{kind:"mutation",access:"view",auth:"admin"}),finishAuthentication:S(d({userId:o(),response:Y(o(),ne())}),d({verified:A()}),{kind:"mutation",access:"view",auth:"admin"}),beginDiscoverableAuthentication:S(d({}),d({optionsJSON:Y(o(),ne())}),{kind:"mutation",access:"view",auth:"admin"}),finishDiscoverableAuthentication:S(d({response:Y(o(),ne())}),d({verified:A(),userId:o().nullable()}),{kind:"mutation",access:"view",auth:"admin"}),listPasskeys:S(d({userId:o()}),M(HQ),{auth:"admin"}),removePasskey:S(d({userId:o(),credentialId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getSecondFactorPreference:S(d({userId:o()}),d({enabled:A()}),{auth:"admin"}),setSecondFactorPreference:S(d({userId:o(),enabled:A()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"create"})}},c_=O(["cosine","dot","euclidean"]),Jc=Y(o(),it([o(),l(),A()])),u_=d({equals:Y(o(),it([o(),l(),A()])).optional(),between:Y(o(),Zc([l(),l()])).optional()}),QQ=d({id:o(),vector:o(),metadata:Jc}),VQ=d({id:o(),score:l(),metadata:Jc}),GQ=d({index:o(),dim:l().int().positive(),metric:c_.default("cosine")}),ZQ=d({index:o(),items:M(QQ)}),KQ=d({upserted:l(),rejected:l()}),WQ=d({index:o(),vector:o(),topK:l().int().positive(),minScore:l().optional(),filter:u_.optional()}),YQ=d({matches:M(VQ),scanned:l(),truncated:A(),effectiveTopK:l().int().positive()}),XQ=d({index:o(),ids:M(o())}),JQ=d({index:o(),filter:u_}),$w=d({deleted:l()}),eV=d({index:o(),ids:M(o())}),tV=d({items:M(d({id:o(),metadata:Jc}))}),nV=d({index:o(),ids:M(o())}),aV=d({items:M(d({id:o(),vector:o(),metadata:Jc}))}),iV=d({index:o(),cursor:l().int().nonnegative().default(0),limit:l().int().positive()}),rV=d({items:M(d({id:o(),metadata:Jc})),nextCursor:l().int().nonnegative().nullable()}),oV=d({index:o()}),sV=d({backend:o(),count:l(),dim:l(),metric:c_,bytes:l().optional(),exact:A()}),lV={name:"vector-store",scope:"system",mode:"singleton",internal:!0,methods:{declareIndex:S(GQ,N(),{kind:"mutation",auth:"admin"}),upsert:S(ZQ,KQ,{kind:"mutation",auth:"admin"}),query:S(WQ,YQ,{auth:"admin"}),getByIds:S(eV,tV,{auth:"admin"}),fetchByIds:S(nV,aV,{auth:"admin"}),scan:S(iV,rV,{auth:"admin"}),deleteByIds:S(XQ,$w,{kind:"mutation",auth:"admin"}),deleteByFilter:S(JQ,$w,{kind:"mutation",auth:"admin"}),stats:S(oV,sV,{auth:"admin"})}},cV=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()}),uV=d({playbackUrl:o(),playbackEndpoints:M(o()).optional(),token:o().optional()}),dV={name:"videoclips",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],methods:{listClips:S(d({deviceId:l(),since:l(),until:l(),limit:l().int().positive().optional()}),M(cV).readonly(),{kind:"query",auth:"admin"}),getClipPlayback:S(d({deviceId:l(),clipId:o()}),uV,{kind:"query",auth:"admin"})}},Qw=d({viewportWidth:l().int().positive().optional(),viewportHeight:l().int().positive().optional(),devicePixelRatio:l().positive().optional(),downlinkMbps:l().nonnegative().optional(),prefersTier:o().optional()}).partial(),lp=xt("kind",[d({kind:V("adaptive")}),d({kind:V("profile"),profile:Cn}),d({kind:V("cam-stream"),camStreamId:o().min(1)})]),pV=d({id:o(),label:o(),target:lp,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()}),mV={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[Q.Camera],methods:{listStreams:S(d({deviceId:l().int().nonnegative()}),M(pV)),createSession:S(d({deviceId:l().int().nonnegative(),target:lp,hints:Qw.optional(),relayOnly:A().optional(),consumerAttribution:_v.optional()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation"}),handleOffer:S(d({deviceId:l().int().nonnegative(),target:lp.optional(),sdpOffer:o(),sessionId:o().optional(),relayOnly:A().optional(),nonTrickle:A().optional(),disableTurn:A().optional(),disableIpv6:A().optional(),consumerAttribution:_v.optional(),hints:Qw.optional()}),d({sessionId:o(),sdpAnswer:o()}),{kind:"mutation"}),handleAnswer:S(d({deviceId:l().int().nonnegative(),sessionId:o(),sdpAnswer:o()}),N(),{kind:"mutation"}),addIceCandidate:S(d({deviceId:l().int().nonnegative(),sessionId:o(),candidate:o(),sdpMid:o().nullable().optional(),sdpMLineIndex:l().int().nullable().optional()}),N(),{kind:"mutation"}),getIceCandidates:S(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:S(d({deviceId:l().int().nonnegative(),sessionId:o()}),N(),{kind:"mutation"}),hasAdaptiveBitrate:S(d({deviceId:l().int().nonnegative(),profile:Cn}),A()),getSessionState:S(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({pendingRenegotiation:d({target:lp,epoch:l()}).nullable()}))},mount:{kind:"server-provided"}},fV=d({childDeviceIds:M(l()).readonly(),hiddenChildIds:M(l()).readonly()}),hV={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera,Q.Hub,Q.Switch,Q.Light,Q.Sensor,Q.Thermostat,Q.Cover,Q.Lock,Q.Fan,Q.MediaPlayer,Q.AlarmPanel,Q.Generic],methods:{setChildHidden:S(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:fV,kind:"command-driven"}},gV=O(["install","update","uninstall","restart"]),d_=O(["queued","fetching","staged","validating","applying","restarting","applied","done","failed","skipped"]),vV=O(["framework","addon"]),yV=d({tsMs:l(),nodeId:o(),packageName:o(),phase:d_,message:o()}),bV=d({taskId:o(),nodeId:o(),packageName:o(),fromVersion:o().nullable(),toVersion:o(),target:vV,phase:d_,stagedPath:o().nullable(),attempts:l(),steps:M(yV),error:o().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable()}),SV=O(["running","completed","failed","partially-failed","cancelled"]),xV=O(["single","bulk","cluster"]),Vw=d({jobId:o(),kind:gV,createdAtMs:l(),createdBy:o(),scope:xV,tasks:M(bV),state:SV,schemaVersion:V(1)}),Gw=O(["debug","info","warn","error"]),Fv=O(["off","latest","beta"]),p_=O(["off","latest","beta","inherit"]),kV=d({id:o(),name:o().optional(),version:o().optional(),description:o().optional(),icon:o().optional(),color:o().optional(),capabilities:M(ne()).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()}),wV=d({pid:l().optional(),mode:o(),state:o()}),MV=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()}),CV=d({manifest:kV,declaration:ne().optional(),source:o(),installSource:o().optional(),process:wV.optional(),hasBackup:A().optional(),health:MV.nullable().optional()}),AV=d({name:o(),version:o(),dir:o(),installSource:o().optional()}),EV=d({name:o(),currentVersion:o(),latestVersion:o(),category:O(["addon","core"]),requiresRestart:A(),isSystem:A()}),RV=d({version:o(),publishedAt:o(),deprecated:o().optional(),distTags:M(o()).readonly()}),_V=d({name:o(),version:o(),description:o(),keywords:M(o()).readonly(),publishedAt:o(),author:o(),installed:A(),installedVersion:o().optional()}),TV=d({channel:Fv,intervalSeconds:l(),updateCheckIntervalSeconds:l()}),IV=p_,NV=ne(),Zw=ne(),OV=ne(),jV=O(["queued","updating","done","done-pending-restart","failed"]),PV=d({name:o(),isSystem:A(),fromVersion:o(),toVersion:o(),status:jV,error:o().optional(),startedAtMs:l().optional(),completedAtMs:l().optional()}),DV=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:DV,cancelled:A(),items:M(PV).readonly()});var zV=d({packageName:o(),currentVersion:o(),latestVersion:o().nullable(),hasUpdate:A(),description:o().optional(),buildId:o().nullable()}),LV=d({timestamp:o(),level:o(),message:o(),scope:o().optional()}),qV=ne(),BV=d({addonId:o().min(1),action:o().min(1),input:ne()}),UV={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:S(N(),M(CV).readonly()),getLogs:S(d({addonId:o(),limit:l().min(1).max(500).default(100),level:Gw.optional()}),M(qV)),listPackages:S(N(),M(AV).readonly()),installPackage:S(d({packageName:o(),version:o().optional()}),Zw,{kind:"mutation",auth:"admin"}),installFromWorkspace:S(d({packageName:o()}),Zw,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:S(N(),A()),listWorkspacePackages:S(N(),M(ne()).readonly()),uninstallPackage:S(d({packageName:o()}),ne(),{kind:"mutation",auth:"admin"}),reloadPackages:S(N(),OV,{kind:"mutation",auth:"admin"}),searchAvailable:S(d({query:o().optional()}),M(_V)),listUpdates:S(d({nodeId:o().optional()}),M(EV).readonly(),{auth:"admin"}),updatePackage:S(d({name:o().min(1),version:o().optional(),nodeId:o().optional()}),ne(),{kind:"mutation",auth:"admin"}),rollbackPackage:S(d({name:o().min(1)}),d({rolledBackTo:o().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:S(d({nodeId:o().optional()}),ne(),{kind:"mutation",auth:"admin"}),restartServer:S(d({confirm:V(!0)}),ne(),{kind:"mutation",auth:"admin"}),getLastRestart:S(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:S(N(),M(zV).readonly(),{auth:"admin"}),listCapabilityProviders:S(d({capName:o().min(1)}),M(d({addonId:o(),mode:O(["singleton","collection"]),isActive:A()})).readonly()),setCapabilityProviderEnabled:S(d({capName:o().min(1),addonId:o().min(1),enabled:A()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getVersions:S(d({name:o()}),M(RV).readonly()),restartAddon:S(d({addonId:o()}),NV,{kind:"mutation",auth:"admin"}),retryLoad:S(d({packageName:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:S(N(),TV,{auth:"admin"}),setAutoUpdateSettings:S(d({channel:Fv,intervalSeconds:l().min(300).max(86400).optional(),updateCheckIntervalSeconds:l().min(900).max(604800).optional()}),ne(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:S(d({addonId:o()}),IV,{auth:"admin"}),setAddonAutoUpdate:S(d({addonId:o(),channel:p_}),ne(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:S(d({channel:Fv}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),custom:S(BV,ne(),{kind:"mutation"}),startJob:S(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:S(d({jobId:o()}),Vw.nullable(),{auth:"admin"}),listJobs:S(d({activeOnly:A().optional()}),M(Vw),{auth:"admin"}),cancelJob:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),onAddonLogs:S(d({addonId:o(),level:Gw.optional()}),LV,{kind:"subscription"})},mount:{kind:"server-provided"}},Kw=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()}),FV={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:Kw,kind:"push"},runtimeState:Kw,durability:"restored",volatileStateFields:["lastFetchedAt"]},Ww=d({lux:l().min(0),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),HV={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:Ww,kind:"push"},runtimeState:Ww,durability:"restored",volatileStateFields:["lastFetchedAt"]},$V=d({className:o(),hits:l().int().nonnegative(),avgScore:l().min(0).max(1),peakScore:l().min(0).max(1)}),Yw=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($V).readonly()}),QV=d({ts:l().int(),dbfs:l().nullable(),peakDbfs:l(),avgDbfs:l(),topClass:o().nullable(),topScore:l().min(0).max(1).nullable()}),VV=d({points:M(QV).readonly(),effectiveSampleEveryMs:l().int().positive(),windowMsActual:l().int().nonnegative()}),GV={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[Q.Camera],methods:{getCurrentSnapshot:S(d({deviceId:l()}),Yw.nullable()),getHistory:S(d({deviceId:l(),windowSec:l().int().positive().optional(),sampleEveryMs:l().int().positive().optional()}),VV)},runtimeState:Yw,durability:"session"},Xw=d({enabled:A(),isRunning:A(),lastTriggeredAt:l(),lastError:o().nullable(),lastChangedAt:l()}),ZV={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Automation],methods:{enable:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),disable:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),trigger:S(d({deviceId:l().int().nonnegative(),skipCondition:A().optional()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:Xw,kind:"push"},runtimeState:Xw,durability:"session"},og=d({percentage:l().min(0).max(100),charging:O(["dc","solar","none"]),sleeping:A(),lastUpdated:l(),lastContactAt:l().optional(),binary:A().optional()}),KV={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera,Q.Sensor,Q.Button,Q.Switch],methods:{wakeForStream:S(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:og})}},status:{schema:og,kind:"push",empty:{percentage:0,charging:"none",sleeping:!1,lastUpdated:0}},runtimeState:og,durability:"restored",volatileStateFields:["lastUpdated"]},Jw=d({on:A(),lastChangedAt:l()}),WV={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:Jw,kind:"push"},runtimeState:Jw,durability:"restored",volatileStateFields:["lastChangedAt"]},e2=d({percentage:l().min(0).max(100),lastChangedAt:l()}),YV={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Light],methods:{setBrightness:S(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:e2,kind:"command-driven"},runtimeState:e2,durability:"session"},XV={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Button],methods:{press:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})}},JV=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()}),eG=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()}),tG={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],methods:{getCredentials:S(d({deviceId:l()}),JV.nullable(),{kind:"query",auth:"admin"})},status:{schema:eG,kind:"command-driven"}},t2=d({detected:A(),lastChangedAt:l()}),nG={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:t2,kind:"push"},runtimeState:t2,durability:"restored",volatileStateFields:["lastChangedAt"]},Hv=O(["off","heat","cool","auto","heat_cool","fan_only","dry"]),n2=d({mode:Hv,availableModes:M(Hv),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()}),aG={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Thermostat,Q.Climate],methods:{setMode:S(d({deviceId:l().int().nonnegative(),mode:Hv}),N(),{kind:"mutation",auth:"admin"}),setFanMode:S(d({deviceId:l().int().nonnegative(),fanMode:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setPreset:S(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setTarget:S(d({deviceId:l().int().nonnegative(),target:l()}),N(),{kind:"mutation",auth:"admin"}),setTargetRange:S(d({deviceId:l().int().nonnegative(),targetLow:l(),targetHigh:l()}),N(),{kind:"mutation",auth:"admin"}),setTargetHumidity:S(d({deviceId:l().int().nonnegative(),targetHumidity:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setSwingVertical:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setSwingHorizontal:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:n2,kind:"push"},runtimeState:n2,durability:"session"},Pb=d({r:l().int().min(0).max(255),g:l().int().min(0).max(255),b:l().int().min(0).max(255)}),Db=d({h:l().min(0).max(360),s:l().min(0).max(100),v:l().min(0).max(100)}),iG=xt("mode",[d({mode:V("rgb"),rgb:Pb}),d({mode:V("hsv"),hsv:Db}),d({mode:V("mired"),mireds:l().int().min(50).max(1e3)})]),a2=d({mode:O(["rgb","hsv","mired"]),rgb:Pb.optional(),hsv:Db.optional(),mireds:l().int().optional(),lastChangedAt:l()}),rG={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Light],methods:{setColor:S(d({deviceId:l().int().nonnegative(),color:iG}),N(),{kind:"mutation",auth:"admin"})},events:{onColorChanged:{data:d({deviceId:l(),mode:O(["rgb","hsv","mired"]),rgb:Pb.optional(),hsv:Db.optional(),mireds:l().int().optional(),lastChangedAt:l()})}},status:{schema:a2,kind:"command-driven"},runtimeState:a2,durability:"session"},oG=xt("outcome",[d({outcome:V("validated"),latencyMs:l().nonnegative().optional(),detail:o().optional()}).strict(),d({outcome:V("rejected"),error:o()}).strict(),d({outcome:V("inconclusive"),error:o()}).strict()]),sG=d({settings:Y(o(),ne())}),lG=d({label:o()}),cG={name:"connection-test",scope:"system",mode:"collection",methods:{testSettings:S(sG,oG,{kind:"mutation",auth:"admin"}),describeTest:S(N(),lG,{auth:"admin"})}},i2=d({connected:A(),lastChangedAt:l()}),uG={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:i2,kind:"push"},runtimeState:i2,durability:"restored",volatileStateFields:["lastChangedAt"]},m_=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()}),r2=d({items:M(m_),lastChangedAt:l()}),dG={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(Q),deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:S(d({deviceId:l().int().nonnegative(),key:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:r2,kind:"push",empty:{items:[],lastChangedAt:0},itemArray:{path:"items",keyField:"key",labelField:"label",itemSchema:m_,emptyItem:{key:"",label:"",level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:r2.extend({lastFetchedAt:l()}),durability:"session"},o2=d({entryOpen:A(),lastChangedAt:l()}),pG={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:o2,kind:"push"},runtimeState:o2,durability:"restored",volatileStateFields:["lastChangedAt"]},mG=O(["numeric","select","text","datetime"]),s2=d({kind:mG,value:it([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()}),fG=xt("kind",[d({kind:V("numeric"),value:l()}),d({kind:V("select"),value:o().min(1)}),d({kind:V("text"),value:o()}),d({kind:V("datetime"),value:o().min(1)})]),hG={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Control],methods:{setValue:S(d({deviceId:l().int().nonnegative(),control:fG}),N(),{kind:"mutation",auth:"admin"})},status:{schema:s2,kind:"push"},runtimeState:s2,durability:"session"},gG=O(["open","opening","closing","closed","stopped"]),l2=d({state:gG,position:l().min(0).max(100).nullable(),tiltPosition:l().min(0).max(100).nullable(),lastChangedAt:l()}),vG={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Cover],methods:{open:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),close:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setPosition:S(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setTiltPosition:S(d({deviceId:l().int().nonnegative(),tiltPosition:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:l2,kind:"push"},runtimeState:l2,durability:"restored",volatileStateFields:["lastChangedAt"]},zb=O(["auto","day","night","schedule"]),c2=d({min:l(),max:l(),step:l()}),u2=d({mode:zb,sensitivity:l().optional(),switchDelaySec:l().optional(),lastFetchedAt:l()}),yG=d({modes:M(zb),supportsSensitivity:A(),sensitivity:c2.optional(),supportsSwitchDelay:A(),switchDelaySec:c2.optional()}),bG=d({mode:zb.optional(),sensitivity:l().optional(),switchDelaySec:l().optional()}),SG={name:"day-night",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"day-night",tab:"image"}},methods:{getOptions:S(d({deviceId:l()}),yG),setSettings:S(d({deviceId:l(),settings:bG}),N(),{kind:"mutation",auth:"admin"})},status:{schema:u2,kind:"poll"},runtimeState:u2,durability:"restored",volatileStateFields:["lastFetchedAt"]},sg=d({online:A(),lastChangedAt:l()}),xG={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:sg})}},status:{schema:sg,kind:"push"},runtimeState:sg,durability:"restored",volatileStateFields:["lastChangedAt"]},d2=d({lastPressedAt:l().nullable(),pressCountSinceStart:l()}),kG=d({deviceId:l(),timestamp:l()}),wG={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[Q.Button,Q.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:kG}},status:{schema:d2,kind:"push"},runtimeState:d2,durability:"restored"},MG=O(["date","time","datetime"]),p2=d({value:o(),format:MG.optional(),lastFetchedAt:l()}),CG={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:p2,kind:"push"},runtimeState:p2,durability:"restored",volatileStateFields:["lastFetchedAt"]},f_=d({deviceId:l(),eventType:o(),data:Y(o(),ne()).nullable(),timestamp:l(),seq:l()}),m2=d({eventTypes:M(o()),lastEvent:f_.nullable(),eventCountSinceStart:l()}),AG={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.EventEmitter],methods:{},events:{onEvent:{data:f_}},status:{schema:m2,kind:"push"},runtimeState:m2,durability:"session"},EG=d({id:o(),type:o(),timestamp:l(),label:o().optional(),thumbnailUrl:o().optional(),clipUrl:o().optional(),metadata:Y(o(),ne()).optional()}),RG={name:"events",scope:"device",mode:"singleton",deviceTypes:[Q.Camera],methods:{getEvents:S(d({deviceId:l(),from:l().optional(),to:l().optional(),limit:l().optional()}),M(EG)),getEventThumbnail:S(d({deviceId:l(),eventId:o()}),d({base64:o(),contentType:o()}).nullable()),getEventClipUrl:S(d({deviceId:l(),eventId:o()}),o().nullable())}},f2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaKey:o().optional(),coverBase64:o().optional()}),_G=d({id:o(),source:O(["detected","photo"]),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),h2=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:Zi.optional(),keyFrameMediaKey:o().optional(),bestMatchScore:l().optional(),nativeFaceShortSidePx:l().optional(),suggestedIdentityId:o().optional(),suggestedMatchScore:l().optional()}),TG=O(["unassigned","recognized","identified","all"]),IG=O(["timestamp","suggestionConfidence"]),NG=O(["asc","desc"]),OG=d({faceIds:M(o()).readonly(),representativeFaceId:o(),size:l().int(),cohesion:l()}),jG=d({key:o(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),PG={name:"face-gallery",scope:"system",mode:"singleton",methods:{listIdentities:S(d({includeCrops:A().optional()}).optional(),M(f2).readonly()),createIdentity:S(d({name:o().min(1)}),f2,{kind:"mutation",auth:"admin"}),renameIdentity:S(d({id:o(),name:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deleteIdentity:S(d({id:o()}),N(),{kind:"mutation",auth:"admin"}),listIdentitySamples:S(d({identityId:o()}),M(_G).readonly()),removeSample:S(d({identityId:o(),sampleId:o()}),N(),{kind:"mutation",auth:"admin"}),listRecentFaces:S(d({deviceId:l().int().optional(),deviceIds:M(l().int()).optional(),limit:l().int().positive().optional(),filter:TG.optional(),since:l().int().optional(),until:l().int().optional(),sortBy:IG.optional(),sortDirection:NG.optional(),includeCrops:A().optional()}).optional(),M(h2).readonly()),getFaceByTrack:S(d({deviceId:l().int(),trackId:o()}),h2.nullable()),getFaceMedia:S(d({faceId:o()}),M(jG).readonly()),assignFace:S(d({faceId:o(),identityId:o()}),N(),{kind:"mutation",auth:"admin"}),unassignFace:S(d({faceId:o()}),N(),{kind:"mutation",auth:"admin"}),deleteFace:S(d({faceId:o()}),N(),{kind:"mutation",auth:"admin"}),assignFaces:S(d({faceIds:M(o()).min(1),identityId:o()}),d({assigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignFaces:S(d({faceIds:M(o()).min(1)}),d({unassigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),suggestFaceClusters:S(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(OG).readonly())}},h_=O(["forward","reverse"]),g2=d({percentage:l().min(0).max(100).nullable(),percentageStep:l().positive().optional(),preset:o(),availablePresets:M(o()),direction:h_.nullable(),oscillating:A().nullable(),lastChangedAt:l()}),DG={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Fan],methods:{setPercentage:S(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setPreset:S(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setDirection:S(d({deviceId:l().int().nonnegative(),direction:h_}),N(),{kind:"mutation",auth:"admin"}),setOscillating:S(d({deviceId:l().int().nonnegative(),oscillating:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:g2,kind:"push"},runtimeState:g2,durability:"session"},lg=d({flags:Y(o(),ne()),deviceType:o().nullable(),model:o().nullable(),channelCount:l().nullable(),lastProbedAt:l(),lastFetchedAt:l()}),zG={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:d({deviceId:l(),status:lg})}},status:{schema:lg,kind:"push"},runtimeState:lg,durability:"session"},v2=d({flooded:A(),lastChangedAt:l()}),LG={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:v2,kind:"push"},runtimeState:v2,durability:"restored",volatileStateFields:["lastChangedAt"]},y2=d({detected:A(),lastChangedAt:l()}),qG={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:y2,kind:"push"},runtimeState:y2,durability:"restored",volatileStateFields:["lastChangedAt"]},b2=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()}),BG={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Humidifier],methods:{setOn:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setTargetHumidity:S(d({deviceId:l().int().nonnegative(),humidity:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setMode:S(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:b2,kind:"push"},runtimeState:b2,durability:"session"},S2=d({percent:l().min(0).max(100),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),UG={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor,Q.Thermostat],methods:{},status:{schema:S2,kind:"push"},runtimeState:S2,durability:"restored",volatileStateFields:["lastFetchedAt"]},x2=d({url:o().nullable(),lastUpdated:l().nullable()}),FG={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Image],methods:{},status:{schema:x2,kind:"push"},runtimeState:x2,durability:"session"},Lb=O(["0","90","180","270"]),qb=O(["auto","manual"]),Bb=O(["auto","manual"]),Ub=O(["off","blc","wdr","hlc"]),ic=d({min:l(),max:l(),step:l()}),k2=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Lb.optional(),whiteBalance:qb.optional(),warmth:l().optional(),exposureMode:Bb.optional(),backlightMode:Ub.optional(),lastFetchedAt:l()}),HG=d({supportsBrightness:A(),brightness:ic.optional(),supportsContrast:A(),contrast:ic.optional(),supportsSaturation:A(),saturation:ic.optional(),supportsSharpness:A(),sharpness:ic.optional(),supportsMirror:A(),supportsFlip:A(),rotateOptions:M(Lb),whiteBalanceModes:M(qb),supportsWarmth:A(),warmth:ic.optional(),exposureModes:M(Bb),backlightModes:M(Ub)}),$G=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:Lb.optional(),whiteBalance:qb.optional(),warmth:l().optional(),exposureMode:Bb.optional(),backlightMode:Ub.optional()}),QG={name:"image-settings",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"image-settings",tab:"image"}},methods:{getOptions:S(d({deviceId:l()}),HG),setSettings:S(d({deviceId:l(),settings:$G}),N(),{kind:"mutation",auth:"admin"})},status:{schema:k2,kind:"poll"},runtimeState:k2,durability:"restored",volatileStateFields:["lastFetchedAt"]},w2=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),ne()).readonly(),createdAt:l(),updatedAt:l(),processState:o()}),cg=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),ne()).readonly(),createdAt:l(),updatedAt:l()}),VG=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()}),GG=O(["validated","rejected","inconclusive","unsupported"]),ZG=d({success:A(),error:o().optional(),status:GG.optional(),testedBy:o().nullable().optional(),latencyMs:l().nonnegative().optional(),detail:o().optional()}),KG=d({addonId:o(),name:o(),enabled:A().optional(),info:Y(o(),ne()).optional(),settings:Y(o(),ne()).optional(),skipRestart:A().optional()}),WG=d({id:o(),name:o().optional(),enabled:A().optional(),info:Y(o(),ne()).optional()}),YG=d({success:A(),deletedId:o()}),XG={name:"integrations",scope:"system",mode:"singleton",methods:{list:S(N(),M(w2)),get:S(d({id:o()}),w2),getByAddonId:S(d({addonId:o()}),cg.nullable()),create:S(KG,cg,{kind:"mutation",auth:"admin"}),update:S(WG,cg,{kind:"mutation",auth:"admin"}),delete:S(d({id:o()}),YG,{kind:"mutation",auth:"admin"}),getSettings:S(d({id:o()}),Y(o(),ne()),{auth:"admin"}),setSettings:S(d({id:o(),settings:Y(o(),ne())}),d({success:A()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:S(N(),M(VG),{auth:"admin"}),testConnection:S(d({addonId:o(),settings:Y(o(),ne())}),ZG,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},JG=d({codecs:M(o()),sampleRate:l(),duplex:O(["half","full"]),maxBacklogMs:l()}),ug=d({talking:A(),lastSessionAt:l().nullable(),ability:JG.nullable()}),eZ=O(["opus","s16le","g711ulaw","g711alaw"]),tZ={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],methods:{startSession:S(d({deviceId:l()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation",auth:"protected"}),handleAnswer:S(d({deviceId:l(),sessionId:o(),sdpAnswer:o()}),N(),{kind:"mutation",auth:"protected"}),stopSession:S(d({deviceId:l(),sessionId:o()}),N(),{kind:"mutation",auth:"protected"}),startTalkSession:S(d({deviceId:l()}),d({sessionId:o()}),{kind:"mutation",auth:"protected"}),pushTalkAudio:S(d({deviceId:l(),audioBase64:o(),codec:eZ.optional(),sampleRate:l().int().positive().optional(),channels:l().int().positive().optional(),sequenceNumber:l().int()}),d({accepted:A()}),{kind:"mutation",auth:"protected"}),endTalkSession:S(d({deviceId:l()}),N(),{kind:"mutation",auth:"protected"})},events:{onStatusChanged:{data:d({deviceId:l(),status:ug})}},status:{schema:ug,kind:"command-driven"},runtimeState:ug,durability:"session"},nZ=O(["idle","mowing","paused","docked","error"]),aZ=O(["info","warning","error"]),M2=d({activity:nZ,batteryLevel:l().min(0).max(100).nullable(),progressPercent:l().min(0).max(100).nullable(),currentCode:l().nullable(),currentCodeLabel:o().nullable(),severity:aZ,lastChangedAt:l()}),iZ={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.LawnMower],methods:{startMowing:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),dock:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:M2,kind:"push"},runtimeState:M2,durability:"session"},rZ=O(["lan","wifi","docker","vpn","loopback","other"]),g_=d({name:o(),family:O(["IPv4","IPv6"]),address:o(),cidr:o(),netmask:o(),internal:A(),mac:o(),kind:rZ,preferred:A(),plausible:A(),plausibleReason:o()}),oZ=d({interfaces:M(g_).readonly(),probedAt:l()}),sZ=g_.nullable(),lZ=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()}),cZ=O(["server-config","server-env","caller-hint","default"]),uZ=d({port:l().int().min(1).max(65535),source:cZ}),dZ=d({endpoints:M(lZ).readonly(),localPort:uZ}),C2=d({baseUrl:o().nullable(),resolved:o().nullable()}),A2=d({baseUrls:M(o()).readonly(),resolved:M(o()).readonly()}),dg=d({addresses:M(o()).readonly()}),jd=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()}),pZ={name:"local-network",scope:"system",mode:"singleton",methods:{list:S(N(),oZ),getPreferred:S(N(),sZ),getConnectionEndpoints:S(d({port:l().int().min(1).max(65535).optional(),includeLoopback:A().optional(),ipv4Only:A().optional(),scheme:O(["http","https"]).optional()}),dZ),getNotificationEndpoint:S(N(),C2),setNotificationEndpoint:S(d({baseUrl:o().nullable()}),C2,{kind:"mutation"}),getViewerEndpoints:S(N(),A2),setViewerEndpoints:S(d({baseUrls:M(o()).readonly()}),A2,{kind:"mutation"}),getAllowedAddresses:S(N(),dg),setAllowedAddresses:S(dg,d({success:V(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:S(N(),dg,{kind:"mutation"}),getTlsStatus:S(N(),jd),regenerateCertificate:S(d({reason:o().optional()}),jd,{kind:"mutation",auth:"admin"}),uploadCertificate:S(d({certPem:o().min(1),keyPem:o().min(1),caPem:o().optional()}),jd,{kind:"mutation",auth:"admin"}),downloadCa:S(N(),d({pem:o()})),revertToGeneratedCertificate:S(N(),jd,{kind:"mutation",auth:"admin"})},mount:{kind:"hub-only"}},mZ=O(["locked","unlocked","locking","unlocking","jammed"]),E2=d({state:mZ,lastChangedAt:l()}),fZ={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Lock],methods:{lock:S(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),unlock:S(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),N(),{kind:"mutation",auth:"admin"}),open:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:E2,kind:"push"},runtimeState:E2,durability:"restored",volatileStateFields:["lastChangedAt"]},hZ=O(["off","on","idle","playing","paused","buffering","standby"]),v_=O(["off","all","one"]),gZ=d({type:o(),title:o(),artist:o().optional(),album:o().optional(),imageUrl:o().optional()}),R2=d({state:hZ,volumeLevel:l().min(0).max(100).nullable(),isMuted:A().nullable(),source:o(),availableSources:M(o()),currentMedia:gZ.nullable(),positionMs:l().int().nonnegative().nullable(),durationMs:l().int().nonnegative().nullable(),shuffle:A().nullable(),repeat:v_.nullable(),lastChangedAt:l()}),vZ={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.MediaPlayer],methods:{play:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),next:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),previous:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),seek:S(d({deviceId:l().int().nonnegative(),positionMs:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setVolume:S(d({deviceId:l().int().nonnegative(),volumeLevel:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"}),setMute:S(d({deviceId:l().int().nonnegative(),muted:A()}),N(),{kind:"mutation",auth:"admin"}),setShuffle:S(d({deviceId:l().int().nonnegative(),shuffle:A()}),N(),{kind:"mutation",auth:"admin"}),setRepeat:S(d({deviceId:l().int().nonnegative(),repeat:v_}),N(),{kind:"mutation",auth:"admin"}),selectSource:S(d({deviceId:l().int().nonnegative(),source:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),playMedia:S(d({deviceId:l().int().nonnegative(),mediaId:o().min(1),mediaType:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:R2,kind:"push"},runtimeState:R2,durability:"session"},yZ=d({id:o(),label:o(),scope:O(["mesh","public"]),url:o(),hostname:o(),port:l(),protocol:O(["http","https"])}),bZ=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()}),SZ=d({joined:A(),meshIp:o(),magicDnsHostname:o(),peerCount:l(),endpoints:M(yZ).readonly(),error:o().optional(),tenantName:o(),magicDnsSuffix:o(),userLogin:o().nullable(),controlPlaneUrl:o(),keyExpiry:l().nullable(),daemonSocket:o().optional(),daemonCliPath:o().optional()}),xZ={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:S(N(),SZ),join:S(d({authKey:o().min(8),hostname:o().optional()}),d({joined:V(!0)}),{kind:"mutation"}),startLogin:S(d({hostname:o().optional()}),d({loginUrl:o()}),{kind:"mutation"}),leave:S(N(),d({left:V(!0)}),{kind:"mutation"}),logout:S(N(),d({loggedOut:V(!0)}),{kind:"mutation"}),listPeers:S(N(),d({peers:M(bZ).readonly()})),testConnection:S(d({authKey:o().optional()}),d({ok:A(),tenant:o().optional(),daemonVersion:o().optional(),error:o().optional()}),{kind:"mutation"})}},_2=d({detected:A(),lastDetectedAt:l().nullable(),autoClearAfterMs:l().nullable()}),kZ=d({deviceId:l(),detected:A(),timestamp:l(),source:Ob,regions:M(Dp).readonly().optional()}),wZ={name:"motion",scope:"device",mode:"singleton",deviceNative:!0,deviceTypes:[Q.Camera,Q.Sensor],methods:{isDetected:S(d({deviceId:l()}),A())},events:{onMotionChanged:{data:kZ}},status:{schema:_2,kind:"push"},runtimeState:_2,durability:"session"},y_=d({enabled:A(),lastChangedAt:l()}),MZ=y_.extend({lastFetchedAt:l()}),CZ={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Light,Q.Siren,Q.Switch],methods:{setMotionTrigger:S(d({deviceId:l().int().nonnegative(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:d({deviceId:l(),enabled:A(),lastChangedAt:l()})}},status:{schema:y_,kind:"command-driven"},runtimeState:MZ,durability:"session"},b_=d({id:l(),enabled:A(),shape:jR}),T2=d({enabled:A(),sensitivity:l(),regions:M(b_),lastFetchedAt:l()}),AZ=d({maxRegions:l(),supportedShapes:M(PR),grid:GU,sensitivity:d({min:l(),max:l(),step:l()})}),EZ=d({enabled:A().optional(),sensitivity:l().optional(),regions:M(b_).optional()}),RZ={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:S(d({deviceId:l()}),AZ),setZone:S(d({deviceId:l(),patch:EZ}),N(),{kind:"mutation",auth:"admin"})},status:{schema:T2,kind:"poll"},runtimeState:T2,durability:"restored",volatileStateFields:["lastFetchedAt"]},$v=O(["person","vehicle","animal","face","package","other"]),S_=d({class:$v,timestamp:l(),confidence:l().min(0).max(1).optional()}),x_=d({lastByClass:xL($v,S_.nullable()),supportedClasses:M($v).readonly(),enabled:A()}),_Z=x_.extend({lastFetchedAt:l()}),TZ={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],methods:{setEnabled:S(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:d({deviceId:l(),detection:S_})}},status:{schema:x_,kind:"push"},runtimeState:_Z,durability:"restored",volatileStateFields:["lastFetchedAt"]},IZ=d({nominalBitrateKbps:l(),observedBitrateKbps:l(),peakBitrateKbps:l(),packetLossPercent:l(),lastUpdated:l()}),NZ=d({rttMs:l(),jitterMs:l(),estimatedBandwidthKbps:l(),packetLossPercent:l().min(0).max(100),lastUpdated:l()}),I2=d({deviceId:l(),streams:Y(o(),IZ),client:NZ.optional()}),OZ={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:S(d({deviceId:l()}),I2.nullable()),getAllStats:S(N(),M(I2).readonly()),reportClientStats:S(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"}},jZ=d({addonId:o(),capabilities:M(o()).readonly(),status:o()}),PZ=d({pid:l(),name:o(),state:o(),cpuPercent:l(),memoryRss:l(),uptimeSeconds:l(),services:M(jZ).readonly(),groupId:o().optional()}),DZ=d({id:o(),status:o(),cpuPercent:l(),memoryRss:l()}),zZ=d({category:o(),total:l(),healthy:l(),addons:M(DZ).readonly()}),LZ=d({name:o(),version:o()}),qZ=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(PZ).readonly(),categories:M(zZ).readonly(),rootPackage:LZ.nullable()}),BZ=d({callerAddonId:o(),providerAddonId:o(),capName:o(),callsPerMin:l(),lastCallAtMs:l()}),UZ=d({nodeId:o(),name:o(),version:o(),status:o(),synced:A()}),FZ=d({hubVersion:o(),nodes:M(UZ)}),pg=d({nodeId:o(),addonId:o()}),HZ=d({id:o(),status:o(),version:o().optional(),packageName:o().optional()}),rc=d({success:A()}),$Z=d({success:A(),reason:o().optional()}),QZ=d({restarted:M(o()).readonly(),failed:M(o()).readonly()}),VZ=d({nodeId:o(),name:o()}),GZ={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:S(N(),M(qZ).readonly(),{auth:"admin"}),deployAddon:S(pg,rc,{kind:"mutation",auth:"admin"}),undeployAddon:S(pg,rc,{kind:"mutation",auth:"admin"}),restartAddon:S(pg,rc,{kind:"mutation",auth:"admin"}),restartProcess:S(d({nodeId:o(),processName:o()}),$Z,{kind:"mutation",auth:"admin"}),restartNode:S(d({nodeId:o()}),QZ,{kind:"mutation",auth:"admin"}),shutdownNode:S(d({nodeId:o()}),rc,{kind:"mutation",auth:"admin"}),renameNode:S(d({nodeId:o(),name:o().min(1).max(64)}),VZ,{kind:"mutation",auth:"admin"}),clusterAddonStatus:S(N(),Y(o(),FZ),{auth:"admin"}),getCapUsageGraph:S(d({windowSeconds:l().int().positive().max(300).default(60)}),M(BZ).readonly(),{auth:"admin"}),getNodeAddons:S(d({nodeId:o()}),M(HZ).readonly(),{auth:"admin"}),setProcessLogLevel:S(d({nodeId:o(),level:o()}),rc,{kind:"mutation",auth:"admin"}),executeQuery:S(d({nodeId:o(),addonId:o(),queryName:o(),params:Y(o(),ne()).optional()}),ne(),{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},ZZ=O(["min","low","normal","high"]),KZ=d({id:o().min(1),title:o().min(1),uri:Qz().optional(),destructive:A().optional()}),WZ=d({image:A(),priority:A(),data:A(),actions:A(),recipients:A()}),N2=d({lastSentAt:l(),lastError:o().nullable(),queueDepth:l().int().nonnegative(),supports:WZ}),YZ=d({deviceId:l().int().nonnegative(),title:o().optional(),body:o().min(1),image:o().optional(),priority:ZZ.optional(),channel:o().optional(),recipients:M(o()).optional(),actions:M(KZ).optional(),data:Y(o(),ne()).optional()}),XZ=d({notificationId:o(),acceptedAt:l()}),JZ={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Notifier],methods:{send:S(YZ,XZ,{kind:"mutation",auth:"admin"}),cancel:S(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:N2,kind:"command-driven"},runtimeState:N2,durability:"session"},O2=d({value:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional(),lastFetchedAt:l()}),eK={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:O2,kind:"push"},runtimeState:O2,durability:"restored",volatileStateFields:["lastFetchedAt"]},k_=O(["text","timestamp","watermark"]),Qv=O(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),tK=d({id:o(),kind:k_,enabled:A(),text:o().optional(),position:Qv.optional(),availablePositions:M(Qv).readonly(),readOnly:A().optional()}),j2=d({overlays:M(tK).readonly()}),nK=d({enabled:A().optional(),text:o().optional(),position:Qv.optional()}).partial(),aK={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],methods:{setOverlay:S(d({deviceId:l(),overlayId:o(),patch:nK}),N(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:d({deviceId:l(),status:j2})}},status:{schema:j2,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}}}]}},iK=xt("kind",[d({kind:V("static"),text:o().max(64)}),d({kind:V("clock"),pattern:o().min(1).max(32).default("HH:mm"),timezone:o().min(1).max(64).optional()}),d({kind:V("device-state"),deviceId:l().int().optional(),capName:o().min(1).max(64),valuePath:o().min(1).max(64)}),d({kind:V("latest-recognition"),recognition:O(["person","plate"])})]),Vv=d({enabled:A().default(!0),source:iK,template:o().max(96).default("${value}"),maxCharacters:l().int().min(4).max(64).optional(),maxDecimals:l().int().min(0).max(4).default(1),unitLabel:o().max(8).optional(),valueMap:Y(o(),o()).optional(),schedule:hm.optional(),conditions:Ab.optional(),fallbackText:o().max(64).default("")}),P2=d({slotId:o(),kind:k_,readOnly:A(),cameraEnabled:A(),cameraText:o().optional(),binding:Vv.nullable()}),rK=O(["written","unchanged","gated","unreadable","disabled","unbound","failed"]),mg=d({slotId:o(),outcome:rK,text:o(),reason:o().optional()}),oK=O(["number","boolean","string","enum"]),sK=d({deviceId:l().int(),deviceName:o(),capName:o(),valuePath:o(),label:o(),valueType:oK,enumValues:M(o()).readonly().optional()}),lK={name:"osd-manager",scope:"system",mode:"singleton",methods:{getDeviceOsd:S(d({deviceId:l().int()}),d({supported:A(),slots:M(P2)}),{auth:"admin"}),getSourceCatalog:S(d({deviceId:l().int()}),d({sources:M(sK)}),{auth:"admin"}),getConditionSupport:S(d({}),d({supported:M(o()),catalog:M(BR)}),{auth:"admin"}),setSlotBinding:S(d({deviceId:l().int(),slotId:o().min(1),binding:Vv}),d({slot:P2,render:mg}),{kind:"mutation",auth:"admin"}),clearSlotBinding:S(d({deviceId:l().int(),slotId:o().min(1)}),d({success:V(!0)}),{kind:"mutation",auth:"admin"}),copyDeviceConfiguration:S(d({sourceDeviceId:l().int(),targetDeviceId:l().int()}),d({copied:l().int().nonnegative(),skipped:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),previewSlot:S(d({deviceId:l().int(),slotId:o().min(1),binding:Vv.optional()}),mg,{kind:"mutation",auth:"admin"}),renderDevice:S(d({deviceId:l().int()}),d({results:M(mg)}),{kind:"mutation",auth:"admin"})}},w_=4,Fb=200,cK=O(["normal","offline","on_batteries"]),fg=l().int().min(4).max(200),D2=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:cK.nullable(),error:o().nullable(),errorCode:l().nullable(),isDualHopper:A(),childLock:A(),indicatorLight:A(),feedSound:A(),volume:l(),lastFetchedAt:l()}),uK={name:"pet-feeder",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.PetFeeder],methods:{feed:S(d({deviceId:l().int().nonnegative(),grams:fg.optional(),hopper1:fg.optional(),hopper2:fg.optional()}),N(),{kind:"mutation",auth:"admin"}),cancelFeed:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),resetDesiccant:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),markFoodReplenished:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),callPet:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),playSound:S(d({deviceId:l().int().nonnegative(),soundId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setChildLock:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setIndicatorLight:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setFeedSound:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"}),setVolume:S(d({deviceId:l().int().nonnegative(),level:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:D2,kind:"poll"},runtimeState:D2,durability:"session"},z2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaKey:o().optional(),coverBase64:o().optional()}),dK=d({id:o(),text:o(),score:l(),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),hg=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:Zi.optional(),keyFrameMediaKey:o().optional(),base64:o().optional(),cropUrl:o().optional()}),pK=d({key:o(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),mK=d({plateIds:M(o()).readonly(),representativePlateId:o(),representativeText:o(),size:l().int(),cohesion:l()}),fK={name:"plate-gallery",scope:"system",mode:"singleton",methods:{listPlates:S(d({deviceId:l().int().optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}).optional(),M(hg).readonly()),getPlateByTrack:S(d({deviceId:l().int(),trackId:o()}),hg.nullable()),getPlateMedia:S(d({plateId:o()}),M(pK).readonly()),searchPlates:S(d({text:o().min(1),maxDistance:l().int().min(0).optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}),M(hg).readonly()),suggestPlateClusters:S(d({maxDistance:l().int().min(0).optional(),minClusterSize:l().int().min(2).optional(),limit:l().int().positive().optional()}).optional(),M(mK).readonly()),correctPlateText:S(d({plateId:o(),text:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deletePlate:S(d({plateId:o()}),N(),{kind:"mutation",auth:"admin"}),listVehicles:S(d({includeCrops:A().optional()}).optional(),M(z2).readonly()),createVehicle:S(d({name:o().min(1)}),z2,{kind:"mutation",auth:"admin"}),renameVehicle:S(d({id:o(),name:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),deleteVehicle:S(d({id:o()}),N(),{kind:"mutation",auth:"admin"}),listVehicleSamples:S(d({vehicleId:o()}),M(dK).readonly()),removeVehicleSample:S(d({vehicleId:o(),sampleId:o()}),N(),{kind:"mutation",auth:"admin"}),assignPlate:S(d({plateId:o(),vehicleId:o()}),N(),{kind:"mutation",auth:"admin"}),unassignPlate:S(d({plateId:o()}),N(),{kind:"mutation",auth:"admin"}),assignPlates:S(d({plateIds:M(o()).min(1),vehicleId:o()}),d({assigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignPlates:S(d({plateIds:M(o()).min(1)}),d({unassigned:l().int(),failed:M(o()).readonly()}),{kind:"mutation",auth:"admin"})}},M_=O(dm),hK=O(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),gK=d({preferred:M(o()).readonly(),rationale:o()}),Gv=O(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),vK=d({encoder:Gv,codec:O(["H264","H265"]),family:O(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:A(),reason:o().optional()});d({encoders:M(vK).readonly(),defaultH264:Gv,defaultH265:Gv,probedAt:l()});d({methods:M(o()).readonly(),probedAt:l()});var yK=O(["darwin","linux","win32"]),bK=O(["arm64","x64"]),SK=d({type:O(["nvidia","amd","intel","apple"]),name:o(),memoryMB:l().optional()}),xK=d({type:O(["apple-ane","intel-npu"])}),kK=d({type:V("coral-edgetpu"),bus:o().optional()}),C_=d({platform:yK,arch:bK,cpuModel:o(),cpuCores:l(),totalRAM_MB:l(),availableRAM_MB:l(),gpu:SK.nullable(),npu:xK.nullable(),coral:kK.nullable().optional()}),L2=d({runtime:O(["node","python"]),backend:o(),format:O(["onnx","coreml","openvino","tflite"]),score:l(),reason:o(),available:A()}),wK=d({key:o(),backend:o(),device:o(),format:M_,runtime:V("python"),score:l(),available:A()}),MK=d({hardware:C_,scores:M(L2).readonly(),bestScore:L2,pythonPath:o().nullable(),devices:M(wK).readonly()}),CK=d({modelId:o(),name:o(),minRAM_MB:l(),accuracyScore:l(),formats:M(o()).readonly()}),AK=d({modelId:o(),runtime:O(["node","python"]),backend:o(),format:M_,reason:o()}),EK={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:S(N(),MK),getHardware:S(N(),C_),resolveInferenceConfig:S(d({requirements:M(CK).readonly()}),AK),resolveHwAccel:S(d({prefer:hK}),gK)}},q2=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()}),RK={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:q2,kind:"push"},runtimeState:q2,durability:"restored",volatileStateFields:["lastFetchedAt"]},_K=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),accuracyMeters:l().nonnegative()}),B2=d({state:o(),location:o().nullable(),gps:_K.nullable(),batteryPercent:l().min(0).max(100).nullable(),lastChangedAt:l()}),TK={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Presence],methods:{},status:{schema:B2,kind:"push"},runtimeState:B2,durability:"restored",volatileStateFields:["lastChangedAt"]},U2=d({hpa:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),IK={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:U2,kind:"push"},runtimeState:U2,durability:"restored",volatileStateFields:["lastFetchedAt"]},NK=xt("kind",[Ws,fm]),A_=d({id:l(),enabled:A(),shape:NK}),F2=d({enabled:A(),regions:M(A_),audioEnabled:A().nullable(),lastFetchedAt:l()}),OK=d({maxRegions:l(),supportedShapes:M(PR),polygonVertices:VU.optional(),supportsAudioMute:A()}),jK=d({enabled:A().optional(),regions:M(A_).optional()}),PK={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:S(d({deviceId:l()}),OK),setMask:S(d({deviceId:l(),patch:jK}),N(),{kind:"mutation",auth:"admin"}),setAudioEnabled:S(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:F2,kind:"poll"},runtimeState:F2,durability:"restored",volatileStateFields:["lastFetchedAt"]},DK=d({id:o(),name:o()}),E_=d({pan:l(),tilt:l(),zoom:l()}),H2=d({pan:l().optional(),tilt:l().optional(),zoom:l().optional(),speed:l().optional()}),zK=E_.extend({autofocus:A()}),LK=d({hasPan:A(),hasTilt:A(),hasZoom:A(),supportsPresets:A(),maxPresets:l().optional(),hasAutofocus:A()}),qK={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:S(H2.extend({deviceId:l()}),N(),{kind:"mutation"}),continuousMove:S(H2.extend({deviceId:l()}),N(),{kind:"mutation"}),stop:S(d({deviceId:l()}),N(),{kind:"mutation"}),getPresets:S(d({deviceId:l()}),M(DK)),goToPreset:S(d({deviceId:l(),presetId:o()}),N(),{kind:"mutation"}),savePreset:S(d({deviceId:l(),presetId:o(),name:o()}),N(),{kind:"mutation",auth:"admin"}),deletePreset:S(d({deviceId:l(),presetId:o()}),N(),{kind:"mutation",auth:"admin"}),getOptions:S(d({deviceId:l()}),LK),goHome:S(d({deviceId:l()}),N(),{kind:"mutation"}),getPosition:S(d({deviceId:l()}),E_),setAutofocus:S(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation"})},status:{schema:zK,kind:"command-driven"}},BK=o().describe("Vendor target string (people/vehicle/pet); empty = camera default"),Zv=d({targetType:BK,stopDelaySeconds:l().int().min(0).max(300),disappearDelaySeconds:l().int().min(0).max(300)}),UK=d({value:o(),label:o()}),cp=d({enabled:A(),lastChangedAt:l(),currentSettings:Zv.nullable(),supportedTargetTypes:M(UK)}),FK=cp.extend({lastFetchedAt:l()}),HK={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:S(d({deviceId:l()}),cp),setEnabled:S(d({deviceId:l(),enabled:A()}),N(),{kind:"mutation"}),getSettings:S(d({deviceId:l()}),Zv.nullable()),setSettings:S(d({deviceId:l(),settings:Zv.partial()}),N(),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:cp})}},status:{schema:cp,kind:"command-driven"},runtimeState:FK,durability:"session"},$K={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera,Q.Sensor,Q.Switch],methods:{reboot:S(d({deviceId:l().int().nonnegative()}),d({success:V(!0)}),{kind:"mutation",auth:"admin"})}},$2=d({deviceId:l(),enabled:A(),activeMode:O(["off","continuous","events"]),nodeId:o(),storageBytes:l()}),QK=d({profile:o(),startMs:l(),endMs:l()}),VK=d({deviceId:l(),ranges:M(QK)}),GK=d({deviceId:l(),days:M(l())}),ZK=d({deviceId:l(),localMasterPath:o().nullable(),playbackUrl:o().nullable(),playbackEndpoints:M(o())}),KK=d({deviceId:l(),usedBytes:l(),oldestMs:l().nullable().optional()}),WK=d({locationId:o().nullable(),locationIds:M(o()).optional(),root:o().optional(),usedBytes:l(),availableBytes:l().nullable(),totalBytes:l().nullable()}),YK=d({nodeId:o(),totalUsedBytes:l(),devices:M(KK),locations:M(WK).optional()}),XK=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o(),bytes:l(),files:l().int()}),JK=O(["unassigned","target-not-writable","below-threshold","no-headroom"]),eW=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o().nullable(),bytes:l(),reason:JK}),Q2=d({moves:M(XK),skipped:M(eW),bytesToMove:l(),jobIds:M(o())}),V2=d({throttleMbps:l().min(1).max(1e3).optional(),minMoveGb:l().min(0).optional()}),tW=d({deviceId:l().int(),profile:o(),locationId:o()}),nW=d({deviceId:l().int(),locationId:o()}),aW=d({assignments:M(tW),pins:M(nW),defaultLocations:Y(o(),o())}),iW=d({deviceId:l().int(),locationId:o().nullable()}),rW=xt("kind",[d({kind:V("segment"),startMs:l(),durMs:l(),bytes:l()}),d({kind:V("gap"),nearestEdgeMs:l().nullable(),prevEndMs:l().nullable().optional()})]),oW=d({data:Ut(Uint8Array)}),sW=d({data:Ut(Uint8Array),gopStartMs:l(),gopDurMs:l()}),lW=xt("kind",[d({kind:V("ok"),data:Ut(Uint8Array),gopStartMs:l(),gopDurMs:l(),reachesRequestedEnd:A()}),d({kind:V("spans-multiple-segments"),segmentEndMs:l()})]),cW={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:$2,kind:"command-driven"},methods:{getAvailability:S(d({deviceId:l(),fromMs:l(),toMs:l()}),VK,{kind:"query",auth:"protected"}),getDaysWithRecordings:S(d({deviceId:l(),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),GK,{kind:"query",auth:"protected"}),getPlaybackManifest:S(d({deviceId:l(),fromMs:l(),toMs:l()}),ZK,{kind:"query",auth:"protected"}),getStorageUsage:S(d({}),YK,{kind:"query",auth:"admin"}),getDeviceConfig:S(d({deviceId:l()}),$h,{kind:"query",auth:"admin"}),locateSegment:S(d({deviceId:l(),profile:o(),epochMs:l()}),rW,{kind:"query",auth:"admin"}),readSegmentBytes:S(d({deviceId:l(),profile:o(),startMs:l()}),oW,{kind:"query",auth:"admin"}),readGopBytes:S(d({deviceId:l(),profile:o(),startMs:l(),epochMs:l()}),sW,{kind:"query",auth:"admin"}),readWindowBytes:S(d({deviceId:l(),profile:o(),startMs:l(),fromMs:l(),toMs:l()}),lW,{kind:"query",auth:"admin"}),setDeviceConfig:S(d({deviceId:l(),config:$h}),$h,{kind:"mutation",auth:"admin"}),rescanStorage:S(d({deviceId:l()}),$2,{kind:"mutation",auth:"admin"}),pruneFootage:S(d({deviceId:l(),reason:cb.optional()}),d({floorMs:l().nullable(),deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),deleteFootprint:S(d({deviceId:l(),fromMs:l().optional(),toMs:l().optional()}),d({deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),listOpsLog:S(UE,M(BE).readonly(),{kind:"query",auth:"admin"}),renderGif:S(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:S(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:S(Nr,d({paused:V(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:S(Nr,d({resumed:V(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:S(Nr,d({refreshed:V(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:S(U8,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:S(d({jobId:o()}),Tc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateFootage:S(VE,d({jobId:o()}),{kind:"mutation",auth:"admin"}),listRelocateJobs:S(d({}),M(Tc).readonly(),{kind:"query",auth:"admin"}),getRelocateResidue:S(tq,nq,{kind:"query",auth:"admin"}),reconcileLedgerAgainstDisk:S(aq,sq,{kind:"mutation",auth:"admin"}),cancelRelocateJob:S(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),planStorageRebalance:S(V2,Q2,{kind:"query",auth:"admin"}),startStorageRebalance:S(V2,Q2,{kind:"mutation",auth:"admin"}),getPlacement:S(d({}),aW,{kind:"query",auth:"admin"}),setDevicePlacement:S(iW,d({ok:V(!0)}),{kind:"mutation",auth:"admin"})}},uW=l().min(.25).max(32),dW=d({fromSec:l().nonnegative(),toSec:l().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:"dense range must have toSec > fromSec"}),pW=d({everyMs:l().int().positive(),ranges:M(dW).min(1).max(200)}),mW=d({everyMs:l().int().positive(),outputFps:l().int().min(1).max(60).optional(),dense:pW.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:ob.custom,message:"dense.everyMs must be strictly smaller than the base everyMs",path:["dense","everyMs"]})}),R_=d({speed:uW.optional(),timelapse:mW.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:ob.custom,message:"speed and timelapse are mutually exclusive",path:["timelapse"]})}),fW=O(["queued","rendering","ready","failed","expired","deleted"]),oc=d({id:o(),deviceId:l(),profile:o(),fromMs:l(),toMs:l(),options:R_,state:fW,progressPct:l().nullable(),fileBytes:l().nullable(),expiresAt:l(),deleteAfterDownload:A(),downloadedAt:l().nullable(),createdAt:l(),createdBy:o(),error:o().nullable()}),hW=d({url:o(),endpoints:M(o())}),gW=d({base64:o(),contentType:o(),name:o(),bytes:l().int().nonnegative()}),vW={name:"recording-export",scope:"system",mode:"singleton",methods:{createExport:S(d({deviceId:l(),profile:o().optional(),profiles:M(o()).min(1).optional(),fromMs:l(),toMs:l(),options:R_}).superRefine((e,t)=>{(e.profiles!==void 0&&e.profiles.length>0?e.profiles:e.profile!==void 0?[e.profile]:[]).length<1&&t.addIssue({code:ob.custom,message:"pass profiles[] (min 1) or legacy profile",path:["profiles"]})}),oc,{kind:"mutation",auth:"protected"}),listExports:S(d({deviceId:l().optional()}),M(oc),{kind:"query",auth:"protected"}),getExport:S(d({exportId:o()}),oc,{kind:"query",auth:"protected"}),cancelExport:S(d({exportId:o()}),oc,{kind:"mutation",auth:"protected"}),deleteExport:S(d({exportId:o()}),oc,{kind:"mutation",auth:"protected"}),getDownloadUrl:S(d({exportId:o()}),hW,{kind:"query",auth:"protected"}),readExportBytes:S(d({exportId:o()}),gW,{kind:"query",auth:"protected"})}},xc=o(),__=O(["skip","judge-anyway"]),yW=O(["matched","diverged","unknown"]),bW=O(["no-reference-for-condition","view-shifted","no-vision-profile","encoder-model-changed","no-snapshot"]),SW=d({embedding:M(l()),modelId:o(),condition:xc,capturedAt:l(),thumbnailMediaId:o().optional(),anchorEmbedding:M(l()).optional()}),xW=d({id:o(),label:o(),references:M(SW),textPrompts:M(o()).optional(),referenceCount:l(),currentlyMatched:A()}),Kv=xt("mode",[d({mode:V("similarity"),threshold:l().min(0).max(1),hysteresisCount:l().int().positive()}),d({mode:V("llm"),prompt:o(),profileId:o().optional(),hysteresisCount:l().int().positive()})]),kW=.85,wW="skip",MW=8e3,T_=d({enabled:A().default(!1),prompt:o().min(1).max(1e3),profileId:o().optional(),timeoutMs:l().int().min(1e3).max(2e4).default(MW),maxImagePx:l().int().min(64).max(2048).default(448),onTimeout:O(["flip","hold"]).default("hold")}),I_=d({id:o(),label:o(),roi:Ws,enabled:A(),triggerMode:O(["periodic","on-motion","both"]),checkIntervalSec:l().optional(),check:Kv,states:M(xW),currentStateId:o().nullable(),lastCheckedAt:l().nullable(),lastConfidence:l().nullable(),currentCondition:xc.nullable(),availability:O(["ok","unavailable"]),unavailableReason:o().nullable(),baselineStateId:o().nullable(),emit:O(["latched","live"]).default("latched"),verdict:yW,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:T_.optional(),anchorThreshold:l().min(0).max(1).default(kW),autoRestore:A().default(!1),onUncoveredCondition:__.default(wW),suspendedCondition:xc.nullable().default(null),unavailable:bW.nullable(),coveredConditions:M(xc)}),up=d({monitors:M(I_),lastFetchedAt:l()}),CW=d({deviceId:l(),status:up.nullable()}),AW={name:"scene-monitor",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[Q.Camera],methods:{listScenes:S(d({deviceId:l()}),up),listScenesBatch:S(d({deviceIds:M(l()).min(1).max(200)}),M(CW).readonly()),createScene:S(d({deviceId:l(),label:o(),roi:Ws,check:Kv,triggerMode:O(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional()}),I_,{kind:"mutation",auth:"admin"}),updateScene:S(d({deviceId:l(),monitorId:o(),patch:d({label:o().optional(),roi:Ws.optional(),enabled:A().optional(),triggerMode:O(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional(),check:Kv.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:__.optional(),confirm:T_.nullable().optional()})}),N(),{kind:"mutation",auth:"admin"}),deleteScene:S(d({deviceId:l(),monitorId:o()}),N(),{kind:"mutation",auth:"admin"}),captureReference:S(d({deviceId:l(),monitorId:o(),stateId:o().optional(),label:o().optional(),condition:xc.optional()}),d({stateId:o(),referenceCount:l()}),{kind:"mutation",auth:"admin"}),deleteReference:S(d({deviceId:l(),monitorId:o(),stateId:o(),index:l()}),N(),{kind:"mutation",auth:"admin"}),recheckNow:S(d({deviceId:l(),monitorId:o()}),N(),{kind:"mutation",auth:"admin"}),resetScene:S(d({deviceId:l(),monitorId:o(),recapture:A().optional()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:up,kind:"push"},runtimeState:up,durability:"session"},G2=d({isRunning:A(),lastRunAt:l(),lastRunSuccess:A().nullable(),lastError:o().nullable(),lastChangedAt:l()}),EW={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Script],methods:{run:S(d({deviceId:l().int().nonnegative(),variables:Y(o(),ne()).optional()}),N(),{kind:"mutation",auth:"admin"}),stop:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:G2,kind:"push"},runtimeState:G2,durability:"session"},Z2=d({detected:A(),lastChangedAt:l()}),RW={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:Z2,kind:"push"},runtimeState:Z2,durability:"restored",volatileStateFields:["lastChangedAt"]},N_=d({camStreamId:o().min(1),kind:sb,url:o().optional(),codec:o().optional(),resolution:ol.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:M(o()).optional(),autoEligible:A().optional(),metadata:Y(o(),ne()).optional()}),_W=d({descriptors:M(N_),lastFetchedAt:l()}),TW={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],methods:{getCatalog:S(d({deviceId:l().int().nonnegative()}),M(N_).readonly())},runtimeState:_W,durability:"restored",volatileStateFields:["lastFetchedAt"]},IW=O(["main","sub","ext"]),gg=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()}),K2=d({main:gg.optional(),sub:gg.optional(),ext:gg.optional(),lastFetchedAt:l()}),vg=d({resolutions:M(d({width:l(),height:l()})),codecs:M(O(["h264","h265"])),framerates:M(l()),bitrates:M(l()),bitrateRange:Zc([l(),l()]).optional(),supportsBitrateMode:A(),supportsEncoderProfile:A(),supportsGop:A(),gop:d({min:l(),max:l(),step:l()}).optional()}),NW=d({main:vg.optional(),sub:vg.optional(),ext:vg.optional()}),OW=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()}),jW={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:S(d({deviceId:l()}),NW),setProfile:S(d({deviceId:l(),profile:IW,patch:OW}),N(),{kind:"mutation",auth:"admin"}),getConfigSchema:S(d({deviceId:l()}),ne().nullable())},status:{schema:K2,kind:"poll"},runtimeState:K2,durability:"restored",volatileStateFields:["lastFetchedAt"]},W2=d({on:A(),lastChangedAt:l()}),PW={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Switch,Q.Siren,Q.Light],methods:{setState:S(d({deviceId:l(),on:A()}),N(),{kind:"mutation",auth:"admin"})},events:{onStateChanged:{data:d({deviceId:l(),on:A(),lastChangedAt:l()})}},status:{schema:W2,kind:"command-driven"},runtimeState:W2,durability:"restored",volatileStateFields:["lastChangedAt"],settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},Y2=d({streaming:A(),notifications:A(),objectDetection:A(),remoteAccess:A(),agentCluster:A(),smartHome:A(),recordings:A(),backup:A(),repl:A()}),DW=d({status:V("ok"),uptime:l()}),zW=d({name:o(),address:o(),family:o(),internal:A()}),LW=O(["operator-set","derived-from-ip"]),qW=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),source:LW,updatedAt:l(),label:o().optional()}),yg=d({location:qW.nullable(),derivationAttemptedAt:l().nullable(),derivationError:o().nullable()}),BW=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180)}).nullable(),UW=O(["http","ws","mesh","unknown"]),O_=d({http:l(),ws:l(),mesh:l(),unknown:l()}),FW=d({plane:UW,procedure:o(),userAgent:o(),ip:o(),principal:o(),calls:l(),subscriptions:l(),perMin:l()}),HW=d({procedure:o(),calls:l(),planes:O_,subscriptions:l(),perMin:l()}),$W=d({armed:A(),elapsedMs:l(),windowMs:l(),armedUntilMs:l(),httpRequests:l(),batchedRequests:l(),procedureCalls:l(),planes:O_,planesExplainTotal:A(),wsConnections:l(),wsMessages:l(),subscriptions:l(),subscriptionStops:l(),distinctGroups:l(),unattributedCalls:l(),procedures:M(HW).readonly(),groups:M(FW).readonly()}),QW=$W.extend({persisted:A()}),Hb=O(["debug","info","warn","error"]),j_=O(["request-census"]),VW=O(["cluster","node","component"]),GW=O(["default","cluster","node","component"]),ZW=d({scope:VW,nodeId:o().nullable(),component:o().nullable(),level:Hb.nullable()}),KW=d({level:Hb,levelSource:GW}),WW=d({layers:M(ZW).readonly()}),YW=d({id:j_,armed:A(),armedUntilMs:l(),remainingMs:l(),persisted:A()}),XW=d({id:j_,armMs:l().int().min(0),reportEveryMs:l().int().positive().optional()}),JW=d({channel:o(),armed:A(),armedUntilMs:l(),remainingMs:l(),deviceIds:M(l().int()).readonly().nullable()}),eY=d({channel:o().min(1),armMs:l().int().min(0),deviceIds:M(l().int()).readonly().nullable().optional()}),tY=d({level:Hb.nullable().optional(),diagnostics:M(XW).readonly().optional(),channels:M(eY).readonly().optional()}),nY=AR.extend({addonId:o()}),aY=bR.extend({addonId:o()}),iY=d({scopeNodeId:o().optional(),scopeComponent:o().optional()}),rY=d({scopeNodeId:o().optional(),scopeComponent:o().optional(),patch:tY}),X2=d({scopeNodeId:o().nullable(),scopeComponent:o().nullable(),effective:KW,explicit:WW,activeWindows:M(YW).readonly(),channels:M(qE).readonly(),activeChannels:M(JW).readonly(),persisted:A()}),oY={name:"system",scope:"system",mode:"singleton",methods:{info:S(N(),Y2),health:S(N(),DW),featureFlags:S(N(),Y2),networkAddresses:S(N(),M(zW).readonly()),getRetentionConfig:S(N(),ne().nullable(),{auth:"admin"}),setRetentionConfig:S(Y(o(),ne()),RE(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:S(N(),N(),{kind:"mutation",auth:"admin"}),getSiteLocation:S(N(),yg),setSiteLocation:S(BW,yg,{kind:"mutation",auth:"admin"}),detectSiteLocation:S(N(),yg,{kind:"mutation",auth:"admin"}),getRequestCensus:S(N(),QW,{auth:"admin"}),getLoadContributions:S(N(),M(nY).readonly(),{auth:"admin"}),getFailureContributions:S(N(),M(aY).readonly(),{auth:"admin"}),getLoggingSettings:S(iY,X2,{auth:"admin"}),setLoggingSettings:S(rY,X2,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},J2=d({tampered:A(),lastChangedAt:l()}),sY={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:J2,kind:"push"},runtimeState:J2,durability:"restored",volatileStateFields:["lastChangedAt"]},eM=d({celsius:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),lY={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor,Q.Thermostat],methods:{},status:{schema:eM,kind:"push"},runtimeState:eM,durability:"restored",volatileStateFields:["lastFetchedAt"]},cY=d({title:o(),message:o(),severity:O(["info","warning","critical"]),duration:l().optional(),action:d({label:o(),url:o()}).optional()}),uY={name:"toast",scope:"system",mode:"singleton",methods:{onToast:S(N(),cY,{kind:"subscription"})},mount:{kind:"server-provided"}},tM=d({currentVersion:o().nullable(),availableVersion:o().nullable(),updatable:A(),state:o().nullable(),inProgress:A()}),dY={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Update],methods:{installUpdate:S(N(),N(),{kind:"mutation",auth:"admin"})},status:{schema:tM,kind:"poll"},runtimeState:tM,durability:"session"},bg=d({id:o(),username:o(),isAdmin:A().default(!1),allowedProviders:it([M(o()),V("*")]),allowedDevices:Y(o(),it([M(o()),V("*")])),scopes:M(xa).default([]),totpEnabled:A().default(!1),createdAt:l(),updatedAt:l()}),pY=d({username:o(),password:o().min(6),isAdmin:A().default(!1),allowedProviders:it([M(o()),V("*")]).optional(),allowedDevices:Y(o(),it([M(o()),V("*")])).optional(),scopes:M(xa).optional()}),mY=d({id:o(),isAdmin:A().optional(),allowedProviders:it([M(o()),V("*")]).optional(),allowedDevices:Y(o(),it([M(o()),V("*")])).optional(),scopes:M(xa).optional()}),Wv=d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:it([M(o()),V("*")]).optional(),allowedDevices:Y(o(),it([M(o()),V("*")])).optional(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()}),fY=d({label:o(),isAdmin:A().default(!1),allowedProviders:it([M(o()),V("*")]).optional(),allowedDevices:Y(o(),it([M(o()),V("*")])).optional()}),hY=d({token:o(),record:Wv}),Yv=d({id:o(),userId:o(),name:o(),tokenPrefix:o(),scopes:M(xa),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()}),gY=d({userId:o(),name:o(),scopes:M(xa),expiresAt:l().optional()}),vY=d({token:o(),record:Yv}),yY=d({id:o(),userId:o(),username:o(),integrationId:o(),scopes:M(xa),createdAt:l(),lastUsedAt:l(),revokedAt:l().nullable()}),bY=d({secret:o(),otpauthUrl:o()}),SY=d({enabled:A(),confirmedAt:l().nullable()}),xY={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:S(N(),M(bg),{auth:"admin"}),createUser:S(pY,bg,{kind:"mutation",auth:"admin",access:"create"}),updateUser:S(mY,d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:S(d({id:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:S(d({id:o(),newPassword:o().min(6)}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:S(d({userId:o(),scopes:M(xa)}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:S(d({username:o(),password:o()}),bg.extend({passwordHash:o()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:S(N(),M(Wv),{auth:"admin"}),createApiKey:S(fY,hY,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:S(d({id:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:S(d({token:o()}),Wv.nullable(),{kind:"mutation",access:"view"}),createScopedToken:S(gY,vY,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:S(d({id:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:S(d({token:o()}),Yv.nullable(),{access:"view"}),listScopedTokens:S(d({userId:o()}),M(Yv),{auth:"admin"}),setupTotp:S(d({userId:o()}),bY,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:S(d({userId:o(),code:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:S(d({userId:o()}),d({success:V(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:S(d({userId:o()}),SY,{auth:"admin"}),verifyTotp:S(d({userId:o(),code:o()}),d({valid:A()}),{kind:"mutation",access:"view"}),oauthIssueCode:S(d({integrationId:o(),userId:o(),username:o(),scopes:M(xa),redirectUri:o(),hubUrl:o(),codeChallenge:o().optional(),refreshTtlSec:it([l().int().positive(),V("never")]).optional()}),d({code:o()}),{kind:"mutation",access:"create"}),oauthExchangeCode:S(d({code:o(),redirectUri:o(),codeVerifier:o().optional()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:S(d({refreshToken:o()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:S(d({token:o()}),d({userId:o(),username:o(),scopes:M(xa)}).nullable(),{access:"view"}),listOauthSessions:S(N(),M(yY),{auth:"admin"}),revokeOauthSession:S(d({id:o()}),d({success:A()}),{kind:"mutation",auth:"admin",access:"delete"})}},kY=O(["idle","cleaning","paused","returning","docked","drying","error"]),Pd=d({level:l().min(0).max(100).nullable(),status:O(["ok","low","full"]).nullable()}),nM=d({state:kY,batteryLevel:l().min(0).max(100).nullable(),fanSpeed:o().nullable(),availableFanSpeeds:M(o()),cleanWater:Pd.nullable(),dirtyWater:Pd.nullable(),detergent:Pd.nullable(),dustBin:Pd.nullable(),progressPercent:l().min(0).max(100).nullable(),errorCode:l().nullable(),errorLabel:o().nullable(),lastChangedAt:l()}),wY={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Vacuum],methods:{start:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),pause:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),returnToBase:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),locate:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setFanSpeed:S(d({deviceId:l().int().nonnegative(),speed:o().min(1)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:nM,kind:"push"},runtimeState:nM,durability:"session"},MY=O(["open","opening","closing","closed","stopped"]),aM=d({state:MY,position:l().min(0).max(100).nullable(),lastChangedAt:l()}),CY={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Valve],methods:{open:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),close:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),stop:S(d({deviceId:l().int().nonnegative()}),N(),{kind:"mutation",auth:"admin"}),setPosition:S(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),N(),{kind:"mutation",auth:"admin"})},status:{schema:aM,kind:"push"},runtimeState:aM,durability:"session"},iM=d({detected:A(),lastChangedAt:l()}),AY={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Sensor],methods:{},status:{schema:iM,kind:"push"},runtimeState:iM,durability:"restored",volatileStateFields:["lastChangedAt"]},rM=d({currentTemp:l().nullable(),targetTemp:l().nullable(),operationMode:o().nullable(),availableModes:M(o()),away:A().nullable(),minTemp:l().nullable(),maxTemp:l().nullable(),lastChangedAt:l()}),EY={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.WaterHeater],methods:{setTargetTemp:S(d({deviceId:l().int().nonnegative(),temp:l().finite()}),N(),{kind:"mutation",auth:"admin"}),setOperationMode:S(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),N(),{kind:"mutation",auth:"admin"}),setAway:S(d({deviceId:l().int().nonnegative(),on:A()}),N(),{kind:"mutation",auth:"admin"})},status:{schema:rM,kind:"push"},runtimeState:rM,durability:"session"},oM=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()}),RY={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[Q.Weather],methods:{},status:{schema:oM,kind:"push"},runtimeState:oM,durability:"session"},Xv=d({totalObjects:l().int().nonnegative(),byClass:Y(o(),l().int().nonnegative())}),_Y=Xv.extend({zoneId:o(),zoneName:o(),trackIds:M(o()).readonly()}),TY=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()}),Jv=d({ts:l().int(),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),zones:M(_Y).readonly(),frame:Xv,unzoned:Xv,stationaryObjects:M(TY).readonly().optional()}),IY=d({deviceId:l(),read:O(["read","unreadable"]),snapshot:Jv.nullable()}),NY=O(["minute","5min","hour"]),Sg=d({from:l().int(),to:l().int(),resolution:NY}),xg=d({ts:l().int(),count:l().int().nonnegative()}),OY={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[Q.Camera],methods:{getCurrentSnapshot:S(d({deviceId:l()}),Jv.nullable()),getCurrentSnapshotBatch:S(d({deviceIds:M(l()).min(1).max(200)}),M(IY).readonly()),getZoneHistory:S(d({deviceId:l(),zoneId:o(),className:o().optional()}).extend(Sg.shape),M(xg).readonly()),getCameraHistory:S(d({deviceId:l(),className:o().optional()}).extend(Sg.shape),M(xg).readonly()),getUnzonedHistory:S(d({deviceId:l(),className:o().optional()}).extend(Sg.shape),M(xg).readonly())},runtimeState:Jv,durability:"session"},sM=O(["motion","detection","package"]),jY={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[Q.Camera],methods:{listRules:S(d({deviceId:l(),stage:sM}),M(vo).readonly()),setRules:S(d({deviceId:l(),stage:sM,rules:M(vo).readonly()}),N(),{kind:"mutation",auth:"admin"})},runtimeState:d({motion:M(vo).readonly(),detection:M(vo).readonly(),package:M(vo).readonly()}),durability:"restored"};He.Siren,He.Floodlight,He.Spotlight,He.PirSensor,He.Chime,He.Autotrack,He.Nightvision,He.PrivacyMask;var PY={[Q.Cover]:"cover",[Q.Valve]:"valve",[Q.Humidifier]:"humidifier",[Q.WaterHeater]:"water-heater",[Q.Camera]:"dummy",[Q.Hub]:"dummy",[Q.Switch]:"switch",[Q.Siren]:"switch",[Q.Light]:"light",[Q.Fan]:"fan",[Q.Sensor]:"sensor",[Q.Thermostat]:"thermostat",[Q.Climate]:"climate",[Q.Button]:"button",[Q.EventEmitter]:"dummy",[Q.Update]:"update",[Q.Generic]:"dummy",[Q.Notifier]:"dummy",[Q.Script]:"script",[Q.Automation]:"automation",[Q.Lock]:"lock",[Q.MediaPlayer]:"media-player",[Q.AlarmPanel]:"alarm",[Q.Control]:"control",[Q.Presence]:"sensor",[Q.Weather]:"weather",[Q.Vacuum]:"vacuum",[Q.LawnMower]:"lawn-mower",[Q.Container]:"dummy",[Q.Image]:"image",[Q.PetFeeder]:"pet-feeder"};new Set(Object.values(Q));ia.BatteryOperated;var DY="device.state-changed",zY="capability.binding-changed",LY="device.registered",qY="device.unregistered",BY="device.updated",UY=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=p8(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const t=(p,f)=>Number.isFinite(e)?new Promise((m,h)=>{const u=setTimeout(()=>h(new Error(`SystemMirror.init: '${f}' timed out after ${e}ms`)),e);p.then(x=>{clearTimeout(u),m(x)},x=>{clearTimeout(u),h(x)})}):p,[n,a,s]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),"deviceManager.getAllBindings"),t(this.api.deviceState.getAllSnapshots.query({}),"deviceState.getAllSnapshots"),t(this.api.deviceManager.listAll.query({}),"deviceManager.listAll")]);for(const p of n)this.bindings.set(p.deviceId,p);for(const[p,f]of Object.entries(a)){const m=Number(p);if(!Number.isFinite(m))continue;const h=new Map;for(const[u,x]of Object.entries(f))h.set(u,x);this.stateMirror.set(m,h)}for(const p of s)this.devices.set(p.id,p);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(const e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){const t=this.bindings.get(e);return t?zE(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&&!Dd(n,e.id)||e.stableId!==void 0&&(!s||!Dd(s.stableId,e.stableId))||e.addonId!==void 0&&(!s||!Dd(s.addonId,e.addonId))||e.type!==void 0&&(!s||!Dd(s.type,e.type)))continue;if(e.caps!==void 0){const f=kg(e.caps),m=new Set(a.entries.map(h=>h.capName));if(!f.every(h=>m.has(h)))continue}if(e.anyCap!==void 0){const f=kg(e.anyCap),m=new Set(a.entries.map(h=>h.capName));if(!f.some(h=>m.has(h)))continue}if(e.name!==void 0&&(!s||!FY(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||!kg(e.feature).every(f=>s.features.includes(f)))||e.isCamera!==void 0&&(!s||s.isCamera!==e.isCamera))continue;const p=this.getDeviceById(n);if(p){if(e.where&&s){if(!e.where(s,p))continue}else if(e.where&&!s)continue;t.push(p)}}return t}whereState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);if(!p||!t(p,a))continue;const f=this.getDeviceById(a);f&&n.push(f)}return n}mapState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);p&&n.push(t(p,a))}return n}findState(e,t){for(const[n,a]of this.stateMirror){const s=a.get(e);if(s&&t(s,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(const n of this.bindings.values())n.entries.some(a=>a.capName===e)&&t++;return t}countByState(e,t){let n=0;for(const[a,s]of this.stateMirror){const p=s.get(e);p&&t(p,a)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,a=3e4){return new Promise((s,p)=>{const m=(()=>{const x=this.stateMirror.get(e)?.get(t);return x&&n(x)?x:null})();if(m){s(m);return}let h=null;const u=this.listenDevice(e,(x,w,C)=>{w===t&&C&&n(C)&&(h&&clearTimeout(h),u(),s(C))});Number.isFinite(a)&&(h=setTimeout(()=>{u(),p(new Error(`waitForState timed out after ${a}ms (deviceId=${e}, capName=${t})`))},a))})}waitForDevice(e,t=3e4){return new Promise((n,a)=>{const s=this.getDeviceById(e);if(s){n(s);return}let p=null;const f=this.onDeviceAdded(m=>{if(m!==e)return;const h=this.getDeviceById(m);h&&(p&&clearTimeout(p),f(),n(h))});Number.isFinite(t)&&(p=setTimeout(()=>{f(),a(new Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(const n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,a={}){const s=this.filterByCap(e),p=Math.max(1,a.parallelism??s.length),f=[];for(let m=0;m<s.length;m+=p){const h=s.slice(m,m+p),u=await Promise.allSettled(h.map(async x=>{const w=x[e];if(!w||typeof w[t]!="function")throw new Error(`device '${x.deviceId}' does not expose '${e}.${t}'`);return await w[t](n)}));for(let x=0;x<u.length;x++){const w=h[x],C=u[x];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 p of this.bindings.values())for(const f of p.entries)e[f.capName]=(e[f.capName]??0)+1;for(const p of this.devices.values())t[p.addonId]=(t[p.addonId]??0)+1,n[p.type]=(n[p.type]??0)+1,p.online?a++:s++;return{totalDevices:this.bindings.size,online:a,offline:s,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){const t=a=>{const s=this.devices.get(a)??null,p=this.bindings.get(a)??null,f={},m=this.stateMirror.get(a);if(m)for(const[h,u]of m)f[h]={...u};return{deviceId:a,info:s,binding:p?{...p,entries:p.entries.map(h=>({...h}))}:null,state:f}};if(e!==void 0)return t(e);const n=[];for(const a of this.bindings.keys())n.push(t(a));return n}getRawMirror(){return this.stateMirror}getSystemState(){const e=new Map;for(const[t,n]of this.stateMirror){const a=new Map;for(const[s,p]of n)a.set(s,{...p});e.set(t,a)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;const e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:DY},{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:zY},{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:LY},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"added")}})),this.bridges.push(e.subscribe({category:qY},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.applyDeviceRemoval(n.deviceId)}})),this.bridges.push(e.subscribe({category:BY},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"updated")}}))}applyStateUpdate(e,t,n){let a=this.stateMirror.get(e);a||(a=new Map,this.stateMirror.set(e,a)),n===void 0?a.delete(t):a.set(t,n);const s=`${e}:${t}`,p=this.handleListeners.get(s);if(p)for(const h of p)try{h(n)}catch{}for(const h of this.globalStateListeners)try{h(e,t,n)}catch{}const f=this.capListeners.get(t);if(f)for(const h of f)try{h(e,n)}catch{}const m=this.deviceListeners.get(e);if(m)for(const h of m)try{h(e,t,n)}catch{}}applyDeviceRemoval(e){const t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(const n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{const t=await this.api.deviceManager.getBindings.query({deviceId:e});if(t.entries.length>0){this.bindings.set(e,t);return}if(await this.api.deviceManager.getDevice.query({deviceId:e})===null){this.applyDeviceRemoval(e);return}this.bindings.set(e,t)}catch{}}async refreshDeviceMetadata(e,t){try{const n=await this.api.deviceManager.getDevice.query({deviceId:e});if(!n)return;const a=!this.devices.has(e);if(this.devices.set(e,n),t==="added"&&a){await this.refreshBinding(e);for(const s of this.addedListeners)try{s(e,n)}catch{}}}catch{}}};function Dd(e,t){return Array.isArray(t)?t.includes(e):e===t}function kg(e){return Array.isArray(e)?e:[e]}function FY(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 HY=[hV,Zq,Wq,e7,a7,s7,r7,UV,a8,FV,$U,d7,HV,p7,y7,M7,GV,C7,ZV,I7,KV,WV,YV,Z7,XV,tG,K7,y9,nG,aG,rG,cG,uG,dG,pG,hG,k9,vG,M9,E9,SG,_9,T9,D9,N9,$9,aB,u8,V9,iB,xG,wG,oB,CG,AG,RG,PG,lB,DG,zG,dB,LG,qG,BG,UG,FG,QG,XG,tZ,iZ,RB,bB,IB,pZ,fZ,OB,jB,qB,vZ,xZ,nU,iU,sU,wZ,cU,CZ,RZ,bU,TZ,kU,OZ,GZ,OU,AF,JZ,eK,NF,aK,lK,uK,u$,rH,Y$,w$,fK,EK,RK,TK,IK,PK,qK,HK,$K,cW,vW,AW,EW,cQ,C9,RW,pQ,hQ,gQ,yQ,xQ,kQ,jQ,f9,TW,jW,PW,oY,sY,lY,BQ,uY,FQ,dY,xY,$Q,wY,CY,lV,AY,dV,o8,EY,RY,mV,OY,jY,cH];function lM(e){const t=e;function n(a,s,p,f,m){const h=t[a]?.[s];if(!h)throw new Error(`SystemProxy: api has no '${a}.${s}'`);const u=h;return p==="mutation"?u.mutate(f):p==="subscription"?u.subscribe(f,m):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 $Y=["devices","classes"];new Set($Y);var P_=d({title:o().max(500).optional(),body:o().max(2e3).optional()}),D_=o().min(1).max(200),z_=M(l()).min(1),L_=l().int().min(2).max(3600),q_=l().int().min(1).max(60),B_=M(zR).min(1),U_=l().int().min(1).max(5),QY=.1,F_=l().min(QY).max(3600),H_=l().min(0).max(60),$_=o().max(200),Q_=O(["image","gif"]),V_=M(o().min(1).max(40)).max(20),VY=d({name:D_,enabled:A().default(!0),deviceIds:z_,schedule:hm,cadenceSec:L_.default(15),framerate:q_.default(10),denseCadenceSec:F_.optional(),minDwellSec:H_.optional(),targets:B_,template:P_.optional(),previewText:$_.optional(),previewMode:Q_.default("image"),reportClasses:V_.optional(),priority:U_.default(3)});d({name:D_.optional(),enabled:A().optional(),deviceIds:z_.optional(),schedule:hm.optional(),cadenceSec:L_.optional(),framerate:q_.optional(),denseCadenceSec:F_.optional(),minDwellSec:H_.optional(),targets:B_.optional(),template:P_.nullable().optional(),previewText:$_.optional(),previewMode:Q_.optional(),reportClasses:V_.optional(),priority:U_.optional()});VY.extend({id:o(),ownerUserId:o().optional(),lastGeneratedAt:l().optional(),generatedByDevice:Y(o(),l()).optional(),createdBy:o(),createdAt:l(),updatedAt:l()});var GY=[{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(GY.map(e=>[e.stepId,e.defaultModelId])));o().min(1);var ZY=[{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 KY(e,t){return`clusterStepSetting:${e}:${t}`}var WY=l().finite();function YY(e){const t={};for(const n of ZY){const a=WY.safeParse(e[KY(n.stepId,n.key)]),s=a.success?a.data:n.default,p=t[n.stepId]??{};t[n.stepId]={...p,[n.key]:s}}return t}YY({});d({paddingRatio:l().min(0).max(4),square:A()});var XY=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:XY,tileBudgetMb:l().int().min(0).max(1024),sceneBudgetMb:l().int().min(0).max(1024)});var cM={"°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 ey(e){return Object.hasOwn(cM,e)?cM[e]:void 0}function uM(e){return ey(e)?.dimension}function JY(e,t){return e*t.factor+t.offset}function eX(e,t){return(e-t.offset)/t.factor}function tX(e,t,n){if(t===n)return e;const a=ey(t);if(!a)return;const s=ey(n);if(s&&a.dimension===s.dimension)return eX(JY(e,a),s)}function nX(e,t){if(e===t)return!0;const n=uM(e);return n===void 0?!1:n===uM(t)}var aX=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()}},G_=class{constructor(t){this.generateIdentifier=t,this.kv=new aX}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)}},iX=class extends G_{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 rX(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 oX(e,t){const n=rX(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function Xs(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function dp(e,t){return e.indexOf(t)!==-1}function dM(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var sX=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return oX(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}},lX=e=>Object.prototype.toString.call(e).slice(8,-1),Z_=e=>typeof e>"u",cX=e=>e===null,Oc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ty=e=>Oc(e)&&Object.keys(e).length===0,Dr=e=>Array.isArray(e),uX=e=>typeof e=="string",dX=e=>typeof e=="number"&&!isNaN(e),pX=e=>typeof e=="boolean",mX=e=>e instanceof RegExp,jc=e=>e instanceof Map,Pc=e=>e instanceof Set,K_=e=>lX(e)==="Symbol",fX=e=>e instanceof Date&&!isNaN(e.valueOf()),W_=e=>e instanceof Error,pM=e=>typeof e=="number"&&isNaN(e),hX=e=>pX(e)||cX(e)||Z_(e)||dX(e)||uX(e)||K_(e),gX=e=>typeof e=="bigint",vX=e=>e===1/0||e===-1/0,yX=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),bX=e=>e instanceof URL,ny=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),wg=e=>e.map(String).map(ny).join("."),kc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function ni(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var Y_=[ni(Z_,"undefined",()=>null,()=>{}),ni(gX,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ni(fX,"Date",e=>e.toISOString(),e=>new Date(e)),ni(W_,"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}),ni(mX,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ni(Pc,"set",e=>[...e.values()],e=>new Set(e)),ni(jc,"map",e=>[...e.entries()],e=>new Map(e)),ni(e=>pM(e)||vX(e),"number",e=>pM(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ni(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ni(bX,"URL",e=>e.toString(),e=>new URL(e))];function gm(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var X_=gm((e,t)=>K_(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}),SX=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),J_=gm(yX,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=SX[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function eT(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var tT=gm(eT,(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)}),nT=gm((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)}),xX=[tT,X_,nT,J_],mM=(e,t)=>{const n=dM(xX,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=dM(Y_,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},aT={};Y_.forEach(e=>{aT[e.annotation]=e});var kX=(e,t,n)=>{if(Dr(t))switch(t[0]){case"symbol":return X_.untransform(e,t,n);case"class":return tT.untransform(e,t,n);case"custom":return nT.untransform(e,t,n);case"typed-array":return J_.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=aT[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},zs=(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 iT(e){if(dp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(dp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(dp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var wX=(e,t)=>{iT(t);for(let n=0;n<t.length;n++){const a=t[n];if(Pc(e))e=zs(e,+a);else if(jc(e)){const s=+a,p=+t[++n]==0?"key":"value",f=zs(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},ay=(e,t,n)=>{if(iT(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Dr(a)){const m=+f;a=a[m]}else if(Oc(a))a=a[f];else if(Pc(a)){const m=+f;a=zs(a,m)}else if(jc(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",u=zs(a,m);switch(h){case"key":a=u;break;case"value":a=a.get(u);break}}}const s=t[t.length-1];if(Dr(a)?a[+s]=n(a[+s]):Oc(a)&&(a[s]=n(a[s])),Pc(a)){const p=zs(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(jc(a)){const p=+t[t.length-2],f=zs(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},rT=e=>e<1;function iy(e,t,n,a=[]){if(!e)return;const s=rT(n);if(!Dr(e)){Xs(e,(m,h)=>iy(m,t,n,[...a,...kc(h,s)]));return}const[p,f]=e;f&&Xs(f,(m,h)=>{iy(m,t,n,[...a,...kc(h,s)])}),t(p,a)}function MX(e,t,n,a){return iy(t,(s,p)=>{e=ay(e,p,f=>kX(f,s,a))},n),e}function CX(e,t,n){const a=rT(n);function s(p,f){const m=wX(e,kc(f,a));p.map(h=>kc(h,a)).forEach(h=>{e=ay(e,h,()=>m)})}if(Dr(t)){const[p,f]=t;p.forEach(m=>{e=ay(e,kc(m,a),()=>e)}),f&&Xs(f,s)}else Xs(t,s);return e}var AX=(e,t)=>Oc(e)||Dr(e)||jc(e)||Pc(e)||W_(e)||eT(e,t);function EX(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function RX(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(wg):n[wg(p)]=f.map(wg)}),a?ty(n)?[a]:[a,n]:ty(n)?void 0:n}var oT=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=hX(e);if(!m){EX(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!AX(e,n)){const E=mM(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(dp(p,e))return{transformedValue:null};const h=mM(e,n),u=h?.value??e,x=Dr(u)?[]:{},w={};Xs(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 I=oT(E,t,n,a,[...s,R],[...p,e],f);x[R]=I.transformedValue,Dr(I.annotations)?w[ny(R)]=I.annotations:Oc(I.annotations)&&Xs(I.annotations,(j,D)=>{w[ny(R)+"."+D]=j})});const C=ty(w)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,w]:w};return m||f.set(e,C),C};function sT(e){return Object.prototype.toString.call(e).slice(8,-1)}function fM(e){return sT(e)==="Array"}function _X(e){if(sT(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function TX(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function ry(e,t={}){if(fM(e))return e.map(s=>ry(s,t));if(!_X(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||fM(t.props)&&!t.props.includes(p))return s;const f=e[p];return TX(s,p,ry(f,t),e,t.nonenumerable),s},{})}var gt=class{constructor({dedupe:t=!1}={}){this.classRegistry=new iX,this.symbolRegistry=new G_(n=>n.description??""),this.customTransformerRegistry=new sX,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,a=oT(t,n,this,this.dedupe),s={json:a.transformedValue};a.annotations&&(s.meta={...s.meta,values:a.annotations});const p=RX(n,this.dedupe);return p&&(s.meta={...s.meta,referentialEqualities:p}),s.meta&&(s.meta.v=1),s}deserialize(t,n){const{json:a,meta:s}=t;let p=n?.inPlace?a:ry(a);return s?.values&&(p=MX(p,s.values,s.v??0,this)),s?.referentialEqualities&&(p=CX(p,s.referentialEqualities,s.v??0)),p}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t),{inPlace:!0})}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}};gt.defaultInstance=new gt;gt.serialize=gt.defaultInstance.serialize.bind(gt.defaultInstance);gt.deserialize=gt.defaultInstance.deserialize.bind(gt.defaultInstance);gt.stringify=gt.defaultInstance.stringify.bind(gt.defaultInstance);gt.parse=gt.defaultInstance.parse.bind(gt.defaultInstance);gt.registerClass=gt.defaultInstance.registerClass.bind(gt.defaultInstance);gt.registerSymbol=gt.defaultInstance.registerSymbol.bind(gt.defaultInstance);gt.registerCustom=gt.defaultInstance.registerCustom.bind(gt.defaultInstance);gt.allowErrorProps=gt.defaultInstance.allowErrorProps.bind(gt.defaultInstance);gt.serialize;gt.deserialize;gt.stringify;gt.parse;gt.registerClass;gt.registerCustom;gt.registerSymbol;gt.allowErrorProps;var IX=1e4,NX=6e3,OX=2e3,jX=3e4,PX=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??OX,this.maxRetryMs=t.maxRetryDelayMs??jX,this._trpcClient=this.buildTrpcClient(),this._systemProxy=lM(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(t){return this.connectionListeners.add(t),()=>{this.connectionListeners.delete(t)}}emitConnectionEvent(t){try{this.onConnectionChange?.(t)}catch{}for(const n of this.connectionListeners)try{n(t,this._connectionVersion)}catch{}}async awaitConnected(t){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;const n=t??15e3;this.connectedPromise=(async()=>{const a=this._trpcClient.auth.me.query();Number.isFinite(n)?await new Promise((s,p)=>{const f=setTimeout(()=>p(new Error(`System.awaitConnected: probe timed out after ${n}ms`)),n);a.then(()=>{clearTimeout(f),s()},m=>{clearTimeout(f),p(m instanceof Error?m:new Error(String(m)))})}):await a,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(t){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;const n=new UY(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=lM(this._trpcClient))}switchServerUrl(t){const n=t.replace(/\/+$/,"");n!==this._serverUrl&&(this._serverUrl=n,this.reconnect())}async raceConnectionEndpoints(t){const n=t?.perCandidateTimeoutMs??1500,a=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),s=a?.port?Number(a.port):a?.protocol==="https:"?443:80,p=a?.protocol==="https:"?"https":"http",f=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!f)return{winner:this._serverUrl,switched:!1};let m;try{m=(await f.query({port:s,ipv4Only:t?.ipv4Only,scheme:p})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(m.length===0)return{winner:this._serverUrl,switched:!1};const h=await DX(m.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,p=s.token,f=s.requiresTotp===!0||Array.isArray(s.secondFactors)&&s.secondFactors.length>0;typeof p=="string"&&!f&&this.setToken(p)}return a}async loginVerifyTotp(t,n){const a=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:t,code:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async loginBeginPasskey(t){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:t})}async loginVerifyPasskey(t,n){const a=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:t,response:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(t){const n=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:t});if(typeof n=="object"&&n!==null&&"token"in n){const a=n,s=a.requiresTotp===!0||Array.isArray(a.secondFactors)&&a.secondFactors.length>0;typeof a.token=="string"&&!s&&this.setToken(a.token)}return n}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(t){return await this._trpcClient.auth.changeOwnPassword.mutate(t)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(t){return await this._trpcClient.auth.confirmOwnTotp.mutate(t)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(t){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(t)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(t){return await this._trpcClient.auth.removeOwnPasskey.mutate(t)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(t){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(t)}setToken(t){this.token=t}listDevices(t){return this.mirror?(t?this.mirror.query(t):this.mirror.getAllDevices()).map(n=>this.attachBinding(n)):[]}getDeviceInfo(t){return this.mirror?.getDeviceInfo(t)??null}listDeviceInfos(t){const n=this.mirror;if(!n)return[];const a=t?n.query(t):n.getAllDevices(),s=[];for(const p of a){const f=n.getDeviceInfo(p.deviceId);f&&s.push(f)}return s}getDevice(t){const n=this.mirror?.getDeviceById(t)??null;return n?this.attachBinding(n):null}getDeviceByName(t){const n=this.mirror?.getDeviceByName(t)??null;return n?this.attachBinding(n):null}getDeviceByStableId(t){const n=this.mirror?.getDeviceByStableId(t)??null;return n?this.attachBinding(n):null}async waitForDevice(t,n){this.mirror||await this.init();const a=await this.mirror.waitForDevice(t,n??3e4);return this.attachBinding(a)}onDeviceAdded(t){if(!this.mirror)throw new Error("System.onDeviceAdded: call init() before subscribing");return this.mirror.onDeviceAdded(t)}onDeviceRemoved(t){if(!this.mirror)throw new Error("System.onDeviceRemoved: call init() before subscribing");return this.mirror.onDeviceRemoved(t)}attachBinding(t){const n=this.lookupBinding(t.deviceId);if(n===t.binding)return t;const a=t;return a.binding=n,t}lookupBinding(t){return this.mirror?this.mirror.getDeviceById(t)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(t,n){const a=n;let s=this._eventSubs.get(t);if(s===void 0){const f=new Set,m=this._trpcClient.live.onEvent.subscribe({category:t},{onData:h=>{for(const u of[...f])try{u(h)}catch{}}});s={listeners:f,unsubscribe:()=>{try{m.unsubscribe()}catch{}}},this._eventSubs.set(t,s)}s.listeners.add(a);let p=!1;return()=>{if(p)return;p=!0;const f=this._eventSubs.get(t);f!==void 0&&(f.listeners.delete(a),f.listeners.size===0&&(f.unsubscribe(),this._eventSubs.delete(t)))}}resetEventSubs(){for(const t of this._eventSubs.values())t.unsubscribe();this._eventSubs.clear()}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){const t=()=>{const n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),n};if(this.useWs){const n=this._serverUrl.replace(/^http/,"ws")+"/trpc",a=this.baseRetryMs,s=this.maxRetryMs,p=this._wsEpoch;return this._wsClient=R3({url:n,connectionParams:()=>({token:this.token}),retryDelayMs:f=>Math.min(a*Math.pow(2,f),s),keepAlive:{enabled:!0,intervalMs:IX,pongTimeoutMs:NX},onOpen:()=>{p===this._wsEpoch&&(this._connectionVersion+=1,this.emitConnectionEvent("connected"))},onClose:()=>{p===this._wsEpoch&&this.emitConnectionEvent("disconnected")}}),vv({links:[_3({client:this._wsClient,transformer:gt})]})}return this._wsClient=null,vv({links:[f3({url:`${this._serverUrl}/trpc`,headers:t,transformer:gt})]})}};function vm(e){return new PX(e)}async function DX(e,t){if(e.length===0)return null;if(typeof fetch!="function")return e[0]??null;const n=typeof window<"u"&&typeof window.location<"u"&&window.location.protocol==="https:"?e.filter(p=>p.toLowerCase().startsWith("https://")):e;if(n.length===0)return null;const a=n.map(()=>new AbortController),s=n.map(async(p,f)=>{const m=a[f],h=setTimeout(()=>m.abort(),t);try{const u=await fetch(`${p.replace(/\/+$/,"")}/trpc/health`,{method:"GET",signal:m.signal,credentials:"omit"});if(!u.ok)throw new Error(`${u.status}`);return p}finally{clearTimeout(h)}});try{const p=await Promise.any(s);for(const f of a)try{f.abort()}catch{}return p}catch{return null}}var zX=(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})({}),LX=["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"],qX=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],BX=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],UX=["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"],FX=["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"],HX=["motion","movement","other"],$X=["package","packet"],QX=["audio"],VX=["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"],GX=["doorbell","ring"],ZX=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...LX.reduce((e,t)=>({...e,[t]:"animal"}),{}),...qX.reduce((e,t)=>({...e,[t]:"person"}),{}),...BX.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...HX.reduce((e,t)=>({...e,[t]:"motion"}),{}),...$X.reduce((e,t)=>({...e,[t]:"package"}),{}),...UX.reduce((e,t)=>({...e,[t]:"face"}),{}),...FX.reduce((e,t)=>({...e,[t]:"plate"}),{}),...QX.reduce((e,t)=>({...e,[t]:"audio"}),{}),...VX.reduce((e,t)=>({...e,[t]:"audio"}),{}),...GX.reduce((e,t)=>({...e,[t]:"doorbell"}),{}),...ZX.reduce((e,t)=>({...e,[t]:"sensor"}),{})});var KX=Object.values(zX),WX=KX.filter(e=>e!=="motion");[...WX];var YX=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(YX);var XX=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(XX);var T=Zy();const bn=kj(T),JX=xj({__proto__:null,default:bn},[T]);T.createContext(null);var No=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(){}},eJ=class extends No{#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"}},$b=new eJ,tJ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},nJ=class{#t=tJ;#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)}},So=new nJ;function aJ(e){setTimeout(e,0)}var iJ=typeof window>"u"||"Deno"in globalThis;function zn(){}function rJ(e,t){return typeof e=="function"?e(t):e}function oy(e){return typeof e=="number"&&e>=0&&e!==1/0}function lT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Or(e,t){return typeof e=="function"?e(t):e}function ba(e,t){return typeof e=="function"?e(t):e}function hM(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:p,queryKey:f,stale:m}=e;if(f){if(a){if(t.queryHash!==Qb(f,t.options))return!1}else if(!Dc(t.queryKey,f))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof m=="boolean"&&t.isStale()!==m||s&&s!==t.state.fetchStatus||p&&!p(t))}function gM(e,t){const{exact:n,status:a,predicate:s,mutationKey:p}=e;if(p){if(!t.options.mutationKey)return!1;if(n){if(zr(t.options.mutationKey)!==zr(p))return!1}else if(!Dc(t.options.mutationKey,p))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function Qb(e,t){return(t?.queryKeyHashFn||zr)(e)}function zr(e){return JSON.stringify(e,(t,n)=>sy(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function Dc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dc(e[n],t[n])):!1}var oJ=Object.prototype.hasOwnProperty;function Vb(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=vM(e)&&vM(t);if(!a&&!(sy(e)&&sy(t)))return t;const p=(a?e:Object.keys(e)).length,f=a?t:Object.keys(t),m=f.length,h=a?new Array(m):{};let u=0;for(let x=0;x<m;x++){const w=a?x:f[x],C=e[w],E=t[w];if(C===E){h[w]=C,(a?x<p:oJ.call(e,w))&&u++;continue}if(C===null||E===null||typeof C!="object"||typeof E!="object"){h[w]=E;continue}const R=Vb(C,E,n+1);h[w]=R,R===C&&u++}return p===m&&u===p?e:h}function zc(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 vM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sy(e){if(!yM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yM(e){return Object.prototype.toString.call(e)==="[object Object]"}function sJ(e){return new Promise(t=>{So.setTimeout(t,e)})}function ly(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Vb(e,t):t}function lJ(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function cJ(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Sa=Symbol();function cT(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Sa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gb(e,t){return typeof e=="function"?e(...t):!!e}function uJ(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 Lc=(()=>{let e=()=>iJ;return{isServer(){return e()},setIsServer(t){e=t}}})();function cy(){let e,t;const n=new Promise((s,p)=>{e=s,t=p});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var dJ=aJ;function pJ(){let e=[],t=0,n=m=>{m()},a=m=>{m()},s=dJ;const p=m=>{t?e.push(m):s(()=>{n(m)})},f=()=>{const m=e;e=[],m.length&&s(()=>{a(()=>{m.forEach(h=>{n(h)})})})};return{batch:m=>{let h;t++;try{h=m()}finally{t--,t||f()}return h},batchCalls:m=>(...h)=>{p(()=>{m(...h)})},schedule:p,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{a=m},setScheduler:m=>{s=m}}}var sn=pJ(),mJ=class extends No{#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}},Up=new mJ;function fJ(e){return Math.min(1e3*2**e,3e4)}function uT(e){return(e??"online")==="online"?Up.isOnline():!0}var uy=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function dT(e){let t=!1,n=0,a;const s=cy(),p=()=>s.status!=="pending",f=I=>{if(!p()){const j=new uy(I);C(j),e.onCancel?.(j)}},m=()=>{t=!0},h=()=>{t=!1},u=()=>$b.isFocused()&&(e.networkMode==="always"||Up.isOnline())&&e.canRun(),x=()=>uT(e.networkMode)&&e.canRun(),w=I=>{p()||(a?.(),s.resolve(I))},C=I=>{p()||(a?.(),s.reject(I))},E=()=>new Promise(I=>{a=j=>{(p()||u())&&I(j)},e.onPause?.()}).then(()=>{a=void 0,p()||e.onContinue?.()}),R=()=>{if(p())return;let I;const j=n===0?e.initialPromise:void 0;try{I=j??e.fn()}catch(D){I=Promise.reject(D)}Promise.resolve(I).then(w).catch(D=>{if(p())return;const z=e.retry??(Lc.isServer()?0:3),B=e.retryDelay??fJ,q=typeof B=="function"?B(n,D):B,Z=z===!0||typeof z=="number"&&n<z||typeof z=="function"&&z(n,D);if(t||!Z){C(D);return}n++,e.onFail?.(n,D),sJ(q).then(()=>u()?void 0:E()).then(()=>{t?C(D):R()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(a?.(),s),cancelRetry:m,continueRetry:h,canStart:x,start:()=>(x()?R():E().then(R),s)}}var pT=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oy(this.gcTime)&&(this.#t=So.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lc.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(So.clearTimeout(this.#t),this.#t=void 0)}};function hJ(e){return{onFetch:(t,n)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,p=t.state.data?.pages||[],f=t.state.data?.pageParams||[];let m={pages:[],pageParams:[]},h=0;const u=async()=>{let x=!1;const w=R=>{uJ(R,()=>t.signal,()=>x=!0)},C=cT(t.options,t.fetchOptions),E=async(R,I,j)=>{if(x)return Promise.reject(t.signal.reason);if(I==null&&R.pages.length)return Promise.resolve(R);const z=(()=>{const J={client:t.client,queryKey:t.queryKey,pageParam:I,direction:j?"backward":"forward",meta:t.options.meta};return w(J),J})(),B=await C(z),{maxPages:q}=t.options,Z=j?cJ:lJ;return{pages:Z(R.pages,B,q),pageParams:Z(R.pageParams,I,q)}};if(s&&p.length){const R=s==="backward",I=R?mT:dy,j={pages:p,pageParams:f},D=I(a,j);m=await E(j,D,R)}else{const R=e??p.length;do{const I=h===0?f[0]??a.initialPageParam:dy(a,m);if(h>0&&I==null)break;m=await E(m,I),h++}while(h<R)}return m};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 dy(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 mT(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function gJ(e,t){return t?dy(e,t)!=null:!1}function vJ(e,t){return!t||!e.getPreviousPageParam?!1:mT(e,t)!=null}var yJ=class extends pT{#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=SM(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=SM(this.options);t.data!==void 0&&(this.setState(bM(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=ly(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(zn).catch(zn):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=>ba(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sa||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Or(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:!lT(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=cT(this.options,t),x=(()=>{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,x,this):h(x)},f=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return a(h),h})();(this.#t==="infinite"?hJ(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=dT({initialPromise:t?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof uy&&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 uy){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#a.config.onError?.(h,this),this.#a.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...fT(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...bM(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),sn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function fT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function SM(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 eu=class extends No{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#s=cy(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#a=void 0;#i;#r;#s;#o;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),xM(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return py(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return py(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 ba(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&&!zc(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&kM(this.#e,n,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==n||ba(this.options.enabled,this.#e)!==ba(t.enabled,this.#e)||Or(this.options.staleTime,this.#e)!==Or(t.staleTime,this.#e))&&this.#g();const s=this.#v();a&&(this.#e!==n||ba(this.options.enabled,this.#e)!==ba(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 SJ(this,n)&&(this.#a=n,this.#r=this.options,this.#i=this.#e.state),n}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(n,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#p(e){this.#k();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(zn)),t}#g(){this.#S();const e=Or(this.options.staleTime,this.#e);if(Lc.isServer()||this.#a.isStale||!oy(e))return;const n=lT(this.#a.dataUpdatedAt,e)+1;this.#d=So.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,!(Lc.isServer()||ba(this.options.enabled,this.#e)===!1||!oy(this.#c)||this.#c===0)&&(this.#f=So.setInterval(()=>{(this.options.refetchIntervalInBackground||$b.isFocused())&&this.#p()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(So.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(So.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#e,a=this.options,s=this.#a,p=this.#i,f=this.#r,h=e!==n?e.state:this.#n,{state:u}=e;let x={...u},w=!1,C;if(t._optimisticResults){const F=this.hasListeners(),de=!F&&xM(e,t),we=F&&kM(e,n,t,a);(de||we)&&(x={...x,...fT(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:E,errorUpdatedAt:R,status:I}=x;C=x.data;let j=!1;if(t.placeholderData!==void 0&&C===void 0&&I==="pending"){let F;s?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(F=s.data,j=!0):F=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,F!==void 0&&(I="success",C=ly(s?.data,F,t),w=!0)}if(t.select&&C!==void 0&&!j)if(s&&C===p?.data&&t.select===this.#u)C=this.#l;else try{this.#u=t.select,C=t.select(C),C=ly(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(),I="error");const D=x.fetchStatus==="fetching",z=I==="pending",B=I==="error",q=z&&D,Z=C!==void 0,$={status:I,fetchStatus:x.fetchStatus,isPending:z,isSuccess:I==="success",isError:B,isInitialLoading:q,isLoading:q,data:C,dataUpdatedAt:x.dataUpdatedAt,error:E,errorUpdatedAt:R,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:x.dataUpdateCount>h.dataUpdateCount||x.errorUpdateCount>h.errorUpdateCount,isFetching:D,isRefetching:D&&!z,isLoadingError:B&&!Z,isPaused:x.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:B&&Z,isStale:Zb(e,t),refetch:this.refetch,promise:this.#s,isEnabled:ba(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=$.data!==void 0,de=$.status==="error"&&!F,we=Ae=>{de?Ae.reject($.error):F&&Ae.resolve($.data)},Ce=()=>{const Ae=this.#s=$.promise=cy();we(Ae)},Me=this.#s;switch(Me.status){case"pending":e.queryHash===n.queryHash&&we(Me);break;case"fulfilled":(de||$.data!==Me.value)&&Ce();break;case"rejected":(!de||$.error!==Me.reason)&&Ce();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.#m=this.#e),zc(t,e))return;this.#a=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!this.#h.size)return!0;const p=new Set(s??this.#h);return this.options.throwOnError&&p.add("error"),Object.keys(this.#a).some(f=>{const m=f;return this.#a[m]!==e[m]&&p.has(m)})};this.#w({listeners:n()})}#k(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){sn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function bJ(e,t){return ba(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&ba(t.retryOnMount,e)===!1)}function xM(e,t){return bJ(e,t)||e.state.data!==void 0&&py(e,t,t.refetchOnMount)}function py(e,t,n){if(ba(t.enabled,e)!==!1&&Or(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Zb(e,t)}return!1}function kM(e,t,n,a){return(e!==t||ba(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Zb(e,n)}function Zb(e,t){return ba(t.enabled,e)!==!1&&e.isStaleByTime(Or(t.staleTime,e))}function SJ(e,t){return!zc(e.getCurrentResult(),t)}var hT=class extends eu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,a=super.createResult(e,t),{isFetching:s,isRefetching:p,isError:f,isRefetchError:m}=a,h=n.fetchMeta?.fetchMore?.direction,u=f&&h==="forward",x=s&&h==="forward",w=f&&h==="backward",C=s&&h==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:gJ(t,n.data),hasPreviousPage:vJ(t,n.data),isFetchNextPageError:u,isFetchingNextPage:x,isFetchPreviousPageError:w,isFetchingPreviousPage:C,isRefetchError:m&&!u&&!w,isRefetching:p&&!x&&!C}}},xJ=class extends pT{#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||gT(),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=dT({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(p,f)=>{this.#i({type:"failed",failureCount:p,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",s=!this.#a.canStart();try{if(a)t();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const f=await this.options.onMutate?.(e,n);f!==this.state.context&&this.#i({type:"pending",context:f,variables:e,isPaused:s})}const p=await this.#a.start();return await this.#n.config.onSuccess?.(p,e,this.state.context,this,n),await this.options.onSuccess?.(p,e,this.state.context,n),await this.#n.config.onSettled?.(p,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(p,null,e,this.state.context,n),this.#i({type:"success",data:p}),p}catch(p){try{await this.#n.config.onError?.(p,e,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onError?.(p,e,this.state.context,n)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,p,this.state.variables,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,p,e,this.state.context,n)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:p}),p}finally{this.#n.runNext(this)}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),sn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function gT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kJ=class extends No{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 xJ({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=zd(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=zd(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=zd(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=zd(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){sn.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=>gM(t,n))}findAll(e={}){return this.getAll().filter(t=>gM(e,t))}notify(e){sn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return sn.batch(()=>Promise.all(e.map(t=>t.continue().catch(zn))))}};function zd(e){return e.options.scope?.id}var wJ=class extends No{#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),zc(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&zr(n.mutationKey)!==zr(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??gT();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){sn.batch(()=>{if(this.#a&&this.hasListeners()){const n=this.#e.variables,a=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#a.onSuccess?.(t.data,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(t.data,null,n,a,s)}catch(p){Promise.reject(p)}}else if(t?.type==="error"){try{this.#a.onError?.(t.error,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(void 0,t.error,n,a,s)}catch(p){Promise.reject(p)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function wM(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function MJ(e,t,n){const a=e.slice(0);return a[t]=n,a}var CJ=class extends No{#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,sn.batch(()=>{const n=this.#i,a=this.#c(this.#n);a.forEach(x=>x.observer.setOptions(x.defaultedQueryOptions));const s=a.map(x=>x.observer),p=s.map(x=>x.getCurrentResult()),f=n.length!==s.length,m=s.some((x,w)=>x!==n[w]),h=f||m,u=h?!0:p.some((x,w)=>{const C=this.#e[w];return!C||!zc(x,C)});!h&&!u||(h&&(this.#l=a,this.#i=s),this.#e=p,this.hasListeners()&&(h&&(wM(n,s).forEach(x=>{x.destroy()}),wM(s,n).forEach(x=>{x.subscribe(w=>{this.#h(x,w)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){const n=this.#c(e),a=n.map(p=>p.observer.getOptimisticResult(p.defaultedQueryOptions)),s=n.map(p=>p.defaultedQueryOptions.queryHash);return[a,p=>this.#d(p??a,t,s),()=>this.#m(a,n)]}#m(e,t){return t.map((n,a)=>{const s=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,p=>{t.forEach(f=>{f.observer.trackProp(p)})})})}#d(e,t,n){if(t){const a=this.#u,s=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((p,f)=>p!==a[f]));return(!this.#r||this.#e!==this.#o||s||t!==this.#s)&&(this.#s=t,this.#o=this.#e,n!==void 0&&(this.#u=n),this.#r=Vb(this.#r,t(e))),this.#r}return e}#f(){return this.#a?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#e[t]?.data===void 0)}#c(e){const t=new Map;this.#i.forEach(a=>{const s=a.options.queryHash;if(!s)return;const p=t.get(s);p?p.push(a):t.set(s,[a])});const n=[];return e.forEach(a=>{const s=this.#t.defaultQueryOptions(a),f=t.get(s.queryHash)?.shift()??new eu(this.#t,s);n.push({defaultedQueryOptions:s,observer:f})}),n}#h(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=MJ(this.#e,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#m(this.#e,this.#l),t=this.#f(),n=this.#r,a=t?n:this.#d(e,this.#a?.combine);(t||n!==a)&&sn.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},AJ=class extends No{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,s=t.queryHash??Qb(a,t);let p=this.get(s);return p||(p=new yJ({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(p)),p}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){sn.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=>hM(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hM(e,n)):t}notify(e){sn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vT=class{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e={}){this.#t=e.queryCache||new AJ,this.#e=e.mutationCache||new kJ,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=$b.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=Up.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(Or(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),p=this.#t.get(a.queryHash)?.state.data,f=rJ(t,p);if(f!==void 0)return this.#t.build(this,a).setData(f,{...n,manual:!0})}setQueriesData(e,t,n){return sn.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;sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return sn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=sn.batch(()=>this.#t.findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(zn).catch(zn)}invalidateQueries(e,t={}){return sn.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=sn.batch(()=>this.#t.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let p=s.fetch(void 0,n);return n.throwOnError||(p=p.catch(zn)),s.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(a).then(zn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Or(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zn).catch(zn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zn).catch(zn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Up.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(zr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(a=>{Dc(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(zr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(a=>{Dc(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=Qb(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===Sa&&(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()}},yT=T.createContext(void 0),tu=e=>{const t=T.useContext(yT);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bT=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(yT.Provider,{value:e,children:t})),ST=T.createContext(!1),xT=()=>T.useContext(ST);ST.Provider;function EJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RJ=T.createContext(EJ()),kT=()=>T.useContext(RJ),wT=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?Gb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},MT=e=>{T.useEffect(()=>{e.clearReset()},[e])},CT=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||Gb(n,[e.error,a])),Kb=(e,t)=>t.state.data===void 0,AT=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))}},_J=(e,t)=>e.isLoading&&e.isFetching&&!t,my=(e,t)=>e?.suspense&&t.isPending,fy=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ET({queries:e,...t},n){const a=tu(n),s=xT(),p=kT(),f=T.useMemo(()=>e.map(I=>{const j=a.defaultQueryOptions(I);return j._optimisticResults=s?"isRestoring":"optimistic",j}),[e,a,s]);f.forEach(I=>{AT(I);const j=a.getQueryCache().get(I.queryHash);wT(I,p,j)}),MT(p);const[m]=T.useState(()=>new CJ(a,f,t)),[h,u,x]=m.getOptimisticResult(f,t.combine),w=!s&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(I=>w?m.subscribe(sn.batchCalls(I)):zn,[m,w]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setQueries(f,t)},[f,t,m]);const E=h.some((I,j)=>my(f[j],I))?h.flatMap((I,j)=>{const D=f[j];if(D&&my(D,I)){const z=new eu(a,D);return fy(D,z,p)}return[]}):[];if(E.length>0)throw Promise.all(E);const R=h.find((I,j)=>{const D=f[j];return D&&CT({result:I,errorResetBoundary:p,throwOnError:D.throwOnError,query:a.getQueryCache().get(D.queryHash),suspense:D.suspense})});if(R?.error)throw R.error;return u(x())}function ym(e,t,n){const a=xT(),s=kT(),p=tu(n),f=p.defaultQueryOptions(e);p.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const m=p.getQueryCache().get(f.queryHash),h=e.subscribed!==!1;f._optimisticResults=a?"isRestoring":h?"optimistic":void 0,AT(f),wT(f,s,m),MT(s);const u=!p.getQueryCache().get(f.queryHash),[x]=T.useState(()=>new t(p,f)),w=x.getOptimisticResult(f),C=!a&&h;if(T.useSyncExternalStore(T.useCallback(E=>{const R=C?x.subscribe(sn.batchCalls(E)):zn;return x.updateResult(),R},[x,C]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),T.useEffect(()=>{x.setOptions(f)},[f,x]),my(f,w))throw fy(f,x,s);if(CT({result:w,errorResetBoundary:s,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw w.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(f,w),f.experimental_prefetchInRender&&!Lc.isServer()&&_J(w,a)&&(u?fy(f,x,s):m?.promise)?.catch(zn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?w:x.trackResult(w)}function TJ(e,t){return ym(e,eu,t)}function IJ(e,t){return ym({...e,enabled:!0,suspense:!0,throwOnError:Kb,placeholderData:void 0},eu,t)}function NJ(e,t){return ym({...e,enabled:!0,suspense:!0,throwOnError:Kb},hT,t)}function OJ(e,t){return ET({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:Kb,enabled:!0,placeholderData:void 0}))},t)}function jJ(e,t){const n=tu(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function PJ(e,t){const n=tu(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function DJ(e,t){const n=tu(t),[a]=T.useState(()=>new wJ(n,e));T.useEffect(()=>{a.setOptions(e)},[a,e]);const s=T.useSyncExternalStore(T.useCallback(f=>a.subscribe(sn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p=T.useCallback((f,m)=>{a.mutate(f,m).catch(zn)},[a]);if(s.error&&Gb(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:p,mutateAsync:s.mutate}}function zJ(e,t){return ym(e,hT,t)}var LJ=Object.create,RT=Object.defineProperty,qJ=Object.getOwnPropertyDescriptor,_T=Object.getOwnPropertyNames,BJ=Object.getPrototypeOf,UJ=Object.prototype.hasOwnProperty,Ur=(e,t)=>function(){return t||(0,e[_T(e)[0]])((t={exports:{}}).exports,t),t.exports},FJ=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=_T(t),p=0,f=s.length,m;p<f;p++)m=s[p],!UJ.call(e,m)&&m!==n&&RT(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=qJ(t,m))||a.enumerable});return e},Oo=(e,t,n)=>(n=e!=null?LJ(BJ(e)):{},FJ(t||!e||!e.__esModule?RT(n,"default",{value:e,enumerable:!0}):n,e)),HJ=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(a,s){if(a==null)return{};var p={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(s.includes(f))continue;p[f]=a[f]}return p}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$J=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=HJ();function a(s,p){if(s==null)return{};var f,m,h=n(s,p);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);for(m=0;m<u.length;m++)f=u[m],p.includes(f)||{}.propertyIsEnumerable.call(s,f)&&(h[f]=s[f])}return h}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),TT=Ur({"../../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}}),QJ=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=TT().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),VJ=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=TT().default,a=QJ();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),GJ=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=VJ();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),nu=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=GJ();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(u){return Object.getOwnPropertyDescriptor(p,u).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),ZJ=Oo($J(),1),MM=Oo(nu(),1);const KJ=["cursor","direction"];function oi(e,t,n){const a=e.flatMap(s=>s.split("."));if(!t&&(!n||n==="any"))return a.length?[a]:[];if(n==="infinite"&&Ro(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:p}=t,f=(0,ZJ.default)(t,KJ);return[a,{input:f,type:"infinite"}]}return[a,(0,MM.default)((0,MM.default)({},typeof t<"u"&&t!==Sa&&{input:t}),n&&n!=="any"&&{type:n})]}function pp(e){return oi(e,void 0,"any")}function WJ(e){return rm(({path:t,args:n})=>{var a;const s=[...t],p=s.pop();if(p==="useMutation")return e[p](s,...n);if(p==="_def")return{path:s};const[f,...m]=n,h=(a=m[0])!==null&&a!==void 0?a:{};return e[p](s,f,h)})}var Mg;const YJ=["client","ssrContext","ssrState","abortOnUnmount"],XJ=(Mg=T.createContext)===null||Mg===void 0?void 0:Mg.call(JX,null),JJ=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 eee(e){return rm(t=>{const n=[...t.path],a=n.pop(),s=[...t.args],p=s.shift(),f=JJ(a),m=oi(n,p,f);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,m,s[0]),queryOptions:()=>e.queryOptions(n,m,...s),fetch:()=>e.fetchQuery(m,...s),fetchInfinite:()=>e.fetchInfiniteQuery(m,s[0]),prefetch:()=>e.prefetchQuery(m,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(m,s[0]),ensureData:()=>e.ensureQueryData(m,...s),invalidate:()=>e.invalidateQueries(m,...s),reset:()=>e.resetQueries(m,...s),refetch:()=>e.refetchQueries(m,...s),cancel:()=>e.cancelQuery(m,...s),setData:()=>{e.setQueryData(m,s[0],s[1])},setQueriesData:()=>e.setQueriesData(m,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(m,s[0],s[1])},getData:()=>e.getQueryData(m),getInfiniteData:()=>e.getInfiniteQueryData(m),setMutationDefaults:()=>e.setMutationDefaults(pp(n),p),getMutationDefaults:()=>e.getMutationDefaults(pp(n)),isMutating:()=>e.isMutating({mutationKey:pp(n)})}[a]()})}function tee(e){const t=GA(e.client),n=eee(e);return Ky(a=>{const s=a;return s==="client"?t:YJ.includes(s)?e[s]:n[a]})}var nee=Oo(nu(),1);function CM(e){const t=e instanceof om?e:Yy(e);return rm(n=>{const a=n.path,s=a.join("."),[p,f]=n.args;return(0,nee.default)({queryKey:oi(a,p,"query"),queryFn:()=>t.query(s,p,f?.trpc)},f)})}var Cg=Oo(nu(),1);function $n(e,t,n){var a;const s=e[0];let p=(a=e[1])===null||a===void 0?void 0:a.input;if(n){var f;p=(0,Cg.default)((0,Cg.default)((0,Cg.default)({},(f=p)!==null&&f!==void 0?f:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.join("."),p,t?.trpc]}var aee=Ur({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),iee=Oo(aee(),1);function hy(e){return{path:e.path.join(".")}}function sc(e){const t=hy(e);return T.useMemo(()=>t,[t])}async function IT(e,t,n){const s=t.getQueryCache().build(t,{queryKey:n});s.setState({data:[],status:"success"});const p=[];var f=!1,m=!1,h;try{for(var u=(0,iee.default)(e),x;f=!(x=await u.next()).done;f=!1){const w=x.value;p.push(w),s.setState({data:[...p]})}}catch(w){m=!0,h=w}finally{try{f&&u.return!=null&&await u.return()}finally{if(m)throw h}}return p}var At=Oo(nu(),1);function ree(e){const{client:t,queryClient:n}=e,a=t instanceof om?t:Yy(t);return{infiniteQueryOptions:(s,p,f)=>{var m,h;const u=((m=p[1])===null||m===void 0?void 0:m.input)===Sa,x=async w=>{var C;const E=(0,At.default)((0,At.default)({},f),{},{trpc:(0,At.default)((0,At.default)({},f?.trpc),!(f==null||(C=f.trpc)===null||C===void 0)&&C.abortOnUnmount?{signal:w.signal}:{signal:null})});return await a.query(...$n(p,E,{direction:w.direction,pageParam:w.pageParam}))};return Object.assign((0,At.default)((0,At.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:u?Sa:x,initialPageParam:(h=f?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:hy({path:s})})},queryOptions:(s,p,f)=>{var m;const h=((m=p[1])===null||m===void 0?void 0:m.input)===Sa,u=async x=>{var w;const C=(0,At.default)((0,At.default)({},f),{},{trpc:(0,At.default)((0,At.default)({},f?.trpc),!(f==null||(w=f.trpc)===null||w===void 0)&&w.abortOnUnmount?{signal:x.signal}:{signal:null})}),E=await a.query(...$n(p,C));return NA(E)?IT(E,n,p):E};return Object.assign((0,At.default)((0,At.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:h?Sa:u}),{trpc:hy({path:s})})},fetchQuery:(s,p)=>n.fetchQuery((0,At.default)((0,At.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...$n(s,p))})),fetchInfiniteQuery:(s,p)=>{var f;return n.fetchInfiniteQuery((0,At.default)((0,At.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...$n(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},prefetchQuery:(s,p)=>n.prefetchQuery((0,At.default)((0,At.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...$n(s,p))})),prefetchInfiniteQuery:(s,p)=>{var f;return n.prefetchInfiniteQuery((0,At.default)((0,At.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...$n(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},ensureQueryData:(s,p)=>n.ensureQueryData((0,At.default)((0,At.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...$n(s,p))})),invalidateQueries:(s,p,f)=>n.invalidateQueries((0,At.default)((0,At.default)({},p),{},{queryKey:s}),f),resetQueries:(s,p,f)=>n.resetQueries((0,At.default)((0,At.default)({},p),{},{queryKey:s}),f),refetchQueries:(s,p,f)=>n.refetchQueries((0,At.default)((0,At.default)({},p),{},{queryKey:s}),f),cancelQuery:(s,p)=>n.cancelQueries({queryKey:s},p),setQueryData:(s,p,f)=>n.setQueryData(s,p,f),setQueriesData:(s,p,f,m)=>n.setQueriesData((0,At.default)((0,At.default)({},p),{},{queryKey:s}),f,m),getQueryData:s=>n.getQueryData(s),setInfiniteQueryData:(s,p,f)=>n.setQueryData(s,p,f),getInfiniteQueryData:s=>n.getQueryData(s),setMutationDefaults:(s,p)=>{const f=s[0],m=h=>a.mutation(...$n([f,{input:h}],e));return n.setMutationDefaults(s,typeof p=="function"?p({canonicalMutationFn:m}):p)},getMutationDefaults:s=>n.getMutationDefaults(s),isMutating:s=>n.isMutating((0,At.default)((0,At.default)({},s),{},{exact:!0}))}}var Ie=Oo(nu());const AM=(e,t)=>new Proxy(e,{get(a,s){return t(s),a[s]}});function oee(e){var t,n;const a=(t=void 0)!==null&&t!==void 0?t:Z=>Z.originalFn(),s=(n=void 0)!==null&&n!==void 0?n:XJ,p=vv,f=Z=>{var J;const{abortOnUnmount:$=!1,queryClient:F,ssrContext:de}=Z,[we,Ce]=T.useState((J=Z.ssrState)!==null&&J!==void 0?J:!1),Me=Z.client instanceof om?Z.client:Yy(Z.client),Ae=T.useMemo(()=>ree({client:Me,queryClient:F}),[Me,F]),oe=T.useMemo(()=>(0,Ie.default)({abortOnUnmount:$,queryClient:F,client:Me,ssrContext:de??null,ssrState:we},Ae),[$,Me,Ae,F,de,we]);return T.useEffect(()=>{Ce(Te=>Te?"mounted":!1)},[]),v.jsx(s.Provider,{value:oe,children:Z.children})};function m(){const Z=T.useContext(s);if(!Z)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return Z}function h(Z,J){var $;const{queryClient:F,ssrState:de}=m();return de&&de!=="mounted"&&(($=F.getQueryCache().find({queryKey:Z}))===null||$===void 0?void 0:$.state.status)==="error"?(0,Ie.default)({retryOnMount:!1},J):J}function u(Z,J,$){var F,de,we,Ce,Me;const Ae=m(),{abortOnUnmount:oe,client:Te,ssrState:H,queryClient:ce,prefetchQuery:ke}=Ae,Ee=oi(Z,J,"query"),me=ce.getQueryDefaults(Ee),L=J===Sa;typeof window>"u"&&H==="prepass"&&($==null||(F=$.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((de=$?.enabled)!==null&&de!==void 0?de:me?.enabled)!==!1&&!L&&!ce.getQueryCache().find({queryKey:Ee})&&ke(Ee,$);const te=h(Ee,(0,Ie.default)((0,Ie.default)({},me),$)),ge=(we=(Ce=$==null||(Me=$.trpc)===null||Me===void 0?void 0:Me.abortOnUnmount)!==null&&Ce!==void 0?Ce:void 0)!==null&&we!==void 0?we:oe,Se=TJ((0,Ie.default)((0,Ie.default)({},te),{},{queryKey:Ee,queryFn:L?J:async ee=>{const ye=(0,Ie.default)((0,Ie.default)({},te),{},{trpc:(0,Ie.default)((0,Ie.default)({},te?.trpc),ge?{signal:ee.signal}:{signal:null})}),Oe=await Te.query(...$n(Ee,ye));return NA(Oe)?IT(Oe,ce,Ee):Oe}}),ce);return Se.trpc=sc({path:Z}),Se}function x(Z,J,$){var F,de,we;const Ce=m(),Me=oi(Z,J,"query"),Ae=J===Sa,oe=(F=(de=$==null||(we=$.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&de!==void 0?de:void 0)!==null&&F!==void 0?F:Ce.abortOnUnmount;jJ((0,Ie.default)((0,Ie.default)({},$),{},{queryKey:Me,queryFn:Ae?J:Te=>{const H={trpc:(0,Ie.default)((0,Ie.default)({},$?.trpc),oe?{signal:Te.signal}:{})};return Ce.client.query(...$n(Me,H))}}))}function w(Z,J,$){var F,de,we;const Ce=m(),Me=oi(Z,J,"query"),Ae=(F=(de=$==null||(we=$.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&de!==void 0?de:void 0)!==null&&F!==void 0?F:Ce.abortOnUnmount,oe=IJ((0,Ie.default)((0,Ie.default)({},$),{},{queryKey:Me,queryFn:Te=>{const H=(0,Ie.default)((0,Ie.default)({},$),{},{trpc:(0,Ie.default)((0,Ie.default)({},$?.trpc),Ae?{signal:Te.signal}:{signal:null})});return Ce.client.query(...$n(Me,H))}}),Ce.queryClient);return oe.trpc=sc({path:Z}),[oe.data,oe]}function C(Z,J){const{client:$,queryClient:F}=m(),de=pp(Z),we=F.defaultMutationOptions(F.getMutationDefaults(de)),Ce=DJ((0,Ie.default)((0,Ie.default)({},J),{},{mutationKey:de,mutationFn:Me=>$.mutation(...$n([Z,{input:Me}],J)),onSuccess(...Me){var Ae,oe;return a({originalFn:()=>{var H,ce,ke;return(H=J==null||(ce=J.onSuccess)===null||ce===void 0?void 0:ce.call(J,...Me))!==null&&H!==void 0?H:we==null||(ke=we.onSuccess)===null||ke===void 0?void 0:ke.call(we,...Me)},queryClient:F,meta:(Ae=(oe=J?.meta)!==null&&oe!==void 0?oe:we?.meta)!==null&&Ae!==void 0?Ae:{}})}}),F);return Ce.trpc=sc({path:Z}),Ce}const E={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};function I(Z,J,$){var F;const de=(F=$?.enabled)!==null&&F!==void 0?F:J!==Sa,we=zr(oi(Z,J,"any")),{client:Ce}=m(),Me=T.useRef($);T.useEffect(()=>{Me.current=$});const[Ae]=T.useState(new Set([])),oe=T.useCallback(L=>{Ae.add(L)},[Ae]),Te=T.useRef(null),H=T.useCallback(L=>{const te=ke.current,ge=ke.current=L(te);let Se=!1;for(const ee of Ae)if(te[ee]!==ge[ee]){Se=!0;break}Se&&me(AM(ge,oe))},[oe,Ae]),ce=T.useCallback(()=>{var L;if((L=Te.current)===null||L===void 0||L.unsubscribe(),!de){H(()=>(0,Ie.default)((0,Ie.default)({},E),{},{reset:ce}));return}H(()=>(0,Ie.default)((0,Ie.default)({},R),{},{reset:ce}));const te=Ce.subscription(Z.join("."),J??void 0,{onStarted:()=>{var ge,Se;(ge=(Se=Me.current).onStarted)===null||ge===void 0||ge.call(Se),H(ee=>(0,Ie.default)((0,Ie.default)({},ee),{},{status:"pending",error:null}))},onData:ge=>{var Se,ee;(Se=(ee=Me.current).onData)===null||Se===void 0||Se.call(ee,ge),H(ye=>(0,Ie.default)((0,Ie.default)({},ye),{},{status:"pending",data:ge,error:null}))},onError:ge=>{var Se,ee;(Se=(ee=Me.current).onError)===null||Se===void 0||Se.call(ee,ge),H(ye=>(0,Ie.default)((0,Ie.default)({},ye),{},{status:"error",error:ge}))},onConnectionStateChange:ge=>{H(Se=>{switch(ge.state){case"idle":return(0,Ie.default)((0,Ie.default)({},Se),{},{status:ge.state,error:null,data:void 0});case"connecting":return(0,Ie.default)((0,Ie.default)({},Se),{},{error:ge.error,status:ge.state});case"pending":return Se}})},onComplete:()=>{var ge,Se;(ge=(Se=Me.current).onComplete)===null||ge===void 0||ge.call(Se),H(ee=>(0,Ie.default)((0,Ie.default)({},ee),{},{status:"idle",error:null,data:void 0}))}});Te.current=te},[Ce,we,de,H]);T.useEffect(()=>(ce(),()=>{var L;(L=Te.current)===null||L===void 0||L.unsubscribe()}),[ce]);const ke=T.useRef(de?(0,Ie.default)((0,Ie.default)({},R),{},{reset:ce}):(0,Ie.default)((0,Ie.default)({},E),{},{reset:ce})),[Ee,me]=T.useState(AM(ke.current,oe));return Ee}function j(Z,J,$){var F,de,we,Ce,Me;const{client:Ae,ssrState:oe,prefetchInfiniteQuery:Te,queryClient:H,abortOnUnmount:ce}=m(),ke=oi(Z,J,"infinite"),Ee=H.getQueryDefaults(ke),me=J===Sa;typeof window>"u"&&oe==="prepass"&&($==null||(F=$.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((de=$?.enabled)!==null&&de!==void 0?de:Ee?.enabled)!==!1&&!me&&!H.getQueryCache().find({queryKey:ke})&&Te(ke,(0,Ie.default)((0,Ie.default)({},Ee),$));const L=h(ke,(0,Ie.default)((0,Ie.default)({},Ee),$)),te=(we=$==null||(Ce=$.trpc)===null||Ce===void 0?void 0:Ce.abortOnUnmount)!==null&&we!==void 0?we:ce,ge=zJ((0,Ie.default)((0,Ie.default)({},L),{},{initialPageParam:(Me=$.initialCursor)!==null&&Me!==void 0?Me:null,persister:$.persister,queryKey:ke,queryFn:me?J:Se=>{var ee;const ye=(0,Ie.default)((0,Ie.default)({},L),{},{trpc:(0,Ie.default)((0,Ie.default)({},L?.trpc),te?{signal:Se.signal}:{signal:null})});return Ae.query(...$n(ke,ye,{pageParam:(ee=Se.pageParam)!==null&&ee!==void 0?ee:$.initialCursor,direction:Se.direction}))}}),H);return ge.trpc=sc({path:Z}),ge}function D(Z,J,$){var F,de,we;const Ce=m(),Me=oi(Z,J,"infinite"),Ae=Ce.queryClient.getQueryDefaults(Me),oe=J===Sa,Te=h(Me,(0,Ie.default)((0,Ie.default)({},Ae),$)),H=(F=$==null||(de=$.trpc)===null||de===void 0?void 0:de.abortOnUnmount)!==null&&F!==void 0?F:Ce.abortOnUnmount;PJ((0,Ie.default)((0,Ie.default)({},$),{},{initialPageParam:(we=$.initialCursor)!==null&&we!==void 0?we:null,queryKey:Me,queryFn:oe?J:ce=>{var ke;const Ee=(0,Ie.default)((0,Ie.default)({},Te),{},{trpc:(0,Ie.default)((0,Ie.default)({},Te?.trpc),H?{signal:ce.signal}:{})});return Ce.client.query(...$n(Me,Ee,{pageParam:(ke=ce.pageParam)!==null&&ke!==void 0?ke:$.initialCursor,direction:ce.direction}))}}))}function z(Z,J,$){var F,de,we;const Ce=m(),Me=oi(Z,J,"infinite"),Ae=Ce.queryClient.getQueryDefaults(Me),oe=h(Me,(0,Ie.default)((0,Ie.default)({},Ae),$)),Te=(F=$==null||(de=$.trpc)===null||de===void 0?void 0:de.abortOnUnmount)!==null&&F!==void 0?F:Ce.abortOnUnmount,H=NJ((0,Ie.default)((0,Ie.default)({},$),{},{initialPageParam:(we=$.initialCursor)!==null&&we!==void 0?we:null,queryKey:Me,queryFn:ce=>{var ke;const Ee=(0,Ie.default)((0,Ie.default)({},oe),{},{trpc:(0,Ie.default)((0,Ie.default)({},oe?.trpc),Te?{signal:ce.signal}:{})});return Ce.client.query(...$n(Me,Ee,{pageParam:(ke=ce.pageParam)!==null&&ke!==void 0?ke:$.initialCursor,direction:ce.direction}))}}),Ce.queryClient);return H.trpc=sc({path:Z}),[H.data,H]}return{Provider:f,createClient:p,useContext:m,useUtils:m,useQuery:u,usePrefetchQuery:x,useSuspenseQuery:w,useQueries:(Z,J)=>{const{ssrState:$,queryClient:F,prefetchQuery:de,client:we}=m(),Ce=CM(we),Me=Z(Ce);if(typeof window>"u"&&$==="prepass")for(const oe of Me){var Ae;const Te=oe;((Ae=Te.trpc)===null||Ae===void 0?void 0:Ae.ssr)!==!1&&!F.getQueryCache().find({queryKey:Te.queryKey})&&de(Te.queryKey,Te)}return ET({queries:Me.map(oe=>(0,Ie.default)((0,Ie.default)({},oe),{},{queryKey:oe.queryKey})),combine:J?.combine},F)},useSuspenseQueries:Z=>{const{queryClient:J,client:$}=m(),F=CM($),de=Z(F),we=OJ({queries:de.map(Ce=>(0,Ie.default)((0,Ie.default)({},Ce),{},{queryFn:Ce.queryFn,queryKey:Ce.queryKey}))},J);return[we.map(Ce=>Ce.data),we]},useMutation:C,useSubscription:I,useInfiniteQuery:j,usePrefetchInfiniteQuery:D,useSuspenseInfiniteQuery:z}}function see(e){const t=WJ(e);return Ky(n=>n==="useContext"||n==="useUtils"?()=>{const a=e.useUtils();return T.useMemo(()=>tee(a),[a])}:e.hasOwnProperty(n)?e[n]:t[n])}function lee(e){const t=oee();return see(t)}EA();var Ag={};var NT=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();var cee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var uee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());var EM=e=>{const t=uee(e);return t.charAt(0).toUpperCase()+t.slice(1)};var dee={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 pee=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var mee=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...dee,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:NT("lucide",s),...!p&&!pee(m)&&{"aria-hidden":"true"},...m},[...f.map(([u,x])=>T.createElement(u,x)),...Array.isArray(p)?p:[p]]));var K=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(mee,{ref:p,iconNode:t,className:NT(`lucide-${cee(EM(e))}`,`lucide-${e}`,a),...s}));return n.displayName=EM(e),n};var OT=K("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 fee=K("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 hee=K("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"}]]);K("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"}]]);K("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);K("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);K("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);K("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"}]]);K("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var gee=K("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 gy=K("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var vee=K("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"}]]);K("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"}]]);K("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 Fp=K("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 yee=K("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"}]]);K("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 Eg=K("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 Hp=K("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 RM=K("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 _M=K("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 bee=K("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 See=K("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 xee=K("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 TM=K("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"}]]);K("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 kee=K("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 wee=K("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 Rg=K("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"}]]);K("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 IM=K("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 jT=K("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var jo=K("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);K("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var Mee=K("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var bm=K("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);K("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);K("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);K("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"}]]);K("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 Cee=K("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var PT=K("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);K("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"}]]);K("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);K("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 Aee=K("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);K("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 NM=K("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var Eee=K("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 Ree=K("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 DT=K("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 OM=K("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 zT=K("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 _ee=K("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 Tee=K("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"}]]);K("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"}]]);K("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"}]]);K("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 LT=K("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"}]]);K("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 jM=K("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 Iee=K("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 Js=K("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 qT=K("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 Wb=K("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 sl=K("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"}]]);K("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"}]]);K("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 Nee=K("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"}]]);K("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 $p=K("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 Oee=K("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"}]]);K("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 Qp=K("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 jee=K("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 Pee=K("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 BT=K("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"}]]);K("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"}]]);K("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 mp=K("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);K("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 Dee=K("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"}]]);K("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 zee=K("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 Sm=K("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 UT=K("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 Lee=K("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"}]]);K("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"}]]);K("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 qee=K("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"}]]);K("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 Bee=K("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 xm=K("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"}]]);K("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 Uee=K("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 Fee=K("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 Yb=K("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);K("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 vy=K("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 au=K("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 Hee=K("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 $ee=K("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"}]]);K("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 FT=K("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"}]]);K("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var HT=K("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 Ife=K("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"}]]);K("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"}]]);K("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var Qee=K("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 Xb=K("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 $T=K("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 Vee=K("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 Gee=K("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"}]]);K("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 QT=K("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 Zee=K("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var Kee=K("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 Wee=K("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 iu=K("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 va=K("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"}]]);K("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 Yee=K("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 Xee=K("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 Jee=K("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 Po=K("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"}]]);K("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);K("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"}]]);K("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 ru=K("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);K("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 VT=K("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 ete=K("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 Jb=K("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 tte=K("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"}]]);K("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 nte=K("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"}]]);K("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"}]]);K("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 ate=K("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"}]]);K("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);K("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"}]]);K("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"}]]);K("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 km=K("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 ite=K("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 rte=K("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 ote=K("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"}]]);K("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 Vp=K("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 ste=K("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 lte=K("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 e0=K("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 cte=K("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var GT=K("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 ZT=K("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 ute=K("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 ou=K("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);K("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 dte=K("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 KT=K("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 pte=K("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"}]]);K("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 WT=K("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"}]]);K("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 wm=K("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var yy=K("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 mte=K("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 fte=K("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 hte=K("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 gte=K("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"}]]);K("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);K("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var el=K("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 vte=K("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 yte=K("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"}]]);K("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]);K("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 bte=K("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 Ste=K("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 xte=K("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 PM=K("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 YT=K("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 su=K("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 XT=K("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 kte=K("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 DM=K("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 wte=K("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 Hi=K("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 Mte=K("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"}]]);K("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 Cte=K("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Ir=K("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 Ate=K("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 Ete=K("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"}]]),JT=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,y=JT??lee();typeof globalThis<"u"&&!JT&&(globalThis.__camstackTrpcReact=y);function di(e,t){if(typeof globalThis>"u")return T.createContext(t);const n=globalThis.__camstackSharedContexts,a=n??new Map;n||(globalThis.__camstackSharedContexts=a);const s=a.get(e);if(s)return s;const p=T.createContext(t);return a.set(e,p),p}var eI=di("camstack:system",null);function tI({system:e,children:t}){return v.jsx(eI.Provider,{value:e,children:t})}function Rte(){const e=T.useContext(eI);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function li(e,t){const n=Rte(),a=T.useRef(t);a.current=t;const[s,p]=T.useState(n.connectionVersion);T.useEffect(()=>n.subscribeConnectionEvents((f,m)=>{f==="connected"&&p(m)}),[n]),T.useEffect(()=>n.subscribeEvent(e,f=>{a.current(f)}),[n,e,s])}y.accessories.setChildHidden.useMutation;y.accessories.getStatus.useQuery;y.addonPages.listPages.useQuery;y.addons.list.useQuery;y.addons.getLogs.useQuery;y.addons.listPackages.useQuery;y.addons.installPackage.useMutation;y.addons.installFromWorkspace.useMutation;y.addons.isWorkspaceAvailable.useQuery;y.addons.listWorkspacePackages.useQuery;y.addons.uninstallPackage.useMutation;y.addons.reloadPackages.useMutation;y.addons.searchAvailable.useQuery;y.addons.listUpdates.useQuery;y.addons.updatePackage.useMutation;y.addons.rollbackPackage.useMutation;y.addons.forceRefresh.useMutation;y.addons.restartServer.useMutation;y.addons.getLastRestart.useQuery;y.addons.listFrameworkPackages.useQuery;y.addons.listCapabilityProviders.useQuery;y.addons.setCapabilityProviderEnabled.useMutation;y.addons.getVersions.useQuery;y.addons.restartAddon.useMutation;y.addons.retryLoad.useMutation;y.addons.getAutoUpdateSettings.useQuery;y.addons.setAutoUpdateSettings.useMutation;y.addons.getAddonAutoUpdate.useQuery;y.addons.setAddonAutoUpdate.useMutation;y.addons.applyAutoUpdateToAll.useMutation;y.addons.custom.useMutation;y.addons.startJob.useMutation;y.addons.getJob.useQuery;y.addons.listJobs.useQuery;y.addons.cancelJob.useMutation;y.addons.onAddonLogs.useSubscription;y.addonSettings.getGlobalSettings.useQuery;y.addonSettings.updateGlobalSettings.useMutation;y.addonSettings.getIntegrationSettings.useQuery;y.addonSettings.getDeviceSettings.useQuery;y.addonSettings.updateDeviceSettings.useMutation;y.addonWidgets.listWidgets.useQuery;y.airQualitySensor.getStatus.useQuery;y.alarmPanel.arm.useMutation;y.alarmPanel.disarm.useMutation;y.alarmPanel.trigger.useMutation;y.alarmPanel.getStatus.useQuery;y.alerts.emit.useMutation;y.alerts.update.useMutation;y.alerts.list.useQuery;y.alerts.getUnreadCount.useQuery;y.alerts.markRead.useMutation;y.alerts.markAllRead.useMutation;y.alerts.dismiss.useMutation;y.ambientLightSensor.getStatus.useQuery;y.audioAnalysis.resolveDeviceSettings.useQuery;y.audioAnalysis.getDeviceSettingsContribution.useQuery;y.audioAnalysis.getDeviceLiveContribution.useQuery;y.audioAnalysis.applyDeviceSettingsPatch.useMutation;y.audioAnalyzer.analyseChunk.useMutation;y.audioAnalyzer.classify.useQuery;y.audioAnalyzer.isReady.useQuery;y.audioAnalyzer.dispose.useMutation;y.audioAnalyzer.reprobeAudioEngine.useMutation;y.audioCodec.listSupportedCodecs.useQuery;y.audioCodec.canHandle.useQuery;y.audioCodec.createDecodeSession.useMutation;y.audioCodec.createEncodeSession.useMutation;y.audioCodec.closeSession.useMutation;y.audioCodec.pushEncodedFrame.useMutation;y.audioCodec.pullPcm.useQuery;y.audioCodec.pushPcm.useMutation;y.audioCodec.pullEncoded.useQuery;y.audioCodec.flushEncode.useMutation;y.audioCodec.listActiveSessions.useQuery;y.audioMetrics.getCurrentSnapshot.useQuery;y.audioMetrics.getHistory.useQuery;y.automationControl.enable.useMutation;y.automationControl.disable.useMutation;y.automationControl.trigger.useMutation;y.automationControl.getStatus.useQuery;y.backup.listDestinations.useQuery;y.backup.trigger.useMutation;y.backup.list.useQuery;y.backup.listLocations.useQuery;y.backup.getEntries.useQuery;y.backup.restore.useMutation;y.backup.delete.useMutation;y.backup.listArchives.useQuery;y.backup.upsertDestinationPolicy.useMutation;y.backup.previewSchedule.useQuery;y.backup.listSchedules.useQuery;y.backup.upsertSchedule.useMutation;y.backup.deleteSchedule.useMutation;y.battery.wakeForStream.useMutation;y.battery.getStatus.useQuery;y.binary.getStatus.useQuery;y.brightness.setBrightness.useMutation;y.brightness.getStatus.useQuery;y.broker.list.useQuery;y.broker.get.useQuery;y.broker.listProviders.useQuery;y.broker.add.useMutation;y.broker.remove.useMutation;y.broker.testConnection.useMutation;y.broker.getSettings.useQuery;y.broker.setSettings.useMutation;y.broker.getBrokerConfig.useQuery;y.broker.getSettingsSchema.useQuery;y.broker.testSettings.useMutation;y.broker.publish.useMutation;y.broker.subscribe.useMutation;y.broker.unsubscribe.useMutation;y.broker.getState.useQuery;y.broker.getStatus.useQuery;y.button.press.useMutation;y.cameraCredentials.getCredentials.useQuery;y.cameraCredentials.getStatus.useQuery;y.cameraPipelineConfig.getDeviceSettingsContribution.useQuery;y.cameraPipelineConfig.getDeviceLiveContribution.useQuery;y.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation;y.cameraStreams.getCameraStreams.useQuery;y.cameraStreams.getBrokerStreams.useQuery;y.cameraStreams.getRtspEntries.useQuery;y.cameraStreams.getProfileRtspEntries.useQuery;y.cameraStreams.pickStream.useQuery;y.carbonMonoxide.getStatus.useQuery;y.climateControl.setMode.useMutation;y.climateControl.setFanMode.useMutation;y.climateControl.setPreset.useMutation;y.climateControl.setTarget.useMutation;y.climateControl.setTargetRange.useMutation;y.climateControl.setTargetHumidity.useMutation;y.climateControl.setSwingVertical.useMutation;y.climateControl.setSwingHorizontal.useMutation;y.climateControl.getStatus.useQuery;y.color.setColor.useMutation;y.color.getStatus.useQuery;y.connectionTest.testSettings.useMutation;y.connectionTest.describeTest.useQuery;y.connectivity.getStatus.useQuery;y.consumables.reset.useMutation;y.consumables.getStatus.useQuery;y.contact.getStatus.useQuery;y.control.setValue.useMutation;y.control.getStatus.useQuery;y.coreBlocks.list.useQuery;y.coreBlocks.get.useQuery;y.coreBlocks.create.useMutation;y.coreBlocks.update.useMutation;y.coreBlocks.delete.useMutation;y.coreBlocks.setEnabled.useMutation;y.coreBlocks.restart.useMutation;y.coreBlocks.compile.useMutation;y.coreBlocks.getTypeDefs.useQuery;y.cover.open.useMutation;y.cover.close.useMutation;y.cover.stop.useMutation;y.cover.setPosition.useMutation;y.cover.setTiltPosition.useMutation;y.cover.getStatus.useQuery;y.dayNight.getOptions.useQuery;y.dayNight.setSettings.useMutation;y.dayNight.getStatus.useQuery;y.decoder.supportsCodec.useQuery;y.decoder.getInfo.useQuery;y.decoder.createSession.useQuery;y.decoder.destroySession.useQuery;y.decoder.pushPacket.useQuery;y.decoder.openStream.useQuery;y.decoder.pullFrames.useQuery;y.decoder.pullHandles.useQuery;y.decoder.getFrame.useQuery;y.decoder.getShmStats.useQuery;y.decoder.updateConfig.useQuery;y.decoder.getStats.useQuery;y.decoder.listActiveSessions.useQuery;y.decoder.reprobeHwaccel.useMutation;y.detectionPipeline.getDeviceSettingsContribution.useQuery;y.detectionPipeline.getDeviceLiveContribution.useQuery;y.detectionPipeline.applyDeviceSettingsPatch.useMutation;y.deviceAdoption.listCandidateFilters.useQuery;y.deviceAdoption.listCandidates.useQuery;y.deviceAdoption.getCandidate.useQuery;y.deviceAdoption.refresh.useMutation;y.deviceAdoption.adopt.useMutation;y.deviceAdoption.release.useMutation;y.deviceAdoption.resync.useMutation;y.deviceAdoption.getStatus.useQuery;y.deviceDiscovery.listDiscovered.useQuery;y.deviceDiscovery.refreshDiscovery.useMutation;y.deviceDiscovery.adoptDevice.useMutation;y.deviceDiscovery.releaseDevice.useMutation;y.deviceDiscovery.getStatus.useQuery;y.deviceExport.getStatus.useQuery;y.deviceExport.listSupportedDeviceKinds.useQuery;y.deviceExport.listExposedDevices.useQuery;y.deviceExport.exposeDevice.useMutation;y.deviceExport.unexposeDevice.useMutation;y.deviceExport.getDeviceSettingsContribution.useQuery;y.deviceExport.getDeviceLiveContribution.useQuery;y.deviceExport.applyDeviceSettingsPatch.useMutation;y.deviceManager.allocateDeviceId.useMutation;y.deviceManager.registerDevice.useMutation;y.deviceManager.removeDevice.useMutation;y.deviceManager.persistConfig.useMutation;y.deviceManager.loadConfig.useQuery;y.deviceManager.loadRuntimeState.useQuery;y.deviceManager.loadMeta.useQuery;y.deviceManager.setName.useMutation;y.deviceManager.setLocation.useMutation;y.deviceManager.setType.useMutation;y.deviceManager.setIntegrationId.useMutation;y.deviceManager.setLinkDeviceId.useMutation;y.deviceManager.setPrimaryChildEntityId.useMutation;y.deviceManager.setChildLayout.useMutation;y.deviceManager.setDisplay.useMutation;var nI=y.deviceManager.getRoleDisplayDefaults.useQuery;y.deviceManager.setRoleDisplayDefaults.useMutation;y.deviceManager.getWireableFields.useQuery;y.deviceManager.setRole.useMutation;y.deviceManager.applyInitialMeta.useMutation;y.deviceManager.setMetadata.useMutation;y.deviceManager.listLocations.useQuery;y.deviceManager.addLocation.useMutation;y.deviceManager.removeLocation.useMutation;y.deviceManager.renameLocation.useMutation;y.deviceManager.setDisabled.useMutation;y.deviceManager.listPersistedByAddon.useQuery;y.deviceManager.listAll.useQuery;var aI=y.deviceManager.getDevice.useQuery;y.deviceManager.getChildren.useQuery;y.deviceManager.getChildrenBatch.useQuery;y.deviceManager.getLinkedDevices.useQuery;y.deviceManager.getLinkedDevicesBatch.useQuery;y.deviceManager.getStreamSources.useQuery;y.deviceManager.getConfigSchema.useQuery;y.deviceManager.getSettingsSchema.useQuery;y.deviceManager.updateConfig.useMutation;y.deviceManager.enable.useMutation;y.deviceManager.disable.useMutation;y.deviceManager.remove.useMutation;y.deviceManager.removeByIntegration.useMutation;y.deviceManager.getStreamProfileMap.useQuery;y.deviceManager.setStreamProfileMap.useMutation;y.deviceManager.probeStreams.useMutation;y.deviceManager.getBindings.useQuery;y.deviceManager.getBindingsBatch.useQuery;y.deviceManager.getAllBindings.useQuery;y.deviceManager.setWrapperActive.useMutation;y.deviceManager.listWrappersForCap.useQuery;y.deviceManager.listBindableCapsForDeviceType.useQuery;y.deviceManager.getDeviceSettingsAggregate.useQuery;y.deviceManager.getDeviceLiveInfoAggregate.useQuery;y.deviceManager.getDeviceAggregate.useQuery;y.deviceManager.runDeviceAction.useMutation;y.deviceManager.updateDeviceField.useMutation;y.deviceManager.updateDeviceFieldsBatch.useMutation;y.deviceManager.discoverDevices.useMutation;y.deviceManager.adoptDevice.useMutation;y.deviceManager.getCreationSchema.useQuery;y.deviceManager.createDevice.useMutation;y.deviceManager.testCreationField.useMutation;y.deviceManager.adoptionListCandidateFilters.useQuery;y.deviceManager.adoptionListCandidates.useQuery;y.deviceManager.adoptionRefresh.useMutation;y.deviceManager.adoptionAdopt.useMutation;y.deviceManager.adoptionRelease.useMutation;y.deviceManager.adoptionStartJob.useMutation;y.deviceManager.adoptionListJobs.useQuery;y.deviceManager.adoptionCancelJob.useMutation;y.deviceManager.adoptionResync.useMutation;y.deviceManager.discoveryProviders.useQuery;y.deviceManager.discoverAllProviders.useMutation;y.deviceManager.discoverProvider.useMutation;y.deviceManager.providerCreationType.useQuery;y.deviceManager.providerDiscoveryParamsSchema.useQuery;y.deviceManager.testField.useMutation;y.deviceManager.getDeviceStatusAggregate.useQuery;y.deviceManager.getDeviceStatusAggregateBatch.useQuery;y.deviceManager.getDeviceSettingsContribution.useQuery;y.deviceManager.getDeviceLiveContribution.useQuery;y.deviceManager.applyDeviceSettingsPatch.useMutation;y.deviceOps.getStreamSources.useQuery;y.deviceOps.getConfigEntries.useQuery;y.deviceOps.setConfig.useMutation;y.deviceOps.runAction.useMutation;y.deviceOps.removeDevice.useMutation;y.deviceOps.getSettingsSchema.useQuery;y.deviceOps.getRawState.useQuery;y.deviceProvider.start.useMutation;y.deviceProvider.stop.useMutation;y.deviceProvider.getStatus.useQuery;y.deviceProvider.getDevices.useQuery;y.deviceProvider.supportsDiscovery.useQuery;y.deviceProvider.discoverDevices.useMutation;y.deviceProvider.getDiscoveryParamsSchema.useQuery;y.deviceProvider.getManualCreationType.useQuery;y.deviceProvider.adoptDiscoveredDevice.useMutation;y.deviceProvider.supportsManualCreation.useQuery;y.deviceProvider.getChildCreationSchema.useQuery;y.deviceProvider.createDevice.useMutation;y.deviceProvider.testCreationField.useMutation;y.deviceState.getSnapshot.useQuery;y.deviceState.getCapSlice.useQuery;y.deviceState.getAllSnapshots.useQuery;y.deviceState.setCapSlice.useMutation;y.deviceStatus.getStatus.useQuery;y.doorbell.getStatus.useQuery;y.doorbell.getDeviceSettingsContribution.useQuery;y.doorbell.getDeviceLiveContribution.useQuery;y.doorbell.applyDeviceSettingsPatch.useMutation;y.enumSensor.getStatus.useQuery;y.eventEmitter.getStatus.useQuery;y.events.getEvents.useQuery;y.events.getEventThumbnail.useQuery;y.events.getEventClipUrl.useQuery;y.faceGallery.listIdentities.useQuery;y.faceGallery.createIdentity.useMutation;y.faceGallery.renameIdentity.useMutation;y.faceGallery.deleteIdentity.useMutation;y.faceGallery.listIdentitySamples.useQuery;y.faceGallery.removeSample.useMutation;y.faceGallery.listRecentFaces.useQuery;y.faceGallery.getFaceByTrack.useQuery;y.faceGallery.getFaceMedia.useQuery;y.faceGallery.assignFace.useMutation;y.faceGallery.unassignFace.useMutation;y.faceGallery.deleteFace.useMutation;y.faceGallery.assignFaces.useMutation;y.faceGallery.unassignFaces.useMutation;y.faceGallery.suggestFaceClusters.useQuery;y.fanControl.setPercentage.useMutation;y.fanControl.setPreset.useMutation;y.fanControl.setDirection.useMutation;y.fanControl.setOscillating.useMutation;y.fanControl.getStatus.useQuery;y.featureProbe.getStatus.useQuery;y.flood.getStatus.useQuery;y.gas.getStatus.useQuery;y.humidifier.setOn.useMutation;y.humidifier.setTargetHumidity.useMutation;y.humidifier.setMode.useMutation;y.humidifier.getStatus.useQuery;y.humiditySensor.getStatus.useQuery;y.image.getStatus.useQuery;y.imageSettings.getOptions.useQuery;y.imageSettings.setSettings.useMutation;y.imageSettings.getStatus.useQuery;y.integrations.list.useQuery;y.integrations.get.useQuery;y.integrations.getByAddonId.useQuery;y.integrations.create.useMutation;y.integrations.update.useMutation;y.integrations.delete.useMutation;y.integrations.getSettings.useQuery;y.integrations.setSettings.useMutation;y.integrations.getAvailableTypes.useQuery;y.integrations.testConnection.useMutation;var _te=y.intercom.startSession.useMutation,Tte=y.intercom.handleAnswer.useMutation,Ite=y.intercom.stopSession.useMutation;y.intercom.startTalkSession.useMutation;y.intercom.pushTalkAudio.useMutation;y.intercom.endTalkSession.useMutation;y.intercom.getStatus.useQuery;y.lawnMowerControl.startMowing.useMutation;y.lawnMowerControl.pause.useMutation;y.lawnMowerControl.dock.useMutation;y.lawnMowerControl.getStatus.useQuery;y.llm.generate.useMutation;y.llm.generateVision.useMutation;y.llm.cancel.useMutation;y.llm.listProfileKinds.useQuery;y.llm.listProfiles.useQuery;y.llm.upsertProfile.useMutation;y.llm.deleteProfile.useMutation;y.llm.testProfile.useMutation;y.llm.listModels.useQuery;y.llm.getDefaults.useQuery;y.llm.setDefault.useMutation;y.llm.getUsage.useQuery;y.llm.listModelCatalog.useQuery;y.llm.listRuntimeNodes.useQuery;y.llm.listNodeModels.useQuery;y.llm.resolveModelRef.useMutation;y.llm.installModel.useMutation;y.llm.deleteModel.useMutation;y.llm.getRuntimeStatus.useQuery;y.llm.startRuntime.useMutation;y.llm.stopRuntime.useMutation;y.localNetwork.list.useQuery;y.localNetwork.getPreferred.useQuery;y.localNetwork.getConnectionEndpoints.useQuery;y.localNetwork.getNotificationEndpoint.useQuery;y.localNetwork.setNotificationEndpoint.useMutation;y.localNetwork.getViewerEndpoints.useQuery;y.localNetwork.setViewerEndpoints.useMutation;y.localNetwork.getAllowedAddresses.useQuery;y.localNetwork.setAllowedAddresses.useMutation;y.localNetwork.resetAllowlistToBestMatch.useMutation;y.localNetwork.getTlsStatus.useQuery;y.localNetwork.regenerateCertificate.useMutation;y.localNetwork.uploadCertificate.useMutation;y.localNetwork.downloadCa.useQuery;y.localNetwork.revertToGeneratedCertificate.useMutation;y.lockControl.lock.useMutation;y.lockControl.unlock.useMutation;y.lockControl.open.useMutation;y.lockControl.getStatus.useQuery;y.mediaPlayer.play.useMutation;y.mediaPlayer.pause.useMutation;y.mediaPlayer.stop.useMutation;y.mediaPlayer.next.useMutation;y.mediaPlayer.previous.useMutation;y.mediaPlayer.seek.useMutation;y.mediaPlayer.setVolume.useMutation;y.mediaPlayer.setMute.useMutation;y.mediaPlayer.setShuffle.useMutation;y.mediaPlayer.setRepeat.useMutation;y.mediaPlayer.selectSource.useMutation;y.mediaPlayer.playMedia.useMutation;y.mediaPlayer.getStatus.useQuery;y.meshNetwork.getStatus.useQuery;y.meshNetwork.join.useMutation;y.meshNetwork.startLogin.useMutation;y.meshNetwork.leave.useMutation;y.meshNetwork.logout.useMutation;y.meshNetwork.listPeers.useQuery;y.meshNetwork.testConnection.useMutation;y.metricsProvider.collectSnapshot.useQuery;y.metricsProvider.getCached.useQuery;y.metricsProvider.getCurrent.useQuery;y.metricsProvider.getDiskSpace.useQuery;y.metricsProvider.getGpuInfo.useQuery;y.metricsProvider.getCpuTemperature.useQuery;y.metricsProvider.getProcessStats.useQuery;y.metricsProvider.listAddonInstances.useQuery;y.metricsProvider.getAddonStats.useQuery;y.metricsProvider.listNodeProcesses.useQuery;y.metricsProvider.getLoadSeries.useQuery;y.metricsProvider.dumpHeapSnapshot.useMutation;y.motion.isDetected.useQuery;y.motion.getStatus.useQuery;y.motionDetection.analyze.useMutation;y.motionDetection.removeCamera.useMutation;y.motionDetection.reset.useMutation;y.motionDetection.getDeviceSettingsContribution.useQuery;y.motionDetection.getDeviceLiveContribution.useQuery;y.motionDetection.applyDeviceSettingsPatch.useMutation;y.motionTrigger.setMotionTrigger.useMutation;y.motionTrigger.getStatus.useQuery;y.motionZones.getOptions.useQuery;y.motionZones.setZone.useMutation;y.motionZones.getStatus.useQuery;y.mqttBroker.listBrokers.useQuery;y.mqttBroker.getBrokerConfig.useQuery;y.mqttBroker.addBroker.useMutation;y.mqttBroker.removeBroker.useMutation;y.mqttBroker.testConnection.useMutation;y.mqttBroker.startEmbeddedBroker.useMutation;y.mqttBroker.stopEmbeddedBroker.useMutation;y.mqttBroker.getStatus.useQuery;y.nativeObjectDetection.setEnabled.useMutation;y.nativeObjectDetection.getStatus.useQuery;y.networkAccess.start.useMutation;y.networkAccess.stop.useMutation;y.networkAccess.getEndpoint.useQuery;y.networkAccess.getStatus.useQuery;y.networkAccess.listEndpoints.useQuery;y.networkQuality.getDeviceStats.useQuery;y.networkQuality.getAllStats.useQuery;y.networkQuality.reportClientStats.useMutation;y.nodes.topology.useQuery;y.nodes.deployAddon.useMutation;y.nodes.undeployAddon.useMutation;y.nodes.restartAddon.useMutation;y.nodes.restartProcess.useMutation;y.nodes.restartNode.useMutation;y.nodes.shutdownNode.useMutation;y.nodes.renameNode.useMutation;y.nodes.clusterAddonStatus.useQuery;y.nodes.getCapUsageGraph.useQuery;y.nodes.getNodeAddons.useQuery;y.nodes.setProcessLogLevel.useMutation;y.nodes.executeQuery.useMutation;y.notificationOutput.listTargetKinds.useQuery;y.notificationOutput.listTargets.useQuery;y.notificationOutput.discoverTargets.useQuery;y.notificationOutput.send.useMutation;y.notificationOutput.testTarget.useMutation;y.notificationOutput.upsertTarget.useMutation;y.notificationOutput.deleteTarget.useMutation;y.notificationOutput.setTargetEnabled.useMutation;y.notificationRules.listRules.useQuery;y.notificationRules.getRule.useQuery;y.notificationRules.createRule.useMutation;y.notificationRules.updateRule.useMutation;y.notificationRules.deleteRule.useMutation;y.notificationRules.setRuleEnabled.useMutation;y.notificationRules.listDeviceMutes.useQuery;y.notificationRules.setDeviceMuted.useMutation;y.notificationRules.testRule.useMutation;y.notificationRules.getConditionCatalog.useQuery;y.notificationRules.getHistory.useQuery;y.notificationRules.resolveArtifactUrl.useQuery;y.notificationRules.listSnoozes.useQuery;y.notificationRules.createSnooze.useMutation;y.notificationRules.cancelSnooze.useMutation;y.notificationRules.getAlarmConfig.useQuery;y.notificationRules.setAlarmConfig.useMutation;y.notifier.send.useMutation;y.notifier.cancel.useMutation;y.notifier.getStatus.useQuery;y.numericSensor.getStatus.useQuery;y.osd.setOverlay.useMutation;y.osd.getStatus.useQuery;y.osdManager.getDeviceOsd.useQuery;y.osdManager.getSourceCatalog.useQuery;y.osdManager.getConditionSupport.useQuery;y.osdManager.setSlotBinding.useMutation;y.osdManager.clearSlotBinding.useMutation;y.osdManager.copyDeviceConfiguration.useMutation;y.osdManager.previewSlot.useMutation;y.osdManager.renderDevice.useMutation;y.petFeeder.feed.useMutation;y.petFeeder.cancelFeed.useMutation;y.petFeeder.resetDesiccant.useMutation;y.petFeeder.markFoodReplenished.useMutation;y.petFeeder.callPet.useMutation;y.petFeeder.playSound.useMutation;y.petFeeder.setChildLock.useMutation;y.petFeeder.setIndicatorLight.useMutation;y.petFeeder.setFeedSound.useMutation;y.petFeeder.setVolume.useMutation;y.petFeeder.getStatus.useQuery;y.pipelineAnalytics.getActiveTracks.useQuery;y.pipelineAnalytics.getTrack.useQuery;y.pipelineAnalytics.listTracks.useQuery;y.pipelineAnalytics.listRecentTracks.useQuery;y.pipelineAnalytics.clearTracks.useMutation;y.pipelineAnalytics.getMotionEvents.useQuery;y.pipelineAnalytics.getObjectEvents.useQuery;y.pipelineAnalytics.getAudioEvents.useQuery;y.pipelineAnalytics.listEventKinds.useQuery;y.pipelineAnalytics.listEventKindsBatch.useQuery;y.pipelineAnalytics.getSensorEvents.useQuery;y.pipelineAnalytics.getKeyEvents.useQuery;y.pipelineAnalytics.getKeyEventsBatch.useQuery;y.pipelineAnalytics.getEventDensity.useQuery;y.pipelineAnalytics.getEventDensityBatch.useQuery;y.pipelineAnalytics.pruneEventsBefore.useMutation;y.pipelineAnalytics.pruneTracksBefore.useMutation;y.pipelineAnalytics.wipeAllAnalytics.useMutation;y.pipelineAnalytics.reconcileFromDisk.useMutation;y.pipelineAnalytics.deleteTracks.useMutation;y.pipelineAnalytics.setTrackFlags.useMutation;y.pipelineAnalytics.getEventStoreFootprint.useQuery;y.pipelineAnalytics.getEventMediaFootprintByKind.useQuery;y.pipelineAnalytics.pruneEvents.useMutation;y.pipelineAnalytics.deleteDeviceEvents.useMutation;y.pipelineAnalytics.pauseForStorageMigration.useMutation;y.pipelineAnalytics.resumeForStorageMigration.useMutation;y.pipelineAnalytics.refreshStorageLocationsForMigration.useMutation;y.pipelineAnalytics.startStorageMigrationMove.useMutation;y.pipelineAnalytics.getStorageMigrationMoveStatus.useQuery;y.pipelineAnalytics.cancelStorageMigrationMove.useMutation;y.pipelineAnalytics.relocateMedia.useMutation;y.pipelineAnalytics.countUnstampedEventMedia.useQuery;y.pipelineAnalytics.countRelocatableMedia.useQuery;y.pipelineAnalytics.listRelocateMediaJobs.useQuery;y.pipelineAnalytics.cancelRelocateMedia.useMutation;y.pipelineAnalytics.listOpsLog.useQuery;y.pipelineAnalytics.reclaimDebugMedia.useMutation;y.pipelineAnalytics.getMediaReclaimStatus.useQuery;y.pipelineAnalytics.getTrainingExportSummary.useQuery;y.pipelineAnalytics.getTrainingExportUrl.useQuery;y.pipelineAnalytics.listRetrainStaging.useQuery;y.pipelineAnalytics.listRetrainFrames.useQuery;y.pipelineAnalytics.selectRetrainFrames.useMutation;y.pipelineAnalytics.deselectRetrainFrame.useMutation;y.pipelineAnalytics.getRetrainFrameImage.useQuery;y.pipelineAnalytics.proposeRetrainAnnotations.useMutation;y.pipelineAnalytics.runReplayFrameProcessor.useMutation;y.pipelineAnalytics.listRetrainAnnotations.useQuery;y.pipelineAnalytics.saveRetrainAnnotations.useMutation;y.pipelineAnalytics.completeRetrainTrack.useMutation;y.pipelineAnalytics.restageRetrainTrack.useMutation;y.pipelineAnalytics.getRetrainExportUrl.useQuery;y.pipelineAnalytics.getEventMedia.useQuery;y.pipelineAnalytics.getTrackMedia.useQuery;y.pipelineAnalytics.listTrackMedia.useQuery;y.pipelineAnalytics.listEventMedia.useQuery;y.pipelineAnalytics.searchObjectEvents.useQuery;y.pipelineAnalytics.wipeObjectEmbeddings.useMutation;y.pipelineAnalytics.rebuildObjectEmbeddings.useMutation;y.pipelineAnalytics.getObjectEmbeddingRebuildStatus.useQuery;y.pipelineAnalytics.getDeviceSettingsContribution.useQuery;y.pipelineAnalytics.getDeviceLiveContribution.useQuery;y.pipelineAnalytics.applyDeviceSettingsPatch.useMutation;y.pipelineExecutor.getAvailableEngines.useQuery;y.pipelineExecutor.getSelectedEngine.useQuery;y.pipelineExecutor.getDefaultSteps.useQuery;y.pipelineExecutor.getEngineProvisioning.useQuery;y.pipelineExecutor.getVideoPipelineSteps.useQuery;y.pipelineExecutor.setVideoPipelineSteps.useMutation;y.pipelineExecutor.clearDeviceOverrides.useMutation;y.pipelineExecutor.getInferenceDeviceHealth.useQuery;y.pipelineExecutor.rearmInferenceDevice.useMutation;y.pipelineExecutor.getSchema.useQuery;y.pipelineExecutor.getGlobalSteps.useQuery;y.pipelineExecutor.getGlobalPipelineConfig.useQuery;y.pipelineExecutor.getOrchestratorConfigSchema.useQuery;y.pipelineExecutor.validatePipeline.useQuery;y.pipelineExecutor.listTemplates.useQuery;y.pipelineExecutor.saveTemplate.useMutation;y.pipelineExecutor.updateTemplate.useMutation;y.pipelineExecutor.deleteTemplate.useMutation;y.pipelineExecutor.getCapabilities.useQuery;y.pipelineExecutor.getAddonModels.useQuery;y.pipelineExecutor.downloadModel.useMutation;y.pipelineExecutor.deleteModel.useMutation;y.pipelineExecutor.runPipeline.useMutation;y.pipelineExecutor.runPipelineBatch.useMutation;y.pipelineExecutor.cacheFrameInPool.useMutation;y.pipelineExecutor.inferCached.useMutation;y.pipelineExecutor.uncacheFrame.useMutation;y.pipelineExecutor.getEffectiveTuning.useQuery;y.pipelineExecutor.listLoadedEngines.useQuery;y.pipelineExecutor.spinEngine.useMutation;y.pipelineExecutor.killEngine.useMutation;y.pipelineExecutor.listReferenceImages.useQuery;y.pipelineExecutor.getReferenceImage.useQuery;y.pipelineExecutor.getReferenceAudioFiles.useQuery;y.pipelineExecutor.getReferenceAudio.useQuery;y.pipelineExecutor.getAudioCapabilities.useQuery;y.pipelineExecutor.runAudioTest.useMutation;y.pipelineExecutor.getDetectionConfigSchema.useQuery;y.pipelineOrchestrator.pauseForStorageMigration.useMutation;y.pipelineOrchestrator.resumeForStorageMigration.useMutation;y.pipelineOrchestrator.assignPipeline.useMutation;y.pipelineOrchestrator.unassignPipeline.useMutation;y.pipelineOrchestrator.setPipelineDevicePin.useMutation;y.pipelineOrchestrator.getPipelineDevicePin.useQuery;y.pipelineOrchestrator.rebalance.useMutation;y.pipelineOrchestrator.getPipelineAssignments.useQuery;y.pipelineOrchestrator.getPipelineAssignment.useQuery;y.pipelineOrchestrator.getAgentLoad.useQuery;y.pipelineOrchestrator.getGlobalMetrics.useQuery;y.pipelineOrchestrator.getCameraMetrics.useQuery;y.pipelineOrchestrator.getCapabilityBindings.useQuery;y.pipelineOrchestrator.setCapabilityBinding.useMutation;y.pipelineOrchestrator.getIngestOwner.useQuery;y.pipelineOrchestrator.assignAudio.useMutation;y.pipelineOrchestrator.unassignAudio.useMutation;y.pipelineOrchestrator.getAudioAssignment.useQuery;y.pipelineOrchestrator.getAudioNodeLoad.useQuery;y.pipelineOrchestrator.getAudioAssignments.useQuery;y.pipelineOrchestrator.getAgentSettings.useQuery;y.pipelineOrchestrator.listAgentSettings.useQuery;y.pipelineOrchestrator.removeAgentSettings.useMutation;y.pipelineOrchestrator.setAgentMaxCameras.useMutation;y.pipelineOrchestrator.setAgentDetectWeight.useMutation;y.pipelineOrchestrator.setAgentCapabilities.useMutation;y.pipelineOrchestrator.setAgentReachableHost.useMutation;y.pipelineOrchestrator.setAgentInferenceDevices.useMutation;y.pipelineOrchestrator.getNodeInferenceDevices.useQuery;y.pipelineOrchestrator.resetNodePipelineDefaults.useMutation;y.pipelineOrchestrator.getCameraSettings.useQuery;y.pipelineOrchestrator.setCameraStepToggle.useMutation;y.pipelineOrchestrator.getCameraStepOverrides.useQuery;y.pipelineOrchestrator.setCameraStepOverride.useMutation;y.pipelineOrchestrator.setCameraPipelineForAgent.useMutation;y.pipelineOrchestrator.resolvePipeline.useQuery;y.pipelineOrchestrator.getCameraSwitches.useQuery;y.pipelineOrchestrator.setCameraSwitch.useMutation;y.pipelineOrchestrator.getCameraStatus.useQuery;y.pipelineOrchestrator.getCameraStatuses.useQuery;y.pipelineOrchestrator.reconcileFromDisk.useMutation;y.pipelineOrchestrator.getReconcileFromDiskStatus.useQuery;y.pipelineOrchestrator.listTemplates.useQuery;y.pipelineOrchestrator.saveTemplate.useMutation;y.pipelineOrchestrator.updateTemplate.useMutation;y.pipelineOrchestrator.deleteTemplate.useMutation;y.pipelineOrchestrator.getDeviceSettingsContribution.useQuery;y.pipelineOrchestrator.getDeviceLiveContribution.useQuery;y.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation;y.pipelineRunner.attachCamera.useMutation;y.pipelineRunner.detachCamera.useMutation;y.pipelineRunner.reportMotion.useMutation;y.pipelineRunner.getLocalLoad.useQuery;y.pipelineRunner.getLocalMetrics.useQuery;y.pipelineRunner.getCameraMetrics.useQuery;y.pipelineRunner.getAllCameraMetrics.useQuery;y.pipelineRunner.getLocalCameras.useQuery;y.pipelineRunner.getNativeCrop.useQuery;y.pipelineRunner.runDetailSubtree.useMutation;y.pipelineRunner.runStatelessStep.useMutation;y.plateGallery.listPlates.useQuery;y.plateGallery.getPlateByTrack.useQuery;y.plateGallery.getPlateMedia.useQuery;y.plateGallery.searchPlates.useQuery;y.plateGallery.suggestPlateClusters.useQuery;y.plateGallery.correctPlateText.useMutation;y.plateGallery.deletePlate.useMutation;y.plateGallery.listVehicles.useQuery;y.plateGallery.createVehicle.useMutation;y.plateGallery.renameVehicle.useMutation;y.plateGallery.deleteVehicle.useMutation;y.plateGallery.listVehicleSamples.useQuery;y.plateGallery.removeVehicleSample.useMutation;y.plateGallery.assignPlate.useMutation;y.plateGallery.unassignPlate.useMutation;y.plateGallery.assignPlates.useMutation;y.plateGallery.unassignPlates.useMutation;y.powerMeter.getStatus.useQuery;y.presence.getStatus.useQuery;y.pressureSensor.getStatus.useQuery;y.privacyMask.getOptions.useQuery;y.privacyMask.setMask.useMutation;y.privacyMask.setAudioEnabled.useMutation;y.privacyMask.getStatus.useQuery;y.ptz.move.useMutation;y.ptz.continuousMove.useMutation;y.ptz.stop.useMutation;y.ptz.getPresets.useQuery;y.ptz.goToPreset.useMutation;y.ptz.savePreset.useMutation;y.ptz.deletePreset.useMutation;y.ptz.getOptions.useQuery;y.ptz.goHome.useMutation;y.ptz.getPosition.useQuery;y.ptz.setAutofocus.useMutation;y.ptz.getStatus.useQuery;y.ptzAutotrack.getStatus.useQuery;y.ptzAutotrack.setEnabled.useMutation;y.ptzAutotrack.getSettings.useQuery;y.ptzAutotrack.setSettings.useMutation;y.reboot.reboot.useMutation;y.recording.getAvailability.useQuery;y.recording.getAvailabilityBatch.useQuery;y.recording.getDaysWithRecordings.useQuery;y.recording.getDaysWithRecordingsBatch.useQuery;y.recording.getPlaybackManifest.useQuery;y.recording.getStorageUsage.useQuery;y.recording.getDeviceConfig.useQuery;y.recording.locateSegment.useQuery;y.recording.readSegmentBytes.useQuery;y.recording.readGopBytes.useQuery;y.recording.readWindowBytes.useQuery;y.recording.setDeviceConfig.useMutation;y.recording.rescanStorage.useMutation;y.recording.pruneFootage.useMutation;y.recording.deleteFootprint.useMutation;y.recording.listOpsLog.useQuery;y.recording.renderGif.useMutation;y.recording.renderClip.useMutation;y.recording.pauseForStorageMigration.useMutation;y.recording.resumeForStorageMigration.useMutation;y.recording.refreshStorageLocationsForMigration.useMutation;y.recording.startStorageMigrationMove.useMutation;y.recording.getStorageMigrationMoveStatus.useQuery;y.recording.cancelStorageMigrationMove.useMutation;y.recording.relocateFootage.useMutation;y.recording.listRelocateJobs.useQuery;y.recording.getRelocateResidue.useQuery;y.recording.reconcileLedgerAgainstDisk.useMutation;y.recording.cancelRelocateJob.useMutation;y.recording.planStorageRebalance.useQuery;y.recording.startStorageRebalance.useMutation;y.recording.getPlacement.useQuery;y.recording.setDevicePlacement.useMutation;y.recording.getStatus.useQuery;y.recording.getDeviceSettingsContribution.useQuery;y.recording.getDeviceLiveContribution.useQuery;y.recording.applyDeviceSettingsPatch.useMutation;y.recordingExport.createExport.useMutation;y.recordingExport.listExports.useQuery;y.recordingExport.getExport.useQuery;y.recordingExport.cancelExport.useMutation;y.recordingExport.deleteExport.useMutation;y.recordingExport.getDownloadUrl.useQuery;y.recordingExport.readExportBytes.useQuery;y.sceneMonitor.listScenes.useQuery;y.sceneMonitor.listScenesBatch.useQuery;y.sceneMonitor.createScene.useMutation;y.sceneMonitor.updateScene.useMutation;y.sceneMonitor.deleteScene.useMutation;y.sceneMonitor.captureReference.useMutation;y.sceneMonitor.deleteReference.useMutation;y.sceneMonitor.recheckNow.useMutation;y.sceneMonitor.resetScene.useMutation;y.sceneMonitor.getStatus.useQuery;y.scriptRunner.run.useMutation;y.scriptRunner.stop.useMutation;y.scriptRunner.getStatus.useQuery;y.serverManagement.getServerPackageStatus.useQuery;y.serverManagement.checkServerUpdate.useMutation;y.serverManagement.applyServerUpdate.useMutation;y.serverManagement.rollbackServerUpdate.useMutation;y.serverManagement.restartServer.useMutation;y.settingsStore.get.useQuery;y.settingsStore.set.useMutation;y.settingsStore.query.useQuery;y.settingsStore.insert.useMutation;y.settingsStore.insertMany.useMutation;y.settingsStore.update.useMutation;y.settingsStore.delete.useMutation;y.settingsStore.deleteWhere.useMutation;y.settingsStore.updateWhere.useMutation;y.settingsStore.count.useQuery;y.settingsStore.aggregate.useQuery;y.settingsStore.histogram.useQuery;y.settingsStore.isEmpty.useQuery;y.settingsStore.declareCollection.useMutation;y.smoke.getStatus.useQuery;y.snapshot.getSnapshot.useQuery;y.snapshot.invalidateCache.useMutation;y.snapshot.getSnapshotOverview.useQuery;y.snapshot.getDebugState.useQuery;y.snapshot.getSnapshotLinks.useQuery;y.snapshot.getStatus.useQuery;y.snapshot.getDeviceSettingsContribution.useQuery;y.snapshot.getDeviceLiveContribution.useQuery;y.snapshot.applyDeviceSettingsPatch.useMutation;y.storage.resolve.useQuery;y.storage.write.useMutation;y.storage.read.useQuery;y.storage.exists.useQuery;y.storage.list.useQuery;y.storage.delete.useMutation;y.storage.getAvailableSpace.useQuery;y.storage.beginUpload.useMutation;y.storage.writeChunk.useMutation;y.storage.finalizeUpload.useMutation;y.storage.abortUpload.useMutation;y.storage.beginDownload.useMutation;y.storage.readChunk.useQuery;y.storage.endDownload.useMutation;y.storage.listLocations.useQuery;y.storage.getDefaultLocation.useQuery;y.storage.listLocationDeclarations.useQuery;y.storage.upsertLocation.useMutation;y.storage.deleteLocation.useMutation;y.storage.testLocation.useQuery;y.storage.listProviders.useQuery;y.storage.testConfig.useQuery;y.storageMigration.plan.useQuery;y.storageMigration.start.useMutation;y.storageMigration.status.useQuery;y.storageMigration.cancel.useMutation;y.storageMigration.movers.useQuery;y.storageMigration.residue.useQuery;y.storageMigration.drain.useMutation;y.storageMigration.cleanupStart.useMutation;y.storageMigration.cleanupStatus.useQuery;y.storageMigration.cleanupCancel.useMutation;y.storageMigration.history.useQuery;y.streamBroker.publishCameraStream.useMutation;y.streamBroker.retractCameraStream.useMutation;y.streamBroker.assignProfile.useMutation;y.streamBroker.unassignProfile.useMutation;y.streamBroker.renderPreBufferClip.useMutation;y.streamBroker.produceEventMedia.useMutation;y.streamBroker.fetchEventMedia.useMutation;y.streamBroker.listAllCameraStreams.useQuery;y.streamBroker.listAllProfileSlots.useQuery;y.streamBroker.getBrokerStats.useQuery;y.streamBroker.probeStream.useMutation;y.streamBroker.listClients.useQuery;y.streamBroker.killClient.useMutation;y.streamBroker.restartProfile.useMutation;y.streamBroker.getStreamUrl.useQuery;y.streamBroker.getStreamWithCodec.useMutation;y.streamBroker.releaseStreamWithCodec.useMutation;y.streamBroker.acquireEgressTranscode.useMutation;y.streamBroker.releaseEgressTranscode.useMutation;y.streamBroker.subscribeAudioChunks.useMutation;y.streamBroker.pullAudioChunks.useQuery;y.streamBroker.unsubscribeAudioChunks.useMutation;y.streamBroker.subscribeFrames.useMutation;y.streamBroker.pullFrameHandles.useQuery;y.streamBroker.unsubscribeFrames.useMutation;y.streamBroker.setPreBufferDuration.useMutation;y.streamBroker.getPreBufferInfo.useQuery;y.streamBroker.getRtspPort.useQuery;y.streamBroker.getAllRtspEntries.useQuery;y.streamBroker.getRtspEntry.useQuery;y.streamBroker.regenerateRtspToken.useMutation;y.streamBroker.setRtspEnabled.useMutation;y.streamBroker.isRtspEnabled.useQuery;y.streamBroker.getDeviceAudioMute.useQuery;y.streamBroker.setDeviceAudioMute.useMutation;y.streamBroker.getDeviceSettingsContribution.useQuery;y.streamBroker.getDeviceLiveContribution.useQuery;y.streamBroker.applyDeviceSettingsPatch.useMutation;y.streamCatalog.getCatalog.useQuery;y.streamParams.getOptions.useQuery;y.streamParams.setProfile.useMutation;y.streamParams.getConfigSchema.useQuery;y.streamParams.getStatus.useQuery;y.switch.setState.useMutation;y.switch.getStatus.useQuery;y.system.info.useQuery;y.system.health.useQuery;y.system.featureFlags.useQuery;y.system.networkAddresses.useQuery;y.system.getRetentionConfig.useQuery;y.system.setRetentionConfig.useMutation;y.system.forceRetentionCleanup.useMutation;y.system.getSiteLocation.useQuery;y.system.setSiteLocation.useMutation;y.system.detectSiteLocation.useMutation;y.system.getRequestCensus.useQuery;y.system.getLoadContributions.useQuery;y.system.getFailureContributions.useQuery;y.system.getLoggingSettings.useQuery;y.system.setLoggingSettings.useMutation;y.tamper.getStatus.useQuery;y.temperatureSensor.getStatus.useQuery;y.terminalSession.listProfiles.useQuery;y.terminalSession.listInstances.useQuery;y.terminalSession.createInstance.useMutation;y.terminalSession.updateInstance.useMutation;y.terminalSession.deleteInstance.useMutation;y.terminalSession.setInstanceEnabled.useMutation;y.terminalSession.listLegacyCameras.useQuery;y.terminalSession.adoptLegacyMonitor.useMutation;y.terminalSession.listSessions.useQuery;y.terminalSession.openSession.useMutation;y.terminalSession.resize.useMutation;y.terminalSession.pullOutput.useMutation;y.terminalSession.writeInput.useMutation;y.terminalSession.close.useMutation;y.toast.onToast.useSubscription;y.turnProvider.getTurnServers.useQuery;y.update.installUpdate.useMutation;y.update.getStatus.useQuery;y.userManagement.listUsers.useQuery;y.userManagement.createUser.useMutation;y.userManagement.updateUser.useMutation;y.userManagement.deleteUser.useMutation;y.userManagement.resetPassword.useMutation;y.userManagement.setUserScopes.useMutation;y.userManagement.validateCredentials.useMutation;y.userManagement.listApiKeys.useQuery;y.userManagement.createApiKey.useMutation;y.userManagement.revokeApiKey.useMutation;y.userManagement.validateApiKey.useMutation;y.userManagement.createScopedToken.useMutation;y.userManagement.revokeScopedToken.useMutation;y.userManagement.validateScopedToken.useQuery;y.userManagement.listScopedTokens.useQuery;y.userManagement.setupTotp.useMutation;y.userManagement.confirmTotp.useMutation;y.userManagement.disableTotp.useMutation;y.userManagement.getTotpStatus.useQuery;y.userManagement.verifyTotp.useMutation;y.userManagement.oauthIssueCode.useMutation;y.userManagement.oauthExchangeCode.useMutation;y.userManagement.oauthRefresh.useMutation;y.userManagement.oauthVerifyAccessToken.useQuery;y.userManagement.listOauthSessions.useQuery;y.userManagement.revokeOauthSession.useMutation;y.vacuumControl.start.useMutation;y.vacuumControl.pause.useMutation;y.vacuumControl.stop.useMutation;y.vacuumControl.returnToBase.useMutation;y.vacuumControl.locate.useMutation;y.vacuumControl.setFanSpeed.useMutation;y.vacuumControl.getStatus.useQuery;y.valve.open.useMutation;y.valve.close.useMutation;y.valve.stop.useMutation;y.valve.setPosition.useMutation;y.valve.getStatus.useQuery;y.vibration.getStatus.useQuery;y.videoclips.listClips.useQuery;y.videoclips.getClipPlayback.useQuery;y.waterHeater.setTargetTemp.useMutation;y.waterHeater.setOperationMode.useMutation;y.waterHeater.setAway.useMutation;y.waterHeater.getStatus.useQuery;y.weather.getStatus.useQuery;y.webrtcSession.listStreams.useQuery;y.webrtcSession.createSession.useMutation;y.webrtcSession.handleOffer.useMutation;y.webrtcSession.handleAnswer.useMutation;y.webrtcSession.addIceCandidate.useMutation;y.webrtcSession.getIceCandidates.useQuery;y.webrtcSession.closeSession.useMutation;y.webrtcSession.hasAdaptiveBitrate.useQuery;y.webrtcSession.getSessionState.useQuery;y.zoneAnalytics.getCurrentSnapshot.useQuery;y.zoneAnalytics.getCurrentSnapshotBatch.useQuery;y.zoneAnalytics.getZoneHistory.useQuery;y.zoneAnalytics.getCameraHistory.useQuery;y.zoneAnalytics.getUnzonedHistory.useQuery;y.zoneRules.listRules.useQuery;y.zoneRules.setRules.useMutation;y.zones.listZones.useQuery;y.zones.addZone.useMutation;y.zones.removeZone.useMutation;y.zones.updateZone.useMutation;di("camstack:custom-field-renderers",{});var zM={motion:OT,audio:su,person:Ste,vehicle:Rg,animal:va,package:Wee,sensor:ete,control:e0,car:Rg,truck:vte,bus:kee,motorcycle:RM,bicycle:RM,airplane:Jee,boat:nte,train:hte,bird:_M,cat:IM,dog:jM,horse:va,sheep:va,cow:va,elephant:va,bear:va,zebra:va,giraffe:va,door:Js,pir:VT,smoke:Qp,water:Wb,gas:Hi,vibration:YT,tamper:km,presence:bte,generic:WT,lock:au,siren:Vp,switch:mte,doorbell:Eg,button:PT,"audio-speech":HT,"audio-scream":FT,"audio-crying":gee,"audio-laughter":qee,"audio-music":QT,"audio-dog":jM,"audio-cat":IM,"audio-bird":_M,"audio-animal":va,"audio-alarm":Eg,"audio-doorbell":Eg,"audio-glass_breaking":el,"audio-gunshot":LT,"audio-vehicle":Rg,"audio-siren":Vp,"audio-fire":Qp,"audio-water":sl,"audio-wind":Hi,"audio-door":Js,"audio-footsteps":BT,"audio-crowd":xte,"audio-telephone":Yee,"audio-engine":Tee,"audio-tools":Dee,"audio-silence":XT};function LM(e){return Object.hasOwn(zM,e)?zM[e]:e.startsWith("audio-")?su:WT}di("camstack:confirm-dialog",null);di("camstack:device-context",null);var Nte="FEDERATION_DEBUG",by=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),Fr=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function iI(){return Fr}function rI(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function Ote(){try{if(iI()&&window.localStorage)return!!localStorage.getItem(Nte)}catch{return!1}return!1}function Sy(){return typeof process<"u"&&Ag&&Ag.FEDERATION_DEBUG?!!Ag.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Ote()}var jte="[ Federation Runtime ]",oI=function(...e){return e.length?e.reduce((t,n)=>n?t?`${t}:${n}`:n:t,""):""},xy=(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?!iI()&&!rI()&&"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),"")},sI=e=>{console.warn(`${jte}: ${e}`)};function lI(e){try{return JSON.stringify(e,null,2)}catch{return""}}var _g=(e,t)=>{if(!e)return t;const a=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const p=s.slice(1);return p.endsWith("/")?p.slice(0,-1):p}return s})(e);return a?a.endsWith("/")?`${a}${t}`:`${a}/${t}`:t};function Pte(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Dte(e,t={}){const{remotes:n={},overrides:a={},version:s}=t;let p;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&s?Pte(s):e.metaData.publicPath:e.metaData.getPublicPath,m=Object.keys(a);let h={};Object.keys(n).length||(h=e.remotes?.reduce((z,B)=>{let q;const Z=B.federationContainerName;return m.includes(Z)?q=a[Z]:"version"in B?q=B.version:q=B.entry,z[Z]={matchedVersion:q},z},{})||{}),Object.keys(n).forEach(z=>h[z]={matchedVersion:m.includes(z)?a[z]:n[z]});const{remoteEntry:{path:u,name:x,type:w},types:C={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:E},globalName:R,ssrRemoteEntry:I}=e.metaData,{exposes:j}=e;let D={version:s||"",buildVersion:E,globalName:R,remoteEntry:_g(u,x),remoteEntryType:w,remoteTypes:_g(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?(p={...D,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(p.ssrPublicPath=e.metaData.ssrPublicPath)):p={...D,getPublicPath:f()},I){const z=_g(I.path,I.name);p.ssrRemoteEntry=z,p.ssrRemoteEntryType=I.type||"commonjs-module"}return p}function cI(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var zte="[ Module Federation ]",lc=console,Lte=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function qte(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
75
+ `),n=t.filter(a=>!Lte.some(s=>a.includes(s)));return n.length?`Stack trace:
76
+ ${n.slice(0,5).join(`
77
+ `)}`:void 0}catch{return}}var uI=class{constructor(e,t=lc){this.prefix=e,this.delegate=t??lc}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??lc}emit(e,t){const n=this.delegate,a=Sy()?qte():void 0,s=a?[...t,a]:t,p=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const f of p){const m=n[f];if(typeof m=="function"){m.call(n,this.prefix,...s);return}}for(const f of p){const m=lc[f];if(typeof m=="function"){m.call(lc,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){Sy()&&this.emit("debug",e)}};function Bte(e){return new uI(e)}function Ute(e){const t=new uI(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Ute(zte);async function dI(e,t){try{return await e()}catch(n){sI(n);return}}function ky(e,t){const n=/^(https?:)?\/\//i;return e.replace(n,"").replace(/\/$/,"")===t.replace(n,"").replace(/\/$/,"")}function pI(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("script");for(let u=0;u<p.length;u++){const x=p[u],w=x.getAttribute("src");if(w&&ky(w,e.url)){t=x,n=!1;break}}if(!t){const u=e.attrs;t=document.createElement("script"),t.type=u?.type==="module"?"module":"text/javascript";let x;e.createScriptHook&&(x=e.createScriptHook(e.url,e.attrs),x instanceof HTMLScriptElement?t=x:typeof x=="object"&&("script"in x&&x.script&&(t=x.script),"timeout"in x&&x.timeout&&(a=x.timeout))),t.src||(t.src=e.url),u&&!x&&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 m=typeof window<"u"?u=>{if(u.filename&&ky(u.filename,e.url)){const x=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${u.message} (${u.filename}:${u.lineno}:${u.colno})`);x.name="ScriptExecutionError",f=x}}:null;m&&window.addEventListener("error",m);const h=async(u,x)=>{clearTimeout(s),m&&window.removeEventListener("error",m);const w=()=>{if(x?.type==="error"){const C=new Error(x?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);C.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(C)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,dI(()=>{const{needDeleteScript:C=!0}=e;C&&t?.parentNode&&t.parentNode.removeChild(t)}),u&&typeof u=="function")){const C=u(x);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 Fte(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("link");for(let m=0;m<p.length;m++){const h=p[m],u=h.getAttribute("href"),x=h.getAttribute("rel");if(u&&ky(u,e.url)&&x===e.attrs.rel){t=h,n=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let m,h=!0;const u=e.attrs;e.createLinkHook&&(m=e.createLinkHook(e.url,u),m instanceof HTMLLinkElement?(t=m,h=!1):typeof m=="object"&&("link"in m&&m.link&&(t=m.link,h=!1),"timeout"in m&&m.timeout&&(a=m.timeout))),u&&h&&Object.keys(u).forEach(x=>{t&&!t.getAttribute(x)&&t.setAttribute(x,u[x])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};const f=(m,h)=>{s&&clearTimeout(s);const u=()=>{if(h?.type==="error"){const x=new Error(h?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);x.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(x)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,dI(()=>{const{needDeleteLink:x=!0}=e;x&&t?.parentNode&&t.parentNode.removeChild(t)}),m)){const x=m(h);return u(),x}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 Hte(e,t){const{attrs:n={},createScriptHook:a}=t;return new Promise((s,p)=>{const{script:f,needAttach:m}=pI({url:e,cb:s,onErrorCallback:p,attrs:{fetchpriority:"high",...n},createScriptHook:a,needDeleteScript:!0});m&&document.head.appendChild(f)})}var Ld=new Map;function Ts(e){if(!e)throw new Error("import specifier is required");if(Ld.has(e))return Ld.get(e);const t=new Function("name","return import(name)")(e).then(n=>n).catch(n=>{throw console.error(`Error importing module ${e}:`,n),Ld.delete(e),n});return Ld.set(e,t),t}var mI=async()=>{const e=await Ts("node-fetch");return e.default||e},$te=async(e,t,n)=>{const s=await((p,f)=>n.lifecycle.fetch.emit(p,f))(e,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await mI():fetch)(e,t||{}):s},Qte=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,n,a)=>{if(a?.createScriptHook){const m=a.createScriptHook(e);m&&typeof m=="object"&&"url"in m&&(e=m.url)}let s;try{s=new URL(e)}catch(m){console.error("Error constructing URL:",m),t(new Error(`Invalid URL: ${m}`));return}const p=async()=>a?.fetch?(m,h)=>$te(m,h,a):typeof fetch>"u"?mI():fetch,f=async(m,h)=>{try{const u=await(await m(h.href)).text(),[x,w]=await Promise.all([Ts("path"),Ts("vm")]),C={exports:{},module:{exports:{}}},E=h.pathname.split("/").slice(0,-1).join("/"),R=x.basename(h.pathname),I=new w.Script(`(function(exports, module, require, __dirname, __filename) {${u}
78
+ })`,{filename:R,importModuleDynamically:w.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??Ts});let j;j=(await Ts("node:module")).createRequire(h.protocol==="file:"||h.protocol==="node:"?h.href:x.join(process.cwd(),"__mf_require_base__.js")),I.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}`))}};p().then(async m=>{if(n?.type==="esm"||n?.type==="module")return wy(s.href,{fetch:m,vm:await Ts("vm")}).then(async h=>{await h.evaluate(),t(void 0,h.namespace)}).catch(h=>{t(h instanceof Error?h:new Error(`Script execution error: ${h}`))});f(m,s)}).catch(m=>{t(m)})}:(e,t,n,a)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},Vte=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((n,a)=>{Qte(e,(s,p)=>{if(s)a(s);else{const f=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[f]=p)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},Tg=new Map;async function wy(e,t){if(Tg.has(e))return Tg.get(e);const{fetch:n,vm:a}=t,s=await(await n(e)).text(),p=new a.SourceTextModule(s,{importModuleDynamically:async(f,m)=>{const h=new URL(f,e).href;return wy(h,t)}});return Tg.set(e,p),await p.link(async f=>{const m=new URL(f,e).href;return await wy(m,t)}),p}var Gte=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,fI=(e,t,n,a)=>{const s=[`${[t[e]]} #${e}`];return n&&s.push(`args: ${JSON.stringify(n)}`),s.push(Gte(e)),a&&s.push(`Original Error Message:
79
+ ${a}`),s.join(`
80
+ `)};function Zte(e,t,n,a,s,p){return a(fI(e,t,n,s))}var xo="[ Federation Runtime ]",My=Bte(xo);function Fi(e,t,n,a,s){e||Gt(t)}function Gt(e,t,n,a,s){if(t!==void 0)return Zte(e,t,n??{},f=>{throw new Error(`${xo}: ${f}`)},a);const p=e;throw p instanceof Error?(p.message.startsWith(xo)||(p.message=`${xo}: ${p.message}`),p):new Error(`${xo}: ${p}`)}function qc(e){e instanceof Error&&(e.message.startsWith(xo)||(e.message=`${xo}: ${e.message}`)),My.warn(e)}function Kte(e,t){return e.findIndex(n=>n===t)===-1&&e.push(t),e}function Gp(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function t0(e){return typeof e.entry<"u"}function hI(e){return!e.entry.includes(".json")}function n0(e){return e&&typeof e=="object"}var Wte=Object.prototype.toString;function Yte(e){return Wte.call(e)==="[object Object]"}function gI(e){return Array.isArray(e)?e:[e]}function vI(e){const t={url:"",type:"global",globalName:""};return Fr||rI()||!("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 Xte=(e,t)=>{let n;return e.endsWith("/")?n=e.slice(0,-1):n=e,t.startsWith(".")&&(t=t.slice(1)),n=n+t,n},On=typeof globalThis=="object"?globalThis:window,Ha=(()=>{try{return document.defaultView}catch{return On}})(),Bc=Ha;function fp(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function hp(e,t){return Object.hasOwnProperty.call(e,t)}hp(On,"__GLOBAL_LOADING_REMOTE_ENTRY__")||fp(On,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var Ls=On.__GLOBAL_LOADING_REMOTE_ENTRY__;function yI(e){hp(e,"__VMOK__")&&!hp(e,"__FEDERATION__")&&fp(e,"__FEDERATION__",e.__VMOK__),hp(e,"__FEDERATION__")||(fp(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),fp(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}yI(On);yI(Ha);function Jte(e,t=Sy()){t&&(On.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,On.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.5.1")}function tl(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const n=Object.keys(e);for(const a of n){const[s,p]=a.split(":"),f=`${s}:${t}`,m=e[f];if(m)return{value:m,key:f}}return{value:void 0,key:t}}}else Gt(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var qM=()=>Ha.__FEDERATION__.moduleInfo,ene=(e,t)=>{const n=tl(t,Gp(e)).value;if(n&&!n.version&&"version"in e&&e.version&&(n.version=e.version),n)return n;if("version"in e&&e.version){const{version:a,...s}=e,p=Gp(s),f=tl(Ha.__FEDERATION__.moduleInfo,p).value;if(f?.version===a)return f}},gp=e=>ene(e,Ha.__FEDERATION__.moduleInfo),BM=(e,t)=>{const n=Gp(e);return Ha.__FEDERATION__.moduleInfo[n]=t,Ha.__FEDERATION__.moduleInfo},tne=e=>(Ha.__FEDERATION__.moduleInfo={...Ha.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const n of t)delete Ha.__FEDERATION__.moduleInfo[n]}),a0=(e,t)=>{const n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:On[n]}},nne=()=>Ha.__FEDERATION__.__GLOBAL_PLUGIN__,ane=e=>On.__FEDERATION__.__PRELOADED_MAP__.get(e),ine=e=>On.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),UM="[0-9A-Za-z-]+",i0=`(?:\\+(${UM}(?:\\.${UM})*))`,wc="0|[1-9]\\d*",vp="[0-9]+",bI="\\d*[a-zA-Z-][a-zA-Z0-9-]*",FM=`(?:${vp}|${bI})`,rne=`(?:-?(${FM}(?:\\.${FM})*))`,HM=`(?:${wc}|${bI})`,SI=`(?:-(${HM}(?:\\.${HM})*))`,Ig=`${wc}|x|X|\\*`,nl=`[v=\\s]*(${Ig})(?:\\.(${Ig})(?:\\.(${Ig})(?:${SI})?${i0}?)?)?`,one=`^\\s*(${nl})\\s+-\\s+(${nl})\\s*$`,sne=`[v=\\s]*${`(${vp})\\.(${vp})\\.(${vp})`}${rne}?${i0}?`,r0="((?:<|>)?=?)",lne=`(\\s*)${r0}\\s*(${sne}|${nl})`,xI="(?:~>?)",cne=`(\\s*)${xI}\\s+`,kI="(?:\\^)",une=`(\\s*)${kI}\\s+`,dne="(<|>)?=?\\s*\\*",pne=`^${kI}${nl}$`,mne=`v?${`(${wc})\\.(${wc})\\.(${wc})`}${SI}?${i0}?`,fne=`^${xI}${nl}$`,hne=`^${r0}\\s*${nl}$`,gne=`^${r0}\\s*(${mne})$|^$`,vne="^\\s*>=\\s*0.0.0\\s*$";function pi(e){return new RegExp(e)}function Qn(e){return!e||e.toLowerCase()==="x"||e==="*"}function wI(...e){return t=>e.reduce((n,a)=>a(n),t)}function $M(e){return e.match(pi(gne))}function QM(e,t,n,a){const s=`${e}.${t}.${n}`;return a?`${s}-${a}`:s}function yne(e){return e.replace(pi(one),(t,n,a,s,p,f,m,h,u,x,w,C)=>(Qn(a)?n="":Qn(s)?n=`>=${a}.0.0`:Qn(p)?n=`>=${a}.${s}.0`:n=`>=${n}`,Qn(u)?h="":Qn(x)?h=`<${Number(u)+1}.0.0-0`:Qn(w)?h=`<${u}.${Number(x)+1}.0-0`:C?h=`<=${u}.${x}.${w}-${C}`:h=`<=${h}`,`${n} ${h}`.trim()))}function bne(e){return e.replace(pi(lne),"$1$2$3")}function Sne(e){return e.replace(pi(cne),"$1~")}function xne(e){return e.replace(pi(une),"$1^")}function kne(e){return e.trim().split(/\s+/).map(t=>t.replace(pi(pne),(n,a,s,p,f)=>Qn(a)?"":Qn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Qn(p)?a==="0"?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.0 <${Number(a)+1}.0.0-0`:f?a==="0"?s==="0"?`>=${a}.${s}.${p}-${f} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p}-${f} <${Number(a)+1}.0.0-0`:a==="0"?s==="0"?`>=${a}.${s}.${p} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${Number(a)+1}.0.0-0`)).join(" ")}function wne(e){return e.trim().split(/\s+/).map(t=>t.replace(pi(fne),(n,a,s,p,f)=>Qn(a)?"":Qn(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:Qn(p)?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:f?`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`)).join(" ")}function Mne(e){return e.split(/\s+/).map(t=>t.trim().replace(pi(hne),(n,a,s,p,f,m)=>{const h=Qn(s),u=h||Qn(p),x=u||Qn(f);return a==="="&&x&&(a=""),m="",h?a===">"||a==="<"?"<0.0.0-0":"*":a&&x?(u&&(p=0),f=0,a===">"?(a=">=",u?(s=Number(s)+1,p=0,f=0):(p=Number(p)+1,f=0)):a==="<="&&(a="<",u?s=Number(s)+1:p=Number(p)+1),a==="<"&&(m="-0"),`${a+s}.${p}.${f}${m}`):u?`>=${s}.0.0${m} <${Number(s)+1}.0.0-0`:x?`>=${s}.${p}.0${m} <${s}.${Number(p)+1}.0-0`:n})).join(" ")}function Cne(e){return e.trim().replace(pi(dne),"")}function Ane(e){return e.trim().replace(pi(vne),"")}function yp(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Ene(e,t){const{preRelease:n}=e,{preRelease:a}=t;if(n===void 0&&a)return 1;if(n&&a===void 0)return-1;if(n===void 0&&a===void 0)return 0;for(let s=0,p=n.length;s<=p;s++){const f=n[s],m=a[s];if(f!==m)return f===void 0&&m===void 0?0:f?m?yp(f,m):-1:1}return 0}function qd(e,t){return yp(e.major,t.major)||yp(e.minor,t.minor)||yp(e.patch,t.patch)||Ene(e,t)}function Ng(e,t){return e.version===t.version}function Rne(e,t){switch(e.operator){case"":case"=":return Ng(e,t);case">":return qd(e,t)<0;case">=":return Ng(e,t)||qd(e,t)<0;case"<":return qd(e,t)>0;case"<=":return Ng(e,t)||qd(e,t)>0;case void 0:return!0;default:return!1}}function _ne(e){return wI(kne,wne,Mne,Cne)(e)}function Tne(e){return wI(yne,bne,Sne,xne)(e.trim()).split(/\s+/).join(" ")}function yc(e,t){if(!e)return!1;const n=$M(e);if(!n)return!1;const[,a,,s,p,f,m]=n,h={operator:a,version:QM(s,p,f,m),major:s,minor:p,patch:f,preRelease:m?.split(".")},u=t.split("||");for(const x of u){const w=x.trim();if(!w||w==="*"||w==="x")return!0;try{const C=Tne(w);if(!C.trim())return!0;const E=C.split(" ").map(j=>_ne(j)).join(" ");if(!E.trim())return!0;const R=E.split(/\s+/).map(j=>Ane(j)).filter(Boolean);if(R.length===0)continue;let I=!0;for(const j of R){const D=$M(j);if(!D){I=!1;break}const[,z,,B,q,Z,J]=D;if(!Rne({operator:z,version:QM(B,q,Z,J),major:B,minor:q,patch:Z,preRelease:J?.split(".")},h)){I=!1;break}}if(I)return!0}catch(C){console.error(`[semver] Error processing range part "${w}":`,C);continue}}return!1}var Mm="default",Ine="global";function Nne(e,t,n,a){let s;return"get"in e?s=e.get:"lib"in e?s=()=>Promise.resolve(e.lib):s=()=>Promise.resolve(()=>{Gt(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Gt(`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??by.UNKNOWN,useIn:[]}:void 0}}function MI(e,t){const n=t.shared||{},a=t.name,s=Object.keys(n).reduce((f,m)=>{const h=gI(n[m]);return f[m]=f[m]||[],h.forEach(u=>{f[m].push(Nne(u,a,m,t.shareStrategy))}),f},{}),p={...e.shared};return Object.keys(s).forEach(f=>{p[f]?s[f].forEach(m=>{p[f].find(h=>h.version===m.version)||p[f].push(m)}):p[f]=s[f]}),{allShareInfos:p,newShareInfos:s}}function Uc(e,t){if(!e)return!1;const{status:n,mode:a}=e;return n===by.NO_USE?!1:n===by.CALCULATED?!0:a==="runtime-infer"?t?jne(e,t):!0:!1}function Co(e,t){const n=a=>{if(!Number.isNaN(Number(a))){const s=a.split(".");let p=a;for(let f=0;f<3-s.length;f++)p+=".0";return p}return a};return!!yc(n(e),`<=${n(t)}`)}var Fc=(e,t)=>{const n=t||function(a,s){return Co(a,s)};return Object.keys(e).reduce((a,s)=>!a||n(a,s)||a==="0"?s:a,0)},Zp=e=>!!e.loaded||typeof e.lib=="function",One=e=>!!e.loading,jne=(e,t)=>{if(!e||!t)return!1;const{usedExports:n}=e;return n?!!t.every(a=>n.includes(a)):!1};function Pne(e,t,n,a){const s=e[t][n];let p="",f=Uc(a);const m=function(h,u){return f?s[h].treeShaking?s[u].treeShaking?!Zp(s[h].treeShaking)&&Co(h,u):!1:!0:!Zp(s[h])&&Co(h,u)};if(f){if(p=Fc(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:Fc(e[t][n],m),useTreesShaking:f}}var As=e=>Zp(e)||One(e);function Dne(e,t,n,a){const s=e[t][n];let p="",f=Uc(a);const m=function(h,u){if(f){if(!s[h].treeShaking)return!0;if(!s[u].treeShaking)return!1;if(As(s[u].treeShaking))return As(s[h].treeShaking)?!!Co(h,u):!0;if(As(s[h].treeShaking))return!1}return As(s[u])?As(s[h])?!!Co(h,u):!0:As(s[h])?!1:Co(h,u)};if(f){if(p=Fc(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:Fc(e[t][n],m),useTreesShaking:f}}function zne(e){return e==="loaded-first"?Dne:Pne}function bp(e,t,n,a){if(!e)return;const{shareConfig:s,scope:p=Mm,strategy:f,treeShaking:m}=n,h=Array.isArray(p)?p:[p];for(const u of h)if(s&&e[u]&&e[u][t]){const{requiredVersion:x}=s,{version:w,useTreesShaking:C}=zne(f)(e,u,t,m),E=()=>{const I=e[u][t][w];if(s.singleton){if(typeof x=="string"&&!yc(w,x)){const j=`Version ${w} from ${w&&I.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${x})`;s.strictVersion?Gt(j):qc(j)}return{shared:I,useTreesShaking:C}}else{if(x===!1||x==="*")return{shared:I,useTreesShaking:C};if(yc(w,x))return{shared:I,useTreesShaking:C};const j=Uc(m);if(j){for(const[D,z]of Object.entries(e[u][t]))if(Uc(z.treeShaking,m?.usedExports)&&yc(D,x))return{shared:z,useTreesShaking:j}}for(const[D,z]of Object.entries(e[u][t]))if(yc(D,x))return{shared:z,useTreesShaking:!1}}},R={shareScopeMap:e,scope:u,pkgName:t,version:w,GlobalFederation:Bc.__FEDERATION__,shareInfo:n,resolver:E};return(a.emit(R)||R).resolver()}}function CI(){return Bc.__FEDERATION__.__SHARE__}function VM(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[Fc(u,function(w,C){return!Zp(u[w])&&Co(w,C)})]},p=n?.resolver??s,f=h=>h!==null&&typeof h=="object"&&!Array.isArray(h),m=(...h)=>{const u={};for(const x of h)if(x)for(const[w,C]of Object.entries(x)){const E=u[w];f(E)&&f(C)?u[w]=m(E,C):C!==void 0&&(u[w]=C)}return u};return m(p(a[t]),n?.customShareInfo)}var Es=(e,t)=>{e.useIn||(e.useIn=[]),Kte(e.useIn,t)};function Bd(e,t){return t&&e.treeShaking?e.treeShaking:e}function o0(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function GM(e,t){for(const n of e){const a=t.startsWith(n.name);let s=t.replace(n.name,"");if(a){if(s.startsWith("/")){const m=n.name;return s=`.${s}`,{pkgNameOrAlias:m,expose:s,remote:n}}else if(s==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const p=n.alias&&t.startsWith(n.alias);let f=n.alias&&t.replace(n.alias,"");if(n.alias&&p){if(f&&f.startsWith("/")){const m=n.alias;return f=`.${f}`,{pkgNameOrAlias:m,expose:f,remote:n}}else if(f==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function Lne(e,t){for(const n of e)if(t===n.name||n.alias&&t===n.alias)return n}var AI="RUNTIME-001",EI="RUNTIME-002",RI="RUNTIME-003",_I="RUNTIME-004",TI="RUNTIME-005",Cy="RUNTIME-006",II="RUNTIME-007",NI="RUNTIME-008",qne="RUNTIME-009",OI="RUNTIME-010",jI="RUNTIME-011",Bne="RUNTIME-012",PI="RUNTIME-013",DI="RUNTIME-014",zI="RUNTIME-015",ra={[AI]:"Failed to get remoteEntry exports.",[EI]:'The remote entry interface does not contain "init"',[RI]:"Failed to get manifest.",[_I]:"Failed to locate remote.",[TI]:"Invalid loadShareSync function call from bundler runtime",[Cy]:"Invalid loadShareSync function call from runtime",[II]:"Failed to get remote snapshot.",[NI]:"Failed to load script resources.",[qne]:"Please call createInstance first.",[OI]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[jI]:"The remoteEntry URL is missing from the remote snapshot.",[Bne]:'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.',[PI]:"The manifest is not a valid Module Federation manifest.",[DI]:"The remote does not expose the requested module.",[zI]:"Remote container initialization failed."};({...ra});var LI=".then(callbacks[0]).catch(callbacks[1])";async function Une({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${LI}`)([n,a]):import(e).then(n).catch(a)}catch(s){Gt(`Failed to load ESM entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}async function Fne({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}")${LI}`)([n,a])}catch(s){Gt(`Failed to load SystemJS entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}function qI(e,t,n){const{remoteEntryKey:a,entryExports:s}=a0(e,t);return s||Gt(AI,ra,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:a}),s}async function Hne({name:e,globalName:t,entry:n,remoteInfo:a,loaderHook:s,getEntryUrl:p,resourceContext:f}){const{entryExports:m}=a0(e,t);if(m)return m;const h=p?p(n):n;return Hte(h,{attrs:{},createScriptHook:(u,x)=>{const w=s.lifecycle.createScript.emit({url:u,attrs:x,remoteInfo:a,resourceContext:f?{...f,url:u}:void 0});if(w&&(w instanceof HTMLScriptElement||"script"in w||"timeout"in w))return w}}).then(()=>qI(e,t,n),u=>{const x=u instanceof Error?u.message:String(u);Gt(NI,ra,{remoteName:e,resourceUrl:h},x)})}async function $ne({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:a,resourceContext:s}){const{entry:p,entryGlobalName:f,name:m,type:h}=e;switch(h){case"esm":case"module":return Une({entry:p,remoteEntryExports:t});case"system":return Fne({entry:p,remoteEntryExports:t});default:return Hne({entry:p,globalName:f,name:m,remoteInfo:e,loaderHook:n,getEntryUrl:a,resourceContext:s})}}async function Qne({remoteInfo:e,loaderHook:t,resourceContext:n}){const{entry:a,entryGlobalName:s,name:p,type:f}=e,{entryExports:m}=a0(p,s);return m||Vte(a,{attrs:{name:p,globalName:s,type:f},loaderHook:{createScriptHook:(h,u={})=>{const x=t.lifecycle.createScript.emit({url:h,attrs:u,remoteInfo:e,resourceContext:n?{...n,url:h}:void 0});if(x&&"url"in x)return x}}}).then(()=>qI(p,s,a)).catch(h=>{Gt(`Failed to load Node.js entry for remote "${p}" from "${a}". ${h instanceof Error?h.message:String(h)}`)})}function Ay(e){const{entry:t,name:n}=e;return oI(n,t)}async function s0(e){const{origin:t,remoteEntryExports:n,remoteInfo:a,getEntryUrl:s,resourceContext:p,_inErrorHandling:f=!1}=e,m=Ay(a);if(n)return n;if(!Ls[m]){const h=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook;Ls[m]=h.emit({origin:t,loaderHook:u,remoteInfo:a,remoteEntryExports:n}).then(x=>x||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":Fr)?$ne({remoteInfo:a,remoteEntryExports:n,loaderHook:u,getEntryUrl:s,resourceContext:p}):Qne({remoteInfo:a,loaderHook:u,resourceContext:p}))).then(async x=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:x}),x)).catch(async x=>{const w=Ay(a),C=x instanceof Error&&x.message.includes("ScriptExecutionError");if(x instanceof Error&&x.message.includes("RUNTIME-008")&&!C&&!f){const E=I=>s0({...I,_inErrorHandling:!0}),R=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:E,origin:t,remoteInfo:a,remoteEntryExports:n,globalLoading:Ls,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:x}),x})}return Ls[m]}function qs(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function Vne(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Gne(e,t){const n=nne(),a=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(s=>{e?.find(p=>p.name!==s.name)&&e.push(s)}),e&&e.length>0&&e.forEach(s=>{a.forEach(p=>{p.applyPlugin(s,t)})}),e}function Zne(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 $i(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(Zne)??[],shared:t}}}function BI(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Kne(e,t){return t.map(n=>{const a=Lne(e,n.nameOrAlias);return Fi(a,`Unable to preload ${n.nameOrAlias} as it is not included in ${!a&&lI({remoteInfo:a,remotes:e})}`),{remote:a,preloadConfig:BI(n)}})}function Wne(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function l0(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function Ao(e,t,n,a){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:a}}async function Yne(e,t,n,a){const s=e.moduleCache.get(n.name),p=n.entry;if(s?.remoteEntryExports)return Ao(a,p,"cached");try{if(!await s0({origin:e,remoteInfo:n,remoteEntryExports:s?.remoteEntryExports,resourceContext:{...a,url:p}}))throw new Error(`Failed to load remoteEntry "${p}".`);return Ao(a,p,"success")}catch(f){return Ao(a,p,l0(f)?"timeout":"error",f)}}function Og({host:e,remoteInfo:t,url:n,attrs:a,context:s,needDeleteLink:p}){return new Promise(f=>{const{link:m,needAttach:h}=Fte({url:n,cb:()=>{f(Ao(s,n,h?"success":"cached"))},onErrorCallback:u=>{f(Ao(s,n,l0(u)?"timeout":"error",u))},attrs:a,createLinkHook:(u,x)=>{const w=e.loaderHook.lifecycle.createLink.emit({url:u,attrs:x,remoteInfo:t,resourceContext:{...s,url:u}});return w instanceof HTMLLinkElement,w},needDeleteLink:p});h&&document.head.appendChild(m)})}function Xne({host:e,remoteInfo:t,url:n,attrs:a,context:s}){return new Promise(p=>{const{script:f,needAttach:m}=pI({url:n,cb:()=>{p(Ao(s,n,m?"success":"cached"))},onErrorCallback:h=>{p(Ao(s,n,l0(h)?"timeout":"error",h))},attrs:a,createScriptHook:(h,u)=>{const x=e.loaderHook.lifecycle.createScript.emit({url:h,attrs:u,remoteInfo:t,resourceContext:{...s,url:h}});return x instanceof HTMLScriptElement,x},needDeleteScript:!0});m&&document.head.appendChild(f)})}function cc(e,t){return{...e,resourceType:t}}function UI(e,t,n,a=!0,s={initiator:"preloadRemote",id:e.name}){const{cssAssets:p,jsAssetsWithoutEntry:f,entryAssets:m}=n,h=[];if(t.options.inBrowser){if(m.forEach(u=>{const{moduleInfo:x}=u;h.push(Yne(t,e,x,cc(s,"remoteEntry")))}),a){const u={rel:"preload",as:"style"};p.forEach(x=>{h.push(Og({host:t,remoteInfo:e,url:x,attrs:u,context:cc(s,"css")}))})}else{const u={rel:"stylesheet",type:"text/css"};p.forEach(x=>{h.push(Og({host:t,remoteInfo:e,url:x,attrs:u,needDeleteLink:!1,context:cc(s,"css")}))})}if(a){const u={rel:"preload",as:"script"};f.forEach(x=>{h.push(Og({host:t,remoteInfo:e,url:x,attrs:u,context:cc(s,"js")}))})}else{const u={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};f.forEach(x=>{h.push(Xne({host:t,remoteInfo:e,url:x,attrs:u,context:cc(s,"js")}))})}}return Promise.all(h)}function Jne(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 eae(e,t,n){const a=t,s=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];s.length||s.push("default"),s.forEach(f=>{a[f]||(a[f]={})});const p={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?s:e.shareScope||"default"};return Object.defineProperty(p,"shareScopeMap",{value:a,enumerable:!1}),{remoteEntryInitOptions:p,shareScope:a[s[0]],initScope:n??[]}}var FI=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 s0({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:o0(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return Fi(t,`remoteEntryExports is undefined
81
+ ${lI(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,a){const s=await this.getEntry(a);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,cached:!0,origin:this.host}),p}return s}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:p,shareScope:f,initScope:m}=eae(this.remoteInfo,this.host.shareScopeMap,n),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:f,remoteEntryInitOptions:p,initScope:m,remoteInfo:this.remoteInfo,origin:this.host});typeof s?.init>"u"&&Gt(EI,ra,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,$i(this.host.options));try{await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions)}catch(u){Gt(zI,ra,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,$i(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,origin:this.host}),p}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,n,a){const{loadFactory:s=!0}=n||{loadFactory:!0},p=await this.init(e,a,void 0,t);this.lib=p,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,origin:this.host});let f;try{const u=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:p,expose:t,moduleInfo:this.remoteInfo});f=typeof u=="function"?u:void 0,f||(f=await p.get(t)),f||Gt(DI,ra,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Jne(a)},void 0,$i(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,moduleFactory:f,origin:this.host})}catch(u){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,error:u,origin:this.host}),u}const m=Xte(this.remoteInfo.name,t),h=this.wraperFactory(f,m);if(!s)return h;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,origin:this.host});try{const 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)}}},aa=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()}},Sn=class extends aa{emit(...e){let t;const n=Array.from(this.listeners);if(n.length>0){let a=0;const s=p=>p===!1?!1:a<n.length?Promise.resolve(n[a++].apply(null,e)).then(f=>f===void 0||e.length===1&&f===e[0]?s(p):s(f)):p;t=s()}return Promise.resolve(t)}};function HI(e,t){if(!n0(t))return!1;if(e!==t){for(const n in e)if(!(n in t))return!1}return!0}var Hs=class extends aa{constructor(e){super(),this.onerror=Gt,this.type=e}emit(e){n0(e)||Gt(`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(HI(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){qc(n),this.onerror(n)}return e}},jr=class extends aa{constructor(e){super(),this.onerror=Gt,this.type=e}emit(e){n0(e)||Gt(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let n=0;const a=p=>(qc(p),this.onerror(p),e),s=p=>{if(p!==void 0&&HI(e,p))e=p;else if(p!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(s,a)}catch(f){return a(f)}return e};return Promise.resolve(s(e))}return Promise.resolve(e)}},$s=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Fi(Yte(e),"Plugin configuration is invalid.");const n=e.name;Fi(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){Fi(e,"A name is required.");const t=this.registerPlugins[e];Fi(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(t[n])})}};function $I(e,t){const n=vI(t);n.url||Gt(jI,ra,{remoteName:e.name});let a=xy(t,n.url);!Fr&&!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 tae(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:n,expose:a,origin:s,remoteInfo:p,id:f}=e;if(!t0(t)||!hI(t)){const{remoteSnapshot:m,globalSnapshot:h}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:o0(t.name,a)});$I(p,m);const u={remote:t,preloadConfig:{nameOrAlias:n,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},x=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:u,remoteInfo:p,remote:t,remoteSnapshot:m,globalSnapshot:h});return x&&UI(p,s,x,!1,{initiator:"loadRemote",id:f}).catch(()=>{}),{...e,remoteSnapshot:m}}return e}}}function nae(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 QI(e,t,n,a,s={},p){const{value:f}=tl(e,Gp(t)),m=p||f;if(m&&!cI(m)&&(n(m,t,a),m.remotesInfo)){const h=Object.keys(m.remotesInfo);for(const u of h){if(s[u])continue;s[u]=!0;const x=nae(u),w=m.remotesInfo[u];QI(e,{name:x.name,version:w.matchedVersion},n,!1,s,void 0)}}}var jg=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function aae(e,t,n,a,s){const p=[],f=[],m=[],h=new Set,u=new Set,{options:x}=e,{preloadConfig:w}=t,{depsRemote:C}=w;if(QI(a,n,(R,I,j)=>{let D;if(j)D=w;else if(Array.isArray(C)){const J=C.find($=>$.nameOrAlias===I.name||$.nameOrAlias===I.alias);if(!J)return;D=BI(J)}else if(C===!0)D=w;else return;const z=xy(R,vI(R).url);z&&m.push({name:I.name,moduleInfo:{name:I.name,entry:z,type:"remoteEntryType"in R?R.remoteEntryType:"global",entryGlobalName:"globalName"in R?R.globalName:I.name,shareScope:"",version:"version"in R?R.version:void 0},url:z});let B="modules"in R?R.modules:[];const q=Wne(D.exposes);q.length&&"modules"in R&&(B=R?.modules?.reduce((J,$)=>(q?.indexOf($.moduleName)!==-1&&J.push($),J),[]));function Z(J){const $=J.map(F=>xy(R,F));return D.filter?$.filter(D.filter):$}if(B){const J=B.length;for(let $=0;$<J;$++){const F=B[$],de=`${I.name}/${F.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:F.moduleName==="."?I.name:de,name:I.name,remoteSnapshot:R,preloadConfig:D,remote:I,origin:e}),!ane(de)&&(D.resourceCategory==="all"?(p.push(...Z(F.assets.css.async)),p.push(...Z(F.assets.css.sync)),f.push(...Z(F.assets.js.async)),f.push(...Z(F.assets.js.sync))):D.resourceCategory==="sync"&&(p.push(...Z(F.assets.css.sync)),f.push(...Z(F.assets.js.sync))),ine(de))}}},!0,{},s),s.shared&&s.shared.length>0){const R=(I,j)=>{const{shared:D}=bp(e.shareScopeMap,j.sharedName,I,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(I=>{const j=x.shared?.[I.sharedName];if(!j)return;const D=I.version?j.find(z=>z.version===I.version):j;D&&gI(D).forEach(z=>{R(z,I)})})}const E=f.filter(R=>!h.has(R)&&!jg("script",R));return{cssAssets:p.filter(R=>!u.has(R)&&!jg("link",R)),jsAssetsWithoutEntry:E,entryAssets:m.filter(R=>!jg("script",R.url))}}var iae=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:n,remoteInfo:a,remote:s,globalSnapshot:p,remoteSnapshot:f}=e;return Fr?t0(s)&&hI(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:a.name,entry:s.entry,type:a.type||"global",entryGlobalName:"",shareScope:""}}]}:($I(a,f),aae(t,n,a,p,f)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function VI(e,t){const n=gp({name:t.name,version:t.options.version}),a=n&&"remotesInfo"in n&&n.remotesInfo&&tl(n.remotesInfo,e.name).value;return a&&a.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:qM(),remoteSnapshot:gp({name:e.name,version:a.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:qM(),remoteSnapshot:gp({name:e.name,version:"version"in e?e.version:void 0})}}var rae=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new $s({beforeLoadRemoteSnapshot:new Sn("beforeLoadRemoteSnapshot"),loadSnapshot:new jr("loadGlobalSnapshot"),loadRemoteSnapshot:new jr("loadRemoteSnapshot"),afterLoadSnapshot:new jr("afterLoadSnapshot")}),this.manifestLoading=Bc.__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=gp({name:this.HostInstance.options.name,version:this.HostInstance.options.version});s||(s={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},tne({[this.HostInstance.options.name]:s})),s&&"remotesInfo"in s&&!tl(s.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(s.remotesInfo={...s?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:a,moduleInfo:e,hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m});let x,w;if(h)if(cI(h)){const C=Fr?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",E=await this.loadManifestSnapshot(C,e,{},{initiator:n,id:t||e.name}),R=BM({...e,entry:C},E);x=E,w=R}else{const{remoteSnapshot:C}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});x=C,w=u}else if(t0(e)){const C=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),E=BM(e,C);x=C,w=E}else Gt(II,ra,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,$i(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:a,moduleInfo:e,remoteSnapshot:x}),{remoteSnapshot:x,globalSnapshot:w}}getGlobalRemoteInfo(e){return VI(e,this.HostInstance)}async getManifestJson(e,t,n,a){return(async()=>{const p=qs(t);let f=this.manifestCache.get(e);if(f)return f;try{let h=await this.loaderHook.lifecycle.fetch.emit(e,{},p,a?{...a,url:e,resourceType:"manifest"}:void 0);(!h||!(h instanceof Response))&&(h=await fetch(e,{})),f=await h.json()}catch(h){f=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),f||(delete this.manifestLoading[e],Gt(RI,ra,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,$i(this.HostInstance.options)))}const m=[!f.metaData&&"metaData",!f.exposes&&"exposes",!f.shared&&"shared"].filter(Boolean);return m.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${m.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),m.length>0&&Gt(PI,ra,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:m.join(",")},void 0,$i(this.HostInstance.options)),this.manifestCache.set(e,f),f})()}async loadManifestSnapshot(e,t,n,a){const s=async()=>{const p=await this.getManifestJson(e,t,n,a),f=Dte(p,{version:e}),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:p,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return m};return this.manifestLoading[e]||(this.manifestLoading[e]=s().then(p=>p)),this.manifestLoading[e]}},oae=class{constructor(e){this.hooks=new $s({beforeRegisterShare:new Hs("beforeRegisterShare"),afterResolve:new jr("afterResolve"),beforeLoadShare:new jr("beforeLoadShare"),loadShare:new Sn,afterLoadShare:new aa("afterLoadShare"),errorLoadShare:new aa("errorLoadShare"),resolveShare:new Hs("resolveShare"),initContainerShareScopeMap:new Hs("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){qc(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:a,recovered:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:a,recovered:s})}catch(p){qc(p)}}registerShared(e,t){const{newShareInfos:n,allShareInfos:a}=MI(e,t);return Object.keys(n).forEach(s=>{n[s].forEach(p=>{p.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:s,shared:p}),this.shareScopeMap[f]?.[s]||this.setShared({pkgName:s,lib:p.lib,get:p.get,loaded:p.loaded||!!p.lib,shared:p,from:t.name})})})}),{newShareInfos:n,allShareInfos:a}}async loadShare(e,t){const{host:n}=this,a=VM({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,Fi(s,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const p=s,{shared:f,useTreesShaking:m}=bp(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(f){const h=Bd(f,m);if(h.lib)return Es(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),h.lib;if(h.loading&&!h.loaded){const u=await h.loading;return h.loaded=!0,h.lib||(h.lib=u),Es(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),u}else{const x=(async()=>{const C=await h.get();return Es(h,n.options.name),h.loaded=!0,h.lib=C,C})();this.setShared({pkgName:e,loaded:!1,shared:f,from:n.options.name,lib:null,loading:x,treeShaking:m?h:void 0});const w=await x;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),w}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,recovered:!0}),!1;const h=Uc(p.treeShaking),u=Bd(p,h),w=(async()=>{const E=await u.get();u.lib=E,u.loaded=!0,Es(u,n.options.name);const{shared:R,useTreesShaking:I}=bp(this.shareScopeMap,e,p,this.hooks.lifecycle.resolveShare)||{};if(R){const j=Bd(R,I);j.lib=E,j.loaded=!0,R.from=p.from}return E})();this.setShared({pkgName:e,loaded:!1,shared:p,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:p,selectedShared:p}),C}}catch(p){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:p}),p}}initializeSharing(e=Mm,t){const{host:n}=this,a=t?.from,s=t?.strategy;let p=t?.initScope;const f=[];if(a!=="build"){const{initTokens:C}=this;p||(p=[]);let E=C[e];if(E||(E=C[e]={from:this.host.name}),p.indexOf(E)>=0)return f;p.push(E)}const m=this.shareScopeMap,h=n.options.name;m[e]||(m[e]={});const u=m[e],x=(C,E)=>{const{version:R,eager:I}=E;u[C]=u[C]||{};const j=u[C],D=j[R]&&Bd(j[R]),z=!!(D&&("eager"in D&&D.eager||"shareConfig"in D&&D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!I!=!z?I: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(I){if(R=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:C,error:I,from:"runtime",lifecycle:"beforeLoadShare",remote:E.remoteInfo,origin:n}),!R)return}finally{R?.init&&!E.initing&&(E.remoteEntryExports=R,await E.init(void 0,void 0,p))}};return Object.keys(n.options.shared).forEach(C=>{n.options.shared[C].forEach(E=>{E.scope.includes(e)&&x(C,E)})}),(n.options.shareStrategy==="version-first"||s==="version-first")&&n.options.remotes.forEach(C=>{C.shareScope===e&&f.push(w(C.name))}),f}loadShareSync(e,t){const{host:n}=this,a=VM({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{a?.scope&&a.scope.forEach(p=>{this.initializeSharing(p,{strategy:a.strategy})});const{shared:s}=bp(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){if(typeof s.lib=="function")return Es(s,n.options.name),s.loaded||(s.loaded=!0,s.from===n.options.name&&(a.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),s.lib;if(typeof s.get=="function"){const p=s.get();if(!(p instanceof Promise))return Es(s,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:p,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),p}}if(a.lib)return a.loaded||(a.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib;if(a.get){const p=a.get();return p instanceof Promise&&Gt(t?.from==="build"?TI:Cy,ra,{hostName:n.options.name,sharedPkgName:e},void 0,$i(n.options)),a.lib=p,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:a.lib,shared:a}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib}Gt(Cy,ra,{hostName:n.options.name,sharedPkgName:e},void 0,$i(n.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,error:s}),s}}initShareScopeMap(e,t,n={}){const{host:a}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:a.options,origin:a,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:a,loading:s,loaded:p,get:f,treeShaking:m}){const{version:h,scope:u="default",...x}=t,w=Array.isArray(u)?u:[u],C=E=>{const R=(j,D,z)=>{z&&!j[D]&&(j[D]=z)},I=m?E.treeShaking:E;R(I,"loaded",p),R(I,"loading",s),R(I,"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],...x,lib:a});const R=this.shareScopeMap[E][e][h];C(R),n&&R.from!==n&&(R.from=n)})}_setGlobalShareScopeMap(e){const t=CI(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},sae=class{constructor(e){this.hooks=new $s({beforeRegisterRemote:new Hs("beforeRegisterRemote"),registerRemote:new Hs("registerRemote"),beforeRequest:new jr("beforeRequest"),afterMatchRemote:new Sn("afterMatchRemote"),onLoad:new Sn("onLoad"),afterLoadRemote:new Sn("afterLoadRemote"),handlePreloadModule:new aa("handlePreloadModule"),errorLoadRemote:new Sn("errorLoadRemote"),beforePreloadRemote:new Sn("beforePreloadRemote"),generatePreloadAssets:new Sn("generatePreloadAssets"),afterPreloadRemote:new Sn("afterPreloadRemote"),loadEntry:new Sn}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((n,a)=>(this.registerRemote(a,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,t){const{remote:n,expose:a}=t,{name:s,alias:p}=n;if(this.idToRemoteMap[e]={name:n.name,expose:a},p&&e.startsWith(s)){const f=e.replace(s,p);this.idToRemoteMap[f]={name:n.name,expose:a};return}if(p&&e.startsWith(p)){const f=e.replace(p,s);this.idToRemoteMap[f]={name:n.name,expose:a}}}async loadRemote(e,t){const{host:n}=this,a=GM(n.options.remotes,e);let s=e,p=a?.expose,f=a?qs(a.remote):void 0,m;try{const{loadFactory:h=!0}=t||{loadFactory:!0},{module:u,moduleOptions:x,remoteMatchInfo:w}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:C,remote:E,expose:R,id:I,remoteSnapshot:j}=w;s=I,p=R,f=qs(E);const D=await u.get(I,R,t,j),z=await this.hooks.lifecycle.onLoad.emit({id:I,pkgNameOrAlias:C,expose:R,exposeModule:h?D:void 0,exposeModuleFactory:h?void 0:D,remote:E,options:x,moduleInstance:u,origin:n});return this.setIdToRemoteMap(e,w),m={id:s,expose:p,remote:f,options:t,origin:n},typeof z=="function"?z:D}catch(h){const{from:u="runtime"}=t||{from:"runtime"};let x;try{x=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:u,lifecycle:"onLoad",expose:p,remote:f,origin:n})}catch(w){throw m={id:s,expose:p,remote:f,options:t,error:w,origin:n},w}if(!x)throw m={id:s,expose:p,remote:f,options:t,error:h,origin:n},h;return m={id:s,expose:p,remote:f,options:t,error:h,origin:n,recovered:!0},x}finally{m&&await this.hooks.lifecycle.afterLoadRemote.emit(m)}}async preloadRemote(e){const{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const a=Kne(t.options.remotes,e),s=m=>{const{preloadConfig:h,remote:u}=m,x=h.exposes||[];return x.length?x.map(w=>({ops:{...m,preloadConfig:{...h,exposes:[w]}},id:o0(u.name,w)})):[{ops:m,id:`${u.name}/*`}]};let p;await Promise.all(a.flatMap(s).map(async m=>{const{ops:h,id:u}=m,{remote:x,preloadConfig:w}=h,C=qs(x);try{const{globalSnapshot:E,remoteSnapshot:R}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:x,id:u,initiator:"preloadRemote"}),I=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:h,remote:x,remoteInfo:C,globalSnapshot:E,remoteSnapshot:R});if(!I)return;const j=await UI(C,t,I,!0,{initiator:"preloadRemote",id:u});n.push({remote:x,remoteInfo:C,preloadConfig:w,id:u,results:j})}catch(E){n.push({remote:x,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(m=>m.results.filter(h=>h.status==="error"||h.status==="timeout"));if(f.length>0&&(p=new Error(`preloadRemote failed to load ${f.length} resource(s).`),Object.assign(p,{results:n,failedResults:f})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:p}),p)throw p}registerRemotes(e,t){const{host:n}=this;e.forEach(a=>{this.registerRemote(a,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:n}=e;let a;try{a=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(E){if(a=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:"runtime",error:E,lifecycle:"beforeRequest"}),!a)throw E}const{id:s}=a,p=GM(t.options.remotes,s);if(!p)try{Gt(_I,ra,{hostName:t.options.name,requestId:s},void 0,$i(t.options))}catch(E){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:s,options:t.options,error:E,origin:t}),E}const{remote:f}=p,m=qs(f);await this.hooks.lifecycle.afterMatchRemote.emit({id:s,...p,options:t.options,remoteInfo:m,origin:t});const h=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:s,...p,options:t.options,origin:t,remoteInfo:m}),{remote:u,expose:x}=h;Fi(u&&x,`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:m};return w||(w=new FI(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(m=>e.alias&&(m.name.startsWith(e.alias)||m.alias?.startsWith(e.alias)));Fi(!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&&Fr&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Mm),e.type||(e.type=Ine)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:a});const p=t.find(f=>f.name===e.name);if(!p)s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a});else{const f=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n?.force&&(this.removeRemote(p),s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a}),sI(f.join(" ")))}}removeRemote(e){try{const{host:t}=this,{name:n}=e,a=t.options.remotes.findIndex(p=>p.name===n);a!==-1&&t.options.remotes.splice(a,1);const s=t.moduleCache.get(e.name);if(s){const p=s.remoteInfo,f=p.entryGlobalName;On[f]&&(Object.getOwnPropertyDescriptor(On,f)?.configurable?delete On[f]:On[f]=void 0);const m=Ay(s.remoteInfo);Ls[m]&&delete Ls[m],t.snapshotHandler.manifestCache.delete(p.entry);let h=p.buildVersion?oI(p.name,p.buildVersion):p.name;const u=On.__FEDERATION__.__INSTANCES__.findIndex(w=>p.buildVersion?w.options.id===h:w.name===h);if(u!==-1){const w=On.__FEDERATION__.__INSTANCES__[u];h=w.options.id||h;const C=CI();let E=!0;const R=[];Object.keys(C).forEach(I=>{const j=C[I];j&&Object.keys(j).forEach(D=>{const z=j[D];z&&Object.keys(z).forEach(B=>{const q=z[B];q&&Object.keys(q).forEach(Z=>{const J=q[Z];J&&typeof J=="object"&&J.from===p.name&&(J.loaded||J.loading?(J.useIn=J.useIn.filter($=>$!==p.name),J.useIn.length?E=!1:R.push([I,D,B,Z])):R.push([I,D,B,Z]))})})})}),E&&(w.shareScopeMap={},delete C[h]),R.forEach(([I,j,D,z])=>{delete C[I]?.[j]?.[D]?.[z]}),On.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:x}=VI(e,t);if(x){const w=x&&"remotesInfo"in x&&x.remotesInfo&&tl(x.remotesInfo,e.name).key;w&&(delete x.remotesInfo[w],Bc.__FEDERATION__.__MANIFEST_LOADING__[w]&&delete Bc.__FEDERATION__.__MANIFEST_LOADING__[w])}t.moduleCache.delete(e.name)}}catch(t){My.error(`removeRemote failed: ${t instanceof Error?t.message:String(t)}`)}}},lae=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,cae=class{constructor(e){this.hooks=new $s({beforeInit:new Hs("beforeInit"),init:new aa,beforeInitContainer:new jr("beforeInitContainer"),initContainer:new jr("initContainer")}),this.version="2.5.1",this.moduleCache=new Map,this.loaderHook=new $s({getModuleInfo:new aa,createScript:new aa,createLink:new aa,fetch:new Sn,loadEntryError:new Sn,afterLoadEntry:new Sn("afterLoadEntry"),beforeInitRemote:new Sn("beforeInitRemote"),afterInitRemote:new Sn("afterInitRemote"),beforeGetExpose:new Sn("beforeGetExpose"),afterGetExpose:new Sn("afterGetExpose"),beforeExecuteFactory:new Sn("beforeExecuteFactory"),afterExecuteFactory:new Sn("afterExecuteFactory"),getModuleFactory:new Sn}),this.bridgeHook=new $s({beforeBridgeRender:new aa,afterBridgeRender:new aa,beforeBridgeDestroy:new aa,afterBridgeDestroy:new aa});const t=lae?[tae(),iae()]:[],n={id:Vne(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:Fr};this.name=e.name,this.options=n,this.snapshotHandler=new rae(this),this.sharedHandler=new oae(this),this.remoteHandler=new sae(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&&Gt(fI(OI,ra)),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=Mm,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){const a=qs({name:e,entry:t}),s=new FI({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}=MI(e,t),{userOptions:a,options:s}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),p=this.remoteHandler.formatAndRegisterRemote(s,a),{allShareInfos:f}=this.sharedHandler.registerShared(s,a),m=[...s.plugins];a.plugins&&a.plugins.forEach(u=>{m.includes(u)||m.push(u)});const h={...e,...t,plugins:m,remotes:p,shared:f,id:a.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:h}),h}registerPlugins(e){const t=Gne(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})}};Jte(cae);di("camstack:widget-registry",null);function Nfe({title:e,icon:t,headerRight:n,collapsible:a=!1,defaultOpen:s=!0,bodyClassName:p="p-3",children:f}){const[m,h]=T.useState(s),u=!a||m,x=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground",children:[t,e]}),a?m?v.jsx(jo,{className:"h-3.5 w-3.5 text-foreground-subtle"}):v.jsx(Mee,{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:x}):v.jsx("div",{className:w,children:x}),u?v.jsx("div",{className:p,children:f}):null]})}var uae="capability.binding-changed";function lu(e,t){const[n,a]=T.useState(null);return T.useEffect(()=>{if(t===null){a(null);return}let s=!1;const p=async()=>{try{const m=await e.deviceManager.getBindings.query({deviceId:t});s||a(m)}catch{s||a(m=>m)}};p();const f=e.live?.onEvent.subscribe({category:uae},{onData:m=>{const h=m.data?.source;if(!h){p();return}h.type==="device"&&h.id===t&&p()}});return()=>{s=!0,f?.unsubscribe()}},[e,t]),T.useMemo(()=>n?zE(e,n):null,[e,n])}function Eo(e){const t=T.useCallback(a=>e?e.subscribe(()=>a()):()=>{},[e]),n=T.useCallback(()=>e?.value,[e]);return T.useSyncExternalStore(t,n,n)}function mt(e){const t=lu(e.trpc,e.deviceId),n=Eo(t!==null?e.slice(t):void 0),a=t!==null?e.cap(t):void 0,s=Eo(t!==null?t.state.deviceStatus:void 0),p=s?.online??!0,f=p?null:s?.lastChangedAt??null;return{dev:t,cap:a,slice:n,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&a!==void 0&&n!==void 0&&p,online:p,offlineSince:f}}function dae(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 Ofe(e){const t=dae(e);return t!==null?t==="no-provider"||t==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}function GI(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=GI(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function ZI(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=GI(e))&&(a&&(a+=" "),a+=t);return a}var pae=(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},mae=(e,t)=>({classGroupId:e,validator:t}),KI=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kp="-",ZM=[],fae="arbitrary..",hae=e=>{const t=vae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return gae(f);const m=f.split(Kp);return WI(m,m[0]===""&&m.length>1?1:0,t)},getConflictingClassGroupIds:(f,m)=>{if(m){const h=a[f],u=n[f];return h?u?pae(u,h):h:u||ZM}return n[f]||ZM}}},WI=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=WI(e,t+1,s);if(h)return h}const p=n.validators;if(p===null)return;const f=t===0?e.join(Kp):e.slice(t).join(Kp),m=p.length;for(let h=0;h<m;h++){const u=p[h];if(u.validator(f))return u.classGroupId}},gae=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?fae+a:void 0})(),vae=e=>{const{theme:t,classGroups:n}=e;return yae(n,t)},yae=(e,t)=>{const n=KI();for(const a in e){const s=e[a];c0(s,n,a,t)}return n},c0=(e,t,n,a)=>{const s=e.length;for(let p=0;p<s;p++){const f=e[p];bae(f,t,n,a)}},bae=(e,t,n,a)=>{if(typeof e=="string"){Sae(e,t,n);return}if(typeof e=="function"){xae(e,t,n,a);return}kae(e,t,n,a)},Sae=(e,t,n)=>{const a=e===""?t:YI(t,e);a.classGroupId=n},xae=(e,t,n,a)=>{if(wae(e)){c0(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(mae(n,e))},kae=(e,t,n,a)=>{const s=Object.entries(e),p=s.length;for(let f=0;f<p;f++){const[m,h]=s[f];c0(h,YI(t,m),n,a)}},YI=(e,t)=>{let n=e;const a=t.split(Kp),s=a.length;for(let p=0;p<s;p++){const f=a[p];let m=n.nextPart.get(f);m||(m=KI(),n.nextPart.set(f,m)),n=m}return n},wae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Mae=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(p,f)=>{n[p]=f,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(p){let f=n[p];if(f!==void 0)return f;if((f=a[p])!==void 0)return s(p,f),f},set(p,f){p in n?n[p]=f:s(p,f)}}},Ey="!",KM=":",Cae=[],WM=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),Aae=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const p=[];let f=0,m=0,h=0,u;const x=s.length;for(let I=0;I<x;I++){const j=s[I];if(f===0&&m===0){if(j===KM){p.push(s.slice(h,I)),h=I+1;continue}if(j==="/"){u=I;continue}}j==="["?f++:j==="]"?f--:j==="("?m++:j===")"&&m--}const w=p.length===0?s:s.slice(h);let C=w,E=!1;w.endsWith(Ey)?(C=w.slice(0,-1),E=!0):w.startsWith(Ey)&&(C=w.slice(1),E=!0);const R=u&&u>h?u-h:void 0;return WM(p,E,C,R)};if(t){const s=t+KM,p=a;a=f=>f.startsWith(s)?p(f.slice(s.length)):WM(Cae,!1,f,void 0,!0)}if(n){const s=a;a=p=>n({className:p,parseClassName:s})}return a},Eae=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let p=0;p<n.length;p++){const f=n[p],m=f[0]==="[",h=t.has(f);m||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(f)):s.push(f)}return s.length>0&&(s.sort(),a.push(...s)),a}},Rae=e=>({cache:Mae(e.cacheSize),parseClassName:Aae(e),sortModifiers:Eae(e),postfixLookupClassGroupIds:_ae(e),...hae(e)}),_ae=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},Tae=/\s+/,Iae=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:p,postfixLookupClassGroupIds:f}=t,m=[],h=e.trim().split(Tae);let u="";for(let x=h.length-1;x>=0;x-=1){const w=h[x],{isExternal:C,modifiers:E,hasImportantModifier:R,baseClassName:I,maybePostfixModifierPosition:j}=n(w);if(C){u=w+(u.length>0?" "+u:u);continue}let D=!!j,z;if(D){z=a(I.substring(0,j));const $=z&&f[z]?a(I):void 0;$&&$!==z&&(z=$,D=!1)}else z=a(I);if(!z){if(!D){u=w+(u.length>0?" "+u:u);continue}if(z=a(I),!z){u=w+(u.length>0?" "+u:u);continue}D=!1}const B=E.length===0?"":E.length===1?E[0]:p(E).join(":"),q=R?B+Ey:B,Z=q+z;if(m.indexOf(Z)>-1)continue;m.push(Z);const J=s(z,D);for(let $=0;$<J.length;++$){const F=J[$];m.push(q+F)}u=w+(u.length>0?" "+u:u)}return u},Nae=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=XI(n))&&(s&&(s+=" "),s+=a);return s},XI=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=XI(e[a]))&&(n&&(n+=" "),n+=t);return n},Oae=(e,...t)=>{let n,a,s,p;const f=h=>(n=Rae(t.reduce((u,x)=>x(u),e())),a=n.cache.get,s=n.cache.set,p=m,m(h)),m=h=>{const u=a(h);if(u)return u;const x=Iae(h,n);return s(h,x),x};return p=f,(...h)=>p(Nae(...h))},jae=[],Mn=e=>{const t=n=>n[e]||jae;return t.isThemeGetter=!0,t},JI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zae=/\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$/,Lae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>Pae.test(e),lt=e=>!!e&&!Number.isNaN(Number(e)),ai=e=>!!e&&Number.isInteger(Number(e)),Pg=e=>e.endsWith("%")&&lt(e.slice(0,-1)),zi=e=>Dae.test(e),t4=()=>!0,Uae=e=>zae.test(e)&&!Lae.test(e),u0=()=>!1,Fae=e=>qae.test(e),Hae=e=>Bae.test(e),$ae=e=>!je(e)&&!Pe(e),Qae=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)),Vae=e=>Hr(e,i4,u0),je=e=>JI.test(e),mo=e=>Hr(e,r4,Uae),YM=e=>Hr(e,eie,lt),Gae=e=>Hr(e,s4,t4),Zae=e=>Hr(e,o4,u0),XM=e=>Hr(e,n4,u0),Kae=e=>Hr(e,a4,Hae),Ud=e=>Hr(e,l4,Fae),Pe=e=>e4.test(e),uc=e=>Do(e,r4),Wae=e=>Do(e,o4),JM=e=>Do(e,n4),Yae=e=>Do(e,i4),Xae=e=>Do(e,a4),Fd=e=>Do(e,l4,!0),Jae=e=>Do(e,s4,!0),Hr=(e,t,n)=>{const a=JI.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Do=(e,t,n=!1)=>{const a=e4.exec(e);return a?a[1]?t(a[1]):n:!1},n4=e=>e==="position"||e==="percentage",a4=e=>e==="image"||e==="url",i4=e=>e==="length"||e==="size"||e==="bg-size",r4=e=>e==="length",eie=e=>e==="number",o4=e=>e==="family-name",s4=e=>e==="number"||e==="weight",l4=e=>e==="shadow",tie=()=>{const e=Mn("color"),t=Mn("font"),n=Mn("text"),a=Mn("font-weight"),s=Mn("tracking"),p=Mn("leading"),f=Mn("breakpoint"),m=Mn("container"),h=Mn("spacing"),u=Mn("radius"),x=Mn("shadow"),w=Mn("inset-shadow"),C=Mn("text-shadow"),E=Mn("drop-shadow"),R=Mn("blur"),I=Mn("perspective"),j=Mn("aspect"),D=Mn("ease"),z=Mn("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Z=()=>[...q(),Pe,je],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],F=()=>[Pe,je,h],de=()=>[Cr,"full","auto",...F()],we=()=>[ai,"none","subgrid",Pe,je],Ce=()=>["auto",{span:["full",ai,Pe,je]},ai,Pe,je],Me=()=>[ai,"auto",Pe,je],Ae=()=>["auto","min","max","fr",Pe,je],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Te=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...F()],ce=()=>[Cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],ke=()=>[Cr,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Ee=()=>[Cr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],me=()=>[e,Pe,je],L=()=>[...q(),JM,XM,{position:[Pe,je]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Yae,Vae,{size:[Pe,je]}],Se=()=>[Pg,uc,mo],ee=()=>["","none","full",u,Pe,je],ye=()=>["",lt,uc,mo],Oe=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[lt,Pg,JM,XM],$e=()=>["","none",R,Pe,je],Ne=()=>["none",lt,Pe,je],nt=()=>["none",lt,Pe,je],Ve=()=>[lt,Pe,je],Xe=()=>[Cr,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zi],breakpoint:[zi],color:[t4],container:[zi],"drop-shadow":[zi],ease:["in","out","in-out"],font:[$ae],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zi],shadow:[zi],spacing:["px",lt],text:[zi],"text-shadow":[zi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cr,je,Pe,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Pe,je]}],"container-named":[Qae],columns:[{columns:[lt,je,Pe,m]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Z()}],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:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{"inset-s":de(),start:de()}],end:[{"inset-e":de(),end:de()}],"inset-bs":[{"inset-bs":de()}],"inset-be":[{"inset-be":de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[ai,"auto",Pe,je]}],basis:[{basis:[Cr,"full","auto",m,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Cr,"auto","initial","none",je]}],grow:[{grow:["",lt,Pe,je]}],shrink:[{shrink:["",lt,Pe,je]}],order:[{order:[ai,"first","last","none",Pe,je]}],"grid-cols":[{"grid-cols":we()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":Me()}],"col-end":[{"col-end":Me()}],"grid-rows":[{"grid-rows":we()}],"row-start-end":[{row:Ce()}],"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":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...Te(),"normal"]}],"justify-self":[{"justify-self":["auto",...Te()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...Te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Te(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...Te(),"baseline"]}],"place-self":[{"place-self":["auto",...Te()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:ce()}],"inline-size":[{inline:["auto",...ke()]}],"min-inline-size":[{"min-inline":["auto",...ke()]}],"max-inline-size":[{"max-inline":["none",...ke()]}],"block-size":[{block:["auto",...Ee()]}],"min-block-size":[{"min-block":["auto",...Ee()]}],"max-block-size":[{"max-block":["none",...Ee()]}],w:[{w:[m,"screen",...ce()]}],"min-w":[{"min-w":[m,"screen","none",...ce()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...ce()]}],h:[{h:["screen","lh",...ce()]}],"min-h":[{"min-h":["screen","lh","none",...ce()]}],"max-h":[{"max-h":["screen","lh",...ce()]}],"font-size":[{text:["base",n,uc,mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Jae,Gae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Pg,je]}],"font-family":[{font:[Wae,Zae,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":[lt,"none",Pe,YM]}],leading:[{leading:[p,...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:me()}],"text-color":[{text:me()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",Pe,mo]}],"text-decoration-color":[{decoration:me()}],"underline-offset":[{"underline-offset":[lt,"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:[ai,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:L()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ai,Pe,je],radial:["",Pe,je],conic:[ai,Pe,je]},Xae,Kae]}],"bg-color":[{bg:me()}],"gradient-from-pos":[{from:Se()}],"gradient-via-pos":[{via:Se()}],"gradient-to-pos":[{to:Se()}],"gradient-from":[{from:me()}],"gradient-via":[{via:me()}],"gradient-to":[{to:me()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ye()}],"border-w-x":[{"border-x":ye()}],"border-w-y":[{"border-y":ye()}],"border-w-s":[{"border-s":ye()}],"border-w-e":[{"border-e":ye()}],"border-w-bs":[{"border-bs":ye()}],"border-w-be":[{"border-be":ye()}],"border-w-t":[{"border-t":ye()}],"border-w-r":[{"border-r":ye()}],"border-w-b":[{"border-b":ye()}],"border-w-l":[{"border-l":ye()}],"divide-x":[{"divide-x":ye()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ye()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:me()}],"border-color-x":[{"border-x":me()}],"border-color-y":[{"border-y":me()}],"border-color-s":[{"border-s":me()}],"border-color-e":[{"border-e":me()}],"border-color-bs":[{"border-bs":me()}],"border-color-be":[{"border-be":me()}],"border-color-t":[{"border-t":me()}],"border-color-r":[{"border-r":me()}],"border-color-b":[{"border-b":me()}],"border-color-l":[{"border-l":me()}],"divide-color":[{divide:me()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,Pe,je]}],"outline-w":[{outline:["",lt,uc,mo]}],"outline-color":[{outline:me()}],shadow:[{shadow:["","none",x,Fd,Ud]}],"shadow-color":[{shadow:me()}],"inset-shadow":[{"inset-shadow":["none",w,Fd,Ud]}],"inset-shadow-color":[{"inset-shadow":me()}],"ring-w":[{ring:ye()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:me()}],"ring-offset-w":[{"ring-offset":[lt,mo]}],"ring-offset-color":[{"ring-offset":me()}],"inset-ring-w":[{"inset-ring":ye()}],"inset-ring-color":[{"inset-ring":me()}],"text-shadow":[{"text-shadow":["none",C,Fd,Ud]}],"text-shadow-color":[{"text-shadow":me()}],opacity:[{opacity:[lt,Pe,je]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"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":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":me()}],"mask-image-linear-to-color":[{"mask-linear-to":me()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":me()}],"mask-image-t-to-color":[{"mask-t-to":me()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":me()}],"mask-image-r-to-color":[{"mask-r-to":me()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":me()}],"mask-image-b-to-color":[{"mask-b-to":me()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":me()}],"mask-image-l-to-color":[{"mask-l-to":me()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":me()}],"mask-image-x-to-color":[{"mask-x-to":me()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":me()}],"mask-image-y-to-color":[{"mask-y-to":me()}],"mask-image-radial":[{"mask-radial":[Pe,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":me()}],"mask-image-radial-to-color":[{"mask-radial-to":me()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":q()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":me()}],"mask-image-conic-to-color":[{"mask-conic-to":me()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,je]}],filter:[{filter:["","none",Pe,je]}],blur:[{blur:$e()}],brightness:[{brightness:[lt,Pe,je]}],contrast:[{contrast:[lt,Pe,je]}],"drop-shadow":[{"drop-shadow":["","none",E,Fd,Ud]}],"drop-shadow-color":[{"drop-shadow":me()}],grayscale:[{grayscale:["",lt,Pe,je]}],"hue-rotate":[{"hue-rotate":[lt,Pe,je]}],invert:[{invert:["",lt,Pe,je]}],saturate:[{saturate:[lt,Pe,je]}],sepia:[{sepia:["",lt,Pe,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,je]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[lt,Pe,je]}],"backdrop-contrast":[{"backdrop-contrast":[lt,Pe,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,Pe,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,Pe,je]}],"backdrop-invert":[{"backdrop-invert":["",lt,Pe,je]}],"backdrop-opacity":[{"backdrop-opacity":[lt,Pe,je]}],"backdrop-saturate":[{"backdrop-saturate":[lt,Pe,je]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,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:[lt,"initial",Pe,je]}],ease:[{ease:["linear","initial",D,Pe,je]}],delay:[{delay:[lt,Pe,je]}],animate:[{animate:["none",z,Pe,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,Pe,je]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:Ne()}],"rotate-x":[{"rotate-x":Ne()}],"rotate-y":[{"rotate-y":Ne()}],"rotate-z":[{"rotate-z":Ne()}],scale:[{scale:nt()}],"scale-x":[{"scale-x":nt()}],"scale-y":[{"scale-y":nt()}],"scale-z":[{"scale-z":nt()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[Pe,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],zoom:[{zoom:[ai,Pe,je]}],accent:[{accent:me()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:me()}],"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":me()}],"scrollbar-track-color":[{"scrollbar-track":me()}],"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",...me()]}],"stroke-w":[{stroke:[lt,uc,mo,YM]}],stroke:[{stroke:["none",...me()]}],"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"]}},nie=Oae(tie);function se(...e){return nie(ZI(e))}di("camstack:vod-playback",{request:null,play:()=>{},clear:()=>{}});di("camstack:recorded-playback",{bindControlChannel:null,channelOpen:!1,mode:"live",positionMs:null,send:()=>!1});T.lazy(()=>Vs(()=>import("./MotionZonesSettings-DNdnFHso-NM6J-UWF.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings}))),T.lazy(()=>Vs(()=>import("./PrivacyMaskSettings-DNSLc6ww-B3J9k853.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));var aie=Object.defineProperty,Wp=Object.getOwnPropertySymbols,c4=Object.prototype.hasOwnProperty,u4=Object.prototype.propertyIsEnumerable,eC=(e,t,n)=>t in e?aie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ry=(e,t)=>{for(var n in t||(t={}))c4.call(t,n)&&eC(e,n,t[n]);if(Wp)for(var n of Wp(t))u4.call(t,n)&&eC(e,n,t[n]);return e},_y=(e,t)=>{var n={};for(var a in e)c4.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Wp)for(var a of Wp(e))t.indexOf(a)<0&&u4.call(e,a)&&(n[a]=e[a]);return n};var _o;(e=>{const t=class pt{constructor(h,u,x,w){if(this.version=h,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],h<pt.MIN_VERSION||h>pt.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(x);if(this.drawCodewords(E),w==-1){let R=1e9;for(let I=0;I<8;I++){this.applyMask(I),this.drawFormatBits(I);const j=this.getPenaltyScore();j<R&&(w=I,R=j),this.applyMask(I)}}s(0<=w&&w<=7),this.mask=w,this.applyMask(w),this.drawFormatBits(w),this.isFunction=[]}static encodeText(h,u){const x=e.QrSegment.makeSegments(h);return pt.encodeSegments(x,u)}static encodeBinary(h,u){const x=e.QrSegment.makeBytes(h);return pt.encodeSegments([x],u)}static encodeSegments(h,u,x=1,w=40,C=-1,E=!0){if(!(pt.MIN_VERSION<=x&&x<=w&&w<=pt.MAX_VERSION)||C<-1||C>7)throw new RangeError("Invalid value");let R,I;for(R=x;;R++){const B=pt.getNumDataCodewords(R,u)*8,q=f.getTotalBits(h,R);if(q<=B){I=q;break}if(R>=w)throw new RangeError("Data too long")}for(const B of[pt.Ecc.MEDIUM,pt.Ecc.QUARTILE,pt.Ecc.HIGH])E&&I<=pt.getNumDataCodewords(R,B)*8&&(u=B);let j=[];for(const B of h){n(B.mode.modeBits,4,j),n(B.numChars,B.mode.numCharCountBits(R),j);for(const q of B.getData())j.push(q)}s(j.length==I);const D=pt.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 B=236;j.length<D;B^=253)n(B,8,j);let z=[];for(;z.length*8<j.length;)z.push(0);return j.forEach((B,q)=>z[q>>>3]|=B<<7-(q&7)),new pt(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 x=0;x<this.size;x++)this.setFunctionModule(6,x,x%2==0),this.setFunctionModule(x,6,x%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),u=h.length;for(let x=0;x<u;x++)for(let w=0;w<u;w++)x==0&&w==0||x==0&&w==u-1||x==u-1&&w==0||this.drawAlignmentPattern(h[x],h[w]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const u=this.errorCorrectionLevel.formatBits<<3|h;let x=u;for(let C=0;C<10;C++)x=x<<1^(x>>>9)*1335;const w=(u<<10|x)^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 x=0;x<12;x++)h=h<<1^(h>>>11)*7973;const u=this.version<<12|h;s(u>>>18==0);for(let x=0;x<18;x++){const w=a(u,x),C=this.size-11+x%3,E=Math.floor(x/3);this.setFunctionModule(C,E,w),this.setFunctionModule(E,C,w)}}drawFinderPattern(h,u){for(let x=-4;x<=4;x++)for(let w=-4;w<=4;w++){const C=Math.max(Math.abs(w),Math.abs(x)),E=h+w,R=u+x;0<=E&&E<this.size&&0<=R&&R<this.size&&this.setFunctionModule(E,R,C!=2&&C!=4)}}drawAlignmentPattern(h,u){for(let x=-2;x<=2;x++)for(let w=-2;w<=2;w++)this.setFunctionModule(h+w,u+x,Math.max(Math.abs(w),Math.abs(x))!=1)}setFunctionModule(h,u,x){this.modules[u][h]=x,this.isFunction[u][h]=!0}addEccAndInterleave(h){const u=this.version,x=this.errorCorrectionLevel;if(h.length!=pt.getNumDataCodewords(u,x))throw new RangeError("Invalid argument");const w=pt.NUM_ERROR_CORRECTION_BLOCKS[x.ordinal][u],C=pt.ECC_CODEWORDS_PER_BLOCK[x.ordinal][u],E=Math.floor(pt.getNumRawDataModules(u)/8),R=w-E%w,I=Math.floor(E/w);let j=[];const D=pt.reedSolomonComputeDivisor(C);for(let B=0,q=0;B<w;B++){let Z=h.slice(q,q+I-C+(B<R?0:1));q+=Z.length;const J=pt.reedSolomonComputeRemainder(Z,D);B<R&&Z.push(0),j.push(Z.concat(J))}let z=[];for(let B=0;B<j[0].length;B++)j.forEach((q,Z)=>{(B!=I-C||Z>=R)&&z.push(q[B])});return s(z.length==E),z}drawCodewords(h){if(h.length!=Math.floor(pt.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let x=this.size-1;x>=1;x-=2){x==6&&(x=5);for(let w=0;w<this.size;w++)for(let C=0;C<2;C++){const E=x-C,R=(x+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 x=0;x<this.size;x++){let w;switch(h){case 0:w=(x+u)%2==0;break;case 1:w=u%2==0;break;case 2:w=x%3==0;break;case 3:w=(x+u)%3==0;break;case 4:w=(Math.floor(x/3)+Math.floor(u/2))%2==0;break;case 5:w=x*u%2+x*u%3==0;break;case 6:w=(x*u%2+x*u%3)%2==0;break;case 7:w=((x+u)%2+x*u%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[u][x]&&w&&(this.modules[u][x]=!this.modules[u][x])}}getPenaltyScore(){let h=0;for(let C=0;C<this.size;C++){let E=!1,R=0,I=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[C][j]==E?(R++,R==5?h+=pt.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,I),E||(h+=this.finderPenaltyCountPatterns(I)*pt.PENALTY_N3),E=this.modules[C][j],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,I)*pt.PENALTY_N3}for(let C=0;C<this.size;C++){let E=!1,R=0,I=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][C]==E?(R++,R==5?h+=pt.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,I),E||(h+=this.finderPenaltyCountPatterns(I)*pt.PENALTY_N3),E=this.modules[j][C],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,I)*pt.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+=pt.PENALTY_N2)}let u=0;for(const C of this.modules)u=C.reduce((E,R)=>E+(R?1:0),u);const x=this.size*this.size,w=Math.ceil(Math.abs(u*20-x*10)/x)-1;return s(0<=w&&w<=9),h+=w*pt.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 x=[6];for(let w=this.size-7;x.length<h;w-=u)x.splice(1,0,w);return x}}static getNumRawDataModules(h){if(h<pt.MIN_VERSION||h>pt.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*h+128)*h+64;if(h>=2){const x=Math.floor(h/7)+2;u-=(25*x-10)*x-55,h>=7&&(u-=36)}return s(208<=u&&u<=29648),u}static getNumDataCodewords(h,u){return Math.floor(pt.getNumRawDataModules(h)/8)-pt.ECC_CODEWORDS_PER_BLOCK[u.ordinal][h]*pt.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 x=1;for(let w=0;w<h;w++){for(let C=0;C<u.length;C++)u[C]=pt.reedSolomonMultiply(u[C],x),C+1<u.length&&(u[C]^=u[C+1]);x=pt.reedSolomonMultiply(x,2)}return u}static reedSolomonComputeRemainder(h,u){let x=u.map(w=>0);for(const w of h){const C=w^x.shift();x.push(0),u.forEach((E,R)=>x[R]^=pt.reedSolomonMultiply(E,C))}return x}static reedSolomonMultiply(h,u){if(h>>>8||u>>>8)throw new RangeError("Byte out of range");let x=0;for(let w=7;w>=0;w--)x=x<<1^(x>>>7)*285,x^=(u>>>w&1)*h;return s(x>>>8==0),x}finderPenaltyCountPatterns(h){const u=h[1];s(u<=this.size*3);const x=u>0&&h[2]==u&&h[3]==u*3&&h[4]==u&&h[5]==u;return(x&&h[0]>=u*4&&h[6]>=u?1:0)+(x&&h[6]>=u*4&&h[0]>=u?1:0)}finderPenaltyTerminateAndCount(h,u,x){return h&&(this.finderPenaltyAddHistory(u,x),u=0),u+=this.size,this.finderPenaltyAddHistory(u,x),this.finderPenaltyCountPatterns(x)}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(m,h,u){if(h<0||h>31||m>>>h)throw new RangeError("Value out of range");for(let x=h-1;x>=0;x--)u.push(m>>>x&1)}function a(m,h){return(m>>>h&1)!=0}function s(m){if(!m)throw new Error("Assertion error")}const p=class rn{constructor(h,u,x){if(this.mode=h,this.numChars=u,this.bitData=x,u<0)throw new RangeError("Invalid argument");this.bitData=x.slice()}static makeBytes(h){let u=[];for(const x of h)n(x,8,u);return new rn(rn.Mode.BYTE,h.length,u)}static makeNumeric(h){if(!rn.isNumeric(h))throw new RangeError("String contains non-numeric characters");let u=[];for(let x=0;x<h.length;){const w=Math.min(h.length-x,3);n(parseInt(h.substring(x,x+w),10),w*3+1,u),x+=w}return new rn(rn.Mode.NUMERIC,h.length,u)}static makeAlphanumeric(h){if(!rn.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let u=[],x;for(x=0;x+2<=h.length;x+=2){let w=rn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x))*45;w+=rn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x+1)),n(w,11,u)}return x<h.length&&n(rn.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x)),6,u),new rn(rn.Mode.ALPHANUMERIC,h.length,u)}static makeSegments(h){return h==""?[]:rn.isNumeric(h)?[rn.makeNumeric(h)]:rn.isAlphanumeric(h)?[rn.makeAlphanumeric(h)]:[rn.makeBytes(rn.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 rn(rn.Mode.ECI,0,u)}static isNumeric(h){return rn.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return rn.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,u){let x=0;for(const w of h){const C=w.mode.numCharCountBits(u);if(w.numChars>=1<<C)return 1/0;x+=4+C+w.bitData.length}return x}static toUtf8ByteArray(h){h=encodeURI(h);let u=[];for(let x=0;x<h.length;x++)h.charAt(x)!="%"?u.push(h.charCodeAt(x)):(u.push(parseInt(h.substring(x+1,x+3),16)),x+=2);return u}};p.NUMERIC_REGEX=/^[0-9]*$/,p.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,p.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=p;e.QrSegment=p})(_o||(_o={}));(e=>{(t=>{const n=class{constructor(s,p){this.ordinal=s,this.formatBits=p}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(_o||(_o={}));(e=>{(t=>{const n=class{constructor(s,p){this.modeBits=s,this.numBitsCharCount=p}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(_o||(_o={}));var Bs=_o;var iie={L:Bs.QrCode.Ecc.LOW,M:Bs.QrCode.Ecc.MEDIUM,Q:Bs.QrCode.Ecc.QUARTILE,H:Bs.QrCode.Ecc.HIGH},d4=128,p4="L",m4="#FFFFFF",f4="#000000",h4=!1,g4=1,rie=4,oie=0,sie=.1;function v4(e,t=0){const n=[];return e.forEach(function(a,s){let p=null;a.forEach(function(f,m){if(!f&&p!==null){n.push(`M${p+t} ${s+t}h${m-p}v1H${p+t}z`),p=null;return}if(m===a.length-1){if(!f)return;p===null?n.push(`M${m+t},${s+t} h1v1H${m+t}z`):n.push(`M${p+t},${s+t} h${m+1-p}v1H${p+t}z`);return}f&&p===null&&(p=m)})}),n.join("")}function y4(e,t){return e.slice().map((n,a)=>a<t.y||a>=t.y+t.h?n:n.map((s,p)=>p<t.x||p>=t.x+t.w?s:!1))}function lie(e,t,n,a){if(a==null)return null;const s=e.length+n*2,p=Math.floor(t*sie),f=s/t,m=(a.width||p)*f,h=(a.height||p)*f,u=a.x==null?e.length/2-m/2:a.x*f,x=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),I=Math.floor(x);C={x:R,y:I,w:Math.ceil(m+u-R),h:Math.ceil(h+x-I)}}const E=a.crossOrigin;return{x:u,y:x,h,w:m,excavation:C,opacity:w,crossOrigin:E}}function cie(e,t){return t!=null?Math.max(Math.floor(t),0):e?rie:oie}function b4({value:e,level:t,minVersion:n,includeMargin:a,marginSize:s,imageSettings:p,size:f,boostLevel:m}){let h=bn.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((R,I)=>(R.push(...Bs.QrSegment.makeSegments(I)),R),[]);return Bs.QrCode.encodeSegments(E,iie[t],n,void 0,void 0,m)},[e,t,n,m]);const{cells:u,margin:x,numCells:w,calculatedImageSettings:C}=bn.useMemo(()=>{let E=h.getModules();const R=cie(a,s);return{cells:E,margin:R,numCells:E.length+R*2,calculatedImageSettings:lie(E,f,R,p)}},[h,f,p,a,s]);return{qrcode:h,margin:x,cells:u,numCells:w,calculatedImageSettings:C}}var uie=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),die=bn.forwardRef(function(t,n){const a=t,{value:s,size:p=d4,level:f=p4,bgColor:m=m4,fgColor:h=f4,includeMargin:u=h4,minVersion:x=g4,boostLevel:w,marginSize:C,imageSettings:E}=a,R=_y(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:I}=R,j=_y(R,["style"]),D=E?.src,z=bn.useRef(null),B=bn.useRef(null),q=bn.useCallback(Ae=>{z.current=Ae,typeof n=="function"?n(Ae):n&&(n.current=Ae)},[n]),[Z,J]=bn.useState(!1),{margin:$,cells:F,numCells:de,calculatedImageSettings:we}=b4({value:s,level:f,minVersion:x,boostLevel:w,includeMargin:u,marginSize:C,imageSettings:E,size:p});bn.useEffect(()=>{if(z.current!=null){const Ae=z.current,oe=Ae.getContext("2d");if(!oe)return;let Te=F;const H=B.current,ce=we!=null&&H!==null&&H.complete&&H.naturalHeight!==0&&H.naturalWidth!==0;ce&&we.excavation!=null&&(Te=y4(F,we.excavation));const ke=window.devicePixelRatio||1;Ae.height=Ae.width=p*ke;const Ee=p/de*ke;oe.scale(Ee,Ee),oe.fillStyle=m,oe.fillRect(0,0,de,de),oe.fillStyle=h,uie?oe.fill(new Path2D(v4(Te,$))):F.forEach(function(me,L){me.forEach(function(te,ge){te&&oe.fillRect(ge+$,L+$,1,1)})}),we&&(oe.globalAlpha=we.opacity),ce&&oe.drawImage(H,we.x+$,we.y+$,we.w,we.h)}}),bn.useEffect(()=>{J(!1)},[D]);const Ce=Ry({height:p,width:p},I);let Me=null;return D!=null&&(Me=bn.createElement("img",{src:D,key:D,style:{display:"none"},onLoad:()=>{J(!0)},ref:B,crossOrigin:we?.crossOrigin})),bn.createElement(bn.Fragment,null,bn.createElement("canvas",Ry({style:Ce,height:p,width:p,ref:q,role:"img"},j)),Me)});die.displayName="QRCodeCanvas";var pie=bn.forwardRef(function(t,n){const a=t,{value:s,size:p=d4,level:f=p4,bgColor:m=m4,fgColor:h=f4,includeMargin:u=h4,minVersion:x=g4,boostLevel:w,title:C,marginSize:E,imageSettings:R}=a,I=_y(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:D,numCells:z,calculatedImageSettings:B}=b4({value:s,level:f,minVersion:x,boostLevel:w,includeMargin:u,marginSize:E,imageSettings:R,size:p});let q=D,Z=null;R!=null&&B!=null&&(B.excavation!=null&&(q=y4(D,B.excavation)),Z=bn.createElement("image",{href:R.src,height:B.h,width:B.w,x:B.x+j,y:B.y+j,preserveAspectRatio:"none",opacity:B.opacity,crossOrigin:B.crossOrigin}));const J=v4(q,j);return bn.createElement("svg",Ry({height:p,width:p,viewBox:`0 0 ${z} ${z}`,ref:n,role:"img"},I),!!C&&bn.createElement("title",null,C),bn.createElement("path",{fill:m,d:`M0,0 h${z}v${z}H0z`,shapeRendering:"crispEdges"}),bn.createElement("path",{fill:h,d:J,shapeRendering:"crispEdges"}),Z)});pie.displayName="QRCodeSVG";var tC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nC=ZI,zo=(e,t)=>n=>{var a;if(t?.variants==null)return nC(e,n?.class,n?.className);const{variants:s,defaultVariants:p}=t,f=Object.keys(s).map(h=>{const u=n?.[h],x=p?.[h];if(u===null)return null;const w=tC(u)||tC(x);return s[h][w]}),m=n&&Object.entries(n).reduce((h,u)=>{let[x,w]=u;return w===void 0||(h[x]=w),h},{});return nC(e,f,t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,u)=>{let{class:x,className:w,...C}=u;return Object.entries(C).every(E=>{let[R,I]=E;return Array.isArray(I)?I.includes({...p,...m}[R]):{...p,...m}[R]===I})?[...h,x,w]:h},[]),n?.class,n?.className)},mie=zo("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"}}),Ty=T.forwardRef(({className:e,variant:t,size:n,...a},s)=>v.jsx("button",{ref:s,className:se(mie({variant:t,size:n}),e),...a}));Ty.displayName="Button";var fie=zo("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"}}),hie=T.forwardRef(({className:e,variant:t,size:n,icon:a,...s},p)=>v.jsx("button",{ref:p,className:se(fie({variant:t,size:n}),e),...s,children:v.jsx(a,{className:"h-4 w-4"})}));hie.displayName="IconButton";var gie=zo("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"}}),vie=T.forwardRef(({className:e,variant:t,style:n,...a},s)=>v.jsx("span",{ref:s,className:se(gie({variant:t,styleVariant:n}),e),...a}));vie.displayName="Badge";var yie=zo("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),bie=T.forwardRef(({className:e,variant:t,...n},a)=>v.jsx("div",{ref:a,className:se(yie({variant:t}),e),...n}));bie.displayName="Card";var Sie=T.forwardRef(({className:e,...t},n)=>v.jsx("label",{ref:n,className:se("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...t}));Sie.displayName="Label";var xie=zo("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),kie=T.forwardRef(({className:e,orientation:t,...n},a)=>v.jsx("div",{ref:a,role:"separator",className:se(xie({orientation:t}),e),...n}));kie.displayName="Separator";var wie=T.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}));wie.displayName="Skeleton";var aC=zo("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"}}),Mie=T.forwardRef(({className:e,state:t,leftSlot:n,rightSlot:a,...s},p)=>n||a?v.jsxs("div",{className:"relative flex items-center w-full",children:[n&&v.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),v.jsx("input",{ref:p,className:se(aC({state:t}),n?"pl-7":"",a?"pr-7":"",e),...s}),a&&v.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:a})]}):v.jsx("input",{ref:p,className:se(aC({state:t}),e),...s}));Mie.displayName="Input";var Cie=T.forwardRef(({className:e,options:t,disabled:n,...a},s)=>v.jsxs("div",{className:"relative w-full",children:[v.jsx("select",{ref:s,disabled:n,className: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(p=>v.jsx("option",{value:p.value,children:p.label},p.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(jo,{className:"h-3.5 w-3.5"})})]}));Cie.displayName="Select";var Aie=T.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}));Aie.displayName="Checkbox";var Eie=T.forwardRef(({className:e,checked:t,onCheckedChange:n,label:a,...s},p)=>v.jsxs("button",{ref:p,role:"switch","aria-checked":t,type:"button",onClick:()=>n(!t),className: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})]}));Eie.displayName="Switch";var S4=T.createContext(null);function Rie(){const e=T.useContext(S4);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function x4({children:e,open:t,onOpenChange:n}){const[a,s]=T.useState(!1),p=t??a,f=T.useId(),m=T.useCallback(h=>{n?.(h),t===void 0&&s(h)},[t,n]);return v.jsx(S4.Provider,{value:{open:p,setOpen:m,contentId:f},children:e})}var _ie=zo("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"}}),d0=T.forwardRef(({className:e,width:t,placement:n,scroll:a,children:s,...p},f)=>{const{open:m,setOpen:h,contentId:u}=Rie(),x=T.useRef(null),w=f??x;T.useEffect(()=>{const E=w.current;E&&(m&&!E.open&&E.showModal(),!m&&E.open&&E.close())},[m,w]);const C=E=>{E.target===E.currentTarget&&h(!1)};return v.jsx("dialog",{ref:w,id:u,className:se(_ie({width:t,placement:n,scroll:a}),e),onClick:C,onClose:()=>h(!1),...p,children:s})});d0.displayName="DialogContent";function Tie({className:e,...t}){return v.jsx("div",{className:se("flex flex-col gap-1 mb-3 shrink-0",e),...t})}function Iie({className:e,...t}){return v.jsx("div",{className:se("flex justify-end gap-2 mt-4 shrink-0",e),...t})}function Nie({className:e,...t}){return v.jsx("h2",{className:se("text-sm font-semibold text-foreground",e),...t})}function Oie({className:e,...t}){return v.jsx("p",{className:se("text-xs text-foreground-muted",e),...t})}T.createContext(null);T.createContext(null);T.createContext(null);T.createContext(null);var jie=T.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}));jie.displayName="ScrollArea";var Dg={baseDelayMs:1500,maxDelayMs:15e3,maxAttempts:40};function Pie(e,t=Math.random){if(e>=Dg.maxAttempts)return{kind:"exhausted",attempts:e};const n=Math.min(Dg.maxDelayMs,Dg.baseDelayMs*2**e);return{kind:"retry",delayMs:Math.round(n*(.8+t()*.4))}}var Die="/adaptive-probe",zie=2500;function k4(e){return e>=8?"high":e>=2.5?"mid":"low"}function Lie(e){const{downlinkMbps:t,...n}=e;return n}function iC(e){return k4(e)!=="low"}function rC(e){if(e===void 0||e==="")return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!=="http:"&&t.protocol!=="https:"?null:t.origin}function qie(e,t){return rC(e)??rC(t)}function Bie(e){const t=e.downlinkMbps===void 0?"none":k4(e.downlinkMbps);return[e.phase,e.viewportWidth??"-",e.viewportHeight??"-",e.devicePixelRatio??"-",t,e.prefersTier??"-",e.probeOrigin??"unreachable"].join("|")}async function Uie(e,t){const n=e.replace(/\/+$/,""),a=new AbortController,s=setTimeout(()=>a.abort(),zie),p=t.now();try{const f=await t.fetchImpl(`${n}${Die}`,{signal:a.signal});if(!f.ok)return null;const m=await f.arrayBuffer(),h=Math.max(1,t.now()-p);return m.byteLength<1024?null:m.byteLength*8/h/1e3}catch{return null}finally{clearTimeout(s)}}function fo(e,t){e.muted=t;const n=e.srcObject;if(n instanceof MediaStream)for(const a of n.getAudioTracks())a.enabled=!t}function Fie(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function Hie(e,t,n){let f=0;for(let m=0;m<8;m++)for(let h=0;h<8;h++){const u=Math.min(t-1,Math.floor((h+.5)/8*t)),x=Math.min(n-1,Math.floor((m+.5)/8*n)),{data:w}=e.getImageData(u,x,1,1);.2126*(w[0]??0)+.7152*(w[1]??0)+.0722*(w[2]??0)>12&&f++}return f<=1}function zg(e){const t={};if(typeof window<"u"){const n=window.devicePixelRatio||1;if(e){const a=e.getBoundingClientRect();a.width>0&&a.height>0&&(t.viewportWidth=Math.round(a.width*n),t.viewportHeight=Math.round(a.height*n))}t.viewportWidth===void 0&&(t.viewportWidth=Math.round(window.innerWidth*n),t.viewportHeight=Math.round(window.innerHeight*n)),t.devicePixelRatio=n}return t}var dc=null,$ie=3e4;function Sp(e){return qie(e,typeof window<"u"?window.location.origin:void 0)}async function pc(e){const t=Sp(e);if(t===null)return;if(dc&&dc.origin===t&&Date.now()-dc.at<$ie)return dc.mbps;const n=await Uie(t,{fetchImpl:(a,s)=>fetch(a,s),now:()=>Date.now()});if(!(n===null||!Number.isFinite(n)))return dc={origin:t,mbps:n,at:Date.now()},n}function oC(e,t,n,a){const s={...e,...n!==void 0?{downlinkMbps:n}:{},...t};return a?Lie(s):s}var Qie=8e3;function w4({serverUrl:e,streamKey:t,label:n,autoPlay:a=!0,muted:s=!0,showControls:p=!0,showStats:f=!1,onPlaybackStats:m,onClientNetworkSample:h,onConnectTiming:u,className:x="",onStateChange:w,onError:C,onReconnectAttempt:E,overlay:R,createSession:I,sendAnswer:j,handleOffer:D,getIceServers:z,addIceCandidate:B,getIceCandidates:q,closeSession:Z,getSessionState:J,reoffer:$,posterUrl:F,hintsOverride:de,onAdaptiveHints:we,reconnectSignal:Ce,onControlChannel:Me,onVideoElement:Ae}){const oe=T.useRef(null),Te=T.useRef(null),H=T.useRef(null),ce=T.useRef(new Set),ke=T.useRef(null),Ee=T.useRef(null),me=T.useRef(0),L=T.useRef(!0),te=T.useRef(Me);te.current=Me;const ge=T.useRef(Ae);ge.current=Ae,T.useEffect(()=>(ge.current?.(oe.current),()=>ge.current?.(null)),[]);const Se=T.useRef(we);Se.current=we;const ee=T.useRef(null),ye=T.useCallback((le,qe,Je)=>{const kt=Se.current;if(!kt)return;const Ye={phase:le,probeOrigin:Je,...qe},_t=Bie(Ye);_t!==ee.current&&(ee.current=_t,kt(Ye))},[]),Oe=T.useRef(null),X=T.useRef(null),he=T.useRef(0),$e=T.useRef(!1),Ne=T.useRef(!1),nt=T.useRef(async()=>{}),[Ve,Xe]=T.useState("idle"),[Re,Ke]=T.useState(""),[vt,An]=T.useState(s),Yt=T.useRef(vt);Yt.current=vt;const[ln,Oa]=T.useState(!1),[Va,Ki]=T.useState(!1),tn=Fie(),[xe,_e]=T.useState(!0),Rt=T.useRef(null),fn=T.useRef(!1);(j||I)&&(fn.current=!0);const We=fn.current,jn=T.useRef(!1);D&&(jn.current=!0);const Ga=jn.current,[Wi,Qr]=T.useState(!1),Rn=T.useRef(null),[ja,Ln]=T.useState(null),[_m,du]=T.useState(!1),ll=T.useCallback(()=>{const le=oe.current;if(!(!le||le.readyState<2||!le.videoWidth||!le.videoHeight))try{const qe=document.createElement("canvas");qe.width=le.videoWidth,qe.height=le.videoHeight;const Je=qe.getContext("2d");if(!Je||(Je.drawImage(le,0,0),Hie(Je,qe.width,qe.height)))return;Rn.current=qe.toDataURL("image/jpeg",.6)}catch{}},[]),Zt=T.useCallback(le=>{Xe(le),le==="playing"&&Qr(!0),w?.(le)},[w]),sa=T.useCallback(()=>{if(ke.current?.abort(),ke.current=null,Ee.current&&(clearTimeout(Ee.current),Ee.current=null),X.current&&(clearTimeout(X.current),X.current=null),Oe.current=null,Ne.current=!1,he.current=0,H.current&&(H.current.close(),H.current=null),Z&&ce.current.size>0){for(const le of ce.current)Z(le).catch(()=>{});ce.current.clear()}},[Z]),mi=T.useCallback(()=>{ke.current?.abort(),ke.current=null,Ee.current&&(clearTimeout(Ee.current),Ee.current=null),X.current&&(clearTimeout(X.current),X.current=null),Oe.current=null,Ne.current=!1,he.current=0},[]),Za=1e3,Ka=T.useCallback(le=>{if(!J||!$)return;X.current&&(clearTimeout(X.current),X.current=null);const qe=async()=>{if(L.current&&Oe.current===le){if(!Ne.current)try{const{pendingRenegotiation:Je}=await J(le);if(L.current&&Oe.current===le&&Je&&Je.epoch>he.current&&!Ne.current){he.current=Je.epoch,await nt.current(le,Je.target);return}}catch{}!L.current||Oe.current!==le||(X.current=setTimeout(()=>{qe()},Za))}};X.current=setTimeout(()=>{qe()},Za)},[J,$]),fi=T.useCallback(async(le=!1,qe=le)=>{if(!L.current||!I||!j)return;const Je=le?H.current:null,kt=le?new Set(ce.current):null;le?mi():sa(),Zt("connecting");const Ye=new AbortController;ke.current=Ye;try{const _t=qe?void 0:pc(e),Ue=oC(zg(Te.current),de,qe?await pc(e):void 0,!qe);ye(qe?"probe-climb":"cold-start",Ue,Sp(e));const{sessionId:at,sdpOffer:Ht,iceServers:$t}=await I(Ue);if(ce.current.add(at),_t!==void 0&&_t.then(rt=>{rt===void 0||!iC(rt)||!L.current||Ye.signal.aborted||$e.current||($e.current=!0,fi(!0,!0))}),!L.current||Ye.signal.aborted){Z?.(at).catch(()=>{}),ce.current.delete(at);return}const Fe=new RTCPeerConnection({iceServers:[...$t??[],{urls:"stun:stun.l.google.com:19302"}]});le||(H.current=Fe);const wt=new MediaStream;let bt=!1;const Tt=()=>{if(!(bt||!L.current)){if(bt=!0,H.current=Fe,oe.current&&(oe.current.srcObject=wt,fo(oe.current,Yt.current),oe.current.play().catch(()=>{})),Je&&Je!==Fe)try{Je.close()}catch{}if(kt)for(const rt of kt)ce.current.delete(rt),Z?.(rt).catch(()=>{})}};Fe.ontrack=rt=>{if(console.debug("[WebRTC] ontrack",rt.track.kind,rt.track.readyState),wt.addTrack(rt.track),le){Tt();return}oe.current&&(oe.current.srcObject=wt,fo(oe.current,Yt.current),oe.current.play().catch(()=>{}))},Fe.oniceconnectionstatechange=()=>{if(!L.current)return;const rt=Fe.iceConnectionState;if(console.debug("[WebRTC] ICE state:",rt),rt==="connected"||rt==="completed")me.current=0,le&&Tt(),Zt("playing"),oe.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),oe.current.play().catch(()=>{}));else if(rt==="failed"||rt==="disconnected"||rt==="closed"){if(le&&!bt)try{Fe.close()}catch{}Zt("disconnected"),Da()}},Fe.onicecandidateerror=rt=>{console.debug("[WebRTC] ICE candidate error:",rt)},console.debug("[WebRTC] Setting remote description (server offer)..."),await Fe.setRemoteDescription({type:"offer",sdp:Ht});const Gn=await Fe.createAnswer();if(await Fe.setLocalDescription(Gn),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await sC(Fe),!L.current)return;const Xt=(Fe.localDescription?.sdp??"").split(`
82
+ `).filter(rt=>rt.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:Xt,sessionId:at.slice(0,8)}),await j(at,Fe.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const Dt=Fe,qn=()=>{const rt=Dt.connectionState;if(rt==="closed"||rt==="failed")return;const cn=oe.current;cn&&cn.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${Dt.iceConnectionState})`)};setTimeout(qn,3e3),setTimeout(qn,8e3)}catch(_t){if(!L.current)return;const Ue=_t instanceof Error?_t.message:String(_t);Ke(Ue),Zt("error"),C?.(Ue),Da()}},[e,t,I,j,sa,mi,Z,Zt,C,de,ye]),Tm=T.useCallback(async()=>{if(L.current){sa(),Zt("connecting");try{const le=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});H.current=le,le.addTransceiver("video",{direction:"recvonly"}),le.addTransceiver("audio",{direction:"recvonly"});const qe=new MediaStream;le.ontrack=Ue=>{qe.addTrack(Ue.track),oe.current&&(oe.current.srcObject=qe,fo(oe.current,Yt.current),oe.current.play().catch(()=>{}))},le.oniceconnectionstatechange=()=>{if(!L.current)return;const Ue=le.iceConnectionState;Ue==="connected"||Ue==="completed"?(me.current=0,Zt("playing"),oe.current?.paused&&oe.current.play().catch(()=>{})):(Ue==="failed"||Ue==="disconnected"||Ue==="closed")&&(Zt("disconnected"),Da())};const Je=await le.createOffer();if(await le.setLocalDescription(Je),await sC(le),!L.current)return;const kt=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,Ye=await fetch(kt,{method:"POST",headers:{"Content-Type":"application/sdp"},body:le.localDescription?.sdp??""});if(!Ye.ok)throw new Error(`WHEP ${Ye.status}: ${Ye.statusText}`);const _t=await Ye.text();await le.setRemoteDescription({type:"answer",sdp:_t})}catch(le){if(!L.current)return;const qe=le instanceof Error?le.message:String(le);Ke(qe),Zt("error"),C?.(qe),Da()}}},[e,t,sa,Zt,C]),Lo=T.useCallback(async(le=!1,qe=le)=>{if(!L.current||!D)return;const Je=le?H.current:null,kt=le?new Set(ce.current):null;le?mi():sa(),Zt("connecting");const Ye=new AbortController;ke.current=Ye;const _t=performance.now(),Ue=()=>Math.round(performance.now()-_t),at={};try{const Ht=qe?void 0:pc(e),$t=await z?.();if(at.iceServersMs=Ue(),!L.current||Ye.signal.aborted)return;const Fe=new RTCPeerConnection({iceServers:[...$t??[],{urls:"stun:stun.l.google.com:19302"}]});le||(H.current=Fe);const wt=new MediaStream;let bt=!1;const Tt=()=>{if(!(bt||!L.current)){if(bt=!0,H.current=Fe,oe.current&&(oe.current.srcObject=wt,fo(oe.current,Yt.current),oe.current.play().catch(()=>{})),Je&&Je!==Fe)try{Je.close()}catch{}if(kt)for(const ct of kt)ce.current.delete(ct),Z?.(ct).catch(()=>{})}};Fe.ontrack=ct=>{if(at.firstTrackMs===void 0&&(at.firstTrackMs=Ue()),console.debug("[WebRTC] ontrack (client-offer)",ct.track.kind,ct.track.readyState),wt.addTrack(ct.track),le){Tt();return}oe.current&&(oe.current.srcObject=wt,fo(oe.current,Yt.current),oe.current.play().catch(()=>{}))};let Gn=!1;Fe.oniceconnectionstatechange=()=>{if(!L.current)return;const ct=Fe.iceConnectionState;if(console.debug("[WebRTC] ICE state (client-offer):",ct),ct==="connected"||ct==="completed"){if(!Gn){Gn=!0,at.iceConnectedMs=Ue(),console.info("[WebRTC timing] client-offer connected",{streamKey:t,...at}),u?.({...at});const Kn=oe.current;Kn&&"requestVideoFrameCallback"in Kn&&(Kn.requestVideoFrameCallback(()=>{at.firstFrameMs=Ue(),console.info("[WebRTC timing] first decoded frame",{streamKey:t,firstFrameMs:at.firstFrameMs}),u?.({...at})}),setTimeout(()=>{L.current&&at.firstFrameMs===void 0&&(console.warn("[WebRTC timing] NO decoded frame (stalled)",{streamKey:t,sinceIceConnectedMs:Ue()-(at.iceConnectedMs??0),iceConnectedMs:at.iceConnectedMs,firstTrackMs:at.firstTrackMs}),qo.current("no decoded frame after connect"),Da())},Qie))}me.current=0,le&&Tt(),Zt("playing"),oe.current?.paused&&oe.current.play().catch(()=>{})}else if(ct==="failed"||ct==="disconnected"||ct==="closed"){if(le&&!bt)try{Fe.close()}catch{}Zt("disconnected"),Da()}};let Xt=null;const Dt=[];if(Fe.onicecandidate=ct=>{if(!ct.candidate)return;const Kn=ct.candidate.toJSON();Xt&&B?B(Xt,Kn).catch(()=>{}):Dt.push(Kn)},Fe.addTransceiver("video",{direction:"recvonly"}),Fe.addTransceiver("audio",{direction:"recvonly"}),te.current){const ct=Fe.createDataChannel("camstack-control");te.current(ct)}const qn=await Fe.createOffer();if(at.offerCreatedMs=Ue(),await Fe.setLocalDescription(qn),at.localSetMs=Ue(),!L.current||Ye.signal.aborted)return;const rt=qe?await pc(e):void 0,cn=oC(zg(Te.current),de,rt,!qe);ye(qe?"probe-climb":"cold-start",cn,Sp(e));const ka=Ue(),{sessionId:Zn,sdpAnswer:et}=await D(Fe.localDescription?.sdp??qn.sdp??"",void 0,cn);if(at.signalingRttMs=Ue()-ka,Xt=Zn,ce.current.add(Zn),Ht!==void 0&&Ht.then(ct=>{ct===void 0||!iC(ct)||!L.current||Ye.signal.aborted||$e.current||($e.current=!0,Lo(!0,!0))}),Oe.current=Zn,!L.current||Ye.signal.aborted){Z?.(Zn).catch(()=>{}),ce.current.delete(Zn);return}if(B)for(const ct of Dt)B(Zn,ct).catch(()=>{});if(Dt.length=0,await Fe.setRemoteDescription({type:"answer",sdp:et}),at.answerSetMs=Ue(),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:Zn.slice(0,8)}),q){const ct=new Set,Kn=Date.now(),Gr=async()=>{if(!(!L.current||Ye.signal.aborted)&&!(Fe.connectionState==="closed"||Fe.signalingState==="closed")){try{const{candidates:Wa,done:Fo}=await q(Zn);for(const yi of Wa){const Zr=yi.candidate??"";Zr&&!ct.has(Zr)&&(ct.add(Zr),Fe.addIceCandidate(new RTCIceCandidate(yi)).catch(()=>{}))}const tr=Fe.iceConnectionState;if(Fo||Date.now()-Kn>1e4||tr==="connected"||tr==="completed")return}catch{}setTimeout(()=>{Gr()},200)}};Gr()}Ka(Zn)}catch(Ht){if(!L.current)return;const $t=Ht instanceof Error?Ht.message:String(Ht);Ke($t),Zt("error"),C?.($t),Da()}},[e,D,z,B,q,Z,sa,mi,Zt,C,Ka,de,ye]);nt.current=T.useCallback(async(le,qe)=>{const Je=$;if(!L.current||!Je)return;const kt=H.current;Ne.current=!0;try{let Ye=function(){if(Ht||!L.current){Tt();return}Ht=!0,H.current=Ue,oe.current&&(oe.current.srcObject=at,oe.current.play().catch(()=>{})),kt&&kt!==Ue&&kt.close(),Tt()};const _t=await z?.();if(!L.current)return;const Ue=new RTCPeerConnection({iceServers:[..._t??[],{urls:"stun:stun.l.google.com:19302"}]}),at=new MediaStream;let Ht=!1,$t=!1,Fe=null,wt,bt;const Tt=()=>{bt!==void 0&&(clearTimeout(bt),bt=void 0);const et=Fe;if(Fe=null,!!et){wt!==void 0&&typeof et.cancelVideoFrameCallback=="function"&&et.cancelVideoFrameCallback(wt),et.removeEventListener("loadeddata",Ye);try{et.srcObject=null}catch{}et.remove()}},Gn=()=>{if($t||Ht||!L.current)return;if($t=!0,typeof document>"u"){Ye();return}const et=document.createElement("video");et.muted=!0,et.playsInline=!0,et.autoplay=!0,et.style.cssText="position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",et.srcObject=at,Fe=et,(Te.current??document.body).appendChild(et),et.play().catch(()=>{}),typeof et.requestVideoFrameCallback=="function"&&(wt=et.requestVideoFrameCallback(()=>Ye())),et.addEventListener("loadeddata",Ye,{once:!0}),bt=setTimeout(()=>Ye(),1800)};Ue.ontrack=et=>{console.debug("[WebRTC] ontrack (reoffer)",et.track.kind,et.track.readyState),at.addTrack(et.track),Gn()},Ue.oniceconnectionstatechange=()=>{if(!L.current)return;const et=Ue.iceConnectionState;console.debug("[WebRTC] ICE state (reoffer):",et),et==="connected"||et==="completed"?(me.current=0,Gn(),Zt("playing"),oe.current?.paused&&oe.current.play().catch(()=>{})):(et==="failed"||et==="closed")&&(Tt(),!Ht&&et==="failed"&&Ue.close(),Zt("disconnected"),Da())};let Xt=null;const Dt=[];if(Ue.onicecandidate=et=>{if(!et.candidate)return;const ct=et.candidate.toJSON();Xt&&B?B(Xt,ct).catch(()=>{}):Dt.push(ct)},Ue.addTransceiver("video",{direction:"recvonly"}),Ue.addTransceiver("audio",{direction:"recvonly"}),te.current){const et=Ue.createDataChannel("camstack-control");te.current(et)}const qn=await Ue.createOffer();if(await Ue.setLocalDescription(qn),!L.current){Ue.close();return}const rt=await pc(e),cn={...zg(Te.current),...rt!==void 0?{downlinkMbps:rt}:{},...de};ye("renegotiate",cn,Sp(e));const{sessionId:ka,sdpAnswer:Zn}=await Je(le,Ue.localDescription?.sdp??qn.sdp??"",qe,cn);if(!L.current){Ue.close();return}if(Xt=ka,ce.current.add(ka),Oe.current=ka,B)for(const et of Dt)B(ka,et).catch(()=>{});if(Dt.length=0,await Ue.setRemoteDescription({type:"answer",sdp:Zn}),q){const et=new Set,ct=Date.now(),Kn=async()=>{if(L.current&&!(Ue.connectionState==="closed"||Ue.signalingState==="closed")){try{const{candidates:Gr,done:Wa}=await q(ka);for(const tr of Gr){const yi=tr.candidate??"";yi&&!et.has(yi)&&(et.add(yi),Ue.addIceCandidate(new RTCIceCandidate(tr)).catch(()=>{}))}const Fo=Ue.iceConnectionState;if(Wa||Date.now()-ct>1e4||Fo==="connected"||Fo==="completed")return}catch{}setTimeout(()=>{Kn()},200)}};Kn()}Ka(ka)}catch(Ye){console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll",Ye instanceof Error?Ye.message:String(Ye)),Ka(le)}finally{Ne.current=!1}},[e,$,z,B,q,Zt,Ka,de,ye]);const Pa=Ga?Lo:We?fi:Tm,Yi=T.useRef(()=>{}),pu=T.useRef(E);pu.current=E;const qo=T.useRef(()=>{});qo.current=le=>{console.warn("[WebRTC] hard error",{streamKey:t,msg:le}),Ke(le),C?.(le),Zt("error")},Yi.current=Pa;const Da=T.useCallback(()=>{if(!L.current)return;const le=me.current,qe=Pie(le);if(pu.current?.(qe),qe.kind==="exhausted"){qo.current(`reconnect attempts exhausted (${qe.attempts})`);return}me.current+=1,Ee.current=setTimeout(()=>{L.current&&Yi.current()},qe.delayMs)},[]);T.useEffect(()=>(L.current=!0,me.current=0,a&&Pa(),()=>{L.current=!1,sa()}),[]);const cl=T.useRef(!1);T.useEffect(()=>{if(a){if(Ga){if(!D)return}else if(We){if(!I||!j)return}else return;cl.current||H.current||(cl.current=!0,Pa())}},[a,Ga,We,D,I,j,Pa]);const Bo=()=>{me.current=0,Pa()},Uo=()=>{if(me.current=0,H.current&&Ga){Lo(!0);return}if(H.current&&We){fi(!0);return}Pa()},ul=T.useRef(e),dl=T.useRef(t);T.useEffect(()=>{const le=ul.current!==e,qe=dl.current!==t;if(ul.current=e,dl.current=t,!(!le&&!qe)&&L.current){if(me.current=0,$e.current=!1,le){sa(),Pa();return}Uo()}},[e,t]);const za=T.useRef(Ce);T.useEffect(()=>{za.current!==Ce&&(za.current=Ce,L.current&&Uo())},[Ce]);const kn=()=>{if(oe.current){const le=!oe.current.muted;fo(oe.current,le),An(le)}},Pn=async()=>{if(Te.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(Te.current.requestFullscreen){await Te.current.requestFullscreen();return}const le=oe.current;le?.webkitEnterFullscreen&&le.webkitEnterFullscreen()}catch(le){console.warn(`Fullscreen toggle failed: ${le instanceof Error?le.message:le}`)}},Xi=async()=>{const le=oe.current;if(le)try{if(typeof le.webkitSetPresentationMode=="function"){le.webkitSetPresentationMode(le.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture");return}document.pictureInPictureElement?await document.exitPictureInPicture():await le.requestPictureInPicture()}catch(qe){console.warn(`PiP toggle failed: ${qe instanceof Error?qe.message:String(qe)}`)}},pl=()=>{if(!oe.current)return;const le=document.createElement("canvas");le.width=oe.current.videoWidth||1280,le.height=oe.current.videoHeight||720;const qe=le.getContext("2d");if(!qe)return;qe.drawImage(oe.current,0,0);const Je=document.createElement("a");Je.download=`${t.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,Je.href=le.toDataURL("image/jpeg",.92),Je.click()};T.useEffect(()=>{const le=()=>Oa(!!document.fullscreenElement);document.addEventListener("fullscreenchange",le);const qe=oe.current;return qe?.addEventListener("webkitbeginfullscreen",le),qe?.addEventListener("webkitendfullscreen",le),()=>{document.removeEventListener("fullscreenchange",le),qe?.removeEventListener("webkitbeginfullscreen",le),qe?.removeEventListener("webkitendfullscreen",le)}},[]),T.useEffect(()=>{const le=oe.current,qe=typeof document<"u"&&document.pictureInPictureEnabled===!0,Je=le!==null&&typeof le.webkitSetPresentationMode=="function";Ki(qe||Je)},[]);const[mu,fu]=T.useState(""),hi=T.useRef(null);T.useEffect(()=>{if(!f){fu(""),hi.current=null;return}const le=async()=>{const Je=H.current;if(Je)try{const kt=await Je.getStats();let Ye=0,_t=0,Ue=0,at=0,Ht=0,$t=0;kt.forEach(bt=>{const Tt=bt;Tt.type==="inbound-rtp"&&(Tt.kind??Tt.mediaType)==="video"?(Ye=Tt.bytesReceived??0,_t=Tt.timestamp,Ue=Tt.framesPerSecond??0,at=Tt.frameWidth??0,Ht=Tt.frameHeight??0):Tt.type==="candidate-pair"&&Tt.nominated&&typeof Tt.currentRoundTripTime=="number"&&($t=Tt.currentRoundTripTime)});let Fe=0;hi.current&&_t>hi.current.ts&&(Fe=Math.round((Ye-hi.current.bytes)*8/(_t-hi.current.ts))),hi.current={bytes:Ye,ts:_t};const wt=[];at&&Ht&&wt.push(`${at}×${Ht}`),Ue&&wt.push(`${Math.round(Ue)}fps`),Fe>0&&wt.push(`${Fe} kbps`),$t&&wt.push(`${Math.round($t*1e3)}ms`),fu(wt.join(" · "))}catch{}};le();const qe=setInterval(()=>{le()},1e3);return()=>clearInterval(qe)},[f]);const gi=T.useRef(null);T.useEffect(()=>{if(!h){gi.current=null;return}const le=async()=>{const Je=H.current;if(Je)try{const kt=await Je.getStats();let Ye=0,_t=0,Ue=0,at=0,Ht=0,$t=0;kt.forEach(Xt=>{const Dt=Xt;Dt.type==="inbound-rtp"&&(Dt.kind??Dt.mediaType)==="video"?(Ye=Dt.packetsLost??0,_t=Dt.packetsReceived??0,Ue=Dt.bytesReceived??0,at=Dt.timestamp,Ht=Dt.jitter??0):Dt.type==="candidate-pair"&&Dt.nominated&&typeof Dt.currentRoundTripTime=="number"&&($t=Dt.currentRoundTripTime)});const Fe=gi.current;if(gi.current={lost:Ye,recv:_t,bytes:Ue,ts:at},!Fe||at<=Fe.ts)return;const wt=Math.max(0,Ye-Fe.lost),bt=wt+Math.max(0,_t-Fe.recv),Tt=bt>0?Math.min(100,wt/bt*100):0,Gn=Math.max(0,Math.round((Ue-Fe.bytes)*8/(at-Fe.ts)));h({rttMs:Math.round($t*1e3),jitterMs:Math.round(Ht*1e3),estimatedBandwidthKbps:Gn,packetLossPercent:Tt})}catch{}},qe=setInterval(()=>{le()},2e3);return()=>clearInterval(qe)},[h]);const Vr=T.useRef(null);T.useEffect(()=>{if(!m){Vr.current=null;return}const le=async()=>{const Je=H.current,kt=oe.current;if(Je)try{const Ye=await Je.getStats();let _t=0,Ue=0,at=0,Ht=0,$t=0,Fe=0,wt=0,bt=0;Ye.forEach(qn=>{const rt=qn;rt.type==="inbound-rtp"&&(rt.kind??rt.mediaType)==="video"&&(_t=rt.framesReceived??0,Ue=rt.framesDecoded??0,at=rt.framesDropped??0,Ht=rt.framesPerSecond??0,$t=rt.freezeCount??0,Fe=rt.totalFreezesDuration??0,wt=rt.jitterBufferDelay??0,bt=rt.jitterBufferEmittedCount??0)});const Tt=kt?.currentTime??0,Gn=Date.now(),Xt=Vr.current,Dt=bt>0?Math.round(wt/bt*1e3):0;Xt&&m({dRecv:_t-Xt.recv,dDec:Ue-Xt.dec,dDrop:at-Xt.drop,fps:Math.round(Ht),dFreeze:$t-Xt.freeze,freezeTotalMs:Math.round(Fe*1e3),avgJitterMs:Dt,dCtMs:Math.round((Tt-Xt.ct)*1e3),dtMs:Gn-Xt.ts,readyState:kt?.readyState??-1}),Vr.current={recv:_t,dec:Ue,drop:at,freeze:$t,ct:Tt,ts:Gn}}catch{}};le();const qe=setInterval(()=>{le()},5e3);return()=>clearInterval(qe)},[m]),T.useEffect(()=>{An(s);const le=oe.current;le&&(fo(le,s),s||le.play().catch(()=>{}))},[s]);const vi=()=>{tn||(_e(!0),Rt.current&&clearTimeout(Rt.current),Rt.current=setTimeout(()=>_e(!1),3e3))},Ji=()=>{_e(le=>!le),Rt.current&&clearTimeout(Rt.current)};T.useEffect(()=>{if(Ve==="playing"){ll();const le=setInterval(ll,2e3);return()=>clearInterval(le)}Wi&&Rn.current&&Ln(Rn.current)},[Ve,Wi,ll]),T.useEffect(()=>{if(Ve!=="playing"){du(!1);return}const le=oe.current;if(!le)return;let qe=!1;const Je=()=>{qe||du(!0)};let kt;typeof le.requestVideoFrameCallback=="function"&&(kt=le.requestVideoFrameCallback(()=>Je())),le.addEventListener("loadeddata",Je,{once:!0});const Ye=setTimeout(Je,12e3);return()=>{qe=!0,clearTimeout(Ye),kt!==void 0&&typeof le.cancelVideoFrameCallback=="function"&&le.cancelVideoFrameCallback(kt),le.removeEventListener("loadeddata",Je)}},[Ve]);const la=Wi&&ja?ja:F??null,er=!_m&&la!==null;return v.jsxs("div",{ref:Te,className:`relative isolate bg-black overflow-hidden group ${x}`,onMouseMove:vi,onMouseEnter:vi,onTouchStart:Ji,children:[v.jsx("video",{ref:oe,autoPlay:a,muted:vt,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),er&&la&&v.jsx("img",{src:la,alt:"",className:"absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"}),n&&Ve==="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&&mu&&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:mu}),R,p&&!la&&Ve==="connecting"&&v.jsxs("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[v.jsx("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})}),v.jsx("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),p&&!la&&(Ve==="error"||Ve==="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:Ve==="error"?Re||"Connection failed":"Disconnected"}),v.jsx("button",{onClick:Bo,className:"mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors",children:"Reconnect"})]}),p&&la&&(Ve==="connecting"||Ve==="disconnected")&&v.jsx("div",{className:"absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55",children:v.jsx("svg",{className:"h-3.5 w-3.5 text-white/90 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})})}),p&&la&&Ve==="error"&&v.jsx("button",{onClick:Bo,title:Re||"Reconnect",className:"absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M23 4v6h-6M1 20v-6h6"}),v.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}),p&&Ve!=="idle"&&Ve!=="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 ${tn||xe?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Hd,{onClick:kn,title:vt?"Unmute":"Mute",children:vt?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(Hd,{onClick:pl,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"})]})}),Va&&v.jsx(Hd,{onClick:Xi,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(Hd,{onClick:Pn,title:ln?"Exit fullscreen":"Fullscreen",children:ln?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 Hd({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 sC(e){if(e.iceGatheringState!=="complete")return new Promise(t=>{let n=!1,a;const s=()=>{n||(n=!0,a&&clearInterval(a),e.removeEventListener("icegatheringstatechange",p),t())},p=()=>{e.iceGatheringState==="complete"&&s()};e.addEventListener("icegatheringstatechange",p);const f=Date.now();a=setInterval(()=>{const m=e.localDescription?.sdp??"";/ typ host/.test(m)&&Date.now()-f>=600&&s()},100),setTimeout(s,2500)})}var Lg=["day","ir"],Vie={day:"Daylight",ir:"Night (IR)",night:"Night",dawn:"Dawn",dusk:"Dusk"};function xp(e){return Vie[e]??e}function Dfe(e){const t=new Set(e.coveredConditions),n=Lg.map(f=>`${xp(f)} ${t.has(f)?"✓":"✗"}`),a=[...t].filter(f=>!Lg.some(m=>m===f));for(const f of a)n.push(`${xp(f)} ✓`);const s=Lg.filter(f=>!t.has(f));if(s.length===0)return n.join(" · ");if(t.size===0)return`${n.join(" · ")} — nothing captured yet, so this scene is not watching.`;const p=s.map(f=>xp(f).toLowerCase()).join(" and ");return e.onUncoveredCondition==="judge-anyway"?`${n.join(" · ")} — ${p} judged against the references you do have.`:`${n.join(" · ")} — optional; checks in ${p} are skipped.`}function Gie(e){if(e.suspendedCondition===null)return null;const t=xp(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 Zie={"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 zfe(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?Zie[e.unavailable]:"can’t tell right now.";const n=e.verdict==="diverged"?e.divergedAt:e.armedAt,a=n!==null?` for ${Wie(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=Gie(e);return s!==null?s:e.verdict==="diverged"?`CHANGED${a}`:`Normal${a}`}function Lfe(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 Kie=.4;function qfe(e){return e.width*e.height>Kie}function Wie(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 Bfe="text-[10px] text-foreground-subtle",Yie={face:"#a855f7",plate:"#ec4899"};Object.freeze({...Object.fromEntries(Object.values(kb).filter(e=>e.category==="detection"||e.kind==="motion").map(e=>[e.kind,e.color])),...Yie});var Xie=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()}},M4=class{constructor(e){this.generateIdentifier=e,this.kv=new Xie}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)}},Jie=class extends M4{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 ere(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 tre(e,t){const n=ere(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function al(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function kp(e,t){return e.indexOf(t)!==-1}function lC(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var nre=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return tre(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},are=e=>Object.prototype.toString.call(e).slice(8,-1),C4=e=>typeof e>"u",ire=e=>e===null,Hc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Iy=e=>Hc(e)&&Object.keys(e).length===0,Lr=e=>Array.isArray(e),rre=e=>typeof e=="string",ore=e=>typeof e=="number"&&!isNaN(e),sre=e=>typeof e=="boolean",lre=e=>e instanceof RegExp,$c=e=>e instanceof Map,Qc=e=>e instanceof Set,A4=e=>are(e)==="Symbol",cre=e=>e instanceof Date&&!isNaN(e.valueOf()),E4=e=>e instanceof Error,cC=e=>typeof e=="number"&&isNaN(e),ure=e=>sre(e)||ire(e)||C4(e)||ore(e)||rre(e)||A4(e),dre=e=>typeof e=="bigint",pre=e=>e===1/0||e===-1/0,mre=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),fre=e=>e instanceof URL,Ny=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),qg=e=>e.map(String).map(Ny).join("."),Mc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function ii(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var R4=[ii(C4,"undefined",()=>null,()=>{}),ii(dre,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ii(cre,"Date",e=>e.toISOString(),e=>new Date(e)),ii(E4,"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}),ii(lre,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ii(Qc,"set",e=>[...e.values()],e=>new Set(e)),ii($c,"map",e=>[...e.entries()],e=>new Map(e)),ii(e=>cC(e)||pre(e),"number",e=>cC(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ii(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ii(fre,"URL",e=>e.toString(),e=>new URL(e))];function Cm(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var _4=Cm((e,t)=>A4(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}),hre=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),T4=Cm(mre,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=hre[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function I4(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var N4=Cm(I4,(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)}),O4=Cm((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)}),gre=[N4,_4,O4,T4],uC=(e,t)=>{const n=lC(gre,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=lC(R4,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},j4={};R4.forEach(e=>{j4[e.annotation]=e});var vre=(e,t,n)=>{if(Lr(t))switch(t[0]){case"symbol":return _4.untransform(e,t,n);case"class":return N4.untransform(e,t,n);case"custom":return O4.untransform(e,t,n);case"typed-array":return T4.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=j4[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Us=(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 P4(e){if(kp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(kp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(kp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var yre=(e,t)=>{P4(t);for(let n=0;n<t.length;n++){const a=t[n];if(Qc(e))e=Us(e,+a);else if($c(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Us(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},Oy=(e,t,n)=>{if(P4(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Lr(a)){const m=+f;a=a[m]}else if(Hc(a))a=a[f];else if(Qc(a)){const m=+f;a=Us(a,m)}else if($c(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",u=Us(a,m);switch(h){case"key":a=u;break;case"value":a=a.get(u);break}}}const s=t[t.length-1];if(Lr(a)?a[+s]=n(a[+s]):Hc(a)&&(a[s]=n(a[s])),Qc(a)){const p=Us(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if($c(a)){const p=+t[t.length-2],f=Us(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},D4=e=>e<1;function jy(e,t,n,a=[]){if(!e)return;const s=D4(n);if(!Lr(e)){al(e,(m,h)=>jy(m,t,n,[...a,...Mc(h,s)]));return}const[p,f]=e;f&&al(f,(m,h)=>{jy(m,t,n,[...a,...Mc(h,s)])}),t(p,a)}function bre(e,t,n,a){return jy(t,(s,p)=>{e=Oy(e,p,f=>vre(f,s,a))},n),e}function Sre(e,t,n){const a=D4(n);function s(p,f){const m=yre(e,Mc(f,a));p.map(h=>Mc(h,a)).forEach(h=>{e=Oy(e,h,()=>m)})}if(Lr(t)){const[p,f]=t;p.forEach(m=>{e=Oy(e,Mc(m,a),()=>e)}),f&&al(f,s)}else al(t,s);return e}var xre=(e,t)=>Hc(e)||Lr(e)||$c(e)||Qc(e)||E4(e)||I4(e,t);function kre(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function wre(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(qg):n[qg(p)]=f.map(qg)}),a?Iy(n)?[a]:[a,n]:Iy(n)?void 0:n}var z4=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=ure(e);if(!m){kre(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!xre(e,n)){const E=uC(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(kp(p,e))return{transformedValue:null};const h=uC(e,n),u=h?.value??e,x=Lr(u)?[]:{},w={};al(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 I=z4(E,t,n,a,[...s,R],[...p,e],f);x[R]=I.transformedValue,Lr(I.annotations)?w[Ny(R)]=I.annotations:Hc(I.annotations)&&al(I.annotations,(j,D)=>{w[Ny(R)+"."+D]=j})});const C=Iy(w)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,w]:w};return m||f.set(e,C),C};function L4(e){return Object.prototype.toString.call(e).slice(8,-1)}function dC(e){return L4(e)==="Array"}function Mre(e){if(L4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Cre(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Py(e,t={}){if(dC(e))return e.map(s=>Py(s,t));if(!Mre(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||dC(t.props)&&!t.props.includes(p))return s;const f=e[p];return Cre(s,p,Py(f,t),e,t.nonenumerable),s},{})}var Ft=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Jie,this.symbolRegistry=new M4(t=>t.description??""),this.customTransformerRegistry=new nre,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=z4(e,t,this,this.dedupe),a={json:n.transformedValue};n.annotations&&(a.meta={...a.meta,values:n.annotations});const s=wre(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:Py(n);return a?.values&&(s=bre(s,a.values,a.v??0,this)),a?.referentialEqualities&&(s=Sre(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);T.createContext(null);Ze.AddonStarted+"",Ze.AddonInstalled+"",Ze.AddonRestarted+"",Ze.AddonUpdated+"",Ze.AddonStopped+"",Ze.AddonUninstalled+"",Ze.AddonCrashed+"",Ze.AddonError+"",Ze.DetectionPhaseTransition+"",Ze.DetectionResult+"",Ze.DetectionEvent+"",Ze.DetectionCameraNative+"",Ze.ProviderMotion+"",Ze.MotionOnMotionChanged+"",Ze.MotionAnalysis+"",Ze.MotionZonesRaw+"",Ze.ProviderDetection+"",Ze.PipelineAudioInferenceResult+"",Ze.AgentOnline+"",Ze.AgentOffline+"",Ze.DeviceRegistered+"",Ze.DeviceUnregistered+"",Ze.DeviceStateChanged+"",Ze.EventEmitted+"";var Are=Object.freeze([...new Set(Object.values(Ze))].toSorted()),Ere=Object.freeze([Ze.PipelineCameraMetricsSnapshot,Ze.PipelineRunnerLoadSnapshot,Ze.PipelineEngineMetricsSnapshot,Ze.PipelineInferenceResult,Ze.PipelineTrace,Ze.PipelineProgress,Ze.StreamBrokerMetricsSnapshot,Ze.MetricsNodeResourcesSnapshot,Ze.MetricsNodeProcessesSnapshot,Ze.ClusterTopologySnapshot,Ze.MotionAnalysis,Ze.MotionZonesRaw,Ze.DetectionResult,Ze.PipelineAudioInferenceResult,Ze.PlatformProbePhase,Ze.BenchmarkProgress,Ze.ModelDownloadProgress]),Rre=new Set(Ere);Object.freeze(Are.filter(e=>!Rre.has(e)));Object.freeze([...new Set(HY.filter(e=>e.scope==="device").map(e=>e.name))].toSorted());function q4({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 _re({on:e,targetLabel:t,onConfirm:n}){const a=T.useRef(null),s=T.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:p=>{p.currentTarget.setPointerCapture?.(p.pointerId),a.current=p.clientX,s.current=!1},onPointerMove:p=>{a.current!==null&&Math.abs(p.clientX-a.current)>40&&(s.current=!0)},onPointerUp:()=>{s.current&&n(),s.current=!1,a.current=null},onPointerCancel:()=>{s.current=!1,a.current=null}})]})}var Tre=2,pC=270,Ire=315;function Nre(e){const t=(e-135+360)%360;return t>pC?t<=Ire?1:0:t/pC}function wp({fraction:e,color:t,knobTopPx:n,onDragFraction:a}){const s=-135+e*270,p=T.useRef(null),[f,m]=T.useState(!1),h=a!==void 0,u=n??Tre,x=E=>{a!==void 0&&(E.preventDefault(),E.stopPropagation(),E.currentTarget.setPointerCapture?.(E.pointerId),m(!0))},w=E=>{if(a===void 0||!f)return;const R=p.current;if(R===null)return;const I=R.getBoundingClientRect(),j=I.left+I.width/2,D=I.top+I.height/2;a(Nre(Math.atan2(E.clientY-D,E.clientX-j)*180/Math.PI))},C=E=>{a!==void 0&&(E.currentTarget.releasePointerCapture?.(E.pointerId),m(!1))};return v.jsx("div",{ref:p,className:"absolute inset-0",style:{transform:`rotate(${s}deg)`},children:v.jsx("div",{className: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:x,onPointerMove:w,onPointerUp:C,onPointerCancel:C}:{}})})}function Dy({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 Li=150,Mp=64,Ore=Li/2,zy=2*Math.PI*Mp,Bg=zy*(270/360);function B4({fraction:e,color:t,children:n,onDragFraction:a}){const s=Math.min(1,Math.max(0,e)),p=Li/2,f=Li/2,m=zy-Bg,h=s*Bg;return v.jsxs("div",{className:"relative",style:{width:Li,height:Li},children:[v.jsxs("svg",{width:Li,height:Li,viewBox:`0 0 ${Li} ${Li}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:p,cy:f,r:Mp,fill:"none",stroke:"var(--color-border)",strokeWidth:11,strokeDasharray:`${Bg} ${m}`,strokeLinecap:"round"}),v.jsx("circle",{cx:p,cy:f,r:Mp,fill:"none",stroke:t,strokeWidth:11,strokeDasharray:`${h} ${zy-h}`,strokeLinecap:"round"})]}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(wp,{fraction:s,color:t,knobTopPx:Ore-Mp-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 p0({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 jre({trpc:e,deviceId:t}){const n=lu(e,t),a=n!==null?n.button:void 0;if(a===void 0)return null;const s=()=>{a.press({deviceId:t})};return v.jsxs("button",{type:"button","aria-label":"Press",title:"Press",onClick:p=>{p.stopPropagation(),s()},className: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($T,{className:"h-3 w-3"}),v.jsx("span",{children:"Press"})]})}function Pre({trpc:e,deviceId:t}){const n=lu(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($T,{className:"h-6 w-6"})}),v.jsx("span",{className:"text-sm font-medium text-foreground",children:"Press"})]})}var Dre=4e3;function mC(e){if(e!==void 0)return e!==null&&typeof e=="object"&&"lastChangedAt"in e&&typeof e.lastChangedAt=="number"?e.lastChangedAt:e}function jt(e,t){const n=t?.enabled!==!1,a=t?.timeoutMs??Dre,[s,p]=T.useState(void 0),f=T.useRef(void 0),m=T.useRef(void 0),h=T.useRef(!1),u=T.useRef(void 0),x=T.useCallback(()=>{u.current!==void 0&&(clearTimeout(u.current),u.current=void 0),f.current=void 0,h.current=!1,m.current=void 0,p(void 0)},[]);T.useEffect(()=>{if(!n||!h.current)return;const C=mC(e),E=m.current;C!==void 0&&C!==E&&x()}),T.useEffect(()=>()=>{u.current!==void 0&&clearTimeout(u.current)},[]);const w=T.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,p(R)}m.current=mC(e),h.current=!0,u.current=setTimeout(x,a)},[n,e,x,a]);return n?{display:s!==void 0?s:e,applyOptimistic:w}:{display:e,applyOptimistic:()=>{}}}function zre(e){return e instanceof Error?e.message:String(e)}function Lre({trpc:e,deviceId:t,layout:n,optimistic:a,features:s}){const{cap:p,slice:f,available:m}=mt({trpc:e,deviceId:t,cap:H=>H.lockControl,slice:H=>H.state.lockControl}),{display:h,applyOptimistic:u}=jt(f,{enabled:a??!0}),[x,w]=T.useState(null),[C,E]=T.useState(!1),[R,I]=T.useState(null);if(h===void 0)return null;const j=h.state==="locked"||h.state==="locking",D=!m||h.state==="jammed",z=s?.includes(ia.LockOpen)===!0,B=n==="compact",q=()=>{u({state:"locking"}),p?.lock({})},Z=()=>{u({state:"unlocking"}),p?.unlock({})},J=()=>{p?.open({})},$=()=>{if(!D){if(!j){q();return}if(B){I(null),w("unlock");return}Z()}},F=()=>{if(!D){if(B){I(null),w("open");return}J()}},de=()=>{C||w(null)},we=async()=>{if(!(C||x===null)){I(null),E(!0);try{x==="unlock"?(u({state:"unlocking"}),await p?.unlock({})):await p?.open({}),w(null)}catch(H){I(zre(H))}finally{E(!1)}}},Ce=j?"Unlock":"Lock",Me=x==="open"?"Open door?":"Unlock device?",Ae=x==="open"?"This will release the latch and open the door.":"This will unlock the device.",oe=x==="open"?"Confirm open":"Confirm unlock",Te=x==="open"?v.jsx(Js,{className:"h-4 w-4 text-amber-400"}):v.jsx(vy,{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":Ce,title:h.state==="jammed"?"Jammed":Ce,disabled:D,onClick:H=>{H.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(au,{className:"h-3.5 w-3.5"}):v.jsx(vy,{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:H=>{H.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(Js,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:"Open"})]}),B&&v.jsx(x4,{open:x!==null,onOpenChange:H=>{H||de()},children:v.jsxs(d0,{width:"sm",onClick:H=>H.stopPropagation(),children:[v.jsxs(Tie,{children:[v.jsxs(Nie,{className:"flex items-center gap-2",children:[Te,Me]}),v.jsx(Oie,{children:Ae})]}),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(Iie,{children:[v.jsx(Ty,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:()=>de(),children:"Cancel"}),v.jsxs(Ty,{type:"button",variant:"danger",size:"sm","aria-label":oe,disabled:C,onClick:()=>{we()},children:[C&&v.jsx(Yb,{className:"h-3.5 w-3.5 animate-spin"}),oe]})]})]})})]})}function m0({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:R=>R.switch,slice:R=>R.state.switch}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0}),[h,u]=T.useState(!1);if(f===void 0)return null;const x=f.on===!0,w=h||!p,C={transform:x?"translateX(14px)":"translateX(2px)"},E=async()=>{if(w||!a)return;const R=!x;m({on:R}),u(!0);try{await a.setState({on:R})}finally{u(!1)}};return v.jsx("button",{type:"button","aria-pressed":x,title:x?"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",x?"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",x?"bg-success":"bg-foreground-subtle"),style:C})})}function qre({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:x=>x.brightness,slice:x=>x.state.brightness}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(m===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:m.percentage,disabled:u,onChange:x=>{const w=Number(x.target.value);h({percentage:w}),u||s?.setBrightness({percentage:w})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[m.percentage,"%"]})]})}function Bre({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=mt({trpc:e,deviceId:t,cap:I=>I.fanControl,slice:I=>I.state.fanControl}),{display:h,applyOptimistic:u}=jt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,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:x,onChange:I=>{const j=Number(I.target.value),D=Math.min(100,Math.max(0,Math.round(j/R)*R));u({percentage:D}),x||p?.setPercentage({percentage:D})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.percentage??"—","%"]})]}),E&&h.availablePresets.length>0&&v.jsx("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:v.jsxs("select",{"aria-label":"Fan preset",value:h.preset,disabled:x,onChange:I=>{const j=I.target.value;!x&&j&&(u({preset:j}),p?.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(I=>v.jsx("option",{value:I,children:I},I))]})})]})}var f0={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"},U4={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"},Ure={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 Fre({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=mt({trpc:e,deviceId:t,cap:E=>E.climateControl,slice:E=>E.state.climateControl}),{display:h,applyOptimistic:u}=jt(f,{enabled:s??!0});if(p===void 0||h===void 0)return null;const x=!m;if(a==="compact")return v.jsxs("div",{"data-mode":h.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",U4[h.mode]),children:h.target!==null?v.jsxs(v.Fragment,{children:[h.target,"°",h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",h.currentTemp,"°)"]})]}):h.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}):null}),h.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;u({target:R}),p.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",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;u({target:R}),p.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",x&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:h.mode,disabled:x,onChange:E=>{E.stopPropagation();const R=E.target.value;x||(u({mode:R}),p.setMode({mode:R}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",x&&"opacity-40 cursor-not-allowed"),children:h.availableModes.map(E=>v.jsx("option",{value:E,children:E},E))})]});const 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",f0[h.mode],"flex-col items-stretch gap-3"),children:[v.jsxs("div",{className:"inline-flex items-center gap-1 text-xs tabular-nums",children:[h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}),C&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-foreground-subtle",children:"→"}),v.jsxs("span",{className:"font-medium",children:[h.target,"°"]}),v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;u({target:R}),p.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",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;u({target:R}),p.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",x&&"opacity-40 cursor-not-allowed"),children:"+"})]})]}),v.jsx("div",{className:"inline-flex items-center gap-0.5 rounded bg-surface-subtle p-0.5",children:h.availableModes.map(E=>v.jsx("button",{type:"button","aria-label":E,disabled:x,onClick:R=>{R.stopPropagation(),x||(u({mode:E}),p.setMode({mode:E}))},className:se("rounded px-1.5 py-0.5 text-xs transition-colors",E===h.mode?Ure[E]:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"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:x,onChange:E=>{if(!x){const R=Number(E.target.value),I=h.targetHigh??R;u({targetLow:R}),p.setTargetRange({targetLow:R,targetHigh:I})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]}),v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"High"}),v.jsx("input",{"aria-label":"Target high",type:"number",step:.5,value:h.targetHigh??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),I=h.targetLow??R;u({targetHigh:R}),p.setTargetRange({targetLow:I,targetHigh:R})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]})]}),h.availableFanModes.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Fan"}),v.jsxs("select",{"aria-label":"Fan mode",value:h.fanMode,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(u({fanMode:R}),p.setFanMode({fanMode:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableFanModes.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.availablePresets.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Preset",value:h.preset,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(u({preset:R}),p.setPreset({preset:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.targetHumidity!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Humidity"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:0,max:100,step:1,value:h.targetHumidity,disabled:x,onChange:E=>{const R=Number(E.target.value);u({targetHumidity:R}),x||p.setTargetHumidity({targetHumidity:R})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.targetHumidity,"%"]})]})]})}var Hre={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"},$re={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"},F4=["off","all","one"];function Qre(e){return F4.includes(e)}var Vre={off:"Off",all:"All",one:"One"};function Gre(e){return e==="playing"||e==="buffering"?"pause":"play"}function Zre({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=mt({trpc:e,deviceId:t,cap:C=>C.mediaPlayer,slice:C=>C.state.mediaPlayer}),{display:h,applyOptimistic:u}=jt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,w=Gre(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",Hre[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",$re[h.state])}),v.jsx("button",{type:"button","aria-label":w==="play"?"Play":"Pause",disabled:x,onClick:C=>{C.stopPropagation(),!x&&(w==="play"?(u({state:"playing"}),p?.play({})):(u({state:"paused"}),p?.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",x&&"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:x,onClick:C=>{C.stopPropagation(),x||p?.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",x&&"opacity-40 cursor-not-allowed"),children:"⏮"}),v.jsx("button",{type:"button","aria-label":"Next",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.next({})},className: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",x&&"opacity-40 cursor-not-allowed"),children:"⏭"})]}),h.volumeLevel!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Vol"}),v.jsx("input",{"aria-label":"Volume",type:"range",min:0,max:100,step:1,value:h.volumeLevel,disabled:x,onChange:C=>{const E=Number(C.target.value);u({volumeLevel:E}),x||p?.setVolume({volumeLevel:E})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.volumeLevel,"%"]})]}),h.isMuted!==null&&v.jsx("button",{type:"button","aria-label":h.isMuted?"Unmute":"Mute",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.isMuted!==null){const E=!h.isMuted;u({isMuted:E}),p?.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",x&&"opacity-40 cursor-not-allowed"),children:h.isMuted?"🔇":"🔊"}),h.availableSources.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Source"}),v.jsxs("select",{"aria-label":"Source",value:h.source,disabled:x,onChange:C=>{const E=C.target.value;!x&&E&&(u({source:E}),p?.selectSource({source:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableSources.map(C=>v.jsx("option",{value:C,children:C},C))]})]}),h.shuffle!==null&&v.jsx("button",{type:"button","aria-label":"Shuffle",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.shuffle!==null){const E=!h.shuffle;u({shuffle:E}),p?.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",x&&"opacity-40 cursor-not-allowed"),children:"⇌ Shuffle"}),h.repeat!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Repeat"}),v.jsx("select",{"aria-label":"Repeat",value:h.repeat,disabled:x,onChange:C=>{const E=C.target.value;!x&&Qre(E)&&(u({repeat:E}),p?.setRepeat({repeat:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:F4.map(C=>v.jsx("option",{value:C,children:Vre[C]},C))})]})]})]})}function Cc(e,t){return t!==void 0?e.toFixed(t):Number.isInteger(e)?String(e):e.toFixed(1)}var Kre=/^(\d{4})-(\d{2})-(\d{2})/,Wre=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function Yre(e,t){const n=Kre.exec(e);if(n===null)return e;const a=Number(n[1]),s=Number(n[2]),p=Number(n[3]),f=new Date(a,s-1,p);if(Number.isNaN(f.getTime()))return e;try{return f.toLocaleDateString(t)}catch{return e}}function Xre(e,t){const n=Wre.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 Jre(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 h0(e,t,n){return e===""?e:t==="date"?Yre(e,n):t==="time"?Xre(e,n):Jre(e,n)}function eoe(e){return e.slice(0,10)}function toe(e){return e.slice(0,5)}function noe(e){return(e.includes("T")?e:e.replace(" ","T")).slice(0,16)}function aoe({value:e,busy:t,onCommit:n,unit:a,min:s,max:p,step:f,precision:m}){const[h,u]=T.useState(Cc(e,m)),x=Number(h),w=h!==""&&!Number.isNaN(x),C=f??1,E=I=>{let j=I;return s!==void 0&&(j=Math.max(s,j)),p!==void 0&&(j=Math.min(p,j)),j},R=()=>{!t&&w&&n(E(x))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Decrement",disabled:t,onClick:I=>{if(I.stopPropagation(),!t){const j=E(e-C);u(Cc(j,m)),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:I=>{u(I.target.value);const j=Number(I.target.value);I.target.value!==""&&!Number.isNaN(j)&&(t||n(E(j)))},onBlur:R,onKeyDown:I=>{I.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:I=>{if(I.stopPropagation(),!t){const j=E(e+C);u(Cc(j,m)),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 ioe({value:e,busy:t,onCommit:n}){const[a,s]=T.useState(e);return v.jsx("input",{type:"text",disabled:t,value:a,onChange:p=>s(p.target.value),onBlur:()=>{t||n(a)},onKeyDown:p=>{p.key==="Enter"&&!t&&n(a)},className:se("rounded border border-border bg-surface px-2 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}function roe({slice:e,busy:t,setValueFn:n,layout:a}){switch(e.kind){case"numeric":return v.jsx(aoe,{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(ioe,{value:String(e.value),busy:t,onCommit:s=>{n({control:{kind:"text",value:s}})}});case"datetime":{const s=String(e.value),p=e.format??"datetime";return a==="compact"?s===""?v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground-subtle",children:"—"}):v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground",children:h0(s,p)}):v.jsx("input",{type:p==="date"?"date":p==="time"?"time":"datetime-local","aria-label":"Control value",disabled:t,value:p==="date"?eoe(s):p==="time"?toe(s):noe(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 H4({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=mt({trpc:e,deviceId:t,cap:C=>C.control,slice:C=>C.state.control}),{display:h,applyOptimistic:u}=jt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,w=C=>{!x&&p&&(u({value:C.control.value}),p.setValue(C))};return v.jsx("div",{"data-kind":h.kind,className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-border px-2 py-1 transition-colors",children:v.jsx(roe,{slice:h,busy:x,setValueFn:w,layout:a})})}var ooe=e=>e;function $4(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&&nX(a,s)?{unit:s,precision:n,toDisplayValue:p=>tX(p,a,s)??p}:{unit:a??"",precision:n,toDisplayValue:ooe}}var Q4={kind:"binary",field:"on",onLabel:"Low",offLabel:"Normal"};function V4(e){return e==="battery-sensor"}function G4(e,t){if(!K4(e))return!1;const n=e[t];if(typeof n!="number")return!1;const a=e.lastFetchedAt;return!(n===0&&a===0)}var Z4={"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 K4(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 Ac(e){return typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string"}function W4(e){if(typeof e!="object"||e===null)return;const t=e.format;if(t==="date"||t==="time"||t==="datetime")return t}function coe(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}function uoe({trpc:e,device:t}){const n=t.role!=null?Z4[t.role]:void 0,a=V4(t.role),{data:s}=nI({},{staleTime:6e4}),p=lu(e,t.id),f=Eo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=Eo(p!==null&&n?.kind==="numeric"?p.state.enumSensor:void 0),h=Eo(p!==null&&a?p.state.binary:void 0),u=a&&n?.kind==="numeric"&&!G4(f,n.field)&&h!==void 0,x=u?Q4:n,w=u?h:f;if(x===void 0||w===void 0)return null;if(x.kind==="numeric"){if(!K4(w))return null;const E=w[x.field];if(typeof E!="number")return null;const R=w.lastFetchedAt,I=E===0&&R===0;if(I&&Ac(m)&&m.value!=="")return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:m.value});if(I)return null;const j=w,D=typeof j.unit=="string"?j.unit:void 0,z=typeof j.precision=="number"?j.precision:void 0,B=$4({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:x.canonicalUnit}),q=B.unit,Z=Cc(B.toDisplayValue(E),B.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:Z}),q&&v.jsx("span",{className:"text-foreground-subtle",children:q})]})}if(x.kind==="binary"){if(!soe(w))return null;const R=!!w[x.field],I=R?x.onLabel:x.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:I})}if(x.kind==="string")return!Ac(w)||w.value===""?null:v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:w.value});if(x.kind==="datetime"){if(!Ac(w)||w.value==="")return null;const E=W4(w)??x.format,R=h0(w.value,E);return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:R})}if(!loe(w))return null;const C=coe(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 Am(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 doe(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Ug({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",doe(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function poe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:w=>w.cover,slice:w=>w.state.cover}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0)return null;const h=Am(f?.state),u=!p,x=(w,C)=>{u||!w||(C!==void 0&&m(C),w({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Ug,{label:"Open",busy:u,variant:h.up,onClick:()=>x(a?.open,{state:"opening"}),children:v.jsx(bm,{className:"h-3.5 w-3.5"})}),v.jsx(Ug,{label:"Stop",busy:u,variant:h.stop,onClick:()=>x(a?.stop,{state:"stopped"}),children:v.jsx(ou,{className:"h-3 w-3"})}),v.jsx(Ug,{label:"Close",busy:u,variant:h.down,onClick:()=>x(a?.close,{state:"closing"}),children:v.jsx(jo,{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 Fg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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 Y4(){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 moe({position:e,interactive:t,onSetPosition:n}){const a=(1-e/100)*100,s=T.useRef(null),p=T.useRef(!1),f=T.useRef(null),m=C=>{const E=s.current;if(E===null)return e;const R=E.getBoundingClientRect();if(R.height<=0)return e;const I=(C-R.top)/R.height,j=Math.round(100-I*100);return Math.min(100,Math.max(0,j))},h=C=>{if(n===void 0)return;const E=m(C);f.current!==E&&(f.current=E,n(E))},u=C=>{t&&(C.stopPropagation(),C.preventDefault(),p.current=!0,f.current=null,C.currentTarget.setPointerCapture(C.pointerId),h(C.clientY))},x=C=>{!t||!p.current||(C.stopPropagation(),h(C.clientY))},w=C=>{!t||!p.current||(C.stopPropagation(),p.current=!1,f.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))};return v.jsxs("div",{ref:s,"data-testid":"cover-window",...t?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e}:{"aria-hidden":"true"},onPointerDown:t?u:void 0,onPointerMove:t?x: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(Y4,{}),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 foe({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(Y4,{}),!e&&v.jsx("div",{className:"absolute inset-0",style:{background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)"}})]})}function hoe({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:z=>z.cover,slice:z=>z.state.cover}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0)return null;const u=!f,x=(n??[]).includes(ia.CoverPositionable),w=(n??[]).includes(ia.CoverTilt),C=Am(m?.state),E=m?.position??null,R=E!==null,I=m?.state==="open"||m?.state==="opening",j=(z,B)=>{u||!z||(B!==void 0&&h(B),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(moe,{position:E,interactive:x,onSetPosition:x?D:void 0}):v.jsx(foe,{isOpen:I}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:"text-3xl font-semibold capitalize text-foreground",children:m?.state??"—"})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Fg,{label:"Open",busy:u,variant:C.up,onClick:()=>j(s?.open,{state:"opening"}),children:v.jsx(bm,{className:"h-5 w-5"})}),v.jsx(Fg,{label:"Stop",busy:u,variant:C.stop,onClick:()=>j(s?.stop,{state:"stopped"}),children:v.jsx(ou,{className:"h-4 w-4"})}),v.jsx(Fg,{label:"Close",busy:u,variant:C.down,onClick:()=>j(s?.close,{state:"closing"}),children:v.jsx(jo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:u,className:"flex-1",onChange:z=>{D(Number(z.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&E!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]}),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:m?.tiltPosition??0,disabled:u,className:"flex-1",onChange:z=>{const B=Number(z.target.value);h({tiltPosition:B}),u||s?.setTiltPosition({tiltPosition:B})}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[m?.tiltPosition??"—","%"]})]})]})}function goe(e){return v.jsx("span",{className:"text-foreground-subtle text-xs select-none","aria-hidden":"true",children:"—"})}function voe(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 yoe(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 boe({trpc:e,deviceId:t}){const{data:n}=aI({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(uoe,{trpc:e,device:yoe(n)})}function Soe(e){return typeof e=="object"&&e!==null}function xoe(e){return typeof e=="object"&&e!==null}function koe(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function woe(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}var Moe={low:"bg-danger",medium:"bg-warning",high:"bg-success"};function Coe(e){return e<=20?"low":e<=50?"medium":"high"}function Aoe({percent:e}){const t=Math.min(100,Math.max(0,e)),n=Coe(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",Moe[n]),style:{width:`${t}%`}})})}function Eoe({trpc:e,device:t}){const n=t.role!=null?Z4[t.role]:void 0,a=V4(t.role),{data:s}=nI({},{staleTime:6e4}),p=lu(e,t.id),f=Eo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=Eo(p!==null&&a?p.state.binary:void 0),h=a&&n?.kind==="numeric"&&!G4(f,n.field)&&m!==void 0,u=h?Q4:n,x=h?m:f;if(u===void 0||x===void 0)return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});if(u.kind==="numeric"){if(!Soe(x))return null;const C=x[u.field];if(typeof C!="number")return null;const E=x,R=typeof E.unit=="string"?E.unit:void 0,I=typeof E.precision=="number"?E.precision:void 0,j=$4({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:I,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:Cc(j.toDisplayValue(C),j.precision)}),D&&v.jsx("span",{className:"text-base text-foreground-subtle",children:D})]}),a&&v.jsx(Aoe,{percent:C}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(u.kind==="binary"){if(!xoe(x))return null;const E=!!x[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(!Ac(x))return null;if(x.value==="")return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});const C=W4(x)??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:h0(x.value,C)}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(u.kind==="string")return!Ac(x)||x.value===""?null:v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-xl font-semibold text-foreground",children:x.value}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]});if(!koe(x))return null;const w=woe(x.state);return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:se("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",x.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:w}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}function Roe({trpc:e,deviceId:t}){const{data:n}=aI({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(Eoe,{trpc:e,device:n})}function X4(e){return e===void 0||e.inProgress?!1:e.availableVersion!==null&&e.currentVersion!==null&&e.availableVersion!==e.currentVersion}function J4(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.update,slice:n=>n.state.update})}function _oe({trpc:e,deviceId:t}){const{cap:n,slice:a}=J4(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(Yb,{className:"h-3.5 w-3.5 animate-spin"}),"Updating…"]}):X4(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(qT,{className:"h-3 w-3"}),"Update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[v.jsx(jT,{className:"h-3 w-3 text-success"}),a?.currentVersion??"Up to date"]})}function Toe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=J4(e,t);if(n===void 0)return null;const p=a?.inProgress===!0,f=X4(a),m=a?.currentVersion??"—",h=()=>{!s||n===void 0||!f||n.installUpdate({})};return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-baseline gap-1.5",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:m}),f&&a?.availableVersion!=null&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-base text-foreground-subtle",children:"→"}),v.jsx("span",{className:"text-base font-medium text-warning tabular-nums",children:a.availableVersion})]})]}),p?v.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-sm font-medium text-foreground-subtle",children:[v.jsx(Yb,{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(qT,{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(jT,{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 Ioe(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 eN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.vacuumControl,slice:n=>n.state.vacuumControl})}function Hg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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 Noe(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 Ooe=`
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 joe({state:e,batteryLevel:t}){const n=Noe(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:Ooe}),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||p)&&"rg-a"),style:f,children:[v.jsx("circle",{cx:"50",cy:"50",r:"34",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("path",{d:"M 24 42 A 34 34 0 0 1 76 42",stroke:"currentColor",strokeWidth:"3",opacity:"0.55",strokeLinecap:"round"}),v.jsxs("g",{className: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 tN({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(Fp,{className:"h-3.5 w-3.5"}),e,"%"]})}function Poe(e){switch(e){case"cleanWater":return!0;case"detergent":return!0;case"dirtyWater":return!1;case"dustBin":return!1;default:return e}}function Doe(e,t){const n=Poe(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 zoe(e){switch(e){case"cleanWater":return{label:"Clean water",icon:v.jsx(Wb,{className:"h-3.5 w-3.5"})};case"dirtyWater":return{label:"Dirty water",icon:v.jsx(sl,{className:"h-3.5 w-3.5"})};case"detergent":return{label:"Detergent",icon:v.jsx(Pee,{className:"h-3.5 w-3.5"})};case"dustBin":return{label:"Dust bin",icon:v.jsx(gte,{className:"h-3.5 w-3.5"})};default:return e}}function Loe({kind:e,tank:t}){if(t===null)return null;const n=zoe(e),a=Doe(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 qoe({cleanWater:e,dirtyWater:t,detergent:n,dustBin:a}){const s=[["cleanWater",e],["dirtyWater",t],["detergent",n],["dustBin",a]];return s.some(([,p])=>p!==null)?v.jsx("div",{className:"grid grid-cols-1 gap-x-6 gap-y-2 rounded-md border border-border bg-surface-hover/40 p-3 sm:grid-cols-2",children:s.map(([p,f])=>v.jsx(Loe,{kind:p,tank:f},p))}):null}function Boe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=eN(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=f==="cleaning",h=u=>{p||u===void 0||u({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Hg,{label:"Start",busy:p,active:m,onClick:()=>h(n.start),children:v.jsx(Po,{className:"h-3 w-3"})}),v.jsx(Hg,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(iu,{className:"h-3 w-3"})}),v.jsx(Hg,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>h(n.returnToBase),children:v.jsx(Sm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(tN,{level:a.batteryLevel})})]})}function mc({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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 Uoe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=eN(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=Ioe(f),h=a?.availableFanSpeeds??[],u=w=>{p||w===void 0||w({})},x=w=>{p||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(joe,{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",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(tN,{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(el,{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(mc,{label:"Start",busy:p,active:f==="cleaning",onClick:()=>u(n.start),children:v.jsx(Po,{className:"h-5 w-5"})}),v.jsx(mc,{label:"Pause",busy:p,active:f==="paused",onClick:()=>u(n.pause),children:v.jsx(iu,{className:"h-5 w-5"})}),v.jsx(mc,{label:"Stop",busy:p,active:!1,onClick:()=>u(n.stop),children:v.jsx(ou,{className:"h-4 w-4"})}),v.jsx(mc,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>u(n.returnToBase),children:v.jsx(Sm,{className:"h-5 w-5"})}),v.jsx(mc,{label:"Locate",busy:p,active:!1,onClick:()=>u(n.locate),children:v.jsx(FT,{className:"h-5 w-5"})})]})]})]}),h.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16 shrink-0",children:"Fan speed"}),v.jsxs("select",{"aria-label":"Fan speed",value:a?.fanSpeed??"",disabled:p,onChange:w=>{x(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(qoe,{cleanWater:a?.cleanWater??null,dirtyWater:a?.dirtyWater??null,detergent:a?.detergent??null,dustBin:a?.dustBin??null})]})}function Foe(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 nN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.lawnMowerControl,slice:n=>n.state.lawnMowerControl})}function Hoe(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 $oe=`
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 Qoe({activity:e,batteryLevel:t}){const n=Hoe(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-emerald-700/40 to-emerald-900/30 overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:$oe}),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||p)&&"rg-a"),style:f,children:[v.jsx("rect",{x:"28",y:"34",width:"44",height:"34",rx:"8",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("line",{x1:"34",y1:"60",x2:"66",y2:"60",stroke:"currentColor",strokeWidth:"2",opacity:"0.5"}),v.jsxs("g",{className: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 Voe(e){switch(e){case"error":return"text-destructive";case"warning":return"text-warning";case"info":return"text-foreground-subtle"}}function Goe({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 Zoe({code:e,label:t,severity:n}){return v.jsxs("div",{className:se("inline-flex items-center gap-1 text-xs",Voe(n)),children:[n!=="info"&&v.jsx(el,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:t??`Code ${e}`})]})}function aN({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(Fp,{className:"h-3.5 w-3.5"}),e,"%"]})}function $g({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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 Koe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=nN(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=h=>{p||h===void 0||h({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx($g,{label:"Mow",busy:p,active:f==="mowing",onClick:()=>m(n.startMowing),children:v.jsx(Po,{className:"h-3 w-3"})}),v.jsx($g,{label:"Pause",busy:p,active:f==="paused",onClick:()=>m(n.pause),children:v.jsx(iu,{className:"h-3 w-3"})}),v.jsx($g,{label:"Dock",busy:p,active:f==="docked",onClick:()=>m(n.dock),children:v.jsx(Sm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(aN,{level:a.batteryLevel})})]})}function Qg({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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 Woe({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=nN(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=Foe(f),h=u=>{p||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(Qoe,{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",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(aN,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsx(Goe,{percent:a.progressPercent}),a?.currentCode!=null&&v.jsx(Zoe,{code:a.currentCode,label:a.currentCodeLabel,severity:a.severity}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Qg,{label:"Start mowing",busy:p,active:f==="mowing",onClick:()=>h(n.startMowing),children:v.jsx(Po,{className:"h-5 w-5"})}),v.jsx(Qg,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(iu,{className:"h-5 w-5"})}),v.jsx(Qg,{label:"Dock",busy:p,active:f==="docked",onClick:()=>h(n.dock),children:v.jsx(Sm,{className:"h-5 w-5"})})]})]})]})})}function Yoe(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 iN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.valve,slice:n=>n.state.valve})}function rN(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function Vg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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",rN(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Xoe({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=iN(e,t),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,u=Am(f?.state),x=(w,C)=>{h||!w||(C!==void 0&&m(C),w({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(Vg,{label:"Open",busy:h,variant:u.up,onClick:()=>x(a.open,{state:"opening"}),children:v.jsx(bm,{className:"h-3.5 w-3.5"})}),v.jsx(Vg,{label:"Stop",busy:h,variant:u.stop,onClick:()=>x(a.stop,{state:"stopped"}),children:v.jsx(ou,{className:"h-3 w-3"})}),v.jsx(Vg,{label:"Close",busy:h,variant:u.down,onClick:()=>x(a.close,{state:"closing"}),children:v.jsx(jo,{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 Joe(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 ese(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 tse({state:e,position:t,interactive:n,onSetPosition:a}){const s=Joe(e),p=t!==null?1-t/100:ese(e),f=41+p*8,m=-90*(1-p),h=T.useRef(null),u=T.useRef(!1),x=T.useRef(null),w=j=>{const D=t??0,z=h.current;if(z===null)return D;const B=z.getBoundingClientRect();if(B.height<=0)return D;const q=(j-B.top)/B.height,Z=Math.round(100-q*100);return Math.min(100,Math.max(0,Z))},C=j=>{if(a===void 0)return;const D=w(j);x.current!==D&&(x.current=D,a(D))},E=j=>{n&&(j.stopPropagation(),j.preventDefault(),u.current=!0,x.current=null,j.currentTarget.setPointerCapture(j.pointerId),C(j.clientY))},R=j=>{!n||!u.current||(j.stopPropagation(),C(j.clientY))},I=j=>{!n||!u.current||(j.stopPropagation(),u.current=!1,x.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?I:void 0,onPointerCancel:n?I: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(${m}deg)`,transformOrigin:"50px 20px",transition:"transform 200ms"},children:v.jsx("rect",{x:"34",y:"17",width:"32",height:"6",rx:"3",fill:"currentColor",fillOpacity:"0.7"})})]})})]})}function Gg({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className: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",rN(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function nse({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=iN(e,t),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0)return null;const u=!f,x=(n??[]).includes(ia.ValvePositionable),w=Am(m?.state),C=Yoe(m?.state),E=m?.position??null,R=E!==null,I=(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(tse,{state:m?.state,position:E,interactive:x&&R,onSetPosition:x&&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(Gg,{label:"Open",busy:u,variant:w.up,onClick:()=>I(s.open,{state:"opening"}),children:v.jsx(bm,{className:"h-5 w-5"})}),v.jsx(Gg,{label:"Stop",busy:u,variant:w.stop,onClick:()=>I(s.stop,{state:"stopped"}),children:v.jsx(ou,{className:"h-4 w-4"})}),v.jsx(Gg,{label:"Close",busy:u,variant:w.down,onClick:()=>I(s.close,{state:"closing"}),children:v.jsx(jo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:u,className:"flex-1",onChange:D=>{j(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&R&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]})]})}function ase(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 oN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.humidifier,slice:n=>n.state.humidifier})}function ise({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=oN(e,t),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,u=f?.on??!1,x=()=>{h||(m({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(),x()},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(ru,{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 rse({fillPct:e,tint:t}){const n=82-Math.min(100,Math.max(0,e))/100*56,a=`humidifier-droplet-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"humidifier-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className: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 ose({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=oN(e,t),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,u=ase(f.on,f.action),x=f.minHumidity??0,w=f.maxHumidity??100,C=f.targetHumidity,E=f.currentHumidity,R=E??C??0,I=()=>{h||(m({on:!f.on}),a.setOn({on:!f.on}))},j=D=>{h||(m({targetHumidity:D}),a.setTargetHumidity({humidity:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(rse,{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(),I()},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(ru,{className:"h-4 w-4"}),f.on?"On":"Off"]})]})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Target"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:x,max:w,step:1,value:C??x,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(B=>B===D.target.value);!h&&z!==void 0&&(m({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 sse(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 lse(e,t,n){return e===null||e==="off"?"off":t!==null&&n!==null&&t<n?"heating":"idle"}function sN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.waterHeater,slice:n=>n.state.waterHeater})}function cse({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s}=sN(e,t),{display:p}=jt(s,{enabled:n??!0});return a===void 0||p===void 0?null:v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsxs("span",{className:"tabular-nums",children:[p.currentTemp!==null&&v.jsxs(v.Fragment,{children:[p.currentTemp,"°",v.jsx("span",{className:"mx-0.5",children:"→"})]}),p.targetTemp!==null?`${p.targetTemp}°`:"—"]}),p.operationMode!==null&&v.jsxs("span",{className:"capitalize text-foreground-subtle/80",children:["· ",p.operationMode.replace(/_/g," ")]})]})}function use({fillPct:e,tint:t}){const n=86-Math.min(100,Math.max(0,e))/100*68,a=`water-heater-tank-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"water-heater-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className: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 dse({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=sN(e,t),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,u=lse(f.operationMode,f.currentTemp,f.targetTemp),x=sse(u),w=f.currentTemp,C=f.targetTemp,E=f.minTemp,R=f.maxTemp,I=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=B=>{let q=B;return E!==null&&(q=Math.max(E,q)),R!==null&&(q=Math.min(R,q)),q},D=B=>{if(h||C===null)return;const q=j(C+B);m({targetTemp:q}),a.setTargetTemp({temp:q})},z=()=>{h||f.away===null||(m({away:!f.away}),a.setAway({on:!f.away}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(use,{fillPct:I,tint:x}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children: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(q4,{value:C,unit:"°",onDelta:D})})]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Operation mode",value:f.operationMode??"",disabled:h,onChange:B=>{B.stopPropagation();const q=f.availableModes.find(Z=>Z===B.target.value);!h&&q!==void 0&&(m({operationMode:q}),a.setOperationMode({mode:q}))},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(B=>v.jsx("option",{value:B,children:B},B))}),f.away!==null&&v.jsxs("button",{type:"button","aria-label":f.away?"Disable away mode":"Enable away mode",disabled:h,onClick:B=>{B.stopPropagation(),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(ru,{className:"h-4 w-4"}),"Away ",f.away?"on":"off"]})]})}function lN(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 cN(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 pse(e){const t="h-4 w-4";switch(e){case"sun":return v.jsx(KT,{className:t});case"clear-night":return v.jsx(Xb,{className:t});case"partly-cloudy":return v.jsx(zT,{className:t});case"cloudy":return v.jsx(_ee,{className:t});case"rain":return v.jsx(DT,{className:t});case"snow":return v.jsx(OM,{className:t});case"lightning":return v.jsx(Ree,{className:t});case"fog":return v.jsx(Eee,{className:t});case"wind":return v.jsx(Hi,{className:t});case"hail":return v.jsx(OM,{className:t});default:return null}}function uN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.weather,slice:n=>n.state.weather})}function mse(e,t){return e===null?"—":`${Math.round(e)}${t??"°"}`}function fse({trpc:e,deviceId:t}){const{slice:n}=uN(e,t);if(n===void 0)return null;const a=lN(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",cN(n.condition).accent),title:a.label,"aria-label":a.label,children:pse(a.glyph)}),v.jsx("span",{className:"tabular-nums",children:mse(n.temperature,n.temperatureUnit)})]})}function hse({glyph:e,tint:t}){const n=T.useId();return v.jsxs("div",{"data-testid":"weather-scene","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className: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:gse(e,n)})})]})}function ho({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 gse(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(ho,{cx:58,cy:60})]});case"cloudy":return v.jsxs("g",{children:[v.jsx(ho,{cx:40,cy:44,scale:.9}),v.jsx(ho,{cx:62,cy:58})]});case"rain":return v.jsxs("g",{children:[v.jsx(ho,{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(ho,{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(ho,{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(ho,{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 Zg({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 vse({trpc:e,deviceId:t}){const{slice:n}=uN(e,t);if(n===void 0)return null;const a=lN(n.condition),s=cN(n.condition),p=n.temperatureUnit??"°";return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(hse,{glyph:a.glyph,tint:s}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:n.temperature!==null?Math.round(n.temperature):"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:p}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-2 capitalize",children:a.label})]}),v.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.humidity!==null&&v.jsx(Zg,{icon:v.jsx(sl,{className:"h-3.5 w-3.5"}),label:"Humidity",value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&v.jsx(Zg,{icon:n.windBearing!==null?v.jsx(Zee,{className:"h-3.5 w-3.5",style:{transform:`rotate(${n.windBearing}deg)`}}):v.jsx(Hi,{className:"h-3.5 w-3.5"}),label:"Wind",value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??""}`.trim()}),n.pressure!==null&&v.jsx(Zg,{icon:v.jsx(mp,{className:"h-3.5 w-3.5"}),label:"Pressure",value:`${Math.round(n.pressure)} ${n.pressureUnit??""}`.trim()})]})]})]})})}function dN(e,t){return mt({trpc:e,deviceId:t,cap:n=>n.image,slice:n=>n.state.image})}var fC=1,hC=6,gC=.5;function pN({url:e,alt:t,open:n,onOpenChange:a}){const[s,p]=T.useState(1);T.useEffect(()=>{n&&p(1)},[n,e]);const f=T.useCallback(()=>p(u=>Math.min(hC,u+gC)),[]),m=T.useCallback(()=>p(u=>Math.max(fC,u-gC)),[]),h=T.useCallback(()=>p(1),[]);return v.jsx(x4,{open:n,onOpenChange:a,children:v.jsxs(d0,{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($d,{label:"Zoom out",disabled:s<=fC,onClick:m,children:v.jsx(Ete,{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($d,{label:"Zoom in",disabled:s>=hC,onClick:f,children:v.jsx(Ate,{className:"h-4 w-4"})}),v.jsx($d,{label:"Reset zoom",disabled:s===1,onClick:h,children:v.jsx(tte,{className:"h-4 w-4"})}),v.jsx($d,{label:"Close",onClick:()=>a(!1),children:v.jsx(Cte,{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 $d({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 yse({trpc:e,deviceId:t}){const{slice:n}=dN(e,t),[a,s]=T.useState(!1);if(n===void 0)return null;const p=n.url;return p===null?v.jsx("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded bg-surface-hover text-foreground-subtle",title:"No image",children:v.jsx(UT,{className:"h-4 w-4","aria-hidden":"true"})}):v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",title:"View image",onClick:f=>{f.stopPropagation(),s(!0)},className:"inline-flex items-center justify-center rounded ring-offset-1 hover:ring-2 hover:ring-primary/50 transition",children:v.jsx("img",{src:p,alt:"Image",className:"h-7 w-7 rounded object-cover"})}),v.jsx(pN,{url:p,alt:"Image",open:a,onOpenChange:s})]})}function bse({trpc:e,deviceId:t,deviceName:n}){const{slice:a}=dN(e,t),[s,p]=T.useState(!1),[f,m]=T.useState(!1),h=a?.url??null;return T.useEffect(()=>{p(!1)},[h]),a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex w-full items-center justify-center overflow-hidden rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface",children:a.url!==null&&!s?v.jsx("button",{type:"button",title:"View image",onClick:()=>m(!0),className:"flex w-full cursor-zoom-in items-center justify-center",children:v.jsx("img",{src:a.url,alt:n??"Image",onError:()=>p(!0),className:"max-h-72 w-full object-contain"})}):v.jsxs("div",{"data-testid":"image-placeholder",className:"flex h-48 w-full flex-col items-center justify-center gap-2 text-foreground-subtle",children:[v.jsx(UT,{className:"h-8 w-8","aria-hidden":"true"}),v.jsx("span",{className:"text-xs",children:"No image"})]})}),h!==null&&!s&&v.jsx(pN,{url:h,alt:n??"Image",open:f,onOpenChange:m})]})}var Qd=20,vC=9,mN="#f59e0b",fN="#ef4444";function Ec(e){return Math.min(Fb,Math.max(w_,e))}var Sse=`
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 hN({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:q=>q.petFeeder,slice:q=>q.state.petFeeder}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0}),[u,x]=T.useState(Qd),[w,C]=T.useState(Qd),[E,R]=T.useState(Qd);if(s===void 0||m===void 0)return null;const I=!f,j=m.error&&m.error!=="no_error"?m.error:null,D=m.status==="offline",z=m.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(DM,{className:"h-3.5 w-3.5","aria-hidden":!0}):v.jsx(el,{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",m.lowFood?"text-destructive":"text-foreground"),children:[v.jsx(PM,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.foodLevel??"—",v.jsx("span",{className:"text-foreground-subtle",children:"g"})]}),m.batteryPower!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 text-xs tabular-nums text-foreground-subtle",children:[v.jsx(Fp,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.batteryPower,"%"]}),v.jsxs("button",{type:"button","aria-label":"Feed now",disabled:I||m.feeding,onClick:q=>{q.stopPropagation(),!(I||m.feeding)&&(h({feeding:!0}),s.feed({grams:Qd}))},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",(I||m.feeding)&&"opacity-40 cursor-not-allowed"),children:[v.jsx(va,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feed"]})]});const B=q=>{I||m.feeding||(h({feeding:!0}),s.feed({grams:Ec(q)}))};return v.jsxs("div",{className:"relative flex flex-col items-stretch gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4",children:[v.jsx("style",{children:Sse}),v.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3",children:[v.jsx(xse,{grams:m.foodLevel,low:m.lowFood,eating:m.feeding}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-bold leading-none tabular-nums",style:{color:m.lowFood?fN:mN},children:m.foodLevel??"—"}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:"g in bowl"})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-subtle",children:[m.batteryPower!==null&&v.jsx(bC,{icon:v.jsx(Fp,{className:"h-3.5 w-3.5"}),label:`${m.batteryPower}%`}),m.desiccantLeftDays!==null&&v.jsx(bC,{icon:v.jsx(Hi,{className:"h-3.5 w-3.5"}),label:`${m.desiccantLeftDays}d desiccant`}),z&&v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-amber-500",children:[v.jsx(yee,{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(DM,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Offline"]}):m.feeding?v.jsxs("span",{className:"pf-pulse inline-flex items-center gap-1 font-medium text-amber-500",style:{animation:"pf-pulse 1.2s ease-in-out infinite"},children:[v.jsx(va,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feeding…"]}):m.lowFood?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(gy,{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(Cee,{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(el,{className:"mt-px h-4 w-4 shrink-0","aria-hidden":!0}),v.jsx("span",{className:"min-w-0 break-words",children:j})]}),m.isDualHopper?v.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[v.jsx(Kg,{label:"Hopper 1",grams:w,busy:I||m.feeding,onGrams:C,onFeed:()=>{I||m.feeding||(h({feeding:!0}),s.feed({hopper1:Ec(w)}))}}),v.jsx(Kg,{label:"Hopper 2",grams:E,busy:I||m.feeding,onGrams:R,onFeed:()=>{I||m.feeding||(h({feeding:!0}),s.feed({hopper2:Ec(E)}))}})]}):v.jsx(Kg,{label:"Manual feed",grams:u,busy:I||m.feeding,onGrams:x,onFeed:()=>B(u)}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(Wg,{icon:v.jsx(va,{className:"h-4 w-4"}),label:"Call pet",busy:I,onClick:()=>{s.callPet({})}}),v.jsx(Wg,{icon:v.jsx(Jb,{className:"h-4 w-4"}),label:"Reset desiccant",busy:I,onClick:()=>{s.resetDesiccant({})}}),v.jsx(Wg,{icon:v.jsx(PM,{className:"h-4 w-4"}),label:"Mark refilled",busy:I,onClick:()=>{s.markFoodReplenished({})}})]}),m.feeding&&v.jsxs("button",{type:"button",disabled:I,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",I&&"opacity-40 cursor-not-allowed"),children:[v.jsx(gy,{className:"h-4 w-4","aria-hidden":!0}),"Cancel feed"]}),v.jsx(yC,{label:"Settings",children:v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(Yg,{icon:v.jsx(au,{className:"h-4 w-4"}),label:"Child lock",on:m.childLock,busy:I,onToggle:q=>{h({childLock:q}),s.setChildLock({on:q})}}),v.jsx(Yg,{icon:v.jsx(xm,{className:"h-4 w-4"}),label:"Light",on:m.indicatorLight,busy:I,onToggle:q=>{h({indicatorLight:q}),s.setIndicatorLight({on:q})}}),v.jsx(Yg,{icon:v.jsx(Hp,{className:"h-4 w-4"}),label:"Feed sound",on:m.feedSound,busy:I,onToggle:q=>{h({feedSound:q}),s.setFeedSound({on:q})}})]})}),v.jsx(yC,{label:"Volume",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(su,{className:"h-4 w-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),v.jsx(Yp,{label:"Decrease volume",symbol:"−",disabled:I||m.volume<=0,onClick:()=>{const q=Math.max(0,m.volume-1);h({volume:q}),s.setVolume({level:q})}}),v.jsx("span",{className:"w-6 text-center text-lg font-semibold tabular-nums text-foreground",children:m.volume}),v.jsx(Yp,{label:"Increase volume",symbol:"+",disabled:I||m.volume>=vC,onClick:()=>{const q=Math.min(vC,m.volume+1);h({volume:q}),s.setVolume({level:q})}})]})})]})}function yC({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 bC({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 xse({grams:e,low:t,eating:n}){const a=Math.min(1,Math.max(0,(e??0)/Fb)),s=t?fN:mN,p=52-a*24;return v.jsxs("svg",{width:72,height:72,viewBox:"0 0 72 72",role:"img","aria-label":e===null?"Food level unknown":`${e} grams in bowl`,className:"shrink-0",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:"pf-bowl-clip",children:v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z"})})}),v.jsxs("g",{clipPath:"url(#pf-bowl-clip)",className:n?"pf-eat":void 0,style:n?{animation:"pf-eat 1.1s ease-in-out infinite"}:void 0,children:[v.jsx("rect",{x:"14",y:p,width:"44",height:"34",fill:s,opacity:.9}),v.jsx("ellipse",{cx:"36",cy:p,rx:"22",ry:"4",fill:s})]}),v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"text-border"}),v.jsx("rect",{x:"11",y:"22",width:"50",height:"6",rx:"3",fill:"currentColor",className:"text-border"})]})}function Kg({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(Yp,{label:`Decrease ${e} portion`,symbol:"−",disabled:n||t<=w_,onClick:()=>a(Ec(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(Yp,{label:`Increase ${e} portion`,symbol:"+",disabled:n||t>=Fb,onClick:()=>a(Ec(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(va,{className:"h-4 w-4","aria-hidden":!0}),"Feed"]})]})]})}function Yp({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 Wg({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 Yg({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 kse({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(hN,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})}function wse({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(hN,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}var Xg={cool:"Cool",heat:"Heat",auto:"Auto",heat_cool:"Heat·Cool",fan_only:"Fan",dry:"Dry",off:"Off"},Mse={cool:GT,heat:Qp,auto:ZT,heat_cool:wm,fan_only:$p,dry:sl,off:ru},Cse={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#a1a1aa"},Ase=16,Ese=30;function SC(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}function Rse(e){switch(e){case"turbo":return Ir;case"quiet":return Oee;case"sleep":return Xb;case"eco":return Bee;case"8c_heat":return GT;case"none":return gy;default:return ZT}}function _se(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 Tse=`
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 gN({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:z=>z.climateControl,slice:z=>z.state.climateControl}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const u=!f;if(n==="compact")return v.jsxs("div",{"data-mode":m.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",U4[m.mode]),children:m.target!==null?v.jsxs(v.Fragment,{children:[m.target,"°",m.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",m.currentTemp,"°)"]})]}):m.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[m.currentTemp,"°"]}):null}),m.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:u,onClick:z=>{if(z.stopPropagation(),!u&&m.target!==null){const B=m.target-1;h({target:B}),s.setTarget({target:B})}},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&&m.target!==null){const B=m.target+1;h({target:B}),s.setTarget({target:B})}},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:m.mode,disabled:u,onChange:z=>{z.stopPropagation();const B=m.availableModes.find(q=>q===z.target.value);!u&&B&&(h({mode:B}),s.setMode({mode:B}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",u&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(z=>v.jsx("option",{value:z,children:Xg[z]},z))})]});const x=Cse[m.mode],w=m.mode!=="off",C=Rse(m.preset),E=m.preset==="turbo",R=Math.max(.55,_se(m.fanMode)*(E?.6:1)),I=m.swingVertical!==null,j=m.swingHorizontal!==null,D=w&&(m.swingVertical===!0||m.swingHorizontal===!0);return v.jsxs("div",{"data-mode":m.mode,className:se("relative flex flex-col items-stretch gap-2.5 overflow-hidden rounded-lg border p-3 transition-colors",f0[m.mode]),children:[v.jsx("style",{children:Tse}),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(Ose,{mode:m.mode,accent:x,periodSec:R,swaying:D})}),v.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-surface/50 via-transparent to-surface/50"}),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:x,animation:"acv-glow 3.2s ease-in-out infinite"}}),v.jsxs("div",{className:"relative z-10 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide",style:{color:x},children:[v.jsx(xC,{mode:m.mode,className:"h-3.5 w-3.5"}),Xg[m.mode],m.currentTemp!==null&&v.jsxs("span",{className:"normal-case text-foreground-subtle",children:["· ",m.currentTemp,"° now"]}),m.currentHumidity!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 normal-case text-foreground-subtle",children:[v.jsx(sl,{className:"h-3 w-3"}),m.currentHumidity,"%"]})]}),m.target!==null?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative z-10 flex items-center gap-3",children:[v.jsx(kC,{label:"Decrease target",symbol:"−",disabled:u,onClick:()=>{if(u||m.target===null)return;const z=m.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:x},children:m.target}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]}),v.jsx(kC,{label:"Increase target",symbol:"+",disabled:u,onClick:()=>{if(u||m.target===null)return;const z=m.target+1;h({target:z}),s.setTarget({target:z})}})]}),v.jsx("div",{className:"relative z-10 w-36",children:v.jsx(Nse,{value:m.target,min:Ase,max:Ese,accent:x})})]}):v.jsxs("div",{className:"relative z-10 flex items-baseline gap-0.5",children:[v.jsx("span",{className:"text-4xl font-bold leading-none tabular-nums text-foreground",children:m.currentTemp??"—"}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]})]}),v.jsxs("div",{className:"relative z-10 grid grid-cols-3 gap-2",children:[v.jsx(Jg,{label:"Mode",icon:v.jsx("span",{style:{color:x},className:"flex",children:v.jsx(xC,{mode:m.mode,className:"h-4 w-4"})}),value:m.mode,options:m.availableModes.map(z=>({value:z,label:Xg[z]})),disabled:u,onChange:z=>{const B=m.availableModes.find(q=>q===z);B&&(h({mode:B}),s.setMode({mode:B}))}}),m.availableFanModes.length>0&&v.jsx(Jg,{label:"Fan",icon:v.jsx(Hi,{className:"h-4 w-4 text-sky-500"}),value:m.fanMode,options:m.availableFanModes.map(z=>({value:z,label:SC(z)})),disabled:u,onChange:z=>{h({fanMode:z}),s.setFanMode({fanMode:z})}}),m.availablePresets.length>0&&v.jsx(Jg,{label:"Preset",icon:v.jsx(C,{className:"h-4 w-4 text-emerald-500"}),value:m.preset,options:m.availablePresets.map(z=>({value:z,label:SC(z)})),disabled:u,onChange:z=>{h({preset:z}),s.setPreset({preset:z})}})]}),(I||j)&&v.jsx(Ise,{label:"Swing",children:v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[I&&v.jsx(wC,{axis:"vertical",on:m.swingVertical??!1,busy:u,onToggle:z=>{h({swingVertical:z}),s.setSwingVertical({on:z})}}),j&&v.jsx(wC,{axis:"horizontal",on:m.swingHorizontal??!1,busy:u,onToggle:z=>{h({swingHorizontal:z}),s.setSwingHorizontal({on:z})}})]})})]})}function Ise({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 xC({mode:e,className:t}){const n=Mse[e];return v.jsx(n,{className:t,"aria-hidden":!0})}function Jg({label:e,icon:t,value:n,options:a,disabled:s,onChange:p}){return v.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),v.jsxs("div",{className: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||p(f.target.value)},className:"min-w-0 flex-1 cursor-pointer appearance-none truncate bg-transparent text-xs font-medium text-foreground outline-none",children:a.map(f=>v.jsx("option",{value:f.value,children:f.label},f.value))}),v.jsx(jo,{className:"h-3 w-3 shrink-0 text-foreground-subtle"})]})]})}function kC({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 Nse({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 Ose({mode:e,accent:t,periodSec:n,swaying:a}){const s=[0,1,2,3,4,5],p=e==="heat",f=e==="dry";return v.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:e==="off"?v.jsx("div",{className:"flex h-full items-center justify-center gap-2 opacity-30",children:s.map(m=>v.jsx("span",{className:"h-8 w-1 rounded-full bg-foreground-subtle opacity-40"},m))}):e==="fan_only"?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx(jse,{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(m=>v.jsx("span",{className:"acv-streak absolute rounded-full",style:{left:`${8+m*15}%`,width:f?"0.4rem":"0.3rem",height:f?"0.4rem":"1.9rem",background:t,boxShadow:`0 0 6px ${t}`,animationName:p?"acv-rise":"acv-fall",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${n}s`,animationDelay:`${m%3*(n/3)+m*.05}s`}},m))})})}function jse({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 wC({axis:e,on:t,busy:n,onToggle:a}){const s=e==="vertical"?"Vertical":"Horizontal",p=e==="vertical"?Gee:Vee,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(p,{className:"acv-swing h-4 w-4","aria-hidden":!0,style:t?{animation:`${f} 1.4s ease-in-out infinite`}:void 0}),s]})}var Pse=5,Dse=35;function ev(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function tv(e,t,n){return Math.round(t+e*(n-t))}var qi=176,Xp=76,Cp=2*Math.PI*Xp,fc=Cp*(270/360),nv=qi/2-Xp-10;function MC(e){const t=qi/2,n=qi/2,a=Cp-fc,s=e.mode==="band"?(()=>{const p=e.band.from*fc,f=Math.max(0,(e.band.to-e.band.from)*fc);return{dasharray:`${f} ${Cp-f}`,dashoffset:-p}})():(()=>{const p=e.fraction*fc;return{dasharray:`${p} ${Cp-p}`,dashoffset:void 0}})();return v.jsxs("svg",{width:qi,height:qi,viewBox:`0 0 ${qi} ${qi}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:t,cy:n,r:Xp,fill:"none",stroke:"var(--color-border)",strokeWidth:12,strokeDasharray:`${fc} ${a}`,strokeLinecap:"round"}),v.jsx("circle",{cx:t,cy:n,r:Xp,fill:"none",stroke:e.color,strokeWidth:12,strokeDasharray:s.dasharray,...s.dashoffset!==void 0?{strokeDashoffset:s.dashoffset}:{},strokeLinecap:"round"})]})}var zse={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#d4d4d8"};function Lse({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:D=>D.climateControl,slice:D=>D.state.climateControl}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const u=!f,x=zse[m.mode],w=m.mode==="heat_cool"||m.targetLow!==null&&m.targetHigh!==null,C=Pse,E=Dse,R=!w&&m.target!==null?ev(m.target,C,E):0,I=w&&m.targetLow!==null?ev(m.targetLow,C,E):0,j=w&&m.targetHigh!==null?ev(m.targetHigh,C,E):0;return v.jsxs("div",{"data-mode":m.mode,className:se("flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4 transition-colors",f0[m.mode]),children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs("div",{className:"relative",style:{width:qi,height:qi},children:[w?v.jsx(MC,{mode:"band",band:{from:I,to:j},color:x}):v.jsx(MC,{mode:"fill",fraction:R,color:x}),w?v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(wp,{fraction:I,color:x,knobTopPx:nv,onDragFraction:D=>{if(u||m.targetHigh===null)return;const z=Math.min(tv(D,C,E),m.targetHigh);h({targetLow:z}),s.setTargetRange({targetLow:z,targetHigh:m.targetHigh})}})}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(wp,{fraction:j,color:x,knobTopPx:nv,onDragFraction:D=>{if(u||m.targetLow===null)return;const z=Math.max(tv(D,C,E),m.targetLow);h({targetHigh:z}),s.setTargetRange({targetLow:m.targetLow,targetHigh:z})}})})]}):v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(wp,{fraction:R,color:x,knobTopPx:nv,onDragFraction:D=>{if(u)return;const z=tv(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:[m.currentTemp!==null?m.currentTemp:"—",v.jsx("span",{className:"text-lg text-foreground-subtle font-normal ml-0.5",children:"°"})]}),!w&&m.target!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:["set ",m.target,"°"]}),w&&m.targetLow!==null&&m.targetHigh!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:[m.targetLow,"° – ",m.targetHigh,"°"]})]})]}),!w&&m.target!==null&&v.jsx("div",{className:"w-[200px]",children:v.jsx(q4,{value:`${m.target}°`,onDelta:D=>{if(u||m.target===null)return;const z=m.target+D;h({target:z}),s.setTarget({target:z})}})})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:u,onChange:D=>{D.stopPropagation();const z=D.target.value;!u&&z&&(h({mode:m.availableModes.find(B=>B===z)??m.mode}),s.setMode({mode:m.availableModes.find(B=>B===z)??m.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:m.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function qse(e){return e==="locked"||e==="locking"}function vN(e){return e==="jammed"}var Bse={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 Use({state:e}){const t=Bse[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(au,{className:"h-8 w-8","aria-hidden":"true"}):v.jsx(vy,{className:"h-8 w-8","aria-hidden":"true"})})}function Fse({state:e}){return v.jsx("span",{className:se("text-sm font-medium capitalize",vN(e)?"text-danger":"text-foreground-muted"),children:e})}function Hse({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(Js,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Open"]})}function $se({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:I=>I.lockControl,slice:I=>I.state.lockControl}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const u=qse(m.state),x=vN(m.state)||!f,w=n?.includes(ia.LockOpen)===!0,C=()=>{x||(u?(h({state:"unlocking"}),s.unlock({})):(h({state:"locking"}),s.lock({})))},E=()=>{x||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(Use,{state:m.state}),v.jsx(Fse,{state:m.state})]}),v.jsx("div",{className:se(x&&"pointer-events-none opacity-40"),children:v.jsx(_re,{on:u,targetLabel:R,onConfirm:C})}),w&&v.jsx("div",{className:"flex justify-center",children:v.jsx(Hse,{busy:x,onOpen:E})})]})}var Ly=500,yN=150,Qse="linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)";function Vse(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function Gse(e){return Vse(e,yN,Ly)}var Zse="#f4b740",Kse="#d4d4d8";function Wse({trpc:e,deviceId:t,features:n,optimistic:a}){const s=mt({trpc:e,deviceId:t,cap:q=>q.switch,slice:q=>q.state.switch}),p=mt({trpc:e,deviceId:t,cap:q=>q.brightness,slice:q=>q.state.brightness}),f=mt({trpc:e,deviceId:t,cap:q=>q.color,slice:q=>q.state.color}),m=jt(s.slice,{enabled:a??!0}),h=jt(p.slice,{enabled:a??!0}),u=jt(f.slice,{enabled:a??!0});if(s.cap===void 0||m.display===void 0)return null;const x=m.display.on===!0,w=!s.available,C=h.display?.percentage??0,E=!p.available,R=x?C/100:0,I=x?Zse:Kse,j=(n?.includes(ia.LightColorMired)??!1)&&f.cap!==void 0,D=u.display?.mireds,z=!f.available,B=()=>{if(w)return;const q=!x;m.applyOptimistic({on:q}),s.cap?.setState({on:q})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs(B4,{fraction:R,color:I,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(xm,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}),p.cap!==void 0&&v.jsxs("label",{className:"flex w-full items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16",children:"Brightness"}),v.jsx("input",{"aria-label":"Brightness",type:"range",min:0,max:100,step:1,className:"flex-1",value:C,disabled:E||!x,onChange:q=>{const Z=Number(q.target.value);h.applyOptimistic({percentage:Z}),E||p.cap?.setBrightness({percentage:Z})}}),v.jsxs("span",{className:"tabular-nums w-9 text-right",children:[C,"%"]})]})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:x?"On":"Off"}),v.jsx(p0,{on:x,busy:w,onToggle:B})]}),j&&v.jsxs("div",{className:"flex items-center gap-2","data-testid":"color-temp-strip",children:[v.jsx(wm,{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:yN,max:Ly,step:1,className:"w-full",value:D??Ly,disabled:z||!x,onChange:q=>{const Z=Number(q.target.value);u.applyOptimistic({mode:"mired",mireds:Z}),z||f.cap?.setColor({color:{mode:"mired",mireds:Z}})}}),v.jsx("div",{className:"pointer-events-none mt-1",children:v.jsx(Dy,{fraction:D!==void 0?Gse(D):.5,color:Qse})})]})]})]})}var Yse="#3aa6a0",Xse="#d4d4d8";function Jse({trpc:e,deviceId:t,features:n,optimistic:a}){const s=mt({trpc:e,deviceId:t,cap:F=>F.switch,slice:F=>F.state.switch}),p=mt({trpc:e,deviceId:t,cap:F=>F.fanControl,slice:F=>F.state.fanControl}),f=jt(s.slice,{enabled:a??!0}),m=jt(p.slice,{enabled:a??!0});if(s.cap===void 0||f.display===void 0)return null;const h=f.display.on===!0,u=!s.available,x=m.display?.percentage??0,w=!p.available,C=h?x/100:0,E=h?Yse:Xse,R=n?.includes(ia.FanSpeed)??!1,I=(n?.includes(ia.FanOscillating)??!1)&&p.cap!==void 0,j=m.display?.availablePresets??[],D=(n?.includes(ia.FanPreset)??!1)&&p.cap!==void 0&&j.length>0,z=m.display?.preset??"",B=m.display?.oscillating===!0,q=()=>{if(u)return;const F=!h;f.applyOptimistic({on:F}),s.cap?.setState({on:F})},Z=()=>{if(w)return;const F=!B;m.applyOptimistic({oscillating:F}),p.cap?.setOscillating({oscillating:F})},J=F=>{if(w)return;const de=m.display;if(de===void 0)return;const we=de.percentageStep!==void 0&&de.percentageStep>0?de.percentageStep:1,Ce=Math.min(100,Math.max(0,Math.round(F*100/we)*we));m.applyOptimistic({percentage:Ce}),p.cap?.setPercentage({percentage:Ce})},$=F=>{w||F===""||(m.applyOptimistic({preset:F}),p.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(B4,{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:[x,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx($p,{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($p,{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:[I?v.jsxs("button",{type:"button","aria-label":"Oscillate","aria-pressed":B,disabled:w,onClick:F=>{F.stopPropagation(),Z()},className:se("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors",B?"border-success/50 bg-success/10 text-success":"border-border text-foreground-muted hover:bg-surface-hover",w&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Jb,{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(p0,{on:h,busy:u,onToggle:q})]})]})}function ele({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:w=>w.switch,slice:w=>w.state.switch}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=f.on===!0,u=!p,x=()=>{if(u)return;const w=!h;m({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(ru,{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(p0,{on:h,busy:u,onToggle:x})]})}function tle(e){return e==="playing"||e==="buffering"?"pause":"play"}function nle(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function CC(e){if(e===null)return"--:--";const t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function ale({title:e,subtitle:t}){return v.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v.jsx(QT,{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 av({label:e,busy:t,onPress:n,children:a,primary:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),t||n()},className: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 ile({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=mt({trpc:e,deviceId:t,cap:B=>B.mediaPlayer,slice:B=>B.state.mediaPlayer}),{display:m,applyOptimistic:h}=jt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const u=!f,x=tle(m.state),w=(n?.includes(ia.MediaPlayerSeek)??!1)&&m.durationMs!==null&&m.durationMs>0,C=n?.includes(ia.MediaPlayerNext)??!1,E=n?.includes(ia.MediaPlayerPrevious)??!1,R=(n?.includes(ia.MediaPlayerVolume)??!1)&&m.volumeLevel!==null,I=()=>{u||(x==="play"?(h({state:"playing"}),s.play({})):(h({state:"paused"}),s.pause({})))},j=m.currentMedia?.artist??m.currentMedia?.album??null,D=nle(m.positionMs,m.durationMs),z=m.volumeLevel??0;return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx(ale,{title:m.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:m.durationMs??0,step:1e3,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:m.positionMs??0,disabled:u,onChange:B=>{if(u)return;const q=Number(B.target.value);h({positionMs:q}),s.seek({positionMs:q})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Dy,{fraction:D})})]}),v.jsxs("div",{className:"flex justify-between text-[11px] tabular-nums text-foreground-subtle",children:[v.jsx("span",{children:CC(m.positionMs)}),v.jsx("span",{children:CC(m.durationMs)})]})]}),v.jsxs("div",{className:"flex items-center justify-center gap-4",children:[E&&v.jsx(av,{label:"Previous",busy:u,onPress:()=>{s.previous({})},children:v.jsx(ste,{className:"h-5 w-5","aria-hidden":"true"})}),v.jsx(av,{label:x==="play"?"Play":"Pause",busy:u,onPress:I,primary:!0,children:x==="play"?v.jsx(Po,{className:"h-6 w-6","aria-hidden":"true"}):v.jsx(iu,{className:"h-6 w-6","aria-hidden":"true"})}),C&&v.jsx(av,{label:"Next",busy:u,onPress:()=>{s.next({})},children:v.jsx(lte,{className:"h-5 w-5","aria-hidden":"true"})})]}),R&&v.jsxs("div",{"data-testid":"media-volume",className:"flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":m.isMuted===!0?"Unmute":"Mute",title:m.isMuted===!0?"Unmute":"Mute",disabled:u,onClick:B=>{if(B.stopPropagation(),u||m.isMuted===null)return;const q=!m.isMuted;h({isMuted:q}),s.setMute({muted:q})},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:m.isMuted===!0?v.jsx(XT,{className:"h-4 w-4","aria-hidden":"true"}):v.jsx(su,{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:B=>{if(u)return;const q=Number(B.target.value);h({volumeLevel:q}),s.setVolume({volumeLevel:q})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(Dy,{fraction:z/100})})]}),v.jsxs("span",{className:"w-9 text-right text-[11px] tabular-nums text-foreground-subtle",children:[z,"%"]})]})]})}var bN={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"}},SN={home:"Home",away:"Away",night:"Night",vacation:"Vacation",custom_bypass:"Bypass"};function xN(e){return e.startsWith("armed_")}function g0(e){return e==="arming"||e==="disarming"}function kN({icon:e,sizeClass:t="h-8 w-8"}){return e==="disarmed"?v.jsx(rte,{className:t,"aria-hidden":"true"}):e==="triggered"?v.jsx(km,{className:t,"aria-hidden":"true"}):e==="pending"?v.jsx(ote,{className:t,"aria-hidden":"true"}):v.jsx(ite,{className:t,"aria-hidden":"true"})}function AC({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 rle({state:e,availableModes:t,busy:n,onDisarm:a,onArm:s}){const p=xN(e),f=g0(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(AC,{label:"Disarm",active:!p&&!f,busy:n,onSelect:a}),t.map(m=>v.jsx(AC,{label:SN[m],active:!f&&e===`armed_${m}`,busy:n,onSelect:()=>s(m)},m))]})}function wN(e,t,n){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:w=>w.alarmPanel,slice:w=>w.state.alarmPanel}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,handleDisarm:()=>{a===void 0||h||(m({state:"disarming"}),a.disarm({}))},handleArm:w=>{a===void 0||h||(m({state:"arming"}),a.arm({mode:w}))}}}function ole({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=wN(e,t,n);if(!s||a===void 0)return null;const h=bN[a.state],u=xN(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,g0(a.state)&&"animate-pulse"),children:[v.jsx(kN,{icon:h.icon,sizeClass:"h-3 w-3"}),h.label]}),v.jsxs("select",{"aria-label":"Alarm mode",disabled:p,value:u,onClick:x=>x.stopPropagation(),onChange:x=>{x.stopPropagation();const w=x.target.value;w===""?f():m(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",p&&"cursor-not-allowed opacity-40"),children:[v.jsx("option",{value:"",children:"Disarm"}),a.availableModes.map(x=>v.jsx("option",{value:x,children:SN[x]},x))]})]})}function sle({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=wN(e,t,n);if(!s||a===void 0)return null;const h=bN[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,g0(a.state)&&"animate-pulse"),children:v.jsx(kN,{icon:h.icon})}),v.jsx("span",{className:se("text-sm font-medium",h.colorClass,"border-0 bg-transparent"),children:h.label})]}),v.jsx(rle,{state:a.state,availableModes:a.availableModes,busy:p,onDisarm:f,onArm:m})]})}function lle(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 v0({atMs:e,neverLabel:t}){const n=lle(e,Date.now());return v.jsx("span",{className:"text-xs text-foreground-subtle","data-testid":"last-run",children:n===null?t:n})}function MN({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(el,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),v.jsx("span",{className:"truncate",children:e})]})}function CN(e,t,n){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:x=>x.scriptRunner,slice:x=>x.state.scriptRunner}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0}),h=!p,u=f?.isRunning===!0;return{display:f,capPresent:a!==void 0,busy:h,running:u,run:()=>{a===void 0||h||u||(m({isRunning:!0}),a.run({}))},stop:()=>{a===void 0||h||!u||(m({isRunning:!1}),a.stop({}))}}}function AN({running:e,busy:t,large:n,onRun:a,onStop:s}){const p=e?"Stop":"Run";return v.jsxs("button",{type:"button","aria-label":p,title:p,disabled:t,"data-testid":"script-run","data-running":e?"true":"false",onClick:f=>{f.stopPropagation(),e?s():a()},className: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(Aee,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}):v.jsx(Po,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:p})]})}function cle({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=CN(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(AN,{running:f,busy:p,large:!1,onRun:m,onStop:h}),v.jsx(v0,{atMs:a.lastRunAt,neverLabel:"never run"})]})}function ule({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=CN(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(Po,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:f?"Running":"Idle"}),v.jsx(v0,{atMs:a.lastRunAt,neverLabel:"never run"}),v.jsx(MN,{error:a.lastError})]}),v.jsx("div",{className:"flex justify-center",children:v.jsx(AN,{running:f,busy:p,large:!0,onRun:m,onStop:h})})]})}function EN(e,t,n){const{cap:a,slice:s,available:p}=mt({trpc:e,deviceId:t,cap:u=>u.automationControl,slice:u=>u.state.automationControl}),{display:f,applyOptimistic:m}=jt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,setEnabled:u=>{a===void 0||h||(m({enabled:u}),u?a.enable({}):a.disable({}))},trigger:()=>{a===void 0||h||a.trigger({})}}}function RN({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 _N({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(Ir,{className:t?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:"Trigger"})]})}function dle({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=EN(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(RN,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(_N,{busy:p,large:!1,onTrigger:m})]})}function ple({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=EN(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(Ir,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:a.enabled?"Enabled":"Disabled"}),v.jsx(v0,{atMs:a.lastTriggeredAt,neverLabel:"never triggered"}),v.jsx(MN,{error:a.lastError})]}),v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx(RN,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(_N,{busy:p,large:!0,onTrigger:m})]})]})}function mle({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 TN(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.switch,slice:a=>a.state.switch});return n!==void 0}function fle({trpc:e,deviceId:t,features:n,optimistic:a}){return TN(e,t)?v.jsx(m0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function hle(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.lockControl,slice:a=>a.state.lockControl});return n!==void 0}function gle({trpc:e,deviceId:t,features:n,optimistic:a}){return hle(e,t)?v.jsx(Lre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function vle({trpc:e,deviceId:t,features:n,optimistic:a}){return TN(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(m0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(qre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function yle(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.fanControl,slice:a=>a.state.fanControl});return n!==void 0}function ble({trpc:e,deviceId:t,features:n,optimistic:a}){return yle(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(m0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(Bre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function y0(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.climateControl,slice:a=>a.state.climateControl});return n!==void 0}function Sle({trpc:e,deviceId:t,features:n,optimistic:a}){return y0(e,t)?v.jsx(Fre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function xle({trpc:e,deviceId:t,features:n,optimistic:a}){return y0(e,t)?v.jsx(gN,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function kle({trpc:e,deviceId:t,features:n,optimistic:a}){return y0(e,t)?v.jsx(gN,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a}):null}function wle(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.mediaPlayer,slice:a=>a.state.mediaPlayer});return n!==void 0}function Mle({trpc:e,deviceId:t,features:n,optimistic:a}){return wle(e,t)?v.jsx(Zre,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function IN(e,t){const{cap:n}=mt({trpc:e,deviceId:t,cap:a=>a.control,slice:a=>a.state.control});return n!==void 0}function Cle({trpc:e,deviceId:t,features:n,optimistic:a}){return IN(e,t)?v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function Ale({trpc:e,deviceId:t,features:n,optimistic:a}){return IN(e,t)?v.jsx(mle,{children:v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}):null}var Ele={cover:{InlineControl:poe,HeroCard:hoe},valve:{InlineControl:Xoe,HeroCard:nse},humidifier:{InlineControl:ise,HeroCard:ose},"water-heater":{InlineControl:cse,HeroCard:dse},switch:{InlineControl:fle,HeroCard:ele},light:{InlineControl:vle,HeroCard:Wse},fan:{InlineControl:ble,HeroCard:Jse},sensor:{InlineControl:boe,HeroCard:Roe},thermostat:{InlineControl:Sle,HeroCard:Lse},climate:{InlineControl:xle,HeroCard:kle},button:{InlineControl:jre,HeroCard:Pre},update:{InlineControl:_oe,HeroCard:Toe},lock:{InlineControl:gle,HeroCard:$se},"media-player":{InlineControl:Mle,HeroCard:ile},alarm:{InlineControl:ole,HeroCard:sle},control:{InlineControl:Cle,HeroCard:Ale},weather:{InlineControl:fse,HeroCard:vse},vacuum:{InlineControl:Boe,HeroCard:Uoe},"lawn-mower":{InlineControl:Koe,HeroCard:Woe},image:{InlineControl:yse,HeroCard:bse},"pet-feeder":{InlineControl:kse,HeroCard:wse},script:{InlineControl:cle,HeroCard:ule},automation:{InlineControl:dle,HeroCard:ple},dummy:{InlineControl:goe,HeroCard:voe}};Object.fromEntries(Object.values(Q).map(e=>[e,Ele[PY[e]]]));Q.Cover+"",Q.Valve+"",Q.Thermostat+"",Q.Climate+"",Q.Control+"",Q.Button+"",Q.MediaPlayer+"",Q.AlarmPanel+"",Q.Lock+"",Q.Vacuum+"",Q.LawnMower+"",Q.Humidifier+"",Q.Switch+"",Q.Siren+"",Q.Light+"",Q.Fan+"",Q.WaterHeater+"",Q.Sensor+"",Q.Presence+"",Q.EventEmitter+"",Q.Notifier+"",Q.Script+"",Q.Automation+"",Q.Camera+"",Q.Hub+"",Q.Update+"",Q.Generic+"",Q.Weather+"",Q.Container+"",Q.Image+"",Q.PetFeeder+"";new Set(Object.values(Q));var NN={[Q.Camera]:{icon:wee,label:"Camera"},[Q.Hub]:{icon:Kee,label:"Hub"},[Q.Light]:{icon:xm,label:"Light"},[Q.Siren]:{icon:Vp,label:"Siren"},[Q.Switch]:{icon:yy,label:"Switch"},[Q.Sensor]:{icon:OT,label:"Sensor"},[Q.Thermostat]:{icon:wm,label:"Thermostat"},[Q.Climate]:{icon:fee,label:"Air conditioner"},[Q.Button]:{icon:PT,label:"Button"},[Q.EventEmitter]:{icon:Ir,label:"Event Emitter"},[Q.Update]:{icon:Jb,label:"Update"},[Q.Generic]:{icon:TM,label:"Generic"},[Q.Notifier]:{icon:Hp,label:"Notifier"},[Q.Script]:{icon:ate,label:"Script"},[Q.Automation]:{icon:Mte,label:"Automation"},[Q.Lock]:{icon:au,label:"Lock"},[Q.Cover]:{icon:bee,label:"Cover"},[Q.Valve]:{icon:Xee,label:"Valve"},[Q.Humidifier]:{icon:kte,label:"Humidifier"},[Q.WaterHeater]:{icon:vee,label:"Water heater"},[Q.Fan]:{icon:$p,label:"Fan"},[Q.MediaPlayer]:{icon:Qee,label:"Media player"},[Q.AlarmPanel]:{icon:km,label:"Alarm panel"},[Q.Control]:{icon:e0,label:"Control"},[Q.Presence]:{icon:$ee,label:"Presence"},[Q.Weather]:{icon:zT,label:"Weather"},[Q.Vacuum]:{icon:xee,label:"Vacuum"},[Q.LawnMower]:{icon:fte,label:"Lawn mower"},[Q.Container]:{icon:TM,label:"Container"},[Q.Image]:{icon:Lee,label:"Image"},[Q.PetFeeder]:{icon:See,label:"Pet feeder"}},Rle={[He.Siren]:{icon:Vp,label:"Siren"},[He.Floodlight]:{icon:xm,label:"Floodlight"},[He.Spotlight]:{icon:jee,label:"Spotlight"},[He.PirSensor]:{icon:VT,label:"PIR sensor"},[He.Chime]:{icon:Hp,label:"Chime"},[He.Autotrack]:{icon:LT,label:"Auto-track"},[He.Nightvision]:{icon:Xb,label:"Night vision"},[He.PrivacyMask]:{icon:Nee,label:"Privacy mask"},[He.Doorbell]:{icon:Iee,label:"Doorbell"},[He.BinaryHelper]:{icon:yy,label:"Binary helper"},[He.MotionSensor]:{icon:BT,label:"Motion sensor"},[He.ContactSensor]:{icon:Js,label:"Contact sensor"},[He.LeakSensor]:{icon:Wb,label:"Leak sensor"},[He.SmokeSensor]:{icon:hee,label:"Smoke sensor"},[He.COSensor]:{icon:Hi,label:"CO sensor"},[He.GasSensor]:{icon:Qp,label:"Gas sensor"},[He.TamperSensor]:{icon:km,label:"Tamper sensor"},[He.VibrationSensor]:{icon:YT,label:"Vibration sensor"},[He.ConnectivitySensor]:{icon:wte,label:"Connectivity"},[He.SoundSensor]:{icon:su,label:"Sound sensor"},[He.BinarySensor]:{icon:yy,label:"Binary sensor"},[He.TemperatureSensor]:{icon:wm,label:"Temperature"},[He.HumiditySensor]:{icon:sl,label:"Humidity"},[He.AmbientLightSensor]:{icon:KT,label:"Ambient light"},[He.PressureSensor]:{icon:mp,label:"Pressure"},[He.WindSensor]:{icon:Hi,label:"Wind"},[He.RainSensor]:{icon:DT,label:"Rain"},[He.UvSensor]:{icon:dte,label:"UV index"},[He.SolarRadiationSensor]:{icon:pte,label:"Solar radiation"},[He.SoilMoistureSensor]:{icon:ute,label:"Soil moisture"},[He.PowerSensor]:{icon:Ir,label:"Power"},[He.EnergySensor]:{icon:Ir,label:"Energy"},[He.VoltageSensor]:{icon:Ir,label:"Voltage"},[He.CurrentSensor]:{icon:Ir,label:"Current"},[He.AirQualitySensor]:{icon:Hi,label:"Air quality"},[He.BatterySensor]:{icon:mp,label:"Battery"},[He.NumericSensor]:{icon:zee,label:"Numeric sensor"},[He.EnumSensor]:{icon:Fee,label:"Enum sensor"},[He.DateTimeSensor]:{icon:NM,label:"Date / time"},[He.GenericSensor]:{icon:mp,label:"Sensor"},[He.NumericControl]:{icon:e0,label:"Numeric control"},[He.SelectControl]:{icon:Uee,label:"Select control"},[He.TextControl]:{icon:yte,label:"Text control"},[He.DateTimeControl]:{icon:NM,label:"Date / time control"},[He.MobilePushNotifier]:{icon:cte,label:"Mobile push"},[He.MessagingNotifier]:{icon:HT,label:"Messaging"},[He.EmailNotifier]:{icon:Hee,label:"Email"},[He.GenericNotifier]:{icon:Hp,label:"Notifier"}},_le=new Set(Object.values(Q));new Set(Object.values(He));function Tle(e){return _le.has(e)}var EC=NN[Q.Generic];Rle[He.GenericSensor];function Ile(e){return Tle(e)?NN[e]??EC:EC}Object.values(Q).map(e=>{const t=Ile(e);return{id:e,label:t.label,icon:t.icon}});T.createContext(null);Q.Sensor,Q.Presence;var Nle="/addon/snapshot/media";function Ufe(e,t={}){const{width:n,baseUrl:a}=t,[s,p]=T.useState(0);return{src:T.useMemo(()=>{if(e===null||e<=0)return null;const f=a!==void 0?a.replace(/\/+$/,""):"",m=new URLSearchParams;n!==void 0&&Number.isInteger(n)&&n>0&&m.set("w",String(n)),s>0&&(m.set("force","1"),m.set("r",String(s)));const h=m.toString();return`${f}${Nle}/${String(e)}.jpg${h.length>0?`?${h}`:""}`},[e,n,a,s]),loading:!1,refresh:T.useCallback(()=>{p(f=>f+1)},[])}}d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),online:A(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:M(o()).optional(),isCamera:A().optional()});di("camstack:player-overlays-state",null);var Ole=di("camstack:player-overlays-actions",null);function Ffe(e){const t=T.useContext(Ole);T.useEffect(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}di("camstack:zone-editing",null);var RC=500,iv=800;function hc(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 Vd(e,t){return e?.id===t}function jle(e,t){const[n,a]=T.useState(null),[s,p]=T.useState(null),[f,m]=T.useState(null),[h,u]=T.useState("watching"),x=T.useRef(void 0),w=T.useRef(void 0),C=T.useRef(void 0),E=T.useRef(0);return T.useEffect(()=>{if(t===null)return;const R=hc(e,"detection.motion-analysis",I=>{const j=I;if(!Vd(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}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>a(null),RC))});return()=>{R?.unsubscribe(),x.current&&clearTimeout(x.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=hc(e,"detection.motion-zones-raw",I=>{const j=I;if(!Vd(j?.source,t))return;const D=j.data;D?.zones&&(p({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,B)=>z+B.changeScore,0)/D.zones.length:0}),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>p(null),RC))});return()=>{R?.unsubscribe(),w.current&&clearTimeout(w.current)}},[e,t]),T.useEffect(()=>{if(E.current=0,t===null)return;const R=hc(e,"pipeline-analytics.frame-tracked",I=>{const j=I?.data;!j||j.deviceId!==t||j.detections?.length&&typeof j.detections[0]?.kind=="string"&&(E.current=Date.now(),m({detections:j.detections,frameWidth:j.frameWidth,frameHeight:j.frameHeight}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),iv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=hc(e,"detection.result",I=>{const j=I;if(!Vd(j?.source,t)||Date.now()-E.current<iv)return;const D=j.data?.frame;D?.detections?.length&&(m({detections:D.detections,frameWidth:D.width,frameHeight:D.height}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),iv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=hc(e,"detection.phase-transition",I=>{const j=I;Vd(j?.source,t)&&j.data?.to&&u(j.data.to)});return()=>{R?.unsubscribe()}},[e,t]),{motion:n,motionRaw:s,detection:f,phase:h}}var Ple=5*6e4,Dle=720*6e4,zle="camstack:turn-servers:v1";function Lle(){const e=globalThis;try{return e.localStorage??null}catch{return null}}function qle(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 Ble=class{freshTtlMs;staleCapMs;storage;now;storageKey;memory=new WeakMap;inflight=new WeakMap;constructor(e={}){this.freshTtlMs=e.freshTtlMs??Ple,this.staleCapMs=e.staleCapMs??Dle,this.storage="storage"in e?e.storage??null:Lle(),this.now=e.now??(()=>Date.now()),this.storageKey=e.storageKey??zle}async getOrFetch(e,t){const n=this.now(),a=this.memory.get(e)??this.readStorage();if(a){const s=n-a.fetchedAt;if(s<this.freshTtlMs)return a.servers;if(s<this.staleCapMs)return this.startFetch(e,t,a),a.servers}return this.startFetch(e,t,a)}startFetch(e,t,n){const a=this.inflight.get(e);if(a)return a;const s=(async()=>{try{const p=await t();if(p.length>0){const f={servers:p,fetchedAt:this.now()};this.memory.set(e,f),this.writeStorage(f)}return p}catch{return n?.servers}})().finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,s),s}readStorage(){if(this.storage)try{const e=this.storage.getItem(this.storageKey);if(e===null)return;const t=JSON.parse(e);return qle(t)?t:void 0}catch{return}}writeStorage(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(e))}catch{}}},Ule=new Ble;function ON(e,t,n=5e3){const[a,s]=T.useState([]);T.useEffect(()=>{if(t===null)return;let E=!1;const R=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(j=>{E||s(j)}).catch(()=>{})};R();const I=setInterval(R,n);return()=>{E=!0,clearInterval(I)}},[e,t,n]);const[p,f]=T.useState(null);T.useEffect(()=>{if(t===null)return;let E=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(R=>{E||!R||f({phase:R.phase,detectionFps:R.actualFps,avgInferenceMs:R.avgInferenceTimeMs,droppedFrames:R.droppedFrames})}).catch(()=>{}),()=>{E=!0}},[e,t]),li("pipeline.camera-metrics-snapshot",E=>{if(t===null)return;const R=E.data;R.deviceId!==t||!R.metrics||f({phase:R.metrics.phase,detectionFps:R.metrics.actualFps,avgInferenceMs:R.metrics.avgInferenceTimeMs,droppedFrames:R.metrics.droppedFrames})});const{streams:m,hasWebrtc:h}=T.useMemo(()=>t===null||a.length===0?{streams:[],hasWebrtc:!1}:{streams:a.map(E=>({id:E.id,label:E.label,target:E.target,status:E.status,inputFps:E.inputFps,decodeFps:E.decodeFps,bitrateKbps:E.bitrateKbps})),hasWebrtc:!0},[t,a]),u=T.useCallback(async()=>{const E=e.turnProvider;if(E)return Ule.getOrFetch(e,async()=>(await E.getTurnServers.query()).map(R=>({urls:typeof R.urls=="string"?R.urls:[...R.urls],...R.username!==void 0?{username:R.username}:{},...R.credential!==void 0?{credential:R.credential}:{}})))},[e]);T.useEffect(()=>{u()},[u]);const x=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");const I=await e.webrtcSession.createSession.mutate({deviceId:t,target:E,hints:R}),j=await u();return{sessionId:I.sessionId,sdpOffer:I.sdpOffer,...j?{iceServers:j}:{}}},[e,t,u]),w=T.useCallback(async(E,R,I,j)=>{if(t===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:t,target:E,sdpOffer:R,...I!==void 0?{sessionId:I}:{},...j!==void 0?{hints:j}:{}})},[e,t]),C=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:E,sdpAnswer:R})},[e,t]);return{streams:m,hasWebrtc:h,pipelineMetrics:p,createSession:x,handleOffer:w,getIceServers:u,addIceCandidate:T.useCallback(async(E,R)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:E,candidate:R.candidate??"",sdpMid:R.sdpMid??null,sdpMLineIndex:R.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:T.useCallback(async E=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:E}),[e,t]),sendAnswer:C,closeSession:T.useCallback(async E=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:E}).catch(()=>{})},[e,t]),getSessionState:T.useCallback(async E=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:E})}catch{return{pendingRenegotiation:null}}},[e,t])}}T.lazy(()=>Vs(()=>import("./MaskShapeCanvas-DI4BY7W2-nd65Mp4-.js"),[],import.meta.url).then(e=>({default:e.MaskShapeCanvas})));T.lazy(()=>Vs(()=>import("./MotionZonesSettings-DNdnFHso-NM6J-UWF.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings})));T.lazy(()=>Vs(()=>import("./SceneMonitorEditor-d_A4kO-M-Foei8N6A.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>({default:e.SceneMonitorEditor})));T.lazy(()=>Vs(()=>import("./PrivacyMaskSettings-DNSLc6ww-B3J9k853.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));const jN=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Fle=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Hle=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const _C=e=>{const t=Hle(e);return t.charAt(0).toUpperCase()+t.slice(1)};var $le={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 Qle=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Vle=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...$le,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:jN("lucide",s),...!p&&!Qle(m)&&{"aria-hidden":"true"},...m},[...f.map(([u,x])=>T.createElement(u,x)),...Array.isArray(p)?p:[p]]));const Gle=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Vle,{ref:p,iconNode:t,className:jN(`lucide-${Fle(_C(e))}`,`lucide-${e}`,a),...s}));return n.displayName=_C(e),n};const Zle=[["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"}]],Kle=Gle("scan-face",Zle),Jp={unassignedFace:"unassigned face",reviewed:"reviewed",debug:"debug",train:"train",favourite:"favourite",active:"active",loadingMore:"Loading more events"},Wle=Object.keys(Jp),PN=Y(o(),o());function Yle(e){if(e===null||typeof e!="object")return Jp;const t=e,n={...Jp};for(const a of Wle){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 Xle=O(["reel","gallery"]),Jle=O(["small","medium","large"]),ece=O(["time","importance"]),tce=O(["text","semantic"]),nce=["face","plate"],b0=O(nce),ace=O(["auto","dark","light"]),ice=it([V("auto"),l().int().min(1).max(12)]),rce=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()});d({view:Xle,rows:l().int().min(1).max(6).optional(),columns:ice.optional(),thumb:Jle,deviceIds:M(l().int().nonnegative()),classes:M(o()).optional(),attrs:M(b0).optional(),search:o().optional(),searchMode:tce.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:ece.optional(),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),deviceNames:Y(o(),o()).optional(),fields:rce,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:ace});const DN=O(["reel","gallery"]),oce=O(["tracks","groups"]),zN=O(["small","medium","large"]),LN=O(["auto","dark","light"]),qN=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()}),BN={label:!0,sublabel:!0,camera:!0,time:!0,badges:!0},UN=O(["time","importance"]),FN=O(["text","semantic"]),HN=it([V("auto"),l().int().min(1).max(12)]),sce=60,lce=600,cce=0,uce=720*60*60*1e3,dce=d({serverUrl:o().min(1),token:o().min(1),entity:oce.default("tracks"),view:DN.default("reel"),rows:l().int().min(1).max(6).default(1),columns:HN.default("auto"),thumbSize:zN.default("medium"),fields:qN.default(BN),deviceIds:M(l().int().nonnegative()).default([]),classes:M(o()).default([]),attrs:M(b0).catch([]).default([]),deviceNames:Y(o(),o()).default({}),kindLabels:Y(o(),o()).default({}),labels:PN.default({}),strings:d({empty:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional()}).default({}),search:o().default(""),searchMode:FN.default("text"),semanticLimit:l().int().min(1).max(200).default(50),semanticMinScore:l().min(0).max(1).default(.2),sort:UN.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(sce),maxRows:l().int().min(1).max(5e3).default(lce),refreshMs:l().int().min(0).max(6e5).default(cce),maxAgeMs:l().int().min(6e4).default(uce),theme:LN.default("auto"),nativePullToRefresh:A().default(!1)}),$N=d({view:DN.optional(),rows:l().int().min(1).max(6).optional(),columns:HN.optional(),thumbSize:zN.optional(),fields:qN.partial().optional(),deviceIds:M(l().int().nonnegative()).optional(),classes:M(o()).optional(),attrs:M(b0).optional(),deviceNames:Y(o(),o()).optional(),kindLabels:Y(o(),o()).optional(),labels:PN.optional(),strings:d({empty:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional()}).optional(),search:o().optional(),searchMode:FN.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:UN.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:LN.optional(),nativePullToRefresh:A().optional()});function S0(e){return e==="small"?80:e==="large"?132:106}function pce(e,t=1){const n=Number.isFinite(t)&&t>0?t:1,a=Math.round(S0(e)*n);return Math.max(mce,Math.min(fce,a))}const mce=64,fce=320,Ap=3,Ep=14,hce=4;function gce(e){return S0(e)+Ap*2+Ep}function QN(e){if(e==null)return{ok:!1,error:"config is required"};const t=dce.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function qy(e,t){const n=t.fields!==void 0?{...e.fields,...t.fields}:e.fields,{sinceMs:a,untilMs:s,...p}=t,{sinceMs:f,untilMs:m,...h}=e,u=TC(a,f),x=TC(s,m);return{...h,...p,fields:n,...u!==void 0?{sinceMs:u}:{},...x!==void 0?{untilMs:x}:{}}}function TC(e,t){if(e!==null)return e??t}function vce(e,t,n){const a=n[String(e)];return a!==void 0&&a.trim().length>0?a:t}const yce={empty:"No events",error:"Couldn't load events",retry:"Retry",end:"·"};function Gd(e,t){const n=e.strings[t];return n!==void 0&&n.trim().length>0?n:yce[t]}const bce="/addon/pipeline-analytics/event-media",IC=64,Sce=320;function xce(e){return e.replace(/\/+$/,"")}function kce(e){const t=Math.round(e);return Number.isFinite(t)?Math.max(IC,Math.min(Sce,t)):IC}function VN(e,t,n){return`${xce(e)}${bce}/${t}?kind=thumbnailSmall&variant=thumb&size=${kce(n)}`}const wce="audio";function em(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mce(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!em(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!em(s))continue;const p=s.kind;if(typeof p!="string"||p.length===0)continue;const f=s.parentKind;t.set(p,typeof f=="string"&&f.length>0?f:p)}}return t}function GN(e,t){return t.get(e)??e}const NC="audio-",OC="audio";function cu(e){const t=e.toLowerCase();return t.startsWith(NC)?t:`${NC}${t}`}function Cce(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!em(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!em(s))continue;const p=s.kind,f=s.iconId;typeof p!="string"||p.length===0||typeof f!="string"||f.length===0||t.set(p,f)}}return t}function Ace(e,t,n=!1){if(n){const s=t.get(e);if(s!==void 0)return s;if(e.toLowerCase()===OC)return OC;const p=cu(e);return t.get(p)??p}const a=e.toLowerCase();return t.get(e)??t.get(a)??a}function Ece(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 x0=new Map;function Rp(e,t){return t.get(e)??t.get(e.toLowerCase())??e}function ZN(e,t){const n=cu(e);return t.get(n)??t.get(e)??e}const jC={background:"#09090b",card:"#18181b",cardHover:"#27272a",border:"#27272a",text:"#fafafa",textMuted:"#a1a1aa",skeleton:"#27272a",chip:"#3f3f46",colorScheme:"dark"},PC={background:"#ffffff",card:"#f4f4f5",cardHover:"#e4e4e7",border:"#e4e4e7",text:"#18181b",textMuted:"#71717a",skeleton:"#e4e4e7",chip:"#d4d4d8",colorScheme:"light"};function KN(e,t){return e==="light"?PC:e==="dark"||t?jC:PC}const By="#f472b6";function Rce(e,t=!1){if(t)return By;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")?By:n.includes("motion")?"#94a3b8":"#71717a"}function _ce(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Tce(e,t){const n=new Date(e),a=new Date(t),s=String(n.getHours()).padStart(2,"0"),p=String(n.getMinutes()).padStart(2,"0");if(n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate())return`${s}:${p}`;const m=String(n.getDate()).padStart(2,"0"),h=String(n.getMonth()+1).padStart(2,"0");return`${m}/${h} ${s}:${p}`}const Ice=/[_\-/.]+/g;function WN(e){return e.toLowerCase().replace(Ice," ").replace(/\s+/g," ").trim()}function Nce(e){if(e===void 0)return[];const t=e.trim().toLowerCase();if(t.length===0)return[];const n=WN(e);return n===t||n.length===0?[t]:[t,n]}const Em=new Map,Oce=new Set(["plate-detection","plate-ocr","operator:plate-gallery"]),DC=new Set(["face-recognizer","face-embedding","operator:face-gallery"]),jce=[];function rv(e,t){if(!k0(e))return!1;const n=e.stepId;return typeof n=="string"&&t.has(n)}function YN(e){return e.source==="audio"}function k0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rr(e){return typeof e=="string"&&e.length>0?e:void 0}function ov(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 Pce(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const a=k0(n)?Rr(n.label):void 0;a!==void 0&&!t.includes(a)&&t.push(a)}return t}function Dce(e,t){if(!k0(e))return null;const n=Rr(e.trackId),a=Rr(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=Rr(e.label),p=Rr(e.subLabel),f=Rr(e.producingDeviceName),m=Rr(e.source),h=ov(e.classes);return{trackId:n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...s!==void 0?{label:s}:{},...p!==void 0?{subLabel:p}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.firstSeen,lastSeen:e.lastSeen,state:typeof e.state=="string"?e.state:"idle",active:e.active===!0,zonesVisited:ov(e.zonesVisited),zoneNames:ov(e.zoneNames),classes:h.includes(a)?h:[a,...h],audioLabels:Pce(e.audioLabels),bestEventId:Rr(e.bestEventId)??n,...f!==void 0?{producingDeviceName:f}:{},...m!==void 0?{source:m}:{},...e.hasEmbeddedFace===!0||rv(e.subLabelMeta,DC)?{hasAssignableFace:!0}:{},...e.hasEmbeddedFace===!0&&!rv(e.subLabelMeta,DC)?{hasUnassignedFace:!0}:{},...rv(e.subLabelMeta,Oce)?{hasPlate:!0}:{},...e.debug===!0?{debug:!0}:{},...e.markForTrain===!0?{markForTrain:!0}:{},...e.favourited===!0?{favourited:!0}:{}}}function zC(e,t){if(!Array.isArray(e))return[];const n=[];for(const a of e){const s=Dce(a,t);s!==null&&n.push(s)}return n}function zce(e,t){const n=new Set;for(const a of[e.className,...e.classes])a.length!==0&&(n.add(a),n.add(GN(a,t)));if(e.audioLabels.length>0){n.add(wce);for(const a of e.audioLabels)n.add(cu(a))}return n}function Lce(e,t,n=Em){if(t.size===0)return!0;const a=zce(e,n);for(const s of t)if(a.has(s))return!0;return!1}function qce(e,t=Em){const n=new Set,a=s=>{for(const p of Nce(s))n.add(p)};for(const s of[e.className,...e.classes])a(s),s.length>0&&a(GN(s,t));a(e.label),a(e.subLabel),a(e.cameraName),a(e.producingDeviceName);for(const s of e.audioLabels)a(s),a(cu(s));for(const s of e.zoneNames)a(s);for(const s of[e.label,e.subLabel]){if(s===void 0)continue;const p=t.get(s.trim().toLowerCase());p!==void 0&&a(p)}return n}function Bce(e,t,n=Em){const a=t.trim().toLowerCase();if(a.length===0)return!0;const s=WN(t);for(const p of qce(e,n))if(p.includes(a)||s.length>0&&p.includes(s))return!0;return!1}function Uce(e,t){return!!(t.size===0||t.has("face")&&e.hasAssignableFace===!0||t.has("plate")&&e.hasPlate===!0)}function Fce(e,t={}){const n=t.debug===!0,a=t.train===!0,s=t.favourited===!0;if(!n&&!a&&!s)return!0;const p=t.reviewedTrackIds?.includes(e.trackId)===!0;return!!(n&&e.debug===!0&&!p||a&&e.markForTrain===!0||s&&e.favourited===!0)}function LC(e,t,n,a=Em,s=jce,p={}){const f=new Set(t),m=new Set(s);return e.filter(h=>Lce(h,f,a)&&Uce(h,m)&&Bce(h,n,a)&&Fce(h,p))}function Hce(e,t=x0){return e.producingDeviceName!==void 0?{text:Rp(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:Rp(e.label,t),tier:"kind"}:{text:Rp(e.className,t),tier:"class"}}function $ce(e,t,n,a=x0){if(t)return"";const s=[n];for(const p of e.audioLabels){if(p===e.className||p===e.label)continue;const f=ZN(p,a);s.includes(f)||s.push(f)}return s.join(" · ")}function qC(e,t){let n=!1;const a=e.map(s=>{const p=t.get(s.deviceId);return p===void 0||p===s.cameraName?s:(n=!0,{...s,cameraName:p})});return n?a:e}function BC(e,t){if(Object.keys(t).length===0)return e;let a=!1;const s=e.map(p=>{const f=t[p.trackId];if(f===void 0)return p;const m=Vce(p,f);return m!==p&&(a=!0),m});return a?s:e}function Qce(e){const{debug:t,markForTrain:n,favourited:a,...s}=e;return s}function Vce(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:{...Qce(e),...n===!0?{debug:!0}:{},...a===!0?{markForTrain:!0}:{},...s===!0?{favourited:!0}:{}}}function Gce(e){const t=e.filter(n=>n.isCamera===!0).map(n=>n.id);return t.length>0?t:e.map(n=>n.id)}const Uy=11,UC=9,sv=3,Zce=8,Kce=12,Wce=24,Yce=.58,Xce=.85;function Jce(e,t){return[...e].length*t*Yce}function eue(e){return Math.max(Wce,e-Zce-Kce)}function FC(e,t,n){const a=eue(t),s=n.maxLines===1?a:a*n.maxLines*Xce;return Jce(e,n.fontSizePx)<=s}function tue(e,t){for(let n=1;n<=sv;n+=1){const a={fontSizePx:Uy,maxLines:n};if(FC(e,t,a))return a}for(let n=Uy-1;n>=UC;n-=1){const a={fontSizePx:n,maxLines:sv};if(FC(e,t,a))return a}return{fontSizePx:UC,maxLines:sv}}const nue=1e4;function XN(){try{return window.parent!==window}catch{return!0}}let Fy=null;function JN(e){Fy=e}function aue(e){if(Fy===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:Fy,...n}}}function on(e){const t=aue(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}XN()&&window.parent.postMessage(t,"*")}function uu(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 iue(e,t,n,a,s){const p=t();if(p!=null)return Promise.resolve(n(p));if(s?.urlFirst===!0){const f=a!==void 0?a():null;if(f!==null)return Promise.resolve(f)}if(!XN()){const f=a!==void 0?a():null;return f!==null?Promise.resolve(f):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`})}return new Promise(f=>{let m;const h=u=>{const x=u.data;if(typeof x!="object"||x===null)return;const w=x;w.type==="embed-config"&&(clearTimeout(m),window.removeEventListener("message",h),f(n(w.config)))};window.addEventListener("message",h),m=setTimeout(()=>{window.removeEventListener("message",h),f({ok:!1,error:"config handshake timed out"})},nue),window.parent.postMessage({type:"embed-ready",mode:e},"*")})}function Rm(e,t,n,a,s){const[p,f]=T.useState(null),m=T.useRef(t);m.current=t;const h=T.useRef(n);h.current=n;const u=T.useRef(a);u.current=a;const x=s?.urlFirst===!0;return T.useEffect(()=>{let w=!0;return iue(e,()=>m.current(),C=>h.current(C),()=>u.current!==void 0?u.current():null,{urlFirst:x}).then(C=>{w&&f(C)}),()=>{w=!1}},[e,x]),p}const ci=1,rue=["window","sort","semantic-search","macro-classes","device-names","kind-labels","heartbeat","track-list","attr-filters","flag-filters","debug-status","native-pull-refresh"];function oue(e){return{v:ci,type:"ready",view:e,features:[...rue]}}function sue(e){return{v:ci,type:"error",message:e}}function _p(e,t){return t!==void 0?{v:ci,type:"state",state:e,message:t}:{v:ci,type:"state",state:e}}function lue(e){return{v:ci,type:"trackClick",...e}}function cue(e){return{v:ci,type:"trackList",tracks:e}}function HC(e,t,n,a="feed"){return{v:ci,type:"countChanged",loaded:e,shown:t,hasMore:n,mode:a}}function uue(){return{v:ci,type:"heartbeat"}}function due(e){return{v:ci,type:"scroll",atTop:e}}function pue(){return{v:ci,type:"refreshed"}}function Ia(e){on(e)}function si(e,t,n="feed"){on({type:"log",scope:n,msg:e,...t!==void 0?{data:t}:{}})}const mue=d({debug:A().optional(),markForTrain:A().optional(),favourited:A().optional()}),fue=Y(o(),mue);function Zd(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=hue.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=fue.safeParse(t.patches);return s.success?{type:"setTrackFlagPatches",patches:s.data}:null}if(n!=="setConfig")return null;const a=$N.safeParse(t.patch);return a.success?{type:"setConfig",patch:a.data}:null}const hue=d({sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional()});function gue(e){return{...e.sinceMs!==void 0?{sinceMs:e.sinceMs}:{},...e.untilMs!==void 0?{untilMs:e.untilMs}:{}}}const vue={blockedMs:0,maxLagMs:0,samples:0};function yue(e,t,n){if(n<=t)return vue;let a=0,s=0,p=0;for(const f of e){const m=f.at-f.lagMs,h=Math.min(f.at,n)-Math.max(m,t);h<=0||(a+=h,s=Math.max(s,f.lagMs),p+=1)}return{blockedMs:Math.round(a),maxLagMs:Math.round(s),samples:p}}function Hy(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 bue=250,$C=600,Sue=8;let Is=[],QC=null;function xue(e){e.lagMs<Sue||(Is.push(e),Is.length>$C&&(Is=Is.slice(Is.length-$C)))}function $y(e,t){return yue(Is,e,t)}function kue(e=bue,t=()=>performance.now(),n=(a,s)=>{const p=setInterval(a,s);return()=>clearInterval(p)}){if(QC!==null)return;let a=t()+e;QC={stop:n(()=>{const p=t();xue({at:p,lagMs:Math.max(0,p-a)}),a=p+e},e)}}function wue(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 Mue(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 Cue(){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 Aue(e,t,n=Cue()){if(n===null)return null;try{const a=Mue(n.getEntriesByName(e,"resource"),t);return a===null?null:wue(a)}catch{return null}}const Eue=250,Ui=new Map,lv=new Map,Rue=6,_ue=1e4,Tue=5e3,cv=[250,750];let uv=40;const VC=32;function Iue(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,VC);return{origin:"(unparseable)",path:e.length>VC?`${t}…`:t,query:""}}}function Nue(e){return e instanceof Error?{errorName:e.name,errorMessage:e.message}:{errorName:"unknown",errorMessage:String(e)}}let tm=0,e5=[];async function Oue(){if(tm<Rue){tm+=1;return}await new Promise(e=>{e5.push(e)})}function jue(){const e=e5.shift();if(e!==void 0){e();return}tm=Math.max(0,tm-1)}function Pue(e,t){for(Ui.set(e,t);Ui.size>Eue;){const n=Ui.keys().next();if(n.done===!0)break;const a=Ui.get(n.value);Ui.delete(n.value),a!==void 0&&URL.revokeObjectURL(a)}}async function t5(e,t){const n=Ui.get(e);if(n!==void 0)return Ui.delete(e),Ui.set(e,n),{status:"ready",src:n};const a=lv.get(e);if(a!==void 0)return a;const s=(async()=>{const p=performance.now(),f=Iue(e);let m={lastStatus:null,errorName:null,errorMessage:null},h=0;try{for(let u=0;u<=cv.length;u+=1){const x=performance.now();await Oue(),h+=performance.now()-x;const w=performance.now(),C=new AbortController,E=setTimeout(()=>C.abort(),_ue);try{const I=await fetch(e,{headers:{Authorization:`Bearer ${t}`},signal:C.signal});if(I.ok){const j=Math.round(performance.now()-w),D=await I.blob(),z=Math.round(performance.now()-p),B=Math.round(performance.now()-w),q=URL.createObjectURL(D);if(Pue(e,q),uv>0||z>=500){uv=Math.max(0,uv-1);const Z=Aue(e,w),J=Hy(performance.now()-w,$y(w,performance.now()));si("thumbnail ready",{ms:z,queuedMs:Math.round(h),headersMs:j,blobMs:B-j,blockedMs:J.blockedMs,maxLagMs:J.maxLagMs,netTotalMs:Z?.totalMs??null,netQueuedMs:Z?.queuedMs??null,netTtfbMs:Z?.ttfbMs??null,bytes:D.size,attempt:u+1,serverTiming:I.headers?.get("server-timing")??null},"media")}return{status:"ready",src:q}}if(I.status===401||I.status===403||I.status===404)return si("thumbnail missing",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),status:I.status,attempt:u+1,...f},"media"),{status:"missing"};m={lastStatus:I.status,errorName:null,errorMessage:null}}catch(I){m={lastStatus:null,...Nue(I)}}finally{clearTimeout(E),jue()}const R=cv[u];R!==void 0&&await new Promise(I=>setTimeout(I,R))}return si("thumbnail transient failure",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),attempts:cv.length+1,...m,...f},"media"),{status:"transient-failure"}}finally{lv.delete(e)}})();return lv.set(e,s),s}async function Due(e,t){const n=await t5(e,t);return n.status==="ready"?n.src:null}function zue(e,t){const[n,a]=T.useState({status:"loading"}),[s,p]=T.useState(0);return T.useEffect(()=>{if(e===null){a({status:"loading"});return}const f=Ui.get(e);if(f!==void 0){a({status:"ready",src:f});return}let m=!0,h;return a({status:"loading"}),t5(e,t).then(u=>{if(m){if(u.status==="ready"){a({status:"ready",src:u.src});return}if(u.status==="missing"){a({status:"failed"});return}h=setTimeout(()=>p(x=>x+1),Tue)}}),()=>{m=!1,h!==void 0&&clearTimeout(h)}},[e,t,s]),n}function Lue(e){const t=e?.clientHeight??0;return t>0?t:600}function que(e,t){const{root:n,disabled:a}=t,[s,p]=T.useState(a===!0),f=T.useRef(s);return f.current=s,T.useEffect(()=>{if(f.current)return;if(a===!0){p(!0);return}const m=e.current;if(!m||typeof IntersectionObserver!="function"){p(!0);return}const h=new IntersectionObserver(u=>{u.some(x=>x.isIntersecting)&&(p(!0),h.disconnect())},{root:n,rootMargin:`${Lue(n)}px`});return h.observe(m),()=>h.disconnect()},[e,n,a]),s}const Kd={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},Bue=T.memo(function({row:t,serverUrl:n,token:a,thumbPx:s,width:p,heroPx:f,fields:m,palette:h,nowMs:u,variant:x,iconId:w,kindLabels:C=x0,labels:E=Jp,scrollRoot:R,eagerImages:I,showAdminFlags:j,onClick:D}){const z=T.useRef(null),q=que(z,{root:R,...I===!0?{disabled:!0}:{}})?VN(n,t.bestEventId,s):null,Z=zue(q,a),J=Rce(t.className,YN(t)),$=x==="reel",F=f+Ap*2+Ep,de=Hce(t,C),we=de.tier!=="class",Ce=!we,Me=tue(de.text,f),Ae=m.label,oe=$ce(t,Ae,de.text,C),Te=LM(w),H=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:Z.status==="loading"?"events-skeleton":void 0,"data-testid":"card-image-backing",style:{position:"absolute",inset:0,background:Z.status==="failed"?`${J}22`:h.skeleton,boxShadow:`inset 0 0 0 1px ${h.border}`}}),Z.status==="ready"?v.jsx("img",{src:Z.src,alt:"",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null,m.label&&v.jsxs("div",{style:{position:"absolute",left:4,right:4,bottom:4,display:"flex",flexWrap:$?"nowrap":"wrap",gap:3,alignItems:"center",pointerEvents:"none"},children:[Ce&&v.jsx("span",{"data-testid":"card-class-glyph",title:Rp(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(Te,{size:13,color:"#fff"})}),we&&v.jsx("span",{"data-testid":"card-title",title:de.fullText??de.text,style:{background:"#000000B3",color:"#fff",fontSize:$?Uy: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:de.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(Kle,{size:13,color:"#fff"}),"?"]}),!$&&t.audioLabels.filter(me=>me!==t.className&&me!==t.label).map(me=>{const L=cu(me),te=LM(L);return v.jsx("span",{title:ZN(me,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${By}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(te,{size:13,color:"#fff"})},`audio-${me}`)})]}),(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:m.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:Kd,children:"✓"}),j===!0&&t.debug===!0&&t.reviewed!==!0&&v.jsx("span",{title:E.debug,style:Kd,children:"D"}),j===!0&&t.markForTrain===!0&&v.jsx("span",{title:E.train,style:Kd,children:"T"}),t.favourited===!0&&v.jsx("span",{title:E.favourite,style:{...Kd,color:"#fbbf24"},children:"★"})]}),m.badges&&t.active&&v.jsx("span",{title:E.active,style:{position:"absolute",top:4,right:4,width:8,height:8,borderRadius:999,background:"#22c55e",boxShadow:"0 0 0 2px rgba(0,0,0,0.35)"}}),m.badges&&!$&&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:p,height:F,minWidth:p,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:[H,v.jsxs("div",{style:{paddingTop:Ap,paddingBottom:Ap,paddingLeft:4,paddingRight:4,display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"100%",boxSizing:"border-box"},children:[m.camera&&t.producingDeviceName!==void 0&&v.jsx("span",{style:{fontSize:11,lineHeight:`${Ep}px`,fontWeight:600,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.producingDeviceName}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:`${Ep}px`,color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:_ce(t.lastSeen)})]})]});const ce=m.camera,ke=t.cameraName,Ee=ce||m.time||m.sublabel&&oe.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:p,display:"flex",flexDirection:"column",gap:4,padding:0,border:"none",background:"transparent",cursor:"pointer",textAlign:"left",font:"inherit",color:h.text,boxSizing:"border-box"},children:[H,Ee&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0,paddingTop:2,paddingBottom:2},children:[m.sublabel&&oe.length>0&&v.jsx("span",{style:{fontSize:11,color:h.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe}),ce&&v.jsx("span",{"data-testid":"card-camera",title:ke,style:{fontSize:12,fontWeight:600,lineHeight:"15px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:ke}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:"14px",color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",flex:"0 0 auto"},children:Tce(t.lastSeen,u)}),m.badges&&t.zonesVisited.length>0&&v.jsx("span",{style:{fontSize:10,color:h.textMuted,background:h.chip,borderRadius:5,padding:"1px 5px",alignSelf:"flex-start",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.zonesVisited.join(" · ")})]})]})});function n5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Uue(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 Fue(e){if(!n5(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(m=>typeof m=="string"&&m.length>0):[],s=Array.isArray(e.memberTrackIds)?e.memberTrackIds.filter(m=>typeof m=="string"&&m.length>0):[],p=typeof e.mediaUrl=="string"?e.mediaUrl:null,f=Uue(p)??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 Hue(e){if(!n5(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 $ue(e){const t=Hue(e),n=[];for(const a of t.groups){const s=Fue(a);s!==null&&n.push(s)}return{tracks:n,nextCursor:t.nextCursor}}function Que(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 $ue(n)}}function Vue(e){const t=e.trpcClient.pipelineAnalytics;return n=>t.listGroups.query(n)}function Gue(e,t="tracks"){return{listRecentTracks:t==="groups"?Que(Vue(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 Zue=2e3,Kue=1e3;function GC(e,t){const n=Math.max(1,Math.floor(e)),a=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(Zue/a));return Math.min(n,Kue,s)}function w0(e,t){return e.lastSeen!==t.lastSeen?t.lastSeen-e.lastSeen:e.trackId===t.trackId?0:e.trackId<t.trackId?1:-1}const bc={rows:[],cursor:null,exhausted:!1,rebuild:null},Wue=8;function Qy(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(w0)}function Yue(e,t,n){const a=e.rebuild;if(a===null)return{rows:Qy(e.rows,t),cursor:n,exhausted:n===null,rebuild:null};const s=Qy(a.rows,t),p=a.pages+1,f=s.length>=a.floor;return n===null||f||p>=Wue?{rows:s,cursor:n,exhausted:n===null,rebuild:null}:{...e,rebuild:{rows:s,cursor:n,exhausted:!1,floor:a.floor,pages:p}}}function Xue(e){return e.rows.length===0?bc:{...e,rebuild:{rows:[],cursor:null,exhausted:!1,floor:e.rows.length,pages:0}}}function Jue(e){return e.rebuild===null?e:{...e,rebuild:null}}function ede(e){return e.rebuild!==null}function ZC(e){return e.rebuild!==null?e.rebuild.cursor:e.cursor}function tde(e,t,n){const a=new Set(e.rows.map(p=>p.trackId));let s=0;for(const p of t)a.has(p.trackId)||(s+=1);return{state:{...e,rows:Qy(e.rows,t)},gap:n!==null,deltaCursor:n,added:s}}function nde(e){const t=e.rows[0];return t!==void 0?t.lastSeen:null}function KC(e,t){const n=e.rebuild??e;return!n.exhausted&&n.rows.length<Math.max(1,t)}function ade(e,t){return Math.max(0,e-Math.max(0,t))}function ide(e){const t=e.sinceMs??ade(e.anchorMs,e.maxAgeMs);return e.untilMs!==void 0?{since:t,until:e.untilMs}:{since:t}}function rde(e,t){return e===void 0||e>t}function a5(e,t){return t==="time"?e:[...e].sort((n,a)=>{const s=n.importance??-1,p=a.importance??-1;return s!==p?p-s:w0(n,a)})}function ode(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rs(e){return typeof e=="string"&&e.length>0?e:void 0}function sde(e,t){if(!ode(e))return null;const n=Rs(e.id),a=Rs(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=Rs(e.trackId),p=Rs(e.mediaKey),f=Rs(e.label),m=Rs(e.subLabel);return{trackId:s??n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...f!==void 0?{label:f}:{},...m!==void 0?{subLabel:m}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.timestamp,lastSeen:e.timestamp,state:"idle",active:!1,zonesVisited:[],zoneNames:[],classes:[a],audioLabels:[],bestEventId:p??s??n,score:e.score}}function lde(e,t){if(!Array.isArray(e))return[];const n=new Map;for(const a of e){const s=sde(a,t);if(s===null)continue;const p=n.get(s.trackId);(p===void 0||s.score>p.score)&&n.set(s.trackId,s)}return[...n.values()].sort((a,s)=>a.score!==s.score?s.score-a.score:s.lastSeen-a.lastSeen)}function cde(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 a5([...a.values()].sort(w0),n)}function ude(e,t){if(e.length===0)return e;const n=Math.max(1,Math.floor(t.rowsPerColumn)),a=Math.max(1,t.cardWidth+t.gap),s=Math.max(0,Math.floor(Math.max(0,t.scrollLeft)/a)),p=t.viewportWidth>0?t.viewportWidth:t.cardWidth,f=Math.max(s+1,Math.ceil((Math.max(0,t.scrollLeft)+p*2)/a));return e.slice(s*n,Math.min(e.length,f*n))}const dde=24,pde=12,mde=34;function fde(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,pde));const s=Math.max(1,Math.floor((t.viewportWidth+n)/(a+n))),p=(t.viewportWidth-(s-1)*n)/s,f=Math.max(1,p+mde+n),m=Math.max(0,Math.floor(Math.max(0,t.scrollTop)/f)),h=Math.max(1,Math.ceil(t.viewportHeight*2/f)),u=m*s,x=Math.min(e.length,u+Math.min(h*s,dde));return e.slice(u,x)}const hde=1,gde=["label","sublabel","camera","time","badges"];function _s(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 vde(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 Vy(e){if(e!==null)return e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function yde(e){if(e===null)return;const t=new Set((Vy(e)??[]).map(a=>a.toLowerCase())),n={};for(const a of gde)n[a]=t.has(a.toLowerCase());return n}function bde(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 Sde(e){if(e===null)return;const t={};if(e.trim()==="")return t;for(const n of e.split(",")){const a=n.indexOf(":");if(a<=0)continue;const s=n.slice(0,a).trim();if(!/^\d+$/.test(s))continue;let p;try{p=decodeURIComponent(n.slice(a+1))}catch{continue}p.trim().length!==0&&(t[s]=p)}return t}function WC(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 xde(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 kde(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 i5(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)!==hde)return{ok:!1,error:`unsupported events URL version "${n}"`};const s={},p=t.get("view");p!==null&&(s.view=p);const f=_s(t,"rows");f!==void 0&&(s.rows=f);const m=xde(t.get("cols"));m!==void 0&&(s.columns=m);const h=t.get("thumb");h!==null&&(s.thumbSize=h);const u=yde(t.get("fields"));u!==void 0&&(s.fields=u);const x=vde(t.get("devices"));x!==void 0&&(s.deviceIds=x);const w=Vy(t.get("classes"));w!==void 0&&(s.classes=w);const C=Vy(t.get("attrs"));C!==void 0&&(s.attrs=C);const E=t.get("q");E!==null&&(s.search=E);const R=_s(t,"page");R!==void 0&&(s.pageSize=R);const I=_s(t,"max");I!==void 0&&(s.maxRows=I);const j=_s(t,"refresh");j!==void 0&&(s.refreshMs=j);const D=_s(t,"age");D!==void 0&&(s.maxAgeMs=D);const z=t.get("theme");z!==null&&(s.theme=z);const B=t.get("sort");B!==null&&(s.sort=B);const q=t.get("smode");q!==null&&(s.searchMode=q);const Z=_s(t,"slimit");Z!==void 0&&(s.semanticLimit=Z);const J=t.get("sscore");if(J!==null&&J.trim()!==""){const Ce=Number.parseFloat(J);Number.isFinite(Ce)&&(s.semanticMinScore=Ce)}const $=WC(t,"since");$!==void 0&&(s.sinceMs=$);const F=WC(t,"until");F!==void 0&&(s.untilMs=F);const de=Sde(bde(e,"names"));de!==void 0&&(s.deviceNames=de);const we=$N.safeParse(s);return we.success?{ok:!0,patch:we.data}:{ok:!1,error:we.error.issues.map(Ce=>`${Ce.path.join(".")||"(root)"}: ${Ce.message}`).join("; ")}}function wde(e,t,n){const a=i5(e);if(a===null)return null;if(!a.ok)return{ok:!1,error:a.error};const s=kde(t);return s===null?null:QN({serverUrl:n,token:s,fields:BN,...a.patch})}function Mde(){const e=wde(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}function Cde(){const e=i5(location.search);return e===null||!e.ok?null:e.patch}function Ade(e,t){return!e.ok||t===null?e:{ok:!0,config:qy(e.config,t)}}const YC=5,XC=3,Ede=[300,900];let Rde=0;function _de(e){if(typeof e!="object"||e===null)return!1;const t=e;return"tracks"in t&&(t.nextCursor===null||typeof t.nextCursor=="string")}const Tde=/^(10\.|127\.|192\.168\.|169\.254\.|172\.(1[6-9]|2\d|3[01])\.)/;function Ide(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}`:Tde.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 Nde(e){const{client:t,deviceIds:n,nameById:a,pageSize:s,maxRows:p,refreshMs:f,maxAgeMs:m}=e,{sinceMs:h,untilMs:u,devicesResolved:x}=e,w=e.includeStationary===!0,[C,E]=T.useState(bc),[R,I]=T.useState(!1),[j,D]=T.useState(!1),[z,B]=T.useState(null),[q,Z]=T.useState(0),J=T.useRef(bc);J.current=C;const $=T.useRef(!1),F=T.useRef(!1),de=T.useRef(0),we=T.useRef(null),Ce=T.useRef(Date.now()),Me=T.useRef(a);Me.current=a;const Ae=T.useRef(e.channel);Ae.current=e.channel;const oe=T.useRef(null);T.useEffect(()=>{kue()},[]);const Te=n.join(","),H=T.useCallback(async(X,he=0)=>{const $e=`feed-${String(++Rde)}`,Ne=performance.now();try{const nt=await t.listRecentTracks(X),Ve=performance.now(),Xe=Hy(Ve-Ne,$y(Ne,Ve)),Re={requestId:$e,waitMs:Math.round(he),...Xe};return _de(nt)?{ok:!0,page:nt,timing:Re}:(si("request invalid",{...Re,channel:Ae.current}),{ok:!1,message:"unexpected response shape"})}catch(nt){const Ve=nt instanceof Error?nt.message:String(nt),Xe=performance.now();return si("listRecentTracks failed",{error:Ve,devices:X.deviceIds.length,limit:X.limit,since:X.since,cursor:X.cursor??null,requestId:$e,channel:Ae.current,waitMs:Math.round(he),...Hy(Xe-Ne,$y(Ne,Xe))}),{ok:!1,message:Ve}}},[t]),ce=T.useCallback((X,he)=>{si("request complete",{...X,channel:Ae.current,...he})},[]),ke=T.useCallback(()=>{if($.current){F.current=!0,oe.current===null&&(oe.current=performance.now());return}const X=J.current;if(!KC(X,p)||n.length===0)return;const he=oe.current;oe.current=null;const $e=he===null?0:performance.now()-he;$.current=!0,D(!0);const Ne=GC(s,n.length),nt=ide({anchorMs:Ce.current,maxAgeMs:m,...h!==void 0?{sinceMs:h}:{},...u!==void 0?{untilMs:u}:{}}),Ve=ZC(X)!==null;H({deviceIds:[...n],since:nt.since,limit:Ne,projection:"slim",...w?{includeStationary:!0}:{},...nt.until!==void 0?{until:nt.until}:{},...(()=>{const Xe=ZC(X);return Xe!==null?{cursor:Xe}:{}})()},$e).then(Xe=>{if(Xe.ok){const An=performance.now(),Yt=zC(Xe.page.tracks,Me.current),ln=Yue(J.current,Yt,Xe.page.nextCursor);J.current=ln,E(ln),ce(Xe.timing,{rows:Yt.length,devices:n.length,limit:Ne,paged:Ve,parseMs:Math.round(performance.now()-An)}),de.current=0,B(null),I(!0);return}const Re=de.current,Ke=Ede[Re];if(Re+1<XC&&Ke!==void 0){de.current=Re+1,si("page failed — retrying",{attempt:Re+1,of:XC,backoffMs:Ke}),we.current=setTimeout(()=>{we.current=null,Ee.current()},Ke);return}de.current=0;const vt=Jue(J.current);J.current=vt,E(vt),B(Xe.message),I(!0)}).finally(()=>{if($.current=!1,D(!1),ede(J.current)){Ee.current();return}F.current&&(F.current=!1,Ee.current())})},[H,ce,n,Te,s,p,m,h,u,w]),Ee=T.useRef(ke);Ee.current=ke;const me=T.useCallback(()=>{if($.current||n.length===0)return Promise.resolve();const X=nde(J.current);if(X===null)return ge.current(),Promise.resolve();$.current=!0;const he=GC(s,n.length);return(async()=>{let $e=null,Ne=0,nt=!0;for(;nt&&Ne<YC;){const Ve=await H({deviceIds:[...n],since:X,limit:he,projection:"slim",...w?{includeStationary:!0}:{},...u!==void 0?{until:u}:{},...$e!==null?{cursor:$e}:{}});if(!Ve.ok)return;const Xe=Ve.page,Re=performance.now(),Ke=zC(Xe.tracks,Me.current),vt=tde(J.current,Ke,Xe.nextCursor);J.current=vt.state,E(vt.state),ce(Ve.timing,{rows:Ke.length,devices:n.length,limit:he,paged:$e!==null,delta:!0,parseMs:Math.round(performance.now()-Re)}),B(null),nt=vt.gap,$e=vt.deltaCursor,Ne+=1}nt&&si("delta drain hit its page bound — newer rows may be missing",{since:X,pages:Ne,bound:YC})})().finally(()=>{$.current=!1,F.current&&(F.current=!1,Ee.current())})},[H,ce,n,Te,s,ke,u,w]),L=T.useCallback(()=>{we.current!==null&&(clearTimeout(we.current),we.current=null),de.current=0},[]),te=T.useCallback(()=>{L(),B(null),I(!1),Ee.current()},[L]),ge=T.useRef(()=>{}),Se=T.useCallback(()=>{L(),Ce.current=Date.now(),F.current=!1,J.current=bc,E(bc),I(!1),D(!1),B(null),Z(X=>X+1)},[L]),ee=T.useCallback(()=>{L(),Ce.current=Date.now(),F.current=!1;const X=Xue(J.current);J.current=X,E(X),X.rows.length===0&&I(!1),D(!1),B(null),Z(he=>he+1)},[L]),ye=`${Te}|${m}|${h??""}|${u??""}|${w?"1":"0"}`,Oe=T.useRef(ye);return T.useEffect(()=>{Oe.current!==ye&&(Oe.current=ye,!(J.current.rows.length===0&&!R)&&Se())},[ye,Se,R]),T.useEffect(()=>{if(n.length===0){x&&I(!0);return}ke()},[q,Te,x]),T.useEffect(()=>{if(f<=0||n.length===0||!rde(u,Date.now()))return;const X=setInterval(()=>{me()},f);return()=>clearInterval(X)},[f,me,n.length,u]),ge.current=te,T.useEffect(()=>L,[L]),{rows:C.rows,retry:te,loading:!R,loadingMore:j&&R,error:z,hasMore:KC(C,p),loadMore:ke,refresh:me,reload:ee}}const Ode=3,jde=250;function Pde(e){const{urls:t,token:n,paused:a,enabled:s}=e,p=T.useRef(0),f=T.useRef(0),m=T.useRef(!1),h=T.useRef(t),u=T.useRef(t[0]??"");h.current=t;const x=t[0]??"";u.current!==x&&(u.current=x,p.current=0),T.useEffect(()=>{if(m.current=!1,!s||a)return;let w=!1;const C=()=>{if(!(w||m.current))for(;f.current<Ode;){const E=h.current,R=p.current;if(R>=E.length)return;p.current=R+1;const I=E[R];I===void 0||I.length===0||(f.current+=1,Due(I,n).finally(()=>{f.current=Math.max(0,f.current-1),C()}))}};return C(),()=>{w=!0,m.current=!0}},[s,a,n,t.length])}const Dde=.5,r5=56,zde=88;function Lde(e){return e<=0?0:Math.min(e*Dde,zde)}function JC(e){return e>=r5}function qde(e,t,n){return e==="gallery"&&!t&&!n}function Bde(e){const{root:t,onRefresh:n,enabled:a}=e,[s,p]=T.useState(0),f=T.useRef(null),m=T.useRef(0);m.current=s;const h=T.useRef(n);h.current=n;const u=T.useCallback(()=>{f.current=null,p(0)},[]);return T.useEffect(()=>{if(!a||t===null)return;const x=R=>{if(t.scrollTop>0){f.current=null;return}const I=R.touches[0];f.current=I!==void 0?I.clientY:null},w=R=>{const I=f.current;if(I===null)return;const j=R.touches[0];if(j!==void 0){if(t.scrollTop>0){f.current=null,p(0);return}p(Lde(j.clientY-I))}},C=()=>{if(f.current===null)return;const R=m.current;u(),JC(R)&&h.current()},E={passive:!0};return t.addEventListener("touchstart",x,E),t.addEventListener("touchmove",w,E),t.addEventListener("touchend",C,E),t.addEventListener("touchcancel",u,E),()=>{t.removeEventListener("touchstart",x),t.removeEventListener("touchmove",w),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",u)}},[t,a,u]),{distance:s,armed:JC(s)}}const Wd=8,eA=10,Ude=400,Fde=8;function tA({message:e,palette:t}){return T.useEffect(()=>{Ia(sue(e)),Ia(_p("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 Hde({client:e,initialConfig:t}){const[n,a]=T.useState(t),[s,p]=T.useState({}),[f,m]=T.useState(()=>window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0),[h,u]=T.useState(()=>Date.now()),[x,w]=T.useState(null);T.useEffect(()=>{let xe=!1;return e.listDevices().then(_e=>{xe||w(_e)}).catch(()=>{xe||w([])}),()=>{xe=!0}},[e]);const C=T.useMemo(()=>{const xe=new Map;for(const _e of x??[])xe.set(_e.id,vce(_e.id,_e.name??`Camera ${_e.id}`,n.deviceNames));for(const[_e,Rt]of Object.entries(n.deviceNames)){const fn=Number(_e);Number.isInteger(fn)&&!xe.has(fn)&&Rt.trim().length>0&&xe.set(fn,Rt)}return xe},[x,n.deviceNames]),[E,R]=T.useState(()=>new Map),[I,j]=T.useState(()=>new Map),D=T.useMemo(()=>Ece(n.kindLabels),[n.kindLabels]),z=T.useMemo(()=>Yle(n.labels),[n.labels]),B=T.useMemo(()=>n.deviceIds.length>0?n.deviceIds:x===null?[]:Gce(x),[n.deviceIds,x]);T.useEffect(()=>{if(B.length===0)return;let xe=!1;return e.listEventKinds([...B]).then(_e=>{xe||(R(Mce(_e)),j(Cce(_e)))}).catch(()=>{si("event-kind taxonomy unavailable — class filter is exact-id only")}),()=>{xe=!0}},[e,B]);const q=Nde({client:e,deviceIds:B,nameById:C,pageSize:n.pageSize,maxRows:n.maxRows,refreshMs:n.refreshMs,maxAgeMs:n.maxAgeMs,channel:Ide(n.serverUrl),devicesResolved:n.deviceIds.length>0||x!==null,...n.showStationary?{includeStationary:!0}:{},...n.sinceMs!==void 0?{sinceMs:n.sinceMs}:{},...n.untilMs!==void 0?{untilMs:n.untilMs}:{}}),Z=n.searchMode==="semantic"?n.search.trim():"",[J,$]=T.useState({query:"",rows:[],loading:!1});T.useEffect(()=>{if(Z.length===0||B.length===0){$({query:"",rows:[],loading:!1});return}let xe=!1;return $(_e=>({..._e,query:Z,loading:!0})),e.searchObjectEvents({text:Z,limit:n.semanticLimit,minScore:n.semanticMinScore,...B.length===1&&B[0]!==void 0?{deviceId:B[0]}:{},...n.sinceMs!==void 0?{since:n.sinceMs}:{},...n.untilMs!==void 0?{until:n.untilMs}:{}}).then(_e=>{xe||$({query:Z,rows:lde(_e,C),loading:!1})}).catch(_e=>{xe||(si("searchObjectEvents failed",{error:_e instanceof Error?_e.message:String(_e)}),$({query:Z,rows:[],loading:!1}))}),()=>{xe=!0}},[e,Z,B,C,n.semanticLimit,n.semanticMinScore,n.sinceMs,n.untilMs]);const F=Z.length>0,de=T.useMemo(()=>new Set(n.reviewedTrackIds),[n.reviewedTrackIds]),we=xe=>de.size===0?[...xe]:xe.map(_e=>de.has(_e.trackId)?{..._e,reviewed:!0}:_e),Ce=T.useMemo(()=>we(BC(qC(q.rows,C),s)),[q.rows,C,de,s]),Me=T.useMemo(()=>we(BC(qC(J.rows,C),s)),[J.rows,C,de,s]),Ae=T.useMemo(()=>{const xe={debug:n.filterDebug,train:n.filterTrain,favourited:n.filterFavourited,reviewedTrackIds:n.reviewedTrackIds},_e=LC(Ce,n.classes,n.search,E,n.attrs,xe);if(F){const Rt=LC(Me,n.classes,"",E,n.attrs,xe);return cde(Rt,_e,n.sort)}return a5(_e,n.sort)},[F,Me,Ce,n.classes,n.attrs,n.filterDebug,n.filterTrain,n.filterFavourited,n.reviewedTrackIds,n.search,n.sort,E]),oe=KN(n.theme,f),Te=T.useRef(null),[H,ce]=T.useState(null),ke=T.useRef(null),Ee=T.useRef(q.loadMore);Ee.current=q.loadMore;const me=T.useRef(q.refresh);me.current=q.refresh;const L=T.useRef(q.reload);L.current=q.reload;const te=T.useCallback(xe=>{if(xe.type==="setConfig"){a(_e=>qy(_e,xe.patch));return}if(xe.type==="setWindow"){a(_e=>qy(_e,gue(xe)));return}if(xe.type==="setTrackFlagPatches"){p(xe.patches);return}if(xe.type==="refresh"){me.current().finally(()=>Ia(pue()));return}if(xe.type==="reload"){L.current();return}if(xe.type==="loadMore"){Ee.current();return}if(xe.type==="ping"){Ia(uue());return}Te.current?.scrollTo({top:0,left:0,behavior:"smooth"})},[]);T.useEffect(()=>(window.__camstackEvents={setConfig:xe=>{const _e=Zd({type:"setConfig",patch:xe});_e!==null&&te(_e)},setWindow:xe=>{const _e=Zd({type:"setWindow",...xe});_e!==null&&te(_e)},setTrackFlagPatches:xe=>{const _e=Zd({type:"setTrackFlagPatches",patches:xe});_e!==null&&te(_e)},refresh:()=>te({type:"refresh"}),reload:()=>te({type:"reload"}),loadMore:()=>te({type:"loadMore"}),scrollToTop:()=>te({type:"scrollToTop"}),ping:()=>te({type:"ping"})},uu(xe=>{const _e=Zd(xe);_e!==null&&te(_e)})),[te]),T.useEffect(()=>{Ia(oue(n.view))},[]),T.useEffect(()=>{Ia(F?HC(J.rows.length,Ae.length,!1,"semantic"):HC(q.rows.length,Ae.length,q.hasMore,"feed"))},[q.rows.length,Ae.length,q.hasMore,F,J.rows.length]);const ge=Ae.map(xe=>xe.trackId).join("|");T.useEffect(()=>{Ia(cue(Ae.map(xe=>({trackId:xe.trackId,deviceId:xe.deviceId,bestEventId:xe.bestEventId,className:xe.className,firstSeen:xe.firstSeen,lastSeen:xe.lastSeen}))))},[ge]),T.useEffect(()=>{if(q.error!==null&&!F){Ia(_p("error",q.error));return}if(F?J.loading:q.loading){Ia(_p("loading"));return}Ia(_p(Ae.length===0?"empty":"ready"))},[q.loading,q.error,Ae.length,F,J.loading]),T.useEffect(()=>{const xe=window.matchMedia?.("(prefers-color-scheme: dark)");if(!xe)return;const _e=Rt=>m(Rt.matches);return xe.addEventListener("change",_e),()=>xe.removeEventListener("change",_e)},[]),T.useEffect(()=>{document.documentElement.style.colorScheme=oe.colorScheme,document.body.style.background=oe.background},[oe]),T.useEffect(()=>{const xe="camstack-events-keyframes";if(document.getElementById(xe)!==null)return;const _e=document.createElement("style");_e.id=xe,_e.textContent="@keyframes camstack-spin{to{transform:rotate(360deg)}}",document.head.appendChild(_e)},[]),T.useEffect(()=>{const xe=setInterval(()=>u(Date.now()),6e4);return()=>clearInterval(xe)},[]);const Se=Ae.length>0;T.useEffect(()=>{const xe=Te.current,_e=ke.current;if(!xe||!_e||F||!Se)return;const Rt=new IntersectionObserver(fn=>{fn.some(We=>We.isIntersecting)&&Ee.current()},{root:xe,rootMargin:`${Ude}px`});return Rt.observe(_e),()=>Rt.disconnect()},[n.view,q.hasMore,F,Se]);const ee=T.useRef(0);T.useEffect(()=>{if(F||q.loading||q.loadingMore||!q.hasMore)return;const xe=Te.current;if(!xe||Ae.length===0)return;const _e=n.view==="reel";if((_e?xe.clientWidth:xe.clientHeight)===0)return;if(_e?xe.scrollWidth>xe.clientWidth+1:xe.scrollHeight>xe.clientHeight+1){ee.current=0;return}ee.current>=Fde||(ee.current+=1,Ee.current())},[Ae.length,q.loading,q.loadingMore,q.hasMore,F,n.view]);const ye=Bde({root:H,enabled:qde(n.view,F,n.nativePullToRefresh),onRefresh:()=>{me.current()}}),Oe=T.useRef(null);T.useEffect(()=>{const xe=H;if(!n.nativePullToRefresh||xe===null){Oe.current=null;return}const _e=()=>{const Rt=n.view==="gallery"&&!F&&xe.scrollTop<=0;Oe.current!==Rt&&(Oe.current=Rt,Ia(due(Rt)))};return _e(),xe.addEventListener("scroll",_e,{passive:!0}),()=>xe.removeEventListener("scroll",_e)},[H,n.nativePullToRefresh,n.view,F]);const X=S0(n.thumbSize),he=gce(n.thumbSize),$e=pce(n.thumbSize,window.devicePixelRatio||1),Ne=n.view==="reel",[nt,Ve]=T.useState(!1),[Xe,Re]=T.useState({scrollLeft:0,scrollTop:0,viewportWidth:0,viewportHeight:0});T.useEffect(()=>{const xe=H;if(xe===null)return;let _e=null;const Rt=()=>{Re({scrollLeft:xe.scrollLeft,scrollTop:xe.scrollTop,viewportWidth:xe.clientWidth,viewportHeight:xe.clientHeight})},fn=()=>{Rt(),Ve(!0),_e!==null&&clearTimeout(_e),_e=setTimeout(()=>Ve(!1),jde)};return Rt(),xe.addEventListener("scroll",fn,{passive:!0}),window.addEventListener("resize",Rt),()=>{xe.removeEventListener("scroll",fn),window.removeEventListener("resize",Rt),_e!==null&&clearTimeout(_e)}},[H]);const Ke=T.useMemo(()=>Ne?ude(Ae,{scrollLeft:Xe.scrollLeft,viewportWidth:Xe.viewportWidth,cardWidth:X,gap:Wd,rowsPerColumn:n.rows}):fde(Ae,{scrollTop:Xe.scrollTop,viewportWidth:Xe.viewportWidth,viewportHeight:Xe.viewportHeight,cardWidth:X,gap:Wd}),[Ne,Ae,Xe,X,n.rows]),vt=T.useMemo(()=>Ke.map(xe=>VN(n.serverUrl,xe.bestEventId,$e)),[Ke,n.serverUrl,$e]);Pde({urls:vt,token:n.token,paused:nt,enabled:!q.loading&&Ae.length>0});const An=T.useCallback(xe=>{Ia(lue({trackId:xe.trackId,deviceId:xe.deviceId,bestEventId:xe.bestEventId,className:xe.className,firstSeen:xe.firstSeen,lastSeen:xe.lastSeen}))},[]),Yt=Ne?{display:"grid",gridTemplateRows:`repeat(${n.rows}, ${he}px)`,gridAutoFlow:"column",gridAutoColumns:`${X}px`,gap:Wd,alignContent:"start"}:{display:"grid",gridTemplateColumns:n.columns==="auto"?`repeat(auto-fill, minmax(${X}px, 1fr))`:`repeat(${n.columns}, minmax(0, 1fr))`,gap:Wd,alignContent:"start"},ln=F?J.loading:q.loading,Oa=!F&&q.loadingMore&&Ae.length>0,Va=!F&&!q.hasMore&&!q.loadingMore&&Ae.length>0,Ki=!F&&q.error!==null,tn=!ln&&!Ki&&Ae.length===0;return v.jsxs("div",{ref:xe=>{Te.current=xe,ce(_e=>_e===xe?_e:xe)},"data-testid":"events-scroller",className:Ne?"events-reel-scroller":void 0,style:{position:"fixed",inset:0,background:oe.background,color:oe.text,fontFamily:"system-ui, -apple-system, sans-serif",overflowX:Ne?"auto":"hidden",overflowY:Ne?"hidden":"auto",padding:Ne?`${hce}px ${eA}px`:eA,boxSizing:"border-box",WebkitOverflowScrolling:"touch"},children:[ye.distance>0&&v.jsx("div",{"data-testid":"pull-indicator","data-armed":ye.armed?"true":"false","aria-hidden":!0,style:{position:"absolute",top:Math.max(0,ye.distance-28),left:0,right:0,display:"flex",justifyContent:"center",pointerEvents:"none",zIndex:2,opacity:Math.min(1,ye.distance/r5)},children:v.jsx("span",{style:{width:22,height:22,borderRadius:999,border:`2px solid ${oe.chip}`,borderTopColor:oe.textMuted,background:oe.card,boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transform:`rotate(${ye.distance*4}deg)`,animation:q.loadingMore?"camstack-spin 700ms linear infinite":void 0}})}),Ki&&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:Gd(n,"error")}),v.jsx("button",{type:"button","data-testid":"state-retry",onClick:()=>q.retry(),style:{marginTop:10,font:"inherit",fontSize:12,color:oe.text,background:oe.card,border:`1px solid ${oe.border}`,borderRadius:8,padding:"5px 14px",cursor:"pointer"},children:Gd(n,"retry")})]}),tn&&v.jsx("div",{"data-testid":"state-empty",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:oe.textMuted,fontSize:13},children:Gd(n,"empty")}),ln&&Ae.length===0&&v.jsx("div",{"data-testid":"state-loading",style:Yt,children:Array.from({length:Ne?8:12},(xe,_e)=>v.jsx("div",{style:{width:Ne?X:"100%",height:Ne?he:void 0,aspectRatio:Ne?void 0:"1 / 1",borderRadius:10,background:oe.skeleton,border:`1px solid ${oe.border}`,boxSizing:"border-box",opacity:.6}},`skeleton-${_e}`))}),v.jsxs("div",{style:Yt,children:[Ae.map((xe,_e)=>v.jsx(Bue,{row:xe,eagerImages:!Ne&&_e<8,serverUrl:n.serverUrl,token:n.token,thumbPx:$e,width:Ne?`${X}px`:"100%",heroPx:X,variant:Ne?"reel":"gallery",iconId:Ace(xe.className,I,YN(xe)),kindLabels:D,labels:z,scrollRoot:H,fields:n.fields,showAdminFlags:n.showAdminFlags===!0,palette:oe,nowMs:h,onClick:An},xe.trackId)),Oa&&v.jsx("div",{"data-testid":"tail-loading","aria-label":z.loadingMore,style:{width:Ne?X:"100%",height:Ne?he:void 0,aspectRatio:Ne?void 0:"1 / 1",borderRadius:10,background:oe.skeleton,border:`1px solid ${oe.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 ${oe.chip}`,borderTopColor:oe.textMuted,animation:"camstack-spin 700ms linear infinite"}})}),Va&&v.jsx("div",{"data-testid":"tail-end",style:{display:"flex",alignItems:"center",justifyContent:"center",color:oe.textMuted,fontSize:11,opacity:.75,padding:Ne?"0 12px":"10px 0",width:Ne?"max-content":"100%",height:Ne?X:void 0,gridColumn:Ne?"auto":"1 / -1",whiteSpace:"nowrap"},children:Gd(n,"end")}),v.jsx("div",{ref:ke,style:{width:1,height:1,gridRow:Ne?1:"auto"},"aria-hidden":!0})]})]})}function $de(){const e=Rm("events",()=>window.__CAMSTACK_EVENTS__,QN,Mde,{urlFirst:!0}),t=T.useMemo(()=>Cde(),[]),n=T.useMemo(()=>e===null?null:Ade(e,t),[e,t]),a=T.useMemo(()=>{if(n===null||!n.ok)return null;const p=vm({serverUrl:n.config.serverUrl,token:n.config.token});return{system:p,client:Gue(p,n.config.entity)}},[n]);T.useEffect(()=>{if(a)return()=>a.system.close()},[a]);const s=KN(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(Hde,{client:a.client,initialConfig:n.config}):v.jsx(tA,{message:"Failed to initialise the events embed",palette:s}):v.jsx(tA,{message:n.error,palette:s})}const nm={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"},Qde=Object.keys(nm),Vde=Y(o(),o()).optional();function Gde(e){if(e===null||typeof e!="object")return nm;const t=e,n={...nm};for(const a of Qde){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return n}const o5=O(["auto","high","mid","low"]).catch("auto"),Zde=it([V("auto"),l().int().min(1)]),s5=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()}),dv=O(["off","top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"]),Kde=d({motionBoxes:A().optional(),motionBadge:dv.optional(),audioMeter:dv.optional(),occupancy:dv.optional(),stats:A().optional()}),Wde=d({cw:l(),ch:l()}),Yde=d({serverUrl:o().min(1),token:o().min(1),devices:M(l().int().nonnegative()).min(1),layout:Zde,quality:o5,showName:A(),showBadges:A(),muted:A(),paused:A(),highlight:s5.optional(),activeOnly:A().optional(),showBoxes:A().optional(),audioOnIds:M(l().int().nonnegative()).optional(),pausedIds:M(l().int().nonnegative()).optional(),snapshots:Y(o(),o()).optional(),ptzIds:M(l().int().nonnegative()).optional(),overlays:Y(o(),Kde).optional(),editable:A().optional(),spans:Y(o(),Wde).optional(),labels:Vde});function l5(e){if(e==null)return{ok:!1,error:"config is required"};const t=Yde.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 Xde=1,c5=O(["auto","high","mid","low"]),Jde=it([V("auto"),l().int().min(1)]),u5=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()}),epe=d({devices:M(l().int().nonnegative()).min(1),layout:Jde,quality:c5,showName:A(),audioOnIds:M(l().int().nonnegative()).optional(),activeOnly:A().optional(),boxes:A().optional(),highlight:u5.optional()}),tpe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function npe(e){let t="",n=0;for(;n<e.length;){const a=e[n];if(a===void 0)return null;let s,p;if(a<128)s=a,p=0;else if((a&224)===192)s=a&31,p=1;else if((a&240)===224)s=a&15,p=2;else if((a&248)===240)s=a&7,p=3;else return null;for(let f=1;f<=p;f++){const m=e[n+f];if(m===void 0||(m&192)!==128)return null;s=s<<6|m&63}n+=p+1,t+=String.fromCodePoint(s)}return t}function ape(e){if(e.length%4===1)return null;const t=[];for(const s of e){const p=tpe.indexOf(s);if(p<0)return null;t.push(p)}const n=[];for(let s=0;s<t.length;s+=4){const p=t[s],f=t[s+1];if(p===void 0||f===void 0)return null;const m=t[s+2],h=t[s+3];n.push(p<<2|f>>4),m!==void 0&&n.push((f&15)<<4|m>>2),h!==void 0&&m!==void 0&&n.push((m&3)<<6|h)}const a=npe(n);if(a===null)return null;try{return JSON.parse(a)}catch{return null}}function M0(e,t){return e.startsWith(t)?e.slice(t.length):e}function d5(e){const n=new URLSearchParams(M0(e,"#")).get("t");return n!==null&&n.length>0?n:null}function ipe(e,t){return new URLSearchParams(M0(e,"?")).has("v")||d5(t)!==null}function nA(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 Ua(e){return{ok:!1,error:e}}function rpe(e,t){const n=new URLSearchParams(M0(e,"?")),a=n.get("mode");if(a!==null&&a!=="grid")return Ua(`unsupported mode "${a}"`);const s=n.get("v");if(s===null)return Ua("missing share-link version (v)");if(s!==String(Xde))return Ua(`unsupported share-link version "${s}"`);const p=n.get("devices"),f=p===null?null:nA(p);if(f===null||f.length===0)return Ua("invalid or missing devices list");const m=n.get("layout");let h;if(m===null||m==="auto")h="auto";else if(/^\d+$/.test(m)&&Number(m)>=1)h=Number(m);else return Ua(`invalid layout "${m}"`);const u=n.get("q")??"auto",x=c5.safeParse(u),w=x.success?x.data:"auto",C=n.get("names")??"0";if(C!=="0"&&C!=="1")return Ua(`invalid names flag "${C}"`);const E=n.get("audio");let R;if(E!==null){const $=nA(E);if($===null)return Ua(`invalid audio list "${E}"`);R=$}const I=n.get("activeOnly");if(I!==null&&I!=="0"&&I!=="1")return Ua(`invalid activeOnly flag "${I}"`);const j=I==="1",D=n.get("boxes");if(D!==null&&D!=="0"&&D!=="1")return Ua(`invalid boxes flag "${D}"`);const z=D==="1",B=n.get("hl");let q;if(B!==null){const $=ape(B),F=u5.safeParse($);if($===null||!F.success)return Ua("invalid highlight config (hl)");q=F.data}const Z={devices:[...f],layout:h,quality:w,showName:C==="1",...R!==void 0&&R.length>0?{audioOnIds:[...R]}:{},...j?{activeOnly:!0}:{},...z?{boxes:!0}:{},...q!==void 0?{highlight:q}:{}},J=epe.safeParse(Z);return J.success?{ok:!0,params:J.data,token:d5(t)}:Ua(J.error.issues.map($=>`${$.path.join(".")||"(root)"}: ${$.message}`).join("; "))}function ope(e,t,n){if(!ipe(e,t))return null;const a=rpe(e,t);if(!a.ok)return{ok:!1,error:a.error};if(a.token===null)return{ok:!1,error:"share token missing — the link must end with #t=<token>"};const s=a.params,p={serverUrl:n,token:a.token,devices:[...s.devices],layout:s.layout,quality:s.quality,showName:s.showName,showBadges:!0,muted:!0,paused:!1,...s.highlight!==void 0?{highlight:s.highlight}:{},...s.activeOnly===!0?{activeOnly:!0}:{},...s.boxes===!0?{showBoxes:!0}:{},...s.audioOnIds!==void 0&&s.audioOnIds.length>0?{audioOnIds:[...s.audioOnIds]}:{}};return l5(p)}function spe(){const e=ope(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}const am=16/9,aA={cols:0,rows:0,cellW:0,cellH:0,wallW:0,wallH:0};function iA(e,t,n,a,s){const p=Math.min(a/e,s/t*am),f=p/am;return{cols:e,rows:t,cellW:p,cellH:f,wallW:Math.min(e,n)*p,wallH:t*f,empty:e*t-n}}function rA(e){return{cols:e.cols,rows:e.rows,cellW:e.cellW,cellH:e.cellH,wallW:e.wallW,wallH:e.wallH}}const oA=1e-9;function lpe(e,t){const n=e.cellW*e.cellH,a=t.cellW*t.cellH,s=Math.max(n,a,1);return n-a>s*oA?!0:a-n>s*oA?!1:e.empty!==t.empty?e.empty<t.empty:e.rows<t.rows}function cpe(e,t,n,a){if(e<=0||t<=0||n<=0)return aA;if(typeof a=="number"&&a>=1){const p=Math.floor(a);return rA(iA(p,Math.ceil(e/p),e,t,n))}let s=null;for(let p=1;p<=e;p++){const f=Math.ceil(e/p);if(Math.ceil(e/f)!==p)continue;const m=iA(f,p,e,t,n);(s===null||lpe(m,s))&&(s=m)}return s===null?aA:rA(s)}function upe(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 dpe(e,t){if(e.length===0||t.cellW<=0||t.cellH<=0)return[];const n=[];return upe(e,t.cols).forEach((s,p)=>{const f=(t.wallW-s.length*t.cellW)/2;s.forEach((m,h)=>{n.push({deviceId:m,x:f+h*t.cellW,y:p*t.cellH,w:t.cellW,h:t.cellH})})}),n}const sA={wallW:0,wallH:0,placements:[]};function ppe(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 mpe(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 fpe(e,t,n){const a=new Set,s=[];let p=0;const f=(m,h,u,x)=>{for(let w=m;w<m+x;w++)for(let C=h;C<h+u;C++)if(a.has(`${w}:${C}`))return!1;return!0};for(const m of e){const{cw:h,ch:u}=ppe(t[String(m)],n),x=p+u+e.length;let w=!1;for(let C=0;C<=x&&!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 I=E;I<E+h;I++)a.add(`${R}:${I}`);s.push({deviceId:m,col:E,row:C,cw:h,ch:u}),p=Math.max(p,C+u),w=!0;break}}return{cells:s,rows:p,cols:n}}function hpe(e,t,n,a,s){const p=cpe(e.length,t,n,a);if(!mpe(s)||p.cols<=0)return{wallW:p.wallW,wallH:p.wallH,placements:dpe(e,p)};if(e.length===0||t<=0||n<=0)return sA;const f=fpe(e,s??{},p.cols);if(f.rows<=0)return sA;const m=Math.min(t/f.cols,n/f.rows*am),h=m/am;return{wallW:f.cells.reduce((x,w)=>Math.max(x,w.col+w.cw),0)*m,wallH:f.rows*h,placements:f.cells.map(x=>({deviceId:x.deviceId,x:x.col*m,y:x.row*h,w:x.cw*m,h:x.ch*h}))}}function p5(){const[e,t]=T.useState(null),[n,a]=T.useState("idle"),s=T.useRef(null),p=T.useRef(null),f=T.useRef(null),m=T.useRef(0),h=T.useRef(null),u=_te(),x=Tte(),w=Ite(),C=T.useRef({start:u.mutateAsync,answer:x.mutateAsync,stop:w.mutateAsync});C.current={start:u.mutateAsync,answer:x.mutateAsync,stop:w.mutateAsync};const E=T.useCallback(()=>{if(s.current){try{s.current.close()}catch{}s.current=null}if(p.current){for(const D of p.current.getTracks())try{D.stop()}catch{}p.current=null}},[]),R=T.useCallback(async()=>{const D=f.current;if(f.current=null,E(),D)try{await C.current.stop({deviceId:D.deviceId,sessionId:D.sessionId})}catch{}},[E]),I=T.useCallback(async D=>{if(h.current===D){m.current+=1,h.current=null,t(null),a("idle"),await R();return}m.current+=1;const z=m.current;h.current=D,t(D),a("starting");let B;try{B=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{z===m.current&&(h.current=null,t(null),a("error"));return}if(z!==m.current){for(const Z of B.getTracks())Z.stop();return}if(await R(),z!==m.current){for(const Z of B.getTracks())Z.stop();return}let q=null;try{p.current=B;const Z=await C.current.start({deviceId:D});if(z!==m.current){try{await C.current.stop({deviceId:D,sessionId:Z.sessionId})}catch{}E();return}f.current={deviceId:D,sessionId:Z.sessionId},q=new RTCPeerConnection,s.current=q,q.oniceconnectionstatechange=()=>{if(z!==m.current||!q)return;const $=q.iceConnectionState;$==="connected"||$==="completed"?a("talking"):($==="failed"||$==="closed"||$==="disconnected")&&(h.current=null,t(null),a("idle"),R())};for(const $ of B.getAudioTracks())q.addTrack($,B);await q.setRemoteDescription({type:"offer",sdp:Z.sdpOffer});const J=await q.createAnswer();if(await q.setLocalDescription(J),z!==m.current)return;await C.current.answer({deviceId:D,sessionId:Z.sessionId,sdpAnswer:q.localDescription?.sdp??J.sdp??""})}catch{if(q)try{q.close()}catch{}E();const Z=f.current;if(f.current=null,Z)try{await C.current.stop({deviceId:Z.deviceId,sessionId:Z.sessionId})}catch{}z===m.current&&(h.current=null,t(null),a("error"))}},[R,E]),j=T.useCallback(D=>{if(D===null){m.current+=1,h.current=null,t(null),a("idle"),R();return}h.current!==D&&I(D)},[R,I]);return T.useEffect(()=>()=>{m.current+=1,R()},[R]),{activeMicId:e,micState:n,toggleMic:D=>{I(D)},setActiveMic:j}}const gpe=6e3,vpe=500;function ype(e,t){const n=T.useRef(new Map),[,a]=T.useState(0),s=t?.motion??!1,p=t?.audio??"off",f=t?.audioDb??-30,m=t?.audioHoldSec??5,h=t?.detection??!1,u=t?.detectionHoldSec??3,x=t?.detectionClasses??[],w=(R,I)=>{n.current.set(R,Date.now()+I),a(j=>j+1)};li(Ze.MotionOnMotionChanged,R=>{if(!s)return;const I=R.data;I&&I.detected&&w(I.deviceId,gpe)}),li(Ze.PipelineAudioInferenceResult,R=>{if(p==="off")return;const I=R.data;if(!I)return;(p==="sensor"?I.frame.detections.length>0:(I.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=f)&&w(I.deviceId,m*1e3)}),li(Ze.DetectionResult,R=>{if(!h)return;const I=R.data;if(!I)return;I.frame.detections.some(D=>x.length===0||x.includes(D.macroClass))&&w(I.frame.deviceId,u*1e3)}),T.useEffect(()=>{const R=setInterval(()=>a(I=>I+1),vpe);return()=>clearInterval(R)},[]);const C=Date.now(),E=new Set;for(const R of e){const I=n.current.get(R);I!==void 0&&C<I&&E.add(R)}return E}function bpe(e){return{type:"tileOpen",deviceId:e}}function Spe(e){return{type:"audioToggle",deviceId:e}}function xpe(e){return{type:"pauseToggle",deviceId:e}}function kpe(e){return{type:"ptzOpen",deviceId:e}}function wpe(e,t){return{type:"cellPanelOpen",deviceId:e,panel:t}}function Mpe(e){return{type:"tileRemove",deviceId:e}}function Cpe(e,t,n){return{type:"tileResize",deviceId:e,cw:t,ch:n}}function m5(e,t,n){return{type:"state",state:e,...t!==void 0?{message:t}:{},...n!==void 0?{commands:n}:{}}}function Ape(e){return{type:"layout",tiles:e}}function ri(e){on(e)}const Epe=["top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"];function lA(e){return typeof e=="string"&&Epe.includes(e)}const Rpe={"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 f5(e){return{position:"absolute",display:"flex",...Rpe[e]}}const h5=[-60,-53,-46,-39,-32,-24],_pe=h5.length,pv=["#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444"];function Tpe(e){const t=Math.min(Math.max(0,e),pv.length-1);return pv[t]??pv[0]}function Ipe(e){if(e===null||!Number.isFinite(e))return 0;let t=0;for(const n of h5)e>=n&&(t+=1);return t}function Npe(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 cA=[8,11,14,17,21,26],mv={horizontal:{width:8,height:16},vertical:{width:24,height:7},compactWidth:4};function Ope(e,t){if(e==="vertical")return mv.vertical;if(e==="horizontal")return mv.horizontal;const n=cA[t]??cA[0];return{width:mv.compactWidth,height:n}}function jpe(e){const t=Array.from({length:_pe},(n,a)=>a);return e==="vertical"?[...t].reverse():t}function ko(e){return typeof e=="object"&&e!==null}function Ppe(e){if(!ko(e))return[];if(e.detected!==!0)return[];const t=typeof e.frameWidth=="number"?e.frameWidth:0,n=typeof e.frameHeight=="number"?e.frameHeight:0;if(t<=0||n<=0)return[];const a=e.regions;if(!Array.isArray(a))return[];const s=[];for(const p of a){if(!ko(p)||!ko(p.bbox))continue;const{x:f,y:m,w:h,h:u}=p.bbox;typeof f!="number"||typeof m!="number"||typeof h!="number"||typeof u!="number"||!(h>0)||!(u>0)||s.push({x:f/t,y:m/n,w:h/t,h:u/n,pixelCount:typeof p.pixelCount=="number"?p.pixelCount:0})}return s}function Dpe(e){return!Number.isFinite(e)||e<=0?.08:Math.min(.28,.08+e/4e3*.28)}function uA(e){if(!ko(e))return[];const t=ko(e.frame)?e.frame.byClass:void 0,n=ko(t)?t:e.byClass;if(!ko(n))return[];const a=[];for(const[s,p]of Object.entries(n))typeof p!="number"||!Number.isFinite(p)||p<=0||a.push({className:s,count:Math.round(p)});return a.sort((s,p)=>p.count-s.count||s.className.localeCompare(p.className))}function zpe(e,t,n){if(n<=0)return 0;const a=t-e;return a<=0?0:Math.round(a*1e3/n)}function Lpe(e){if(e===null)return"—";const t=[e.resolution,`${e.fps}fps`];return e.dropped>0&&t.push(`${e.dropped} dropped`),t.join(" · ")}const qpe=1200,Bpe=1e3;function Upe({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return li(Ze.MotionAnalysis,s=>{const p=s.data;!p||p.deviceId!==e||(n(Ppe(p)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),qpe))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>v.jsx("div",{style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,border:"1px dashed #f59e0b",borderRadius:2,background:`rgba(245,158,11,${Dpe(s.pixelCount)})`}},`${s.x}:${s.y}:${s.w}:${s.h}:${p}`))})}function Fpe({deviceId:e,anchor:t}){const[n,a]=T.useState(null);li(Ze.PipelineAudioInferenceResult,h=>{const u=h.data;!u||u.deviceId!==e||a(u.frame.level?.dbfs??null)});const s=Ipe(n),p=Npe(t);if(p===null)return null;const f=p==="horizontal",m=p==="vertical";return v.jsx("div",{style:{...f5(t),pointerEvents:"none"},children:v.jsx("span",{style:{display:"flex",flexDirection:m?"column":"row",alignItems:m||f?"center":"flex-end",gap:m||f?4:3,padding:f||m?"4px 8px":"3px 6px",borderRadius:8,background:"rgba(0,0,0,0.7)"},children:jpe(p).map(h=>{const u=h<s,x=Ope(p,h);return v.jsx("span",{style:{width:x.width,height:x.height,borderRadius:2,background:u?Tpe(h):"#71717a",opacity:u?1:.35}},h)})})})}function Hpe(e,t){if(typeof e!="object"||e===null)return null;const n=Reflect.get(e,"zoneAnalytics");if(typeof n!="object"||n===null)return null;const a=Reflect.get(n,"getCurrentSnapshot");if(typeof a!="object"||a===null)return null;const s=Reflect.get(a,"query");if(typeof s!="function")return null;const p=s.call(a,{deviceId:t});return p instanceof Promise?p:Promise.resolve(p)}function $pe({system:e,deviceId:t,anchor:n}){const[a,s]=T.useState([]);return T.useEffect(()=>{let p=!1;const f=Hpe(e.trpcClient,t);if(f!==null)return f.then(m=>{p||s(uA(m))}).catch(()=>{p||s([])}),()=>{p=!0}},[e,t]),li(Ze.ZoneAnalyticsOccupancyChanged,p=>{const f=p.data;f.deviceId===t&&s(uA(f))}),a.length===0?null:v.jsx("div",{style:{...f5(n),gap:4,pointerEvents:"none"},children:a.slice(0,4).map(p=>v.jsx("span",{style:{padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.75)",color:"#fafaf9",fontSize:11,fontWeight:700,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap"},children:`${p.className} ${p.count}`},p.className))})}function Qpe({containerRef:e}){const[t,n]=T.useState(null),a=T.useRef(null);return T.useEffect(()=>{const s=()=>{const f=e.current?.querySelector("video");if(!f){n(null);return}const m=typeof f.getVideoPlaybackQuality=="function"?f.getVideoPlaybackQuality():null,h=m?.totalVideoFrames??0,u=Date.now(),x=a.current;a.current={frames:h,at:u},n({resolution:f.videoWidth>0?`${f.videoWidth}x${f.videoHeight}`:"—",fps:x===null?0:zpe(x.frames,h,u-x.at),dropped:m?.droppedVideoFrames??0})};s();const p=setInterval(s,Bpe);return()=>{clearInterval(p),a.current=null}},[e]),v.jsx("div",{style:{position:"absolute",top:4,right:4,maxWidth:"90%",padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.7)",color:"#fafaf9",fontSize:10,fontWeight:600,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},children:Lpe(t)})}const Vpe=1e4,dA=1e3,pA=[0,5e3,15e3,3e4],Gpe=4;function Zpe(e){const t=Math.max(0,Math.min(e,pA.length-1));return pA[t]??0}function Kpe(e){return!e.playing||e.lastFrameAt===null?!1:e.nowMs-e.lastFrameAt>=e.stallMs}function Wpe(e){const{containerRef:t,playing:n,onRecover:a,stallMs:s=Vpe}=e,p=e.now??Date.now,[f,m]=T.useState({recovering:!1,attempts:0}),h=T.useRef(null),u=T.useRef(0),x=T.useRef(0),w=T.useRef(a);w.current=a;const C=T.useRef(p);C.current=p;const E=T.useCallback(()=>{const R=C.current(),I=h.current;h.current=R,u.current>0&&I!==null&&R-I<s&&(u.current=0,m({recovering:!1,attempts:0}))},[s]);return T.useEffect(()=>{if(!n){h.current=null;return}const I=t.current?.querySelector("video");if(!I)return;let j=!1,D=null;if(typeof I.requestVideoFrameCallback=="function"){const q=()=>{j||(E(),D=I.requestVideoFrameCallback?.(q)??null)};return D=I.requestVideoFrameCallback(q),()=>{j=!0,D!==null&&I.cancelVideoFrameCallback?.(D)}}let z=I.currentTime;const B=setInterval(()=>{if(j)return;const q=I.currentTime;q!==z&&(z=q,E())},dA);return()=>{j=!0,clearInterval(B)}},[n,t,E]),T.useEffect(()=>{if(!n)return;const R=setInterval(()=>{const I=C.current();if(I<x.current||!Kpe({lastFrameAt:h.current,nowMs:I,stallMs:s,playing:n})||u.current>=Gpe)return;const j=u.current;u.current=j+1,h.current=I,x.current=I+Zpe(j+1)+s,m({recovering:!0,attempts:j+1}),w.current()},dA);return()=>clearInterval(R)},[n,s]),f}const Ype=300,Xpe=130,Jpe=["devices","viewOptions"],eme={inline:Jpe,overflow:!1},tme={inline:[],overflow:!0};function nme(e,t){return e>=Ype&&t>=Xpe?eme:tme}const ame=120,ime=68;function rme(e,t,n){return e&&t>=ame&&n>=ime}const ome=16/9,sme={left:0,top:0,width:0,height:0},mA=.5;function lme(e,t,n){if(!(e>0)||!(t>0))return sme;const a={left:0,top:0,width:e,height:t};if(!Number.isFinite(n))return a;const s=Math.min(e,t*n),p=s/n;return e-s<mA&&t-p<mA?a:{left:(e-s)/2,top:(t-p)/2,width:s,height:p}}const cme=500;function g5(e,t,n){const{motion:a,detection:s}=jle(e.trpcClient,t),p=T.useRef(0),f=T.useRef(0),m=T.useRef(0),h=T.useRef(!1),[,u]=T.useState(0),x=n?.audio??"off",w=n?.audioDb??-30,C=n?.audioHoldSec??5,E=n?.motionHoldSec??0,R=n?.detectionHoldSec??3,I=n?.detectionClasses??[],j=I.join(",");if(li(Ze.MotionOnMotionChanged,z=>{const B=z.data;!B||B.deviceId!==t||!n?.motion||(B.detected===!0?(m.current=Date.now()+Math.max(1,E)*1e3,h.current=!0,u(q=>q+1)):B.detected===!1&&h.current&&(m.current=Date.now()+E*1e3,h.current=!1,u(q=>q+1)))}),li(Ze.PipelineAudioInferenceResult,z=>{const B=z.data;if(!B||B.deviceId!==t||x==="off")return;(x==="sensor"?B.frame.detections.length>0:(B.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=w)&&(p.current=Date.now()+C*1e3,u(Z=>Z+1))}),T.useEffect(()=>{if(!s)return;s.detections.some(B=>I.length===0||I.includes(B.macroClass))&&(f.current=Date.now()+R*1e3,u(B=>B+1))},[s,R,j]),T.useEffect(()=>{const z=a!==null;(z||h.current)&&(m.current=Date.now()+E*1e3,z||u(B=>B+1)),h.current=z},[a,E]),T.useEffect(()=>{const z=setInterval(()=>u(B=>B+1),cme);return()=>clearInterval(z)},[]),!n?.enabled)return null;const D=Date.now();return n.detection&&D<f.current?"detection":x!=="off"&&D<p.current?"audio":n.motion&&(a!==null||D<m.current)?"motion":null}const Qs={motion:"#DC2626",audio:"#3B82F6",detection:"#22C55E"},ume=2500,dme={person:"#f59e0b",vehicle:"#3b82f6",animal:"#22c55e",face:"#a855f7",plate:"#ec4899"},pme="#ef4444";function mme(e){return dme[e]??pme}function Yd(e){return e<0?0:e>1?1:e}function fme(e){if(e.width<=0||e.height<=0)return[];const t=[];for(const n of e.detections){const{bbox:a}=n,s=Yd(a.x/e.width),p=Yd(a.y/e.height),f=Yd((a.x+a.width)/e.width),m=Yd((a.y+a.height)/e.height);f<=s||m<=p||t.push({label:n.macroClass,score:n.score,x1:s,y1:p,x2:f,y2:m})}return t}function hme({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return li(Ze.DetectionResult,s=>{const p=s.data;!p||p.frame.deviceId!==e||(n(fme(p.frame)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),ume))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current),n([])},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>{const f=mme(s.label),m=Math.round(s.score*100);return v.jsx("div",{style:{position:"absolute",left:`${s.x1*100}%`,top:`${s.y1*100}%`,width:`${(s.x2-s.x1)*100}%`,height:`${(s.y2-s.y1)*100}%`,border:`2px solid ${f}`,borderRadius:3},children:v.jsx("span",{style:{position:"absolute",left:-2,bottom:"100%",background:f,color:"#fff",fontSize:10,fontWeight:700,fontFamily:"system-ui, sans-serif",lineHeight:"14px",padding:"0 4px",borderRadius:3,whiteSpace:"nowrap"},children:`${s.label} ${m}%`})},`${s.label}-${p}`)})})}function gme(e,t,n,a){const s=Number.isFinite(e)&&e>0?e:0,p=Number.isFinite(t)&&t>0?t:0;if(!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)return{width:s,height:p};const f=Math.min(s/n,p/a);return{width:n*f,height:a*f}}function vme(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function fA(e,t,n,a){if(!Number.isFinite(e))return 0;const s=vme(t,n,a);return Math.max(-s,Math.min(s,e))}const yme=4,hA=8,bme=300;function gA(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Sme({children:e,onTap:t}){const n=T.useRef(null),a=T.useRef(null),s=T.useRef(new Map),p=T.useRef(1),f=T.useRef(0),m=T.useRef(0),h=T.useRef(null),u=T.useRef(null),x=T.useRef(0),w=()=>{const D=a.current;D&&(D.style.transform=`translate(${f.current}px, ${m.current}px) scale(${p.current})`)},C=()=>{const D=n.current?.getBoundingClientRect();if(!D||D.width<=0||D.height<=0)return;const z=a.current?.querySelector("video")??null,B=z?null:a.current?.querySelector("img")??null,q=z?.videoWidth??B?.naturalWidth??0,Z=z?.videoHeight??B?.naturalHeight??0,J=gme(D.width,D.height,q,Z);f.current=fA(f.current,D.width,J.width,p.current),m.current=fA(m.current,D.height,J.height,p.current)},E=()=>{p.current=1,f.current=0,m.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()],B=z[0],q=z[1];B&&q&&(h.current={dist:gA(B,q),scale:p.current,cx:(B.x+q.x)/2,cy:(B.y+q.y)/2,tx:f.current,ty:m.current}),u.current=null}else s.current.size===1&&(u.current={x:D.clientX,y:D.clientY,tx:f.current,ty:m.current,moved:!1})},I=D=>{if(!s.current.has(D.pointerId))return;if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size>=2&&h.current){const B=[...s.current.values()],q=B[0],Z=B[1];if(!q||!Z)return;const J=gA(q,Z);h.current.dist>0&&(p.current=Math.max(1,Math.min(yme,h.current.scale*(J/h.current.dist))));const $=(q.x+Z.x)/2,F=(q.y+Z.y)/2;f.current=h.current.tx+($-h.current.cx),m.current=h.current.ty+(F-h.current.cy),C(),w();return}const z=u.current;if(s.current.size===1&&z){const B=D.clientX-z.x,q=D.clientY-z.y;(Math.abs(B)>hA||Math.abs(q)>hA)&&(z.moved=!0),p.current>1&&(f.current=z.tx+B,m.current=z.ty+q,C(),w())}},j=D=>{const z=s.current.size===1,B=u.current;if(s.current.delete(D.pointerId),s.current.size<2&&(h.current=null),s.current.size===0&&(u.current=null,z&&B&&!B.moved)){const q=Date.now();q-x.current<bme?(x.current=0,E()):(x.current=q,t())}};return v.jsx("div",{ref:n,style:{position:"absolute",inset:0,overflow:"hidden",touchAction:"none"},onPointerDown:R,onPointerMove:I,onPointerUp:j,onPointerCancel:j,children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%",transformOrigin:"center center",willChange:"transform"},children:e})})}function xme(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 kme(e,t){const n=t[0];return n===void 0?null:xme(e,n.url)}function wme(e,t){return{handleOffer:(n,a,s)=>e(t,n,a,s),reoffer:(n,a,s,p)=>e(s,a,n,p)}}const Mme=3500;function Cme(e){return e==="auto"?{kind:"adaptive"}:{kind:"profile",profile:e}}function Ame({system:e,deviceId:t,name:n,online:a,quality:s,muted:p,paused:f,showName:m,audioActive:h,micActive:u,onTogglePause:x,onToggleAudio:w,onToggleMic:C,onOpen:E,ptzSupported:R,onPtz:I,cellW:j,cellH:D,onCellPanel:z,highlight:B,showBoxes:q,overlay:Z,reconnectSignal:J,onStall:$,posterUrl:F,labels:de=nm,editable:we,span:Ce,onRemove:Me,onResize:Ae}){const{handleOffer:oe,getIceServers:Te,addIceCandidate:H,getIceCandidates:ce,closeSession:ke,getSessionState:Ee}=ON(e.trpcClient,t),me=g5(e,t,B),L=T.useRef(null),[te,ge]=T.useState(0),[Se,ee]=T.useState("idle"),ye=Wpe({containerRef:L,playing:Se==="playing"&&!f,onRecover:()=>{ge(We=>We+1),$?.(t)}}),[Oe,X]=T.useState(void 0);T.useEffect(()=>{if(F||f)return;let We=!1;const jn=j!==void 0&&j>0?Math.round(j):void 0;return e.trpcClient.snapshot.getSnapshotLinks.query({targets:[{deviceId:t,...jn!==void 0?{width:jn}:{}}]}).then(Ga=>{if(We)return;const Wi=kme(e.serverUrl,Ga??[]);Wi!==null&&X(Wi)}).catch(()=>{}),()=>{We=!0}},[F,f,e,t,j]);const he=F??Oe,$e=T.useMemo(()=>Cme(s),[s]),Ne=`grid:${t}:${s}`,nt=T.useMemo(()=>wme(oe,$e),[oe,$e]),[Ve,Xe]=T.useState(!1),Re=T.useRef(null),Ke=()=>{Re.current&&clearTimeout(Re.current),Re.current=setTimeout(()=>Xe(!1),Mme)},vt=()=>{Xe(!0),Ke()},An=()=>{Xe(We=>{const jn=!We;return jn&&Ke(),jn})},Yt=nme(j??0,D??0),ln=We=>{We.stopPropagation(),vt()},Oa=j!==void 0&&D!==void 0&&j>0&&D>0,Va=lme(j??0,D??0,ome),Ki=Oa?{position:"absolute",left:Va.left,top:Va.top,width:Va.width,height:Va.height}:{position:"absolute",inset:0},tn=Math.max(1,Math.round(Ce?.cw??1)),xe=Math.max(1,Math.round(Ce?.ch??1)),_e=Oa&&j!==void 0?j/tn:0,Rt=Oa&&D!==void 0?D/xe:0,fn=rme(we===!0,j??0,D??0);return T.useEffect(()=>()=>{Re.current&&clearTimeout(Re.current)},[]),v.jsxs("div",{ref:L,"data-stall-recovering":ye.recovering?"true":void 0,style:{position:"relative",width:"100%",height:"100%",background:"#000"},children:[v.jsxs("div",{style:Ki,children:[v.jsx(Sme,{onTap:An,children:f?v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#fafaf9"},children:v.jsx(yA,{size:28})}):v.jsx(w4,{serverUrl:e.serverUrl,streamKey:Ne,autoPlay:!0,muted:p,showControls:!1,className:"w-full h-full",handleOffer:nt.handleOffer,reoffer:nt.reoffer,getSessionState:Ee,getIceServers:Te,addIceCandidate:H,getIceCandidates:ce,closeSession:ke,reconnectSignal:(J??0)+te,onStateChange:ee,posterUrl:he,onClientNetworkSample:s==="auto"?We=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...We}).catch(()=>{})}:void 0},Ne)}),q&&!f?v.jsx(hme,{deviceId:t}):null,Z?.motionBoxes===!0&&!f?v.jsx(Upe,{deviceId:t}):null]}),lA(Z?.audioMeter)&&!f?v.jsx(Fpe,{deviceId:t,anchor:Z.audioMeter}):null,lA(Z?.occupancy)&&!f?v.jsx($pe,{system:e,deviceId:t,anchor:Z.occupancy}):null,Z?.stats===!0&&!f?v.jsx(Qpe,{containerRef:L}):null,me&&(()=>{const We=B?.appearance,jn=me==="motion"?We?.motionColor??Qs.motion:me==="audio"?We?.audioColor??Qs.audio:We?.detectionColor??Qs.detection,Ga=We?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${Ga}px solid ${jn}`,boxShadow:`inset 0 0 12px ${jn}`,pointerEvents:"none"}})})(),(m||Ve)&&v.jsxs("div",{style:{position:"absolute",left:0,right:0,top:0,display:"flex",alignItems:"center",gap:6,padding:"4px 8px",background:"rgba(0,0,0,0.6)",color:"#fafaf9",fontSize:12,fontWeight:600,fontFamily:"system-ui, sans-serif",pointerEvents:"none",opacity:m||Ve?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:Ve?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(Ar,{label:f?de.play:de.pause,big:!0,enabled:Ve,onClick:We=>{ln(We),x(t)},children:f?v.jsx(yA,{size:22}):v.jsx(Eme,{size:22})})}),v.jsxs("div",{style:{position:"absolute",left:8,bottom:8,display:"flex",gap:8,pointerEvents:"none"},children:[v.jsx(Ar,{label:h?de.mute:de.listen,active:h,enabled:Ve,onClick:We=>{ln(We),w(t)},children:h?v.jsx(Rme,{size:18}):v.jsx(_me,{size:18})}),v.jsx(Ar,{label:u?de.stopTalk:de.talk,active:u,enabled:Ve,onClick:We=>{ln(We),C(t)},children:v.jsx(Tme,{size:18,muted:!u})}),R&&I&&(!z||!Yt.overflow)?v.jsx(Ar,{label:de.ptz,enabled:Ve,onClick:We=>{ln(We),I(t)},children:v.jsx(Dme,{size:18})}):null,z?Yt.inline.map(We=>v.jsx(Ar,{label:We==="devices"?de.linkedDevices:de.viewOptions,enabled:Ve,onClick:jn=>{ln(jn),z(t,We)},children:We==="devices"?v.jsx(Nme,{size:18}):v.jsx(Ome,{size:18})},We)):null,z&&Yt.overflow?v.jsx(Ar,{label:de.moreActions,enabled:Ve,onClick:We=>{ln(We),z(t,"actions")},children:v.jsx(jme,{size:18})}):null]}),v.jsx("div",{style:{position:"absolute",right:8,bottom:8,pointerEvents:"none"},children:v.jsx(Ar,{label:de.open,enabled:Ve,onClick:We=>{ln(We),E(t)},children:v.jsx(Ime,{size:18})})}),fn&&Me?v.jsx("div",{style:{position:"absolute",right:8,top:8,pointerEvents:"none"},children:v.jsx(Ar,{label:de.removeFromView,enabled:Ve,onClick:We=>{ln(We),Me(t)},children:v.jsx(Pme,{size:18})})}):null,fn&&Ae?v.jsxs(v.Fragment,{children:[v.jsx(vA,{axis:"x",label:de.resizeWidth,enabled:Ve,track:_e,span:tn,onSpan:We=>{vt(),Ae(t,We,xe)}}),v.jsx(vA,{axis:"y",label:de.resizeHeight,enabled:Ve,track:Rt,span:xe,onSpan:We=>{vt(),Ae(t,tn,We)}})]}):null]})]})}function vA({axis:e,label:t,enabled:n,track:a,span:s,onSpan:p}){const f=T.useRef(null),m=h=>e==="x"?h.clientX:h.clientY;return v.jsx("div",{role:"separator","aria-label":t,"aria-orientation":e==="x"?"vertical":"horizontal",onPointerDown:h=>{h.stopPropagation(),h.currentTarget.setPointerCapture(h.pointerId),f.current={origin:m(h),base:s}},onPointerMove:h=>{if(f.current===null||!(a>0))return;h.stopPropagation();const u=Math.round((m(h)-f.current.origin)/a),x=Math.max(1,f.current.base+u);x!==s&&p(x)},onPointerUp:h=>{f.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:()=>{f.current=null},style:{position:"absolute",...e==="x"?{right:0,top:"50%",width:14,height:48,transform:"translateY(-50%)"}:{bottom:0,left:"50%",width:48,height:14,transform:"translateX(-50%)"},borderRadius:7,background:"rgba(0,0,0,0.55)",border:"1px solid rgba(250,250,249,0.35)",cursor:e==="x"?"ew-resize":"ns-resize",touchAction:"none",pointerEvents:n?"auto":"none"}})}function Ar({children:e,label:t,onClick:n,big:a=!1,active:s=!1,enabled:p=!0}){const f=a?52:40;return v.jsx("button",{type:"button","aria-label":t,onClick:n,style:{width:f,height:f,borderRadius:f/2,border:"none",display:"flex",alignItems:"center",justifyContent:"center",background:s?"rgba(59,130,246,0.85)":"rgba(0,0,0,0.55)",color:"#fafaf9",cursor:"pointer",padding:0,WebkitTapHighlightColor:"transparent",pointerEvents:p?"auto":"none"},children:e})}const $r={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function yA({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 Eme({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 Rme({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 _me({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 Tme({size:e,muted:t}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 Ime({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 Nme({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 Ome({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 jme({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 Pme({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,children:v.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Dme({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...$r,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 zme({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 bA({message:e}){return T.useEffect(()=>ri(m5("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 Lme=["setDevices","setSpans"];function qme(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function Bme({system:e,config:t}){const[n,a]=T.useState(t.devices),[s,p]=T.useState(()=>new Set(t.audioOnIds??[])),f=p5(),m=T.useRef(f.setActiveMic);m.current=f.setActiveMic;const[h,u]=T.useState(()=>new Set(t.pausedIds??[])),[x,w]=T.useState(t.highlight),[C,E]=T.useState(t.activeOnly??!1),[R,I]=T.useState(t.showBoxes??!1),[j,D]=T.useState(()=>t.overlays??{}),[z,B]=T.useState(()=>t.spans??{}),q=ype(n,x),Z=T.useMemo(()=>C?n.filter(ee=>q.has(ee)):n,[C,n,q]),[J,$]=T.useState(t.quality),[F,de]=T.useState(t.layout),[we,Ce]=T.useState(t.showName),[Me,Ae]=T.useState(0),oe=T.useMemo(()=>Gde(t.labels),[t.labels]),[Te,H]=T.useState(()=>t.snapshots??{}),ce=T.useMemo(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[ke,Ee]=T.useState({w:window.innerWidth,h:window.innerHeight}),me=oe.camera,[L,te]=T.useState({});T.useEffect(()=>{let ee=!1;return e.trpcClient.deviceManager.listAll.query({deviceIds:[...n],projection:"slim"}).then(ye=>{if(ee)return;const Oe={};for(const X of ye)Oe[X.id]={name:X.name??`${me} ${X.id}`,online:X.online??!1};te(Oe)}).catch(()=>{}),()=>{ee=!0}},[e,n,me]),T.useEffect(()=>(window.__camstackGrid={setAudioOn:ee=>p(new Set(ee)),setMutedAll:ee=>{ee&&p(new Set)},setActiveMic:ee=>m.current(ee),setHighlight:ee=>w(ee),setActiveOnly:ee=>E(ee),setShowBoxes:ee=>I(ee),setOverlays:ee=>D(ee),setPaused:ee=>u(new Set(ee)),setDevices:ee=>a(ye=>qme(ye,ee)?ye:[...ee]),setSpans:ee=>B(ee),setQuality:ee=>$(ee),setLayout:ee=>de(ee),setShowName:Ce,setShowBadges:()=>{},setSnapshots:ee=>H(ee),fit:(ee,ye)=>Ee({w:ee,h:ye}),reconnect:()=>Ae(ee=>ee+1)},ri(m5("ready",void 0,Lme)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),T.useEffect(()=>uu(ee=>{const ye=window.__camstackGrid;if(!ye)return;switch(ee.kind){case"setAudioOn":ye.setAudioOn(ee.value);break;case"setMutedAll":ye.setMutedAll(ee.value);break;case"setActiveMic":ye.setActiveMic(ee.value);break;case"setHighlight":ye.setHighlight(ee.value);break;case"setActiveOnly":ye.setActiveOnly(ee.value);break;case"setShowBoxes":ye.setShowBoxes(ee.value===!0);break;case"setOverlays":ye.setOverlays(ee.value);break;case"setPaused":ye.setPaused(ee.value);break;case"setDevices":ye.setDevices(ee.value);break;case"setSpans":ye.setSpans(ee.value);break;case"setQuality":ye.setQuality(o5.parse(ee.value));break;case"setLayout":ye.setLayout(ee.value);break;case"setShowName":ye.setShowName(ee.value);break;case"setShowBadges":ye.setShowBadges(ee.value);break;case"setSnapshots":ye.setSnapshots(ee.value);break;case"fit":ye.fit(ee.w,ee.h);break;case"reconnect":ye.reconnect();break}}),[]);const ge=T.useMemo(()=>hpe(Z,ke.w,ke.h,F,z),[Z,ke.w,ke.h,F,z]),Se=T.useRef(null);return T.useEffect(()=>{const ee=Se.current;if(!ee)return;const ye=[];ee.querySelectorAll("[data-device-id]").forEach(Oe=>{const X=Number(Oe.dataset.deviceId),he=Oe.getBoundingClientRect();ye.push({deviceId:X,rect:{x:he.x,y:he.y,w:he.width,h:he.height}})}),ye.length&&ri(Ape(ye))},[ge,Z]),v.jsxs("div",{ref:Se,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:[C&&Z.length===0&&v.jsx("div",{style:{color:"#a1a1aa",fontFamily:"system-ui, sans-serif",fontSize:14,padding:24,textAlign:"center"},children:oe.noActiveCameras}),v.jsx(zme,{wall:ge,renderTile:(ee,ye,Oe)=>v.jsx(Ame,{system:e,deviceId:ee,name:L[ee]?.name??`${oe.camera} ${ee}`,online:L[ee]?.online??!1,quality:J,muted:!s.has(ee),paused:h.has(ee),showName:we,audioActive:s.has(ee),micActive:f.activeMicId===ee,onTogglePause:X=>ri(xpe(X)),onToggleAudio:X=>ri(Spe(X)),onToggleMic:f.toggleMic,onOpen:X=>ri(bpe(X)),ptzSupported:ce.has(ee),onPtz:X=>ri(kpe(X)),cellW:ye,cellH:Oe,onCellPanel:(X,he)=>ri(wpe(X,he)),highlight:x,showBoxes:R,overlay:j[String(ee)],reconnectSignal:Me,posterUrl:Te[String(ee)],editable:t.editable===!0,span:z[String(ee)],onRemove:X=>ri(Mpe(X)),onResize:(X,he,$e)=>ri(Cpe(X,he,$e)),labels:oe})})]})}function Ume(){const e=Rm("grid",()=>window.__CAMSTACK_GRID__,l5,spe),t=T.useMemo(()=>{if(e===null||!e.ok)return null;const n=vm({serverUrl:e.config.serverUrl,token:e.config.token}),a=new vT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:n,queryClient:a}},[e]);return T.useEffect(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?v.jsx(tI,{system:t.system,children:v.jsx(bT,{client:t.queryClient,children:v.jsx(y.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:v.jsx(Bme,{system:t.system,config:e.config})})})}):v.jsx(bA,{message:"Failed to initialise the grid embed"}):v.jsx(bA,{message:e.error})}const C0=it([d({kind:V("adaptive")}),d({kind:V("profile"),profile:Cn})]),Fme=d({deviceId:l().int().nonnegative(),target:C0.optional(),muted:A().optional(),stats:A().optional(),snapshot:o().optional()});function Hme(e){const t=Fme.safeParse(e);return t.success?t.data:null}const $me=["live","loading","playing","paused","gap","ended","error"];function Qme(e){return typeof e=="string"&&$me.includes(e)}const go="low",SA=5e3;class Vme{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"&&Qme(a.state)){this.lastState=a.state,a.state==="playing"||a.state==="paused"?(this.maybeArmPlaybackUpgrade(),this.playIntentAt!==null&&(this.deps.onLog?.("playback:ready",{kind:this.playIntentKind,state:a.state,waitMs:Math.round(performance.now()-this.playIntentAt),dragId:this.playIntentDragId}),this.playIntentAt=null,this.playIntentKind=null,this.playIntentDragId=void 0)):(a.state==="live"||a.state==="gap"||a.state==="ended"||a.state==="error")&&this.cancelPlaybackUpgrade(),this.deps.onState?.(a.state);return}a.t!=="position"||typeof a.epochMs!="number"||(this.lastCursorMs=a.epochMs,this.deps.onPosition?.(a.epochMs),typeof a.seq=="number"&&(this.lastPushSeq=a.seq),this.begun&&(this.positionsSeen+=1,this.rvfcCapable()||(this.acks+=1,this.sendAck())))};sendAck(){this.send(this.lastPushSeq===null?{t:"scrubAck"}:{t:"scrubAck",seq:this.lastPushSeq})}rvfcCapable(){return typeof this.deps.video()?.requestVideoFrameCallback=="function"}send(t){return this.disposed||this.deps.channel.readyState!=="open"?!1:(this.deps.channel.send(JSON.stringify(t)),!0)}sendPlayRecorded(t,n,a,s,p){const f=this.send({t:"playRecorded",deviceId:t,epoch:n,profile:a});return f&&(this.lastSentProfile=a,this.playIntentAt=performance.now(),this.playIntentKind=s,this.playIntentDragId=p,this.deps.onLog?.("playback:intent",{kind:s,deviceId:t,epochMs:n,profile:a,dragId:p})),f}maybeArmPlaybackUpgrade(){if(this.pendingUpgrade===null||this.upgradeTimer!==null||this.disposed)return;this.upgradeTimer=setTimeout(()=>this.firePlaybackUpgrade(),SA);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,SA-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:go,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,go,"land",s)?(this.lastCursorMs=n,a!==go&&(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=go){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!==go&&(this.lastSentProfile=go,this.send({t:"setProfile",profile:go})),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 Gme(e,t,n,a){return e?.isOpen()?(e.warm(n),e.playRecorded(t,n,a)):!1}const Zme=24e4;function Kme(e,t=Zme){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 Wme=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus"],xA=["video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp8","video/webm"];function Yme(e=n=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(n),t){const n=t?.audio?[...Wme,...xA]:xA;for(const a of n)try{if(e(a))return a}catch{}return""}function Xme(e,t){const n=[...e.getVideoTracks()],a=t?.getAudioTracks()??[],s=a.length>0?a.map(p=>{const f=p.clone();return"enabled"in f&&(f.enabled=!0),f}):[...e.getAudioTracks()];return[...n,...s]}function Jme(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 efe(e,t)}function efe(e,t){if(e.videoWidth<2||e.videoHeight<2||typeof document>"u")return null;const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight;const a=n.getContext("2d");if(!a||typeof n.captureStream!="function")return null;let s=!0;const p=()=>{if(s){try{a.drawImage(e,0,0,n.width,n.height)}catch{}requestAnimationFrame(p)}};p();const f=n.captureStream(t),m=f.getVideoTracks()[0];if(m){const h=m.stop.bind(m);m.stop=()=>{s=!1,h()}}return f}function tfe(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const s=String(a.result??""),p=s.indexOf(",");t(p>=0?s.slice(p+1):s)},a.onerror=()=>n(a.error??new Error("read failed")),a.readAsDataURL(e)})}function nfe(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function afe(e){let t=null,n=[],a=null,s="",p=!1;const f=()=>{if(t=null,n=[],p=!1,a){for(const h of a.getTracks())try{h.stop()}catch{}a=null}},m=h=>{f(),e.emit({type:"liveCaptureError",message:h})};return{start(){if(t)return;const h=e.getVideo();if(!h){m("no video");return}if(typeof MediaRecorder>"u"){m("MediaRecorder missing");return}const u=Jme(h);if(!u){m("no video");return}const x=h.srcObject instanceof MediaStream?h.srcObject:null,w=Xme(u,x);if(x&&x.getAudioTracks().length>0)for(const I of u.getAudioTracks())try{I.stop()}catch{}const C=new MediaStream(w);a=C;const E=w.some(I=>I.kind==="audio"),R=Yme(void 0,{audio:E});try{t=R?new MediaRecorder(C,{mimeType:R,videoBitsPerSecond:25e5,...E?{audioBitsPerSecond:128e3}:{}}):new MediaRecorder(C)}catch(I){m(I instanceof Error?I.message:"MediaRecorder missing");return}n=[],s=nfe(),p=!1,t.ondataavailable=I=>{I.data&&I.data.size>0&&n.push(I.data)},t.onerror=()=>m("MediaRecorder missing");try{t.start(1e3)}catch(I){m(I instanceof Error?I.message:"MediaRecorder missing")}},stop(){const h=t;if(!h||p){h||m("no video");return}p=!0;const u=s,x=h.mimeType||"video/mp4";h.onstop=()=>{const w=new Blob(n,{type:x});if(f(),w.size===0){e.emit({type:"liveCaptureError",message:"empty capture"});return}tfe(w).then(C=>{e.emit({type:"liveCaptureStart",id:u,mime:x});const E=Kme(C),R=E.length;E.forEach((I,j)=>{e.emit({type:"liveCaptureChunk",id:u,index:j,total:R,data:I})}),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){m(w instanceof Error?w.message:"stop failed")}},abort(){if(t&&t.state!=="inactive")try{t.stop()}catch{}f()}}}const ife=8,rfe=2.5;function ofe(e){return e>=ife?"high":e>=rfe?"mid":"low"}function sfe(e,t){return e.kind==="profile"?e.profile:"low"}function lfe(e,t){return e.kind==="profile"?e.profile:ofe(t)}const cfe=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),target:C0,muted:A(),stats:A().optional(),highlight:s5.optional(),snapshot:o().optional(),initialSeekMs:l().positive().optional()});function Gy(e,t){on(t!==void 0?{type:"state",state:e,message:t}:{type:"state",state:e})}function ufe(e){switch(e){case"playing":return"playing";case"error":return"error";case"connecting":case"disconnected":case"idle":return"connecting"}}function kA(e,t){return sfe(e)}async function dfe(){if(typeof window>"u")return null;const e=window.location.origin.replace(/\/+$/,""),t=new AbortController,n=window.setTimeout(()=>t.abort(),2500),a=performance.now();try{const s=await fetch(`${e}/adaptive-probe`,{signal:t.signal});if(!s.ok)return null;const p=await s.arrayBuffer(),f=Math.max(1,performance.now()-a);return p.byteLength<1024?null:p.byteLength*8/f/1e3}catch{return null}finally{window.clearTimeout(n)}}function wA(e,t,n,a){a.kind==="adaptive"&&dfe().then(s=>{if(s===null)return;const p=lfe(a,s);e.upgradePlayback(t,n,p)})}function pfe(e){return e.kind==="adaptive"?{kind:"adaptive"}:{kind:"profile",profile:e.profile}}function mfe(e){return e.kind==="adaptive"?"embed:adaptive":`embed:profile:${e.profile}`}function ffe(e){const t=cfe.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 MA({message:e}){return T.useEffect(()=>{Gy("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 hfe({system:e,deviceId:t,initialTarget:n,initialMuted:a,initialStats:s,initialHighlight:p,initialSnapshot:f,initialSeekMs:m}){const[h,u]=T.useState(n);T.useEffect(()=>JN(t),[t]);const x=T.useRef(h);x.current=h;const[w,C]=T.useState(a),[E,R]=T.useState(s),[I,j]=T.useState(p),[D,z]=T.useState(f),[B,q]=T.useState(0),[Z,J]=T.useState({w:window.innerWidth,h:window.innerHeight}),$=g5(e,t,I),F=p5(),de=T.useRef(F.setActiveMic);de.current=F.setActiveMic;const{handleOffer:we,getIceServers:Ce,addIceCandidate:Me,getIceCandidates:Ae,closeSession:oe,getSessionState:Te}=ON(e.trpcClient,t),H=T.useMemo(()=>pfe(h),[h]),ce=T.useMemo(()=>(X,he,$e)=>we(H,X,he,$e),[we,H]),ke=T.useMemo(()=>(X,he,$e,Ne)=>we($e,he,X,Ne),[we]),Ee=T.useRef(null),me=T.useRef(null),L=T.useRef("low"),te=T.useRef(!1),ge=T.useRef(null),Se=T.useRef(null),ee=()=>{const X=ge.current;if(X===null)return;const he=L.current,$e=`${X.phase}|${X.viewportWidth??"-"}x${X.viewportHeight??"-"}|${X.devicePixelRatio??"-"}|${X.downlinkMbps??"-"}|${X.prefersTier??"-"}|${X.probeOrigin??"unreachable"}|${he}`;$e!==Se.current&&(Se.current=$e,on({type:"log",scope:"adaptive",msg:"tier decision",data:{deviceId:t,requested:h.kind==="adaptive"?"adaptive":`pinned:${h.kind}`,phase:X.phase,viewportWidth:X.viewportWidth??null,viewportHeight:X.viewportHeight??null,devicePixelRatio:X.devicePixelRatio??null,downlinkMbps:X.downlinkMbps??null,prefersTier:X.prefersTier??null,probeOrigin:X.probeOrigin,liveProfile:he}}))},ye=T.useRef(m??null);T.useEffect(()=>{if(!w)return;const X=setInterval(()=>{let he=0;for(const $e of Array.from(document.querySelectorAll("video"))){$e.muted||($e.muted=!0,he++);const Ne=$e.srcObject;if(Ne instanceof MediaStream)for(const nt of Ne.getAudioTracks())nt.enabled&&(nt.enabled=!1,he++)}he>0&&on({type:"log",scope:"live-audio",msg:"re-muted",data:{corrected:he}})},1e3);return()=>clearInterval(X)},[w]),T.useEffect(()=>()=>Ee.current?.dispose(),[]),T.useEffect(()=>{const X=()=>{const Re=Ee.current;return Re?.isOpen()?Re:null},he=()=>kA(x.current,L.current),$e=(Re,Ke)=>{wA(Re,t,Ke,x.current)},Ne=Re=>{te.current||(te.current=!0,on({type:"log",scope:"recorded:session",msg:"pointer move with no open session",data:{what:Re}}),on({type:"recState",state:"error"}))},nt=(Re,Ke)=>{const vt=X();return!vt||!Ke(vt)?(Ne(Re),!1):(te.current=!1,!0)},Ve=(Re,Ke)=>{nt("scrubCommit",vt=>{const An=vt.landFromScrub(t,Re,he(),Ke);return An&&$e(vt,Re),An})},Xe=afe({emit:on,getVideo:()=>me.current});return window.__camstackEmbed={setMuted:Re=>C(Re),setTarget:Re=>{const Ke=C0.safeParse(Re);Ke.success&&u(Ke.data)},setStats:Re=>R(Re),setHighlight:Re=>j(Re),setSnapshot:Re=>z(Re),setMic:Re=>de.current(Re?t:null),fit:(Re,Ke)=>J({w:Re,h:Ke}),reconnect:()=>q(Re=>Re+1),playRecorded:(Re,Ke,vt)=>{Number.isFinite(Ke)&&nt("playRecorded",An=>An.playRecorded(Re,Ke,vt))},seek:Re=>{Number.isFinite(Re)&&nt("seek",Ke=>{const vt=Ke.playRecorded(t,Re,he());return vt&&$e(Ke,Re),vt})},scrubCommit:(Re,Ke)=>{Number.isFinite(Re)&&Ve(Re,Ke)},scrubStart:Re=>{on({type:"log",scope:"recorded:scrub",msg:"scrubStart",data:{dragId:Re}}),nt("scrubStart",Ke=>Ke.begin(Re))},scrubTo:(Re,Ke,vt)=>{if(!Number.isFinite(Re))return;const An=(Ke==="fine"||Ke==="coarse")&&Number.isFinite(vt)?{mode:Ke,velocityPxPerS:vt}:void 0;nt("scrubTo",Yt=>Yt.isActive()?(Yt.retarget(Re,An),!0):!1)},timelineWarm:Re=>{Number.isFinite(Re)&&X()?.warm(Re)},scrubEnd:Re=>{Number.isFinite(Re)&&Ve(Re)},setRate:Re=>{Number.isFinite(Re)&&nt("setRate",Ke=>Ke.setRate(Re))},stepFrame:Re=>{Re!==1&&Re!==-1||nt("stepFrame",Ke=>Ke.stepFrame(Re))},goLive:()=>{nt("goLive",Re=>Re.goLive())&&on({type:"recState",state:"live"})},startLiveCapture:()=>Xe.start(),stopLiveCapture:()=>Xe.stop()},()=>{Xe.abort(),window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),T.useEffect(()=>{on({type:"micState",state:F.micState})},[F.micState]),T.useEffect(()=>uu(X=>{const he=window.__camstackEmbed;if(!he)return;switch(X.kind){case"setMuted":he.setMuted(X.value);break;case"setTarget":he.setTarget(X.value);break;case"setStats":he.setStats(X.value);break;case"setHighlight":he.setHighlight(X.value);break;case"setSnapshot":he.setSnapshot(X.value);break;case"setMic":he.setMic(X.value);break;case"fit":he.fit(X.w,X.h);break;case"reconnect":he.reconnect();break;case"playRecorded":he.playRecorded(X.deviceId,X.epochMs,X.profile);break;case"seek":he.seek(X.epochMs??X.value);break;case"scrubCommit":he.scrubCommit(X.epochMs??X.value,X.dragId);break;case"scrubStart":he.scrubStart(X.dragId);break;case"scrubTo":he.scrubTo(X.epochMs??X.value,X.m,X.v);break;case"scrubEnd":he.scrubEnd(X.epochMs??X.value);break;case"timelineWarm":he.timelineWarm(X.epochMs??X.value);break;case"setRate":he.setRate(X.rate??X.value);break;case"stepFrame":{const Ne=X.dir;(Ne===1||Ne===-1)&&he.stepFrame(Ne);break}case"goLive":he.goLive();break;case"startLiveCapture":he.startLiveCapture();break;case"stopLiveCapture":he.stopLiveCapture();break}}),[]);const Oe=mfe(h);return v.jsxs("div",{style:{position:"fixed",left:0,top:0,width:Z.w,height:Z.h,background:"#000"},children:[v.jsx(w4,{serverUrl:e.serverUrl,streamKey:Oe,autoPlay:!0,muted:w,showControls:!1,showStats:E,onPlaybackStats:X=>on({type:"log",scope:"playback",msg:"stats",data:X}),onConnectTiming:X=>on({type:"log",scope:"webrtc-timing",msg:"connect",data:X}),onClientNetworkSample:h.kind==="adaptive"?X=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...X}).catch(()=>{})}:void 0,className:"w-full h-full",onAdaptiveHints:X=>{ge.current=X,ee()},handleOffer:ce,reoffer:ke,getSessionState:Te,getIceServers:Ce,addIceCandidate:Me,getIceCandidates:Ae,closeSession:oe,reconnectSignal:B,posterUrl:D,onStateChange:X=>Gy(ufe(X)),onError:X=>Gy("error",X),onReconnectAttempt:X=>on({type:"log",scope:"live:retry",msg:X.kind==="retry"?"auto-retry scheduled":"auto-retry exhausted",data:X}),onControlChannel:X=>{if(Ee.current?.dispose(),te.current=!1,Ee.current=new Vme({channel:X,video:()=>me.current,onState:he=>on({type:"recState",state:he}),onPosition:he=>on({type:"position",positionMs:he}),onLiveProfile:he=>{L.current=he,ee()},onFirstFrame:()=>on({type:"scrubDrawn"}),onLog:(he,$e)=>on({type:"log",scope:he.startsWith("playback:")?"playback":"scrub",msg:he,data:$e})}),ye.current!==null){const he=()=>{const $e=ye.current;if($e===null)return;const Ne=kA(x.current,L.current);Gme(Ee.current,t,$e,Ne)&&(ye.current=null,Ee.current&&wA(Ee.current,t,$e,x.current),on({type:"log",scope:"recorded:initial-seek",msg:"config-carried seek fired",data:{epochMs:$e,profile:Ne}}))};X.readyState==="open"?he():X.addEventListener("open",he,{once:!0})}},onVideoElement:X=>{me.current=X}}),$&&(()=>{const X=I?.appearance,he=$==="motion"?X?.motionColor??Qs.motion:$==="audio"?X?.audioColor??Qs.audio:X?.detectionColor??Qs.detection,$e=X?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${$e}px solid ${he}`,boxShadow:`inset 0 0 12px ${he}`,pointerEvents:"none",transform:"translateZ(0)"}})})()]})}function gfe(){const e=Rm("player",()=>window.__CAMSTACK_EMBED__,ffe),[t,n]=T.useState(null);T.useEffect(()=>{const u=w=>{const C=Hme(w);C&&n(C)};window.__camstackEmbedPage={setDevice:u};const x=uu(w=>{w.kind==="setDevice"&&u(w.value)});return()=>{window.__camstackEmbedPage&&delete window.__camstackEmbedPage,x()}},[]);const a=T.useMemo(()=>{if(e===null||!e.ok)return null;const u=vm({serverUrl:e.config.serverUrl,token:e.config.token}),x=new vT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:u,queryClient:x}},[e]);if(T.useEffect(()=>{if(a)return()=>{a.system.close()}},[a]),e===null)return null;if(!e.ok)return v.jsx(MA,{message:e.error});if(!a)return v.jsx(MA,{message:"Failed to initialise the embed player"});const s=t?.deviceId??e.config.deviceId,p=t?.target??e.config.target,f=t?.muted??e.config.muted,m=t?.stats??e.config.stats??!1,h=t!==null?t.snapshot:e.config.snapshot;return v.jsx(tI,{system:a.system,children:v.jsx(bT,{client:a.queryClient,children:v.jsx(y.Provider,{client:a.system.trpcClient,queryClient:a.queryClient,children:v.jsx(hfe,{system:a.system,deviceId:s,initialTarget:p,initialMuted:f,initialStats:m,initialHighlight:e.config.highlight,initialSnapshot:h,initialSeekMs:t===null?e.config.initialSeekMs:void 0},s)})})})}const vfe=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),startMs:l().int().nonnegative().optional()});function yfe(e){if(e==null)return{ok:!1,error:"config is required"};const t=vfe.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 bfe(e,t){const n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}const CA=360*60*1e3,Sfe="scrub unavailable: no open RecordedTrackSession";function Fa(e){on(e)}function pn(e,t,n){try{on({type:"log",scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??"")}catch{}}function xfe({system:e,config:t}){T.useEffect(()=>JN(t.deviceId),[t.deviceId]);const n=T.useRef(null),a=T.useRef(0),s=T.useRef(0),p=T.useRef(0),[f,m]=T.useState({w:window.innerWidth,h:window.innerHeight}),h=T.useMemo(()=>async u=>{const x=n.current;if(!x)return;const w=++p.current;s.current=performance.now(),pn("loadAt","start",{epochMs:u,window:CA}),Fa({type:"state",state:"loading"});try{const C=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:u,toMs:u+CA});if(w!==p.current){pn("loadAt","superseded",{epochMs:u});return}if(pn("loadAt","manifest",{playbackUrl:C?.playbackUrl??null,endpoints:C?.playbackEndpoints?.length??0,localMaster:!!C?.localMasterPath}),!C?.playbackUrl){Fa({type:"state",state:"error",message:"no footage"});return}x.src=C.playbackUrl;const E=()=>{if(w!==p.current)return;const R=typeof x.getStartDate=="function"?x.getStartDate():null,I=R instanceof Date&&!Number.isNaN(R.getTime())?R.getTime():u;a.current=I;const j=bfe(u,I);if(j>0)try{x.currentTime=j}catch(D){pn("loadAt","seek-failed",{msg:String(D)})}x.play().catch(D=>{pn("loadAt","play-rejected",{msg:String(D)})}),pn("loadAt","seek",{epochMs:u,media0Ms:I,offsetSec:j})};x.readyState>=HTMLMediaElement.HAVE_METADATA?E():x.addEventListener("loadedmetadata",E,{once:!0}),pn("loadAt","src-set",{src:C.playbackUrl})}catch(C){pn("loadAt","error",{msg:C instanceof Error?C.message:String(C)}),Fa({type:"state",state:"error",message:C instanceof Error?C.message:String(C)})}},[e,t.deviceId]);return T.useEffect(()=>{pn("init","mounted",{deviceId:t.deviceId,startMs:t.startMs??null,ua:navigator.userAgent});const u=(x,w)=>{pn("scrub","unavailable",{command:x,...w===void 0?{}:{epochMs:w}}),Fa({type:"state",state:"error",message:Sfe})};return window.__camstackRecording={seekTo:x=>{pn("cmd","seekTo",{epochMs:x}),h(x)},play:()=>{pn("cmd","play"),n.current?.play().catch(()=>{})},pause:()=>{pn("cmd","pause"),n.current?.pause()},setRate:x=>{pn("cmd","setRate",{rate:x}),n.current&&(n.current.playbackRate=x)},fit:(x,w)=>{pn("cmd","fit",{w:x,h:w}),m({w:x,h:w})},scrubStart:()=>{pn("cmd","scrubStart"),u("scrubStart")},scrubTo:x=>{pn("cmd","scrubTo",{epochMs:x}),u("scrubTo",x)},scrubEnd:x=>{pn("cmd","scrubEnd",{epochMs:x}),u("scrubEnd",x)}},t.startMs&&t.startMs>0&&h(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording}},[h,t.startMs,t.deviceId]),T.useEffect(()=>uu(u=>{const x=window.__camstackRecording;if(!x)return;switch(u.kind){case"seekTo":x.seekTo(u.value);break;case"play":x.play();break;case"pause":x.pause();break;case"setRate":x.setRate(u.value);break;case"scrubStart":x.scrubStart();break;case"scrubTo":x.scrubTo(u.value);break;case"scrubEnd":x.scrubEnd(u.value);break;case"fit":x.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=>pn("video","loadedmetadata",{w:u.currentTarget.videoWidth,h:u.currentTarget.videoHeight,dur:u.currentTarget.duration}),onPlaying:()=>{pn("video","playing",{vodStartMs:Math.round(performance.now()-s.current)}),Fa({type:"state",state:"playing"})},onPause:()=>Fa({type:"state",state:"paused"}),onEnded:()=>Fa({type:"state",state:"ended"}),onError:u=>{const x=u.currentTarget.error;pn("video","error",{code:x?.code??null,message:x?.message??null}),Fa({type:"state",state:"error",message:x?.message||"video error"})},onTimeUpdate:u=>Fa({type:"position",positionMs:a.current+u.currentTarget.currentTime*1e3})})})}function kfe(){const e=Rm("recording",()=>window.__CAMSTACK_RECORDING__,yfe),t=T.useMemo(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,vm({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return T.useEffect(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?v.jsx(xfe,{system:t,config:e.config}):(Fa({type:"state",state:"error",message:"init failed"}),null):(Fa({type:"state",state:"error",message:e.error}),null)}function wfe(){const e=window.__CAMSTACK_EMBED_MODE__??new URLSearchParams(location.search).get("mode")??"grid";return e==="player"?v.jsx(gfe,{}):e==="recording"?v.jsx(kfe,{}):e==="events"?v.jsx($de,{}):v.jsx(Ume,{})}const AA=document.getElementById("root");AA&&Ij.createRoot(AA).render(v.jsx(wfe,{}));export{wee as C,Nee as E,UT as I,Ife as M,tte as R,ou as S,Bfe as T,Nfe as W,Rte as a,Ffe as b,K as c,gte as d,Eo as e,Ufe as f,qfe as g,Lfe as h,Ofe as i,v as j,Dfe as k,Lg as l,Zy as m,Aj as n,kj as o,bn as p,T as r,zfe as s,lu as u,xp as v};