@camstack/addon-pipeline-orchestrator 1.2.225 → 1.2.226

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 (20) hide show
  1. package/assets/viewer/.viewer-current-files.json +11 -11
  2. package/assets/viewer/.viewer-version +1 -1
  3. package/assets/viewer/_expo/static/js/web/Clipboard-75053b3b6e763e6838d29333f3b8119a.js +8 -0
  4. package/assets/viewer/_expo/static/js/web/Haptics-f6186d079cfa560ae6539f8509170bd7.js +3 -0
  5. package/assets/viewer/_expo/static/js/web/{index-0653df7f859e527ded008e610fdf67d9.js → index-d3aef90ae2a56bb0a84ec49fdf285f91.js} +795 -794
  6. package/assets/viewer/_expo/static/js/web/node-fs-e281fe03bd59b43d130d21108e4766f2.js +1 -0
  7. package/assets/viewer/_expo/static/js/web/node-path-838659d5742f2fa30e13a07c1cda0e7a.js +1 -0
  8. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-DW9iUovV.js → MaskShapeCanvas-DI4BY7W2-C0fGaeA-.js} +1 -1
  9. package/assets/viewer/embed/assets/{MotionZonesSettings-7c3yiT5E-CzRwhaU6.js → MotionZonesSettings-7c3yiT5E-9PMziv1F.js} +1 -1
  10. package/assets/viewer/embed/assets/{PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js → PrivacyMaskSettings-PkYs077O-DXkWrrAk.js} +1 -1
  11. package/assets/viewer/embed/assets/{SceneMonitorEditor-BvDy3x3k-zFGikTQ4.js → SceneMonitorEditor-BvDy3x3k-B9lXS5ns.js} +1 -1
  12. package/assets/viewer/embed/assets/{index-BSfCOPKT.css → index-BW6iV1GH.css} +1 -1
  13. package/assets/viewer/embed/assets/index-Btt6Cej-.js +115 -0
  14. package/assets/viewer/embed/index.html +2 -2
  15. package/assets/viewer/index.html +1 -1
  16. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-DrxNdhAk.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-NwKb20QX.mjs} +1 -1
  17. package/dist/{hostInit-BVu4vjZv.mjs → hostInit-C7R9w_ZP.mjs} +1 -1
  18. package/dist/remoteEntry.js +1 -1
  19. package/package.json +1 -1
  20. package/assets/viewer/embed/assets/index-G1DWVOwz.js +0 -115
@@ -0,0 +1,115 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-7c3yiT5E-9PMziv1F.js","./MaskShapeCanvas-DI4BY7W2-C0fGaeA-.js","./PrivacyMaskSettings-PkYs077O-DXkWrrAk.js","./SceneMonitorEditor-BvDy3x3k-B9lXS5ns.js"])))=>i.map(i=>d[i]);
2
+ function kP(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 wP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jh={exports:{}},yc={};var Tk;function MP(){if(Tk)return yc;Tk=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 yc.Fragment=t,yc.jsx=n,yc.jsxs=n,yc}var _k;function CP(){return _k||(_k=1,Jh.exports=MP()),Jh.exports}var v=CP(),eg={exports:{}},bc={},tg={exports:{}},ng={};var Nk;function AP(){return Nk||(Nk=1,(function(e){function t(B,ue){var ge=B.length;B.push(ue);e:for(;0<ge;){var Re=ge-1>>>1,fe=B[Re];if(0<s(fe,ue))B[Re]=ue,B[ge]=fe,ge=Re;else break e}}function n(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var ue=B[0],ge=B.pop();if(ge!==ue){B[0]=ge;e:for(var Re=0,fe=B.length,q=fe>>>1;Re<q;){var ee=2*(Re+1)-1,X=B[ee],ye=ee+1,te=B[ye];if(0>s(X,ge))ye<fe&&0>s(te,X)?(B[Re]=te,B[ye]=ge,Re=ye):(B[Re]=X,B[ee]=ge,Re=ee);else if(ye<fe&&0>s(te,ge))B[Re]=te,B[ye]=ge,Re=ye;else break e}}return ue}function s(B,ue){var ge=B.sortIndex-ue.sortIndex;return ge!==0?ge:B.id-ue.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var f=Date,m=f.now();e.unstable_now=function(){return f.now()-m}}var h=[],c=[],x=1,M=null,C=3,E=!1,R=!1,_=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function L(B){for(var ue=n(c);ue!==null;){if(ue.callback===null)a(c);else if(ue.startTime<=B)a(c),ue.sortIndex=ue.expirationTime,t(h,ue);else break;ue=n(c)}}function Z(B){if(_=!1,L(B),!R)if(n(h)!==null)R=!0,ne||(ne=!0,Ae());else{var ue=n(c);ue!==null&&Te(Z,ue.startTime-B)}}var ne=!1,V=-1,U=5,pe=-1;function we(){return j?!0:!(e.unstable_now()-pe<U)}function ke(){if(j=!1,ne){var B=e.unstable_now();pe=B;var ue=!0;try{e:{R=!1,_&&(_=!1,z(V),V=-1),E=!0;var ge=C;try{t:{for(L(B),M=n(h);M!==null&&!(M.expirationTime>B&&we());){var Re=M.callback;if(typeof Re=="function"){M.callback=null,C=M.priorityLevel;var fe=Re(M.expirationTime<=B);if(B=e.unstable_now(),typeof fe=="function"){M.callback=fe,L(B),ue=!0;break t}M===n(h)&&a(h),L(B)}else a(h);M=n(h)}if(M!==null)ue=!0;else{var q=n(c);q!==null&&Te(Z,q.startTime-B),ue=!1}}break e}finally{M=null,C=ge,E=!1}ue=void 0}}finally{ue?Ae():ne=!1}}}var Ae;if(typeof F=="function")Ae=function(){F(ke)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,Me=Ce.port2;Ce.port1.onmessage=ke,Ae=function(){Me.postMessage(null)}}else Ae=function(){D(ke,0)};function Te(B,ue){V=D(function(){B(e.unstable_now())},ue)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(B){switch(C){case 1:case 2:case 3:var ue=3;break;default:ue=C}var ge=C;C=ue;try{return B()}finally{C=ge}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(B,ue){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ge=C;C=B;try{return ue()}finally{C=ge}},e.unstable_scheduleCallback=function(B,ue,ge){var Re=e.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?Re+ge:Re):ge=Re,B){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ge+fe,B={id:x++,callback:ue,priorityLevel:B,startTime:ge,expirationTime:fe,sortIndex:-1},ge>Re?(B.sortIndex=ge,t(c,B),n(h)===null&&B===n(c)&&(_?(z(V),V=-1):_=!0,Te(Z,ge-Re))):(B.sortIndex=fe,t(h,B),R||E||(R=!0,ne||(ne=!0,Ae()))),B},e.unstable_shouldYield=we,e.unstable_wrapCallback=function(B){var ue=C;return function(){var ge=C;C=ue;try{return B.apply(this,arguments)}finally{C=ge}}}})(ng)),ng}var Ok;function EP(){return Ok||(Ok=1,tg.exports=AP()),tg.exports}var ag={exports:{}},ot={};var jk;function RP(){if(jk)return ot;jk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),C=Symbol.iterator;function E(q){return q===null||typeof q!="object"?null:(q=C&&q[C]||q["@@iterator"],typeof q=="function"?q:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,j={};function D(q,ee,X){this.props=q,this.context=ee,this.refs=j,this.updater=X||R}D.prototype.isReactComponent={},D.prototype.setState=function(q,ee){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,ee,"setState")},D.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function z(){}z.prototype=D.prototype;function F(q,ee,X){this.props=q,this.context=ee,this.refs=j,this.updater=X||R}var L=F.prototype=new z;L.constructor=F,_(L,D.prototype),L.isPureReactComponent=!0;var Z=Array.isArray;function ne(){}var V={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function pe(q,ee,X){var ye=X.ref;return{$$typeof:e,type:q,key:ee,ref:ye!==void 0?ye:null,props:X}}function we(q,ee){return pe(q.type,ee,q.props)}function ke(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function Ae(q){var ee={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(X){return ee[X]})}var Ce=/\/+/g;function Me(q,ee){return typeof q=="object"&&q!==null&&q.key!=null?Ae(""+q.key):ee.toString(36)}function Te(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(ne,ne):(q.status="pending",q.then(function(ee){q.status==="pending"&&(q.status="fulfilled",q.value=ee)},function(ee){q.status==="pending"&&(q.status="rejected",q.reason=ee)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function B(q,ee,X,ye,te){var he=typeof q;(he==="undefined"||he==="boolean")&&(q=null);var Be=!1;if(q===null)Be=!0;else switch(he){case"bigint":case"string":case"number":Be=!0;break;case"object":switch(q.$$typeof){case e:case t:Be=!0;break;case x:return Be=q._init,B(Be(q._payload),ee,X,ye,te)}}if(Be)return te=te(q),Be=ye===""?"."+Me(q,0):ye,Z(te)?(X="",Be!=null&&(X=Be.replace(Ce,"$&/")+"/"),B(te,ee,X,"",function(Ee){return Ee})):te!=null&&(ke(te)&&(te=we(te,X+(te.key==null||q&&q.key===te.key?"":(""+te.key).replace(Ce,"$&/")+"/")+Be)),ee.push(te)),1;Be=0;var Ue=ye===""?".":ye+":";if(Z(q))for(var re=0;re<q.length;re++)ye=q[re],he=Ue+Me(ye,re),Be+=B(ye,ee,X,he,te);else if(re=E(q),typeof re=="function")for(q=re.call(q),re=0;!(ye=q.next()).done;)ye=ye.value,he=Ue+Me(ye,re++),Be+=B(ye,ee,X,he,te);else if(he==="object"){if(typeof q.then=="function")return B(Te(q),ee,X,ye,te);throw ee=String(q),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return Be}function ue(q,ee,X){if(q==null)return q;var ye=[],te=0;return B(q,ye,"","",function(he){return ee.call(X,he,te++)}),ye}function ge(q){if(q._status===-1){var ee=q._result;ee=ee(),ee.then(function(X){(q._status===0||q._status===-1)&&(q._status=1,q._result=X)},function(X){(q._status===0||q._status===-1)&&(q._status=2,q._result=X)}),q._status===-1&&(q._status=0,q._result=ee)}if(q._status===1)return q._result.default;throw q._result}var Re=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},fe={map:ue,forEach:function(q,ee,X){ue(q,function(){ee.apply(this,arguments)},X)},count:function(q){var ee=0;return ue(q,function(){ee++}),ee},toArray:function(q){return ue(q,function(ee){return ee})||[]},only:function(q){if(!ke(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ot.Activity=M,ot.Children=fe,ot.Component=D,ot.Fragment=n,ot.Profiler=s,ot.PureComponent=F,ot.StrictMode=a,ot.Suspense=h,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,ot.__COMPILER_RUNTIME={__proto__:null,c:function(q){return V.H.useMemoCache(q)}},ot.cache=function(q){return function(){return q.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(q,ee,X){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var ye=_({},q.props),te=q.key;if(ee!=null)for(he in ee.key!==void 0&&(te=""+ee.key),ee)!U.call(ee,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&ee.ref===void 0||(ye[he]=ee[he]);var he=arguments.length-2;if(he===1)ye.children=X;else if(1<he){for(var Be=Array(he),Ue=0;Ue<he;Ue++)Be[Ue]=arguments[Ue+2];ye.children=Be}return pe(q.type,te,ye)},ot.createContext=function(q){return q={$$typeof:f,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:p,_context:q},q},ot.createElement=function(q,ee,X){var ye,te={},he=null;if(ee!=null)for(ye in ee.key!==void 0&&(he=""+ee.key),ee)U.call(ee,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(te[ye]=ee[ye]);var Be=arguments.length-2;if(Be===1)te.children=X;else if(1<Be){for(var Ue=Array(Be),re=0;re<Be;re++)Ue[re]=arguments[re+2];te.children=Ue}if(q&&q.defaultProps)for(ye in Be=q.defaultProps,Be)te[ye]===void 0&&(te[ye]=Be[ye]);return pe(q,he,te)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(q){return{$$typeof:m,render:q}},ot.isValidElement=ke,ot.lazy=function(q){return{$$typeof:x,_payload:{_status:-1,_result:q},_init:ge}},ot.memo=function(q,ee){return{$$typeof:c,type:q,compare:ee===void 0?null:ee}},ot.startTransition=function(q){var ee=V.T,X={};V.T=X;try{var ye=q(),te=V.S;te!==null&&te(X,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(ne,Re)}catch(he){Re(he)}finally{ee!==null&&X.types!==null&&(ee.types=X.types),V.T=ee}},ot.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},ot.use=function(q){return V.H.use(q)},ot.useActionState=function(q,ee,X){return V.H.useActionState(q,ee,X)},ot.useCallback=function(q,ee){return V.H.useCallback(q,ee)},ot.useContext=function(q){return V.H.useContext(q)},ot.useDebugValue=function(){},ot.useDeferredValue=function(q,ee){return V.H.useDeferredValue(q,ee)},ot.useEffect=function(q,ee){return V.H.useEffect(q,ee)},ot.useEffectEvent=function(q){return V.H.useEffectEvent(q)},ot.useId=function(){return V.H.useId()},ot.useImperativeHandle=function(q,ee,X){return V.H.useImperativeHandle(q,ee,X)},ot.useInsertionEffect=function(q,ee){return V.H.useInsertionEffect(q,ee)},ot.useLayoutEffect=function(q,ee){return V.H.useLayoutEffect(q,ee)},ot.useMemo=function(q,ee){return V.H.useMemo(q,ee)},ot.useOptimistic=function(q,ee){return V.H.useOptimistic(q,ee)},ot.useReducer=function(q,ee,X){return V.H.useReducer(q,ee,X)},ot.useRef=function(q){return V.H.useRef(q)},ot.useState=function(q){return V.H.useState(q)},ot.useSyncExternalStore=function(q,ee,X){return V.H.useSyncExternalStore(q,ee,X)},ot.useTransition=function(){return V.H.useTransition()},ot.version="19.2.3",ot}var Pk;function yb(){return Pk||(Pk=1,ag.exports=RP()),ag.exports}var ig={exports:{}},$n={};var Dk;function IP(){if(Dk)return $n;Dk=1;var e=yb();function t(h){var c="https://react.dev/errors/"+h;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)c+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+h+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function p(h,c,x){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:M==null?null:""+M,children:h,containerInfo:c,implementation:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,c){if(h==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,$n.createPortal=function(h,c){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return p(h,c,null,x)},$n.flushSync=function(h){var c=f.T,x=a.p;try{if(f.T=null,a.p=2,h)return h()}finally{f.T=c,a.p=x,a.d.f()}},$n.preconnect=function(h,c){typeof h=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,a.d.C(h,c))},$n.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},$n.preinit=function(h,c){if(typeof h=="string"&&c&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin),C=typeof c.integrity=="string"?c.integrity:void 0,E=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;x==="style"?a.d.S(h,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:M,integrity:C,fetchPriority:E}):x==="script"&&a.d.X(h,{crossOrigin:M,integrity:C,fetchPriority:E,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},$n.preinitModule=function(h,c){if(typeof h=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var x=m(c.as,c.crossOrigin);a.d.M(h,{crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&a.d.M(h)},$n.preload=function(h,c){if(typeof h=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin);a.d.L(h,x,{crossOrigin:M,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},$n.preloadModule=function(h,c){if(typeof h=="string")if(c){var x=m(c.as,c.crossOrigin);a.d.m(h,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else a.d.m(h)},$n.requestFormReset=function(h){a.d.r(h)},$n.unstable_batchedUpdates=function(h,c){return h(c)},$n.useFormState=function(h,c,x){return f.H.useFormState(h,c,x)},$n.useFormStatus=function(){return f.H.useHostTransitionStatus()},$n.version="19.2.3",$n}var zk;function cE(){if(zk)return ig.exports;zk=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(),ig.exports=IP(),ig.exports}var Lk;function TP(){if(Lk)return bc;Lk=1;var e=EP(),t=yb(),n=cE();function a(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function p(i){var r=i,u=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(u=r.return),i=r.return;while(i)}return r.tag===3?u:null}function f(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function m(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(p(i)!==i)throw Error(a(188))}function c(i){var r=i.alternate;if(!r){if(r=p(i),r===null)throw Error(a(188));return r!==i?null:i}for(var u=i,g=r;;){var S=u.return;if(S===null)break;var k=S.alternate;if(k===null){if(g=S.return,g!==null){u=g;continue}break}if(S.child===k.child){for(k=S.child;k;){if(k===u)return h(S),i;if(k===g)return h(S),r;k=k.sibling}throw Error(a(188))}if(u.return!==g.return)u=S,g=k;else{for(var I=!1,P=S.child;P;){if(P===u){I=!0,u=S,g=k;break}if(P===g){I=!0,g=S,u=k;break}P=P.sibling}if(!I){for(P=k.child;P;){if(P===u){I=!0,u=k,g=S;break}if(P===g){I=!0,g=k,u=S;break}P=P.sibling}if(!I)throw Error(a(189))}}if(u.alternate!==g)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?i:r}function x(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=x(i),r!==null)return r;i=i.sibling}return null}var M=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),F=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),ke=Symbol.iterator;function Ae(i){return i===null||typeof i!="object"?null:(i=ke&&i[ke]||i["@@iterator"],typeof i=="function"?i:null)}var Ce=Symbol.for("react.client.reference");function Me(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ce?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case D:return"Profiler";case j:return"StrictMode";case Z:return"Suspense";case ne:return"SuspenseList";case pe:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case R:return"Portal";case F:return i.displayName||"Context";case z:return(i._context.displayName||"Context")+".Consumer";case L:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return r=i.displayName||null,r!==null?r:Me(i.type)||"Memo";case U:r=i._payload,i=i._init;try{return Me(i(r))}catch{}}return null}var Te=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},Re=[],fe=-1;function q(i){return{current:i}}function ee(i){0>fe||(i.current=Re[fe],Re[fe]=null,fe--)}function X(i,r){fe++,Re[fe]=i.current,i.current=r}var ye=q(null),te=q(null),he=q(null),Be=q(null);function Ue(i,r){switch(X(he,r),X(te,i),X(ye,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Jx(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Jx(r),i=ek(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ee(ye),X(ye,i)}function re(){ee(ye),ee(te),ee(he)}function Ee(i){i.memoizedState!==null&&X(Be,i);var r=ye.current,u=ek(r,i.type);r!==u&&(X(te,i),X(ye,u))}function nt(i){te.current===i&&(ee(ye),ee(te)),Be.current===i&&(ee(Be),fc._currentValue=ge)}var Ye,St;function Le(i){if(Ye===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Ye=r&&r[1]||"",St=-1<u.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ye+i+St}var qe=!1;function Ie(i,r){if(!i||qe)return"";qe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ce){var oe=ce}Reflect.construct(i,[],Se)}else{try{Se.call()}catch(ce){oe=ce}i.call(Se.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(Se=i())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),I=k[0],P=k[1];if(I&&P){var $=I.split(`
5
+ `),ie=P.split(`
6
+ `);for(S=g=0;g<$.length&&!$[g].includes("DetermineComponentFrameRoot");)g++;for(;S<ie.length&&!ie[S].includes("DetermineComponentFrameRoot");)S++;if(g===$.length||S===ie.length)for(g=$.length-1,S=ie.length-1;1<=g&&0<=S&&$[g]!==ie[S];)S--;for(;1<=g&&0<=S;g--,S--)if($[g]!==ie[S]){if(g!==1||S!==1)do if(g--,S--,0>S||$[g]!==ie[S]){var me=`
7
+ `+$[g].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=g&&0<=S);break}}}finally{qe=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Le(u):""}function Ge(i,r){switch(i.tag){case 26:case 27:case 5:return Le(i.type);case 16:return Le("Lazy");case 13:return i.child!==r&&r!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Ie(i.type,!1);case 11:return Ie(i.type.render,!1);case 1:return Ie(i.type,!0);case 31:return Le("Activity");default:return""}}function Je(i){try{var r="",u=null;do r+=Ge(i,u),u=i,i=i.return;while(i);return r}catch(g){return`
8
+ Error generating stack: `+g.message+`
9
+ `+g.stack}}var Ct=Object.prototype.hasOwnProperty,dt=e.unstable_scheduleCallback,Tt=e.unstable_cancelCallback,Yt=e.unstable_shouldYield,En=e.unstable_requestPaint,pn=e.unstable_now,Vn=e.unstable_getCurrentPriorityLevel,aa=e.unstable_ImmediatePriority,pr=e.unstable_UserBlockingPriority,ia=e.unstable_NormalPriority,ga=e.unstable_LowPriority,it=e.unstable_IdlePriority,nn=e.log,Ta=e.unstable_setDisableYieldValue,Gn=null,Rn=null;function _a(i){if(typeof nn=="function"&&Ta(i),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode(Gn,i)}catch{}}var In=Math.clz32?Math.clz32:Xo,io=Math.log,Yo=Math.LN2;function Xo(i){return i>>>=0,i===0?32:31-(io(i)/Yo|0)|0}var li=256,be=262144,xe=4194304;function st(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Qt(i,r,u){var g=i.pendingLanes;if(g===0)return 0;var S=0,k=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var P=g&134217727;return P!==0?(g=P&~k,g!==0?S=st(g):(I&=P,I!==0?S=st(I):u||(u=P&~i,u!==0&&(S=st(u))))):(P=g&~k,P!==0?S=st(P):I!==0?S=st(I):u||(u=g&~i,u!==0&&(S=st(u)))),S===0?0:r!==0&&r!==S&&(r&k)===0&&(k=S&-S,u=r&-r,k>=u||k===32&&(u&4194048)!==0)?r:S}function Zn(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Qa(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 Jo(){var i=xe;return xe<<=1,(xe&62914560)===0&&(xe=4194304),i}function Ml(i){for(var r=[],u=0;31>u;u++)r.push(i);return r}function Ri(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ii(i,r,u,g,S,k){var I=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var P=i.entanglements,$=i.expirationTimes,ie=i.hiddenUpdates;for(u=I&~u;0<u;){var me=31-In(u),Se=1<<me;P[me]=0,$[me]=-1;var oe=ie[me];if(oe!==null)for(ie[me]=null,me=0;me<oe.length;me++){var ce=oe[me];ce!==null&&(ce.lane&=-536870913)}u&=~Se}g!==0&&Cl(i,g,0),k!==0&&S===0&&i.tag!==0&&(i.suspendedLanes|=k&~(I&~r))}function Cl(i,r,u){i.pendingLanes|=r,i.suspendedLanes&=~r;var g=31-In(r);i.entangledLanes|=r,i.entanglements[g]=i.entanglements[g]|1073741824|u&261930}function Al(i,r){var u=i.entangledLanes|=r;for(i=i.entanglements;u;){var g=31-In(u),S=1<<g;S&r|i[g]&r&&(i[g]|=r),u&=~S}}function es(i,r){var u=r&-r;return u=(u&42)!==0?1:Na(u),(u&(i.suspendedLanes|r))!==0?0:u}function Na(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 ts(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function El(){var i=ue.p;return i!==0?i:(i=window.event,i===void 0?32:wk(i.type))}function Rl(i,r){var u=ue.p;try{return ue.p=i,r()}finally{ue.p=u}}var Va=Math.random().toString(36).slice(2),yn="__reactFiber$"+Va,Pn="__reactProps$"+Va,mr="__reactContainer$"+Va,Il="__reactEvents$"+Va,Wm="__reactListeners$"+Va,Ym="__reactHandles$"+Va,Tl="__reactResources$"+Va,fr="__reactMarker$"+Va;function ns(i){delete i[yn],delete i[Pn],delete i[Il],delete i[Wm],delete i[Ym]}function Ti(i){var r=i[yn];if(r)return r;for(var u=i.parentNode;u;){if(r=u[mr]||u[yn]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(i=sk(i);i!==null;){if(u=i[yn])return u;i=sk(i)}return r}i=u,u=i.parentNode}return null}function _i(i){if(i=i[yn]||i[mr]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function ci(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function hr(i){var r=i[Tl];return r||(r=i[Tl]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function bn(i){i[fr]=!0}var ro=new Set,_l={};function Ga(i,r){Ni(i,r),Ni(i+"Capture",r)}function Ni(i,r){for(_l[i]=r,i=0;i<r.length;i++)ro.add(r[i])}var ju=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]*$"),as={},is={};function Pu(i){return Ct.call(is,i)?!0:Ct.call(as,i)?!1:ju.test(i)?is[i]=!0:(as[i]=!0,!1)}function rs(i,r,u){if(Pu(r))if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var g=r.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+u)}}function Oa(i,r,u){if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+u)}}function Za(i,r,u,g){if(g===null)i.removeAttribute(u);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(r,u,""+g)}}function le(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ne(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function at(i,r,u){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,k=g.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return S.call(this)},set:function(I){u=""+I,k.call(this,I)}}),Object.defineProperty(i,r,{enumerable:g.enumerable}),{getValue:function(){return u},setValue:function(I){u=""+I},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function At(i){if(!i._valueTracker){var r=Ne(i)?"checked":"value";i._valueTracker=at(i,r,""+i[r])}}function Xe(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var u=r.getValue(),g="";return i&&(g=Ne(i)?i.checked?"true":"false":i.value),i=g,i!==u?(r.setValue(i),!0):!1}function Nt(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 He=/[\n"\\]/g;function et(i){return i.replace(He,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function an(i,r,u,g,S,k,I,P){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),r!=null?I==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+le(r)):i.value!==""+le(r)&&(i.value=""+le(r)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),r!=null?Ve(i,I,le(r)):u!=null?Ve(i,I,le(u)):g!=null&&i.removeAttribute("value"),S==null&&k!=null&&(i.defaultChecked=!!k),S!=null&&(i.checked=S&&typeof S!="function"&&typeof S!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.name=""+le(P):i.removeAttribute("name")}function Tn(i,r,u,g,S,k,I,P){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),r!=null||u!=null){if(!(k!=="submit"&&k!=="reset"||r!=null)){At(i);return}u=u!=null?""+le(u):"",r=r!=null?""+le(r):u,P||r===i.value||(i.value=r),i.defaultValue=r}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=P?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),At(i)}function Ve(i,r,u){r==="number"&&Nt(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Xt(i,r,u,g){if(i=i.options,r){r={};for(var S=0;S<u.length;S++)r["$"+u[S]]=!0;for(u=0;u<i.length;u++)S=r.hasOwnProperty("$"+i[u].value),i[u].selected!==S&&(i[u].selected=S),S&&g&&(i[u].defaultSelected=!0)}else{for(u=""+le(u),r=null,S=0;S<i.length;S++){if(i[S].value===u){i[S].selected=!0,g&&(i[S].defaultSelected=!0);return}r!==null||i[S].disabled||(r=i[S])}r!==null&&(r.selected=!0)}}function sn(i,r,u){if(r!=null&&(r=""+le(r),r!==i.value&&(i.value=r),u==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=u!=null?""+le(u):""}function Dn(i,r,u,g){if(r==null){if(g!=null){if(u!=null)throw Error(a(92));if(Te(g)){if(1<g.length)throw Error(a(93));g=g[0]}u=g}u==null&&(u=""),r=u}u=le(r),i.defaultValue=u,g=i.textContent,g===u&&g!==""&&g!==null&&(i.value=g),At(i)}function _n(i,r){if(r){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=r;return}}i.textContent=r}var mn=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 qt(i,r,u){var g=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?g?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":g?i.setProperty(r,u):typeof u!="number"||u===0||mn.has(r)?r==="float"?i.cssFloat=u:i[r]=(""+u).trim():i[r]=u+"px"}function va(i,r,u){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,u!=null){for(var g in u)!u.hasOwnProperty(g)||r!=null&&r.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var S in r)g=r[S],r.hasOwnProperty(S)&&u[S]!==g&&qt(i,S,g)}else for(var k in r)r.hasOwnProperty(k)&&qt(i,k,r[k])}function rt(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 ui=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"]]),di=/^[\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 Hn(i){return di.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ze(){}var xt=null;function Kn(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ka=null,pi=null;function oo(i){var r=_i(i);if(r&&(i=r.stateNode)){var u=i[Pn]||null;e:switch(i=r.stateNode,r.type){case"input":if(an(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+et(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var g=u[r];if(g!==i&&g.form===i.form){var S=g[Pn]||null;if(!S)throw Error(a(90));an(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<u.length;r++)g=u[r],g.form===i.form&&Xe(g)}break e;case"textarea":sn(i,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&Xt(i,!!u.multiple,r,!1)}}}var Oi=!1;function ji(i,r,u){if(Oi)return i(r,u);Oi=!0;try{var g=i(r);return g}finally{if(Oi=!1,(Ka!==null||pi!==null)&&(kd(),Ka&&(r=Ka,i=pi,pi=Ka=null,oo(r),i)))for(r=0;r<i.length;r++)oo(i[r])}}function Pi(i,r){var u=i.stateNode;if(u===null)return null;var g=u[Pn]||null;if(g===null)return null;u=g[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(a(231,r,typeof u));return u}var Di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xm=!1;if(Di)try{var Nl={};Object.defineProperty(Nl,"passive",{get:function(){Xm=!0}}),window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{Xm=!1}var gr=null,Jm=null,Du=null;function e1(){if(Du)return Du;var i,r=Jm,u=r.length,g,S="value"in gr?gr.value:gr.textContent,k=S.length;for(i=0;i<u&&r[i]===S[i];i++);var I=u-i;for(g=1;g<=I&&r[u-g]===S[k-g];g++);return Du=S.slice(i,1<g?1-g:void 0)}function zu(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 Lu(){return!0}function t1(){return!1}function ra(i){function r(u,g,S,k,I){this._reactName=u,this._targetInst=S,this.type=g,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var P in i)i.hasOwnProperty(P)&&(u=i[P],this[P]=u?u(k):k[P]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Lu:t1,this.isPropagationStopped=t1,this}return M(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Lu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Lu)},persist:function(){},isPersistent:Lu}),r}var so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qu=ra(so),Ol=M({},so,{view:0,detail:0}),SO=ra(Ol),ef,tf,jl,Bu=M({},Ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,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!==jl&&(jl&&i.type==="mousemove"?(ef=i.screenX-jl.screenX,tf=i.screenY-jl.screenY):tf=ef=0,jl=i),ef)},movementY:function(i){return"movementY"in i?i.movementY:tf}}),n1=ra(Bu),xO=M({},Bu,{dataTransfer:0}),kO=ra(xO),wO=M({},Ol,{relatedTarget:0}),nf=ra(wO),MO=M({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),CO=ra(MO),AO=M({},so,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),EO=ra(AO),RO=M({},so,{data:0}),a1=ra(RO),IO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TO={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"},_O={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NO(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=_O[i])?!!r[i]:!1}function af(){return NO}var OO=M({},Ol,{key:function(i){if(i.key){var r=IO[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=zu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?TO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(i){return i.type==="keypress"?zu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?zu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),jO=ra(OO),PO=M({},Bu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i1=ra(PO),DO=M({},Ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),zO=ra(DO),LO=M({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),qO=ra(LO),BO=M({},Bu,{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}),FO=ra(BO),UO=M({},so,{newState:0,oldState:0}),HO=ra(UO),$O=[9,13,27,32],rf=Di&&"CompositionEvent"in window,Pl=null;Di&&"documentMode"in document&&(Pl=document.documentMode);var QO=Di&&"TextEvent"in window&&!Pl,r1=Di&&(!rf||Pl&&8<Pl&&11>=Pl),o1=" ",s1=!1;function l1(i,r){switch(i){case"keyup":return $O.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var os=!1;function VO(i,r){switch(i){case"compositionend":return c1(r);case"keypress":return r.which!==32?null:(s1=!0,o1);case"textInput":return i=r.data,i===o1&&s1?null:i;default:return null}}function GO(i,r){if(os)return i==="compositionend"||!rf&&l1(i,r)?(i=e1(),Du=Jm=gr=null,os=!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 r1&&r.locale!=="ko"?null:r.data;default:return null}}var ZO={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 u1(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!ZO[i.type]:r==="textarea"}function d1(i,r,u,g){Ka?pi?pi.push(g):pi=[g]:Ka=g,r=Id(r,"onChange"),0<r.length&&(u=new qu("onChange","change",null,u,g),i.push({event:u,listeners:r}))}var Dl=null,zl=null;function KO(i){Gx(i,0)}function Fu(i){var r=ci(i);if(Xe(r))return i}function p1(i,r){if(i==="change")return r}var m1=!1;if(Di){var of;if(Di){var sf="oninput"in document;if(!sf){var f1=document.createElement("div");f1.setAttribute("oninput","return;"),sf=typeof f1.oninput=="function"}of=sf}else of=!1;m1=of&&(!document.documentMode||9<document.documentMode)}function h1(){Dl&&(Dl.detachEvent("onpropertychange",g1),zl=Dl=null)}function g1(i){if(i.propertyName==="value"&&Fu(zl)){var r=[];d1(r,zl,i,Kn(i)),ji(KO,r)}}function WO(i,r,u){i==="focusin"?(h1(),Dl=r,zl=u,Dl.attachEvent("onpropertychange",g1)):i==="focusout"&&h1()}function YO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Fu(zl)}function XO(i,r){if(i==="click")return Fu(r)}function JO(i,r){if(i==="input"||i==="change")return Fu(r)}function ej(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ya=typeof Object.is=="function"?Object.is:ej;function Ll(i,r){if(ya(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var u=Object.keys(i),g=Object.keys(r);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var S=u[g];if(!Ct.call(r,S)||!ya(i[S],r[S]))return!1}return!0}function v1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function y1(i,r){var u=v1(i);i=0;for(var g;u;){if(u.nodeType===3){if(g=i+u.textContent.length,i<=r&&g>=r)return{node:u,offset:r-i};i=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=v1(u)}}function b1(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?b1(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function S1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Nt(i.document);r instanceof i.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)i=r.contentWindow;else break;r=Nt(i.document)}return r}function lf(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 tj=Di&&"documentMode"in document&&11>=document.documentMode,ss=null,cf=null,ql=null,uf=!1;function x1(i,r,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;uf||ss==null||ss!==Nt(g)||(g=ss,"selectionStart"in g&&lf(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}),ql&&Ll(ql,g)||(ql=g,g=Id(cf,"onSelect"),0<g.length&&(r=new qu("onSelect","select",null,r,u),i.push({event:r,listeners:g}),r.target=ss)))}function lo(i,r){var u={};return u[i.toLowerCase()]=r.toLowerCase(),u["Webkit"+i]="webkit"+r,u["Moz"+i]="moz"+r,u}var ls={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionrun:lo("Transition","TransitionRun"),transitionstart:lo("Transition","TransitionStart"),transitioncancel:lo("Transition","TransitionCancel"),transitionend:lo("Transition","TransitionEnd")},df={},k1={};Di&&(k1=document.createElement("div").style,"AnimationEvent"in window||(delete ls.animationend.animation,delete ls.animationiteration.animation,delete ls.animationstart.animation),"TransitionEvent"in window||delete ls.transitionend.transition);function co(i){if(df[i])return df[i];if(!ls[i])return i;var r=ls[i],u;for(u in r)if(r.hasOwnProperty(u)&&u in k1)return df[i]=r[u];return i}var w1=co("animationend"),M1=co("animationiteration"),C1=co("animationstart"),nj=co("transitionrun"),aj=co("transitionstart"),ij=co("transitioncancel"),A1=co("transitionend"),E1=new Map,pf="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(" ");pf.push("scrollEnd");function Wa(i,r){E1.set(i,r),Ga(r,[i])}var Uu=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)},ja=[],cs=0,mf=0;function Hu(){for(var i=cs,r=mf=cs=0;r<i;){var u=ja[r];ja[r++]=null;var g=ja[r];ja[r++]=null;var S=ja[r];ja[r++]=null;var k=ja[r];if(ja[r++]=null,g!==null&&S!==null){var I=g.pending;I===null?S.next=S:(S.next=I.next,I.next=S),g.pending=S}k!==0&&R1(u,S,k)}}function $u(i,r,u,g){ja[cs++]=i,ja[cs++]=r,ja[cs++]=u,ja[cs++]=g,mf|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function ff(i,r,u,g){return $u(i,r,u,g),Qu(i)}function uo(i,r){return $u(i,null,null,r),Qu(i)}function R1(i,r,u){i.lanes|=u;var g=i.alternate;g!==null&&(g.lanes|=u);for(var S=!1,k=i.return;k!==null;)k.childLanes|=u,g=k.alternate,g!==null&&(g.childLanes|=u),k.tag===22&&(i=k.stateNode,i===null||i._visibility&1||(S=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,S&&r!==null&&(S=31-In(u),i=k.hiddenUpdates,g=i[S],g===null?i[S]=[r]:g.push(r),r.lane=u|536870912),k):null}function Qu(i){if(50<sc)throw sc=0,wh=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var us={};function rj(i,r,u,g){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(i,r,u,g){return new rj(i,r,u,g)}function hf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function zi(i,r){var u=i.alternate;return u===null?(u=ba(i.tag,r,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=r,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,r=i.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function I1(i,r){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,r=u.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Vu(i,r,u,g,S,k){var I=0;if(g=i,typeof i=="function")hf(i)&&(I=1);else if(typeof i=="string")I=uP(i,u,ye.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case pe:return i=ba(31,u,r,S),i.elementType=pe,i.lanes=k,i;case _:return po(u.children,S,k,r);case j:I=8,S|=24;break;case D:return i=ba(12,u,r,S|2),i.elementType=D,i.lanes=k,i;case Z:return i=ba(13,u,r,S),i.elementType=Z,i.lanes=k,i;case ne:return i=ba(19,u,r,S),i.elementType=ne,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case F:I=10;break e;case z:I=9;break e;case L:I=11;break e;case V:I=14;break e;case U:I=16,g=null;break e}I=29,u=Error(a(130,i===null?"null":typeof i,"")),g=null}return r=ba(I,u,r,S),r.elementType=i,r.type=g,r.lanes=k,r}function po(i,r,u,g){return i=ba(7,i,g,r),i.lanes=u,i}function gf(i,r,u){return i=ba(6,i,null,r),i.lanes=u,i}function T1(i){var r=ba(18,null,null,0);return r.stateNode=i,r}function vf(i,r,u){return r=ba(4,i.children!==null?i.children:[],i.key,r),r.lanes=u,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var _1=new WeakMap;function Pa(i,r){if(typeof i=="object"&&i!==null){var u=_1.get(i);return u!==void 0?u:(r={value:i,source:r,stack:Je(r)},_1.set(i,r),r)}return{value:i,source:r,stack:Je(r)}}var ds=[],ps=0,Gu=null,Bl=0,Da=[],za=0,vr=null,mi=1,fi="";function Li(i,r){ds[ps++]=Bl,ds[ps++]=Gu,Gu=i,Bl=r}function N1(i,r,u){Da[za++]=mi,Da[za++]=fi,Da[za++]=vr,vr=i;var g=mi;i=fi;var S=32-In(g)-1;g&=~(1<<S),u+=1;var k=32-In(r)+S;if(30<k){var I=S-S%5;k=(g&(1<<I)-1).toString(32),g>>=I,S-=I,mi=1<<32-In(r)+S|u<<S|g,fi=k+i}else mi=1<<k|u<<S|g,fi=i}function yf(i){i.return!==null&&(Li(i,1),N1(i,1,0))}function bf(i){for(;i===Gu;)Gu=ds[--ps],ds[ps]=null,Bl=ds[--ps],ds[ps]=null;for(;i===vr;)vr=Da[--za],Da[za]=null,fi=Da[--za],Da[za]=null,mi=Da[--za],Da[za]=null}function O1(i,r){Da[za++]=mi,Da[za++]=fi,Da[za++]=vr,mi=r.id,fi=r.overflow,vr=i}var zn=null,Zt=null,kt=!1,yr=null,La=!1,Sf=Error(a(519));function br(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fl(Pa(r,i)),Sf}function j1(i){var r=i.stateNode,u=i.type,g=i.memoizedProps;switch(r[yn]=i,r[Pn]=g,u){case"dialog":ft("cancel",r),ft("close",r);break;case"iframe":case"object":case"embed":ft("load",r);break;case"video":case"audio":for(u=0;u<cc.length;u++)ft(cc[u],r);break;case"source":ft("error",r);break;case"img":case"image":case"link":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"input":ft("invalid",r),Tn(r,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ft("invalid",r);break;case"textarea":ft("invalid",r),Dn(r,g.value,g.defaultValue,g.children)}u=g.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||g.suppressHydrationWarning===!0||Yx(r.textContent,u)?(g.popover!=null&&(ft("beforetoggle",r),ft("toggle",r)),g.onScroll!=null&&ft("scroll",r),g.onScrollEnd!=null&&ft("scrollend",r),g.onClick!=null&&(r.onclick=Ze),r=!0):r=!1,r||br(i,!0)}function P1(i){for(zn=i.return;zn;)switch(zn.tag){case 5:case 31:case 13:La=!1;return;case 27:case 3:La=!0;return;default:zn=zn.return}}function ms(i){if(i!==zn)return!1;if(!kt)return P1(i),kt=!0,!1;var r=i.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Lh(i.type,i.memoizedProps)),u=!u),u&&Zt&&br(i),P1(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Zt=ok(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Zt=ok(i)}else r===27?(r=Zt,Or(i.type)?(i=Hh,Hh=null,Zt=i):Zt=r):Zt=zn?Ba(i.stateNode.nextSibling):null;return!0}function mo(){Zt=zn=null,kt=!1}function xf(){var i=yr;return i!==null&&(ca===null?ca=i:ca.push.apply(ca,i),yr=null),i}function Fl(i){yr===null?yr=[i]:yr.push(i)}var kf=q(null),fo=null,qi=null;function Sr(i,r,u){X(kf,r._currentValue),r._currentValue=u}function Bi(i){i._currentValue=kf.current,ee(kf)}function wf(i,r,u){for(;i!==null;){var g=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,g!==null&&(g.childLanes|=r)):g!==null&&(g.childLanes&r)!==r&&(g.childLanes|=r),i===u)break;i=i.return}}function Mf(i,r,u,g){var S=i.child;for(S!==null&&(S.return=i);S!==null;){var k=S.dependencies;if(k!==null){var I=S.child;k=k.firstContext;e:for(;k!==null;){var P=k;k=S;for(var $=0;$<r.length;$++)if(P.context===r[$]){k.lanes|=u,P=k.alternate,P!==null&&(P.lanes|=u),wf(k.return,u,i),g||(I=null);break e}k=P.next}}else if(S.tag===18){if(I=S.return,I===null)throw Error(a(341));I.lanes|=u,k=I.alternate,k!==null&&(k.lanes|=u),wf(I,u,i),I=null}else I=S.child;if(I!==null)I.return=S;else for(I=S;I!==null;){if(I===i){I=null;break}if(S=I.sibling,S!==null){S.return=I.return,I=S;break}I=I.return}S=I}}function fs(i,r,u,g){i=null;for(var S=r,k=!1;S!==null;){if(!k){if((S.flags&524288)!==0)k=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var I=S.alternate;if(I===null)throw Error(a(387));if(I=I.memoizedProps,I!==null){var P=S.type;ya(S.pendingProps.value,I.value)||(i!==null?i.push(P):i=[P])}}else if(S===Be.current){if(I=S.alternate,I===null)throw Error(a(387));I.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(i!==null?i.push(fc):i=[fc])}S=S.return}i!==null&&Mf(r,i,u,g),r.flags|=262144}function Zu(i){for(i=i.firstContext;i!==null;){if(!ya(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ho(i){fo=i,qi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ln(i){return D1(fo,i)}function Ku(i,r){return fo===null&&ho(i),D1(i,r)}function D1(i,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},qi===null){if(i===null)throw Error(a(308));qi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else qi=qi.next=r;return u}var oj=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(u,g){i.push(g)}};this.abort=function(){r.aborted=!0,i.forEach(function(u){return u()})}},sj=e.unstable_scheduleCallback,lj=e.unstable_NormalPriority,Sn={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cf(){return{controller:new oj,data:new Map,refCount:0}}function Ul(i){i.refCount--,i.refCount===0&&sj(lj,function(){i.controller.abort()})}var Hl=null,Af=0,hs=0,gs=null;function cj(i,r){if(Hl===null){var u=Hl=[];Af=0,hs=Ih(),gs={status:"pending",value:void 0,then:function(g){u.push(g)}}}return Af++,r.then(z1,z1),r}function z1(){if(--Af===0&&Hl!==null){gs!==null&&(gs.status="fulfilled");var i=Hl;Hl=null,hs=0,gs=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function uj(i,r){var u=[],g={status:"pending",value:null,reason:null,then:function(S){u.push(S)}};return i.then(function(){g.status="fulfilled",g.value=r;for(var S=0;S<u.length;S++)(0,u[S])(r)},function(S){for(g.status="rejected",g.reason=S,S=0;S<u.length;S++)(0,u[S])(void 0)}),g}var L1=B.S;B.S=function(i,r){xx=pn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&cj(i,r),L1!==null&&L1(i,r)};var go=q(null);function Ef(){var i=go.current;return i!==null?i:Vt.pooledCache}function Wu(i,r){r===null?X(go,go.current):X(go,r.pool)}function q1(){var i=Ef();return i===null?null:{parent:Sn._currentValue,pool:i}}var vs=Error(a(460)),Rf=Error(a(474)),Yu=Error(a(542)),Xu={then:function(){}};function B1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function F1(i,r,u){switch(u=i[u],u===void 0?i.push(r):u!==r&&(r.then(Ze,Ze),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,H1(i),i;default:if(typeof r.status=="string")r.then(Ze,Ze);else{if(i=Vt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(g){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=g}},function(g){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,H1(i),i}throw yo=r,vs}}function vo(i){try{var r=i._init;return r(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(yo=u,vs):u}}var yo=null;function U1(){if(yo===null)throw Error(a(459));var i=yo;return yo=null,i}function H1(i){if(i===vs||i===Yu)throw Error(a(483))}var ys=null,$l=0;function Ju(i){var r=$l;return $l+=1,ys===null&&(ys=[]),F1(ys,i,r)}function Ql(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function ed(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 $1(i){function r(W,K){if(i){var ae=W.deletions;ae===null?(W.deletions=[K],W.flags|=16):ae.push(K)}}function u(W,K){if(!i)return null;for(;K!==null;)r(W,K),K=K.sibling;return null}function g(W){for(var K=new Map;W!==null;)W.key!==null?K.set(W.key,W):K.set(W.index,W),W=W.sibling;return K}function S(W,K){return W=zi(W,K),W.index=0,W.sibling=null,W}function k(W,K,ae){return W.index=ae,i?(ae=W.alternate,ae!==null?(ae=ae.index,ae<K?(W.flags|=67108866,K):ae):(W.flags|=67108866,K)):(W.flags|=1048576,K)}function I(W){return i&&W.alternate===null&&(W.flags|=67108866),W}function P(W,K,ae,ve){return K===null||K.tag!==6?(K=gf(ae,W.mode,ve),K.return=W,K):(K=S(K,ae),K.return=W,K)}function $(W,K,ae,ve){var Qe=ae.type;return Qe===_?me(W,K,ae.props.children,ve,ae.key):K!==null&&(K.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===U&&vo(Qe)===K.type)?(K=S(K,ae.props),Ql(K,ae),K.return=W,K):(K=Vu(ae.type,ae.key,ae.props,null,W.mode,ve),Ql(K,ae),K.return=W,K)}function ie(W,K,ae,ve){return K===null||K.tag!==4||K.stateNode.containerInfo!==ae.containerInfo||K.stateNode.implementation!==ae.implementation?(K=vf(ae,W.mode,ve),K.return=W,K):(K=S(K,ae.children||[]),K.return=W,K)}function me(W,K,ae,ve,Qe){return K===null||K.tag!==7?(K=po(ae,W.mode,ve,Qe),K.return=W,K):(K=S(K,ae),K.return=W,K)}function Se(W,K,ae){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=gf(""+K,W.mode,ae),K.return=W,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case E:return ae=Vu(K.type,K.key,K.props,null,W.mode,ae),Ql(ae,K),ae.return=W,ae;case R:return K=vf(K,W.mode,ae),K.return=W,K;case U:return K=vo(K),Se(W,K,ae)}if(Te(K)||Ae(K))return K=po(K,W.mode,ae,null),K.return=W,K;if(typeof K.then=="function")return Se(W,Ju(K),ae);if(K.$$typeof===F)return Se(W,Ku(W,K),ae);ed(W,K)}return null}function oe(W,K,ae,ve){var Qe=K!==null?K.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Qe!==null?null:P(W,K,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case E:return ae.key===Qe?$(W,K,ae,ve):null;case R:return ae.key===Qe?ie(W,K,ae,ve):null;case U:return ae=vo(ae),oe(W,K,ae,ve)}if(Te(ae)||Ae(ae))return Qe!==null?null:me(W,K,ae,ve,null);if(typeof ae.then=="function")return oe(W,K,Ju(ae),ve);if(ae.$$typeof===F)return oe(W,K,Ku(W,ae),ve);ed(W,ae)}return null}function ce(W,K,ae,ve,Qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return W=W.get(ae)||null,P(K,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,$(K,W,ve,Qe);case R:return W=W.get(ve.key===null?ae:ve.key)||null,ie(K,W,ve,Qe);case U:return ve=vo(ve),ce(W,K,ae,ve,Qe)}if(Te(ve)||Ae(ve))return W=W.get(ae)||null,me(K,W,ve,Qe,null);if(typeof ve.then=="function")return ce(W,K,ae,Ju(ve),Qe);if(ve.$$typeof===F)return ce(W,K,ae,Ku(K,ve),Qe);ed(K,ve)}return null}function ze(W,K,ae,ve){for(var Qe=null,Et=null,Fe=K,ut=K=0,yt=null;Fe!==null&&ut<ae.length;ut++){Fe.index>ut?(yt=Fe,Fe=null):yt=Fe.sibling;var Rt=oe(W,Fe,ae[ut],ve);if(Rt===null){Fe===null&&(Fe=yt);break}i&&Fe&&Rt.alternate===null&&r(W,Fe),K=k(Rt,K,ut),Et===null?Qe=Rt:Et.sibling=Rt,Et=Rt,Fe=yt}if(ut===ae.length)return u(W,Fe),kt&&Li(W,ut),Qe;if(Fe===null){for(;ut<ae.length;ut++)Fe=Se(W,ae[ut],ve),Fe!==null&&(K=k(Fe,K,ut),Et===null?Qe=Fe:Et.sibling=Fe,Et=Fe);return kt&&Li(W,ut),Qe}for(Fe=g(Fe);ut<ae.length;ut++)yt=ce(Fe,W,ut,ae[ut],ve),yt!==null&&(i&&yt.alternate!==null&&Fe.delete(yt.key===null?ut:yt.key),K=k(yt,K,ut),Et===null?Qe=yt:Et.sibling=yt,Et=yt);return i&&Fe.forEach(function(Lr){return r(W,Lr)}),kt&&Li(W,ut),Qe}function Ke(W,K,ae,ve){if(ae==null)throw Error(a(151));for(var Qe=null,Et=null,Fe=K,ut=K=0,yt=null,Rt=ae.next();Fe!==null&&!Rt.done;ut++,Rt=ae.next()){Fe.index>ut?(yt=Fe,Fe=null):yt=Fe.sibling;var Lr=oe(W,Fe,Rt.value,ve);if(Lr===null){Fe===null&&(Fe=yt);break}i&&Fe&&Lr.alternate===null&&r(W,Fe),K=k(Lr,K,ut),Et===null?Qe=Lr:Et.sibling=Lr,Et=Lr,Fe=yt}if(Rt.done)return u(W,Fe),kt&&Li(W,ut),Qe;if(Fe===null){for(;!Rt.done;ut++,Rt=ae.next())Rt=Se(W,Rt.value,ve),Rt!==null&&(K=k(Rt,K,ut),Et===null?Qe=Rt:Et.sibling=Rt,Et=Rt);return kt&&Li(W,ut),Qe}for(Fe=g(Fe);!Rt.done;ut++,Rt=ae.next())Rt=ce(Fe,W,ut,Rt.value,ve),Rt!==null&&(i&&Rt.alternate!==null&&Fe.delete(Rt.key===null?ut:Rt.key),K=k(Rt,K,ut),Et===null?Qe=Rt:Et.sibling=Rt,Et=Rt);return i&&Fe.forEach(function(xP){return r(W,xP)}),kt&&Li(W,ut),Qe}function Ut(W,K,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===_&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case E:e:{for(var Qe=ae.key;K!==null;){if(K.key===Qe){if(Qe=ae.type,Qe===_){if(K.tag===7){u(W,K.sibling),ve=S(K,ae.props.children),ve.return=W,W=ve;break e}}else if(K.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===U&&vo(Qe)===K.type){u(W,K.sibling),ve=S(K,ae.props),Ql(ve,ae),ve.return=W,W=ve;break e}u(W,K);break}else r(W,K);K=K.sibling}ae.type===_?(ve=po(ae.props.children,W.mode,ve,ae.key),ve.return=W,W=ve):(ve=Vu(ae.type,ae.key,ae.props,null,W.mode,ve),Ql(ve,ae),ve.return=W,W=ve)}return I(W);case R:e:{for(Qe=ae.key;K!==null;){if(K.key===Qe)if(K.tag===4&&K.stateNode.containerInfo===ae.containerInfo&&K.stateNode.implementation===ae.implementation){u(W,K.sibling),ve=S(K,ae.children||[]),ve.return=W,W=ve;break e}else{u(W,K);break}else r(W,K);K=K.sibling}ve=vf(ae,W.mode,ve),ve.return=W,W=ve}return I(W);case U:return ae=vo(ae),Ut(W,K,ae,ve)}if(Te(ae))return ze(W,K,ae,ve);if(Ae(ae)){if(Qe=Ae(ae),typeof Qe!="function")throw Error(a(150));return ae=Qe.call(ae),Ke(W,K,ae,ve)}if(typeof ae.then=="function")return Ut(W,K,Ju(ae),ve);if(ae.$$typeof===F)return Ut(W,K,Ku(W,ae),ve);ed(W,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,K!==null&&K.tag===6?(u(W,K.sibling),ve=S(K,ae),ve.return=W,W=ve):(u(W,K),ve=gf(ae,W.mode,ve),ve.return=W,W=ve),I(W)):u(W,K)}return function(W,K,ae,ve){try{$l=0;var Qe=Ut(W,K,ae,ve);return ys=null,Qe}catch(Fe){if(Fe===vs||Fe===Yu)throw Fe;var Et=ba(29,Fe,null,W.mode);return Et.lanes=ve,Et.return=W,Et}}}var bo=$1(!0),Q1=$1(!1),xr=!1;function If(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tf(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 kr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function wr(i,r,u){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(_t&2)!==0){var S=g.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),g.pending=r,r=Qu(i),R1(i,null,u),r}return $u(i,g,r,u),Qu(i)}function Vl(i,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,Al(i,u)}}function _f(i,r){var u=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var S=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var I={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};k===null?S=k=I:k=k.next=I,u=u.next}while(u!==null);k===null?S=k=r:k=k.next=r}else S=k=r;u={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=r:i.next=r,u.lastBaseUpdate=r}var Nf=!1;function Gl(){if(Nf){var i=gs;if(i!==null)throw i}}function Zl(i,r,u,g){Nf=!1;var S=i.updateQueue;xr=!1;var k=S.firstBaseUpdate,I=S.lastBaseUpdate,P=S.shared.pending;if(P!==null){S.shared.pending=null;var $=P,ie=$.next;$.next=null,I===null?k=ie:I.next=ie,I=$;var me=i.alternate;me!==null&&(me=me.updateQueue,P=me.lastBaseUpdate,P!==I&&(P===null?me.firstBaseUpdate=ie:P.next=ie,me.lastBaseUpdate=$))}if(k!==null){var Se=S.baseState;I=0,me=ie=$=null,P=k;do{var oe=P.lane&-536870913,ce=oe!==P.lane;if(ce?(vt&oe)===oe:(g&oe)===oe){oe!==0&&oe===hs&&(Nf=!0),me!==null&&(me=me.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var ze=i,Ke=P;oe=r;var Ut=u;switch(Ke.tag){case 1:if(ze=Ke.payload,typeof ze=="function"){Se=ze.call(Ut,Se,oe);break e}Se=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ke.payload,oe=typeof ze=="function"?ze.call(Ut,Se,oe):ze,oe==null)break e;Se=M({},Se,oe);break e;case 2:xr=!0}}oe=P.callback,oe!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=S.callbacks,ce===null?S.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},me===null?(ie=me=ce,$=Se):me=me.next=ce,I|=oe;if(P=P.next,P===null){if(P=S.shared.pending,P===null)break;ce=P,P=ce.next,ce.next=null,S.lastBaseUpdate=ce,S.shared.pending=null}}while(!0);me===null&&($=Se),S.baseState=$,S.firstBaseUpdate=ie,S.lastBaseUpdate=me,k===null&&(S.shared.lanes=0),Rr|=I,i.lanes=I,i.memoizedState=Se}}function V1(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function G1(i,r){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)V1(u[i],r)}var bs=q(null),td=q(0);function Z1(i,r){i=Ki,X(td,i),X(bs,r),Ki=i|r.baseLanes}function Of(){X(td,Ki),X(bs,bs.current)}function jf(){Ki=td.current,ee(bs),ee(td)}var Sa=q(null),qa=null;function Mr(i){var r=i.alternate;X(fn,fn.current&1),X(Sa,i),qa===null&&(r===null||bs.current!==null||r.memoizedState!==null)&&(qa=i)}function Pf(i){X(fn,fn.current),X(Sa,i),qa===null&&(qa=i)}function K1(i){i.tag===22?(X(fn,fn.current),X(Sa,i),qa===null&&(qa=i)):Cr()}function Cr(){X(fn,fn.current),X(Sa,Sa.current)}function xa(i){ee(Sa),qa===i&&(qa=null),ee(fn)}var fn=q(0);function nd(i){for(var r=i;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Fh(u)||Uh(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Fi=0,lt=null,Bt=null,xn=null,ad=!1,Ss=!1,So=!1,id=0,Kl=0,xs=null,dj=0;function ln(){throw Error(a(321))}function Df(i,r){if(r===null)return!1;for(var u=0;u<r.length&&u<i.length;u++)if(!ya(i[u],r[u]))return!1;return!0}function zf(i,r,u,g,S,k){return Fi=k,lt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,B.H=i===null||i.memoizedState===null?NS:Xf,So=!1,k=u(g,S),So=!1,Ss&&(k=Y1(r,u,g,S)),W1(i),k}function W1(i){B.H=Xl;var r=Bt!==null&&Bt.next!==null;if(Fi=0,xn=Bt=lt=null,ad=!1,Kl=0,xs=null,r)throw Error(a(300));i===null||kn||(i=i.dependencies,i!==null&&Zu(i)&&(kn=!0))}function Y1(i,r,u,g){lt=i;var S=0;do{if(Ss&&(xs=null),Kl=0,Ss=!1,25<=S)throw Error(a(301));if(S+=1,xn=Bt=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}B.H=OS,k=r(u,g)}while(Ss);return k}function pj(){var i=B.H,r=i.useState()[0];return r=typeof r.then=="function"?Wl(r):r,i=i.useState()[0],(Bt!==null?Bt.memoizedState:null)!==i&&(lt.flags|=1024),r}function Lf(){var i=id!==0;return id=0,i}function qf(i,r,u){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~u}function Bf(i){if(ad){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}ad=!1}Fi=0,xn=Bt=lt=null,Ss=!1,Kl=id=0,xs=null}function Wn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xn===null?lt.memoizedState=xn=i:xn=xn.next=i,xn}function hn(){if(Bt===null){var i=lt.alternate;i=i!==null?i.memoizedState:null}else i=Bt.next;var r=xn===null?lt.memoizedState:xn.next;if(r!==null)xn=r,Bt=i;else{if(i===null)throw lt.alternate===null?Error(a(467)):Error(a(310));Bt=i,i={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},xn===null?lt.memoizedState=xn=i:xn=xn.next=i}return xn}function rd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wl(i){var r=Kl;return Kl+=1,xs===null&&(xs=[]),i=F1(xs,i,r),r=lt,(xn===null?r.memoizedState:xn.next)===null&&(r=r.alternate,B.H=r===null||r.memoizedState===null?NS:Xf),i}function od(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Wl(i);if(i.$$typeof===F)return Ln(i)}throw Error(a(438,String(i)))}function Ff(i){var r=null,u=lt.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var g=lt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=rd(),lt.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(i),g=0;g<i;g++)u[g]=we;return r.index++,u}function Ui(i,r){return typeof r=="function"?r(i):r}function sd(i){var r=hn();return Uf(r,Bt,i)}function Uf(i,r,u){var g=i.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=u;var S=i.baseQueue,k=g.pending;if(k!==null){if(S!==null){var I=S.next;S.next=k.next,k.next=I}r.baseQueue=S=k,g.pending=null}if(k=i.baseState,S===null)i.memoizedState=k;else{r=S.next;var P=I=null,$=null,ie=r,me=!1;do{var Se=ie.lane&-536870913;if(Se!==ie.lane?(vt&Se)===Se:(Fi&Se)===Se){var oe=ie.revertLane;if(oe===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Se===hs&&(me=!0);else if((Fi&oe)===oe){ie=ie.next,oe===hs&&(me=!0);continue}else Se={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},$===null?(P=$=Se,I=k):$=$.next=Se,lt.lanes|=oe,Rr|=oe;Se=ie.action,So&&u(k,Se),k=ie.hasEagerState?ie.eagerState:u(k,Se)}else oe={lane:Se,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},$===null?(P=$=oe,I=k):$=$.next=oe,lt.lanes|=Se,Rr|=Se;ie=ie.next}while(ie!==null&&ie!==r);if($===null?I=k:$.next=P,!ya(k,i.memoizedState)&&(kn=!0,me&&(u=gs,u!==null)))throw u;i.memoizedState=k,i.baseState=I,i.baseQueue=$,g.lastRenderedState=k}return S===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Hf(i){var r=hn(),u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=i;var g=u.dispatch,S=u.pending,k=r.memoizedState;if(S!==null){u.pending=null;var I=S=S.next;do k=i(k,I.action),I=I.next;while(I!==S);ya(k,r.memoizedState)||(kn=!0),r.memoizedState=k,r.baseQueue===null&&(r.baseState=k),u.lastRenderedState=k}return[k,g]}function X1(i,r,u){var g=lt,S=hn(),k=kt;if(k){if(u===void 0)throw Error(a(407));u=u()}else u=r();var I=!ya((Bt||S).memoizedState,u);if(I&&(S.memoizedState=u,kn=!0),S=S.queue,Vf(tS.bind(null,g,S,i),[i]),S.getSnapshot!==r||I||xn!==null&&xn.memoizedState.tag&1){if(g.flags|=2048,ks(9,{destroy:void 0},eS.bind(null,g,S,u,r),null),Vt===null)throw Error(a(349));k||(Fi&127)!==0||J1(g,r,u)}return u}function J1(i,r,u){i.flags|=16384,i={getSnapshot:r,value:u},r=lt.updateQueue,r===null?(r=rd(),lt.updateQueue=r,r.stores=[i]):(u=r.stores,u===null?r.stores=[i]:u.push(i))}function eS(i,r,u,g){r.value=u,r.getSnapshot=g,nS(r)&&aS(i)}function tS(i,r,u){return u(function(){nS(r)&&aS(i)})}function nS(i){var r=i.getSnapshot;i=i.value;try{var u=r();return!ya(i,u)}catch{return!0}}function aS(i){var r=uo(i,2);r!==null&&ua(r,i,2)}function $f(i){var r=Wn();if(typeof i=="function"){var u=i;if(i=u(),So){_a(!0);try{u()}finally{_a(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:i},r}function iS(i,r,u,g){return i.baseState=u,Uf(i,Bt,typeof g=="function"?g:Ui)}function mj(i,r,u,g,S){if(ud(i))throw Error(a(485));if(i=r.action,i!==null){var k={payload:S,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){k.listeners.push(I)}};B.T!==null?u(!0):k.isTransition=!1,g(k),u=r.pending,u===null?(k.next=r.pending=k,rS(r,k)):(k.next=u.next,r.pending=u.next=k)}}function rS(i,r){var u=r.action,g=r.payload,S=i.state;if(r.isTransition){var k=B.T,I={};B.T=I;try{var P=u(S,g),$=B.S;$!==null&&$(I,P),oS(i,r,P)}catch(ie){Qf(i,r,ie)}finally{k!==null&&I.types!==null&&(k.types=I.types),B.T=k}}else try{k=u(S,g),oS(i,r,k)}catch(ie){Qf(i,r,ie)}}function oS(i,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(g){sS(i,r,g)},function(g){return Qf(i,r,g)}):sS(i,r,u)}function sS(i,r,u){r.status="fulfilled",r.value=u,lS(r),i.state=u,r=i.pending,r!==null&&(u=r.next,u===r?i.pending=null:(u=u.next,r.next=u,rS(i,u)))}function Qf(i,r,u){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=u,lS(r),r=r.next;while(r!==g)}i.action=null}function lS(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function cS(i,r){return r}function uS(i,r){if(kt){var u=Vt.formState;if(u!==null){e:{var g=lt;if(kt){if(Zt){t:{for(var S=Zt,k=La;S.nodeType!==8;){if(!k){S=null;break t}if(S=Ba(S.nextSibling),S===null){S=null;break t}}k=S.data,S=k==="F!"||k==="F"?S:null}if(S){Zt=Ba(S.nextSibling),g=S.data==="F!";break e}}br(g)}g=!1}g&&(r=u[0])}}return u=Wn(),u.memoizedState=u.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cS,lastRenderedState:r},u.queue=g,u=IS.bind(null,lt,g),g.dispatch=u,g=$f(!1),k=Yf.bind(null,lt,!1,g.queue),g=Wn(),S={state:r,dispatch:null,action:i,pending:null},g.queue=S,u=mj.bind(null,lt,S,k,u),S.dispatch=u,g.memoizedState=i,[r,u,!1]}function dS(i){var r=hn();return pS(r,Bt,i)}function pS(i,r,u){if(r=Uf(i,r,cS)[0],i=sd(Ui)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Wl(r)}catch(I){throw I===vs?Yu:I}else g=r;r=hn();var S=r.queue,k=S.dispatch;return u!==r.memoizedState&&(lt.flags|=2048,ks(9,{destroy:void 0},fj.bind(null,S,u),null)),[g,k,i]}function fj(i,r){i.action=r}function mS(i){var r=hn(),u=Bt;if(u!==null)return pS(r,u,i);hn(),r=r.memoizedState,u=hn();var g=u.queue.dispatch;return u.memoizedState=i,[r,g,!1]}function ks(i,r,u,g){return i={tag:i,create:u,deps:g,inst:r,next:null},r=lt.updateQueue,r===null&&(r=rd(),lt.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=i.next=i:(g=u.next,u.next=i,i.next=g,r.lastEffect=i),i}function fS(){return hn().memoizedState}function ld(i,r,u,g){var S=Wn();lt.flags|=i,S.memoizedState=ks(1|r,{destroy:void 0},u,g===void 0?null:g)}function cd(i,r,u,g){var S=hn();g=g===void 0?null:g;var k=S.memoizedState.inst;Bt!==null&&g!==null&&Df(g,Bt.memoizedState.deps)?S.memoizedState=ks(r,k,u,g):(lt.flags|=i,S.memoizedState=ks(1|r,k,u,g))}function hS(i,r){ld(8390656,8,i,r)}function Vf(i,r){cd(2048,8,i,r)}function hj(i){lt.flags|=4;var r=lt.updateQueue;if(r===null)r=rd(),lt.updateQueue=r,r.events=[i];else{var u=r.events;u===null?r.events=[i]:u.push(i)}}function gS(i){var r=hn().memoizedState;return hj({ref:r,nextImpl:i}),function(){if((_t&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function vS(i,r){return cd(4,2,i,r)}function yS(i,r){return cd(4,4,i,r)}function bS(i,r){if(typeof r=="function"){i=i();var u=r(i);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function SS(i,r,u){u=u!=null?u.concat([i]):null,cd(4,4,bS.bind(null,r,i),u)}function Gf(){}function xS(i,r){var u=hn();r=r===void 0?null:r;var g=u.memoizedState;return r!==null&&Df(r,g[1])?g[0]:(u.memoizedState=[i,r],i)}function kS(i,r){var u=hn();r=r===void 0?null:r;var g=u.memoizedState;if(r!==null&&Df(r,g[1]))return g[0];if(g=i(),So){_a(!0);try{i()}finally{_a(!1)}}return u.memoizedState=[g,r],g}function Zf(i,r,u){return u===void 0||(Fi&1073741824)!==0&&(vt&261930)===0?i.memoizedState=r:(i.memoizedState=u,i=wx(),lt.lanes|=i,Rr|=i,u)}function wS(i,r,u,g){return ya(u,r)?u:bs.current!==null?(i=Zf(i,u,g),ya(i,r)||(kn=!0),i):(Fi&42)===0||(Fi&1073741824)!==0&&(vt&261930)===0?(kn=!0,i.memoizedState=u):(i=wx(),lt.lanes|=i,Rr|=i,r)}function MS(i,r,u,g,S){var k=ue.p;ue.p=k!==0&&8>k?k:8;var I=B.T,P={};B.T=P,Yf(i,!1,r,u);try{var $=S(),ie=B.S;if(ie!==null&&ie(P,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var me=uj($,g);Yl(i,r,me,Ma(i))}else Yl(i,r,g,Ma(i))}catch(Se){Yl(i,r,{then:function(){},status:"rejected",reason:Se},Ma())}finally{ue.p=k,I!==null&&P.types!==null&&(I.types=P.types),B.T=I}}function gj(){}function Kf(i,r,u,g){if(i.tag!==5)throw Error(a(476));var S=CS(i).queue;MS(i,S,r,ge,u===null?gj:function(){return AS(i),u(g)})}function CS(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:ge},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:u},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function AS(i){var r=CS(i);r.next===null&&(r=i.alternate.memoizedState),Yl(i,r.next.queue,{},Ma())}function Wf(){return Ln(fc)}function ES(){return hn().memoizedState}function RS(){return hn().memoizedState}function vj(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var u=Ma();i=kr(u);var g=wr(r,i,u);g!==null&&(ua(g,r,u),Vl(g,r,u)),r={cache:Cf()},i.payload=r;return}r=r.return}}function yj(i,r,u){var g=Ma();u={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ud(i)?TS(r,u):(u=ff(i,r,u,g),u!==null&&(ua(u,i,g),_S(u,r,g)))}function IS(i,r,u){var g=Ma();Yl(i,r,u,g)}function Yl(i,r,u,g){var S={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ud(i))TS(r,S);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=r.lastRenderedReducer,k!==null))try{var I=r.lastRenderedState,P=k(I,u);if(S.hasEagerState=!0,S.eagerState=P,ya(P,I))return $u(i,r,S,0),Vt===null&&Hu(),!1}catch{}if(u=ff(i,r,S,g),u!==null)return ua(u,i,g),_S(u,r,g),!0}return!1}function Yf(i,r,u,g){if(g={lane:2,revertLane:Ih(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ud(i)){if(r)throw Error(a(479))}else r=ff(i,u,g,2),r!==null&&ua(r,i,2)}function ud(i){var r=i.alternate;return i===lt||r!==null&&r===lt}function TS(i,r){Ss=ad=!0;var u=i.pending;u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r}function _S(i,r,u){if((u&4194048)!==0){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,Al(i,u)}}var Xl={readContext:Ln,use:od,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};Xl.useEffectEvent=ln;var NS={readContext:Ln,use:od,useCallback:function(i,r){return Wn().memoizedState=[i,r===void 0?null:r],i},useContext:Ln,useEffect:hS,useImperativeHandle:function(i,r,u){u=u!=null?u.concat([i]):null,ld(4194308,4,bS.bind(null,r,i),u)},useLayoutEffect:function(i,r){return ld(4194308,4,i,r)},useInsertionEffect:function(i,r){ld(4,2,i,r)},useMemo:function(i,r){var u=Wn();r=r===void 0?null:r;var g=i();if(So){_a(!0);try{i()}finally{_a(!1)}}return u.memoizedState=[g,r],g},useReducer:function(i,r,u){var g=Wn();if(u!==void 0){var S=u(r);if(So){_a(!0);try{u(r)}finally{_a(!1)}}}else S=r;return g.memoizedState=g.baseState=S,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:S},g.queue=i,i=i.dispatch=yj.bind(null,lt,i),[g.memoizedState,i]},useRef:function(i){var r=Wn();return i={current:i},r.memoizedState=i},useState:function(i){i=$f(i);var r=i.queue,u=IS.bind(null,lt,r);return r.dispatch=u,[i.memoizedState,u]},useDebugValue:Gf,useDeferredValue:function(i,r){var u=Wn();return Zf(u,i,r)},useTransition:function(){var i=$f(!1);return i=MS.bind(null,lt,i.queue,!0,!1),Wn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,u){var g=lt,S=Wn();if(kt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=r(),Vt===null)throw Error(a(349));(vt&127)!==0||J1(g,r,u)}S.memoizedState=u;var k={value:u,getSnapshot:r};return S.queue=k,hS(tS.bind(null,g,k,i),[i]),g.flags|=2048,ks(9,{destroy:void 0},eS.bind(null,g,k,u,r),null),u},useId:function(){var i=Wn(),r=Vt.identifierPrefix;if(kt){var u=fi,g=mi;u=(g&~(1<<32-In(g)-1)).toString(32)+u,r="_"+r+"R_"+u,u=id++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=dj++,r="_"+r+"r_"+u.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Wf,useFormState:uS,useActionState:uS,useOptimistic:function(i){var r=Wn();r.memoizedState=r.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=Yf.bind(null,lt,!0,u),u.dispatch=r,[i,r]},useMemoCache:Ff,useCacheRefresh:function(){return Wn().memoizedState=vj.bind(null,lt)},useEffectEvent:function(i){var r=Wn(),u={impl:i};return r.memoizedState=u,function(){if((_t&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Xf={readContext:Ln,use:od,useCallback:xS,useContext:Ln,useEffect:Vf,useImperativeHandle:SS,useInsertionEffect:vS,useLayoutEffect:yS,useMemo:kS,useReducer:sd,useRef:fS,useState:function(){return sd(Ui)},useDebugValue:Gf,useDeferredValue:function(i,r){var u=hn();return wS(u,Bt.memoizedState,i,r)},useTransition:function(){var i=sd(Ui)[0],r=hn().memoizedState;return[typeof i=="boolean"?i:Wl(i),r]},useSyncExternalStore:X1,useId:ES,useHostTransitionStatus:Wf,useFormState:dS,useActionState:dS,useOptimistic:function(i,r){var u=hn();return iS(u,Bt,i,r)},useMemoCache:Ff,useCacheRefresh:RS};Xf.useEffectEvent=gS;var OS={readContext:Ln,use:od,useCallback:xS,useContext:Ln,useEffect:Vf,useImperativeHandle:SS,useInsertionEffect:vS,useLayoutEffect:yS,useMemo:kS,useReducer:Hf,useRef:fS,useState:function(){return Hf(Ui)},useDebugValue:Gf,useDeferredValue:function(i,r){var u=hn();return Bt===null?Zf(u,i,r):wS(u,Bt.memoizedState,i,r)},useTransition:function(){var i=Hf(Ui)[0],r=hn().memoizedState;return[typeof i=="boolean"?i:Wl(i),r]},useSyncExternalStore:X1,useId:ES,useHostTransitionStatus:Wf,useFormState:mS,useActionState:mS,useOptimistic:function(i,r){var u=hn();return Bt!==null?iS(u,Bt,i,r):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ff,useCacheRefresh:RS};OS.useEffectEvent=gS;function Jf(i,r,u,g){r=i.memoizedState,u=u(g,r),u=u==null?r:M({},r,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var eh={enqueueSetState:function(i,r,u){i=i._reactInternals;var g=Ma(),S=kr(g);S.payload=r,u!=null&&(S.callback=u),r=wr(i,S,g),r!==null&&(ua(r,i,g),Vl(r,i,g))},enqueueReplaceState:function(i,r,u){i=i._reactInternals;var g=Ma(),S=kr(g);S.tag=1,S.payload=r,u!=null&&(S.callback=u),r=wr(i,S,g),r!==null&&(ua(r,i,g),Vl(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var u=Ma(),g=kr(u);g.tag=2,r!=null&&(g.callback=r),r=wr(i,g,u),r!==null&&(ua(r,i,u),Vl(r,i,u))}};function jS(i,r,u,g,S,k,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,k,I):r.prototype&&r.prototype.isPureReactComponent?!Ll(u,g)||!Ll(S,k):!0}function PS(i,r,u,g){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,g),r.state!==i&&eh.enqueueReplaceState(r,r.state,null)}function xo(i,r){var u=r;if("ref"in r){u={};for(var g in r)g!=="ref"&&(u[g]=r[g])}if(i=i.defaultProps){u===r&&(u=M({},u));for(var S in i)u[S]===void 0&&(u[S]=i[S])}return u}function DS(i){Uu(i)}function zS(i){console.error(i)}function LS(i){Uu(i)}function dd(i,r){try{var u=i.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function qS(i,r,u){try{var g=i.onCaughtError;g(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function th(i,r,u){return u=kr(u),u.tag=3,u.payload={element:null},u.callback=function(){dd(i,r)},u}function BS(i){return i=kr(i),i.tag=3,i}function FS(i,r,u,g){var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var k=g.value;i.payload=function(){return S(k)},i.callback=function(){qS(r,u,g)}}var I=u.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){qS(r,u,g),typeof S!="function"&&(Ir===null?Ir=new Set([this]):Ir.add(this));var P=g.stack;this.componentDidCatch(g.value,{componentStack:P!==null?P:""})})}function bj(i,r,u,g,S){if(u.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=u.alternate,r!==null&&fs(r,u,S,!0),u=Sa.current,u!==null){switch(u.tag){case 31:case 13:return qa===null?wd():u.alternate===null&&cn===0&&(cn=3),u.flags&=-257,u.flags|=65536,u.lanes=S,g===Xu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([g]):r.add(g),Ah(i,g,S)),!1;case 22:return u.flags|=65536,g===Xu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([g]):u.add(g)),Ah(i,g,S)),!1}throw Error(a(435,u.tag))}return Ah(i,g,S),wd(),!1}if(kt)return r=Sa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,g!==Sf&&(i=Error(a(422),{cause:g}),Fl(Pa(i,u)))):(g!==Sf&&(r=Error(a(423),{cause:g}),Fl(Pa(r,u))),i=i.current.alternate,i.flags|=65536,S&=-S,i.lanes|=S,g=Pa(g,u),S=th(i.stateNode,g,S),_f(i,S),cn!==4&&(cn=2)),!1;var k=Error(a(520),{cause:g});if(k=Pa(k,u),oc===null?oc=[k]:oc.push(k),cn!==4&&(cn=2),r===null)return!0;g=Pa(g,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,i=S&-S,u.lanes|=i,i=th(u.stateNode,g,i),_f(u,i),!1;case 1:if(r=u.type,k=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Ir===null||!Ir.has(k))))return u.flags|=65536,S&=-S,u.lanes|=S,S=BS(S),FS(S,i,u,g),_f(u,S),!1}u=u.return}while(u!==null);return!1}var nh=Error(a(461)),kn=!1;function qn(i,r,u,g){r.child=i===null?Q1(r,null,u,g):bo(r,i.child,u,g)}function US(i,r,u,g,S){u=u.render;var k=r.ref;if("ref"in g){var I={};for(var P in g)P!=="ref"&&(I[P]=g[P])}else I=g;return ho(r),g=zf(i,r,u,I,k,S),P=Lf(),i!==null&&!kn?(qf(i,r,S),Hi(i,r,S)):(kt&&P&&yf(r),r.flags|=1,qn(i,r,g,S),r.child)}function HS(i,r,u,g,S){if(i===null){var k=u.type;return typeof k=="function"&&!hf(k)&&k.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=k,$S(i,r,k,g,S)):(i=Vu(u.type,null,g,r,r.mode,S),i.ref=r.ref,i.return=r,r.child=i)}if(k=i.child,!uh(i,S)){var I=k.memoizedProps;if(u=u.compare,u=u!==null?u:Ll,u(I,g)&&i.ref===r.ref)return Hi(i,r,S)}return r.flags|=1,i=zi(k,g),i.ref=r.ref,i.return=r,r.child=i}function $S(i,r,u,g,S){if(i!==null){var k=i.memoizedProps;if(Ll(k,g)&&i.ref===r.ref)if(kn=!1,r.pendingProps=g=k,uh(i,S))(i.flags&131072)!==0&&(kn=!0);else return r.lanes=i.lanes,Hi(i,r,S)}return ah(i,r,u,g,S)}function QS(i,r,u,g){var S=g.children,k=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((r.flags&128)!==0){if(k=k!==null?k.baseLanes|u:u,i!==null){for(g=r.child=i.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~k}else g=0,r.child=null;return VS(i,r,k,u,g)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Wu(r,k!==null?k.cachePool:null),k!==null?Z1(r,k):Of(),K1(r);else return g=r.lanes=536870912,VS(i,r,k!==null?k.baseLanes|u:u,u,g)}else k!==null?(Wu(r,k.cachePool),Z1(r,k),Cr(),r.memoizedState=null):(i!==null&&Wu(r,null),Of(),Cr());return qn(i,r,S,u),r.child}function Jl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function VS(i,r,u,g,S){var k=Ef();return k=k===null?null:{parent:Sn._currentValue,pool:k},r.memoizedState={baseLanes:u,cachePool:k},i!==null&&Wu(r,null),Of(),K1(r),i!==null&&fs(i,r,g,!0),r.childLanes=S,null}function pd(i,r){return r=fd({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function GS(i,r,u){return bo(r,i.child,null,u),i=pd(r,r.pendingProps),i.flags|=2,xa(r),r.memoizedState=null,i}function Sj(i,r,u){var g=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(kt){if(g.mode==="hidden")return i=pd(r,g),r.lanes=536870912,Jl(null,i);if(Pf(r),(i=Zt)?(i=rk(i,La),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:vr!==null?{id:mi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},u=T1(i),u.return=r,r.child=u,zn=r,Zt=null)):i=null,i===null)throw br(r);return r.lanes=536870912,null}return pd(r,g)}var k=i.memoizedState;if(k!==null){var I=k.dehydrated;if(Pf(r),S)if(r.flags&256)r.flags&=-257,r=GS(i,r,u);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(kn||fs(i,r,u,!1),S=(u&i.childLanes)!==0,kn||S){if(g=Vt,g!==null&&(I=es(g,u),I!==0&&I!==k.retryLane))throw k.retryLane=I,uo(i,I),ua(g,i,I),nh;wd(),r=GS(i,r,u)}else i=k.treeContext,Zt=Ba(I.nextSibling),zn=r,kt=!0,yr=null,La=!1,i!==null&&O1(r,i),r=pd(r,g),r.flags|=4096;return r}return i=zi(i.child,{mode:g.mode,children:g.children}),i.ref=r.ref,r.child=i,i.return=r,i}function md(i,r){var u=r.ref;if(u===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(i===null||i.ref!==u)&&(r.flags|=4194816)}}function ah(i,r,u,g,S){return ho(r),u=zf(i,r,u,g,void 0,S),g=Lf(),i!==null&&!kn?(qf(i,r,S),Hi(i,r,S)):(kt&&g&&yf(r),r.flags|=1,qn(i,r,u,S),r.child)}function ZS(i,r,u,g,S,k){return ho(r),r.updateQueue=null,u=Y1(r,g,u,S),W1(i),g=Lf(),i!==null&&!kn?(qf(i,r,k),Hi(i,r,k)):(kt&&g&&yf(r),r.flags|=1,qn(i,r,u,k),r.child)}function KS(i,r,u,g,S){if(ho(r),r.stateNode===null){var k=us,I=u.contextType;typeof I=="object"&&I!==null&&(k=Ln(I)),k=new u(g,k),r.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=eh,r.stateNode=k,k._reactInternals=r,k=r.stateNode,k.props=g,k.state=r.memoizedState,k.refs={},If(r),I=u.contextType,k.context=typeof I=="object"&&I!==null?Ln(I):us,k.state=r.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(Jf(r,u,I,g),k.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(I=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),I!==k.state&&eh.enqueueReplaceState(k,k.state,null),Zl(r,g,k,S),Gl(),k.state=r.memoizedState),typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(i===null){k=r.stateNode;var P=r.memoizedProps,$=xo(u,P);k.props=$;var ie=k.context,me=u.contextType;I=us,typeof me=="object"&&me!==null&&(I=Ln(me));var Se=u.getDerivedStateFromProps;me=typeof Se=="function"||typeof k.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,me||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P||ie!==I)&&PS(r,k,g,I),xr=!1;var oe=r.memoizedState;k.state=oe,Zl(r,g,k,S),Gl(),ie=r.memoizedState,P||oe!==ie||xr?(typeof Se=="function"&&(Jf(r,u,Se,g),ie=r.memoizedState),($=xr||jS(r,u,$,g,oe,ie,I))?(me||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=I,g=$):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{k=r.stateNode,Tf(i,r),I=r.memoizedProps,me=xo(u,I),k.props=me,Se=r.pendingProps,oe=k.context,ie=u.contextType,$=us,typeof ie=="object"&&ie!==null&&($=Ln(ie)),P=u.getDerivedStateFromProps,(ie=typeof P=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==Se||oe!==$)&&PS(r,k,g,$),xr=!1,oe=r.memoizedState,k.state=oe,Zl(r,g,k,S),Gl();var ce=r.memoizedState;I!==Se||oe!==ce||xr||i!==null&&i.dependencies!==null&&Zu(i.dependencies)?(typeof P=="function"&&(Jf(r,u,P,g),ce=r.memoizedState),(me=xr||jS(r,u,me,g,oe,ce,$)||i!==null&&i.dependencies!==null&&Zu(i.dependencies))?(ie||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ce,$),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ce,$)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&oe===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&oe===i.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=ce),k.props=g,k.state=ce,k.context=$,g=me):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&oe===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&oe===i.memoizedState||(r.flags|=1024),g=!1)}return k=g,md(i,r),g=(r.flags&128)!==0,k||g?(k=r.stateNode,u=g&&typeof u.getDerivedStateFromError!="function"?null:k.render(),r.flags|=1,i!==null&&g?(r.child=bo(r,i.child,null,S),r.child=bo(r,null,u,S)):qn(i,r,u,S),r.memoizedState=k.state,i=r.child):i=Hi(i,r,S),i}function WS(i,r,u,g){return mo(),r.flags|=256,qn(i,r,u,g),r.child}var ih={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rh(i){return{baseLanes:i,cachePool:q1()}}function oh(i,r,u){return i=i!==null?i.childLanes&~u:0,r&&(i|=wa),i}function YS(i,r,u){var g=r.pendingProps,S=!1,k=(r.flags&128)!==0,I;if((I=k)||(I=i!==null&&i.memoizedState===null?!1:(fn.current&2)!==0),I&&(S=!0,r.flags&=-129),I=(r.flags&32)!==0,r.flags&=-33,i===null){if(kt){if(S?Mr(r):Cr(),(i=Zt)?(i=rk(i,La),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:vr!==null?{id:mi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},u=T1(i),u.return=r,r.child=u,zn=r,Zt=null)):i=null,i===null)throw br(r);return Uh(i)?r.lanes=32:r.lanes=536870912,null}var P=g.children;return g=g.fallback,S?(Cr(),S=r.mode,P=fd({mode:"hidden",children:P},S),g=po(g,S,u,null),P.return=r,g.return=r,P.sibling=g,r.child=P,g=r.child,g.memoizedState=rh(u),g.childLanes=oh(i,I,u),r.memoizedState=ih,Jl(null,g)):(Mr(r),sh(r,P))}var $=i.memoizedState;if($!==null&&(P=$.dehydrated,P!==null)){if(k)r.flags&256?(Mr(r),r.flags&=-257,r=lh(i,r,u)):r.memoizedState!==null?(Cr(),r.child=i.child,r.flags|=128,r=null):(Cr(),P=g.fallback,S=r.mode,g=fd({mode:"visible",children:g.children},S),P=po(P,S,u,null),P.flags|=2,g.return=r,P.return=r,g.sibling=P,r.child=g,bo(r,i.child,null,u),g=r.child,g.memoizedState=rh(u),g.childLanes=oh(i,I,u),r.memoizedState=ih,r=Jl(null,g));else if(Mr(r),Uh(P)){if(I=P.nextSibling&&P.nextSibling.dataset,I)var ie=I.dgst;I=ie,g=Error(a(419)),g.stack="",g.digest=I,Fl({value:g,source:null,stack:null}),r=lh(i,r,u)}else if(kn||fs(i,r,u,!1),I=(u&i.childLanes)!==0,kn||I){if(I=Vt,I!==null&&(g=es(I,u),g!==0&&g!==$.retryLane))throw $.retryLane=g,uo(i,g),ua(I,i,g),nh;Fh(P)||wd(),r=lh(i,r,u)}else Fh(P)?(r.flags|=192,r.child=i.child,r=null):(i=$.treeContext,Zt=Ba(P.nextSibling),zn=r,kt=!0,yr=null,La=!1,i!==null&&O1(r,i),r=sh(r,g.children),r.flags|=4096);return r}return S?(Cr(),P=g.fallback,S=r.mode,$=i.child,ie=$.sibling,g=zi($,{mode:"hidden",children:g.children}),g.subtreeFlags=$.subtreeFlags&65011712,ie!==null?P=zi(ie,P):(P=po(P,S,u,null),P.flags|=2),P.return=r,g.return=r,g.sibling=P,r.child=g,Jl(null,g),g=r.child,P=i.child.memoizedState,P===null?P=rh(u):(S=P.cachePool,S!==null?($=Sn._currentValue,S=S.parent!==$?{parent:$,pool:$}:S):S=q1(),P={baseLanes:P.baseLanes|u,cachePool:S}),g.memoizedState=P,g.childLanes=oh(i,I,u),r.memoizedState=ih,Jl(i.child,g)):(Mr(r),u=i.child,i=u.sibling,u=zi(u,{mode:"visible",children:g.children}),u.return=r,u.sibling=null,i!==null&&(I=r.deletions,I===null?(r.deletions=[i],r.flags|=16):I.push(i)),r.child=u,r.memoizedState=null,u)}function sh(i,r){return r=fd({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function fd(i,r){return i=ba(22,i,null,r),i.lanes=0,i}function lh(i,r,u){return bo(r,i.child,null,u),i=sh(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function XS(i,r,u){i.lanes|=r;var g=i.alternate;g!==null&&(g.lanes|=r),wf(i.return,r,u)}function ch(i,r,u,g,S,k){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:S,treeForkCount:k}:(I.isBackwards=r,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=u,I.tailMode=S,I.treeForkCount=k)}function JS(i,r,u){var g=r.pendingProps,S=g.revealOrder,k=g.tail;g=g.children;var I=fn.current,P=(I&2)!==0;if(P?(I=I&1|2,r.flags|=128):I&=1,X(fn,I),qn(i,r,g,u),g=kt?Bl:0,!P&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&XS(i,u,r);else if(i.tag===19)XS(i,u,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(S){case"forwards":for(u=r.child,S=null;u!==null;)i=u.alternate,i!==null&&nd(i)===null&&(S=u),u=u.sibling;u=S,u===null?(S=r.child,r.child=null):(S=u.sibling,u.sibling=null),ch(r,!1,S,u,k,g);break;case"backwards":case"unstable_legacy-backwards":for(u=null,S=r.child,r.child=null;S!==null;){if(i=S.alternate,i!==null&&nd(i)===null){r.child=S;break}i=S.sibling,S.sibling=u,u=S,S=i}ch(r,!0,u,null,k,g);break;case"together":ch(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function Hi(i,r,u){if(i!==null&&(r.dependencies=i.dependencies),Rr|=r.lanes,(u&r.childLanes)===0)if(i!==null){if(fs(i,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(a(153));if(r.child!==null){for(i=r.child,u=zi(i,i.pendingProps),r.child=u,u.return=r;i.sibling!==null;)i=i.sibling,u=u.sibling=zi(i,i.pendingProps),u.return=r;u.sibling=null}return r.child}function uh(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Zu(i)))}function xj(i,r,u){switch(r.tag){case 3:Ue(r,r.stateNode.containerInfo),Sr(r,Sn,i.memoizedState.cache),mo();break;case 27:case 5:Ee(r);break;case 4:Ue(r,r.stateNode.containerInfo);break;case 10:Sr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Pf(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(Mr(r),r.flags|=128,null):(u&r.child.childLanes)!==0?YS(i,r,u):(Mr(r),i=Hi(i,r,u),i!==null?i.sibling:null);Mr(r);break;case 19:var S=(i.flags&128)!==0;if(g=(u&r.childLanes)!==0,g||(fs(i,r,u,!1),g=(u&r.childLanes)!==0),S){if(g)return JS(i,r,u);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),X(fn,fn.current),g)break;return null;case 22:return r.lanes=0,QS(i,r,u,r.pendingProps);case 24:Sr(r,Sn,i.memoizedState.cache)}return Hi(i,r,u)}function ex(i,r,u){if(i!==null)if(i.memoizedProps!==r.pendingProps)kn=!0;else{if(!uh(i,u)&&(r.flags&128)===0)return kn=!1,xj(i,r,u);kn=(i.flags&131072)!==0}else kn=!1,kt&&(r.flags&1048576)!==0&&N1(r,Bl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var g=r.pendingProps;if(i=vo(r.elementType),r.type=i,typeof i=="function")hf(i)?(g=xo(i,g),r.tag=1,r=KS(null,r,i,g,u)):(r.tag=0,r=ah(null,r,i,g,u));else{if(i!=null){var S=i.$$typeof;if(S===L){r.tag=11,r=US(null,r,i,g,u);break e}else if(S===V){r.tag=14,r=HS(null,r,i,g,u);break e}}throw r=Me(i)||i,Error(a(306,r,""))}}return r;case 0:return ah(i,r,r.type,r.pendingProps,u);case 1:return g=r.type,S=xo(g,r.pendingProps),KS(i,r,g,S,u);case 3:e:{if(Ue(r,r.stateNode.containerInfo),i===null)throw Error(a(387));g=r.pendingProps;var k=r.memoizedState;S=k.element,Tf(i,r),Zl(r,g,null,u);var I=r.memoizedState;if(g=I.cache,Sr(r,Sn,g),g!==k.cache&&Mf(r,[Sn],u,!0),Gl(),g=I.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:I.cache},r.updateQueue.baseState=k,r.memoizedState=k,r.flags&256){r=WS(i,r,g,u);break e}else if(g!==S){S=Pa(Error(a(424)),r),Fl(S),r=WS(i,r,g,u);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Zt=Ba(i.firstChild),zn=r,kt=!0,yr=null,La=!0,u=Q1(r,null,g,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(mo(),g===S){r=Hi(i,r,u);break e}qn(i,r,g,u)}r=r.child}return r;case 26:return md(i,r),i===null?(u=dk(r.type,null,r.pendingProps,null))?r.memoizedState=u:kt||(u=r.type,i=r.pendingProps,g=Td(he.current).createElement(u),g[yn]=r,g[Pn]=i,Bn(g,u,i),bn(g),r.stateNode=g):r.memoizedState=dk(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Ee(r),i===null&&kt&&(g=r.stateNode=lk(r.type,r.pendingProps,he.current),zn=r,La=!0,S=Zt,Or(r.type)?(Hh=S,Zt=Ba(g.firstChild)):Zt=S),qn(i,r,r.pendingProps.children,u),md(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&kt&&((S=g=Zt)&&(g=Yj(g,r.type,r.pendingProps,La),g!==null?(r.stateNode=g,zn=r,Zt=Ba(g.firstChild),La=!1,S=!0):S=!1),S||br(r)),Ee(r),S=r.type,k=r.pendingProps,I=i!==null?i.memoizedProps:null,g=k.children,Lh(S,k)?g=null:I!==null&&Lh(S,I)&&(r.flags|=32),r.memoizedState!==null&&(S=zf(i,r,pj,null,null,u),fc._currentValue=S),md(i,r),qn(i,r,g,u),r.child;case 6:return i===null&&kt&&((i=u=Zt)&&(u=Xj(u,r.pendingProps,La),u!==null?(r.stateNode=u,zn=r,Zt=null,i=!0):i=!1),i||br(r)),null;case 13:return YS(i,r,u);case 4:return Ue(r,r.stateNode.containerInfo),g=r.pendingProps,i===null?r.child=bo(r,null,g,u):qn(i,r,g,u),r.child;case 11:return US(i,r,r.type,r.pendingProps,u);case 7:return qn(i,r,r.pendingProps,u),r.child;case 8:return qn(i,r,r.pendingProps.children,u),r.child;case 12:return qn(i,r,r.pendingProps.children,u),r.child;case 10:return g=r.pendingProps,Sr(r,r.type,g.value),qn(i,r,g.children,u),r.child;case 9:return S=r.type._context,g=r.pendingProps.children,ho(r),S=Ln(S),g=g(S),r.flags|=1,qn(i,r,g,u),r.child;case 14:return HS(i,r,r.type,r.pendingProps,u);case 15:return $S(i,r,r.type,r.pendingProps,u);case 19:return JS(i,r,u);case 31:return Sj(i,r,u);case 22:return QS(i,r,u,r.pendingProps);case 24:return ho(r),g=Ln(Sn),i===null?(S=Ef(),S===null&&(S=Vt,k=Cf(),S.pooledCache=k,k.refCount++,k!==null&&(S.pooledCacheLanes|=u),S=k),r.memoizedState={parent:g,cache:S},If(r),Sr(r,Sn,S)):((i.lanes&u)!==0&&(Tf(i,r),Zl(r,null,null,u),Gl()),S=i.memoizedState,k=r.memoizedState,S.parent!==g?(S={parent:g,cache:g},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),Sr(r,Sn,g)):(g=k.cache,Sr(r,Sn,g),g!==S.cache&&Mf(r,[Sn],u,!0))),qn(i,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function $i(i){i.flags|=4}function dh(i,r,u,g,S){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(S&335544128)===S)if(i.stateNode.complete)i.flags|=8192;else if(Ex())i.flags|=8192;else throw yo=Xu,Rf}else i.flags&=-16777217}function tx(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!gk(r))if(Ex())i.flags|=8192;else throw yo=Xu,Rf}function hd(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Jo():536870912,i.lanes|=r,As|=r)}function ec(i,r){if(!kt)switch(i.tailMode){case"hidden":r=i.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function Kt(i){var r=i.alternate!==null&&i.alternate.child===i.child,u=0,g=0;if(r)for(var S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=i,S=S.sibling;else for(S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=i,S=S.sibling;return i.subtreeFlags|=g,i.childLanes=u,r}function kj(i,r,u){var g=r.pendingProps;switch(bf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(r),null;case 1:return Kt(r),null;case 3:return u=r.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),Bi(Sn),re(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(ms(r)?$i(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,xf())),Kt(r),null;case 26:var S=r.type,k=r.memoizedState;return i===null?($i(r),k!==null?(Kt(r),tx(r,k)):(Kt(r),dh(r,S,null,g,u))):k?k!==i.memoizedState?($i(r),Kt(r),tx(r,k)):(Kt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==g&&$i(r),Kt(r),dh(r,S,i,g,u)),null;case 27:if(nt(r),u=he.current,S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&$i(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Kt(r),null}i=ye.current,ms(r)?j1(r):(i=lk(S,g,u),r.stateNode=i,$i(r))}return Kt(r),null;case 5:if(nt(r),S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&$i(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Kt(r),null}if(k=ye.current,ms(r))j1(r);else{var I=Td(he.current);switch(k){case 1:k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":k=I.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?I.createElement(S,{is:g.is}):I.createElement(S)}}k[yn]=r,k[Pn]=g;e:for(I=r.child;I!==null;){if(I.tag===5||I.tag===6)k.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===r)break e;for(;I.sibling===null;){if(I.return===null||I.return===r)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}r.stateNode=k;e:switch(Bn(k,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&$i(r)}}return Kt(r),dh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,u),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==g&&$i(r);else{if(typeof g!="string"&&r.stateNode===null)throw Error(a(166));if(i=he.current,ms(r)){if(i=r.stateNode,u=r.memoizedProps,g=null,S=zn,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}i[yn]=r,i=!!(i.nodeValue===u||g!==null&&g.suppressHydrationWarning===!0||Yx(i.nodeValue,u)),i||br(r,!0)}else i=Td(i).createTextNode(g),i[yn]=r,r.stateNode=i}return Kt(r),null;case 31:if(u=r.memoizedState,i===null||i.memoizedState!==null){if(g=ms(r),u!==null){if(i===null){if(!g)throw Error(a(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[yn]=r}else mo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Kt(r),i=!1}else u=xf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return r.flags&256?(xa(r),r):(xa(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Kt(r),null;case 13:if(g=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(S=ms(r),g!==null&&g.dehydrated!==null){if(i===null){if(!S)throw Error(a(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(a(317));S[yn]=r}else mo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Kt(r),S=!1}else S=xf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(xa(r),r):(xa(r),null)}return xa(r),(r.flags&128)!==0?(r.lanes=u,r):(u=g!==null,i=i!==null&&i.memoizedState!==null,u&&(g=r.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==S&&(g.flags|=2048)),u!==i&&u&&(r.child.flags|=8192),hd(r,r.updateQueue),Kt(r),null);case 4:return re(),i===null&&Oh(r.stateNode.containerInfo),Kt(r),null;case 10:return Bi(r.type),Kt(r),null;case 19:if(ee(fn),g=r.memoizedState,g===null)return Kt(r),null;if(S=(r.flags&128)!==0,k=g.rendering,k===null)if(S)ec(g,!1);else{if(cn!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(k=nd(i),k!==null){for(r.flags|=128,ec(g,!1),i=k.updateQueue,r.updateQueue=i,hd(r,i),r.subtreeFlags=0,i=u,u=r.child;u!==null;)I1(u,i),u=u.sibling;return X(fn,fn.current&1|2),kt&&Li(r,g.treeForkCount),r.child}i=i.sibling}g.tail!==null&&pn()>Sd&&(r.flags|=128,S=!0,ec(g,!1),r.lanes=4194304)}else{if(!S)if(i=nd(k),i!==null){if(r.flags|=128,S=!0,i=i.updateQueue,r.updateQueue=i,hd(r,i),ec(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!kt)return Kt(r),null}else 2*pn()-g.renderingStartTime>Sd&&u!==536870912&&(r.flags|=128,S=!0,ec(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=pn(),i.sibling=null,u=fn.current,X(fn,S?u&1|2:u&1),kt&&Li(r,g.treeForkCount),i):(Kt(r),null);case 22:case 23:return xa(r),jf(),g=r.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(u&536870912)!==0&&(r.flags&128)===0&&(Kt(r),r.subtreeFlags&6&&(r.flags|=8192)):Kt(r),u=r.updateQueue,u!==null&&hd(r,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==u&&(r.flags|=2048),i!==null&&ee(go),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Bi(Sn),Kt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function wj(i,r){switch(bf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Bi(Sn),re(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return nt(r),null;case 31:if(r.memoizedState!==null){if(xa(r),r.alternate===null)throw Error(a(340));mo()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(xa(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));mo()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return ee(fn),null;case 4:return re(),null;case 10:return Bi(r.type),null;case 22:case 23:return xa(r),jf(),i!==null&&ee(go),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Bi(Sn),null;case 25:return null;default:return null}}function nx(i,r){switch(bf(r),r.tag){case 3:Bi(Sn),re();break;case 26:case 27:case 5:nt(r);break;case 4:re();break;case 31:r.memoizedState!==null&&xa(r);break;case 13:xa(r);break;case 19:ee(fn);break;case 10:Bi(r.type);break;case 22:case 23:xa(r),jf(),i!==null&&ee(go);break;case 24:Bi(Sn)}}function tc(i,r){try{var u=r.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var S=g.next;u=S;do{if((u.tag&i)===i){g=void 0;var k=u.create,I=u.inst;g=k(),I.destroy=g}u=u.next}while(u!==S)}}catch(P){Pt(r,r.return,P)}}function Ar(i,r,u){try{var g=r.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var k=S.next;g=k;do{if((g.tag&i)===i){var I=g.inst,P=I.destroy;if(P!==void 0){I.destroy=void 0,S=r;var $=u,ie=P;try{ie()}catch(me){Pt(S,$,me)}}}g=g.next}while(g!==k)}}catch(me){Pt(r,r.return,me)}}function ax(i){var r=i.updateQueue;if(r!==null){var u=i.stateNode;try{G1(r,u)}catch(g){Pt(i,i.return,g)}}}function ix(i,r,u){u.props=xo(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(g){Pt(i,r,g)}}function nc(i,r){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof u=="function"?i.refCleanup=u(g):u.current=g}}catch(S){Pt(i,r,S)}}function hi(i,r){var u=i.ref,g=i.refCleanup;if(u!==null)if(typeof g=="function")try{g()}catch(S){Pt(i,r,S)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(S){Pt(i,r,S)}else u.current=null}function rx(i){var r=i.type,u=i.memoizedProps,g=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&g.focus();break e;case"img":u.src?g.src=u.src:u.srcSet&&(g.srcset=u.srcSet)}}catch(S){Pt(i,i.return,S)}}function ph(i,r,u){try{var g=i.stateNode;Qj(g,i.type,u,r),g[Pn]=r}catch(S){Pt(i,i.return,S)}}function ox(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Or(i.type)||i.tag===4}function mh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ox(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&&Or(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 fh(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(i),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=Ze));else if(g!==4&&(g===27&&Or(i.type)&&(u=i.stateNode,r=null),i=i.child,i!==null))for(fh(i,r,u),i=i.sibling;i!==null;)fh(i,r,u),i=i.sibling}function gd(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?u.insertBefore(i,r):u.appendChild(i);else if(g!==4&&(g===27&&Or(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(gd(i,r,u),i=i.sibling;i!==null;)gd(i,r,u),i=i.sibling}function sx(i){var r=i.stateNode,u=i.memoizedProps;try{for(var g=i.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);Bn(r,g,u),r[yn]=i,r[Pn]=u}catch(k){Pt(i,i.return,k)}}var Qi=!1,wn=!1,hh=!1,lx=typeof WeakSet=="function"?WeakSet:Set,jn=null;function Mj(i,r){if(i=i.containerInfo,Dh=zd,i=S1(i),lf(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var S=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var I=0,P=-1,$=-1,ie=0,me=0,Se=i,oe=null;t:for(;;){for(var ce;Se!==u||S!==0&&Se.nodeType!==3||(P=I+S),Se!==k||g!==0&&Se.nodeType!==3||($=I+g),Se.nodeType===3&&(I+=Se.nodeValue.length),(ce=Se.firstChild)!==null;)oe=Se,Se=ce;for(;;){if(Se===i)break t;if(oe===u&&++ie===S&&(P=I),oe===k&&++me===g&&($=I),(ce=Se.nextSibling)!==null)break;Se=oe,oe=Se.parentNode}Se=ce}u=P===-1||$===-1?null:{start:P,end:$}}else u=null}u=u||{start:0,end:0}}else u=null;for(zh={focusedElem:i,selectionRange:u},zd=!1,jn=r;jn!==null;)if(r=jn,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,jn=i;else for(;jn!==null;){switch(r=jn,k=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)S=i[u],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,u=r,S=k.memoizedProps,k=k.memoizedState,g=u.stateNode;try{var ze=xo(u.type,S);i=g.getSnapshotBeforeUpdate(ze,k),g.__reactInternalSnapshotBeforeUpdate=i}catch(Ke){Pt(u,u.return,Ke)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,u=i.nodeType,u===9)Bh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bh(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,jn=i;break}jn=r.return}}function cx(i,r,u){var g=u.flags;switch(u.tag){case 0:case 11:case 15:Gi(i,u),g&4&&tc(5,u);break;case 1:if(Gi(i,u),g&4)if(i=u.stateNode,r===null)try{i.componentDidMount()}catch(I){Pt(u,u.return,I)}else{var S=xo(u.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(S,r,i.__reactInternalSnapshotBeforeUpdate)}catch(I){Pt(u,u.return,I)}}g&64&&ax(u),g&512&&nc(u,u.return);break;case 3:if(Gi(i,u),g&64&&(i=u.updateQueue,i!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{G1(i,r)}catch(I){Pt(u,u.return,I)}}break;case 27:r===null&&g&4&&sx(u);case 26:case 5:Gi(i,u),r===null&&g&4&&rx(u),g&512&&nc(u,u.return);break;case 12:Gi(i,u);break;case 31:Gi(i,u),g&4&&px(i,u);break;case 13:Gi(i,u),g&4&&mx(i,u),g&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=Oj.bind(null,u),Jj(i,u))));break;case 22:if(g=u.memoizedState!==null||Qi,!g){r=r!==null&&r.memoizedState!==null||wn,S=Qi;var k=wn;Qi=g,(wn=r)&&!k?Zi(i,u,(u.subtreeFlags&8772)!==0):Gi(i,u),Qi=S,wn=k}break;case 30:break;default:Gi(i,u)}}function ux(i){var r=i.alternate;r!==null&&(i.alternate=null,ux(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&ns(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 Jt=null,oa=!1;function Vi(i,r,u){for(u=u.child;u!==null;)dx(i,r,u),u=u.sibling}function dx(i,r,u){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(Gn,u)}catch{}switch(u.tag){case 26:wn||hi(u,r),Vi(i,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:wn||hi(u,r);var g=Jt,S=oa;Or(u.type)&&(Jt=u.stateNode,oa=!1),Vi(i,r,u),dc(u.stateNode),Jt=g,oa=S;break;case 5:wn||hi(u,r);case 6:if(g=Jt,S=oa,Jt=null,Vi(i,r,u),Jt=g,oa=S,Jt!==null)if(oa)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(u.stateNode)}catch(k){Pt(u,r,k)}else try{Jt.removeChild(u.stateNode)}catch(k){Pt(u,r,k)}break;case 18:Jt!==null&&(oa?(i=Jt,ak(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),js(i)):ak(Jt,u.stateNode));break;case 4:g=Jt,S=oa,Jt=u.stateNode.containerInfo,oa=!0,Vi(i,r,u),Jt=g,oa=S;break;case 0:case 11:case 14:case 15:Ar(2,u,r),wn||Ar(4,u,r),Vi(i,r,u);break;case 1:wn||(hi(u,r),g=u.stateNode,typeof g.componentWillUnmount=="function"&&ix(u,r,g)),Vi(i,r,u);break;case 21:Vi(i,r,u);break;case 22:wn=(g=wn)||u.memoizedState!==null,Vi(i,r,u),wn=g;break;default:Vi(i,r,u)}}function px(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{js(i)}catch(u){Pt(r,r.return,u)}}}function mx(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{js(i)}catch(u){Pt(r,r.return,u)}}function Cj(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new lx),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new lx),r;default:throw Error(a(435,i.tag))}}function vd(i,r){var u=Cj(i);r.forEach(function(g){if(!u.has(g)){u.add(g);var S=jj.bind(null,i,g);g.then(S,S)}})}function sa(i,r){var u=r.deletions;if(u!==null)for(var g=0;g<u.length;g++){var S=u[g],k=i,I=r,P=I;e:for(;P!==null;){switch(P.tag){case 27:if(Or(P.type)){Jt=P.stateNode,oa=!1;break e}break;case 5:Jt=P.stateNode,oa=!1;break e;case 3:case 4:Jt=P.stateNode.containerInfo,oa=!0;break e}P=P.return}if(Jt===null)throw Error(a(160));dx(k,I,S),Jt=null,oa=!1,k=S.alternate,k!==null&&(k.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)fx(r,i),r=r.sibling}var Ya=null;function fx(i,r){var u=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:sa(r,i),la(i),g&4&&(Ar(3,i,i.return),tc(3,i),Ar(5,i,i.return));break;case 1:sa(r,i),la(i),g&512&&(wn||u===null||hi(u,u.return)),g&64&&Qi&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?g:u.concat(g))));break;case 26:var S=Ya;if(sa(r,i),la(i),g&512&&(wn||u===null||hi(u,u.return)),g&4){var k=u!==null?u.memoizedState:null;if(g=i.memoizedState,u===null)if(g===null)if(i.stateNode===null){e:{g=i.type,u=i.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":k=S.getElementsByTagName("title")[0],(!k||k[fr]||k[yn]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=S.createElement(g),S.head.insertBefore(k,S.querySelector("head > title"))),Bn(k,g,u),k[yn]=i,bn(k),g=k;break e;case"link":var I=fk("link","href",S).get(g+(u.href||""));if(I){for(var P=0;P<I.length;P++)if(k=I[P],k.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&k.getAttribute("rel")===(u.rel==null?null:u.rel)&&k.getAttribute("title")===(u.title==null?null:u.title)&&k.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){I.splice(P,1);break t}}k=S.createElement(g),Bn(k,g,u),S.head.appendChild(k);break;case"meta":if(I=fk("meta","content",S).get(g+(u.content||""))){for(P=0;P<I.length;P++)if(k=I[P],k.getAttribute("content")===(u.content==null?null:""+u.content)&&k.getAttribute("name")===(u.name==null?null:u.name)&&k.getAttribute("property")===(u.property==null?null:u.property)&&k.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&k.getAttribute("charset")===(u.charSet==null?null:u.charSet)){I.splice(P,1);break t}}k=S.createElement(g),Bn(k,g,u),S.head.appendChild(k);break;default:throw Error(a(468,g))}k[yn]=i,bn(k),g=k}i.stateNode=g}else hk(S,i.type,i.stateNode);else i.stateNode=mk(S,g,i.memoizedProps);else k!==g?(k===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):k.count--,g===null?hk(S,i.type,i.stateNode):mk(S,g,i.memoizedProps)):g===null&&i.stateNode!==null&&ph(i,i.memoizedProps,u.memoizedProps)}break;case 27:sa(r,i),la(i),g&512&&(wn||u===null||hi(u,u.return)),u!==null&&g&4&&ph(i,i.memoizedProps,u.memoizedProps);break;case 5:if(sa(r,i),la(i),g&512&&(wn||u===null||hi(u,u.return)),i.flags&32){S=i.stateNode;try{_n(S,"")}catch(ze){Pt(i,i.return,ze)}}g&4&&i.stateNode!=null&&(S=i.memoizedProps,ph(i,S,u!==null?u.memoizedProps:S)),g&1024&&(hh=!0);break;case 6:if(sa(r,i),la(i),g&4){if(i.stateNode===null)throw Error(a(162));g=i.memoizedProps,u=i.stateNode;try{u.nodeValue=g}catch(ze){Pt(i,i.return,ze)}}break;case 3:if(Od=null,S=Ya,Ya=_d(r.containerInfo),sa(r,i),Ya=S,la(i),g&4&&u!==null&&u.memoizedState.isDehydrated)try{js(r.containerInfo)}catch(ze){Pt(i,i.return,ze)}hh&&(hh=!1,hx(i));break;case 4:g=Ya,Ya=_d(i.stateNode.containerInfo),sa(r,i),la(i),Ya=g;break;case 12:sa(r,i),la(i);break;case 31:sa(r,i),la(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,vd(i,g)));break;case 13:sa(r,i),la(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(bd=pn()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,vd(i,g)));break;case 22:S=i.memoizedState!==null;var $=u!==null&&u.memoizedState!==null,ie=Qi,me=wn;if(Qi=ie||S,wn=me||$,sa(r,i),wn=me,Qi=ie,la(i),g&8192)e:for(r=i.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(u===null||$||Qi||wn||ko(i)),u=null,r=i;;){if(r.tag===5||r.tag===26){if(u===null){$=u=r;try{if(k=$.stateNode,S)I=k.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{P=$.stateNode;var Se=$.memoizedProps.style,oe=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(ze){Pt($,$.return,ze)}}}else if(r.tag===6){if(u===null){$=r;try{$.stateNode.nodeValue=S?"":$.memoizedProps}catch(ze){Pt($,$.return,ze)}}}else if(r.tag===18){if(u===null){$=r;try{var ce=$.stateNode;S?ik(ce,!0):ik($.stateNode,!1)}catch(ze){Pt($,$.return,ze)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}g&4&&(g=i.updateQueue,g!==null&&(u=g.retryQueue,u!==null&&(g.retryQueue=null,vd(i,u))));break;case 19:sa(r,i),la(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,vd(i,g)));break;case 30:break;case 21:break;default:sa(r,i),la(i)}}function la(i){var r=i.flags;if(r&2){try{for(var u,g=i.return;g!==null;){if(ox(g)){u=g;break}g=g.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var S=u.stateNode,k=mh(i);gd(i,k,S);break;case 5:var I=u.stateNode;u.flags&32&&(_n(I,""),u.flags&=-33);var P=mh(i);gd(i,P,I);break;case 3:case 4:var $=u.stateNode.containerInfo,ie=mh(i);fh(i,ie,$);break;default:throw Error(a(161))}}catch(me){Pt(i,i.return,me)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function hx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;hx(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Gi(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)cx(i,r.alternate,r),r=r.sibling}function ko(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Ar(4,r,r.return),ko(r);break;case 1:hi(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&ix(r,r.return,u),ko(r);break;case 27:dc(r.stateNode);case 26:case 5:hi(r,r.return),ko(r);break;case 22:r.memoizedState===null&&ko(r);break;case 30:ko(r);break;default:ko(r)}i=i.sibling}}function Zi(i,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,S=i,k=r,I=k.flags;switch(k.tag){case 0:case 11:case 15:Zi(S,k,u),tc(4,k);break;case 1:if(Zi(S,k,u),g=k,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ie){Pt(g,g.return,ie)}if(g=k,S=g.updateQueue,S!==null){var P=g.stateNode;try{var $=S.shared.hiddenCallbacks;if($!==null)for(S.shared.hiddenCallbacks=null,S=0;S<$.length;S++)V1($[S],P)}catch(ie){Pt(g,g.return,ie)}}u&&I&64&&ax(k),nc(k,k.return);break;case 27:sx(k);case 26:case 5:Zi(S,k,u),u&&g===null&&I&4&&rx(k),nc(k,k.return);break;case 12:Zi(S,k,u);break;case 31:Zi(S,k,u),u&&I&4&&px(S,k);break;case 13:Zi(S,k,u),u&&I&4&&mx(S,k);break;case 22:k.memoizedState===null&&Zi(S,k,u),nc(k,k.return);break;case 30:break;default:Zi(S,k,u)}r=r.sibling}}function gh(i,r){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Ul(u))}function vh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ul(i))}function Xa(i,r,u,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)gx(i,r,u,g),r=r.sibling}function gx(i,r,u,g){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Xa(i,r,u,g),S&2048&&tc(9,r);break;case 1:Xa(i,r,u,g);break;case 3:Xa(i,r,u,g),S&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ul(i)));break;case 12:if(S&2048){Xa(i,r,u,g),i=r.stateNode;try{var k=r.memoizedProps,I=k.id,P=k.onPostCommit;typeof P=="function"&&P(I,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch($){Pt(r,r.return,$)}}else Xa(i,r,u,g);break;case 31:Xa(i,r,u,g);break;case 13:Xa(i,r,u,g);break;case 23:break;case 22:k=r.stateNode,I=r.alternate,r.memoizedState!==null?k._visibility&2?Xa(i,r,u,g):ac(i,r):k._visibility&2?Xa(i,r,u,g):(k._visibility|=2,ws(i,r,u,g,(r.subtreeFlags&10256)!==0||!1)),S&2048&&gh(I,r);break;case 24:Xa(i,r,u,g),S&2048&&vh(r.alternate,r);break;default:Xa(i,r,u,g)}}function ws(i,r,u,g,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var k=i,I=r,P=u,$=g,ie=I.flags;switch(I.tag){case 0:case 11:case 15:ws(k,I,P,$,S),tc(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?ws(k,I,P,$,S):ac(k,I):(me._visibility|=2,ws(k,I,P,$,S)),S&&ie&2048&&gh(I.alternate,I);break;case 24:ws(k,I,P,$,S),S&&ie&2048&&vh(I.alternate,I);break;default:ws(k,I,P,$,S)}r=r.sibling}}function ac(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=i,g=r,S=g.flags;switch(g.tag){case 22:ac(u,g),S&2048&&gh(g.alternate,g);break;case 24:ac(u,g),S&2048&&vh(g.alternate,g);break;default:ac(u,g)}r=r.sibling}}var ic=8192;function Ms(i,r,u){if(i.subtreeFlags&ic)for(i=i.child;i!==null;)vx(i,r,u),i=i.sibling}function vx(i,r,u){switch(i.tag){case 26:Ms(i,r,u),i.flags&ic&&i.memoizedState!==null&&dP(u,Ya,i.memoizedState,i.memoizedProps);break;case 5:Ms(i,r,u);break;case 3:case 4:var g=Ya;Ya=_d(i.stateNode.containerInfo),Ms(i,r,u),Ya=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=ic,ic=16777216,Ms(i,r,u),ic=g):Ms(i,r,u));break;default:Ms(i,r,u)}}function yx(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 rc(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];jn=g,Sx(g,i)}yx(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)bx(i),i=i.sibling}function bx(i){switch(i.tag){case 0:case 11:case 15:rc(i),i.flags&2048&&Ar(9,i,i.return);break;case 3:rc(i);break;case 12:rc(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,yd(i)):rc(i);break;default:rc(i)}}function yd(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];jn=g,Sx(g,i)}yx(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Ar(8,r,r.return),yd(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,yd(r));break;default:yd(r)}i=i.sibling}}function Sx(i,r){for(;jn!==null;){var u=jn;switch(u.tag){case 0:case 11:case 15:Ar(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var g=u.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Ul(u.memoizedState.cache)}if(g=u.child,g!==null)g.return=u,jn=g;else e:for(u=i;jn!==null;){g=jn;var S=g.sibling,k=g.return;if(ux(g),g===u){jn=null;break e}if(S!==null){S.return=k,jn=S;break e}jn=k}}}var Aj={getCacheForType:function(i){var r=Ln(Sn),u=r.data.get(i);return u===void 0&&(u=i(),r.data.set(i,u)),u},cacheSignal:function(){return Ln(Sn).controller.signal}},Ej=typeof WeakMap=="function"?WeakMap:Map,_t=0,Vt=null,mt=null,vt=0,jt=0,ka=null,Er=!1,Cs=!1,yh=!1,Ki=0,cn=0,Rr=0,wo=0,bh=0,wa=0,As=0,oc=null,ca=null,Sh=!1,bd=0,xx=0,Sd=1/0,xd=null,Ir=null,Nn=0,Tr=null,Es=null,Wi=0,xh=0,kh=null,kx=null,sc=0,wh=null;function Ma(){return(_t&2)!==0&&vt!==0?vt&-vt:B.T!==null?Ih():El()}function wx(){if(wa===0)if((vt&536870912)===0||kt){var i=be;be<<=1,(be&3932160)===0&&(be=262144),wa=i}else wa=536870912;return i=Sa.current,i!==null&&(i.flags|=32),wa}function ua(i,r,u){(i===Vt&&(jt===2||jt===9)||i.cancelPendingCommit!==null)&&(Rs(i,0),_r(i,vt,wa,!1)),Ri(i,u),((_t&2)===0||i!==Vt)&&(i===Vt&&((_t&2)===0&&(wo|=u),cn===4&&_r(i,vt,wa,!1)),gi(i))}function Mx(i,r,u){if((_t&6)!==0)throw Error(a(327));var g=!u&&(r&127)===0&&(r&i.expiredLanes)===0||Zn(i,r),S=g?Tj(i,r):Ch(i,r,!0),k=g;do{if(S===0){Cs&&!g&&_r(i,r,0,!1);break}else{if(u=i.current.alternate,k&&!Rj(u)){S=Ch(i,r,!1),k=!1;continue}if(S===2){if(k=r,i.errorRecoveryDisabledLanes&k)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){r=I;e:{var P=i;S=oc;var $=P.current.memoizedState.isDehydrated;if($&&(Rs(P,I).flags|=256),I=Ch(P,I,!1),I!==2){if(yh&&!$){P.errorRecoveryDisabledLanes|=k,wo|=k,S=4;break e}k=ca,ca=S,k!==null&&(ca===null?ca=k:ca.push.apply(ca,k))}S=I}if(k=!1,S!==2)continue}}if(S===1){Rs(i,0),_r(i,r,0,!0);break}e:{switch(g=i,k=S,k){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:_r(g,r,wa,!Er);break e;case 2:ca=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(S=bd+300-pn(),10<S)){if(_r(g,r,wa,!Er),Qt(g,0,!0)!==0)break e;Wi=r,g.timeoutHandle=tk(Cx.bind(null,g,u,ca,xd,Sh,r,wa,wo,As,Er,k,"Throttled",-0,0),S);break e}Cx(g,u,ca,xd,Sh,r,wa,wo,As,Er,k,null,-0,0)}}break}while(!0);gi(i)}function Cx(i,r,u,g,S,k,I,P,$,ie,me,Se,oe,ce){if(i.timeoutHandle=-1,Se=r.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ze},vx(r,k,Se);var ze=(k&62914560)===k?bd-pn():(k&4194048)===k?xx-pn():0;if(ze=pP(Se,ze),ze!==null){Wi=k,i.cancelPendingCommit=ze(Ox.bind(null,i,r,k,u,g,S,I,P,$,me,Se,null,oe,ce)),_r(i,k,I,!ie);return}}Ox(i,r,k,u,g,S,I,P,$)}function Rj(i){for(var r=i;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var g=0;g<u.length;g++){var S=u[g],k=S.getSnapshot;S=S.value;try{if(!ya(k(),S))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function _r(i,r,u,g){r&=~bh,r&=~wo,i.suspendedLanes|=r,i.pingedLanes&=~r,g&&(i.warmLanes|=r),g=i.expirationTimes;for(var S=r;0<S;){var k=31-In(S),I=1<<k;g[k]=-1,S&=~I}u!==0&&Cl(i,u,r)}function kd(){return(_t&6)===0?(lc(0),!1):!0}function Mh(){if(mt!==null){if(jt===0)var i=mt.return;else i=mt,qi=fo=null,Bf(i),ys=null,$l=0,i=mt;for(;i!==null;)nx(i.alternate,i),i=i.return;mt=null}}function Rs(i,r){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,Zj(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Wi=0,Mh(),Vt=i,mt=u=zi(i.current,null),vt=r,jt=0,ka=null,Er=!1,Cs=Zn(i,r),yh=!1,As=wa=bh=wo=Rr=cn=0,ca=oc=null,Sh=!1,(r&8)!==0&&(r|=r&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=r;0<g;){var S=31-In(g),k=1<<S;r|=i[S],g&=~k}return Ki=r,Hu(),u}function Ax(i,r){lt=null,B.H=Xl,r===vs||r===Yu?(r=U1(),jt=3):r===Rf?(r=U1(),jt=4):jt=r===nh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ka=r,mt===null&&(cn=1,dd(i,Pa(r,i.current)))}function Ex(){var i=Sa.current;return i===null?!0:(vt&4194048)===vt?qa===null:(vt&62914560)===vt||(vt&536870912)!==0?i===qa:!1}function Rx(){var i=B.H;return B.H=Xl,i===null?Xl:i}function Ix(){var i=B.A;return B.A=Aj,i}function wd(){cn=4,Er||(vt&4194048)!==vt&&Sa.current!==null||(Cs=!0),(Rr&134217727)===0&&(wo&134217727)===0||Vt===null||_r(Vt,vt,wa,!1)}function Ch(i,r,u){var g=_t;_t|=2;var S=Rx(),k=Ix();(Vt!==i||vt!==r)&&(xd=null,Rs(i,r)),r=!1;var I=cn;e:do try{if(jt!==0&&mt!==null){var P=mt,$=ka;switch(jt){case 8:Mh(),I=6;break e;case 3:case 2:case 9:case 6:Sa.current===null&&(r=!0);var ie=jt;if(jt=0,ka=null,Is(i,P,$,ie),u&&Cs){I=0;break e}break;default:ie=jt,jt=0,ka=null,Is(i,P,$,ie)}}Ij(),I=cn;break}catch(me){Ax(i,me)}while(!0);return r&&i.shellSuspendCounter++,qi=fo=null,_t=g,B.H=S,B.A=k,mt===null&&(Vt=null,vt=0,Hu()),I}function Ij(){for(;mt!==null;)Tx(mt)}function Tj(i,r){var u=_t;_t|=2;var g=Rx(),S=Ix();Vt!==i||vt!==r?(xd=null,Sd=pn()+500,Rs(i,r)):Cs=Zn(i,r);e:do try{if(jt!==0&&mt!==null){r=mt;var k=ka;t:switch(jt){case 1:jt=0,ka=null,Is(i,r,k,1);break;case 2:case 9:if(B1(k)){jt=0,ka=null,_x(r);break}r=function(){jt!==2&&jt!==9||Vt!==i||(jt=7),gi(i)},k.then(r,r);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:B1(k)?(jt=0,ka=null,_x(r)):(jt=0,ka=null,Is(i,r,k,7));break;case 5:var I=null;switch(mt.tag){case 26:I=mt.memoizedState;case 5:case 27:var P=mt;if(I?gk(I):P.stateNode.complete){jt=0,ka=null;var $=P.sibling;if($!==null)mt=$;else{var ie=P.return;ie!==null?(mt=ie,Md(ie)):mt=null}break t}}jt=0,ka=null,Is(i,r,k,5);break;case 6:jt=0,ka=null,Is(i,r,k,6);break;case 8:Mh(),cn=6;break e;default:throw Error(a(462))}}_j();break}catch(me){Ax(i,me)}while(!0);return qi=fo=null,B.H=g,B.A=S,_t=u,mt!==null?0:(Vt=null,vt=0,Hu(),cn)}function _j(){for(;mt!==null&&!Yt();)Tx(mt)}function Tx(i){var r=ex(i.alternate,i,Ki);i.memoizedProps=i.pendingProps,r===null?Md(i):mt=r}function _x(i){var r=i,u=r.alternate;switch(r.tag){case 15:case 0:r=ZS(u,r,r.pendingProps,r.type,void 0,vt);break;case 11:r=ZS(u,r,r.pendingProps,r.type.render,r.ref,vt);break;case 5:Bf(r);default:nx(u,r),r=mt=I1(r,Ki),r=ex(u,r,Ki)}i.memoizedProps=i.pendingProps,r===null?Md(i):mt=r}function Is(i,r,u,g){qi=fo=null,Bf(r),ys=null,$l=0;var S=r.return;try{if(bj(i,S,r,u,vt)){cn=1,dd(i,Pa(u,i.current)),mt=null;return}}catch(k){if(S!==null)throw mt=S,k;cn=1,dd(i,Pa(u,i.current)),mt=null;return}r.flags&32768?(kt||g===1?i=!0:Cs||(vt&536870912)!==0?i=!1:(Er=i=!0,(g===2||g===9||g===3||g===6)&&(g=Sa.current,g!==null&&g.tag===13&&(g.flags|=16384))),Nx(r,i)):Md(r)}function Md(i){var r=i;do{if((r.flags&32768)!==0){Nx(r,Er);return}i=r.return;var u=kj(r.alternate,r,Ki);if(u!==null){mt=u;return}if(r=r.sibling,r!==null){mt=r;return}mt=r=i}while(r!==null);cn===0&&(cn=5)}function Nx(i,r){do{var u=wj(i.alternate,i);if(u!==null){u.flags&=32767,mt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(i=i.sibling,i!==null)){mt=i;return}mt=i=u}while(i!==null);cn=6,mt=null}function Ox(i,r,u,g,S,k,I,P,$){i.cancelPendingCommit=null;do Cd();while(Nn!==0);if((_t&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(k=r.lanes|r.childLanes,k|=mf,Ii(i,u,k,I,P,$),i===Vt&&(mt=Vt=null,vt=0),Es=r,Tr=i,Wi=u,xh=k,kh=S,kx=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Pj(ia,function(){return Lx(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=B.T,B.T=null,S=ue.p,ue.p=2,I=_t,_t|=4;try{Mj(i,r,u)}finally{_t=I,ue.p=S,B.T=g}}Nn=1,jx(),Px(),Dx()}}function jx(){if(Nn===1){Nn=0;var i=Tr,r=Es,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var g=ue.p;ue.p=2;var S=_t;_t|=4;try{fx(r,i);var k=zh,I=S1(i.containerInfo),P=k.focusedElem,$=k.selectionRange;if(I!==P&&P&&P.ownerDocument&&b1(P.ownerDocument.documentElement,P)){if($!==null&&lf(P)){var ie=$.start,me=$.end;if(me===void 0&&(me=ie),"selectionStart"in P)P.selectionStart=ie,P.selectionEnd=Math.min(me,P.value.length);else{var Se=P.ownerDocument||document,oe=Se&&Se.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),ze=P.textContent.length,Ke=Math.min($.start,ze),Ut=$.end===void 0?Ke:Math.min($.end,ze);!ce.extend&&Ke>Ut&&(I=Ut,Ut=Ke,Ke=I);var W=y1(P,Ke),K=y1(P,Ut);if(W&&K&&(ce.rangeCount!==1||ce.anchorNode!==W.node||ce.anchorOffset!==W.offset||ce.focusNode!==K.node||ce.focusOffset!==K.offset)){var ae=Se.createRange();ae.setStart(W.node,W.offset),ce.removeAllRanges(),Ke>Ut?(ce.addRange(ae),ce.extend(K.node,K.offset)):(ae.setEnd(K.node,K.offset),ce.addRange(ae))}}}}for(Se=[],ce=P;ce=ce.parentNode;)ce.nodeType===1&&Se.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Se.length;P++){var ve=Se[P];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}zd=!!Dh,zh=Dh=null}finally{_t=S,ue.p=g,B.T=u}}i.current=r,Nn=2}}function Px(){if(Nn===2){Nn=0;var i=Tr,r=Es,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var g=ue.p;ue.p=2;var S=_t;_t|=4;try{cx(i,r.alternate,r)}finally{_t=S,ue.p=g,B.T=u}}Nn=3}}function Dx(){if(Nn===4||Nn===3){Nn=0,En();var i=Tr,r=Es,u=Wi,g=kx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Nn=5:(Nn=0,Es=Tr=null,zx(i,i.pendingLanes));var S=i.pendingLanes;if(S===0&&(Ir=null),ts(u),r=r.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(Gn,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=B.T,S=ue.p,ue.p=2,B.T=null;try{for(var k=i.onRecoverableError,I=0;I<g.length;I++){var P=g[I];k(P.value,{componentStack:P.stack})}}finally{B.T=r,ue.p=S}}(Wi&3)!==0&&Cd(),gi(i),S=i.pendingLanes,(u&261930)!==0&&(S&42)!==0?i===wh?sc++:(sc=0,wh=i):sc=0,lc(0)}}function zx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Ul(r)))}function Cd(){return jx(),Px(),Dx(),Lx()}function Lx(){if(Nn!==5)return!1;var i=Tr,r=xh;xh=0;var u=ts(Wi),g=B.T,S=ue.p;try{ue.p=32>u?32:u,B.T=null,u=kh,kh=null;var k=Tr,I=Wi;if(Nn=0,Es=Tr=null,Wi=0,(_t&6)!==0)throw Error(a(331));var P=_t;if(_t|=4,bx(k.current),gx(k,k.current,I,u),_t=P,lc(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(Gn,k)}catch{}return!0}finally{ue.p=S,B.T=g,zx(i,r)}}function qx(i,r,u){r=Pa(u,r),r=th(i.stateNode,r,2),i=wr(i,r,2),i!==null&&(Ri(i,2),gi(i))}function Pt(i,r,u){if(i.tag===3)qx(i,i,u);else for(;r!==null;){if(r.tag===3){qx(r,i,u);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ir===null||!Ir.has(g))){i=Pa(u,i),u=BS(2),g=wr(r,u,2),g!==null&&(FS(u,g,r,i),Ri(g,2),gi(g));break}}r=r.return}}function Ah(i,r,u){var g=i.pingCache;if(g===null){g=i.pingCache=new Ej;var S=new Set;g.set(r,S)}else S=g.get(r),S===void 0&&(S=new Set,g.set(r,S));S.has(u)||(yh=!0,S.add(u),i=Nj.bind(null,i,r,u),r.then(i,i))}function Nj(i,r,u){var g=i.pingCache;g!==null&&g.delete(r),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Vt===i&&(vt&u)===u&&(cn===4||cn===3&&(vt&62914560)===vt&&300>pn()-bd?(_t&2)===0&&Rs(i,0):bh|=u,As===vt&&(As=0)),gi(i)}function Bx(i,r){r===0&&(r=Jo()),i=uo(i,r),i!==null&&(Ri(i,r),gi(i))}function Oj(i){var r=i.memoizedState,u=0;r!==null&&(u=r.retryLane),Bx(i,u)}function jj(i,r){var u=0;switch(i.tag){case 31:case 13:var g=i.stateNode,S=i.memoizedState;S!==null&&(u=S.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(r),Bx(i,u)}function Pj(i,r){return dt(i,r)}var Ad=null,Ts=null,Eh=!1,Ed=!1,Rh=!1,Nr=0;function gi(i){i!==Ts&&i.next===null&&(Ts===null?Ad=Ts=i:Ts=Ts.next=i),Ed=!0,Eh||(Eh=!0,zj())}function lc(i,r){if(!Rh&&Ed){Rh=!0;do for(var u=!1,g=Ad;g!==null;){if(i!==0){var S=g.pendingLanes;if(S===0)var k=0;else{var I=g.suspendedLanes,P=g.pingedLanes;k=(1<<31-In(42|i)+1)-1,k&=S&~(I&~P),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(u=!0,$x(g,k))}else k=vt,k=Qt(g,g===Vt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||Zn(g,k)||(u=!0,$x(g,k));g=g.next}while(u);Rh=!1}}function Dj(){Fx()}function Fx(){Ed=Eh=!1;var i=0;Nr!==0&&Gj()&&(i=Nr);for(var r=pn(),u=null,g=Ad;g!==null;){var S=g.next,k=Ux(g,r);k===0?(g.next=null,u===null?Ad=S:u.next=S,S===null&&(Ts=u)):(u=g,(i!==0||(k&3)!==0)&&(Ed=!0)),g=S}Nn!==0&&Nn!==5||lc(i),Nr!==0&&(Nr=0)}function Ux(i,r){for(var u=i.suspendedLanes,g=i.pingedLanes,S=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var I=31-In(k),P=1<<I,$=S[I];$===-1?((P&u)===0||(P&g)!==0)&&(S[I]=Qa(P,r)):$<=r&&(i.expiredLanes|=P),k&=~P}if(r=Vt,u=vt,u=Qt(i,i===r?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,u===0||i===r&&(jt===2||jt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&Tt(g),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Zn(i,u)){if(r=u&-u,r===i.callbackPriority)return r;switch(g!==null&&Tt(g),ts(u)){case 2:case 8:u=pr;break;case 32:u=ia;break;case 268435456:u=it;break;default:u=ia}return g=Hx.bind(null,i),u=dt(u,g),i.callbackPriority=r,i.callbackNode=u,r}return g!==null&&g!==null&&Tt(g),i.callbackPriority=2,i.callbackNode=null,2}function Hx(i,r){if(Nn!==0&&Nn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Cd()&&i.callbackNode!==u)return null;var g=vt;return g=Qt(i,i===Vt?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(Mx(i,g,r),Ux(i,pn()),i.callbackNode!=null&&i.callbackNode===u?Hx.bind(null,i):null)}function $x(i,r){if(Cd())return null;Mx(i,r,!0)}function zj(){Kj(function(){(_t&6)!==0?dt(aa,Dj):Fx()})}function Ih(){if(Nr===0){var i=hs;i===0&&(i=li,li<<=1,(li&261888)===0&&(li=256)),Nr=i}return Nr}function Qx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Hn(""+i)}function Vx(i,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,i.id&&u.setAttribute("form",i.id),r.parentNode.insertBefore(u,r),i=new FormData(i),u.parentNode.removeChild(u),i}function Lj(i,r,u,g,S){if(r==="submit"&&u&&u.stateNode===S){var k=Qx((S[Pn]||null).action),I=g.submitter;I&&(r=(r=I[Pn]||null)?Qx(r.formAction):I.getAttribute("formAction"),r!==null&&(k=r,I=null));var P=new qu("action","action",null,g,S);i.push({event:P,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Nr!==0){var $=I?Vx(S,I):new FormData(S);Kf(u,{pending:!0,data:$,method:S.method,action:k},null,$)}}else typeof k=="function"&&(P.preventDefault(),$=I?Vx(S,I):new FormData(S),Kf(u,{pending:!0,data:$,method:S.method,action:k},k,$))},currentTarget:S}]})}}for(var Th=0;Th<pf.length;Th++){var _h=pf[Th],qj=_h.toLowerCase(),Bj=_h[0].toUpperCase()+_h.slice(1);Wa(qj,"on"+Bj)}Wa(w1,"onAnimationEnd"),Wa(M1,"onAnimationIteration"),Wa(C1,"onAnimationStart"),Wa("dblclick","onDoubleClick"),Wa("focusin","onFocus"),Wa("focusout","onBlur"),Wa(nj,"onTransitionRun"),Wa(aj,"onTransitionStart"),Wa(ij,"onTransitionCancel"),Wa(A1,"onTransitionEnd"),Ni("onMouseEnter",["mouseout","mouseover"]),Ni("onMouseLeave",["mouseout","mouseover"]),Ni("onPointerEnter",["pointerout","pointerover"]),Ni("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cc="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(" "),Fj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cc));function Gx(i,r){r=(r&4)!==0;for(var u=0;u<i.length;u++){var g=i[u],S=g.event;g=g.listeners;e:{var k=void 0;if(r)for(var I=g.length-1;0<=I;I--){var P=g[I],$=P.instance,ie=P.currentTarget;if(P=P.listener,$!==k&&S.isPropagationStopped())break e;k=P,S.currentTarget=ie;try{k(S)}catch(me){Uu(me)}S.currentTarget=null,k=$}else for(I=0;I<g.length;I++){if(P=g[I],$=P.instance,ie=P.currentTarget,P=P.listener,$!==k&&S.isPropagationStopped())break e;k=P,S.currentTarget=ie;try{k(S)}catch(me){Uu(me)}S.currentTarget=null,k=$}}}}function ft(i,r){var u=r[Il];u===void 0&&(u=r[Il]=new Set);var g=i+"__bubble";u.has(g)||(Zx(r,i,2,!1),u.add(g))}function Nh(i,r,u){var g=0;r&&(g|=4),Zx(u,i,g,r)}var Rd="_reactListening"+Math.random().toString(36).slice(2);function Oh(i){if(!i[Rd]){i[Rd]=!0,ro.forEach(function(u){u!=="selectionchange"&&(Fj.has(u)||Nh(u,!1,i),Nh(u,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Rd]||(r[Rd]=!0,Nh("selectionchange",!1,r))}}function Zx(i,r,u,g){switch(wk(r)){case 2:var S=hP;break;case 8:S=gP;break;default:S=Zh}u=S.bind(null,r,u,i),S=void 0,!Xm||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),g?S!==void 0?i.addEventListener(r,u,{capture:!0,passive:S}):i.addEventListener(r,u,!0):S!==void 0?i.addEventListener(r,u,{passive:S}):i.addEventListener(r,u,!1)}function jh(i,r,u,g,S){var k=g;if((r&1)===0&&(r&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var P=g.stateNode.containerInfo;if(P===S)break;if(I===4)for(I=g.return;I!==null;){var $=I.tag;if(($===3||$===4)&&I.stateNode.containerInfo===S)return;I=I.return}for(;P!==null;){if(I=Ti(P),I===null)return;if($=I.tag,$===5||$===6||$===26||$===27){g=k=I;continue e}P=P.parentNode}}g=g.return}ji(function(){var ie=k,me=Kn(u),Se=[];e:{var oe=E1.get(i);if(oe!==void 0){var ce=qu,ze=i;switch(i){case"keypress":if(zu(u)===0)break e;case"keydown":case"keyup":ce=jO;break;case"focusin":ze="focus",ce=nf;break;case"focusout":ze="blur",ce=nf;break;case"beforeblur":case"afterblur":ce=nf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=n1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=kO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=zO;break;case w1:case M1:case C1:ce=CO;break;case A1:ce=qO;break;case"scroll":case"scrollend":ce=SO;break;case"wheel":ce=FO;break;case"copy":case"cut":case"paste":ce=EO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=i1;break;case"toggle":case"beforetoggle":ce=HO}var Ke=(r&4)!==0,Ut=!Ke&&(i==="scroll"||i==="scrollend"),W=Ke?oe!==null?oe+"Capture":null:oe;Ke=[];for(var K=ie,ae;K!==null;){var ve=K;if(ae=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ae===null||W===null||(ve=Pi(K,W),ve!=null&&Ke.push(uc(K,ve,ae))),Ut)break;K=K.return}0<Ke.length&&(oe=new ce(oe,ze,null,u,me),Se.push({event:oe,listeners:Ke}))}}if((r&7)===0){e:{if(oe=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",oe&&u!==xt&&(ze=u.relatedTarget||u.fromElement)&&(Ti(ze)||ze[mr]))break e;if((ce||oe)&&(oe=me.window===me?me:(oe=me.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(ze=u.relatedTarget||u.toElement,ce=ie,ze=ze?Ti(ze):null,ze!==null&&(Ut=p(ze),Ke=ze.tag,ze!==Ut||Ke!==5&&Ke!==27&&Ke!==6)&&(ze=null)):(ce=null,ze=ie),ce!==ze)){if(Ke=n1,ve="onMouseLeave",W="onMouseEnter",K="mouse",(i==="pointerout"||i==="pointerover")&&(Ke=i1,ve="onPointerLeave",W="onPointerEnter",K="pointer"),Ut=ce==null?oe:ci(ce),ae=ze==null?oe:ci(ze),oe=new Ke(ve,K+"leave",ce,u,me),oe.target=Ut,oe.relatedTarget=ae,ve=null,Ti(me)===ie&&(Ke=new Ke(W,K+"enter",ze,u,me),Ke.target=ae,Ke.relatedTarget=Ut,ve=Ke),Ut=ve,ce&&ze)t:{for(Ke=Uj,W=ce,K=ze,ae=0,ve=W;ve;ve=Ke(ve))ae++;ve=0;for(var Qe=K;Qe;Qe=Ke(Qe))ve++;for(;0<ae-ve;)W=Ke(W),ae--;for(;0<ve-ae;)K=Ke(K),ve--;for(;ae--;){if(W===K||K!==null&&W===K.alternate){Ke=W;break t}W=Ke(W),K=Ke(K)}Ke=null}else Ke=null;ce!==null&&Kx(Se,oe,ce,Ke,!1),ze!==null&&Ut!==null&&Kx(Se,Ut,ze,Ke,!0)}}e:{if(oe=ie?ci(ie):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var Et=p1;else if(u1(oe))if(m1)Et=JO;else{Et=YO;var Fe=WO}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&rt(ie.elementType)&&(Et=p1):Et=XO;if(Et&&(Et=Et(i,ie))){d1(Se,Et,u,me);break e}Fe&&Fe(i,oe,ie),i==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&Ve(oe,"number",oe.value)}switch(Fe=ie?ci(ie):window,i){case"focusin":(u1(Fe)||Fe.contentEditable==="true")&&(ss=Fe,cf=ie,ql=null);break;case"focusout":ql=cf=ss=null;break;case"mousedown":uf=!0;break;case"contextmenu":case"mouseup":case"dragend":uf=!1,x1(Se,u,me);break;case"selectionchange":if(tj)break;case"keydown":case"keyup":x1(Se,u,me)}var ut;if(rf)e:{switch(i){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else os?l1(i,u)&&(yt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(yt="onCompositionStart");yt&&(r1&&u.locale!=="ko"&&(os||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&os&&(ut=e1()):(gr=me,Jm="value"in gr?gr.value:gr.textContent,os=!0)),Fe=Id(ie,yt),0<Fe.length&&(yt=new a1(yt,i,null,u,me),Se.push({event:yt,listeners:Fe}),ut?yt.data=ut:(ut=c1(u),ut!==null&&(yt.data=ut)))),(ut=QO?VO(i,u):GO(i,u))&&(yt=Id(ie,"onBeforeInput"),0<yt.length&&(Fe=new a1("onBeforeInput","beforeinput",null,u,me),Se.push({event:Fe,listeners:yt}),Fe.data=ut)),Lj(Se,i,ie,u,me)}Gx(Se,r)})}function uc(i,r,u){return{instance:i,listener:r,currentTarget:u}}function Id(i,r){for(var u=r+"Capture",g=[];i!==null;){var S=i,k=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||k===null||(S=Pi(i,u),S!=null&&g.unshift(uc(i,S,k)),S=Pi(i,r),S!=null&&g.push(uc(i,S,k))),i.tag===3)return g;i=i.return}return[]}function Uj(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Kx(i,r,u,g,S){for(var k=r._reactName,I=[];u!==null&&u!==g;){var P=u,$=P.alternate,ie=P.stateNode;if(P=P.tag,$!==null&&$===g)break;P!==5&&P!==26&&P!==27||ie===null||($=ie,S?(ie=Pi(u,k),ie!=null&&I.unshift(uc(u,ie,$))):S||(ie=Pi(u,k),ie!=null&&I.push(uc(u,ie,$)))),u=u.return}I.length!==0&&i.push({event:r,listeners:I})}var Hj=/\r\n?/g,$j=/\u0000|\uFFFD/g;function Wx(i){return(typeof i=="string"?i:""+i).replace(Hj,`
10
+ `).replace($j,"")}function Yx(i,r){return r=Wx(r),Wx(i)===r}function Ft(i,r,u,g,S,k){switch(u){case"children":typeof g=="string"?r==="body"||r==="textarea"&&g===""||_n(i,g):(typeof g=="number"||typeof g=="bigint")&&r!=="body"&&_n(i,""+g);break;case"className":Oa(i,"class",g);break;case"tabIndex":Oa(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Oa(i,u,g);break;case"style":va(i,g,k);break;case"data":if(r!=="object"){Oa(i,"data",g);break}case"src":case"href":if(g===""&&(r!=="a"||u!=="href")){i.removeAttribute(u);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Hn(""+g),i.setAttribute(u,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(u==="formAction"?(r!=="input"&&Ft(i,r,"name",S.name,S,null),Ft(i,r,"formEncType",S.formEncType,S,null),Ft(i,r,"formMethod",S.formMethod,S,null),Ft(i,r,"formTarget",S.formTarget,S,null)):(Ft(i,r,"encType",S.encType,S,null),Ft(i,r,"method",S.method,S,null),Ft(i,r,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Hn(""+g),i.setAttribute(u,g);break;case"onClick":g!=null&&(i.onclick=Ze);break;case"onScroll":g!=null&&ft("scroll",i);break;case"onScrollEnd":g!=null&&ft("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}u=Hn(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""+g):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":g===!0?i.setAttribute(u,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,g):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(u,g):i.removeAttribute(u);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(u):i.setAttribute(u,g);break;case"popover":ft("beforetoggle",i),ft("toggle",i),rs(i,"popover",g);break;case"xlinkActuate":Za(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Za(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Za(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Za(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Za(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Za(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Za(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Za(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Za(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":rs(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ui.get(u)||u,rs(i,u,g))}}function Ph(i,r,u,g,S,k){switch(u){case"style":va(i,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"children":typeof g=="string"?_n(i,g):(typeof g=="number"||typeof g=="bigint")&&_n(i,""+g);break;case"onScroll":g!=null&&ft("scroll",i);break;case"onScrollEnd":g!=null&&ft("scrollend",i);break;case"onClick":g!=null&&(i.onclick=Ze);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_l.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(S=u.endsWith("Capture"),r=u.slice(2,S?u.length-7:void 0),k=i[Pn]||null,k=k!=null?k[u]:null,typeof k=="function"&&i.removeEventListener(r,k,S),typeof g=="function")){typeof k!="function"&&k!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(r,g,S);break e}u in i?i[u]=g:g===!0?i.setAttribute(u,""):rs(i,u,g)}}}function Bn(i,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",i),ft("load",i);var g=!1,S=!1,k;for(k in u)if(u.hasOwnProperty(k)){var I=u[k];if(I!=null)switch(k){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Ft(i,r,k,I,u,null)}}S&&Ft(i,r,"srcSet",u.srcSet,u,null),g&&Ft(i,r,"src",u.src,u,null);return;case"input":ft("invalid",i);var P=k=I=S=null,$=null,ie=null;for(g in u)if(u.hasOwnProperty(g)){var me=u[g];if(me!=null)switch(g){case"name":S=me;break;case"type":I=me;break;case"checked":$=me;break;case"defaultChecked":ie=me;break;case"value":k=me;break;case"defaultValue":P=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(a(137,r));break;default:Ft(i,r,g,me,u,null)}}Tn(i,k,P,$,ie,I,S,!1);return;case"select":ft("invalid",i),g=I=k=null;for(S in u)if(u.hasOwnProperty(S)&&(P=u[S],P!=null))switch(S){case"value":k=P;break;case"defaultValue":I=P;break;case"multiple":g=P;default:Ft(i,r,S,P,u,null)}r=k,u=I,i.multiple=!!g,r!=null?Xt(i,!!g,r,!1):u!=null&&Xt(i,!!g,u,!0);return;case"textarea":ft("invalid",i),k=S=g=null;for(I in u)if(u.hasOwnProperty(I)&&(P=u[I],P!=null))switch(I){case"value":g=P;break;case"defaultValue":S=P;break;case"children":k=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:Ft(i,r,I,P,u,null)}Dn(i,g,S,k);return;case"option":for($ in u)u.hasOwnProperty($)&&(g=u[$],g!=null)&&($==="selected"?i.selected=g&&typeof g!="function"&&typeof g!="symbol":Ft(i,r,$,g,u,null));return;case"dialog":ft("beforetoggle",i),ft("toggle",i),ft("cancel",i),ft("close",i);break;case"iframe":case"object":ft("load",i);break;case"video":case"audio":for(g=0;g<cc.length;g++)ft(cc[g],i);break;case"image":ft("error",i),ft("load",i);break;case"details":ft("toggle",i);break;case"embed":case"source":case"link":ft("error",i),ft("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 u)if(u.hasOwnProperty(ie)&&(g=u[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Ft(i,r,ie,g,u,null)}return;default:if(rt(r)){for(me in u)u.hasOwnProperty(me)&&(g=u[me],g!==void 0&&Ph(i,r,me,g,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(g=u[P],g!=null&&Ft(i,r,P,g,u,null))}function Qj(i,r,u,g){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,k=null,I=null,P=null,$=null,ie=null,me=null;for(ce in u){var Se=u[ce];if(u.hasOwnProperty(ce)&&Se!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":$=Se;default:g.hasOwnProperty(ce)||Ft(i,r,ce,null,g,Se)}}for(var oe in g){var ce=g[oe];if(Se=u[oe],g.hasOwnProperty(oe)&&(ce!=null||Se!=null))switch(oe){case"type":k=ce;break;case"name":S=ce;break;case"checked":ie=ce;break;case"defaultChecked":me=ce;break;case"value":I=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,r));break;default:ce!==Se&&Ft(i,r,oe,ce,g,Se)}}an(i,I,P,$,ie,me,k,S);return;case"select":ce=I=P=oe=null;for(k in u)if($=u[k],u.hasOwnProperty(k)&&$!=null)switch(k){case"value":break;case"multiple":ce=$;default:g.hasOwnProperty(k)||Ft(i,r,k,null,g,$)}for(S in g)if(k=g[S],$=u[S],g.hasOwnProperty(S)&&(k!=null||$!=null))switch(S){case"value":oe=k;break;case"defaultValue":P=k;break;case"multiple":I=k;default:k!==$&&Ft(i,r,S,k,g,$)}r=P,u=I,g=ce,oe!=null?Xt(i,!!u,oe,!1):!!g!=!!u&&(r!=null?Xt(i,!!u,r,!0):Xt(i,!!u,u?[]:"",!1));return;case"textarea":ce=oe=null;for(P in u)if(S=u[P],u.hasOwnProperty(P)&&S!=null&&!g.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Ft(i,r,P,null,g,S)}for(I in g)if(S=g[I],k=u[I],g.hasOwnProperty(I)&&(S!=null||k!=null))switch(I){case"value":oe=S;break;case"defaultValue":ce=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==k&&Ft(i,r,I,S,g,k)}sn(i,oe,ce);return;case"option":for(var ze in u)oe=u[ze],u.hasOwnProperty(ze)&&oe!=null&&!g.hasOwnProperty(ze)&&(ze==="selected"?i.selected=!1:Ft(i,r,ze,null,g,oe));for($ in g)oe=g[$],ce=u[$],g.hasOwnProperty($)&&oe!==ce&&(oe!=null||ce!=null)&&($==="selected"?i.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":Ft(i,r,$,oe,g,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ke in u)oe=u[Ke],u.hasOwnProperty(Ke)&&oe!=null&&!g.hasOwnProperty(Ke)&&Ft(i,r,Ke,null,g,oe);for(ie in g)if(oe=g[ie],ce=u[ie],g.hasOwnProperty(ie)&&oe!==ce&&(oe!=null||ce!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,r));break;default:Ft(i,r,ie,oe,g,ce)}return;default:if(rt(r)){for(var Ut in u)oe=u[Ut],u.hasOwnProperty(Ut)&&oe!==void 0&&!g.hasOwnProperty(Ut)&&Ph(i,r,Ut,void 0,g,oe);for(me in g)oe=g[me],ce=u[me],!g.hasOwnProperty(me)||oe===ce||oe===void 0&&ce===void 0||Ph(i,r,me,oe,g,ce);return}}for(var W in u)oe=u[W],u.hasOwnProperty(W)&&oe!=null&&!g.hasOwnProperty(W)&&Ft(i,r,W,null,g,oe);for(Se in g)oe=g[Se],ce=u[Se],!g.hasOwnProperty(Se)||oe===ce||oe==null&&ce==null||Ft(i,r,Se,oe,g,ce)}function Xx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Vj(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,u=performance.getEntriesByType("resource"),g=0;g<u.length;g++){var S=u[g],k=S.transferSize,I=S.initiatorType,P=S.duration;if(k&&P&&Xx(I)){for(I=0,P=S.responseEnd,g+=1;g<u.length;g++){var $=u[g],ie=$.startTime;if(ie>P)break;var me=$.transferSize,Se=$.initiatorType;me&&Xx(Se)&&($=$.responseEnd,I+=me*($<P?1:(P-ie)/($-ie)))}if(--g,r+=8*(k+I)/(S.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Dh=null,zh=null;function Td(i){return i.nodeType===9?i:i.ownerDocument}function Jx(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 ek(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 Lh(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 qh=null;function Gj(){var i=window.event;return i&&i.type==="popstate"?i===qh?!1:(qh=i,!0):(qh=null,!1)}var tk=typeof setTimeout=="function"?setTimeout:void 0,Zj=typeof clearTimeout=="function"?clearTimeout:void 0,nk=typeof Promise=="function"?Promise:void 0,Kj=typeof queueMicrotask=="function"?queueMicrotask:typeof nk<"u"?function(i){return nk.resolve(null).then(i).catch(Wj)}:tk;function Wj(i){setTimeout(function(){throw i})}function Or(i){return i==="head"}function ak(i,r){var u=r,g=0;do{var S=u.nextSibling;if(i.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"||u==="/&"){if(g===0){i.removeChild(S),js(r);return}g--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")g++;else if(u==="html")dc(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,dc(u);for(var k=u.firstChild;k;){var I=k.nextSibling,P=k.nodeName;k[fr]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&k.rel.toLowerCase()==="stylesheet"||u.removeChild(k),k=I}}else u==="body"&&dc(i.ownerDocument.body);u=S}while(u);js(r)}function ik(i,r){var u=i;i=0;do{var g=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=g}while(u)}function Bh(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Bh(u),ns(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function Yj(i,r,u,g){for(;i.nodeType===1;){var S=u;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[fr])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(k=i.getAttribute("rel"),k==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(k!==S.rel||i.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||i.getAttribute("title")!==(S.title==null?null:S.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(S.src==null?null:S.src)||i.getAttribute("type")!==(S.type==null?null:S.type)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var k=S.name==null?null:""+S.name;if(S.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=Ba(i.nextSibling),i===null)break}return null}function Xj(i,r,u){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ba(i.nextSibling),i===null))return null;return i}function rk(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Ba(i.nextSibling),i===null))return null;return i}function Fh(i){return i.data==="$?"||i.data==="$~"}function Uh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Jj(i,r){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||u.readyState!=="loading")r();else{var g=function(){r(),u.removeEventListener("DOMContentLoaded",g)};u.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Ba(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 Hh=null;function ok(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(r===0)return Ba(i.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}i=i.nextSibling}return null}function sk(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return i;r--}else u!=="/$"&&u!=="/&"||r++}i=i.previousSibling}return null}function lk(i,r,u){switch(r=Td(u),i){case"html":if(i=r.documentElement,!i)throw Error(a(452));return i;case"head":if(i=r.head,!i)throw Error(a(453));return i;case"body":if(i=r.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function dc(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);ns(i)}var Fa=new Map,ck=new Set;function _d(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Yi=ue.d;ue.d={f:eP,r:tP,D:nP,C:aP,L:iP,m:rP,X:sP,S:oP,M:lP};function eP(){var i=Yi.f(),r=kd();return i||r}function tP(i){var r=_i(i);r!==null&&r.tag===5&&r.type==="form"?AS(r):Yi.r(i)}var _s=typeof document>"u"?null:document;function uk(i,r,u){var g=_s;if(g&&typeof r=="string"&&r){var S=et(r);S='link[rel="'+i+'"][href="'+S+'"]',typeof u=="string"&&(S+='[crossorigin="'+u+'"]'),ck.has(S)||(ck.add(S),i={rel:i,crossOrigin:u,href:r},g.querySelector(S)===null&&(r=g.createElement("link"),Bn(r,"link",i),bn(r),g.head.appendChild(r)))}}function nP(i){Yi.D(i),uk("dns-prefetch",i,null)}function aP(i,r){Yi.C(i,r),uk("preconnect",i,r)}function iP(i,r,u){Yi.L(i,r,u);var g=_s;if(g&&i&&r){var S='link[rel="preload"][as="'+et(r)+'"]';r==="image"&&u&&u.imageSrcSet?(S+='[imagesrcset="'+et(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(S+='[imagesizes="'+et(u.imageSizes)+'"]')):S+='[href="'+et(i)+'"]';var k=S;switch(r){case"style":k=Ns(i);break;case"script":k=Os(i)}Fa.has(k)||(i=M({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:i,as:r},u),Fa.set(k,i),g.querySelector(S)!==null||r==="style"&&g.querySelector(pc(k))||r==="script"&&g.querySelector(mc(k))||(r=g.createElement("link"),Bn(r,"link",i),bn(r),g.head.appendChild(r)))}}function rP(i,r){Yi.m(i,r);var u=_s;if(u&&i){var g=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+et(g)+'"][href="'+et(i)+'"]',k=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Os(i)}if(!Fa.has(k)&&(i=M({rel:"modulepreload",href:i},r),Fa.set(k,i),u.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(mc(k)))return}g=u.createElement("link"),Bn(g,"link",i),bn(g),u.head.appendChild(g)}}}function oP(i,r,u){Yi.S(i,r,u);var g=_s;if(g&&i){var S=hr(g).hoistableStyles,k=Ns(i);r=r||"default";var I=S.get(k);if(!I){var P={loading:0,preload:null};if(I=g.querySelector(pc(k)))P.loading=5;else{i=M({rel:"stylesheet",href:i,"data-precedence":r},u),(u=Fa.get(k))&&$h(i,u);var $=I=g.createElement("link");bn($),Bn($,"link",i),$._p=new Promise(function(ie,me){$.onload=ie,$.onerror=me}),$.addEventListener("load",function(){P.loading|=1}),$.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Nd(I,r,g)}I={type:"stylesheet",instance:I,count:1,state:P},S.set(k,I)}}}function sP(i,r){Yi.X(i,r);var u=_s;if(u&&i){var g=hr(u).hoistableScripts,S=Os(i),k=g.get(S);k||(k=u.querySelector(mc(S)),k||(i=M({src:i,async:!0},r),(r=Fa.get(S))&&Qh(i,r),k=u.createElement("script"),bn(k),Bn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function lP(i,r){Yi.M(i,r);var u=_s;if(u&&i){var g=hr(u).hoistableScripts,S=Os(i),k=g.get(S);k||(k=u.querySelector(mc(S)),k||(i=M({src:i,async:!0,type:"module"},r),(r=Fa.get(S))&&Qh(i,r),k=u.createElement("script"),bn(k),Bn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function dk(i,r,u,g){var S=(S=he.current)?_d(S):null;if(!S)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=Ns(u.href),u=hr(S).hoistableStyles,g=u.get(r),g||(g={type:"style",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Ns(u.href);var k=hr(S).hoistableStyles,I=k.get(i);if(I||(S=S.ownerDocument||S,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,I),(k=S.querySelector(pc(i)))&&!k._p&&(I.instance=k,I.state.loading=5),Fa.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Fa.set(i,u),k||cP(S,i,u,I.state))),r&&g===null)throw Error(a(528,""));return I}if(r&&g!==null)throw Error(a(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Os(u),u=hr(S).hoistableScripts,g=u.get(r),g||(g={type:"script",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function Ns(i){return'href="'+et(i)+'"'}function pc(i){return'link[rel="stylesheet"]['+i+"]"}function pk(i){return M({},i,{"data-precedence":i.precedence,precedence:null})}function cP(i,r,u,g){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?g.loading=1:(r=i.createElement("link"),g.preload=r,r.addEventListener("load",function(){return g.loading|=1}),r.addEventListener("error",function(){return g.loading|=2}),Bn(r,"link",u),bn(r),i.head.appendChild(r))}function Os(i){return'[src="'+et(i)+'"]'}function mc(i){return"script[async]"+i}function mk(i,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var g=i.querySelector('style[data-href~="'+et(u.href)+'"]');if(g)return r.instance=g,bn(g),g;var S=M({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),bn(g),Bn(g,"style",S),Nd(g,u.precedence,i),r.instance=g;case"stylesheet":S=Ns(u.href);var k=i.querySelector(pc(S));if(k)return r.state.loading|=4,r.instance=k,bn(k),k;g=pk(u),(S=Fa.get(S))&&$h(g,S),k=(i.ownerDocument||i).createElement("link"),bn(k);var I=k;return I._p=new Promise(function(P,$){I.onload=P,I.onerror=$}),Bn(k,"link",g),r.state.loading|=4,Nd(k,u.precedence,i),r.instance=k;case"script":return k=Os(u.src),(S=i.querySelector(mc(k)))?(r.instance=S,bn(S),S):(g=u,(S=Fa.get(k))&&(g=M({},u),Qh(g,S)),i=i.ownerDocument||i,S=i.createElement("script"),bn(S),Bn(S,"link",g),i.head.appendChild(S),r.instance=S);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(g=r.instance,r.state.loading|=4,Nd(g,u.precedence,i));return r.instance}function Nd(i,r,u){for(var g=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,k=S,I=0;I<g.length;I++){var P=g[I];if(P.dataset.precedence===r)k=P;else if(k!==S)break}k?k.parentNode.insertBefore(i,k.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(i,r.firstChild))}function $h(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Qh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Od=null;function fk(i,r,u){if(Od===null){var g=new Map,S=Od=new Map;S.set(u,g)}else S=Od,g=S.get(u),g||(g=new Map,S.set(u,g));if(g.has(i))return g;for(g.set(i,null),u=u.getElementsByTagName(i),S=0;S<u.length;S++){var k=u[S];if(!(k[fr]||k[yn]||i==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var I=k.getAttribute(r)||"";I=i+I;var P=g.get(I);P?P.push(k):g.set(I,[k])}}return g}function hk(i,r,u){i=i.ownerDocument||i,i.head.insertBefore(u,r==="title"?i.querySelector("head > title"):null)}function uP(i,r,u){if(u===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(i=r.disabled,typeof r.precedence=="string"&&i==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function gk(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function dP(i,r,u,g){if(u.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var S=Ns(g.href),k=r.querySelector(pc(S));if(k){r=k._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=jd.bind(i),r.then(i,i)),u.state.loading|=4,u.instance=k,bn(k);return}k=r.ownerDocument||r,g=pk(g),(S=Fa.get(S))&&$h(g,S),k=k.createElement("link"),bn(k);var I=k;I._p=new Promise(function(P,$){I.onload=P,I.onerror=$}),Bn(k,"link",g),u.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=jd.bind(i),r.addEventListener("load",u),r.addEventListener("error",u))}}var Vh=0;function pP(i,r){return i.stylesheets&&i.count===0&&Dd(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var g=setTimeout(function(){if(i.stylesheets&&Dd(i,i.stylesheets),i.unsuspend){var k=i.unsuspend;i.unsuspend=null,k()}},6e4+r);0<i.imgBytes&&Vh===0&&(Vh=62500*Vj());var S=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Dd(i,i.stylesheets),i.unsuspend)){var k=i.unsuspend;i.unsuspend=null,k()}},(i.imgBytes>Vh?50:800)+r);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dd(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Pd=null;function Dd(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Pd=new Map,r.forEach(mP,i),Pd=null,jd.call(i))}function mP(i,r){if(!(r.state.loading&4)){var u=Pd.get(i);if(u)var g=u.get(null);else{u=new Map,Pd.set(i,u);for(var S=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<S.length;k++){var I=S[k];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(u.set(I.dataset.precedence,I),g=I)}g&&u.set(null,g)}S=r.instance,I=S.getAttribute("data-precedence"),k=u.get(I)||g,k===g&&u.set(null,S),u.set(I,S),this.count++,g=jd.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),k?k.parentNode.insertBefore(S,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(S,i.firstChild)),r.state.loading|=4}}var fc={$$typeof:F,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function fP(i,r,u,g,S,k,I,P,$){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=Ml(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ml(0),this.hiddenUpdates=Ml(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=k,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function vk(i,r,u,g,S,k,I,P,$,ie,me,Se){return i=new fP(i,r,u,I,$,ie,me,Se,P),r=1,k===!0&&(r|=24),k=ba(3,null,null,r),i.current=k,k.stateNode=i,r=Cf(),r.refCount++,i.pooledCache=r,r.refCount++,k.memoizedState={element:g,isDehydrated:u,cache:r},If(k),i}function yk(i){return i?(i=us,i):us}function bk(i,r,u,g,S,k){S=yk(S),g.context===null?g.context=S:g.pendingContext=S,g=kr(r),g.payload={element:u},k=k===void 0?null:k,k!==null&&(g.callback=k),u=wr(i,g,r),u!==null&&(ua(u,i,r),Vl(u,i,r))}function Sk(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<r?u:r}}function Gh(i,r){Sk(i,r),(i=i.alternate)&&Sk(i,r)}function xk(i){if(i.tag===13||i.tag===31){var r=uo(i,67108864);r!==null&&ua(r,i,67108864),Gh(i,67108864)}}function kk(i){if(i.tag===13||i.tag===31){var r=Ma();r=Na(r);var u=uo(i,r);u!==null&&ua(u,i,r),Gh(i,r)}}var zd=!0;function hP(i,r,u,g){var S=B.T;B.T=null;var k=ue.p;try{ue.p=2,Zh(i,r,u,g)}finally{ue.p=k,B.T=S}}function gP(i,r,u,g){var S=B.T;B.T=null;var k=ue.p;try{ue.p=8,Zh(i,r,u,g)}finally{ue.p=k,B.T=S}}function Zh(i,r,u,g){if(zd){var S=Kh(g);if(S===null)jh(i,r,g,Ld,u),Mk(i,g);else if(yP(S,i,r,u,g))g.stopPropagation();else if(Mk(i,g),r&4&&-1<vP.indexOf(i)){for(;S!==null;){var k=_i(S);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var I=st(k.pendingLanes);if(I!==0){var P=k;for(P.pendingLanes|=2,P.entangledLanes|=2;I;){var $=1<<31-In(I);P.entanglements[1]|=$,I&=~$}gi(k),(_t&6)===0&&(Sd=pn()+500,lc(0))}}break;case 31:case 13:P=uo(k,2),P!==null&&ua(P,k,2),kd(),Gh(k,2)}if(k=Kh(g),k===null&&jh(i,r,g,Ld,u),k===S)break;S=k}S!==null&&g.stopPropagation()}else jh(i,r,g,null,u)}}function Kh(i){return i=Kn(i),Wh(i)}var Ld=null;function Wh(i){if(Ld=null,i=Ti(i),i!==null){var r=p(i);if(r===null)i=null;else{var u=r.tag;if(u===13){if(i=f(r),i!==null)return i;i=null}else if(u===31){if(i=m(r),i!==null)return i;i=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Ld=i,null}function wk(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(Vn()){case aa:return 2;case pr:return 8;case ia:case ga:return 32;case it:return 268435456;default:return 32}default:return 32}}var Yh=!1,jr=null,Pr=null,Dr=null,hc=new Map,gc=new Map,zr=[],vP="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 Mk(i,r){switch(i){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Pr=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":hc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(r.pointerId)}}function vc(i,r,u,g,S,k){return i===null||i.nativeEvent!==k?(i={blockedOn:r,domEventName:u,eventSystemFlags:g,nativeEvent:k,targetContainers:[S]},r!==null&&(r=_i(r),r!==null&&xk(r)),i):(i.eventSystemFlags|=g,r=i.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),i)}function yP(i,r,u,g,S){switch(r){case"focusin":return jr=vc(jr,i,r,u,g,S),!0;case"dragenter":return Pr=vc(Pr,i,r,u,g,S),!0;case"mouseover":return Dr=vc(Dr,i,r,u,g,S),!0;case"pointerover":var k=S.pointerId;return hc.set(k,vc(hc.get(k)||null,i,r,u,g,S)),!0;case"gotpointercapture":return k=S.pointerId,gc.set(k,vc(gc.get(k)||null,i,r,u,g,S)),!0}return!1}function Ck(i){var r=Ti(i.target);if(r!==null){var u=p(r);if(u!==null){if(r=u.tag,r===13){if(r=f(u),r!==null){i.blockedOn=r,Rl(i.priority,function(){kk(u)});return}}else if(r===31){if(r=m(u),r!==null){i.blockedOn=r,Rl(i.priority,function(){kk(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function qd(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var u=Kh(i.nativeEvent);if(u===null){u=i.nativeEvent;var g=new u.constructor(u.type,u);xt=g,u.target.dispatchEvent(g),xt=null}else return r=_i(u),r!==null&&xk(r),i.blockedOn=u,!1;r.shift()}return!0}function Ak(i,r,u){qd(i)&&u.delete(r)}function bP(){Yh=!1,jr!==null&&qd(jr)&&(jr=null),Pr!==null&&qd(Pr)&&(Pr=null),Dr!==null&&qd(Dr)&&(Dr=null),hc.forEach(Ak),gc.forEach(Ak)}function Bd(i,r){i.blockedOn===r&&(i.blockedOn=null,Yh||(Yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bP)))}var Fd=null;function Ek(i){Fd!==i&&(Fd=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fd===i&&(Fd=null);for(var r=0;r<i.length;r+=3){var u=i[r],g=i[r+1],S=i[r+2];if(typeof g!="function"){if(Wh(g||u)===null)continue;break}var k=_i(u);k!==null&&(i.splice(r,3),r-=3,Kf(k,{pending:!0,data:S,method:u.method,action:g},g,S))}}))}function js(i){function r($){return Bd($,i)}jr!==null&&Bd(jr,i),Pr!==null&&Bd(Pr,i),Dr!==null&&Bd(Dr,i),hc.forEach(r),gc.forEach(r);for(var u=0;u<zr.length;u++){var g=zr[u];g.blockedOn===i&&(g.blockedOn=null)}for(;0<zr.length&&(u=zr[0],u.blockedOn===null);)Ck(u),u.blockedOn===null&&zr.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(g=0;g<u.length;g+=3){var S=u[g],k=u[g+1],I=S[Pn]||null;if(typeof k=="function")I||Ek(u);else if(I){var P=null;if(k&&k.hasAttribute("formAction")){if(S=k,I=k[Pn]||null)P=I.formAction;else if(Wh(S)!==null)continue}else P=I.action;typeof P=="function"?u[g+1]=P:(u.splice(g,3),g-=3),Ek(u)}}}function Rk(){function i(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(I){return S=I})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),g||setTimeout(u,20)}function u(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function Xh(i){this._internalRoot=i}Ud.prototype.render=Xh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var u=r.current,g=Ma();bk(u,g,i,r,null,null)},Ud.prototype.unmount=Xh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;bk(i.current,2,null,i,null,null),kd(),r[mr]=null}};function Ud(i){this._internalRoot=i}Ud.prototype.unstable_scheduleHydration=function(i){if(i){var r=El();i={blockedOn:null,target:i,priority:r};for(var u=0;u<zr.length&&r!==0&&r<zr[u].priority;u++);zr.splice(u,0,i),u===0&&Ck(i)}};var Ik=t.version;if(Ik!=="19.2.3")throw Error(a(527,Ik,"19.2.3"));ue.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=c(r),i=i!==null?x(i):null,i=i===null?null:i.stateNode,i};var SP={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hd.isDisabled&&Hd.supportsFiber)try{Gn=Hd.inject(SP),Rn=Hd}catch{}}return bc.createRoot=function(i,r){if(!s(i))throw Error(a(299));var u=!1,g="",S=DS,k=zS,I=LS;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError)),r=vk(i,1,!1,null,null,u,g,null,S,k,I,Rk),i[mr]=r.current,Oh(i),new Xh(r)},bc.hydrateRoot=function(i,r,u){if(!s(i))throw Error(a(299));var g=!1,S="",k=DS,I=zS,P=LS,$=null;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onUncaughtError!==void 0&&(k=u.onUncaughtError),u.onCaughtError!==void 0&&(I=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&($=u.formState)),r=vk(i,1,!0,r,u??null,g,S,$,k,I,P,Rk),r.context=yk(null),u=r.current,g=Ma(),g=Na(g),S=kr(g),S.callback=null,wr(u,S,g),u=g,r.current.lanes=u,Ri(r,u),gi(r),i[mr]=r.current,Oh(i),new Ud(r)},bc.version="19.2.3",bc}var qk;function _P(){if(qk)return eg.exports;qk=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(),eg.exports=TP(),eg.exports}var NP=_P(),OP=Object.create,uE=Object.defineProperty,jP=Object.getOwnPropertyDescriptor,dE=Object.getOwnPropertyNames,PP=Object.getPrototypeOf,DP=Object.prototype.hasOwnProperty,Ci=(e,t)=>function(){return t||(0,e[dE(e)[0]])((t={exports:{}}).exports,t),t.exports},zP=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=dE(t),p=0,f=s.length,m;p<f;p++)m=s[p],!DP.call(e,m)&&m!==n&&uE(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=jP(t,m))||a.enumerable});return e},vn=(e,t,n)=>(n=e!=null?OP(PP(e)):{},zP(t||!e||!e.__esModule?uE(n,"default",{value:e,enumerable:!0}):n,e)),pE=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),LP=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=pE().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}}),qP=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=pE().default,a=LP();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}}),Ho=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=qP();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}}),oi=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Ho();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function Sl(e){const t={subscribe(n){let a=null,s=!1,p=!1,f=!1;function m(){if(a===null){f=!0;return}p||(p=!0,typeof a=="function"?a():a&&a.unsubscribe())}return a=e({next(h){var c;s||(c=n.next)===null||c===void 0||c.call(n,h)},error(h){var c;s||(s=!0,(c=n.error)===null||c===void 0||c.call(n,h),m())},complete(){var h;s||(s=!0,(h=n.complete)===null||h===void 0||h.call(n),m())}}),f&&m(),{unsubscribe:m}},pipe(...n){return n.reduce(BP,t)}};return t}function BP(e,t){return t(e)}function FP(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 UP(e){return t=>{let n=0,a=null;const s=[];function p(){a||(a=t.subscribe({next(m){for(const c of s){var h;(h=c.next)===null||h===void 0||h.call(c,m)}},error(m){for(const c of s){var h;(h=c.error)===null||h===void 0||h.call(c,m)}},complete(){for(const h of s){var m;(m=h.complete)===null||m===void 0||m.call(h)}}}))}function f(){if(n===0&&a){const m=a;a=null,m.unsubscribe()}}return Sl(m=>(n++,s.push(m),p(),{unsubscribe(){n--,f();const h=s.findIndex(c=>c===m);h>-1&&s.splice(h,1)}}))}}function mE(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=Sl(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 HP(e){return Sl(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 Fo(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function $P(){return Object.create(null)}const QP=typeof Symbol=="function"&&!!Symbol.asyncIterator;function fE(e){return QP&&Fo(e)&&Symbol.asyncIterator in e}const Bk=e=>e();function Fk(e=0){return new Promise(t=>setTimeout(t,e))}var VP=Object.create,hE=Object.defineProperty,GP=Object.getOwnPropertyDescriptor,gE=Object.getOwnPropertyNames,ZP=Object.getPrototypeOf,KP=Object.prototype.hasOwnProperty,fu=(e,t)=>function(){return t||(0,e[gE(e)[0]])((t={exports:{}}).exports,t),t.exports},WP=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=gE(t),p=0,f=s.length,m;p<f;p++)m=s[p],!KP.call(e,m)&&m!==n&&hE(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=GP(t,m))||a.enumerable});return e},Cm=(e,t,n)=>(n=e!=null?VP(ZP(e)):{},WP(hE(n,"default",{value:e,enumerable:!0}),e));const vE=()=>{},Uk=e=>{Object.freeze&&Object.freeze(e)};function yE(e,t,n){var a;const s=t.join(".");return(a=n[s])!==null&&a!==void 0||(n[s]=new Proxy(vE,{get(p,f){if(!(typeof f!="string"||f==="then"))return yE(e,[...t,f],n)},apply(p,f,m){const h=t[t.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let c={args:m,path:t};return h==="call"?c={args:m.length>=2?[m[1]]:[],path:t.slice(0,-1)}:h==="apply"&&(c={args:m.length>=2?m[1]:[],path:t.slice(0,-1)}),Uk(c.args),Uk(c.path),e(c)}})),n[s]}const Am=e=>yE(e,[],$P()),bb=e=>new Proxy(vE,{get(t,n){if(n!=="then")return e(n)}});var bE=fu({"../../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}}),YP=fu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=bE().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}}),XP=fu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=bE().default,a=YP();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}}),SE=fu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=XP();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}}),Sb=fu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=SE();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});Cm(Sb());Cm(SE());var $d=Cm(Sb());function JP(e,t){if("error"in e){const a=t.deserialize(e.error);return{ok:!1,error:(0,$d.default)((0,$d.default)({},e),{},{error:a})}}return{ok:!0,result:(0,$d.default)((0,$d.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var rg=class extends Error{constructor(){super("Unable to transform response from server")}};function xE(e,t){let n;try{n=JP(e,t)}catch{throw new rg}if(!n.ok&&(!Fo(n.error.error)||typeof n.error.error.code!="number"))throw new rg;if(n.ok&&!Fo(n.result))throw new rg;return n}Cm(Sb());var Qd=vn(Ho(),1),Ps=vn(oi(),1);function e3(e){return e instanceof nr}function t3(e){return Fo(e)&&Fo(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function n3(e,t){return typeof e=="string"?e:Fo(e)&&typeof e.message=="string"?e.message:t}var nr=class vp extends Error{constructor(t,n){var a,s;const p=n?.cause;super(t,{cause:p}),(0,Qd.default)(this,"cause",void 0),(0,Qd.default)(this,"shape",void 0),(0,Qd.default)(this,"data",void 0),(0,Qd.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,vp.prototype)}static from(t,n={}){const a=t;return e3(a)?(n.meta&&(a.meta=(0,Ps.default)((0,Ps.default)({},a.meta),n.meta)),a):t3(a)?new vp(a.error.message,(0,Ps.default)((0,Ps.default)({},n),{},{result:a,cause:n.cause})):new vp(n3(a,"Unknown error"),(0,Ps.default)((0,Ps.default)({},n),{},{cause:a}))}};function kE(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 Hk=e=>typeof e=="function";function a3(e){if(e)return e;if(typeof window<"u"&&Hk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Hk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Bc=vn(oi());function i3(e){return{url:e.url.toString(),fetch:e.fetch,transformer:kE(e.transformer),methodOverride:e.methodOverride}}function r3(e){const t={};for(let n=0;n<e.length;n++){const a=e[n];t[n]=a}return t}const o3={query:"GET",mutation:"POST",subscription:"PATCH"};function wE(e){return"input"in e?e.transformer.input.serialize(e.input):r3(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Pv=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=wE(e);p!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(p))}`)}return s.length&&(a+="?"+s.join("&")),a},s3=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=wE(e);return t!==void 0?JSON.stringify(t):void 0},l3=e=>Dv((0,Bc.default)((0,Bc.default)({},e),{},{contentTypeHeader:"application/json",getUrl:Pv,getBody:s3}));var c3=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const u3=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 c3};async function d3(e){var t,n;u3(e.signal);const a=e.getUrl(e),s=e.getBody(e),p=(t=e.methodOverride)!==null&&t!==void 0?t:o3[e.type],f=await(async()=>{const h=await e.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),m=(0,Bc.default)((0,Bc.default)((0,Bc.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 a3(e.fetch)(a,{method:p,signal:e.signal,body:s,headers:m})}async function Dv(e){const t={},n=await d3(e);t.response=n;const a=await n.json();return t.responseJSON=a,{json:a,meta:t}}function p3(e){return e instanceof Uint8Array||e instanceof Blob}function m3(e){return e instanceof FormData}var Zs=vn(oi(),1);const f3=e=>{if("input"in e){const{input:t}=e;if(m3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return Dv((0,Zs.default)((0,Zs.default)({},e),{},{contentTypeHeader:void 0,getUrl:Pv,getBody:()=>t}))}if(p3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return Dv((0,Zs.default)((0,Zs.default)({},e),{},{contentTypeHeader:"application/octet-stream",getUrl:Pv,getBody:()=>t}))}}return l3(e)};function h3(e){const t=i3(e);return()=>n=>{const{op:a}=n;return Sl(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=f3((0,Zs.default)((0,Zs.default)({},t),{},{type:m,path:p,input:f,signal:a.signal,headers(){return e.headers?typeof e.headers=="function"?e.headers({op:a}):e.headers:{}}}));let c;return h.then(x=>{c=x.meta;const M=xE(x.json,t.transformer.output);if(!M.ok){s.error(nr.from(M.error,{meta:c}));return}s.next({context:x.meta,result:M.result}),s.complete()}).catch(x=>{s.error(nr.from(x,{meta:c}))}),()=>{}})}}vn(oi(),1);vn(oi(),1);const g3={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)}},v3={enabled:!1,closeMs:0},y3={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},b3=e=>e===0?0:Math.min(1e3*2**e,3e4),ME=(e,...t)=>typeof e=="function"?e(...t):e;var S3=vn(Ho(),1),Ds=class CE extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,CE.prototype)}},x3=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,S3.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 AE(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}async function k3(e){const t=await ME(e.url);if(!e.connectionParams)return t;const a=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+a}async function w3(e,t){const n={method:"connectionParams",data:await ME(e)};return t.encode(n)}var $k=vn(Ho(),1),M3=class{constructor(){(0,$k.default)(this,"outgoingRequests",new Array),(0,$k.default)(this,"pendingRequests",{})}register(e,t){const{promise:n,resolve:a}=AE();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}},Fr=vn(Ho(),1);function C3(e){const{promise:t,resolve:n,reject:a}=AE();return e.addEventListener("open",()=>{e.removeEventListener("error",a),n()}),e.addEventListener("error",a),t}function A3(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 EE=class zv{constructor(t){var n;if((0,Fr.default)(this,"id",++zv.connectCount),(0,Fr.default)(this,"WebSocketPonyfill",void 0),(0,Fr.default)(this,"urlOptions",void 0),(0,Fr.default)(this,"keepAliveOpts",void 0),(0,Fr.default)(this,"encoder",void 0),(0,Fr.default)(this,"wsObservable",mE(null)),(0,Fr.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=++zv.connectCount;const n=k3(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&&A3(a,t.keepAliveOpts),a.addEventListener("close",()=>{t.ws===a&&(t.ws=null)}),await C3(a),t.urlOptions.connectionParams&&a.send(await w3(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,Fr.default)(EE,"connectCount",0);function E3(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 vi=vn(Ho(),1),zs=vn(oi(),1),R3=class{constructor(e){var t,n;(0,vi.default)(this,"connectionState",void 0),(0,vi.default)(this,"allowReconnect",!1),(0,vi.default)(this,"requestManager",new M3),(0,vi.default)(this,"activeConnection",void 0),(0,vi.default)(this,"reconnectRetryDelay",void 0),(0,vi.default)(this,"inactivityTimeout",void 0),(0,vi.default)(this,"callbacks",void 0),(0,vi.default)(this,"lazyMode",void 0),(0,vi.default)(this,"encoder",void 0),(0,vi.default)(this,"reconnecting",null),this.encoder=(t=e.experimental_encoder)!==null&&t!==void 0?t:g3,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const a=(0,zs.default)((0,zs.default)({},v3),e.lazy);this.inactivityTimeout=new x3(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},a.closeMs),this.activeConnection=new EE({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,zs.default)((0,zs.default)({},y3),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:b3,this.lazyMode=a.enabled,this.connectionState=mE({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 Ds({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(nr.from(new Ds({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 Sl(m=>{const h=this.batchSend({id:e,method:t,params:{input:p.input.serialize(a),path:n,lastEventId:f}},(0,zs.default)((0,zs.default)({},m),{},{next(c){const x=xE(c,p.output);if(!x.ok){m.error(nr.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 E3(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:"state",state:"connecting",error:nr.from(e)}),this.reconnecting)return;const n=async a=>{try{await Fk(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(nr.from(a??new Ds({message:"WebSocket closed",cause:a}))),this.requestManager.delete(p.id))};e.addEventListener("open",()=>{Bk(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 Ds({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 Ds({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 Ds({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(),Bk(async()=>{n.activeConnection.isOpen()||await n.open(),await Fk(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:a})=>a))}).catch(a=>{this.requestManager.delete(e.id),t.error(nr.from(a))}),this.requestManager.register(e,t)}};function I3(e){return new R3(e)}function T3(e){const{client:t}=e,n=kE(e.transformer);return()=>({op:a})=>Sl(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 og=vn(Ho(),1),Qk=vn(oi(),1),Em=class{constructor(e){(0,og.default)(this,"links",void 0),(0,og.default)(this,"runtime",void 0),(0,og.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return HP({links:this.links,op:(0,Qk.default)((0,Qk.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(UP())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await FP(n)).result.data}catch(n){throw nr.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 RE=Symbol.for("trpc_untypedClient"),_3={query:"query",mutate:"mutation",subscribe:"subscription"},N3=e=>_3[e];function IE(e){const t=Am(({path:n,args:a})=>{const s=[...n],p=N3(s.pop()),f=s.join(".");return e[p](f,...a)});return bb(n=>n===RE?e:t[n])}function Lv(e){const t=new Em(e);return IE(t)}function xb(e){return e[RE]}vn(oi(),1);vn(oi(),1);var O3=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var 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}});vn(O3(),1);vn(oi(),1);var j3=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var a=typeof SuppressedError=="function"?SuppressedError:function(m,h){var c=Error();return c.name="SuppressedError",c.error=m,c.suppressed=h,c},s={},p=[];function f(m,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(m)var c=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=h[Symbol.dispose||Symbol.for("Symbol.dispose")],m))var x=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");x&&(c=function(){try{x.call(h)}catch(C){return Promise.reject(C)}}),p.push({v:h,d:c,a:m})}else m&&p.push({d:h,a:m});return h}return{e:s,u:f.bind(null,!1),a:f.bind(null,!0),d:function(){var h,c=this.e,x=0;function M(){for(;h=p.pop();)try{if(!h.a&&x===1)return x=0,p.push(h),Promise.resolve().then(M);if(h.d){var E=h.d.call(h.v);if(h.a)return x|=2,Promise.resolve(E).then(M,C)}else x|=1}catch(R){return C(R)}if(x===1)return c!==s?Promise.reject(c):Promise.resolve();if(c!==s)throw c}function C(E){return c=c!==s?new a(E,c):E,M()}return M()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),TE=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(a,s){this.v=a,this.k=s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),P3=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=TE();function a(s){return new n(s,0)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),D3=Ci({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=TE();function a(p){return function(){return new s(p.apply(this,arguments))}}function s(p){var f,m;function h(x,M){try{var C=p[x](M),E=C.value,R=E instanceof n;Promise.resolve(R?E.v:E).then(function(_){if(R){var j=x==="return"?"return":"next";if(!E.k||_.done)return h(j,_);_=p[j](_).value}c(C.done?"return":"normal",_)},function(_){h("throw",_)})}catch(_){c("throw",_)}}function c(x,M){switch(x){case"return":f.resolve({value:M,done:!0});break;case"throw":f.reject(M);break;default:f.resolve({value:M,done:!1})}(f=f.next)?h(f.key,f.arg):m=null}this._invoke=function(x,M){return new Promise(function(C,E){var R={key:x,arg:M,resolve:C,reject:E,next:null};m?m=m.next=R:(f=m=R,h(x,M))})},typeof p.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(p){return this._invoke("next",p)},s.prototype.throw=function(p){return this._invoke("throw",p)},s.prototype.return=function(p){return this._invoke("return",p)},t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});vn(j3(),1);vn(P3(),1);vn(D3(),1);vn(oi(),1);const z3="modulepreload",L3=function(e,t){return new URL(e,t).href},Vk={},ll=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let c=function(x){return Promise.all(x.map(M=>Promise.resolve(M).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};const f=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");s=c(n.map(x=>{if(x=L3(x,a),x in Vk)return;Vk[x]=!0;const M=x.endsWith(".css"),C=M?'[rel="stylesheet"]':"";if(a)for(let R=f.length-1;R>=0;R--){const _=f[R];if(_.href===x&&(!M||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${C}`))return;const E=document.createElement("link");if(E.rel=M?"stylesheet":z3,M||(E.as="script"),E.crossOrigin="",E.href=x,h&&E.setAttribute("nonce",h),document.head.appendChild(E),M)return new Promise((R,_)=>{E.addEventListener("load",R),E.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${x}`)))})}))}function p(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return s.then(f=>{for(const m of f||[])m.status==="rejected"&&p(m.reason);return t().catch(p)})};var We=(function(e){return e.SystemBoot="system.boot",e.SystemAddonsReady="system.addons-ready",e.SystemRestarting="system.restarting",e.SystemRestartCompleted="system.restart-completed",e.SystemTlsCertChanged="system.tls-cert-changed",e.UpdateAvailable="update.available",e.SystemReadyState="system.ready-state",e.AddonStarted="addon.started",e.AddonStopped="addon.stopped",e.AddonRestarted="addon.restarted",e.AddonUpdated="addon.updated",e.AddonInstalled="addon.installed",e.AddonUninstalled="addon.uninstalled",e.AddonCrashed="addon.crashed",e.AddonRunnerFailed="addon.runner-failed",e.AddonError="addon.error",e.AddonPageReady="addon.page-ready",e.AddonWidgetReady="addon.widget-ready",e.AddonLoadFailed="addon.load-failed",e.AddonLoadRecovered="addon.load-recovered",e.AddonRetryScheduled="addon.retry-scheduled",e.SystemLivenessFailed="system.liveness-failed",e.SystemLivenessRecovered="system.liveness-recovered",e.AddonRetryAttempting="addon.retry-attempting",e.DeviceRegistered="device.registered",e.DeviceUnregistered="device.unregistered",e.DeviceEnabled="device.enabled",e.DeviceDisabled="device.disabled",e.DeviceSettingsUpdated="device.settings-updated",e.DeviceBindingsChanged="device.bindings-changed",e.DeviceMetaChanged="device.meta-changed",e.DeviceSourceInfoChanged="device.source-info-changed",e.DeviceStreamsRegistered="device.streams-registered",e.DeviceProvisioned="device.provisioned",e.DeviceReady="device.ready",e.IntegrationEnabled="integration.enabled",e.IntegrationDisabled="integration.disabled",e.IntegrationDeleted="integration.deleted",e.BrokerStatusChanged="broker.status-changed",e.BrokerMessage="broker.message",e.ProviderStarted="provider.started",e.ProviderStopped="provider.stopped",e.ProcessCrashed="process.crashed",e.ProcessRestartScheduled="process.restart_scheduled",e.ProcessRestarted="process.restarted",e.StorageLocationsChanged="storage.locations-changed",e.RecordingStarted="recording.started",e.RecordingStopped="recording.stopped",e.RecordingError="recording.error",e.RecordingHealthDegraded="recording.health.degraded",e.RecordingStorageCritical="recording.storage.critical",e.RecordingSegmentWritten="recording.segment.written",e.RecordingPolicyFallback="recording.policy.fallback",e.RecordingRetentionCompleted="recording.retention.completed",e.RecordingExportProgress="recording.export.progress",e.RecordingExportCompleted="recording.export.completed",e.RecordingExportFailed="recording.export.failed",e.DetectionEvent="detection.event",e.SessionTrackNew="session.track.new",e.SessionTrackExpired="session.track.expired",e.BenchmarkProgress="benchmark.progress",e.PlatformProbePhase="platform-probe.phase",e.PipelineProgress="pipeline.progress",e.PipelineTrace="pipeline.trace",e.PipelineInferenceResult="pipeline.inference-result",e.PipelineCameraAssigned="pipeline.camera-assigned",e.PipelineCameraUnassigned="pipeline.camera-unassigned",e.PipelineNodeInferenceUnavailable="pipeline.node-inference-unavailable",e.PipelineDetectionBlind="pipeline.detection-blind",e.PipelineCameraUpdated="pipeline.camera-updated",e.PipelineIngestOwnerChanged="pipeline.ingest-owner-changed",e.PipelineRunnerLoadSnapshot="pipeline.runner-load-snapshot",e.PipelineCameraMetricsSnapshot="pipeline.camera-metrics-snapshot",e.StreamBrokerMetricsSnapshot="stream-broker.metrics-snapshot",e.StreamBrokerOnCamStreamDemand="stream-broker.onCamStreamDemand",e.StreamBrokerOnCamStreamIdle="stream-broker.onCamStreamIdle",e.StreamBrokerOnRequestStreamSourceRefresh="stream-broker.onRequestStreamSourceRefresh",e.StreamParamsChanged="stream-params.changed",e.DeviceStateChanged="device.state-changed",e.ZoneAnalyticsOccupancyChanged="zone-analytics.occupancy-changed",e.BatteryOnStatusChanged="battery.onStatusChanged",e.NetworkLinkOnStatusChanged="network-link.onStatusChanged",e.BatteryOnWakeStarted="battery.onWakeStarted",e.DoorbellOnPressed="doorbell.onPressed",e.EventEmitted="event-emitter.event",e.PipelineEngineMetricsSnapshot="pipeline.engine-metrics-snapshot",e.PipelineEngineProvisioning="pipeline.engine-provisioning",e.ClusterTopologySnapshot="cluster.topology-snapshot",e.MetricsNodeResourcesSnapshot="metrics.node-resources-snapshot",e.MetricsNodeProcessesSnapshot="metrics.node-processes-snapshot",e.CapabilityBindingChanged="capability.binding-changed",e.ModelDownloadProgress="model.download.progress",e.AgentRegistered="agent.registered",e.AgentUnregistered="agent.unregistered",e.AgentOnline="agent.online",e.AgentOffline="agent.offline",e.WorkerOnline="worker.online",e.WorkerOffline="worker.offline",e.AgentTaskDispatched="agent.task.dispatched",e.AgentTaskAssigned="agent.task.assigned",e.AgentTrpcConnected="agent.trpc.connected",e.AgentWsConnected="agent.ws.connected",e.AgentWsDisconnected="agent.ws.disconnected",e.AgentBackupActivated="agent.backup.activated",e.OrchestrationSettingsUpdated="orchestration.settings-updated",e.PipelineAgentHwaccelChanged="pipeline.agent-hwaccel-changed",e.MotionAnalysis="detection.motion-analysis",e.MotionZonesRaw="detection.motion-zones-raw",e.MotionOnMotionChanged="motion.on-motion-changed",e.DetectionResult="detection.result",e.DetectionRaw="detection.raw",e.DetectionCameraNative="detection.camera-native",e.PipelineAudioInferenceResult="pipeline.audio-inference-result",e.DetectionPhaseTransition="detection.phase-transition",e.ProviderMotion="provider.motion",e.ProviderDetection="provider.detection",e.EnrichmentEmbeddingStored="enrichment.embedding.stored",e.EnrichmentSceneStateChanged="enrichment.scene.state-changed",e.EnrichmentActivitySummary="enrichment.activity.summary",e.PipelineAnalyticsTrackLifecycle="pipeline-analytics.track-lifecycle",e.PipelineAnalyticsTrackStarted="pipeline-analytics.track-started",e.PipelineAnalyticsTrackEnded="pipeline-analytics.track-ended",e.PipelineAnalyticsDetectionEvent="pipeline-analytics.detection-event",e.PipelineAnalyticsFrameTracked="pipeline-analytics.frame-tracked",e.PipelineAnalyticsStationaryChanged="pipeline-analytics.stationary-changed",e.PipelineAnalyticsPackageDelivered="pipeline-analytics.package-delivered",e.PipelineAnalyticsPackagePickedUp="pipeline-analytics.package-picked-up",e.PipelineAnalyticsFaceGalleryChanged="pipeline-analytics.face-gallery-changed",e.PipelineAnalyticsPlateGalleryChanged="pipeline-analytics.plate-gallery-changed",e.CameraStreamsProfileSlotsChanged="camera-streams.onProfileSlotsChanged",e.StreamOnline="stream.online",e.StreamOffline="stream.offline",e.NetworkTunnelStarted="network.tunnel.started",e.NetworkTunnelStopped="network.tunnel.stopped",e.LocalNetworkChanged="network.local.changed",e.MeshNetworkChanged="network.mesh.changed",e.BackupCompleted="backup.completed",e.BackupRunCompleted="backup.run-completed",e.BackupRestored="backup.restored",e.NotificationDispatched="notification.dispatched",e.NotificationFailed="notification.failed",e.DeviceUpdated="device.updated",e.DeviceOnline="device.online",e.DeviceOffline="device.offline",e.DeviceAwake="device.awake",e.DeviceSleeping="device.sleeping",e.RetentionCleanup="retention.cleanup",e.AddonsBulkUpdateProgress="addons.bulk-update-progress",e.AddonsJobProgress="addons.job-progress",e.AddonsJobLog="addons.job-log",e.AccessoriesChildVisibilityChanged="accessories.onChildVisibilityChanged",e.AccessoriesChanged="accessories.onAccessoriesChanged",e.ModelConvertProgress="model-convert.progress",e})({}),Gk;function de(e,t,n){function a(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,h);const c=f.prototype,x=Object.keys(c);for(let M=0;M<x.length;M++){const C=x[M];C in m||(m[C]=c[C].bind(m))}}const s=n?.Parent??Object;class p extends s{}Object.defineProperty(p,"name",{value:e});function f(m){var h;const c=n?.Parent?new p:this;a(c,m),(h=c._zod).deferred??(h.deferred=[]);for(const x of c._zod.deferred)x();return c}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class il extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _E extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Gk=globalThis).__zod_globalConfig??(Gk.__zod_globalConfig={});const kb=globalThis.__zod_globalConfig;function lr(e){return kb}function NE(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 qv(e,t){return typeof t=="bigint"?t.toString():t}function Rm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function wb(e){return e==null}function Mb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function q3(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 Zk=Symbol("evaluating");function Mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Zk)return a===void 0&&(a=Zk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function $o(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xr(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Kk(e){return JSON.stringify(e)}function B3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const OE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const F3=Rm(()=>{if(kb.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function cl(e){if(Wc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Wc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function jE(e){return cl(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 ul(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ur(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 H3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const $3={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 Q3(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=Xr(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 $o(this,"shape",f),f},checks:[]});return ur(e,p)}function V3(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=Xr(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 $o(this,"shape",f),f},checks:[]});return ur(e,p)}function G3(e,t){if(!cl(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=Xr(e._zod.def,{get shape(){const p={...e._zod.def.shape,...t};return $o(this,"shape",p),p}});return ur(e,s)}function Z3(e,t){if(!cl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Xr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return $o(this,"shape",a),a}});return ur(e,n)}function K3(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=Xr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return $o(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ur(e,n)}function W3(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=Xr(t._zod.def,{get shape(){const m=t._zod.def.shape,h={...m};if(n)for(const c in n){if(!(c in m))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(h[c]=e?new e({type:"optional",innerType:m[c]}):m[c])}else for(const c in m)h[c]=e?new e({type:"optional",innerType:m[c]}):m[c];return $o(this,"shape",h),h},checks:[]});return ur(t,f)}function Y3(e,t,n){const a=Xr(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 $o(this,"shape",p),p}});return ur(t,a)}function Ks(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 X3(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 Hr(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Vd(e){return typeof e=="string"?e:e?.message}function cr(e,t,n){const a=e.message?e.message:Vd(e.inst?._zod.def?.error?.(e))??Vd(t?.error?.(e))??Vd(n.customError?.(e))??Vd(n.localeError?.(e))??"Invalid input",{inst:s,continue:p,input:f,...m}=e;return m.path??(m.path=[]),m.message=a,t?.reportInput&&(m.input=f),m}function Cb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Yc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const PE=(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,qv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},DE=de("$ZodError",PE),zE=de("$ZodError",PE,{Parent:Error});function J3(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 eD(e,t=n=>n.message){const n={_errors:[]},a=(s,p=[])=>{for(const f of s.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>a({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...p,...f.path]);else{const m=[...p,...f.path];if(m.length===0)n._errors.push(t(f));else{let h=n,c=0;for(;c<m.length;){const x=m[c];c===m.length-1?(h[x]=h[x]||{_errors:[]},h[x]._errors.push(t(f))):h[x]=h[x]||{_errors:[]},h=h[x],c++}}}};return a(e),n}const Ab=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 il;if(f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>cr(h,p,lr())));throw OE(m,s?.callee),m}return f.value},Eb=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=>cr(h,p,lr())));throw OE(m,s?.callee),m}return f.value},Im=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 il;return p.issues.length?{success:!1,error:new(e??DE)(p.issues.map(f=>cr(f,s,lr())))}:{success:!0,data:p.value}},tD=Im(zE),Tm=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=>cr(f,s,lr())))}:{success:!0,data:p.value}},nD=Tm(zE),aD=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Ab(e)(t,n,s)},iD=e=>(t,n,a)=>Ab(e)(t,n,a),rD=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Eb(e)(t,n,s)},oD=e=>async(t,n,a)=>Eb(e)(t,n,a),sD=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Im(e)(t,n,s)},lD=e=>(t,n,a)=>Im(e)(t,n,a),cD=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Tm(e)(t,n,s)},uD=e=>async(t,n,a)=>Tm(e)(t,n,a),dD=/^[cC][0-9a-z]{6,}$/,pD=/^[0-9a-z]+$/,mD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fD=/^[0-9a-vA-V]{20}$/,hD=/^[A-Za-z0-9]{27}$/,gD=/^[a-zA-Z0-9_-]{21}$/,vD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yD=/^([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})$/,Wk=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)$/,bD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,SD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xD(){return new RegExp(SD,"u")}const kD=/^(?:(?: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])$/,wD=/^(([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}|:))$/,MD=/^((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])$/,CD=/^(([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])$/,AD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,LE=/^[A-Za-z0-9_-]*$/,ED=/^https?$/,RD=/^\+[1-9]\d{6,14}$/,qE="(?:(?:\\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])))",ID=new RegExp(`^${qE}$`);function BE(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 TD(e){return new RegExp(`^${BE(e)}$`)}function _D(e){const t=BE({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(`^${qE}T(?:${a})$`)}const ND=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},OD=/^-?\d+$/,FE=/^-?\d+(?:\.\d+)?$/,jD=/^(?:true|false)$/i,PD=/^null$/i,DD=/^[^A-Z]*$/,zD=/^[^a-z]*$/,ha=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),UE={number:"number",bigint:"bigint",object:"date"},HE=de("$ZodCheckLessThan",(e,t)=>{ha.init(e,t);const n=UE[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})}}),$E=de("$ZodCheckGreaterThan",(e,t)=>{ha.init(e,t);const n=UE[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})}}),LD=de("$ZodCheckMultipleOf",(e,t)=>{ha.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):q3(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})}}),qD=de("$ZodCheckNumberFormat",(e,t)=>{ha.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,p]=$3[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=OD)}),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})}}),BD=de("$ZodCheckMaxLength",(e,t)=>{var n;ha.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!wb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const f=Cb(s);a.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),FD=de("$ZodCheckMinLength",(e,t)=>{var n;ha.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!wb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const f=Cb(s);a.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),UD=de("$ZodCheckLengthEquals",(e,t)=>{var n;ha.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!wb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,p=s.length;if(p===t.length)return;const f=Cb(s),m=p>t.length;a.issues.push({origin:f,...m?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),_m=de("$ZodCheckStringFormat",(e,t)=>{var n,a;ha.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=()=>{})}),HD=de("$ZodCheckRegex",(e,t)=>{_m.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})}}),$D=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=DD),_m.init(e,t)}),QD=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zD),_m.init(e,t)}),VD=de("$ZodCheckIncludes",(e,t)=>{ha.init(e,t);const n=ul(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})}}),GD=de("$ZodCheckStartsWith",(e,t)=>{ha.init(e,t);const n=new RegExp(`^${ul(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})}}),ZD=de("$ZodCheckEndsWith",(e,t)=>{ha.init(e,t);const n=new RegExp(`.*${ul(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})}}),KD=de("$ZodCheckOverwrite",(e,t)=>{ha.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class WD{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 YD={major:4,minor:4,patch:3},Ot=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=YD;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const p of s._zod.onattach)p(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,m,h)=>{let c=Ks(f),x;for(const M of m){if(M._zod.def.when){if(X3(f)||!M._zod.def.when(f))continue}else if(c)continue;const C=f.issues.length,E=M._zod.check(f);if(E instanceof Promise&&h?.async===!1)throw new il;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,f.issues.length!==C&&(c||(c=Ks(f,C)))});else{if(f.issues.length===C)continue;c||(c=Ks(f,C))}}return x?x.then(()=>f):f},p=(f,m,h)=>{if(Ks(f))return f.aborted=!0,f;const c=s(m,a,h);if(c instanceof Promise){if(h.async===!1)throw new il;return c.then(x=>e._zod.parse(x,h))}return e._zod.parse(c,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const c=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return c instanceof Promise?c.then(x=>p(x,f,m)):p(c,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new il;return h.then(c=>s(c,a,m))}return s(h,a,m)}}Mt(e,"~standard",()=>({validate:s=>{try{const p=tD(e,s);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return nD(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Rb=de("$ZodString",(e,t)=>{Ot.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ND(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}}),tn=de("$ZodStringFormat",(e,t)=>{_m.init(e,t),Rb.init(e,t)}),XD=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yD),tn.init(e,t)}),JD=de("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wk(a))}else t.pattern??(t.pattern=Wk());tn.init(e,t)}),e6=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bD),tn.init(e,t)}),t6=de("$ZodURL",(e,t)=>{tn.init(e,t),e._zod.check=n=>{try{const a=n.value.trim();if(!t.normalize&&t.protocol?.source===ED.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})}}}),n6=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xD()),tn.init(e,t)}),a6=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gD),tn.init(e,t)}),i6=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=dD),tn.init(e,t)}),r6=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=pD),tn.init(e,t)}),o6=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=mD),tn.init(e,t)}),s6=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=fD),tn.init(e,t)}),l6=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=hD),tn.init(e,t)}),c6=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=_D(t)),tn.init(e,t)}),u6=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ID),tn.init(e,t)}),d6=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=TD(t)),tn.init(e,t)}),p6=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vD),tn.init(e,t)}),m6=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kD),tn.init(e,t),e._zod.bag.format="ipv4"}),f6=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=wD),tn.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})}}}),h6=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=MD),tn.init(e,t)}),g6=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=CD),tn.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 QE(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const v6=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=AD),tn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{QE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function y6(e){if(!LE.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return QE(n)}const b6=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=LE),tn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{y6(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),S6=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=RD),tn.init(e,t)});function x6(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 k6=de("$ZodJWT",(e,t)=>{tn.init(e,t),e._zod.check=n=>{x6(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),VE=de("$ZodNumber",(e,t)=>{Ot.init(e,t),e._zod.pattern=e._zod.bag.pattern??FE,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}}),w6=de("$ZodNumberFormat",(e,t)=>{qD.init(e,t),VE.init(e,t)}),M6=de("$ZodBoolean",(e,t)=>{Ot.init(e,t),e._zod.pattern=jD,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}}),C6=de("$ZodNull",(e,t)=>{Ot.init(e,t),e._zod.pattern=PD,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}}),A6=de("$ZodAny",(e,t)=>{Ot.init(e,t),e._zod.parse=n=>n}),E6=de("$ZodUnknown",(e,t)=>{Ot.init(e,t),e._zod.parse=n=>n}),R6=de("$ZodNever",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),I6=de("$ZodVoid",(e,t)=>{Ot.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}}),T6=de("$ZodDate",(e,t)=>{Ot.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 Yk(e,t,n){e.issues.length&&t.issues.push(...Hr(n,e.issues)),t.value[n]=e.value}const _6=de("$ZodArray",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const p=[];for(let f=0;f<s.length;f++){const m=s[f],h=t.element._zod.run({value:m,issues:[]},a);h instanceof Promise?p.push(h.then(c=>Yk(c,n,f))):Yk(h,n,f)}return p.length?Promise.all(p).then(()=>n):n}});function Wp(e,t,n,a,s,p){const f=n in a;if(e.issues.length){if(s&&p&&!f)return;t.issues.push(...Hr(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 GE(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=H3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ZE(e,t,n,a,s,p){const f=[],m=s.keySet,h=s.catchall._zod,c=h.def.type,x=h.optin==="optional",M=h.optout==="optional";for(const C in t){if(C==="__proto__"||m.has(C))continue;if(c==="never"){f.push(C);continue}const E=h.run({value:t[C],issues:[]},a);E instanceof Promise?e.push(E.then(R=>Wp(R,n,C,t,x,M))):Wp(E,n,C,t,x,M)}return f.length&&n.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:p}),e.length?Promise.all(e).then(()=>n):n}const N6=de("$ZodObject",(e,t)=>{if(Ot.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=Rm(()=>GE(t));Mt(e._zod,"propValues",()=>{const m=t.shape,h={};for(const c in m){const x=m[c]._zod;if(x.values){h[c]??(h[c]=new Set);for(const M of x.values)h[c].add(M)}}return h});const s=Wc,p=t.catchall;let f;e._zod.parse=(m,h)=>{f??(f=a.value);const c=m.value;if(!s(c))return m.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),m;m.value={};const x=[],M=f.shape;for(const C of f.keys){const E=M[C],R=E._zod.optin==="optional",_=E._zod.optout==="optional",j=E._zod.run({value:c[C],issues:[]},h);j instanceof Promise?x.push(j.then(D=>Wp(D,m,C,c,R,_))):Wp(j,m,C,c,R,_)}return p?ZE(x,c,m,h,a.value,e):x.length?Promise.all(x).then(()=>m):m}}),O6=de("$ZodObjectJIT",(e,t)=>{N6.init(e,t);const n=e._zod.parse,a=Rm(()=>GE(t)),s=C=>{const E=new WD(["shape","payload","ctx"]),R=a.value,_=F=>{const L=Kk(F);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};E.write("const input = payload.value;");const j=Object.create(null);let D=0;for(const F of R.keys)j[F]=`key_${D++}`;E.write("const newResult = {};");for(const F of R.keys){const L=j[F],Z=Kk(F),ne=C[F],V=ne?._zod?.optin==="optional",U=ne?._zod?.optout==="optional";E.write(`const ${L} = ${_(F)};`),V&&U?E.write(`
13
+ if (${L}.issues.length) {
14
+ if (${Z} in input) {
15
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
16
+ ...iss,
17
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
18
+ })));
19
+ }
20
+ }
21
+
22
+ if (${L}.value === undefined) {
23
+ if (${Z} in input) {
24
+ newResult[${Z}] = undefined;
25
+ }
26
+ } else {
27
+ newResult[${Z}] = ${L}.value;
28
+ }
29
+
30
+ `):V?E.write(`
31
+ if (${L}.issues.length) {
32
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
33
+ ...iss,
34
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
35
+ })));
36
+ }
37
+
38
+ if (${L}.value === undefined) {
39
+ if (${Z} in input) {
40
+ newResult[${Z}] = undefined;
41
+ }
42
+ } else {
43
+ newResult[${Z}] = ${L}.value;
44
+ }
45
+
46
+ `):E.write(`
47
+ const ${L}_present = ${Z} in input;
48
+ if (${L}.issues.length) {
49
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
50
+ ...iss,
51
+ path: iss.path ? [${Z}, ...iss.path] : [${Z}]
52
+ })));
53
+ }
54
+ if (!${L}_present && !${L}.issues.length) {
55
+ payload.issues.push({
56
+ code: "invalid_type",
57
+ expected: "nonoptional",
58
+ input: undefined,
59
+ path: [${Z}]
60
+ });
61
+ }
62
+
63
+ if (${L}_present) {
64
+ if (${L}.value === undefined) {
65
+ newResult[${Z}] = undefined;
66
+ } else {
67
+ newResult[${Z}] = ${L}.value;
68
+ }
69
+ }
70
+
71
+ `)}E.write("payload.value = newResult;"),E.write("return payload;");const z=E.compile();return(F,L)=>z(C,F,L)};let p;const f=Wc,m=!kb.jitless,c=m&&F3.value,x=t.catchall;let M;e._zod.parse=(C,E)=>{M??(M=a.value);const R=C.value;return f(R)?m&&c&&E?.async===!1&&E.jitless!==!0?(p||(p=s(t.shape)),C=p(C,E),x?ZE([],R,C,E,M,e):C):n(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),C)}});function Xk(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=>!Ks(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=>cr(f,a,lr())))}),t)}const KE=de("$ZodUnion",(e,t)=>{Ot.init(e,t),Mt(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),Mt(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),Mt(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),Mt(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${a.map(s=>Mb(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=>Xk(m,a,e,s)):Xk(f,a,e,s)}}),j6=de("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,KE.init(e,t);const n=e._zod.parse;Mt(e._zod,"propValues",()=>{const s={};for(const p of t.options){const f=p._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(const[m,h]of Object.entries(f)){s[m]||(s[m]=new Set);for(const c of h)s[m].add(c)}}return s});const a=Rm(()=>{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(!Wc(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)}}),P6=de("$ZodIntersection",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,p=t.left._zod.run({value:s,issues:[]},a),f=t.right._zod.run({value:s,issues:[]},a);return p instanceof Promise||f instanceof Promise?Promise.all([p,f]).then(([h,c])=>Jk(n,h,c)):Jk(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(cl(e)&&cl(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 Jk(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}),Ks(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 D6=de("$ZodTuple",(e,t)=>{Ot.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=ew(n,"optin"),h=ew(n,"optout");if(!t.rest){if(p.length<m)return a.issues.push({code:"too_small",minimum:m,inclusive:!0,input:p,inst:e,origin:"array"}),a;p.length>n.length&&a.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:p,inst:e,origin:"array"})}const c=new Array(n.length);for(let x=0;x<n.length;x++){const M=n[x]._zod.run({value:p[x],issues:[]},s);M instanceof Promise?f.push(M.then(C=>{c[x]=C})):c[x]=M}if(t.rest){let x=n.length-1;const M=p.slice(n.length);for(const C of M){x++;const E=t.rest._zod.run({value:C,issues:[]},s);E instanceof Promise?f.push(E.then(R=>tw(R,a,x))):tw(E,a,x)}}return f.length?Promise.all(f).then(()=>nw(c,a,n,p,h)):nw(c,a,n,p,h)}});function ew(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function tw(e,t,n){e.issues.length&&t.issues.push(...Hr(n,e.issues)),t.value[n]=e.value}function nw(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(...Hr(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 z6=de("$ZodRecord",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!cl(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const p=[],f=t.keyType._zod.values;if(f){n.value={};const m=new Set;for(const c of f)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){m.add(typeof c=="number"?c.toString():c);const x=t.keyType._zod.run({value:c,issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(x.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:x.issues.map(E=>cr(E,a,lr())),input:c,path:[c],inst:e});continue}const M=x.value,C=t.valueType._zod.run({value:s[c],issues:[]},a);C instanceof Promise?p.push(C.then(E=>{E.issues.length&&n.issues.push(...Hr(c,E.issues)),n.value[M]=E.value})):(C.issues.length&&n.issues.push(...Hr(c,C.issues)),n.value[M]=C.value)}let h;for(const c in s)m.has(c)||(h=h??[],h.push(c));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const m of Reflect.ownKeys(s)){if(m==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,m))continue;let h=t.keyType._zod.run({value:m,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&FE.test(m)&&h.issues.length){const M=t.keyType._zod.run({value:Number(m),issues:[]},a);if(M instanceof Promise)throw new Error("Async schemas not supported in object keys currently");M.issues.length===0&&(h=M)}if(h.issues.length){t.mode==="loose"?n.value[m]=s[m]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(M=>cr(M,a,lr())),input:m,path:[m],inst:e});continue}const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?p.push(x.then(M=>{M.issues.length&&n.issues.push(...Hr(m,M.issues)),n.value[h.value]=M.value})):(x.issues.length&&n.issues.push(...Hr(m,x.issues)),n.value[h.value]=x.value)}}return p.length?Promise.all(p).then(()=>n):n}}),L6=de("$ZodEnum",(e,t)=>{Ot.init(e,t);const n=NE(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"?ul(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}}),q6=de("$ZodLiteral",(e,t)=>{if(Ot.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"?ul(a):a?ul(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}}),B6=de("$ZodTransform",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new _E(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 il;return n.value=s,n.fallback=!0,n}});function aw(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const WE=de("$ZodOptional",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mb(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=>aw(f,s)):aw(p,s)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),F6=de("$ZodExactOptional",(e,t)=>{WE.init(e,t),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),U6=de("$ZodNullable",(e,t)=>{Ot.init(e,t),Mt(e._zod,"optin",()=>t.innerType._zod.optin),Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mb(n.source)}|null)$`):void 0}),Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),H6=de("$ZodDefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>iw(p,t)):iw(s,t)}});function iw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $6=de("$ZodPrefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),Q6=de("$ZodNonOptional",(e,t)=>{Ot.init(e,t),Mt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>rw(p,e)):rw(s,e)}});function rw(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 V6=de("$ZodCatch",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>(n.value=p.value,p.issues.length&&(n.value=t.catchValue({...n,error:{issues:p.issues.map(f=>cr(f,a,lr()))},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=>cr(p,a,lr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),YE=de("$ZodPipe",(e,t)=>{Ot.init(e,t),Mt(e._zod,"values",()=>t.in._zod.values),Mt(e._zod,"optin",()=>t.in._zod.optin),Mt(e._zod,"optout",()=>t.out._zod.optout),Mt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const p=t.out._zod.run(n,a);return p instanceof Promise?p.then(f=>Gd(f,t.in,a)):Gd(p,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(p=>Gd(p,t.out,a)):Gd(s,t.out,a)}});function Gd(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 G6=de("$ZodPreprocess",(e,t)=>{YE.init(e,t)}),Z6=de("$ZodReadonly",(e,t)=>{Ot.init(e,t),Mt(e._zod,"propValues",()=>t.innerType._zod.propValues),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"optin",()=>t.innerType?._zod?.optin),Mt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(ow):ow(s)}});function ow(e){return e.value=Object.freeze(e.value),e}const K6=de("$ZodLazy",(e,t)=>{Ot.init(e,t),Mt(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Mt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Mt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Mt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Mt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,a)=>e._zod.innerType._zod.run(n,a)}),W6=de("$ZodCustom",(e,t)=>{ha.init(e,t),Ot.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=>sw(p,n,a,e));sw(s,n,a,e)}});function sw(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(Yc(s))}}var lw;class Y6{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 X6(){return new Y6}(lw=globalThis).__zod_globalRegistry??(lw.__zod_globalRegistry=X6());const Dc=globalThis.__zod_globalRegistry;function J6(e,t){return new e({type:"string",...De(t)})}function XE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function cw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function ez(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function tz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function nz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function az(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function JE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function iz(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function rz(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function oz(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function sz(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function lz(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function cz(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function uz(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function dz(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function pz(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function mz(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function fz(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function hz(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function gz(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function vz(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function yz(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function bz(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function Sz(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function xz(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function kz(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function wz(e,t){return new e({type:"number",checks:[],...De(t)})}function Mz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function Cz(e,t){return new e({type:"boolean",...De(t)})}function Az(e,t){return new e({type:"null",...De(t)})}function Ez(e){return new e({type:"any"})}function Rz(e){return new e({type:"unknown"})}function Iz(e,t){return new e({type:"never",...De(t)})}function Tz(e,t){return new e({type:"void",...De(t)})}function _z(e,t){return new e({type:"date",...De(t)})}function uw(e,t){return new HE({check:"less_than",...De(t),value:e,inclusive:!1})}function yp(e,t){return new HE({check:"less_than",...De(t),value:e,inclusive:!0})}function dw(e,t){return new $E({check:"greater_than",...De(t),value:e,inclusive:!1})}function bp(e,t){return new $E({check:"greater_than",...De(t),value:e,inclusive:!0})}function pw(e,t){return new LD({check:"multiple_of",...De(t),value:e})}function eR(e,t){return new BD({check:"max_length",...De(t),maximum:e})}function Yp(e,t){return new FD({check:"min_length",...De(t),minimum:e})}function tR(e,t){return new UD({check:"length_equals",...De(t),length:e})}function Nz(e,t){return new HD({check:"string_format",format:"regex",...De(t),pattern:e})}function Oz(e){return new $D({check:"string_format",format:"lowercase",...De(e)})}function jz(e){return new QD({check:"string_format",format:"uppercase",...De(e)})}function Pz(e,t){return new VD({check:"string_format",format:"includes",...De(t),includes:e})}function Dz(e,t){return new GD({check:"string_format",format:"starts_with",...De(t),prefix:e})}function zz(e,t){return new ZD({check:"string_format",format:"ends_with",...De(t),suffix:e})}function xl(e){return new KD({check:"overwrite",tx:e})}function Lz(e){return xl(t=>t.normalize(e))}function qz(){return xl(e=>e.trim())}function Bz(){return xl(e=>e.toLowerCase())}function Fz(){return xl(e=>e.toUpperCase())}function Uz(){return xl(e=>B3(e))}function Hz(e,t,n){return new e({type:"array",element:t,...De(n)})}function $z(e,t,n){const a=De(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function Qz(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function Vz(e,t){const n=Gz(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(Yc(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(Yc(p))}},e(a.value,a)),t);return n}function Gz(e,t){const n=new ha({check:"custom",...De(t)});return n._zod.check=e,n}function nR(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??Dc,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 rn(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,p=t.seen.get(e);if(p)return p.count++,n.schemaPath.includes(e)&&(p.cycle=n.path),p.schema;const f={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,f);const m=e._zod.toJSONSchema?.();if(m)f.schema=m;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,f.schema,x);else{const C=f.schema,E=t.processors[s.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);E(e,t,C,x)}const M=e._zod.parent;M&&(f.ref||(f.ref=M),rn(M,t,x),t.seen.get(M).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(f.schema,h),t.io==="input"&&Yn(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 aR(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const f of e.seen.entries()){const m=e.metadataRegistry.get(f[0])?.id;if(m){const h=a.get(m);if(h&&h!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(m,f[0])}}const s=f=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const M=e.external.registry.get(f[0])?.id,C=e.external.uri??(R=>R);if(M)return{ref:C(M)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${C("__shared")}#/${m}/${E}`}}if(f[1]===n)return{ref:"#"};const c=`#/${m}/`,x=f[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:c+x}},p=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:h,defId:c}=s(f);m.def={...m.schema},c&&(m.defId=c);const x=m.schema;for(const M in x)delete x[M];x.$ref=h};if(e.cycles==="throw")for(const f of e.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
72
+
73
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const m=f[1];if(t===f[0]){p(f);continue}if(e.external){const c=e.external.registry.get(f[0])?.id;if(t!==f[0]&&c){p(f);continue}}if(e.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1&&e.reused==="ref"){p(f);continue}}}function iR(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=m=>{const h=e.seen.get(m);if(h.ref===null)return;const c=h.def??h.schema,x={...c},M=h.ref;if(h.ref=null,M){a(M);const E=e.seen.get(M),R=E.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(R)):Object.assign(c,R),Object.assign(c,x),m._zod.parent===M)for(const j in c)j==="$ref"||j==="allOf"||j in x||delete c[j];if(R.$ref&&E.def)for(const j in c)j==="$ref"||j==="allOf"||j in E.def&&JSON.stringify(c[j])===JSON.stringify(E.def[j])&&delete c[j]}const C=m._zod.parent;if(C&&C!==M){a(C);const E=e.seen.get(C);if(E?.schema.$ref&&(c.$ref=E.schema.$ref,E.def))for(const R in c)R==="$ref"||R==="allOf"||R in E.def&&JSON.stringify(c[R])===JSON.stringify(E.def[R])&&delete c[R]}e.override({zodSchema:m,jsonSchema:c,path:h.path??[]})};for(const m of[...e.seen.entries()].reverse())a(m[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const m=e.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(m)}Object.assign(s,n.def??n.schema);const p=e.metadataRegistry.get(t)?.id;p!==void 0&&s.id===p&&delete s.id;const f=e.external?.defs??{};for(const m of e.seen.entries()){const h=m[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,f[h.defId]=h.def)}e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?s.$defs=f:s.definitions=f);try{const m=JSON.parse(JSON.stringify(s));return Object.defineProperty(m,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xp(t,"input",e.processors),output:Xp(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Yn(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 Yn(a.element,n);if(a.type==="set")return Yn(a.valueType,n);if(a.type==="lazy")return Yn(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 Yn(a.innerType,n);if(a.type==="intersection")return Yn(a.left,n)||Yn(a.right,n);if(a.type==="record"||a.type==="map")return Yn(a.keyType,n)||Yn(a.valueType,n);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Yn(a.in,n)||Yn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Yn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Yn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Yn(s,n))return!0;return!!(a.rest&&Yn(a.rest,n))}return!1}const Zz=(e,t={})=>n=>{const a=nR({...n,processors:t});return rn(e,a),aR(a,e),iR(a,e)},Xp=(e,t,n={})=>a=>{const{libraryOptions:s,target:p}=a??{},f=nR({...s??{},target:p,io:t,processors:n});return rn(e,f),aR(f,e),iR(f,e)},Kz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Wz=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:p,maximum:f,format:m,patterns:h,contentEncoding:c}=e._zod.bag;if(typeof p=="number"&&(s.minLength=p),typeof f=="number"&&(s.maxLength=f),m&&(s.format=Kz[m]??m,s.format===""&&delete s.format,m==="time"&&delete s.format),c&&(s.contentEncoding=c),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(M=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:M.source}))])}},Yz=(e,t,n,a)=>{const s=n,{minimum:p,maximum:f,format:m,multipleOf:h,exclusiveMaximum:c,exclusiveMinimum:x}=e._zod.bag;typeof m=="string"&&m.includes("int")?s.type="integer":s.type="number";const M=typeof x=="number"&&x>=(p??Number.NEGATIVE_INFINITY),C=typeof c=="number"&&c<=(f??Number.POSITIVE_INFINITY),E=t.target==="draft-04"||t.target==="openapi-3.0";M?E?(s.minimum=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x:typeof p=="number"&&(s.minimum=p),C?E?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof f=="number"&&(s.maximum=f),typeof h=="number"&&(s.multipleOf=h)},Xz=(e,t,n,a)=>{n.type="boolean"},Jz=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},eL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},tL=(e,t,n,a)=>{n.not={}},nL=(e,t,n,a)=>{},aL=(e,t,n,a)=>{},iL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},rL=(e,t,n,a)=>{const s=e._zod.def,p=NE(s.entries);p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),n.enum=p},oL=(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},sL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},lL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cL=(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=rn(p.element,t,{...a,path:[...a.path,"items"]})},uL=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object",s.properties={};const f=p.shape;for(const c in f)s.properties[c]=rn(f[c],t,{...a,path:[...a.path,"properties",c]});const m=new Set(Object.keys(f)),h=new Set([...m].filter(c=>{const x=p.shape[c]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),p.catchall?._zod.def.type==="never"?s.additionalProperties=!1:p.catchall?p.catchall&&(s.additionalProperties=rn(p.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},dL=(e,t,n,a)=>{const s=e._zod.def,p=s.inclusive===!1,f=s.options.map((m,h)=>rn(m,t,{...a,path:[...a.path,p?"oneOf":"anyOf",h]}));p?n.oneOf=f:n.anyOf=f},pL=(e,t,n,a)=>{const s=e._zod.def,p=rn(s.left,t,{...a,path:[...a.path,"allOf",0]}),f=rn(s.right,t,{...a,path:[...a.path,"allOf",1]}),m=c=>"allOf"in c&&Object.keys(c).length===1,h=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=h},mL=(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)=>rn(C,t,{...a,path:[...a.path,f,E]})),c=p.rest?rn(p.rest,t,{...a,path:[...a.path,m,...t.target==="openapi-3.0"?[p.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,c&&(s.items=c)):t.target==="openapi-3.0"?(s.items={anyOf:h},c&&s.items.anyOf.push(c),s.minItems=h.length,c||(s.maxItems=h.length)):(s.items=h,c&&(s.additionalItems=c));const{minimum:x,maximum:M}=e._zod.bag;typeof x=="number"&&(s.minItems=x),typeof M=="number"&&(s.maxItems=M)},fL=(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=rn(p.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const M of h)s.patternProperties[M.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=rn(p.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=rn(p.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const c=f._zod.values;if(c){const x=[...c].filter(M=>typeof M=="string"||typeof M=="number");x.length>0&&(s.required=x)}},hL=(e,t,n,a)=>{const s=e._zod.def,p=rn(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"}]},gL=(e,t,n,a)=>{const s=e._zod.def;rn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},vL=(e,t,n,a)=>{const s=e._zod.def;rn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},yL=(e,t,n,a)=>{const s=e._zod.def;rn(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)))},bL=(e,t,n,a)=>{const s=e._zod.def;rn(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},SL=(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;rn(f,t,a);const m=t.seen.get(e);m.ref=f},xL=(e,t,n,a)=>{const s=e._zod.def;rn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.readOnly=!0},rR=(e,t,n,a)=>{const s=e._zod.def;rn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},kL=(e,t,n,a)=>{const s=e._zod.innerType;rn(s,t,a);const p=t.seen.get(e);p.ref=s},wL=de("ZodISODateTime",(e,t)=>{c6.init(e,t),on.init(e,t)});function ML(e){return bz(wL,e)}const CL=de("ZodISODate",(e,t)=>{u6.init(e,t),on.init(e,t)});function AL(e){return Sz(CL,e)}const EL=de("ZodISOTime",(e,t)=>{d6.init(e,t),on.init(e,t)});function RL(e){return xz(EL,e)}const IL=de("ZodISODuration",(e,t)=>{p6.init(e,t),on.init(e,t)});function TL(e){return kz(IL,e)}const _L=(e,t)=>{DE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>eD(e,n)},flatten:{value:n=>J3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,qv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,qv,2)}},isEmpty:{get(){return e.issues.length===0}}})},$a=de("ZodError",_L,{Parent:Error}),NL=Ab($a),OL=Eb($a),jL=Im($a),PL=Tm($a),DL=aD($a),zL=iD($a),LL=rD($a),qL=oD($a),BL=sD($a),FL=lD($a),UL=cD($a),HL=uD($a),mw=new WeakMap;function hu(e,t,n){const a=Object.getPrototypeOf(e);let s=mw.get(a);if(s||(s=new Set,mw.set(a,s)),!s.has(t)){s.add(t);for(const p in n){const f=n[p];Object.defineProperty(a,p,{configurable:!0,enumerable:!1,get(){const m=f.bind(this);return Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m}),m},set(m){Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m})}})}}}const Lt=de("ZodType",(e,t)=>(Ot.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xp(e,"input"),output:Xp(e,"output")}}),e.toJSONSchema=Zz(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,a)=>NL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>jL(e,n,a),e.parseAsync=async(n,a)=>OL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>PL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>DL(e,n,a),e.decode=(n,a)=>zL(e,n,a),e.encodeAsync=async(n,a)=>LL(e,n,a),e.decodeAsync=async(n,a)=>qL(e,n,a),e.safeEncode=(n,a)=>BL(e,n,a),e.safeDecode=(n,a)=>FL(e,n,a),e.safeEncodeAsync=async(n,a)=>UL(e,n,a),e.safeDecodeAsync=async(n,a)=>HL(e,n,a),hu(e,"ZodType",{check(...n){const a=this.def;return this.clone(Xr(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 ur(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(q8(n,a))},superRefine(n,a){return this.check(B8(n,a))},overwrite(n){return this.check(xl(n))},optional(){return vw(this)},exactOptional(){return A8(this)},nullable(){return yw(this)},nullish(){return vw(yw(this))},nonoptional(n){return N8(this,n)},array(){return w(this)},or(n){return tt([this,n])},and(n){return S8(this,n)},transform(n){return bw(this,fR(n))},default(n){return I8(this,n)},prefault(n){return _8(this,n)},catch(n){return j8(this,n)},pipe(n){return bw(this,n)},readonly(){return z8(this)},describe(n){const a=this.clone();return Dc.add(a,{description:n}),a},meta(...n){if(n.length===0)return Dc.get(this);const a=this.clone();return Dc.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 Dc.get(e)?.description},configurable:!0}),e)),oR=de("_ZodString",(e,t)=>{Rb.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Wz(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,hu(e,"_ZodString",{regex(...a){return this.check(Nz(...a))},includes(...a){return this.check(Pz(...a))},startsWith(...a){return this.check(Dz(...a))},endsWith(...a){return this.check(zz(...a))},min(...a){return this.check(Yp(...a))},max(...a){return this.check(eR(...a))},length(...a){return this.check(tR(...a))},nonempty(...a){return this.check(Yp(1,...a))},lowercase(a){return this.check(Oz(a))},uppercase(a){return this.check(jz(a))},trim(){return this.check(qz())},normalize(...a){return this.check(Lz(...a))},toLowerCase(){return this.check(Bz())},toUpperCase(){return this.check(Fz())},slugify(){return this.check(Uz())}})}),$L=de("ZodString",(e,t)=>{Rb.init(e,t),oR.init(e,t),e.email=n=>e.check(XE(sR,n)),e.url=n=>e.check(JE(lR,n)),e.jwt=n=>e.check(yz(s8,n)),e.emoji=n=>e.check(iz(GL,n)),e.guid=n=>e.check(cw(fw,n)),e.uuid=n=>e.check(ez(Zd,n)),e.uuidv4=n=>e.check(tz(Zd,n)),e.uuidv6=n=>e.check(nz(Zd,n)),e.uuidv7=n=>e.check(az(Zd,n)),e.nanoid=n=>e.check(rz(ZL,n)),e.guid=n=>e.check(cw(fw,n)),e.cuid=n=>e.check(oz(KL,n)),e.cuid2=n=>e.check(sz(WL,n)),e.ulid=n=>e.check(lz(YL,n)),e.base64=n=>e.check(hz(i8,n)),e.base64url=n=>e.check(gz(r8,n)),e.xid=n=>e.check(cz(XL,n)),e.ksuid=n=>e.check(uz(JL,n)),e.ipv4=n=>e.check(dz(e8,n)),e.ipv6=n=>e.check(pz(t8,n)),e.cidrv4=n=>e.check(mz(n8,n)),e.cidrv6=n=>e.check(fz(a8,n)),e.e164=n=>e.check(vz(o8,n)),e.datetime=n=>e.check(ML(n)),e.date=n=>e.check(AL(n)),e.time=n=>e.check(RL(n)),e.duration=n=>e.check(TL(n))});function o(e){return J6($L,e)}const on=de("ZodStringFormat",(e,t)=>{tn.init(e,t),oR.init(e,t)}),sR=de("ZodEmail",(e,t)=>{e6.init(e,t),on.init(e,t)});function QL(e){return XE(sR,e)}const fw=de("ZodGUID",(e,t)=>{XD.init(e,t),on.init(e,t)}),Zd=de("ZodUUID",(e,t)=>{JD.init(e,t),on.init(e,t)}),lR=de("ZodURL",(e,t)=>{t6.init(e,t),on.init(e,t)});function VL(e){return JE(lR,e)}const GL=de("ZodEmoji",(e,t)=>{n6.init(e,t),on.init(e,t)}),ZL=de("ZodNanoID",(e,t)=>{a6.init(e,t),on.init(e,t)}),KL=de("ZodCUID",(e,t)=>{i6.init(e,t),on.init(e,t)}),WL=de("ZodCUID2",(e,t)=>{r6.init(e,t),on.init(e,t)}),YL=de("ZodULID",(e,t)=>{o6.init(e,t),on.init(e,t)}),XL=de("ZodXID",(e,t)=>{s6.init(e,t),on.init(e,t)}),JL=de("ZodKSUID",(e,t)=>{l6.init(e,t),on.init(e,t)}),e8=de("ZodIPv4",(e,t)=>{m6.init(e,t),on.init(e,t)}),t8=de("ZodIPv6",(e,t)=>{f6.init(e,t),on.init(e,t)}),n8=de("ZodCIDRv4",(e,t)=>{h6.init(e,t),on.init(e,t)}),a8=de("ZodCIDRv6",(e,t)=>{g6.init(e,t),on.init(e,t)}),i8=de("ZodBase64",(e,t)=>{v6.init(e,t),on.init(e,t)}),r8=de("ZodBase64URL",(e,t)=>{b6.init(e,t),on.init(e,t)}),o8=de("ZodE164",(e,t)=>{S6.init(e,t),on.init(e,t)}),s8=de("ZodJWT",(e,t)=>{k6.init(e,t),on.init(e,t)}),cR=de("ZodNumber",(e,t)=>{VE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Yz(e,a,s),hu(e,"ZodNumber",{gt(a,s){return this.check(dw(a,s))},gte(a,s){return this.check(bp(a,s))},min(a,s){return this.check(bp(a,s))},lt(a,s){return this.check(uw(a,s))},lte(a,s){return this.check(yp(a,s))},max(a,s){return this.check(yp(a,s))},int(a){return this.check(hw(a))},safe(a){return this.check(hw(a))},positive(a){return this.check(dw(0,a))},nonnegative(a){return this.check(bp(0,a))},negative(a){return this.check(uw(0,a))},nonpositive(a){return this.check(yp(0,a))},multipleOf(a,s){return this.check(pw(a,s))},step(a,s){return this.check(pw(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 wz(cR,e)}const l8=de("ZodNumberFormat",(e,t)=>{w6.init(e,t),cR.init(e,t)});function hw(e){return Mz(l8,e)}const c8=de("ZodBoolean",(e,t)=>{M6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Xz(e,n,a)});function A(e){return Cz(c8,e)}const u8=de("ZodNull",(e,t)=>{C6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Jz(e,n,a)});function uR(e){return Az(u8,e)}const d8=de("ZodAny",(e,t)=>{A6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nL()});function dR(){return Ez(d8)}const p8=de("ZodUnknown",(e,t)=>{E6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>aL()});function J(){return Rz(p8)}const m8=de("ZodNever",(e,t)=>{R6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tL(e,n,a)});function f8(e){return Iz(m8,e)}const h8=de("ZodVoid",(e,t)=>{I6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eL(e,n)});function O(e){return Tz(h8,e)}const g8=de("ZodDate",(e,t)=>{T6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>iL(e,a),e.min=(a,s)=>e.check(bp(a,s)),e.max=(a,s)=>e.check(yp(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 Fv(e){return _z(g8,e)}const v8=de("ZodArray",(e,t)=>{_6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cL(e,n,a,s),e.element=t.element,hu(e,"ZodArray",{min(n,a){return this.check(Yp(n,a))},nonempty(n){return this.check(Yp(1,n))},max(n,a){return this.check(eR(n,a))},length(n,a){return this.check(tR(n,a))},unwrap(){return this.element}})});function w(e,t){return Hz(v8,e,t)}const pR=de("ZodObject",(e,t)=>{O6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uL(e,n,a,s),Mt(e,"shape",()=>t.shape),hu(e,"ZodObject",{keyof(){return N(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:J()})},loose(){return this.clone({...this._zod.def,catchall:J()})},strict(){return this.clone({...this._zod.def,catchall:f8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return G3(this,n)},safeExtend(n){return Z3(this,n)},merge(n){return K3(this,n)},pick(n){return Q3(this,n)},omit(n){return V3(this,n)},partial(...n){return W3(hR,this,n[0])},required(...n){return Y3(gR,this,n[0])}})});function d(e,t){const n={type:"object",shape:e??{},...De(t)};return new pR(n)}function gw(e,t){return new pR({type:"object",shape:e,catchall:J(),...De(t)})}const mR=de("ZodUnion",(e,t)=>{KE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dL(e,n,a,s),e.options=t.options});function tt(e,t){return new mR({type:"union",options:e,...De(t)})}const y8=de("ZodDiscriminatedUnion",(e,t)=>{mR.init(e,t),j6.init(e,t)});function wt(e,t,n){return new y8({type:"union",options:t,discriminator:e,...De(n)})}const b8=de("ZodIntersection",(e,t)=>{P6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pL(e,n,a,s)});function S8(e,t){return new b8({type:"intersection",left:e,right:t})}const x8=de("ZodTuple",(e,t)=>{D6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mL(e,n,a,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function gu(e,t,n){const a=t instanceof Ot,s=a?n:t,p=a?t:null;return new x8({type:"tuple",items:e,rest:p,...De(s)})}const Uv=de("ZodRecord",(e,t)=>{z6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fL(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Y(e,t,n){return!t||!t._zod?new Uv({type:"record",keyType:o(),valueType:e,...De(t)}):new Uv({type:"record",keyType:e,valueType:t,...De(n)})}function k8(e,t,n){const a=ur(e);return a._zod.values=void 0,new Uv({type:"record",keyType:a,valueType:t,...De(n)})}const Hv=de("ZodEnum",(e,t)=>{L6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>rL(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 Hv({...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 Hv({...t,checks:[],...De(s),entries:p})}});function N(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Hv({type:"enum",entries:n,...De(t)})}const w8=de("ZodLiteral",(e,t)=>{q6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oL(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new w8({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const M8=de("ZodTransform",(e,t)=>{B6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new _E(e.constructor.name);n.addIssue=p=>{if(typeof p=="string")n.issues.push(Yc(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(Yc(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 fR(e){return new M8({type:"transform",transform:e})}const hR=de("ZodOptional",(e,t)=>{WE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rR(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new hR({type:"optional",innerType:e})}const C8=de("ZodExactOptional",(e,t)=>{F6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rR(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function A8(e){return new C8({type:"optional",innerType:e})}const E8=de("ZodNullable",(e,t)=>{U6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yw(e){return new E8({type:"nullable",innerType:e})}const R8=de("ZodDefault",(e,t)=>{H6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I8(e,t){return new R8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jE(t)}})}const T8=de("ZodPrefault",(e,t)=>{$6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>yL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function _8(e,t){return new T8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jE(t)}})}const gR=de("ZodNonOptional",(e,t)=>{Q6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function N8(e,t){return new gR({type:"nonoptional",innerType:e,...De(t)})}const O8=de("ZodCatch",(e,t)=>{V6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function j8(e,t){return new O8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vR=de("ZodPipe",(e,t)=>{YE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SL(e,n,a,s),e.in=t.in,e.out=t.out});function bw(e,t){return new vR({type:"pipe",in:e,out:t})}const P8=de("ZodPreprocess",(e,t)=>{vR.init(e,t),G6.init(e,t)}),D8=de("ZodReadonly",(e,t)=>{Z6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function z8(e){return new D8({type:"readonly",innerType:e})}const L8=de("ZodLazy",(e,t)=>{K6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kL(e,n,a,s),e.unwrap=()=>e._zod.def.getter()});function vu(e){return new L8({type:"lazy",getter:e})}const Ib=de("ZodCustom",(e,t)=>{W6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sL(e,n)});function si(e,t){return $z(Ib,(()=>!0),t)}function q8(e,t={}){return Qz(Ib,e,t)}function B8(e,t){return Vz(e,t)}function $t(e,t={}){const n=new Ib({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 yR(e,t){return new P8({type:"pipe",in:fR(e),out:t})}const Tb={custom:"custom"};var F8=["f32le","pcmu","pcma"];function U8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=~t&255,a=(n&128)!==0?-1:1,s=n>>4&7;e[t]=a*((8*(n&15)+132<<s)-132)/32768}return e}function H8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=t^85,a=(n&128)!==0?1:-1,s=n>>4&7,p=n&15;e[t]=a*(s===0?16*p+8:16*p+264<<s-1)/32768}return e}U8();H8();var $8=[{id:"overview",label:"Overview",icon:"layout-dashboard",order:-10},{id:"general",label:"General",icon:"settings",order:0},{id:"image",label:"Image",icon:"image",order:5},{id:"light",label:"Light",icon:"lightbulb",order:7},{id:"motion",label:"Motion",icon:"activity",order:10},{id:"audio",label:"Audio",icon:"mic",order:12},{id:"alarms",label:"Alarms",icon:"bell-ring",order:13},{id:"snapshot",label:"Snapshot",icon:"camera",order:15},{id:"osd",label:"OSD",icon:"type",order:18},{id:"stream-broker",label:"Stream Broker",icon:"radio",order:20},{id:"streaming",label:"Streaming",icon:"video",order:35},{id:"ptz",label:"PTZ",icon:"move",order:40},{id:"navigation",label:"Navigation",icon:"compass",order:41},{id:"consumables",label:"Consumables",icon:"recycle",order:44},{id:"pipeline",label:"Detection Pipeline",icon:"cpu",order:39},{id:"detection-pipeline",label:"Detection pipeline",icon:"cpu",order:39},{id:"zones",label:"Detection",icon:"shapes",order:38},{id:"analytics",label:"Analytics",icon:"activity",order:37},{id:"live-stats",label:"Live Stats",icon:"activity",order:39},{id:"recording",label:"Recording",icon:"circle-dot",order:40},{id:"engine",label:"Inference Engine",icon:"zap",order:41},{id:"scheduler",label:"Scheduler",icon:"list-checks",order:42},{id:"decoder",label:"Decoder",icon:"film",order:43},{id:"notifications",label:"Notifications",icon:"bell",order:50},{id:"network",label:"Network",icon:"globe",order:60},{id:"storage",label:"Storage",icon:"hard-drive",order:70},{id:"advanced",label:"Advanced",icon:"wrench",order:100}];Object.fromEntries($8.map(e=>[e.id,e]));var Ht=N(["high","mid","low"]),Q8=tt([Ht,Q("auto")]),_b=N(["pull-rtsp","pull-rtmp","pull-http","pull-flv","pull-rfc4571","push-annexb","derived"]),kl=d({width:l().int().positive(),height:l().int().positive()}),$v=d({camStreamId:o().min(1),deviceId:l().int().nonnegative(),kind:_b,url:o().optional(),codec:o().optional(),resolution:kl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ht.optional(),metadata:Y(o(),J()).optional()}),Sp=N(["unassigned","idle","connecting","streaming","error"]),Qv=d({deviceId:l().int().nonnegative(),profile:Ht,brokerId:o(),sourceCamStreamId:o().nullable(),status:Sp,resolution:kl.optional(),codec:o().optional(),preBufferSec:l().nonnegative().optional(),errorMessage:o().optional()}),V8=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).readonly().optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:Ht.optional()});d({type:o(),url:o(),videoCodec:o().optional(),audioCodec:o().optional(),metadata:Y(o(),J()).readonly().optional()});var G8=d({type:N(["video","audio"]),data:$t(Uint8Array),pts:l(),dts:l(),keyframe:A(),codec:o()}),Sw=d({data:$t(Uint8Array),width:l(),height:l(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:l()}),rr=d({shmId:o(),slot:l().int().nonnegative(),seq:l().int().nonnegative(),width:l().int().positive(),height:l().int().positive(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),pts:l(),byteLength:l().int().nonnegative(),nodeId:o(),slotCount:l().int().positive()}),Z8=N(["rgb","bgr","yuv420","gray"]),K8=d({brokerId:o(),format:Z8,maxFps:l().positive().optional(),tag:o().optional()}),W8=d({subscriptionId:o(),maxFps:l().nonnegative()}),bR=N(F8),Y8=d({data:$t(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),timestamp:l(),format:bR.optional()}),X8=d({brokerId:o(),tag:o().optional(),accept:w(bR).readonly().optional()}),J8=d({subscriptionId:o()}),eq=N(["idle","connecting","streaming","error","stopped"]),tq=d({status:eq,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()}),nq=d({profile:Ht,brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:kl.optional()}),aq=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([Q(1),Q(2),Q(3),Q(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(dR())}),iq=d({id:o(),label:o(),icon:o(),order:l().optional()});d({tabs:w(iq).optional(),sections:w(aq)}).nullable();d({deviceId:l()}),d({deviceId:l()}),d({deviceId:l(),patch:Y(o(),J())}),d({success:Q(!0)});d({deviceId:l()}),J().nullable();function b(e,t,n){return{input:e,output:t,kind:n?.kind??"query",...n?.auth!==void 0?{auth:n.auth}:{},...n?.access!==void 0?{access:n.access}:{},...n?.caller!==void 0?{caller:n.caller}:{},timeoutMs:n?.timeoutMs}}function sg(e,t,n){return{...b(e,t,n),systemOnly:!0}}function Po(e){return{data:e}}var rq=d({staticDir:o()}),oq=d({version:o()}),sq={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(O(),rq,{auth:"admin"}),getVersion:b(O(),oq,{auth:"admin"})}},H=(function(e){return e.Camera="camera",e.Hub="hub",e.Light="light",e.Siren="siren",e.Switch="switch",e.Sensor="sensor",e.Thermostat="thermostat",e.Climate="climate",e.Button="button",e.EventEmitter="event-emitter",e.Update="update",e.Generic="generic",e.Notifier="notifier",e.Script="script",e.Automation="automation",e.Lock="lock",e.Cover="cover",e.Valve="valve",e.Humidifier="humidifier",e.WaterHeater="water-heater",e.Fan="fan",e.MediaPlayer="media-player",e.AlarmPanel="alarm-panel",e.Control="control",e.Presence="presence",e.Weather="weather",e.Vacuum="vacuum",e.LawnMower="lawn-mower",e.Container="container",e.Image="image",e.PetFeeder="pet-feeder",e})({}),ma=(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})({}),$e=(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})({}),lq=d({staticDir:o()}),cq=d({version:o()}),uq={name:"viewer-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(O(),lq,{auth:"admin"}),getVersion:b(O(),cq,{auth:"admin"})}},dq=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:Ht.optional(),sdp:o().optional()}),pq=d({key:o(),value:J()}),mq=d({source:o(),data:Y(o(),J())}),fq={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:b(d({deviceId:l()}),w(dq)),getConfigEntries:b(d({deviceId:l()}),w(pq)),setConfig:b(d({deviceId:l(),values:Y(o(),J())}),O(),{kind:"mutation"}),runAction:b(d({deviceId:l(),action:o().min(1),input:J()}),J(),{kind:"mutation"}),removeDevice:b(d({deviceId:l()}),O(),{kind:"mutation"}),getSettingsSchema:b(d({deviceId:l()}),J().nullable()),getRawState:b(d({deviceId:l()}),mq.nullable(),{auth:"protected"})}},hq="device.state-changed";function SR(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:hq},{onData:m=>{const h=m.data;if(!h||typeof h.deviceId!="number"||typeof h.capName!="string")return;const c=s(h.deviceId,h.capName);t.set(c,h.slice);const x=n.get(c);if(x)for(const M of x)try{M(h.slice)}catch{}}}))},f=()=>{a&&(n.size>0||(a.unsubscribe(),a=null))};return{read(m,h){return t.get(s(m,h))},async refresh(m,h){const c=await e.deviceState.getCapSlice.query({deviceId:m,capName:h}),x=s(m,h);t.set(x,c??void 0);const M=n.get(x);if(M)for(const C of M)try{C(c??void 0)}catch{}},watch(m,h,c){const x=s(m,h);let M=n.get(x);return M||(M=new Set,n.set(x,M)),M.add(c),p(),()=>{M.delete(c),M.size===0&&n.delete(x),f()}},async write(m,h,c){await e.deviceState.setCapSlice.mutate({deviceId:m,capName:h,slice:c})}}}function gq(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 Oe(e,t,n){const a=vq(e)?e:SR(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 vq(e){return typeof e.read=="function"&&typeof e.watch=="function"}function xR(e,t,n){const a=e,s=n?.stateSource??SR(e);function p(c,x){const M=typeof c=="object"&&c!==null?c:{};return x!==void 0?{...M,deviceId:t.deviceId,nodeId:x}:{...M,deviceId:t.deviceId}}function f(c,x,M,C,E){const R=a[c]?.[x];if(!R)throw new Error(`DeviceProxy: api has no '${c}.${x}'`);const _=R;return M==="mutation"?_.mutate(C):M==="subscription"?_.subscribe(C,E):_.query(C)}function m(c,x,M,C,E,R){return f(x,M,C,p(E,t.entries.find(_=>_.capName===c)?.providerNodeId),R)}function h(c,x,M,C,E){return f(c,x,M,p(C,void 0),E)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:Oe(s,t.deviceId,"air-quality-sensor"),alarmPanel:Oe(s,t.deviceId,"alarm-panel"),ambientLightSensor:Oe(s,t.deviceId,"ambient-light-sensor"),audioMetrics:Oe(s,t.deviceId,"audio-metrics"),automationControl:Oe(s,t.deviceId,"automation-control"),battery:Oe(s,t.deviceId,"battery"),binary:Oe(s,t.deviceId,"binary"),brightness:Oe(s,t.deviceId,"brightness"),cameraStreams:Oe(s,t.deviceId,"camera-streams"),carbonMonoxide:Oe(s,t.deviceId,"carbon-monoxide"),climateControl:Oe(s,t.deviceId,"climate-control"),color:Oe(s,t.deviceId,"color"),connectivity:Oe(s,t.deviceId,"connectivity"),consumables:Oe(s,t.deviceId,"consumables"),contact:Oe(s,t.deviceId,"contact"),control:Oe(s,t.deviceId,"control"),cover:Oe(s,t.deviceId,"cover"),dayNight:Oe(s,t.deviceId,"day-night"),deviceDiscovery:Oe(s,t.deviceId,"device-discovery"),deviceStatus:Oe(s,t.deviceId,"device-status"),doorbell:Oe(s,t.deviceId,"doorbell"),enumSensor:Oe(s,t.deviceId,"enum-sensor"),eventEmitter:Oe(s,t.deviceId,"event-emitter"),fanControl:Oe(s,t.deviceId,"fan-control"),featureProbe:Oe(s,t.deviceId,"feature-probe"),flood:Oe(s,t.deviceId,"flood"),gas:Oe(s,t.deviceId,"gas"),humidifier:Oe(s,t.deviceId,"humidifier"),humiditySensor:Oe(s,t.deviceId,"humidity-sensor"),image:Oe(s,t.deviceId,"image"),imageSettings:Oe(s,t.deviceId,"image-settings"),intercom:Oe(s,t.deviceId,"intercom"),lawnMowerControl:Oe(s,t.deviceId,"lawn-mower-control"),lockControl:Oe(s,t.deviceId,"lock-control"),mediaPlayer:Oe(s,t.deviceId,"media-player"),motion:Oe(s,t.deviceId,"motion"),motionTrigger:Oe(s,t.deviceId,"motion-trigger"),motionZones:Oe(s,t.deviceId,"motion-zones"),nativeObjectDetection:Oe(s,t.deviceId,"native-object-detection"),navigation:Oe(s,t.deviceId,"navigation"),networkLink:Oe(s,t.deviceId,"network-link"),notifier:Oe(s,t.deviceId,"notifier"),numericSensor:Oe(s,t.deviceId,"numeric-sensor"),petFeeder:Oe(s,t.deviceId,"pet-feeder"),powerMeter:Oe(s,t.deviceId,"power-meter"),presence:Oe(s,t.deviceId,"presence"),pressureSensor:Oe(s,t.deviceId,"pressure-sensor"),privacyMask:Oe(s,t.deviceId,"privacy-mask"),ptzAutotrack:Oe(s,t.deviceId,"ptz-autotrack"),recordingSignal:Oe(s,t.deviceId,"recording-signal"),sceneMonitor:Oe(s,t.deviceId,"scene-monitor"),scriptRunner:Oe(s,t.deviceId,"script-runner"),smoke:Oe(s,t.deviceId,"smoke"),streamCatalog:Oe(s,t.deviceId,"stream-catalog"),streamParams:Oe(s,t.deviceId,"stream-params"),streamSignals:Oe(s,t.deviceId,"stream-signals"),switch:Oe(s,t.deviceId,"switch"),tamper:Oe(s,t.deviceId,"tamper"),temperatureSensor:Oe(s,t.deviceId,"temperature-sensor"),update:Oe(s,t.deviceId,"update"),vacuumControl:Oe(s,t.deviceId,"vacuum-control"),valve:Oe(s,t.deviceId,"valve"),vibration:Oe(s,t.deviceId,"vibration"),waterHeater:Oe(s,t.deviceId,"water-heater"),weather:Oe(s,t.deviceId,"weather"),zoneAnalytics:Oe(s,t.deviceId,"zone-analytics"),zoneRules:Oe(s,t.deviceId,"zone-rules"),zones:Oe(s,t.deviceId,"zones")},accessories:{setChildHidden:c=>m("accessories","accessories","setChildHidden","mutation",c),getStatus:c=>m("accessories","accessories","getStatus","query",c)},airQualitySensor:{getStatus:c=>m("air-quality-sensor","airQualitySensor","getStatus","query",c)},alarmPanel:{arm:c=>m("alarm-panel","alarmPanel","arm","mutation",c),disarm:c=>m("alarm-panel","alarmPanel","disarm","mutation",c),trigger:c=>m("alarm-panel","alarmPanel","trigger","mutation",c),getStatus:c=>m("alarm-panel","alarmPanel","getStatus","query",c)},ambientLightSensor:{getStatus:c=>m("ambient-light-sensor","ambientLightSensor","getStatus","query",c)},audioAnalysis:{resolveDeviceSettings:c=>m("audio-analysis","audioAnalysis","resolveDeviceSettings","query",c),getDeviceSettingsContribution:c=>m("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",c)},audioMetrics:{getCurrentSnapshot:c=>m("audio-metrics","audioMetrics","getCurrentSnapshot","query",c),getHistory:c=>m("audio-metrics","audioMetrics","getHistory","query",c)},automationControl:{enable:c=>m("automation-control","automationControl","enable","mutation",c),disable:c=>m("automation-control","automationControl","disable","mutation",c),trigger:c=>m("automation-control","automationControl","trigger","mutation",c),getStatus:c=>m("automation-control","automationControl","getStatus","query",c)},battery:{wakeForStream:c=>m("battery","battery","wakeForStream","mutation",c),getStatus:c=>m("battery","battery","getStatus","query",c)},binary:{getStatus:c=>m("binary","binary","getStatus","query",c)},brightness:{setBrightness:c=>m("brightness","brightness","setBrightness","mutation",c),getStatus:c=>m("brightness","brightness","getStatus","query",c)},button:{press:c=>m("button","button","press","mutation",c)},cameraCredentials:{getCredentials:c=>m("camera-credentials","cameraCredentials","getCredentials","query",c),getStatus:c=>m("camera-credentials","cameraCredentials","getStatus","query",c)},cameraGridLayout:{getLayout:c=>m("camera-grid-layout","cameraGridLayout","getLayout","query",c),saveLayout:c=>m("camera-grid-layout","cameraGridLayout","saveLayout","mutation",c),getDeviceSettingsContribution:c=>m("camera-grid-layout","cameraGridLayout","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("camera-grid-layout","cameraGridLayout","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("camera-grid-layout","cameraGridLayout","applyDeviceSettingsPatch","mutation",c)},cameraStreams:{getCameraStreams:c=>m("camera-streams","cameraStreams","getCameraStreams","query",c),getBrokerStreams:c=>m("camera-streams","cameraStreams","getBrokerStreams","query",c),getRtspEntries:c=>m("camera-streams","cameraStreams","getRtspEntries","query",c),getProfileRtspEntries:c=>m("camera-streams","cameraStreams","getProfileRtspEntries","query",c),pickStream:c=>m("camera-streams","cameraStreams","pickStream","query",c)},carbonMonoxide:{getStatus:c=>m("carbon-monoxide","carbonMonoxide","getStatus","query",c)},climateControl:{setMode:c=>m("climate-control","climateControl","setMode","mutation",c),setFanMode:c=>m("climate-control","climateControl","setFanMode","mutation",c),setPreset:c=>m("climate-control","climateControl","setPreset","mutation",c),setTarget:c=>m("climate-control","climateControl","setTarget","mutation",c),setTargetRange:c=>m("climate-control","climateControl","setTargetRange","mutation",c),setTargetHumidity:c=>m("climate-control","climateControl","setTargetHumidity","mutation",c),setSwingVertical:c=>m("climate-control","climateControl","setSwingVertical","mutation",c),setSwingHorizontal:c=>m("climate-control","climateControl","setSwingHorizontal","mutation",c),getStatus:c=>m("climate-control","climateControl","getStatus","query",c)},color:{setColor:c=>m("color","color","setColor","mutation",c),getStatus:c=>m("color","color","getStatus","query",c)},connectivity:{getStatus:c=>m("connectivity","connectivity","getStatus","query",c)},consumables:{reset:c=>m("consumables","consumables","reset","mutation",c),getStatus:c=>m("consumables","consumables","getStatus","query",c)},contact:{getStatus:c=>m("contact","contact","getStatus","query",c)},control:{setValue:c=>m("control","control","setValue","mutation",c),getStatus:c=>m("control","control","getStatus","query",c)},cover:{open:c=>m("cover","cover","open","mutation",c),close:c=>m("cover","cover","close","mutation",c),stop:c=>m("cover","cover","stop","mutation",c),setPosition:c=>m("cover","cover","setPosition","mutation",c),setTiltPosition:c=>m("cover","cover","setTiltPosition","mutation",c),getStatus:c=>m("cover","cover","getStatus","query",c)},dayNight:{getOptions:c=>m("day-night","dayNight","getOptions","query",c),setSettings:c=>m("day-night","dayNight","setSettings","mutation",c),getStatus:c=>m("day-night","dayNight","getStatus","query",c)},detectionPipeline:{getDeviceSettingsContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",c)},deviceDiscovery:{listDiscovered:c=>m("device-discovery","deviceDiscovery","listDiscovered","query",c),refreshDiscovery:c=>m("device-discovery","deviceDiscovery","refreshDiscovery","mutation",c),adoptDevice:c=>m("device-discovery","deviceDiscovery","adoptDevice","mutation",c),releaseDevice:c=>m("device-discovery","deviceDiscovery","releaseDevice","mutation",c),getStatus:c=>m("device-discovery","deviceDiscovery","getStatus","query",c)},deviceOps:{getStreamSources:c=>m("device-ops","deviceOps","getStreamSources","query",c),getConfigEntries:c=>m("device-ops","deviceOps","getConfigEntries","query",c),setConfig:c=>m("device-ops","deviceOps","setConfig","mutation",c),runAction:c=>m("device-ops","deviceOps","runAction","mutation",c),removeDevice:c=>m("device-ops","deviceOps","removeDevice","mutation",c),getSettingsSchema:c=>m("device-ops","deviceOps","getSettingsSchema","query",c),getRawState:c=>m("device-ops","deviceOps","getRawState","query",c)},deviceStatus:{getStatus:c=>m("device-status","deviceStatus","getStatus","query",c)},doorbell:{getStatus:c=>m("doorbell","doorbell","getStatus","query",c),getDeviceSettingsContribution:c=>m("doorbell","doorbell","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("doorbell","doorbell","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("doorbell","doorbell","applyDeviceSettingsPatch","mutation",c)},enumSensor:{getStatus:c=>m("enum-sensor","enumSensor","getStatus","query",c)},eventEmitter:{getStatus:c=>m("event-emitter","eventEmitter","getStatus","query",c)},events:{getEvents:c=>m("events","events","getEvents","query",c),getEventThumbnail:c=>m("events","events","getEventThumbnail","query",c),getEventClipUrl:c=>m("events","events","getEventClipUrl","query",c)},fanControl:{setPercentage:c=>m("fan-control","fanControl","setPercentage","mutation",c),setPreset:c=>m("fan-control","fanControl","setPreset","mutation",c),setDirection:c=>m("fan-control","fanControl","setDirection","mutation",c),setOscillating:c=>m("fan-control","fanControl","setOscillating","mutation",c),getStatus:c=>m("fan-control","fanControl","getStatus","query",c)},featureProbe:{getStatus:c=>m("feature-probe","featureProbe","getStatus","query",c)},flood:{getStatus:c=>m("flood","flood","getStatus","query",c)},gas:{getStatus:c=>m("gas","gas","getStatus","query",c)},humidifier:{setOn:c=>m("humidifier","humidifier","setOn","mutation",c),setTargetHumidity:c=>m("humidifier","humidifier","setTargetHumidity","mutation",c),setMode:c=>m("humidifier","humidifier","setMode","mutation",c),getStatus:c=>m("humidifier","humidifier","getStatus","query",c)},humiditySensor:{getStatus:c=>m("humidity-sensor","humiditySensor","getStatus","query",c)},image:{getStatus:c=>m("image","image","getStatus","query",c)},imageSettings:{getOptions:c=>m("image-settings","imageSettings","getOptions","query",c),setSettings:c=>m("image-settings","imageSettings","setSettings","mutation",c),getStatus:c=>m("image-settings","imageSettings","getStatus","query",c)},intercom:{startSession:c=>m("intercom","intercom","startSession","mutation",c),handleAnswer:c=>m("intercom","intercom","handleAnswer","mutation",c),stopSession:c=>m("intercom","intercom","stopSession","mutation",c),startTalkSession:c=>m("intercom","intercom","startTalkSession","mutation",c),pushTalkAudio:c=>m("intercom","intercom","pushTalkAudio","mutation",c),endTalkSession:c=>m("intercom","intercom","endTalkSession","mutation",c),getStatus:c=>m("intercom","intercom","getStatus","query",c)},lawnMowerControl:{startMowing:c=>m("lawn-mower-control","lawnMowerControl","startMowing","mutation",c),pause:c=>m("lawn-mower-control","lawnMowerControl","pause","mutation",c),dock:c=>m("lawn-mower-control","lawnMowerControl","dock","mutation",c),getStatus:c=>m("lawn-mower-control","lawnMowerControl","getStatus","query",c)},lockControl:{lock:c=>m("lock-control","lockControl","lock","mutation",c),unlock:c=>m("lock-control","lockControl","unlock","mutation",c),open:c=>m("lock-control","lockControl","open","mutation",c),getStatus:c=>m("lock-control","lockControl","getStatus","query",c)},mediaPlayer:{play:c=>m("media-player","mediaPlayer","play","mutation",c),pause:c=>m("media-player","mediaPlayer","pause","mutation",c),stop:c=>m("media-player","mediaPlayer","stop","mutation",c),next:c=>m("media-player","mediaPlayer","next","mutation",c),previous:c=>m("media-player","mediaPlayer","previous","mutation",c),seek:c=>m("media-player","mediaPlayer","seek","mutation",c),setVolume:c=>m("media-player","mediaPlayer","setVolume","mutation",c),setMute:c=>m("media-player","mediaPlayer","setMute","mutation",c),setShuffle:c=>m("media-player","mediaPlayer","setShuffle","mutation",c),setRepeat:c=>m("media-player","mediaPlayer","setRepeat","mutation",c),selectSource:c=>m("media-player","mediaPlayer","selectSource","mutation",c),playMedia:c=>m("media-player","mediaPlayer","playMedia","mutation",c),getStatus:c=>m("media-player","mediaPlayer","getStatus","query",c)},motion:{isDetected:c=>m("motion","motion","isDetected","query",c),getStatus:c=>m("motion","motion","getStatus","query",c)},motionDetection:{analyze:c=>m("motion-detection","motionDetection","analyze","mutation",c),removeCamera:c=>m("motion-detection","motionDetection","removeCamera","mutation",c),reset:c=>m("motion-detection","motionDetection","reset","mutation",c),getDeviceSettingsContribution:c=>m("motion-detection","motionDetection","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("motion-detection","motionDetection","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",c)},motionTrigger:{setMotionTrigger:c=>m("motion-trigger","motionTrigger","setMotionTrigger","mutation",c),getStatus:c=>m("motion-trigger","motionTrigger","getStatus","query",c)},motionZones:{getOptions:c=>m("motion-zones","motionZones","getOptions","query",c),setZone:c=>m("motion-zones","motionZones","setZone","mutation",c),getStatus:c=>m("motion-zones","motionZones","getStatus","query",c)},nativeObjectDetection:{getOptions:c=>m("native-object-detection","nativeObjectDetection","getOptions","query",c),setSettings:c=>m("native-object-detection","nativeObjectDetection","setSettings","mutation",c),setEnabled:c=>m("native-object-detection","nativeObjectDetection","setEnabled","mutation",c),getStatus:c=>m("native-object-detection","nativeObjectDetection","getStatus","query",c)},navigation:{move:c=>m("navigation","navigation","move","mutation",c),stop:c=>m("navigation","navigation","stop","mutation",c),goToPoint:c=>m("navigation","navigation","goToPoint","mutation",c),listActions:c=>m("navigation","navigation","listActions","query",c),runAction:c=>m("navigation","navigation","runAction","mutation",c),playSound:c=>m("navigation","navigation","playSound","mutation",c),setLightOn:c=>m("navigation","navigation","setLightOn","mutation",c),setLightMode:c=>m("navigation","navigation","setLightMode","mutation",c),setLightLevel:c=>m("navigation","navigation","setLightLevel","mutation",c),getFeatures:c=>m("navigation","navigation","getFeatures","query",c),getStatus:c=>m("navigation","navigation","getStatus","query",c)},networkLink:{getStatus:c=>m("network-link","networkLink","getStatus","query",c)},notificationRules:{listRules:c=>m("notification-rules","notificationRules","listRules","query",c),getRule:c=>m("notification-rules","notificationRules","getRule","query",c),createRule:c=>m("notification-rules","notificationRules","createRule","mutation",c),updateRule:c=>m("notification-rules","notificationRules","updateRule","mutation",c),deleteRule:c=>m("notification-rules","notificationRules","deleteRule","mutation",c),setRuleEnabled:c=>m("notification-rules","notificationRules","setRuleEnabled","mutation",c),getClipRetentionAsks:c=>m("notification-rules","notificationRules","getClipRetentionAsks","query",c),listDeviceMutes:c=>m("notification-rules","notificationRules","listDeviceMutes","query",c),setDeviceMuted:c=>m("notification-rules","notificationRules","setDeviceMuted","mutation",c),testRule:c=>m("notification-rules","notificationRules","testRule","mutation",c),getConditionCatalog:c=>m("notification-rules","notificationRules","getConditionCatalog","query",c),getHistory:c=>m("notification-rules","notificationRules","getHistory","query",c),resolveArtifactUrl:c=>m("notification-rules","notificationRules","resolveArtifactUrl","query",c),listSnoozes:c=>m("notification-rules","notificationRules","listSnoozes","query",c),createSnooze:c=>m("notification-rules","notificationRules","createSnooze","mutation",c),cancelSnooze:c=>m("notification-rules","notificationRules","cancelSnooze","mutation",c),getAlarmConfig:c=>m("notification-rules","notificationRules","getAlarmConfig","query",c),setAlarmConfig:c=>m("notification-rules","notificationRules","setAlarmConfig","mutation",c)},notifier:{send:c=>m("notifier","notifier","send","mutation",c),cancel:c=>m("notifier","notifier","cancel","mutation",c),getStatus:c=>m("notifier","notifier","getStatus","query",c)},numericSensor:{getStatus:c=>m("numeric-sensor","numericSensor","getStatus","query",c)},osd:{setOverlay:c=>m("osd","osd","setOverlay","mutation",c),getStatus:c=>m("osd","osd","getStatus","query",c)},petFeeder:{feed:c=>m("pet-feeder","petFeeder","feed","mutation",c),cancelFeed:c=>m("pet-feeder","petFeeder","cancelFeed","mutation",c),resetDesiccant:c=>m("pet-feeder","petFeeder","resetDesiccant","mutation",c),markFoodReplenished:c=>m("pet-feeder","petFeeder","markFoodReplenished","mutation",c),callPet:c=>m("pet-feeder","petFeeder","callPet","mutation",c),playSound:c=>m("pet-feeder","petFeeder","playSound","mutation",c),setChildLock:c=>m("pet-feeder","petFeeder","setChildLock","mutation",c),setIndicatorLight:c=>m("pet-feeder","petFeeder","setIndicatorLight","mutation",c),setFeedSound:c=>m("pet-feeder","petFeeder","setFeedSound","mutation",c),setVolume:c=>m("pet-feeder","petFeeder","setVolume","mutation",c),getStatus:c=>m("pet-feeder","petFeeder","getStatus","query",c)},pipelineAnalytics:{getActiveTracks:c=>m("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",c),getTrack:c=>m("pipeline-analytics","pipelineAnalytics","getTrack","query",c),listTracks:c=>m("pipeline-analytics","pipelineAnalytics","listTracks","query",c),listRecentTracks:c=>m("pipeline-analytics","pipelineAnalytics","listRecentTracks","query",c),listSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listSummaries","query",c),listRecentSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listRecentSummaries","query",c),getSummary:c=>m("pipeline-analytics","pipelineAnalytics","getSummary","query",c),clearTracks:c=>m("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",c),getMotionEvents:c=>m("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",c),getObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",c),getAudioEvents:c=>m("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",c),listEventKinds:c=>m("pipeline-analytics","pipelineAnalytics","listEventKinds","query",c),listEventKindsBatch:c=>m("pipeline-analytics","pipelineAnalytics","listEventKindsBatch","query",c),getSensorEvents:c=>m("pipeline-analytics","pipelineAnalytics","getSensorEvents","query",c),getKeyEvents:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEvents","query",c),getKeyEventsBatch:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEventsBatch","query",c),readLongTermSeries:c=>m("pipeline-analytics","pipelineAnalytics","readLongTermSeries","query",c),getEventDensity:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensity","query",c),getEventDensityBatch:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensityBatch","query",c),pruneEventsBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",c),pruneTracksBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneTracksBefore","mutation",c),wipeAllAnalytics:c=>m("pipeline-analytics","pipelineAnalytics","wipeAllAnalytics","mutation",c),reconcileFromDisk:c=>m("pipeline-analytics","pipelineAnalytics","reconcileFromDisk","mutation",c),deleteTracks:c=>m("pipeline-analytics","pipelineAnalytics","deleteTracks","mutation",c),setTrackFlags:c=>m("pipeline-analytics","pipelineAnalytics","setTrackFlags","mutation",c),listArchivedDebugNotes:c=>m("pipeline-analytics","pipelineAnalytics","listArchivedDebugNotes","query",c),listBirthDecisions:c=>m("pipeline-analytics","pipelineAnalytics","listBirthDecisions","query",c),getEventStoreFootprint:c=>m("pipeline-analytics","pipelineAnalytics","getEventStoreFootprint","query",c),getEventMediaFootprintByKind:c=>m("pipeline-analytics","pipelineAnalytics","getEventMediaFootprintByKind","query",c),pruneEvents:c=>m("pipeline-analytics","pipelineAnalytics","pruneEvents","mutation",c),deleteDeviceEvents:c=>m("pipeline-analytics","pipelineAnalytics","deleteDeviceEvents","mutation",c),pauseForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","pauseForStorageMigration","mutation",c),resumeForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","resumeForStorageMigration","mutation",c),refreshStorageLocationsForMigration:c=>m("pipeline-analytics","pipelineAnalytics","refreshStorageLocationsForMigration","mutation",c),startStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","startStorageMigrationMove","mutation",c),getStorageMigrationMoveStatus:c=>m("pipeline-analytics","pipelineAnalytics","getStorageMigrationMoveStatus","query",c),cancelStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","cancelStorageMigrationMove","mutation",c),relocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","relocateMedia","mutation",c),countUnstampedEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","countUnstampedEventMedia","query",c),countRelocatableMedia:c=>m("pipeline-analytics","pipelineAnalytics","countRelocatableMedia","query",c),listRelocateMediaJobs:c=>m("pipeline-analytics","pipelineAnalytics","listRelocateMediaJobs","query",c),cancelRelocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","cancelRelocateMedia","mutation",c),listOpsLog:c=>m("pipeline-analytics","pipelineAnalytics","listOpsLog","query",c),reclaimDebugMedia:c=>m("pipeline-analytics","pipelineAnalytics","reclaimDebugMedia","mutation",c),getMediaReclaimStatus:c=>m("pipeline-analytics","pipelineAnalytics","getMediaReclaimStatus","query",c),getTrainingExportSummary:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportSummary","query",c),getTrainingExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportUrl","query",c),listRetrainStaging:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainStaging","query",c),listRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainFrames","query",c),selectRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","selectRetrainFrames","mutation",c),deselectRetrainFrame:c=>m("pipeline-analytics","pipelineAnalytics","deselectRetrainFrame","mutation",c),getRetrainFrameImage:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainFrameImage","query",c),proposeRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","proposeRetrainAnnotations","mutation",c),runReplayFrameProcessor:c=>m("pipeline-analytics","pipelineAnalytics","runReplayFrameProcessor","mutation",c),listRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainAnnotations","query",c),saveRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","saveRetrainAnnotations","mutation",c),completeRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","completeRetrainTrack","mutation",c),restageRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","restageRetrainTrack","mutation",c),getRetrainExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainExportUrl","query",c),getEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","getEventMedia","query",c),getTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",c),listTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","listTrackMedia","query",c),listEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","listEventMedia","query",c),searchObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","searchObjectEvents","query",c),wipeObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","wipeObjectEmbeddings","mutation",c),rebuildObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","rebuildObjectEmbeddings","mutation",c),getObjectEmbeddingRebuildStatus:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEmbeddingRebuildStatus","query",c),getDeviceSettingsContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",c)},powerMeter:{getStatus:c=>m("power-meter","powerMeter","getStatus","query",c)},presence:{getStatus:c=>m("presence","presence","getStatus","query",c)},pressureSensor:{getStatus:c=>m("pressure-sensor","pressureSensor","getStatus","query",c)},privacyMask:{getOptions:c=>m("privacy-mask","privacyMask","getOptions","query",c),setMask:c=>m("privacy-mask","privacyMask","setMask","mutation",c),setAudioEnabled:c=>m("privacy-mask","privacyMask","setAudioEnabled","mutation",c),getStatus:c=>m("privacy-mask","privacyMask","getStatus","query",c)},ptz:{move:c=>m("ptz","ptz","move","mutation",c),continuousMove:c=>m("ptz","ptz","continuousMove","mutation",c),stop:c=>m("ptz","ptz","stop","mutation",c),getPresets:c=>m("ptz","ptz","getPresets","query",c),goToPreset:c=>m("ptz","ptz","goToPreset","mutation",c),savePreset:c=>m("ptz","ptz","savePreset","mutation",c),deletePreset:c=>m("ptz","ptz","deletePreset","mutation",c),getOptions:c=>m("ptz","ptz","getOptions","query",c),goHome:c=>m("ptz","ptz","goHome","mutation",c),getHomePreset:c=>m("ptz","ptz","getHomePreset","query",c),setHomePreset:c=>m("ptz","ptz","setHomePreset","mutation",c),captureHomeHere:c=>m("ptz","ptz","captureHomeHere","mutation",c),getHomeReturn:c=>m("ptz","ptz","getHomeReturn","query",c),setHomeReturn:c=>m("ptz","ptz","setHomeReturn","mutation",c),getPosition:c=>m("ptz","ptz","getPosition","query",c),setAutofocus:c=>m("ptz","ptz","setAutofocus","mutation",c),getStatus:c=>m("ptz","ptz","getStatus","query",c)},ptzAutotrack:{getStatus:c=>m("ptz-autotrack","ptzAutotrack","getStatus","query",c),setEnabled:c=>m("ptz-autotrack","ptzAutotrack","setEnabled","mutation",c),getSettings:c=>m("ptz-autotrack","ptzAutotrack","getSettings","query",c),setSettings:c=>m("ptz-autotrack","ptzAutotrack","setSettings","mutation",c)},reboot:{reboot:c=>m("reboot","reboot","reboot","mutation",c)},recordingSignal:{getStatus:c=>m("recording-signal","recordingSignal","getStatus","query",c)},sceneMonitor:{listScenes:c=>m("scene-monitor","sceneMonitor","listScenes","query",c),listScenesBatch:c=>m("scene-monitor","sceneMonitor","listScenesBatch","query",c),createScene:c=>m("scene-monitor","sceneMonitor","createScene","mutation",c),updateScene:c=>m("scene-monitor","sceneMonitor","updateScene","mutation",c),deleteScene:c=>m("scene-monitor","sceneMonitor","deleteScene","mutation",c),captureReference:c=>m("scene-monitor","sceneMonitor","captureReference","mutation",c),deleteReference:c=>m("scene-monitor","sceneMonitor","deleteReference","mutation",c),recheckNow:c=>m("scene-monitor","sceneMonitor","recheckNow","mutation",c),resetScene:c=>m("scene-monitor","sceneMonitor","resetScene","mutation",c),getStatus:c=>m("scene-monitor","sceneMonitor","getStatus","query",c)},scriptRunner:{run:c=>m("script-runner","scriptRunner","run","mutation",c),stop:c=>m("script-runner","scriptRunner","stop","mutation",c),getStatus:c=>m("script-runner","scriptRunner","getStatus","query",c)},smoke:{getStatus:c=>m("smoke","smoke","getStatus","query",c)},snapshot:{getSnapshot:c=>m("snapshot","snapshot","getSnapshot","query",c),invalidateCache:c=>m("snapshot","snapshot","invalidateCache","mutation",c),getSnapshotOverview:c=>m("snapshot","snapshot","getSnapshotOverview","query",c),getDebugState:c=>m("snapshot","snapshot","getDebugState","query",c),getSnapshotLinks:c=>m("snapshot","snapshot","getSnapshotLinks","query",c),getStatus:c=>m("snapshot","snapshot","getStatus","query",c),getDeviceSettingsContribution:c=>m("snapshot","snapshot","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("snapshot","snapshot","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("snapshot","snapshot","applyDeviceSettingsPatch","mutation",c)},streamCatalog:{getCatalog:c=>m("stream-catalog","streamCatalog","getCatalog","query",c)},streamParams:{getOptions:c=>m("stream-params","streamParams","getOptions","query",c),setProfile:c=>m("stream-params","streamParams","setProfile","mutation",c),getConfigSchema:c=>m("stream-params","streamParams","getConfigSchema","query",c),getStatus:c=>m("stream-params","streamParams","getStatus","query",c)},streamSignals:{listSignals:c=>m("stream-signals","streamSignals","listSignals","query",c)},switch:{setState:c=>m("switch","switch","setState","mutation",c),getStatus:c=>m("switch","switch","getStatus","query",c)},tamper:{getStatus:c=>m("tamper","tamper","getStatus","query",c)},temperatureSensor:{getStatus:c=>m("temperature-sensor","temperatureSensor","getStatus","query",c)},update:{installUpdate:c=>m("update","update","installUpdate","mutation",c),getStatus:c=>m("update","update","getStatus","query",c)},vacuumControl:{start:c=>m("vacuum-control","vacuumControl","start","mutation",c),pause:c=>m("vacuum-control","vacuumControl","pause","mutation",c),stop:c=>m("vacuum-control","vacuumControl","stop","mutation",c),returnToBase:c=>m("vacuum-control","vacuumControl","returnToBase","mutation",c),locate:c=>m("vacuum-control","vacuumControl","locate","mutation",c),setFanSpeed:c=>m("vacuum-control","vacuumControl","setFanSpeed","mutation",c),getStatus:c=>m("vacuum-control","vacuumControl","getStatus","query",c)},valve:{open:c=>m("valve","valve","open","mutation",c),close:c=>m("valve","valve","close","mutation",c),stop:c=>m("valve","valve","stop","mutation",c),setPosition:c=>m("valve","valve","setPosition","mutation",c),getStatus:c=>m("valve","valve","getStatus","query",c)},vibration:{getStatus:c=>m("vibration","vibration","getStatus","query",c)},videoclips:{listClips:c=>m("videoclips","videoclips","listClips","query",c),getClipPlayback:c=>m("videoclips","videoclips","getClipPlayback","query",c)},waterHeater:{setTargetTemp:c=>m("water-heater","waterHeater","setTargetTemp","mutation",c),setOperationMode:c=>m("water-heater","waterHeater","setOperationMode","mutation",c),setAway:c=>m("water-heater","waterHeater","setAway","mutation",c),getStatus:c=>m("water-heater","waterHeater","getStatus","query",c)},weather:{getStatus:c=>m("weather","weather","getStatus","query",c)},webrtcSession:{listStreams:c=>m("webrtc-session","webrtcSession","listStreams","query",c),createSession:c=>m("webrtc-session","webrtcSession","createSession","mutation",c),handleOffer:c=>m("webrtc-session","webrtcSession","handleOffer","mutation",c),handleAnswer:c=>m("webrtc-session","webrtcSession","handleAnswer","mutation",c),addIceCandidate:c=>m("webrtc-session","webrtcSession","addIceCandidate","mutation",c),getIceCandidates:c=>m("webrtc-session","webrtcSession","getIceCandidates","query",c),closeSession:c=>m("webrtc-session","webrtcSession","closeSession","mutation",c),hasAdaptiveBitrate:c=>m("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",c),getSessionState:c=>m("webrtc-session","webrtcSession","getSessionState","query",c),getSessionDebug:c=>m("webrtc-session","webrtcSession","getSessionDebug","query",c)},zoneAnalytics:{getCurrentSnapshot:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",c),getCurrentSnapshotBatch:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshotBatch","query",c),getZoneHistory:c=>m("zone-analytics","zoneAnalytics","getZoneHistory","query",c),getCameraHistory:c=>m("zone-analytics","zoneAnalytics","getCameraHistory","query",c),getUnzonedHistory:c=>m("zone-analytics","zoneAnalytics","getUnzonedHistory","query",c)},zoneRules:{listRules:c=>m("zone-rules","zoneRules","listRules","query",c),setRules:c=>m("zone-rules","zoneRules","setRules","mutation",c)},zones:{listZones:c=>m("zones","zones","listZones","query",c),addZone:c=>m("zones","zones","addZone","mutation",c),removeZone:c=>m("zones","zones","removeZone","mutation",c),updateZone:c=>m("zones","zones","updateZone","mutation",c)},addonSettings:{getDeviceSettings:c=>h("addonSettings","getDeviceSettings","query",c),updateDeviceSettings:c=>h("addonSettings","updateDeviceSettings","mutation",c)},audioAnalyzer:{detachDevice:c=>h("audioAnalyzer","detachDevice","mutation",c)},cameraPipelineConfig:{getDeviceSettingsContribution:c=>h("cameraPipelineConfig","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("cameraPipelineConfig","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("cameraPipelineConfig","applyDeviceSettingsPatch","mutation",c)},deviceAdoption:{getStatus:c=>h("deviceAdoption","getStatus","query",c)},deviceExport:{getDeviceSettingsContribution:c=>h("deviceExport","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceExport","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceExport","applyDeviceSettingsPatch","mutation",c)},deviceManager:{loadConfig:c=>h("deviceManager","loadConfig","query",c),loadRuntimeState:c=>h("deviceManager","loadRuntimeState","query",c),loadMeta:c=>h("deviceManager","loadMeta","query",c),setName:c=>h("deviceManager","setName","mutation",c),setLocation:c=>h("deviceManager","setLocation","mutation",c),setType:c=>h("deviceManager","setType","mutation",c),setIntegrationId:c=>h("deviceManager","setIntegrationId","mutation",c),setLinkDeviceId:c=>h("deviceManager","setLinkDeviceId","mutation",c),setPrimaryChildEntityId:c=>h("deviceManager","setPrimaryChildEntityId","mutation",c),setChildLayout:c=>h("deviceManager","setChildLayout","mutation",c),setDisplay:c=>h("deviceManager","setDisplay","mutation",c),getWireableFields:c=>h("deviceManager","getWireableFields","query",c),setRole:c=>h("deviceManager","setRole","mutation",c),applyInitialMeta:c=>h("deviceManager","applyInitialMeta","mutation",c),setMetadata:c=>h("deviceManager","setMetadata","mutation",c),setDisabled:c=>h("deviceManager","setDisabled","mutation",c),getDevice:c=>h("deviceManager","getDevice","query",c),getLinkedDevices:c=>h("deviceManager","getLinkedDevices","query",c),getStreamSources:c=>h("deviceManager","getStreamSources","query",c),getConfigSchema:c=>h("deviceManager","getConfigSchema","query",c),getSettingsSchema:c=>h("deviceManager","getSettingsSchema","query",c),updateConfig:c=>h("deviceManager","updateConfig","mutation",c),enable:c=>h("deviceManager","enable","mutation",c),disable:c=>h("deviceManager","disable","mutation",c),remove:c=>h("deviceManager","remove","mutation",c),getStreamProfileMap:c=>h("deviceManager","getStreamProfileMap","query",c),setStreamProfileMap:c=>h("deviceManager","setStreamProfileMap","mutation",c),probeStreams:c=>h("deviceManager","probeStreams","mutation",c),getBindings:c=>h("deviceManager","getBindings","query",c),setWrapperActive:c=>h("deviceManager","setWrapperActive","mutation",c),getDeviceSettingsAggregate:c=>h("deviceManager","getDeviceSettingsAggregate","query",c),getDeviceLiveInfoAggregate:c=>h("deviceManager","getDeviceLiveInfoAggregate","query",c),getDeviceAggregate:c=>h("deviceManager","getDeviceAggregate","query",c),runDeviceAction:c=>h("deviceManager","runDeviceAction","mutation",c),updateDeviceField:c=>h("deviceManager","updateDeviceField","mutation",c),updateDeviceFieldsBatch:c=>h("deviceManager","updateDeviceFieldsBatch","mutation",c),testField:c=>h("deviceManager","testField","mutation",c),getDeviceStatusAggregate:c=>h("deviceManager","getDeviceStatusAggregate","query",c),getDeviceSettingsContribution:c=>h("deviceManager","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceManager","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceManager","applyDeviceSettingsPatch","mutation",c)},deviceProvider:{reloadDevice:c=>h("deviceProvider","reloadDevice","mutation",c)},deviceState:{getSnapshot:c=>h("deviceState","getSnapshot","query",c),getCapSlice:c=>h("deviceState","getCapSlice","query",c),setCapSlice:c=>h("deviceState","setCapSlice","mutation",c)},faceGallery:{listRecentFaces:c=>h("faceGallery","listRecentFaces","query",c),getFaceByTrack:c=>h("faceGallery","getFaceByTrack","query",c)},networkQuality:{getDeviceStats:c=>h("networkQuality","getDeviceStats","query",c),reportClientStats:c=>h("networkQuality","reportClientStats","mutation",c)},osdManager:{getDeviceOsd:c=>h("osdManager","getDeviceOsd","query",c),getSourceCatalog:c=>h("osdManager","getSourceCatalog","query",c),setSlotBinding:c=>h("osdManager","setSlotBinding","mutation",c),clearSlotBinding:c=>h("osdManager","clearSlotBinding","mutation",c),previewSlot:c=>h("osdManager","previewSlot","mutation",c),renderDevice:c=>h("osdManager","renderDevice","mutation",c)},pipelineExecutor:{runPipeline:c=>h("pipelineExecutor","runPipeline","mutation",c),runPipelineBatch:c=>h("pipelineExecutor","runPipelineBatch","mutation",c)},pipelineOrchestrator:{assignPipeline:c=>h("pipelineOrchestrator","assignPipeline","mutation",c),unassignPipeline:c=>h("pipelineOrchestrator","unassignPipeline","mutation",c),setPipelineDevicePin:c=>h("pipelineOrchestrator","setPipelineDevicePin","mutation",c),getPipelineDevicePin:c=>h("pipelineOrchestrator","getPipelineDevicePin","query",c),getPipelineAssignment:c=>h("pipelineOrchestrator","getPipelineAssignment","query",c),getCameraMetrics:c=>h("pipelineOrchestrator","getCameraMetrics","query",c),assignAudio:c=>h("pipelineOrchestrator","assignAudio","mutation",c),unassignAudio:c=>h("pipelineOrchestrator","unassignAudio","mutation",c),getAudioAssignment:c=>h("pipelineOrchestrator","getAudioAssignment","query",c),getAudioAssignments:c=>h("pipelineOrchestrator","getAudioAssignments","query",c),getCameraSettings:c=>h("pipelineOrchestrator","getCameraSettings","query",c),setCameraStepToggle:c=>h("pipelineOrchestrator","setCameraStepToggle","mutation",c),getCameraStepOverrides:c=>h("pipelineOrchestrator","getCameraStepOverrides","query",c),setCameraStepOverride:c=>h("pipelineOrchestrator","setCameraStepOverride","mutation",c),setCameraPipelineForAgent:c=>h("pipelineOrchestrator","setCameraPipelineForAgent","mutation",c),resolvePipeline:c=>h("pipelineOrchestrator","resolvePipeline","query",c),getCameraSwitches:c=>h("pipelineOrchestrator","getCameraSwitches","query",c),setCameraSwitch:c=>h("pipelineOrchestrator","setCameraSwitch","mutation",c),getCameraStatus:c=>h("pipelineOrchestrator","getCameraStatus","query",c),getDeviceSettingsContribution:c=>h("pipelineOrchestrator","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("pipelineOrchestrator","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",c)},pipelineRunner:{detachCamera:c=>h("pipelineRunner","detachCamera","mutation",c),getCameraMetrics:c=>h("pipelineRunner","getCameraMetrics","query",c),requestOccupancyBurst:c=>h("pipelineRunner","requestOccupancyBurst","mutation",c),runDetailSubtree:c=>h("pipelineRunner","runDetailSubtree","mutation",c),parkTrackFrame:c=>h("pipelineRunner","parkTrackFrame","mutation",c),getParkedTrackFrame:c=>h("pipelineRunner","getParkedTrackFrame","query",c),releaseParkedTrackFrames:c=>h("pipelineRunner","releaseParkedTrackFrames","mutation",c)},plateGallery:{listPlates:c=>h("plateGallery","listPlates","query",c),getPlateByTrack:c=>h("plateGallery","getPlateByTrack","query",c)},recording:{getAvailability:c=>h("recording","getAvailability","query",c),getDaysWithRecordings:c=>h("recording","getDaysWithRecordings","query",c),getPlaybackManifest:c=>h("recording","getPlaybackManifest","query",c),getDeviceConfig:c=>h("recording","getDeviceConfig","query",c),locateSegment:c=>h("recording","locateSegment","query",c),readSegmentBytes:c=>h("recording","readSegmentBytes","query",c),readGopBytes:c=>h("recording","readGopBytes","query",c),readWindowBytes:c=>h("recording","readWindowBytes","query",c),setDeviceConfig:c=>h("recording","setDeviceConfig","mutation",c),rescanStorage:c=>h("recording","rescanStorage","mutation",c),pruneFootage:c=>h("recording","pruneFootage","mutation",c),deleteFootprint:c=>h("recording","deleteFootprint","mutation",c),renderGif:c=>h("recording","renderGif","mutation",c),renderClip:c=>h("recording","renderClip","mutation",c),getStatus:c=>h("recording","getStatus","query",c),getDeviceSettingsContribution:c=>h("recording","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("recording","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("recording","applyDeviceSettingsPatch","mutation",c)},recordingExport:{listExports:c=>h("recordingExport","listExports","query",c)},streamBroker:{reportStreamSignal:c=>h("streamBroker","reportStreamSignal","mutation",c),publishCameraStream:c=>h("streamBroker","publishCameraStream","mutation",c),retractCameraStream:c=>h("streamBroker","retractCameraStream","mutation",c),assignProfile:c=>h("streamBroker","assignProfile","mutation",c),unassignProfile:c=>h("streamBroker","unassignProfile","mutation",c),forgetDeviceHardware:c=>h("streamBroker","forgetDeviceHardware","mutation",c),renderPreBufferClip:c=>h("streamBroker","renderPreBufferClip","mutation",c),produceEventMedia:c=>h("streamBroker","produceEventMedia","mutation",c),restartProfile:c=>h("streamBroker","restartProfile","mutation",c),getDeviceAudioMute:c=>h("streamBroker","getDeviceAudioMute","query",c),setDeviceAudioMute:c=>h("streamBroker","setDeviceAudioMute","mutation",c),getDeviceSettingsContribution:c=>h("streamBroker","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("streamBroker","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("streamBroker","applyDeviceSettingsPatch","mutation",c)}}}var yq=["track","summary","face","identity","plate","vehicle","scene","motion","object","audio","mosaic"];new Set(yq);var kR=["motion","object","audio"],xw=N(kR);new Set(kR);var bq=d({codec:N(["h264","h265","copy"]),profile:N(["baseline","main","high"]).optional(),level:o().optional(),width:l().int().positive().optional(),height:l().int().positive().optional(),fps:l().positive().optional(),bitrateKbps:l().int().positive().optional(),gopFrames:l().int().positive().optional(),bf:l().int().min(0).optional(),preset:N(["ultrafast","superfast","veryfast","faster","fast","medium"]).optional(),tune:N(["zerolatency","film","animation"]).optional(),singleSlicePerFrame:A().optional()}),Sq=tt([Q("passthrough"),d({codec:N(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:l().int().positive().optional(),sampleRateHz:l().int().positive().optional(),channels:tt([Q(1),Q(2)]).optional()})]),wR=d({video:bq,audio:Sq,inputArgs:w(o()).optional(),outputArgs:w(o()).optional()}),MR={video:{codec:"h264",profile:"baseline",level:"3.1",width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:"veryfast",tune:"zerolatency"}};({...MR.video});({...MR.video});var xq=N(["singleton","device","widget"]),kw=d({capName:o(),kind:xq,deviceId:l().optional(),reachable:A(),latencyMs:l(),error:o().optional()}),kq=d({addonId:o(),caps:w(kw).readonly(),widgets:w(kw).readonly()}),wq=d({nodeId:o(),addons:w(kq).readonly()});d({ok:A(),degraded:A(),checkedAt:o(),nodes:w(wq).readonly(),summary:d({total:l(),reachable:l(),unreachable:l()})});var Mq=N(["running","done","failed","cancelled"]),Cq=N(["adopted","already-adopted","failed","cancelled"]),Aq=d({childNativeId:o(),outcome:Cq,parentDeviceId:l().int().nonnegative().nullable(),accessoryCount:l().int().nonnegative(),error:o().nullable()}),Eq=d({jobId:o(),addonId:o(),integrationId:o(),state:Mq,total:l().int().nonnegative(),processed:l().int().nonnegative(),adopted:l().int().nonnegative(),alreadyAdopted:l().int().nonnegative(),failed:l().int().nonnegative(),accessoriesCreated:l().int().nonnegative(),currentChildNativeId:o().nullable(),results:w(Aq).readonly(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),yu=N(["stream-broker","object-detection","privacy-mask","device-audio","broker-audio","audio-analysis","recording","notifications"]),Rq=wt("kind",[d({kind:Q("device-disabled")}),d({kind:Q("wrapper-binding"),capName:o()}),d({kind:Q("recording-config")}),d({kind:Q("notification-mute")}),d({kind:Q("camera-audio"),capName:o()}),d({kind:Q("camera-mask"),capName:o()}),d({kind:Q("broker-audio-mute")})]),Iq=N(["no-provider","source-unreachable","not-configured","device-disabled"]),Tq=d({id:yu,label:o(),costWhenOff:o(),available:A(),unavailableReason:Iq.optional(),enabled:A(),authority:Rq}),ww=d({deviceId:l().int(),switches:w(Tq).readonly(),fetchedAt:l()}),CR=N(["confirmed","suppressed","exhausted-fallback"]),_q=d({id:o(),at:l().int(),deviceId:l().int(),sourceTrackId:o(),className:o(),verdict:CR,reason:o().nullable(),attempts:l().int(),deferredForMs:l().int(),decidedOnCoastedFrame:A(),birthEvidenceAvailable:A(),decidedByBirthEvidence:A(),bestScore:l().nullable(),appliedMinConfidence:l().nullable(),firstSeen:l().int().nullable(),motionOnsetAt:l().int().nullable(),birthLatencyMs:l().int().nullable(),birthIndexInBurst:l().int().nullable()}),Nq=d({deviceId:l().int().optional(),since:l().int().optional(),verdict:CR.optional(),limit:l().int().min(1).max(5e3).optional()}),Oq=d({id:o(),note:o(),deviceId:l().int(),sourceTrackId:o(),archivedAt:l().int(),trackStartedAt:l().int().nullable(),trackClass:o().nullable(),trackLabel:o().nullable()}),jq=d({deviceId:l().int().optional(),limit:l().int().min(1).max(1e3).optional()}),Pq=N(["recording","events"]),Dq=N(["prune","manual-delete","rescan","retention-run","relocate","orphan-audit"]),Nb=N(["retention","quota","manual","operator","maintenance","orphaned-device"]),AR=d({id:o(),at:l(),domain:Pq,op:Dq,reason:Nb,deviceId:l().nullable(),nodeId:o(),itemsAffected:l(),bytesReclaimed:l(),detail:o().nullable(),actor:o()}),ER=d({deviceId:l().optional(),limit:l().int().min(1).max(1e3).optional()}),RR=d({id:o(),name:o(),category:o().optional(),description:o().optional(),icon:o().optional()}),zq=["person","vehicle","animal","package"],Lq=["person","vehicle","animal"],IR=d({mapping:Y(o(),N(zq)),preserveOriginal:A()}),qq=l().int().min(0).max(6),Mw=/^([01]\d|2[0-3]):[0-5]\d$/,Ob=N(["off","events","continuous","on-device-decision"]),Bq=N(Lq),Cw=e=>new Set(e).size===e.length,Fq=d({motion:A().optional(),audioThresholdDbfs:l().optional(),objectClasses:w(Bq).min(1).refine(Cw,{message:"objectClasses must not repeat a class"}).optional(),sensorDeviceIds:w(l().int().positive()).min(1).max(16).refine(Cw,{message:"sensorDeviceIds must not repeat a device"}).optional()}),Uq=N(["continuous","events"]),Hq=Fq,$q=d({days:w(qq),start:o().regex(Mw),end:o().regex(Mw),mode:Uq,triggers:Hq.optional(),preBufferSec:l().min(0).optional(),postBufferSec:l().min(0).optional()}),Qq=d({maxAgeDays:l().min(0).optional(),maxSizeGb:l().min(0).optional()}),lg=d({enabled:A(),mode:Ob.optional(),profiles:w(Ht).optional(),segmentSeconds:l().int().positive().optional(),bands:w($q).default([]),deviceDecision:A().optional(),retention:Qq.optional()}).strict().refine(e=>e.deviceDecision!==!0||e.bands.length===0,{message:"deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",path:["bands"]}),TR=N(["queued","running","done","failed","cancelled"]),Xc=d({jobId:o(),state:TR,fromLocationId:o(),toLocationId:o(),deviceId:l().nullable(),entities:w(o()),filesMoved:l().int(),bytesMoved:l().int(),filesTotal:l().int().nullable(),rowsReconciled:l().int().nonnegative().optional(),rowsForgotten:l().int().nonnegative().optional(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),_R=N(["recordings","recordingsLow"]),NR=d({fromLocationId:o(),toLocationId:o(),entities:w(N(["segments"])).optional(),footageClass:_R.optional(),deviceId:l().int().optional(),profiles:w(o()).optional(),throttleMbps:l().min(1).max(1e3).optional(),sinceMs:l().int().optional()}),Vr=d({leaseId:o().min(1)}),Vq=NR.extend({leaseId:o().min(1)}),OR=N(["move","seal","gallery"]),jR=d({toLocationId:o(),fromLocationId:o().optional(),throttleMbps:l().min(1).max(1e3).optional(),mode:OR.optional()}),Aw=d({present:A(),rows:l().int().nonnegative().nullable()}),Gq=d({media:Aw,retrainFrames:Aw,anyPresent:A(),total:l().int().nonnegative().nullable()}).nullable(),Zq=jR.extend({leaseId:o().min(1)}),bu=N(["recordings","recordingsLow","eventMedia","backups","galleryMedia"]),jb=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"}),Pb=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(),Db=N(["blocking","nonBlocking"]),Ew=d({destinations:jb,sources:Pb,throttleMbps:l().min(1).max(1e3).optional(),mode:Db.optional()}),Kq=N(["planning","sealing","pausing","moving","draining","verifying","repointing","refreshing","resuming","done","failed","cancelled"]),Wq=N(["pipeline","recorder","analytics"]),Yq=d({filesMoved:l().int().nonnegative(),filesTotal:l().int().nonnegative().nullable(),bytesMoved:l().int().nonnegative(),rowsReconciled:l().int().nonnegative().optional(),startedAt:l(),observedAt:l()}),Xq=d({storageClass:bu,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional(),moverJobId:o().nullable(),state:TR.nullable(),error:o().nullable(),progress:Yq.nullable()}),Rw=d({jobId:o(),phase:Kq,mode:Db,destinations:jb,sources:Pb,throttleMbps:l(),moves:w(Xq),pauseLeaseId:o().nullable(),pausedParticipants:w(Wq),repointed:A(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),Jq=N(["sharesDeviceWithSource","deviceIdentityUnknown","unstampedEventMediaRows","blockingOnly","noMover"]),e7=d({code:Jq,storageClass:bu,message:o()}),t7=d({destinations:jb,sources:Pb,mode:Db,moves:w(d({storageClass:bu,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional()})),findings:w(e7)}),n7=N(["footage","media"]),a7=d({lane:n7,job:Xc,migrationJobId:o().nullable(),observedAt:l()}),i7=d({storageClass:bu,fromLocationId:o(),toLocationId:o(),items:l().int().nonnegative().nullable(),bytes:l().int().nonnegative().nullable()}),r7=d({classes:w(bu).min(1),throttleMbps:l().min(1).max(1e3).optional()}),o7=d({fromLocationId:o().min(1),footageClass:_R.optional()}),s7=d({segments:l().int().nonnegative(),bytes:l().int().nonnegative()}).nullable(),l7=d({locationId:o().min(1),apply:A().optional(),deviceId:l().int().positive().optional(),profiles:w(o().min(1)).optional()}),c7=N(["location-unknown","source-writable","no-ledger","archive-unreadable","anchor-absent","anchor-unreadable","anchor-moved"]);N(["live-tail","listing-error","path-mismatch","durable-refused"]);var u7=d({"live-tail":l().int().nonnegative(),"listing-error":l().int().nonnegative(),"path-mismatch":l().int().nonnegative(),"durable-refused":l().int().nonnegative()}),d7=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()}),p7=d({locationId:o(),applied:A(),refused:c7.nullable(),archiveSegments:l().int().nonnegative().nullable(),archiveBytes:l().int().nonnegative().nullable(),hoursClaimed:l().int().nonnegative(),hoursWalked:l().int().nonnegative(),hoursMissing:l().int().nonnegative(),listings:l().int().nonnegative(),segmentsClaimed:l().int().nonnegative(),ghostSegments:l().int().nonnegative(),ghostBytes:l().int().nonnegative(),ghostHoursWhole:l().int().nonnegative(),forgottenSegments:l().int().nonnegative(),forgottenBytes:l().int().nonnegative(),orphanFiles:l().int().nonnegative(),orphanSample:w(o()).readonly(),hoursSkipped:l().int().nonnegative(),skippedByReason:u7,bounded:A(),byDevice:w(d7).readonly()}),m7=d({rows:l().int().nonnegative()}).nullable(),f7=d({toLocationId:o().min(1),fromLocationId:o().optional(),mode:OR.optional()}),h7=N(["orphans","debug-media","ghost-ledger","done","failed","cancelled"]),g7=d({includeDebugMedia:A().optional()}),v7=d({jobId:o(),phase:h7,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()}),y7=d({jobId:o().optional()}),b7=["active","readonly","drain","disabled"],S7=N(b7);N(["normal","never","drain"]);var PR=o().regex(/^[a-z][a-zA-Z0-9-]*$/),Ha=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(),J()),nodeId:o().optional(),isSystem:A().default(!1),enabled:A().optional(),mode:S7.optional(),capacity:d({totalBytes:l(),availableBytes:l()}).nullable().optional(),owned:d({bytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}).optional(),createdAt:l(),updatedAt:l()});d({isDefault:A().optional()});var x7=d({locationId:o(),startedAtMs:l(),startBytes:l(),bytesRemaining:l(),drained:A(),estimatedEmptyAtMs:l().nullable()}),Xi=tt([PR,o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),k7=N(["local-path","cap-mediated"]),w7=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:"id must start with a lowercase letter and contain only letters, digits, or hyphens"}),displayName:o().min(1,{message:"displayName must not be empty"}),description:o().optional(),cardinality:N(["single","multi"]),access:k7.optional(),defaultsTo:o().optional(),defaultRoot:N(["data","media","backup"]).optional()}),M7=d({inputFps:l(),outputFps:l(),avgDecodeTimeMs:l(),droppedFrames:l(),lagMs:l().optional(),effectiveFps:l().optional(),adaptiveFps:l().optional()}),Iw=d({codec:o(),maxFps:l().default(0),outputFormat:N(["jpeg","rgb","bgr","yuv420","gray"]).default("jpeg"),scale:l().default(1),width:l().optional(),height:l().optional(),deviceId:l().int().nonnegative().optional(),tag:o().optional(),frameSink:N(["callback","shm"]).default("callback"),debug:A().optional()}),C7=N(["info","warn","error"]),DR=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:C7,perDevice:A()}),A7=d({channel:o().min(1),armedUntilMs:l(),deviceIds:w(l().int()).readonly().nullable()}),Nm=["onnx","coreml","openvino","tflite","pt","gguf"],Ls=d({url:o(),sizeMB:l(),isDirectory:A().optional(),files:w(o()).readonly().optional(),runtimes:w(N(["node","python"])).readonly().optional()}),E7=d({url:o(),filename:o(),sizeMB:l()}),R7=d({onnx:Ls.optional(),coreml:Ls.optional(),openvino:Ls.optional(),tflite:Ls.optional(),pt:Ls.optional(),gguf:Ls.optional()}),zR=d({family:o(),tier:o(),precision:N(["fp32","int8"]).optional(),optimization:N(["standard","fast"]).optional(),resolution:l().int().positive().optional()}),I7=["camstack","frigate","scrypted","custom"],LR=N(I7),zb=d({id:o(),name:o(),description:o(),formats:R7,inputSize:d({width:l(),height:l()}),inputChannels:l().int().positive().optional(),labels:w(RR).readonly(),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),outputProbabilities:A().optional(),preprocessMode:N(["letterbox","resize"]).optional(),postprocessor:si().optional(),faceAlignment:A().optional(),extraFiles:w(E7).readonly().optional(),legacy:A().optional(),metrics:d({map50:l().optional(),p95LatencyMs:Y(o(),l()).optional()}).optional(),license:o().optional(),group:zR.optional(),provider:LR.optional(),classMap:IR.optional()}),T7=wt("format",[d({format:Q("openvino"),precisions:w(N(["fp16","int8"])).min(1).readonly()}),d({format:Q("coreml")})]),_7=d({id:o().regex(/^[a-zA-Z0-9._-]+$/),name:o(),labels:w(RR).readonly(),inputSize:d({width:l(),height:l()}),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),preprocessMode:N(["letterbox","resize"]).optional(),outputFormat:N(["yolo","ssd","embedding","classification","ocr","segmentation"]),faceAlignment:A().optional(),classMap:IR.optional()}),N7=d({format:N(Nm),precision:N(["fp16","int8"]).optional(),sizeMB:l(),validated:A(),files:w(o()).readonly()}),O7=d({entry:zb,artifacts:w(N7).readonly()}),Jn=class extends Error{position;constructor(e,t){super(e),this.name="ExpressionParseError",this.position=t}},To=class extends Error{constructor(e){super(e),this.name="ExpressionEvalError"}};function Xn(e,t,n){if(typeof e!="number"||!Number.isFinite(e))throw new To(`${t}: argument ${n+1} must be a finite number`);return e}function Tw(e,t,n){if(typeof e!="string")throw new To(`${t}: argument ${n+1} must be a string`);return e}function Ca(e,t){if(!Number.isFinite(e))throw new To(`${t}: produced a non-finite result`);return e}function Kd(e,t){return e.map((n,a)=>Xn(n,t,a))}var Sc=Number.POSITIVE_INFINITY,qR={min:{minArgs:1,maxArgs:Sc,apply:e=>Ca(Math.min(...Kd(e,"min")),"min")},max:{minArgs:1,maxArgs:Sc,apply:e=>Ca(Math.max(...Kd(e,"max")),"max")},abs:{minArgs:1,maxArgs:1,apply:e=>Ca(Math.abs(Xn(e[0],"abs",0)),"abs")},floor:{minArgs:1,maxArgs:1,apply:e=>Ca(Math.floor(Xn(e[0],"floor",0)),"floor")},ceil:{minArgs:1,maxArgs:1,apply:e=>Ca(Math.ceil(Xn(e[0],"ceil",0)),"ceil")},sqrt:{minArgs:1,maxArgs:1,apply:e=>Ca(Math.sqrt(Xn(e[0],"sqrt",0)),"sqrt")},round:{minArgs:1,maxArgs:2,apply:e=>{const t=Xn(e[0],"round",0),n=e.length>1?Math.trunc(Xn(e[1],"round",1)):0;if(n<0||n>100)throw new To("round: digits must be between 0 and 100");const a=10**n;return Ca(Math.round(t*a)/a,"round")}},pow:{minArgs:2,maxArgs:2,apply:e=>Ca(Xn(e[0],"pow",0)**Xn(e[1],"pow",1),"pow")},clamp:{minArgs:3,maxArgs:3,apply:e=>{const t=Xn(e[0],"clamp",0),n=Xn(e[1],"clamp",1),a=Xn(e[2],"clamp",2);if(n>a)throw new To("clamp: lower bound is greater than upper bound");return Ca(Math.min(a,Math.max(n,t)),"clamp")}},avg:{minArgs:1,maxArgs:Sc,apply:e=>{const t=Kd(e,"avg");return Ca(t.reduce((n,a)=>n+a,0)/t.length,"avg")}},sum:{minArgs:1,maxArgs:Sc,apply:e=>Ca(Kd(e,"sum").reduce((t,n)=>t+n,0),"sum")},coalesce:{minArgs:1,maxArgs:Sc,apply:e=>{for(const t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>Ca(Xn(e[0],"age",0)-Xn(e[1],"age",1),"age")},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{const n=Xn(e[0],"convert",0),a=Tw(e[1],"convert",1).trim(),s=Tw(e[2],"convert",2).trim();if(t.convert){const p=t.convert(n,a,s);if(p===null)throw new To(`convert: cannot convert '${a}' to '${s}'`);return Ca(p,"convert")}if(a===s)return n;throw new To("convert: unit conversion table not installed")}}};Object.freeze(Object.assign(Object.create(null),qR));var BR=new Set(Object.keys(qR)),Lb=2048,qb=/^[A-Za-z_][A-Za-z0-9_]*$/,j7=new Set(["now","true","false","null"]),P7=new Set(["true","false","null"]);function zc(e){return e>="0"&&e<="9"}function FR(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"}function D7(e){return FR(e)||zc(e)}function z7(e){return e===" "||e===" "||e===`
74
+ `||e==="\r"||e==="\f"||e==="\v"}function L7(e){if(e.length>2048)throw new Jn(`expression too long (${e.length} > ${Lb} chars)`,0);const t=[];let n=0;const a=e.length;for(;n<a;){const s=e[n];if(z7(s)){n+=1;continue}if(zc(s)){const f=n;for(;n<a&&zc(e[n]);)n+=1;if(n<a&&e[n]==="."){if(n+1>=a||!zc(e[n+1]))throw new Jn("malformed number: decimal point needs a digit",n);for(n+=1;n<a&&zc(e[n]);)n+=1}const m=e.slice(f,n),h=Number(m);if(!Number.isFinite(h))throw new Jn(`malformed number: '${m}'`,f);t.push({type:"number",value:h,pos:f});continue}if(s==="'"||s==='"'){const f=s,m=n;n+=1;let h="",c=!1;for(;n<a;){const x=e[n];if(x==="\\"){const M=n+1<a?e[n+1]:"";if(M==="\\"||M==="'"||M==='"'){h+=M,n+=2;continue}throw new Jn(`invalid string escape: '\\${M}'`,n)}if(x===f){c=!0,n+=1;break}h+=x,n+=1}if(!c)throw new Jn("unterminated string literal",m);t.push({type:"string",value:h,pos:m});continue}if(FR(s)){const f=n;for(;n<a&&D7(e[n]);)n+=1;const m=e.slice(f,n);P7.has(m)?t.push({type:"keyword",keyword:q7(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(B7(s)){t.push({type:"punct",punct:s,pos:n}),n+=1;continue}throw new Jn(`unexpected character '${s}'`,n)}return t.push({type:"eof",pos:a}),t}function q7(e){return e==="true"?"true":e==="false"?"false":"null"}function B7(e){return e==="("||e===")"||e===","||e==="?"||e===":"||e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="!"||e==="<"||e===">"}var F7={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function U7(e){return e==="&&"||e==="||"}function H7(e){return e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="=="||e==="!="||e==="<"||e==="<="||e===">"||e===">="}var $7=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 Jn("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 Jn(`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 Jn("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=F7[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(),U7(s))t={kind:"logical",op:s,left:t,right:p};else if(H7(s))t={kind:"binary",op:s,left:t,right:p};else throw new Jn(`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 Jn(`unexpected token '${e.punct}'`,e.pos);case"eof":throw new Jn("unexpected end of expression",e.pos)}}parseCall(e,t){if(!BR.has(e))throw new Jn(`unknown function '${e}'`,t);this.expectPunct("(");const n=[];if(!this.matchPunct(")"))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new Jn(`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 Q7(e){return new $7(L7(e)).parse()}var Mo=new Map;function V7(e){const t=Mo.get(e);if(t!==void 0)return Mo.delete(e),Mo.set(e,t),t;let n;try{n={ok:!0,parsed:Q7(e)}}catch(a){n={ok:!1,error:a instanceof Jn?a.message:String(a)}}if(Mo.set(e,n),Mo.size>256){const a=Mo.keys().next().value;a!==void 0&&Mo.delete(a)}return n}function G7(e){return V7(e)}function UR(e){const t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(const s of t){if(!qb.test(s))return`invalid binding name '${s}'`;if(j7.has(s))return`binding name '${s}' is reserved`;if(BR.has(s))return`binding name '${s}' shadows a builtin function`}const n=G7(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 Z7=d({kind:Q("field").optional(),sourceKey:o(),cap:o(),fieldPath:o()}),K7=d({kind:Q("literal"),value:tt([o(),l(),A(),uR()])}),W7=d({kind:Q("global"),sourceStableId:o(),cap:o(),fieldPath:o()}),HR=tt([Z7,K7,W7]);d({expr:o().min(1).max(Lb),bindings:Y(o().regex(qb),HR)}).superRefine((e,t)=>{const n=UR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})});var Y7=N(["eq","ne","gt","gte","lt","lte","contains","in"]),X7=d({kind:Q("condition"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),operator:Y7,value:tt([o(),l(),A(),w(tt([o(),l()]))])}),J7=d({kind:Q("expression"),expr:o().min(1).max(Lb),bindings:Y(o().regex(qb),HR)}).superRefine((e,t)=>{const n=UR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})}),xp=vu(()=>wt("kind",[d({kind:Q("all"),children:w(xp)}),d({kind:Q("any"),children:w(xp)}),d({kind:Q("not"),child:xp}),X7,J7])),eB=wt("kind",[d({kind:Q("device-state"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),becomes:tt([o(),l(),A()]).optional(),edge:A().optional(),forMs:l().int().min(0).max(864e5).optional(),debounceMs:l().int().min(0).max(6e5).optional()}),d({kind:Q("device-event"),category:o().min(1),deviceId:l().int().nonnegative().optional()}),d({kind:Q("schedule"),cron:o().min(1).max(120)}),d({kind:Q("manual")})]),tB=wt("kind",[d({kind:Q("wait"),seconds:l().min(0).max(300)}),d({kind:Q("cap"),deviceId:tt([l().int(),d({$var:o().min(1)})]),cap:o().min(1),method:o().min(1),args:Y(o(),J()).optional()}),d({kind:Q("code"),code:o().min(1).max(2e4)})]);d({triggers:w(eB),conditions:xp.optional(),actions:w(tB)});var nB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),aB=d({addonId:o(),page:nB,bundleUrl:o()}),iB={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:b(O(),w(aB).readonly())}},rB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),oB={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:b(O(),w(rB).readonly(),{auth:"admin"})}},sB=d({method:N(["GET","POST","PUT","DELETE","PATCH"]),path:o(),access:N(["public","authenticated","admin"]).optional(),description:o().optional()}),lB=d({method:o(),path:o(),params:Y(o(),o()),query:Y(o(),o()),body:J(),headers:Y(o(),o()),user:d({id:o(),username:o(),isAdmin:A()}).optional(),scopedToken:J().optional()}),cB=d({status:l().int(),headers:Y(o(),o()),redirectUrl:o().nullable(),body:J().optional(),contentType:o().optional()}),uB={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:b(O(),w(sB)),invoke:b(lB,cB,{kind:"mutation"})},mount:{kind:"skip"}},dB=d({id:o(),label:o(),icon:o(),order:l().optional()}),pB=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([Q(1),Q(2),Q(3),Q(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(dR())}),_o=d({tabs:w(dB).optional(),sections:w(pB)}),_w=Y(o(),J()),Nw=d({success:Q(!0)}),mB={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),overlay:Y(o(),J()).optional(),cap:o().optional()}),_o.nullable()),updateGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),patch:_w}),Nw,{kind:"mutation",auth:"admin"}),getIntegrationSettings:b(d({addonId:o(),nodeId:o().optional()}),_o.nullable()),getDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional()}),_o.nullable()),updateDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional(),patch:_w}),Nw,{kind:"mutation",auth:"admin"})}},fB=N(["device-tab","dashboard","integration-detail"]),Ow=N(["xs","sm","md","lg","xl"]),$R=d({remoteName:o(),exposedModule:o(),componentKey:o().optional()}),QR=d({tab:o(),subTab:o().optional(),label:o(),order:l().optional(),kind:Q("remote"),remote:$R,stableId:o(),description:o().optional(),icon:o().optional(),bundle:o(),hosts:w(fB).readonly(),requires:d({deviceContext:A().default(!1),integrationContext:A().default(!1)}),preAuth:A().optional().default(!1),defaultSize:Ow.default("md"),allowedSizes:w(Ow).readonly().default(["sm","md","lg"]),defaultColumns:l().int().min(1).max(12).default(6),defaultRows:l().int().min(1).max(12).default(1)}),hB={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:b(O(),w(QR).readonly(),{auth:"admin"})}},gB=QR.extend({addonId:o(),bundleUrl:o()}),vB={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:b(O(),w(gB).readonly())}},yB=N(["info","success","warning","error"]),bB=N(["active","in-progress","completed","failed","dismissed"]),SB=d({type:o(),id:o()}),cg=d({id:o(),category:o(),severity:yB,title:o(),message:o(),status:bB,progress:l().optional(),read:A(),createdAt:l(),updatedAt:l(),source:SB.optional(),metadata:Y(o(),J()).optional()}),xB={name:"alerts",scope:"system",mode:"singleton",methods:{emit:b(cg,O(),{kind:"mutation"}),update:b(d({alertId:o(),patch:cg.partial()}),O(),{kind:"mutation"}),list:b(d({unreadOnly:A().optional(),limit:l().optional()}).optional(),w(cg).readonly()),getUnreadCount:b(O(),l()),markRead:b(d({alertId:o()}),O(),{kind:"mutation"}),markAllRead:b(O(),O(),{kind:"mutation"}),dismiss:b(d({alertId:o()}),O(),{kind:"mutation"})}},kB={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:b(d({deviceId:l()}),si())},events:{onAudioLevel:Po(d({deviceId:l(),rms:l(),dbfs:l()}))}},wB=N(["jpeg","rgb","bgr","yuv420","gray"]),Vv=d({data:si(),format:wB,width:l(),height:l(),timestamp:l()}),dr=d({x:l(),y:l(),w:l(),h:l()});d({class:o(),originalClass:o(),score:l(),bbox:dr});var jw=d({data:$t(Uint8Array),sampleRate:l(),channels:l(),timestamp:l(),deviceId:l().optional()}),MB=d({rms:l(),dbfs:l()}),Gv=d({className:o(),originalClass:o().optional(),score:l()}),CB=d({level:MB,classification:d({labels:w(Gv).readonly(),inferenceMs:l()}).optional(),timestamp:l()}),VR=d({minConfidence:l().min(0).max(1).default(.3),allowedClasses:w(o()).default([])}),AB=d({deviceId:l(),brokerId:o(),ingestNodeId:o(),settings:VR}),EB=d({attached:A(),replaced:A()}),RB=d({detached:A()}),IB=d({labels:w(Gv).readonly(),rawLabels:w(Gv).readonly().optional(),inferenceMs:l()}),TB={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:b(d({chunk:jw,settings:VR}),CB.nullable(),{kind:"mutation"}),classify:b(jw,IB,{timeoutMs:3e4}),attachDevice:b(AB,EB,{kind:"mutation"}),detachDevice:b(d({deviceId:l()}),RB,{kind:"mutation"}),isReady:b(O(),A()),dispose:b(O(),O(),{kind:"mutation"}),reprobeAudioEngine:b(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},Om=N(["f32le","s16le"]),_B=d({codec:o(),canDecode:A(),canEncode:A(),label:o().optional()}),NB=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),extraData:$t(Uint8Array).optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),targetFormat:Om.optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),OB=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),sourceFormat:Om.optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),bitrateKbps:l().int().positive().optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),jB=d({data:$t(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),format:Om,pts:l()}),Pw=d({data:$t(Uint8Array),codec:o(),pts:l(),frameComplete:A()}),PB=d({sessionId:o(),kind:N(["decode","encode"]),codec:o(),sourceSampleRate:l(),sourceChannels:l(),targetSampleRate:l(),targetChannels:l(),format:Om,tag:o().optional(),createdAtMs:l(),lastActivityMs:l(),framesIn:l(),framesOut:l()}),DB={name:"audio-codec",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{listSupportedCodecs:b(O(),w(_B).readonly()),canHandle:b(d({codec:o(),kind:N(["decode","encode"])}),A()),createDecodeSession:b(NB,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),createEncodeSession:b(OB,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),closeSession:b(d({sessionId:o(),nodeId:o().optional()}),O(),{kind:"mutation"}),pushEncodedFrame:b(d({sessionId:o(),nodeId:o().optional(),data:$t(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullPcm:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(jB)),pushPcm:b(d({sessionId:o(),nodeId:o().optional(),data:$t(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullEncoded:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(Pw)),flushEncode:b(d({sessionId:o(),nodeId:o().optional()}),w(Pw),{kind:"mutation"}),listActiveSessions:b(O(),w(PB).readonly())}},ug=d({userId:o(),username:o(),email:o().optional(),displayName:o().optional(),isAdmin:A().default(!1)}),zB={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:b(d({username:o(),password:o()}),ug.nullable(),{kind:"mutation"}),getLoginUrl:b(d({state:o()}),o()),handleCallback:b(Y(o(),o()),ug,{kind:"mutation"}),validateToken:b(d({token:o()}),ug.nullable())},mount:{kind:"skip"}},LB=d({subId:o(),displayName:o(),description:o().optional(),kind:o(),triggerSupported:A(),restoreSupported:A()}).extend({id:o(),addonId:o(),enabled:A(),retentionCount:l(),label:o().optional(),lastSuccessAt:l().optional(),lastSuccessSizeBytes:l().optional(),cron:o().optional(),nextRunAt:l().optional(),lastAttemptAt:l().optional(),lastError:o().optional()}),qB=d({id:o(),filename:o(),createdAt:l(),sizeBytes:l(),label:o().optional(),locations:w(o()).readonly()}),GR=d({id:o(),destinationId:o().optional(),label:o().optional(),createdAt:l(),sizeBytes:l(),locations:w(o()).optional()}),BB=d({path:o(),kind:N(["file","dir","symlink"]),sizeBytes:l(),mtime:l()}),FB=d({archiveVersion:Q(1),createdAt:l(),dataDir:o(),locations:w(o()),entries:w(BB),totalBytes:l(),totalFiles:l()}),UB=d({name:o(),sizeBytes:l(),fileCount:l(),present:A()}),HB=N(["queued","running","succeeded","failed","cancelled"]),$B=N(["queued","building","uploading","done"]),QB=d({id:o(),state:HB,phase:$B,destinationIds:w(o()).readonly(),label:o().optional(),requestedAt:l(),startedAt:l().optional(),finishedAt:l().optional(),stagedBytes:l(),archiveSizeBytes:l().optional(),uploadedBytes:l(),completedDestinationIds:w(o()).readonly(),failedDestinationIds:w(o()).readonly(),error:o().optional(),queuePosition:l().int().min(1).optional()}),VB=d({runId:o(),queued:A(),joined:A(),cancelled:A(),entries:w(GR).readonly()}),Dw=d({id:o(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional(),lastAttemptAt:l().optional(),lastSuccessAt:l().optional(),lastError:o().optional(),nextRunAt:l().optional()}),GB={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:b(O(),w(LB).readonly(),{auth:"admin"}),trigger:b(d({destinations:w(o()).optional(),locations:w(o()).optional(),label:o().optional(),retentionCount:l().int().min(1).max(1e3).optional()}).optional(),VB,{kind:"mutation",auth:"admin"}),listRuns:b(O(),w(QB).readonly(),{auth:"admin"}),cancel:b(d({runId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),list:b(O(),w(GR).readonly(),{auth:"admin"}),listLocations:b(O(),w(UB).readonly(),{auth:"admin"}),getEntries:b(d({destinationId:o(),backupId:o()}),FB.nullable(),{auth:"admin"}),restore:b(d({destinationId:o(),backupId:o(),locations:w(o()).optional()}),O(),{kind:"mutation",auth:"admin"}),delete:b(d({destinationId:o(),backupId:o()}),O(),{kind:"mutation",auth:"admin"}),listArchives:b(d({destinationId:o()}),w(qB).readonly(),{auth:"admin"}),upsertDestinationPolicy:b(d({locationId:o(),enabled:A(),retentionCount:l().int().min(1).max(1e3),label:o().optional()}),O(),{kind:"mutation",auth:"admin"}),previewSchedule:b(d({cron:o(),count:l().int().min(1).max(20).optional()}),d({ok:A(),error:o().optional(),nextRuns:w(l()).readonly()})),listSchedules:b(O(),w(Dw).readonly(),{auth:"admin"}),upsertSchedule:b(d({id:o().optional(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional()}),Dw,{kind:"mutation",auth:"admin"}),deleteSchedule:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"})}},ZB=N(["connected","disconnected","connecting","auth-failed","unreachable","error"]),zw=d({id:o(),addonId:o(),name:o(),kind:o(),status:ZB,info:Y(o(),J()),lastCheckedAt:l().nullable(),error:o().nullable()}),Lw=d({brokerCount:l().int().nonnegative(),connectedCount:l().int().nonnegative()}),KB=d({addonId:o(),kinds:w(d({kind:o(),label:o()}))}),WB=d({kind:o().optional()}),Wd=d({id:o()}),YB=d({kind:o().min(1),name:o().min(1),id:o().min(1).optional(),settings:Y(o(),J())}),XB=d({id:o()}),JB=d({id:o()}),e9=wt("ok",[d({ok:Q(!0),latencyMs:l().nonnegative()}),d({ok:Q(!1),error:o()})]),kp=Y(o(),J()),t9=d({kind:o()}),n9=d({kind:o(),settings:kp}),a9=wt("ok",[d({ok:Q(!0),latencyMs:l().nonnegative().optional()}).strict(),d({ok:Q(!1),error:o()})]),i9=J().nullable(),r9=d({brokerId:o(),target:Y(o(),J()),payload:J().optional()}),o9=d({brokerId:o(),filter:Y(o(),J())}),s9=d({subscriptionId:o()}),l9=d({brokerId:o(),subscriptionId:o()}),c9=d({brokerId:o(),key:o()}),u9={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Lw,kind:"poll"},methods:{list:b(WB,w(zw)),get:b(Wd,zw.nullable()),listProviders:b(O(),w(KB),{auth:"admin"}),add:b(YB,XB,{kind:"mutation",auth:"admin"}),remove:b(JB,O(),{kind:"mutation",auth:"admin"}),testConnection:b(Wd,e9,{kind:"mutation",auth:"admin"}),getSettings:b(Wd,kp.nullable(),{auth:"admin"}),setSettings:b(d({id:o(),settings:kp}),O(),{kind:"mutation",auth:"admin"}),getBrokerConfig:b(Wd,kp.nullable(),{auth:"admin"}),getSettingsSchema:b(t9,i9,{auth:"admin"}),testSettings:b(n9,a9,{kind:"mutation",auth:"admin"}),publish:b(r9,J(),{kind:"mutation",auth:"admin"}),subscribe:b(o9,s9,{kind:"mutation",auth:"admin"}),unsubscribe:b(l9,O(),{kind:"mutation",auth:"admin"}),getState:b(c9,J().nullable()),getStatus:b(O(),Lw)}},d9={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{}},ZR=d({code:o().min(1),label:o().min(1),recommended:A()}),p9=d({signals:w(ZR),lastFetchedAt:l()}),m9={name:"stream-signals",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(H),runtimeState:p9,durability:"session",methods:{listSignals:b(O(),w(ZR).readonly())}},f9=N(["webrtc","hls","mjpeg","rtsp"]),KR=N(["mp4","gif"]),h9=d({kind:KR,handle:o(),nodeId:o(),mime:o(),bytes:l().int(),width:l().int(),height:l().int()}),g9=d({fromTs:l(),toTs:l(),packets:l().int()}),v9=d({media:w(h9).readonly(),coverage:g9,profile:Ht,video:N(["copy","encode"])}),Zv=d({brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:d({width:l().int().positive(),height:l().int().positive()}).optional()}),y9=d({sessionId:o(),remoteAddr:o(),userAgent:o().nullish(),playing:A(),muted:A(),connectedAt:l(),lastRtpAt:l(),bytesSent:l()}),b9=d({tag:o(),subscribedAt:l(),maxFps:l(),framesDelivered:l(),framesDropped:l()}),S9=d({tag:o(),subscribedAt:l(),chunksDelivered:l()}),x9=N(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),Kv=d({kind:x9,label:o().optional(),media:N(["audio","video","both"]).optional(),targetCodec:o().optional(),transport:N(["passthrough","repacketize","transcode"]).optional(),remoteAddr:o().optional(),userAgent:o().optional(),userId:o().optional(),sessionId:o().optional(),extra:Y(o(),o()).optional()}).readonly(),k9=d({id:o(),channel:N(["annexb","rtp"]),attribution:Kv,subscribedAt:l(),packetsDelivered:l()}),w9=d({rtsp:w(y9).readonly(),decoded:w(b9).readonly(),audio:w(S9).readonly(),encoded:w(k9).readonly(),pipeClients:l(),encodedSubscribers:l()});N(["reconnecting","sleeping","offline","disabled","waking"]);var M9=N(["h264","h265","copy"]),C9=N(["aac","opus","pcmu","copy","none"]),A9=d({deviceId:l().int().nonnegative(),video:M9,audio:C9.optional(),profile:Ht.optional(),targetResolution:d({width:l().int().positive(),height:l().int().positive()}).optional(),outputArgs:w(o()).optional(),audioEgress:A().optional(),hostname:o().optional(),tag:o().optional()}),E9=d({url:o(),sentryUrl:o().nullable().optional(),videoCodec:N(["H264","H265"]),audioCodec:o(),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),pipelineKey:o()}),R9=wR.omit({inputArgs:!0,outputArgs:!0}),I9=N(["tight","relaxed"]),T9=d({deviceId:l().int().nonnegative(),source:wt("kind",[d({kind:Q("profile"),profile:Ht}),d({kind:Q("cam-stream"),camStreamId:o().min(1)})]),encode:R9,rateControl:I9.optional(),bitstreamFilter:N(["dump_extra","h264_mp4toannexb","hevc_mp4toannexb"]).optional(),publishLocally:A().optional(),pixelFormat:N(["yuv420p","nv12"]).optional(),decodeHwAccel:N(["auto","none","videotoolbox","vaapi","qsv","cuda"]).optional(),hostname:o().optional(),tag:o().optional()}),_9=d({url:o(),pipelineKey:o(),videoCodec:N(["H264","H265"]),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),decodeHwAccel:o().nullable(),camStreamId:o().nullable()}),N9={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{reportStreamSignal:b(d({deviceId:l().int().nonnegative(),code:o().min(1),at:l().optional()}),d({accepted:A(),reason:N(["woke","hold-extended","not-enabled","no-consumer","unknown-code"])}),{kind:"mutation"}),publishCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1),kind:_b,url:o().optional(),codec:o().optional(),resolution:kl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ht.optional(),metadata:Y(o(),J()).optional(),sourceCamStreamId:o().min(1).optional(),encodeProfile:wR.optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:b(d({deviceId:l().int().nonnegative(),profile:Ht,camStreamId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:b(d({deviceId:l().int().nonnegative(),profile:Ht}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),forgetDeviceHardware:b(d({deviceId:l().int().nonnegative()}),d({derivedStreamsDeleted:w(o()).readonly(),assignmentsPurged:A(),probeSnapshotsDropped:l().int().nonnegative(),rtspTokenRowsDeleted:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),renderPreBufferClip:b(d({deviceId:l(),profile:Ht.optional(),aroundMs:l(),preRollSec:l().min(0).max(20).default(3),postRollSec:l().min(0).max(20).default(5),format:N(["gif","mp4"]).default("gif"),maxWidth:l().int().min(120).max(1920).default(480),fps:l().int().min(1).max(15).default(5),speed:l().min(1).max(8).default(2)}),d({base64:o(),mime:o(),bytes:l().int(),profile:Ht,durationMs:l()}),{kind:"mutation",auth:"admin"}),produceEventMedia:b(d({deviceId:l(),profile:Ht.optional(),aroundMs:l(),preSeconds:l().min(0).max(20).default(4),postSeconds:l().min(0).max(20).default(6),kinds:w(KR).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)}),v9,{kind:"mutation",auth:"admin"}),fetchEventMedia:b(d({handle:o()}),d({base64:o(),mime:o(),bytes:l().int()}).nullable(),{kind:"mutation",auth:"admin"}),listAllCameraStreams:b(O(),w($v).readonly()),listAllProfileSlots:b(O(),w(Qv).readonly()),getBrokerStats:b(d({brokerId:o()}),tq),probeStream:b(d({brokerId:o()}),d({probed:A(),summary:o()}),{kind:"mutation",auth:"admin"}),listClients:b(d({brokerId:o()}),w9),killClient:b(d({brokerId:o(),channel:N(["rtsp","decoded","audio"]),handle:o()}),d({killed:A()}),{kind:"mutation",auth:"admin"}),restartProfile:b(d({deviceId:l().int().nonnegative(),profile:Ht}),d({success:A()}),{kind:"mutation",auth:"admin"}),getStreamUrl:b(d({streamId:o(),format:f9}),d({url:o()})),getStreamWithCodec:b(A9,E9,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),acquireEgressTranscode:b(T9,_9,{kind:"mutation",auth:"admin"}),releaseEgressTranscode:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:b(X8,J8,{kind:"mutation"}),pullAudioChunks:b(d({subscriptionId:o(),maxCount:l().int().positive().default(8)}),w(Y8).readonly()),unsubscribeAudioChunks:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),subscribeFrames:b(K8,W8,{kind:"mutation"}),pullFrameHandles:b(d({subscriptionId:o(),maxCount:l().int().positive().default(4)}),w(rr).readonly()),unsubscribeFrames:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),setPreBufferDuration:b(d({brokerId:o(),seconds:l().min(0).max(30)}),O(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:b(d({brokerId:o()}),d({configuredSec:l(),bufferedMs:l(),packetCount:l()})),getRtspPort:b(O(),l()),getAllRtspEntries:b(d({hostname:o().optional()}),w(Zv).readonly()),getRtspEntry:b(d({brokerId:o(),hostname:o().optional()}),Zv.nullable()),regenerateRtspToken:b(d({brokerId:o()}),o().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:b(d({brokerId:o(),enabled:A()}),O(),{kind:"mutation",auth:"admin"}),isRtspEnabled:b(d({brokerId:o()}),A()),getDeviceAudioMute:b(d({deviceId:l().int()}),d({muted:A(),appliedBrokers:l().int().nonnegative()})),setDeviceAudioMute:b(d({deviceId:l().int(),muted:A()}),d({muted:A(),appliedBrokers:l().int().nonnegative()}),{kind:"mutation",auth:"admin"})},events:{onCamStreamDemand:Po(d({deviceId:l().int().nonnegative(),camStreamId:o(),profile:Ht})),onCamStreamIdle:Po(d({deviceId:l().int().nonnegative(),camStreamId:o()})),onRequestStreamSourceRefresh:Po(d({deviceId:l().int().nonnegative(),camStreamId:o(),brokerId:o()}))}},qw=N(["h264","h265","hevc","av1","mjpeg","vp8","vp9"]),O9=d({acceptCodecs:w(qw).readonly().optional(),minHeight:l().int().positive().optional(),maxHeight:l().int().positive().optional(),minWidth:l().int().positive().optional(),excludeDerived:A().optional(),requireSiblingCodec:w(qw).readonly().optional(),allowTranscode:A().optional(),requireProfileBound:A().optional()}).readonly(),j9=d({preferredProviders:w(o()).readonly().optional(),resolutionPreference:N(["highest","lowest"]).optional(),targetHeight:l().int().positive().optional()}).readonly(),P9=d({camStreamId:o(),codec:o().optional(),resolution:kl.optional(),transcodes:A(),reason:o(),profile:Ht.optional(),brokerId:o().optional(),url:o().optional(),fps:l().positive().optional(),fpsSource:N(["published","measured"]).optional()}),D9={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{getCameraStreams:b(d({deviceId:l().int().nonnegative()}),w($v).readonly()),getBrokerStreams:b(d({deviceId:l().int().nonnegative()}),w(Qv).readonly()),getRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(Zv).readonly()),getProfileRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(nq).readonly()),pickStream:b(d({deviceId:l().int().nonnegative(),requirements:O9,preferences:j9.optional()}),P9.nullable())},events:{onCamStreamsChanged:Po(d({deviceId:l().int().nonnegative(),camStreams:w($v).readonly()})),onProfileSlotsChanged:Po(d({deviceId:l().int().nonnegative(),profileSlots:w(Qv).readonly()}))},runtimeState:d({online:A(),slotStatuses:d({high:Sp.optional(),mid:Sp.optional(),low:Sp.optional()}),slotErrors:d({high:o().optional(),mid:o().optional(),low:o().optional()}),lastChangedAt:l()}),durability:"session"},z9=tt([Q("hub"),o().min(1)]),L9=N(["stopped","starting","running","failed"]),Wv=d({name:o().min(1).max(120),code:o().max(2e5),enabled:A(),placement:z9,integrationId:o().optional()}),qs=Wv.extend({id:o(),createdAt:l(),updatedAt:l(),createdBy:o(),status:L9,lastError:o().optional(),lastChangedAt:l()}),q9=d({ok:A(),error:o().optional(),line:l().optional(),column:l().optional()}),B9={name:"core-blocks",scope:"system",mode:"singleton",methods:{list:b(d({}),d({blocks:w(qs)}),{auth:"admin"}),get:b(d({blockId:o()}),d({block:qs.nullable()}),{auth:"admin"}),create:b(d({block:Wv}),d({block:qs}),{kind:"mutation",auth:"admin",caller:"required"}),update:b(d({blockId:o(),block:Wv.partial()}),d({block:qs}),{kind:"mutation",auth:"admin",caller:"required"}),delete:b(d({blockId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setEnabled:b(d({blockId:o(),enabled:A()}),d({block:qs}),{kind:"mutation",auth:"admin"}),restart:b(d({blockId:o()}),d({block:qs}),{kind:"mutation",auth:"admin"}),compile:b(d({code:o()}),q9,{kind:"mutation",auth:"admin"}),getTypeDefs:b(d({}),d({libs:w(d({filePath:o(),content:o()}))}),{auth:"admin"})}},F9=d({stepId:o(),entry:zb}),U9={name:"custom-model-registry",scope:"system",mode:"collection",internal:!0,methods:{listModels:b(O(),w(F9).readonly(),{auth:"admin"})}},$r=d({where:Y(o(),J()).optional(),whereIn:Y(o(),w(J())).optional(),whereBetween:Y(o(),gu([J(),J()])).optional(),whereNot:Y(o(),J()).optional(),whereNotIn:Y(o(),w(J())).optional(),orderBy:d({field:o(),direction:N(["asc","desc"])}).optional(),limit:l().optional(),offset:l().optional()}),Jp=d({where:Y(o(),J()).optional(),whereIn:Y(o(),w(J())).optional(),whereBetween:Y(o(),gu([J(),J()])).optional(),whereNot:Y(o(),J()).optional(),whereNotIn:Y(o(),w(J())).optional()}),WR=d({as:o().min(1),field:o().min(1),op:N(["sum","min","max"])}),YR=d({count:l().int(),values:Y(o(),l().nullable())}),XR=d({id:o(),data:Y(o(),J())}),em=d({id:o().optional(),data:Y(o(),J())}),JR=d({name:o(),type:N(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:A().optional(),notNull:A().optional(),unique:A().optional(),defaultValue:tt([o(),l(),A()]).optional()}),eI=d({name:o(),columns:w(o()).readonly(),unique:A().optional()}),H9={name:"settings-store",scope:"system",mode:"singleton",methods:{get:b(d({namespace:o().optional(),collection:o(),key:o()}),J()),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:J()}),O(),{kind:"mutation"}),query:b(d({namespace:o().optional(),collection:o(),filter:$r.optional(),columns:w(o()).readonly().optional()}),w(XR).readonly()),upsert:b(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:em}),d({id:tt([o(),l()])}),{kind:"mutation"}),insert:b(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:Y(o(),J())})}),d({id:tt([o(),l()])}),{kind:"mutation"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:w(em).readonly()}),d({inserted:l().int()}),{kind:"mutation"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),J())}),O(),{kind:"mutation"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Jp}),d({deleted:l().int()}),{kind:"mutation"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Jp,data:Y(o(),J())}),d({updated:l().int()}),{kind:"mutation"}),count:b(d({namespace:o().optional(),collection:o(),filter:$r.optional()}),l()),aggregate:b(d({namespace:o().optional(),collection:o(),fields:w(WR).readonly(),filter:$r.optional()}),YR),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:$r.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly()),isEmpty:b(d({namespace:o().optional(),collection:o()}),A()),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:w(JR).readonly(),indexes:w(eI).readonly().optional()}),O(),{kind:"mutation"})}},$9=d({engineId:o(),kind:N(["relational","vector"]),displayName:o()}),Q9={name:"data-store-provider",scope:"system",mode:"collection",internal:!0,methods:{getEngineInfo:b(O(),$9,{auth:"admin"}),get:b(d({namespace:o().optional(),collection:o(),key:o()}),J(),{auth:"admin"}),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:J()}),O(),{kind:"mutation",auth:"admin"}),query:b(d({namespace:o().optional(),collection:o(),filter:$r.optional(),columns:w(o()).readonly().optional()}),w(XR).readonly(),{auth:"admin"}),insert:b(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:Y(o(),J())})}),d({id:tt([o(),l()])}),{kind:"mutation",auth:"admin"}),upsert:b(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:em}),d({id:tt([o(),l()])}),{kind:"mutation",auth:"admin"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:w(em).readonly()}),d({inserted:l().int()}),{kind:"mutation",auth:"admin"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:Y(o(),J())}),O(),{kind:"mutation",auth:"admin"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation",auth:"admin"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Jp}),d({deleted:l().int()}),{kind:"mutation",auth:"admin"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Jp,data:Y(o(),J())}),d({updated:l().int()}),{kind:"mutation",auth:"admin"}),count:b(d({namespace:o().optional(),collection:o(),filter:$r.optional()}),l(),{auth:"admin"}),aggregate:b(d({namespace:o().optional(),collection:o(),fields:w(WR).readonly(),filter:$r.optional()}),YR,{auth:"admin"}),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:$r.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly(),{auth:"admin"}),isEmpty:b(d({namespace:o().optional(),collection:o()}),A(),{auth:"admin"}),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:w(JR).readonly(),indexes:w(eI).readonly().optional()}),O(),{kind:"mutation",auth:"admin"})}},V9=d({sessionId:o(),slotCount:l().int(),slotByteLength:l().int(),segmentBytes:l().int(),budgetMb:l().int(),framesWritten:l().int(),getFrameHits:l().int(),getFrameMisses:l().int()}),G9={name:"decoder",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{supportsCodec:b(d({codec:o()}),A()),getInfo:b(O(),d({id:o(),name:o(),isPullMode:A().optional(),priority:l().optional(),hwaccel:o().optional(),probedBestHwaccel:o().optional()})),createSession:b(Iw,d({sessionId:o(),nodeId:o()})),destroySession:b(d({sessionId:o()}),O()),pushPacket:b(d({sessionId:o(),packet:G8}),O()),openStream:b(d({sessionId:o(),url:o()}),O()),pullFrames:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(Sw)),pullHandles:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(rr)),getFrame:b(d({handle:rr}),Sw.nullable()),getShmStats:b(d({sessionId:o()}),V9.nullable()),updateConfig:b(d({sessionId:o(),config:Iw.partial()}),O()),getStats:b(d({sessionId:o()}),M7),listActiveSessions:b(O(),w(d({sessionId:o(),codec:o(),outputFormat:o(),createdAtMs:l()})).readonly()),reprobeHwaccel:b(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},Z9={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{}},Su=d({id:o(),system:o(),uniqueId:o().optional(),raw:Y(o(),J()).optional()}),K9=N(["online","sleeping","offline","unknown"]),dl=vu(()=>d({childNativeId:o(),name:o(),type:N(H),status:K9,metadata:d({model:o().optional(),serialNumber:o().optional(),uid:o().optional(),rtspChannel:l().int().nonnegative().optional(),isBattery:A().optional(),isDoorbell:A().optional(),isMultifocal:A().optional(),externalLocation:o().optional(),manufacturer:o().optional(),integration:o().optional()}).default({}),alreadyAdopted:A(),adoptedDeviceId:l().int().nonnegative().nullable(),capabilities:w(o()).readonly().optional(),features:w(o()).readonly().optional(),sourceInfo:Su.optional(),children:w(dl).readonly().optional()})),Bw=d({discovered:w(dl),lastDiscoveryAt:l().int().nonnegative().nullable(),lastError:o().nullable()}),W9={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Hub],status:{schema:Bw,kind:"poll"},runtimeState:Bw.extend({lastFetchedAt:l().int().nonnegative()}),durability:"session",methods:{listDiscovered:b(d({deviceId:l().int().nonnegative()}),w(dl).readonly()),refreshDiscovery:b(d({deviceId:l().int().nonnegative()}),w(dl).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({deviceId:l().int().nonnegative(),childNativeId:o(),name:o().optional()}),d({deviceId:l().int().nonnegative(),stableId:o()}),{kind:"mutation",auth:"admin"}),releaseDevice:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})}},tI=d({id:o(),label:o(),isDefault:A().optional()}),Y9=d({search:o().optional(),area:o().optional(),manufacturer:o().optional(),adoptedOnly:A().optional(),unadoptedOnly:A().optional()}),nI=d({integrationId:o(),page:l().int().positive().default(1),pageSize:l().int().positive().max(2e4).default(50),filter:o().optional(),filterText:Y9.optional()}),aI=d({candidates:w(dl).readonly(),totalCount:l().int().nonnegative(),page:l().int().positive(),pageSize:l().int().positive()}),X9=d({integrationId:o(),childNativeId:o()}),Yv=d({lastDiscoveryAt:l().int().nonnegative().nullable(),candidateCount:l().int().nonnegative(),adoptedCount:l().int().nonnegative(),lastError:o().nullable()}),J9=d({name:o().min(1).optional(),hiddenChildIds:w(o()).optional()}),Xv=d({integrationId:o(),childNativeIds:w(o()).min(1),filter:o().optional(),importLocations:A().optional(),perCandidate:Y(o(),J9).optional()}),iI=d({adopted:w(d({childNativeId:o(),parentDeviceId:l().int().nonnegative(),accessoryDeviceIds:w(l().int().nonnegative()).readonly()})).readonly()}),rI=d({integrationId:o(),camDeviceId:l().int().nonnegative()}),oI=d({camDeviceId:l().int().nonnegative(),resetToSource:A().optional()}),sI=d({changed:A(),rebuiltChildren:l().int().nonnegative(),removedChildren:l().int().nonnegative().optional()}),eF={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:Yv,kind:"poll"},methods:{listCandidateFilters:b(d({integrationId:o()}),d({filters:w(tI)}),{auth:"admin"}),listCandidates:b(nI,aI,{auth:"admin"}),getCandidate:b(X9,dl.nullable(),{auth:"admin"}),refresh:b(d({integrationId:o()}),Yv,{kind:"mutation",auth:"admin"}),adopt:b(Xv,iI,{kind:"mutation",auth:"admin"}),release:b(rI,O(),{kind:"mutation",auth:"admin"}),resync:b(oI,sI,{kind:"mutation",auth:"admin"})}},tF=N(["unlinked","linked","error"]),nF=d({label:o(),value:o(),secret:A().optional()}),aF=d({qr:o().optional(),fields:w(nF).readonly().optional(),note:o().optional()}),Fw=d({linkState:tF,exposedDeviceCount:l(),error:o().optional(),setup:aF.optional()}),iF=o(),rF=d({deviceId:o(),exposedAs:o().optional(),capabilities:w(o()).optional()}),oF=d({deviceId:o(),capabilities:w(o()).optional()}),sF=d({deviceId:o()}),lF={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:Fw,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:b(O(),Fw),listSupportedDeviceKinds:b(O(),w(iF)),listExposedDevices:b(O(),w(rF)),exposeDevice:b(oF,O(),{kind:"mutation"}),unexposeDevice:b(sF,O(),{kind:"mutation"})}},cF=["map-pin","house","door-open","sofa","utensils","bed-double","bath","briefcase","car","circle-parking","route","trees","umbrella","waves-ladder","fence","package","warehouse","store","sun","radar"],tm=N(cF),uF=d({locationKey:o(),icon:tm}),dF=d({locationKey:o(),description:o()}),pF=d({zoneKey:o(),label:o(),icon:tm.nullable(),locationKeys:w(o())}),mF=d({connected:A(),deviceCount:l(),error:o().optional()});d({externalId:o(),name:o(),type:o(),metadata:Y(o(),J()).optional()});var Ws=d({stableId:o(),type:N(H),suggestedName:o(),prefilledConfig:Y(o(),J()),sourceInfo:Su.optional(),alreadyOnboarded:A().optional(),onboardedDeviceId:l().optional(),onboardedName:o().optional()}),nm=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),parentDeviceId:l().nullable(),online:A(),features:w(o()),config:Y(o(),J()),sourceInfo:Su.optional()}),Jv=d({status:N(["ok","error"]),labels:w(o()).optional(),error:o().optional()}),Uw=J(),fF={name:"device-provider",scope:"system",mode:"collection",methods:{start:b(O(),O(),{kind:"mutation"}),stop:b(O(),O(),{kind:"mutation"}),getStatus:b(O(),mF),getDevices:b(O(),w(d({id:o(),name:o(),type:o()}))),reloadDevice:b(d({stableId:o()}),d({deviceId:l()}),{kind:"mutation",timeoutMs:3*6e4}),supportsDiscovery:b(d({}),A()),discoverDevices:b(d({params:Y(o(),J()).optional()}),w(Ws),{kind:"mutation",auth:"admin"}),getDiscoveryParamsSchema:b(d({}),Uw),getManualCreationType:b(d({}),d({deviceType:N(H).nullable()})),adoptDiscoveredDevice:b(d({candidate:Ws}),nm,{kind:"mutation",auth:"admin"}),supportsManualCreation:b(d({}),A()),getChildCreationSchema:b(d({type:N(H)}),Uw),createDevice:b(d({type:N(H),config:Y(o(),J())}),nm,{kind:"mutation",auth:"admin"}),testCreationField:b(d({type:N(H),key:o(),value:J(),formValues:Y(o(),J()).optional()}),Jv,{kind:"mutation",auth:"admin"})}},Bb=d({childKey:o(),section:o(),order:l().optional(),collapsed:A().optional()}),hF=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional()}),Fb=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(),hF).optional()}),Hw=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),icon:o().min(1).optional()}),Yd=d({id:l(),stableId:o(),addonId:o(),type:N(H),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),online:A(),probed:A().optional(),features:w(o()),isCamera:A(),config:Y(o(),J()),metadata:Y(o(),J()).nullable().optional(),sourceInfo:Su.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Bb).readonly().optional(),display:Fb.optional()}),gF=d({key:o(),value:J(),description:o().optional()}),lI=N(["manual"]),cI=d({deviceId:l(),name:o(),location:o().nullable(),features:w(o()),producesTrackedEvents:A().optional()}),vF=d({deviceId:l(),mode:lI,devices:w(cI)}),dg=d({deviceId:l(),entries:w(d({capName:o(),kind:N(["native","wrapped"]),providerAddonId:o(),providerNodeId:o(),nativeAddonId:o()}))}),yF=d({id:l(),stableId:o(),type:o(),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional()}),bF=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(),J()).nullable().optional(),sourceInfo:Su.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Bb).readonly().optional(),role:o().nullable().optional(),display:Fb.optional()}),SF=J().nullable(),xF=d({streamId:o(),width:l().optional(),height:l().optional(),codec:o().optional(),fps:l().optional(),bitrateKbps:l().optional()}),kF=d({addonId:o(),stableId:o(),id:l(),type:o(),name:o(),location:o().nullable().optional(),disabled:A().optional(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),config:Y(o(),J())}),wF=d({deviceId:l()}),MF=d({deviceId:l(),data:Y(o(),J())}),CF=N(["off","on","not-offered","unreachable"]),AF=d({deviceId:l(),switchId:yu,outcome:CF,detail:o().optional()}),EF=d({sourceId:l(),targetId:l(),switches:w(AF).readonly(),sourceStillLive:w(yu).readonly(),swapped:A()}),RF={name:"device-manager",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{allocateDeviceId:b(d({addonId:o(),stableId:o()}),d({id:l()}),{kind:"mutation"}),migrateDevice:b(d({sourceId:l(),targetId:l()}),EF,{kind:"mutation",auth:"admin",timeoutMs:12*6e4}),registerDevice:b(kF,O(),{kind:"mutation"}),removeDevice:b(wF,O(),{kind:"mutation"}),persistConfig:b(MF,O(),{kind:"mutation"}),loadConfig:b(d({deviceId:l()}),Y(o(),J())),loadRuntimeState:b(d({deviceId:l()}),Y(o(),J())),loadMeta:b(d({deviceId:l()}),bF.nullable()),setName:b(d({deviceId:l(),name:o()}),O(),{kind:"mutation",auth:"admin"}),setLocation:b(d({deviceId:l(),location:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setType:b(d({deviceId:l(),type:N(H)}),O(),{kind:"mutation",auth:"admin"}),setIntegrationId:b(d({deviceId:l(),integrationId:o()}),O(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:b(d({deviceId:l(),linkDeviceId:l().nullable()}),O(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:b(d({deviceId:l(),primaryChildEntityId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setChildLayout:b(d({deviceId:l(),childLayout:w(Bb).readonly()}),O(),{kind:"mutation",auth:"admin"}),setDisplay:b(d({deviceId:l(),display:Fb.nullable()}),O(),{kind:"mutation",auth:"admin"}),getRoleDisplayDefaults:b(d({}),d({defaults:Y(o(),Hw)}),{kind:"query"}),setRoleDisplayDefaults:b(d({defaults:Y(o(),Hw)}),O(),{kind:"mutation",auth:"admin"}),getWireableFields:b(d({deviceId:l(),includeSynthesizable:A().optional()}),d({caps:w(d({cap:o(),fields:w(d({path:o(),kind:N(["string","number","boolean","enum"]),enumValues:w(o()).optional(),item:A().optional()})).readonly(),itemArray:d({path:o(),keyField:o()}).optional()})).readonly()}),{kind:"query"}),setRole:b(d({deviceId:l(),role:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),applyInitialMeta:b(d({deviceId:l(),name:o().optional(),location:o().nullable().optional(),type:N(H).optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),role:o().nullable().optional()}),O(),{kind:"mutation",auth:"admin"}),setMetadata:b(d({deviceId:l(),patch:Y(o(),J())}),O(),{kind:"mutation",auth:"admin"}),listLocations:b(O(),w(o())),addLocation:b(d({name:o()}),O(),{kind:"mutation",auth:"admin"}),removeLocation:b(d({name:o(),cascade:A().optional()}),O(),{kind:"mutation",auth:"admin"}),renameLocation:b(d({from:o(),to:o()}),d({moved:l()}),{kind:"mutation",auth:"admin"}),listLocationIcons:b(O(),w(uF)),setLocationIcon:b(d({location:o(),icon:tm.nullable()}),O(),{kind:"mutation",auth:"admin"}),listLocationDescriptions:b(O(),w(dF)),setLocationDescription:b(d({location:o(),description:o().max(400).nullable()}),O(),{kind:"mutation",auth:"admin"}),listSiteZones:b(O(),w(pF)),setSiteZone:b(d({name:o(),icon:tm.nullable().optional()}),O(),{kind:"mutation",auth:"admin"}),removeSiteZone:b(d({name:o()}),O(),{kind:"mutation",auth:"admin"}),renameSiteZone:b(d({from:o(),to:o()}),O(),{kind:"mutation",auth:"admin"}),setLocationZone:b(d({location:o(),zone:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setDisabled:b(d({deviceId:l(),disabled:A()}),O(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:b(d({addonId:o()}),w(yF)),listAll:b(d({addonId:o().optional(),projection:N(["full","slim"]).optional(),isCamera:A().optional(),deviceIds:w(l()).optional()}),w(Yd)),getDevice:b(d({deviceId:l()}),Yd.nullable()),getChildren:b(d({parentDeviceId:l()}),w(Yd)),getChildrenBatch:b(d({parentDeviceIds:w(l()).max(256)}),Y(o(),w(Yd))),getLinkedDevices:b(d({deviceId:l()}),d({mode:lI,devices:w(cI)})),getLinkedDevicesBatch:b(d({deviceIds:w(l())}),w(vF)),getStreamSources:b(d({deviceId:l()}),w(V8)),getConfigSchema:b(d({deviceId:l()}),w(gF)),getSettingsSchema:b(d({deviceId:l()}),SF),updateConfig:b(d({deviceId:l(),values:Y(o(),J())}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),enable:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),remove:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:b(d({integrationId:o()}),d({removed:l()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:b(d({deviceId:l()}),Y(o(),o().nullable())),setStreamProfileMap:b(d({deviceId:l(),profileMap:Y(o(),o().nullable())}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:b(d({deviceId:l()}),w(xF),{kind:"mutation",auth:"admin"}),getBindings:b(d({deviceId:l()}),dg),getBindingsBatch:b(d({deviceIds:w(l())}),w(dg)),getAllBindings:b(d({}),w(dg)),setWrapperActive:b(d({deviceId:l(),capName:o(),wrapperAddonId:o(),active:A()}),O(),{kind:"mutation",auth:"admin"}),listWrappersForCap:b(d({capName:o()}),w(o())),listBindableCapsForDeviceType:b(d({deviceType:o()}),w(d({capName:o(),wrappers:w(o())}))),getDeviceSettingsAggregate:b(d({deviceId:l()}),_o.nullable()),getDeviceLiveInfoAggregate:b(d({deviceId:l()}),_o.nullable()),getDeviceAggregate:b(d({deviceId:l()}),d({settings:_o.nullable(),live:_o.nullable()})),runDeviceAction:b(d({deviceId:l().int().nonnegative(),action:o().min(1),input:J()}),J(),{kind:"mutation"}),updateDeviceField:b(d({deviceId:l(),writerCapName:o(),writerAddonId:o(),key:o(),value:J()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:b(d({deviceId:l(),changes:w(d({writerCapName:o(),writerAddonId:o(),key:o(),value:J()}))}),d({success:Q(!0),failures:w(d({writerCapName:o(),writerAddonId:o(),error:o()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:b(d({addonId:o()}),w(Ws),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({addonId:o(),candidate:Ws,integrationId:o().optional()}),nm,{kind:"mutation",auth:"admin"}),getCreationSchema:b(d({addonId:o(),type:N(H)}),J().nullable()),createDevice:b(d({addonId:o(),type:N(H),config:Y(o(),J()),integrationId:o().optional()}),nm,{kind:"mutation",auth:"admin"}),testCreationField:b(d({addonId:o(),type:N(H),key:o(),value:J(),formValues:Y(o(),J()).optional()}),Jv,{kind:"mutation",auth:"admin"}),adoptionListCandidateFilters:b(d({addonId:o(),integrationId:o()}),d({filters:w(tI)}),{auth:"admin"}),adoptionListCandidates:b(nI.extend({addonId:o()}),aI,{auth:"admin"}),adoptionRefresh:b(d({addonId:o(),integrationId:o()}),Yv,{kind:"mutation",auth:"admin"}),adoptionAdopt:b(Xv.extend({addonId:o()}),iI,{kind:"mutation",auth:"admin"}),adoptionRelease:b(rI.extend({addonId:o()}),O(),{kind:"mutation",auth:"admin"}),adoptionStartJob:b(Xv.extend({addonId:o()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),adoptionListJobs:b(d({addonId:o(),integrationId:o().optional()}),w(Eq).readonly(),{auth:"admin"}),adoptionCancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),adoptionResync:b(oI,sI,{kind:"mutation",auth:"admin"}),discoveryProviders:b(d({}),d({providers:w(d({addonId:o(),label:o()})).readonly()}),{auth:"admin"}),discoverAllProviders:b(d({}),d({groups:w(d({addonId:o(),label:o(),candidates:w(Ws).readonly(),error:o().nullable()})).readonly()}),{kind:"mutation",auth:"admin"}),discoverProvider:b(d({addonId:o(),params:Y(o(),J()).optional()}),d({candidates:w(Ws).readonly()}),{kind:"mutation",auth:"admin"}),providerCreationType:b(d({addonId:o()}),d({deviceType:N(H).nullable()}),{auth:"admin"}),providerDiscoveryParamsSchema:b(d({addonId:o()}),J(),{auth:"admin"}),testField:b(d({deviceId:l(),key:o(),value:J()}),Jv,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:b(d({deviceId:l(),caps:w(o()).readonly().optional()}),Y(o(),J().nullable())),getDeviceStatusAggregateBatch:b(d({deviceIds:w(l()).readonly(),caps:w(o()).readonly().optional()}),Y(o(),Y(o(),J().nullable())))}},IF={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:b(d({deviceId:l()}),Y(o(),Y(o(),J()))),getCapSlice:b(d({deviceId:l(),capName:o()}),Y(o(),J()).nullable()),getAllSnapshots:b(d({}),Y(o(),Y(o(),Y(o(),J())))),setCapSlice:b(d({deviceId:l(),capName:o(),slice:Y(o(),J())}),O(),{kind:"mutation"})},events:{onChanged:Po(d({deviceId:l(),capName:o(),slice:Y(o(),J())}))}},$w=d({embedding:w(l()),inferenceMs:l()}),TF=d({modelId:o(),embeddingDim:l(),ready:A()}),_F={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:b(d({crop:$t(Uint8Array),width:l(),height:l()}),$w,{auth:"admin"}),encodeText:b(d({text:o()}),$w,{auth:"admin"}),getInfo:b(O(),TF,{auth:"admin"})}},NF=d({reason:o(),count:l().int().nonnegative()}),uI=d({family:o(),deviceId:l().int().positive(),variant:o().optional(),sinceMs:l(),atMs:l(),attempts:l().int().nonnegative(),succeeded:l().int().nonnegative(),reasons:w(NF).readonly()}),OF={name:"failure-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(uI).readonly())},mount:{kind:"skip"}},jF=d({name:o(),path:o()}),PF=d({path:o(),entries:w(jF).readonly(),freeBytes:l(),totalBytes:l()}),DF={name:"filesystem-browse",scope:"system",mode:"singleton",internal:!0,methods:{listAllowedRoots:b(O(),w(o()).readonly(),{auth:"admin"}),browse:b(d({path:o()}),PF,{auth:"admin"}),createDir:b(d({path:o()}),d({path:o()}),{kind:"mutation",auth:"admin"})}},Fc=6e5,zF=60*6e4,LF=d({inputTokens:l(),outputTokens:l()}),qF=N(["timeout","rate-limited","auth","refusal","bad-request","unavailable","no-profile","budget-exceeded","adapter-error"]),BF=d({ok:Q(!0),text:o(),model:o(),usage:LF,truncated:A(),latencyMs:l()}),FF=d({ok:Q(!1),code:qF,message:o(),retryAfterMs:l().optional()}),wp=wt("ok",[BF,FF]),dI=d({bytes:$t(Uint8Array),mimeType:o()}),pI=d({enabled:A().default(!1),maxAttempts:l().int().min(1).max(5).default(1)}),Ub=d({addonId:o().optional(),profileId:o().optional(),consumer:o(),system:o().optional(),prompt:o(),jsonSchema:Y(o(),J()).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:pI.optional(),requestId:o().optional()}),UF=d({url:o(),filename:o(),sizeBytes:l(),sha256:o().optional()}),jm=wt("kind",[d({kind:Q("catalog"),catalogId:o()}),d({kind:Q("url"),url:o(),sha256:o().optional(),label:o().optional(),sizeBytes:l().optional(),extraFiles:w(UF).optional()}),d({kind:Q("path"),path:o()})]),Hb=d({nodeId:o(),engine:N(["llama-cpp"]),model:jm,contextSize:l().int().default(4096),gpuLayers:l().int().default(0),threads:l().int().optional(),parallel:l().int().default(1),batchSize:l().int().positive().optional(),ubatchSize:l().int().positive().optional(),flashAttention:A().default(!1),mlock:A().default(!1),noMmap:A().default(!1),cacheTypeK:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),cacheTypeV:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),extraArgs:w(o()).default([]),autoStart:A().default(!1),idleStopMinutes:l().int().default(30)}),HF=d({phase:N(["downloading","verifying"]),file:o(),fileIndex:l().int(),fileCount:l().int(),downloadedBytes:l(),totalBytes:l().optional()}),Jc=d({nodeId:o(),state:N(["stopped","downloading","starting","ready","crashed","failed"]),pid:l().optional(),port:l().optional(),modelPath:o().optional(),modelId:o().optional(),downloadProgress:l().min(0).max(1).optional(),download:HF.optional(),lastError:o().optional(),crashesInWindow:l(),memoryBytes:l().optional(),vramBytes:l().optional()}),mI=d({file:o(),sizeBytes:l(),catalogId:o().optional(),installedAt:l().optional(),path:o().optional()}),fI=d({nodeId:o(),modelsBytes:l(),freeBytes:l().optional()}),$F=Ub.extend({images:w(dI).optional(),runtime:Hb,timeoutMs:l().int().positive().optional()}),QF={name:"llm-runtime",scope:"system",mode:"singleton",internal:!0,methods:{complete:b($F,wp,{kind:"mutation",auth:"admin",timeoutMs:Fc}),ensureStarted:b(d({runtime:Hb}),Jc,{kind:"mutation",auth:"admin",timeoutMs:Fc}),stop:b(d({}),O(),{kind:"mutation",auth:"admin"}),status:b(d({}),Jc,{auth:"admin"}),installModel:b(d({model:jm}),O(),{kind:"mutation",auth:"admin",timeoutMs:zF}),deleteModel:b(d({file:o()}),O(),{kind:"mutation",auth:"admin"}),listLocalModels:b(d({}),w(mI),{auth:"admin"}),getDiskUsage:b(d({}),fI,{auth:"admin"})}},hI=N(["openai-compatible","openai","anthropic","google","managed-local"]),pg=d({id:o(),name:o(),kind:hI,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:pI.default({enabled:!1,maxAttempts:1}),toolsEnabled:A().default(!1),extraHeaders:Y(o(),o()).optional(),runtime:Hb.optional()}),VF=J(),GF=d({kind:hI,label:o(),icon:o(),addonId:o(),configSchema:VF}),gI=tt([d({consumer:o()}),d({purpose:N(["text","vision"])})]),ZF=d({selector:gI,profileId:o()}),KF=d({day:o(),consumer:o(),profileId:o(),calls:l(),okCalls:l(),errorCalls:l(),inputTokens:l(),outputTokens:l(),avgLatencyMs:l()}),WF=d({id:o(),label:o(),family:o(),purpose:N(["text","vision"]),url:o(),sha256:o(),sizeBytes:l(),quantization:o(),minRamBytes:l(),contextSizeDefault:l().int(),mmprojUrl:o().optional()}),YF=wt("ok",[d({ok:Q(!0),model:jm,label:o(),repo:o(),quantization:o(),purpose:N(["text","vision"]),totalBytes:l(),extraFilenames:w(o())}),d({ok:Q(!1),code:o(),message:o(),candidates:w(o()).optional(),requiredBytes:l().optional()})]),XF=d({nodeId:o(),reachable:A(),status:Jc.optional(),disk:fI.optional(),error:o().optional()}),JF=Ub.extend({images:w(dI).min(1)}),Bs=d({addonId:o(),profileId:o()}),eU={name:"llm",scope:"system",mode:"collection",internal:!1,providerKind:"ai",nodeIdMode:"data",methods:{generate:b(Ub,wp,{kind:"mutation",timeoutMs:Fc}),generateVision:b(JF,wp,{kind:"mutation",timeoutMs:Fc}),cancel:b(d({addonId:o().optional(),requestId:o()}),O(),{kind:"mutation"}),listProfileKinds:b(d({}),w(GF)),listProfiles:b(d({}),w(pg)),upsertProfile:b(d({profile:pg}),pg,{kind:"mutation",auth:"admin"}),deleteProfile:b(Bs,O(),{kind:"mutation",auth:"admin"}),testProfile:b(Bs,wp,{kind:"mutation",auth:"admin",timeoutMs:Fc}),listModels:b(Bs,w(o())),getDefaults:b(d({}),w(ZF)),setDefault:b(d({selector:gI,profileId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),getUsage:b(d({since:l().optional(),until:l().optional(),consumer:o().optional(),profileId:o().optional()}),w(KF)),listModelCatalog:b(d({}),w(WF)),listRuntimeNodes:b(d({}),w(XF)),listNodeModels:b(d({nodeId:o()}),w(mI)),resolveModelRef:b(d({ref:o(),maxBytes:l().positive().optional()}),YF,{kind:"mutation",auth:"admin"}),installModel:b(d({nodeId:o(),model:jm}),O(),{kind:"mutation",auth:"admin"}),deleteModel:b(d({nodeId:o(),file:o()}),O(),{kind:"mutation",auth:"admin"}),getRuntimeStatus:b(Bs,Jc),startRuntime:b(Bs,Jc,{kind:"mutation",auth:"admin"}),stopRuntime:b(Bs,O(),{kind:"mutation",auth:"admin"})}},tU=["decode","transcode","recording","streaming","detection"],nU=["measured","accounted","unattributable"],vI=d({role:N(tU),deviceId:l().int().positive().nullable(),attribution:N(nU),unit:o(),pid:l().int().positive().optional(),startedAtMs:l().optional(),cpuSeconds:l().optional(),rssBytes:l().optional()}),aU={name:"load-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(vI).readonly())},mount:{kind:"skip"}},iU=d({armed:l().int().min(0),unknown:w(o()).readonly()}),rU={name:"log-channels",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(DR).readonly()),apply:b(d({windows:w(A7).readonly()}),iU,{kind:"mutation"})},mount:{kind:"skip"}},yI=N(["debug","info","warn","error"]),Qw=d({timestamp:Fv(),level:yI,scope:w(o()),message:o(),meta:Y(o(),J()).optional(),tags:Y(o(),o()).optional()}),oU={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:b(Qw,O(),{kind:"mutation"}),query:b(d({scope:w(o()).optional(),level:yI.optional(),since:Fv().optional(),until:Fv().optional(),limit:l().optional(),tags:Y(o(),o()).optional()}),w(Qw).readonly())},mount:{kind:"skip"}},$b=N(["primary","second-factor"]),sU=d({kind:Q("redirect"),id:o(),label:o(),icon:o().optional(),startUrl:o(),stage:$b}),lU=d({kind:Q("widget"),id:o(),addonId:o(),bundle:o(),remote:$R,stage:$b}),cU=d({kind:Q("passkey"),id:o(),label:o(),stage:$b,rpId:o(),origin:o().nullable()}),uU=wt("kind",[sU,lU,cU]),dU={name:"login-method",scope:"system",mode:"collection",internal:!0,methods:{getLoginMethods:b(O(),w(uU).readonly())},mount:{kind:"skip"}},pU=d({total:l(),user:l(),system:l(),irq:l(),nice:l(),loadAvg:gu([l(),l(),l()]),cores:l()}),mU=d({percent:l(),totalBytes:l(),usedBytes:l(),availableBytes:l(),swapUsedBytes:l(),swapTotalBytes:l()}),fU=d({readBytes:l(),writeBytes:l(),readOps:l(),writeOps:l(),timestampMs:l()}),hU=d({rxBytes:l(),txBytes:l(),rxPackets:l(),txPackets:l(),rxErrors:l(),txErrors:l(),timestampMs:l()}),bI=d({utilization:l(),model:o(),memoryUsedBytes:l(),memoryTotalBytes:l(),temperature:l().nullable()}),gU=d({openFds:l(),threadCount:l(),activeHandles:l(),activeRequests:l()}),Vw=d({avg10:l(),avg60:l(),avg300:l()}),mg=d({some:Vw,full:Vw.nullable()}),Gw=d({cpu:pU,memory:mU,gpu:bI.nullable(),network:hU,disk:fU,pressure:d({cpu:mg.nullable(),memory:mg.nullable(),io:mg.nullable()}),process:gU,cpuTemperature:l().nullable(),timestampMs:l()}),vU=d({path:o(),totalBytes:l(),usedBytes:l(),availableBytes:l(),percent:l()}),Zw=d({pid:l(),cpu:l(),memory:l(),privateBytes:l().optional(),sharedBytes:l().optional()}),yU=d({addonId:o(),nodeId:o(),role:N(["hub","worker"]),pid:l(),state:N(["starting","running","stopping","stopped","crashed"]),uptimeSec:l()}),bU=d({pid:l(),ppid:l(),pgid:l(),classification:N(["root","managed","system"]),addonId:o().nullable(),nodeId:o().nullable(),command:o(),cpuPercent:l(),memoryRssBytes:l(),cpuMainPercent:l().nullable(),cpuGcPercent:l().nullable(),threadCount:l().nullable(),uptimeSec:l()}),SU=d({source:N(["cgroup-v2","cgroup-v1"]),currentBytes:l(),limitBytes:l().nullable(),anonBytes:l().nullable(),fileBytes:l().nullable(),shmemBytes:l().nullable(),slabBytes:l().nullable(),gpuShmemBytes:l().nullable()}).extend({atMs:l()}),xU=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()}),kU=d({key:o(),kind:N(["addon","root","unattributed"]),points:w(xU).readonly()}),wU=d({nodeId:o(),series:w(kU).readonly(),containerMemory:w(SU).readonly(),bucketMs:l(),retainedSamples:l(),oldestAtMs:l().nullable(),cadenceMs:l(),durable:A()}),MU=d({forNodeId:o(),sinceMs:l().optional(),maxPoints:l().int().positive().optional()}),CU=d({cpuPercent:l(),memoryPercent:l(),memoryUsedMB:l(),memoryTotalMB:l(),diskPercent:l().optional(),temperature:l().optional(),gpuPercent:l().optional(),gpuMemoryPercent:l().optional()}),AU={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:b(O(),Gw),getCached:b(O(),Gw.nullable()),getCurrent:b(O(),CU),getDiskSpace:b(d({dirPath:o()}),vU),getGpuInfo:b(O(),bI.nullable()),getCpuTemperature:b(O(),l().nullable()),getProcessStats:b(d({pids:w(l())}),w(Zw)),listAddonInstances:b(O(),w(yU).readonly()),getAddonStats:b(d({addonId:o()}),Zw.nullable()),listNodeProcesses:b(O(),w(bU).readonly()),getLoadSeries:b(MU,wU)}},EU=d({sourceUrl:o(),metadata:_7,targets:w(T7).min(1).readonly(),calibrationRef:o().optional(),sessionId:o().optional()}),RU={name:"model-convert",scope:"system",mode:"singleton",internal:!0,methods:{convert:b(EU,O7,{kind:"mutation",auth:"admin",timeoutMs:6e5})}},IU=d({nodeId:o(),modelId:o(),format:N(Nm),entry:zb}),TU=d({ok:A(),sha256:o(),bytes:l(),path:o()}),_U={name:"model-distributor",scope:"system",mode:"singleton",internal:!0,methods:{distributeModel:b(IU,TU,{kind:"mutation",auth:"admin"})}},am=d({bbox:dr,pixelCount:l(),intensity:l()}),NU=d({detected:A(),regionCount:l(),regions:w(am).readonly(),rawRegions:w(am).readonly(),frameWidth:l(),frameHeight:l(),analysisMs:l()}),OU={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{analyze:b(d({deviceId:l(),frame:Vv.optional(),frameHandle:rr.optional()}),NU,{kind:"mutation"}),removeCamera:b(d({deviceId:l()}),O(),{kind:"mutation"}),reset:b(O(),O(),{kind:"mutation"})},events:{onMotion:{data:d({deviceId:l(),detected:A(),regionCount:l()})}}},jU=N(["external","embedded"]),PU=N(["connected","disconnected","auth-failed","unreachable","tls-error"]),DU=d({id:o(),name:o(),url:o(),kind:jU,status:PU,latencyMs:l().nullable(),error:o().optional(),connectedClients:l().int().nonnegative().optional(),lastCheckedAt:l().optional()}),zU=d({url:o(),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),LU=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()}),qU=d({id:o()}),Xd=d({id:o()}),BU=wt("ok",[d({ok:Q(!0),latencyMs:l()}),d({ok:Q(!1),error:o()})]),FU=d({port:l().int().min(1).max(65535).default(1883),allowAnonymous:A().default(!1),username:o().optional(),password:o().optional()}),UU=d({id:o(),url:o()}),Kw=d({brokerCount:l(),embeddedRunning:A()}),HU={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Kw,kind:"poll"},methods:{listBrokers:b(O(),w(DU)),getBrokerConfig:b(Xd,zU),addBroker:b(LU,qU,{kind:"mutation"}),removeBroker:b(Xd,O(),{kind:"mutation"}),testConnection:b(Xd,BU,{kind:"mutation"}),startEmbeddedBroker:b(FU,UU,{kind:"mutation"}),stopEmbeddedBroker:b(Xd,O(),{kind:"mutation"}),getStatus:b(O(),Kw)}},im=d({url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),$U=d({connected:A(),endpoint:im.nullable(),error:o().optional()}),QU=im.extend({id:o(),label:o(),mode:o().optional(),sourcePort:l().optional()}),VU={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:b(O(),im,{kind:"mutation"}),stop:b(O(),O(),{kind:"mutation"}),getEndpoint:b(O(),im.nullable()),getStatus:b(O(),$U),listEndpoints:b(O(),w(QU).readonly())}},SI=N(["image","video","gif","audio","icon"]),GU=d({mediaType:SI,url:o().optional(),bytes:$t(Uint8Array).optional(),mime:o().optional(),name:o().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),Qb=N(["text","markdown","html"]),xI=N(["acknowledge","dismiss","silence","snooze","view","play","open","close","lock","unlock","arm","arm-home","arm-away","arm-night","disarm","light","alert","camera"]),ZU=d({id:o(),label:o(),url:o().optional(),icon:xI.optional(),destructive:A().optional(),mode:N(["navigate","background"]).optional()}),Ww=d({body:o(),title:o().optional(),format:Qb.default("text"),priority:l().int().min(1).max(5).default(3),level:o().optional(),attachments:w(GU).optional(),clickUrl:o().optional(),actions:w(ZU).optional(),sound:o().optional(),ttl:l().optional(),tag:o().optional(),deviceId:l().optional(),eventId:o().optional(),metadata:Y(o(),J()).optional()}),KU=d({id:o(),label:o(),ordinal:l().int().min(1).max(5).nullable(),flags:d({critical:A().optional(),silent:A().optional(),noPush:A().optional()}).optional(),requires:w(o()).optional(),description:o().optional()}),WU=d({mediaTypes:w(SI),mode:N(["url","bytes","both"]),max:l().int().nonnegative(),maxBytes:l().int().positive().optional()}),YU=d({attachments:WU,actions:l().int().nonnegative(),actionIcons:A().optional(),levels:w(KU),format:w(Qb),clickUrl:A(),sound:A(),ttl:A(),bodyMaxLen:l().int().positive()}),XU=J(),JU=d({kind:o(),label:o(),icon:o(),addonId:o(),iconUrl:o().optional(),iconMediaType:o().optional(),configSchema:XU,supportsDiscovery:A(),caps:YU}),fg=d({id:o(),name:o(),kind:o(),addonId:o(),enabled:A(),config:Y(o(),J())}),eH=d({kind:o(),suggestedName:o(),config:Y(o(),J())}),tH=d({level:o(),format:Qb,attachmentsSent:l().int().nonnegative(),actionsSent:l().int().nonnegative(),truncated:A(),dropped:w(o())}),kI=d({success:A(),error:o().optional(),renderedAs:tH.optional()}),nH=kI,aH={name:"notification-output",scope:"system",mode:"collection",methods:{listTargetKinds:b(d({}),w(JU)),listTargets:b(d({}),w(fg)),discoverTargets:b(d({kind:o(),config:Y(o(),J()).optional()}),w(eH)),send:b(d({targetId:o(),notification:Ww}),kI,{kind:"mutation"}),testTarget:b(d({targetId:o(),sample:Ww.optional()}),nH,{kind:"mutation"}),upsertTarget:b(d({target:fg}),fg,{kind:"mutation"}),deleteTarget:b(d({targetId:o()}),O(),{kind:"mutation"}),setTargetEnabled:b(d({targetId:o(),enabled:A()}),O(),{kind:"mutation"})}},iH=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"},{id:"package",name:"Package"}];new Set(iH.map(e=>e.id));var rH={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"}},oH=[{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"}],sH={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"}},lH={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"}},wI=new Map;for(const[e,t]of Object.entries(sH.mapping))wI.set(e.toLowerCase(),t);for(const[e,t]of Object.entries(lH.mapping))wI.set(e.toLowerCase(),t);var na={motion:"#f59e0b",audio:"#06b6d4",person:"#22c55e",vehicle:"#3b82f6",animal:"#f97316",package:"#a855f7",sensor:"#8b5cf6",control:"#10b981",genericDetection:"#64748b"},cH={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 uH(e){return e.split(/[-_ ]/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var xu=new Map;function Jr(e,t,n,a,s){xu.set(e,{kind:e,parentKind:null,level:"macro",category:t,color:n,iconId:a,labelKey:`eventKind.${e}`,label:s})}function An(e,t,n,a,s,p){xu.set(e,{kind:e,parentKind:t,level:"sub",category:n,color:a,iconId:s,labelKey:`eventKind.${e}`,label:p})}Jr("motion","motion",na.motion,"motion","Motion");Jr("audio","audio",na.audio,"audio","Audio");Jr("person","detection",na.person,"person","Person");Jr("vehicle","detection",na.vehicle,"vehicle","Vehicle");Jr("animal","detection",na.animal,"animal","Animal");Jr("package","package",na.package,"package","Package");Jr("sensor","sensor",na.sensor,"sensor","Sensor");Jr("control","control",na.control,"control","Control");for(const[e,t]of Object.entries(rH.mapping))t!=="vehicle"&&t!=="animal"||xu.has(e)||An(e,t,"detection",cH[e]??na.genericDetection,e,uH(e));An("package-delivered","package","package",na.package,"package","Package delivered");An("package-picked-up","package","package",na.package,"package","Package picked up");An("contact","sensor","sensor","#f59e0b","door","Contact");An("motion-sensor","sensor","sensor",na.sensor,"pir","Motion sensor");An("smoke","sensor","sensor","#ef4444","smoke","Smoke");An("flood","sensor","sensor","#3b82f6","water","Water leak");An("gas","sensor","sensor","#ef4444","gas","Gas");An("carbon-monoxide","sensor","sensor","#dc2626","smoke","Carbon monoxide");An("vibration","sensor","sensor","#eab308","vibration","Vibration");An("tamper","sensor","sensor","#f97316","tamper","Tamper");An("presence","sensor","sensor","#22c55e","presence","Presence");An("enum-sensor","sensor","sensor",na.sensor,"generic","Sensor state");An("device-event","sensor","sensor","#10b981","button","Device event");An("lock","control","control","#0ea5e9","lock","Lock");An("switch","control","control",na.control,"switch","Switch");An("siren","control","control","#dc2626","siren","Siren");An("button","control","control","#10b981","button","Button");An("doorbell","control","control","#a855f7","doorbell","Doorbell");for(const e of oH){const t=`audio-${e.id}`;xu.has(t)||An(t,"audio","audio",na.audio,t,e.name)}var Vb=Object.freeze(Object.fromEntries(xu)),hg=d({kind:o(),label:o(),parentKind:o().nullable()}),dH=d({videoClasses:w(hg),audioKinds:w(hg),labels:w(hg)});function gg(e,t,n){return{kind:e,label:t,parentKind:n}}function pH(){const e=Object.values(Vb);return{videoClasses:e.filter(t=>t.category==="detection").map(t=>gg(t.kind,t.label,t.parentKind)),audioKinds:e.filter(t=>t.category==="audio"&&t.level==="sub").map(t=>gg(t.kind,t.label,t.parentKind)),labels:e.filter(t=>t.category==="sensor"||t.category==="control").map(t=>gg(t.kind,t.label,t.parentKind))}}Object.freeze(pH());var mH=N(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),Gb=N(["home","away","night","vacation","custom_bypass"]),Yw=d({state:mH,availableModes:w(Gb),requiresCode:A(),lastChangedAt:l()}),fH={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.AlarmPanel],methods:{arm:b(d({deviceId:l().int().nonnegative(),mode:Gb,code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),disarm:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),trigger:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:Yw,kind:"push"},runtimeState:Yw,durability:"restored",volatileStateFields:["lastChangedAt"]},MI=d({x:l(),y:l()}),pl=d({kind:Q("rect"),x:l(),y:l(),width:l(),height:l()}),Pm=d({kind:Q("polygon"),points:w(MI)}),CI=d({kind:Q("grid"),gridWidth:l(),gridHeight:l(),cells:w(A())}),hH=d({kind:Q("line"),points:w(MI)});wt("kind",[pl,Pm,CI,hH]);var AI=N(["rect","polygon","grid","line"]),gH=d({min:l(),max:l()}),vH=d({width:l(),height:l()}),Zb=N(["immediate","track-end","device-event","package-event","system-event"]),Kb=N(["device-online","device-offline","device-disabled","device-enabled","device-battery-low","device-battery-normal","device-consumable-low","device-consumable-normal","stream-online","stream-offline","node-online","node-offline","node-inference-unavailable","detection-blind","addon-crash-loop","addon-update-available","server-update-available","wrapper-update-available","alarm-triggered","alarm-armed","alarm-disarmed","alarm-arming","alarm-arm-refused","addon-updated","server-updated","export-completed","backup-completed","camera-online","camera-offline","camera-disabled","camera-enabled"]),yH=new Set(["camera-online","camera-offline","camera-disabled","camera-enabled"]);Kb.options.filter(e=>!yH.has(e));var bH=d({kinds:w(Kb).min(1),deviceIds:w(l().int()).min(1).optional(),deviceTypes:w(o().min(1)).min(1).optional(),nodeIds:w(o().min(1)).min(1).optional(),packageNames:w(o().min(1)).min(1).optional()}),EI=1440,SH=d({days:w(l().int().min(0).max(6)).min(1),startMinute:l().int().min(0).max(1439),endMinute:l().int().min(0).max(1439)}),Dm=d({windows:w(SH).min(1),timezone:o().optional(),invert:A().optional()}),xH=d({values:w(o().min(1)),maxDistance:l().int().min(0).max(3).default(1)}),kH=d({zoneId:o().optional(),className:o().optional(),op:N(["became-occupied","became-free",">=","<="]).default("became-occupied"),count:l().int().min(0).default(1),sustainSeconds:l().int().min(0).max(3600).default(15)}),wH=d({labels:w(o().min(1)).min(1).optional(),dbThreshold:l().min(-96).max(0).optional(),hitPercent:l().int().min(1).max(100).default(60),samplingSeconds:l().int().min(1).max(300).default(10),confirmHits:l().int().min(1).max(20).optional(),confirmWindowSec:l().int().min(1).max(60).optional()}),MH=N(["enter","exit","any"]),CH=d({ids:w(o().min(1)).min(1),match:N(["any","all"]).default("any")}),AH=wt("kind",[d({kind:Q("wait"),seconds:l().min(0).max(300)}),d({kind:Q("cap"),deviceId:l().int(),cap:o().min(1),method:o().min(1),args:Y(o(),J()).optional()})]),EH=d({name:o().min(1).max(120),enabled:A(),minDelaySec:l().int().min(0).max(86400).optional(),actions:w(AH).min(1)}),RH=d({id:o().min(1).max(64),label:o().min(1).max(40),sequence:o().min(1).max(120),icon:xI.optional(),destructive:A().optional()}),IH=d({onTrigger:w(EH).optional(),buttons:w(RH).max(8).optional()}),TH=d({deviceId:l().int(),states:w(o().min(1)).min(1)}),_H=d({sceneId:o().min(1),deviceId:l().int().optional(),requiredState:N(["matched","diverged"]),latched:A().optional()}),Wb=d({deviceState:TH.optional(),scene:_H.optional(),devices:w(l()).optional(),classes:w(o().min(1)).optional(),classesExclude:w(o().min(1)).optional(),minConfidence:l().min(0).max(1).optional(),zones:CH.optional(),zonesExclude:w(o().min(1)).optional(),crossing:MH.optional(),labelEquals:w(o().min(1)).optional(),identities:w(o().min(1)).optional(),plates:xH.optional(),identitiesExclude:w(o().min(1)).optional(),minImportance:l().min(0).max(1).optional(),minDwellSeconds:l().min(0).optional(),source:N(["pipeline","onboard","sensor","audio","any"]).optional(),minLabelConfidence:l().min(0).max(1).optional(),eventTypeTokens:w(o().min(1)).optional(),sensorKinds:w(o().min(1)).optional(),packagePhase:N(["delivered","picked-up","both"]).optional(),systemEvent:bH.optional(),customZones:w(Pm).optional(),occupancy:kH.optional(),audio:wH.optional()}),RI=d({targetId:o().min(1),params:Y(o(),J()).optional()}),NH=N(["cropped","full","boxed"]),II=d({attach:N(["best","best-matching","keyFrame","none"]).default("best"),frame:NH.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:Ht.optional()}),OH=N(["shared","per-class"]),TI=d({cooldownSec:l().int().min(0).max(86400).default(60),scope:N(["rule","rule-device"]).default("rule-device"),granularity:OH.optional()}),jH=1e3,PH=2e4,DH=8e3,zH=d({op:N([">=",">","<=","<","=="]),count:l().int().min(0).max(1e3)}),LH=d({enabled:A().default(!1),profileId:o().optional(),prompt:o().max(1e3).optional(),expect:zH.optional(),timeoutMs:l().int().min(jH).max(PH).default(DH),onTimeout:N(["fire","suppress"]).default("fire"),maxImagePx:l().int().min(64).max(2048).default(448)}),rm=d({name:o().min(1).max(200),enabled:A().default(!0),delivery:Zb,conditions:Wb.default({}),schedule:Dm.optional(),targets:w(RI),targetUsers:w(o()).optional(),media:II.default({attach:"best"}),throttle:TI.default({cooldownSec:60,scope:"rule-device"}),template:d({title:o().max(500).optional(),body:o().max(2e3).optional()}).optional(),priority:l().int().min(1).max(5).default(3),ownerUserId:o().optional(),snoozeAllowGlobal:A().optional(),snoozeOptions:w(l().int().min(1).max(EI)).max(4).optional(),actions:IH.optional(),confirm:LH.optional(),waitForEnhancement:A().optional(),groupIdleSec:l().int().min(0).max(600).optional()}),qH=rm.partial().extend({disabledTargetIds:w(o()).optional(),enabled:A().optional(),conditions:Wb.optional(),media:II.optional(),throttle:TI.optional(),priority:l().int().min(1).max(5).optional()}),Jd=rm.extend({id:o(),createdBy:o(),createdAt:l(),updatedAt:l(),disabledTargetIds:w(o()).default([])}),BH=d({recordId:o(),recordKind:N(["object-event","track","device-event","package-event","system-event"]),deviceId:l(),timestamp:l(),wouldFire:A(),failedCondition:o().optional(),className:o().optional(),label:o().optional()}),_I=d({id:o(),group:N(["scope","class","zones","quality","label","schedule","device","package","occupancy","audio","system"]),label:o(),valueType:N(["deviceIdList","stringList","number01","number","sourceSelect","zoneSelection","zoneIdList","schedule","plateMatcher","packagePhase","crossingSelect","polygonDraw","occupancy","audio","deviceState","scene","systemEvent"]),operator:N(["in","notIn","anyOf","allOf","gte","fuzzyIn","withinSchedule"]),appliesTo:w(Zb),phase:o(),description:o().optional(),options:w(d({value:o(),label:o(),hint:o().optional()})).readonly().optional()}),NI=N(["pending","sent","dead"]),FH=N(["object-event","track-end","device-event","package-event","system-event"]),UH=d({className:o(),label:o().optional(),confidence:l().optional(),zones:w(o()),timestamp:l(),systemEvent:d({kind:Kb,subject:o(),title:o(),body:o(),data:Y(o(),J())}).optional()}),HH=d({id:o(),ruleId:o(),ruleName:o(),delivery:Zb,targetId:o(),deviceId:l(),recordKind:FH,recordId:o(),trackId:o().optional(),status:NI,attempts:l().int(),createdAt:l(),updatedAt:l(),error:o().optional(),subject:UH,artifactIds:w(o().min(1)).optional()}),$H=d({ruleId:o().optional(),deviceId:l().optional(),status:NI.optional(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100)}),OI=N(["rule","device","all"]),QH=d({scope:OI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),durationMinutes:l().int().min(1).max(EI),global:A().optional(),summary:A().optional()}),Xw=d({id:o(),userId:o(),scope:OI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),startedAt:l(),expiresAt:l(),global:A(),summary:A(),digestSentAt:l().optional()});d({snoozeId:o(),targetId:o(),ruleId:o(),ruleName:o(),deviceId:l().int(),count:l().int(),firstAt:l(),lastAt:l()});var jI=d({exitDelaySec:l().int().min(0).max(600),entryDelaySec:l().int().min(0).max(600),triggeredDurationSec:l().int().min(0).max(3600),announceArm:A(),announceTargets:w(o().min(1)).max(16)}),VH=jI.partial(),GH=N(["muted","detection-off","offline"]),ZH=d({deviceId:l().int(),reason:GH}),KH=d({mode:Gb,ruleCount:l().int().min(0),allDevices:A(),deviceIds:w(l().int()),skippedDevices:w(ZH).default([])}),Jw=d({deviceId:l().int().nullable(),settings:jI,coverage:w(KH)}),WH=d({deviceId:l().int().nonnegative().optional(),seconds:l().min(0).max(60),profile:Ht.optional(),ruleId:o(),ruleName:o(),reason:N(["window","occupancy"])}),YH=d({rulesLoaded:A(),asks:w(WH).readonly()}),XH={name:"notification-rules",scope:"system",mode:"singleton",methods:{listRules:b(d({}),d({rules:w(Jd)}),{auth:"admin"}),getRule:b(d({ruleId:o()}),d({rule:Jd.nullable()}),{auth:"admin"}),createRule:b(d({rule:rm}),d({rule:Jd}),{kind:"mutation",auth:"admin",caller:"required"}),updateRule:b(d({ruleId:o(),patch:qH}),d({rule:Jd}),{kind:"mutation",auth:"admin",caller:"required"}),deleteRule:b(d({ruleId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setRuleEnabled:b(d({ruleId:o(),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getClipRetentionAsks:b(d({}),YH,{auth:"admin"}),listDeviceMutes:b(d({}),d({mutedDeviceIds:w(l().int()).readonly()}),{auth:"admin"}),setDeviceMuted:b(d({deviceId:l().int(),muted:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),testRule:b(d({rule:rm,lookbackMinutes:l().int().min(1).max(1440).default(60)}),d({results:w(BH)}),{kind:"mutation",auth:"admin"}),getConditionCatalog:b(d({}),d({catalog:w(_I),taxonomy:dH.optional()})),getHistory:b(d({filter:$H.default({limit:100})}),d({entries:w(HH)}),{auth:"admin"}),resolveArtifactUrl:b(d({artifactId:o().min(1)}),d({url:o().nullable()}),{auth:"admin"}),listSnoozes:b(d({}),d({snoozes:w(Xw)}),{caller:"required"}),createSnooze:b(d({snooze:QH}),d({snooze:Xw}),{kind:"mutation",caller:"required"}),cancelSnooze:b(d({snoozeId:o()}),d({success:Q(!0)}),{kind:"mutation",caller:"required"}),getAlarmConfig:b(d({}),Jw,{auth:"admin"}),setAlarmConfig:b(d({patch:VH}),Jw,{kind:"mutation",auth:"admin"})}},Mp=N(["view","create","delete"]),PI=tt([Q("*"),w(o())]),DI=Y(o(),tt([Q("*"),w(o())])),JH=N(["device","system"]),e$=wt("kind",[d({kind:Q("all")}),d({kind:Q("ids"),ids:w(l().int()).min(1)}),d({kind:Q("types"),types:w(N(H)).min(1)}),d({kind:Q("locations"),locations:w(o().min(1)).min(1)})]),t$=d({type:Q("device"),selector:e$,access:w(Mp).min(1),includeLinked:A().optional()});function n$(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 Ia=yR(n$,wt("type",[d({type:Q("category"),target:JH,access:w(Mp).min(1)}),d({type:Q("capability"),target:o(),access:w(Mp).min(1)}),d({type:Q("addon"),target:o(),access:w(Mp).min(1)}),t$]));d({id:o(),username:o(),passwordHash:o(),isAdmin:A().default(!1),allowedProviders:PI,allowedDevices:DI,scopes:w(Ia).default([]),createdAt:l(),updatedAt:l()});d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:PI,allowedDevices:DI,tokenHash:o(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()});d({id:o(),userId:o(),name:o(),tokenHash:o(),tokenPrefix:o(),scopes:w(Ia),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()});var a$=d({integrationId:o(),displayName:o(),requestedScopes:w(Ia),allowedRedirectPrefixes:w(o()).min(1),allowedPrivateHostPaths:w(o()).optional(),requiresPkce:A().optional(),hubUrl:o().optional(),refreshTokenTtlSec:tt([l().int().positive(),Q("never")]).optional()}),i$={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:b(O(),a$,{auth:"admin"})}},r$=d({handle:rr,cropFrameSpace:d({x:l(),y:l(),w:l(),h:l()})});d({crop:d({left:l(),top:l(),width:l().positive(),height:l().positive()}).optional(),content:d({width:l().int().positive(),height:l().int().positive()}),fit:N(["stretch","contain"]),format:N(["rgb","gray","jpeg"])});var o$=d({registryId:o().min(1),id:o().min(1),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","gray"]),timestamp:l(),capturedAt:l().optional()}),ey=N(["onnx","coreml","openvino","tflite","pt","gguf"]),eu=N(["detector","cropper","classifier","refiner","audio-classifier"]),da=d({runtime:N(["node","python"]),backend:o(),format:ey,device:o().optional()}),s$=d({id:o(),label:o(),description:o().optional()}),l$=d({engine:da,devices:w(s$).readonly(),defaultDevice:o()}),ty=vu(()=>d({addonId:o(),addonName:o(),slot:eu,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),enabled:A(),modelId:o(),children:w(ty).readonly(),group:o().optional(),settings:Y(o(),J()).optional()})),om=vu(()=>d({addonId:o(),enabled:A(),modelId:o(),children:w(om).readonly(),settings:Y(o(),J()).optional()})),vg=d({id:o(),name:o(),createdAt:o(),updatedAt:o(),engine:da,steps:w(om).readonly()}),c$=d({id:o(),name:o(),formats:Y(o(),d({downloaded:A(),sizeMB:l()})),group:zR.optional(),legacy:A().optional(),provider:LR.optional()}),u$=si(),d$=d({id:o(),name:o(),slot:eu,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),childSlots:w(eu).readonly(),models:w(c$).readonly(),defaultModelId:o(),defaultModelIdByFormat:Y(o(),o()).optional(),enabledByDefault:A().optional(),backfillIntoExistingOverrides:A().optional(),defaultConfidence:l(),group:o().optional(),configSchema:w(u$).readonly().optional()}),p$=d({id:eu,label:o(),priority:l(),parentSlot:eu.nullable(),addons:w(d$).readonly()}),m$=d({availableEngines:w(l$).readonly(),selectedEngine:da,slots:w(p$).readonly()}),f$=d({runtimeId:N(["onnx","openvino","coreml","edgetpu"]).nullable(),device:o().nullable(),state:N(["idle","installing","verifying","ready","failed"]),progress:l().optional(),error:o().optional(),nextRetryAt:l().optional(),configIssues:w(o()).optional()}),Do=vu(()=>d({addonId:o(),modelId:o().optional(),enabled:A().default(!0),children:w(Do).optional(),settings:Y(o(),J()).optional(),jumpDeviceKey:o().optional()})),h$=d({addonId:o(),chosen:o(),running:o(),format:o()}),g$=d({addonId:o(),kind:N(["unknown-addon","no-format-build"]),detail:o()}),v$=d({ok:A(),issues:w(g$).readonly(),substitutions:w(h$).readonly(),format:o()}),y$=d({filename:o(),stepIds:w(o()).readonly().optional()}),b$=d({base64:o(),filename:o()}),S$=d({filename:o(),sizeKb:l()}),x$=d({base64:o()}),k$=d({id:o(),name:o(),description:o(),available:A(),rawLabels:w(o()).readonly().optional()}),w$=d({activeBackend:o(),availableBackends:w(k$).readonly(),sampleRate:l(),chunkDurationMs:l()}),M$=d({filePath:o(),sizeMB:l(),durationMs:l()}),C$=d({success:A(),error:o().optional(),frame:si().optional()}),A$=si(),E$=si(),R$=si(),I$=si(),T$=si(),ny=si(),_$={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:b(O(),w(da)),getSelectedEngine:b(O(),da),getDefaultSteps:b(da,w(ty)),getEngineProvisioning:b(d({nodeId:o()}),f$),getVideoPipelineSteps:b(O(),Y(o(),d({modelId:o(),settings:Y(o(),J()).readonly()}))),setVideoPipelineSteps:b(d({steps:Y(o(),d({modelId:o(),settings:Y(o(),J()).readonly()}))}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),clearDeviceOverrides:b(d({nodeId:o()}),d({success:Q(!0),clearedDevices:l()}),{kind:"mutation",auth:"admin"}),getInferenceDeviceHealth:b(d({nodeId:o()}),d({unhealthy:w(d({deviceKey:o(),state:N(["failed","backoff"]),since:l(),deaths:l(),lastError:o()})).readonly()})),rearmInferenceDevice:b(d({nodeId:o(),deviceKey:o()}),d({rearmed:A()}),{kind:"mutation",auth:"admin"}),getSchema:b(O(),m$),getGlobalSteps:b(O(),w(ty).readonly().nullable()),getGlobalPipelineConfig:b(O(),A$),getOrchestratorConfigSchema:b(O(),E$),validatePipeline:b(d({steps:w(Do)}),v$),listTemplates:b(O(),w(vg).readonly()),saveTemplate:b(d({name:o(),steps:w(om).readonly(),engine:da}),vg,{kind:"mutation"}),updateTemplate:b(d({id:o(),name:o().optional(),steps:w(om).readonly().optional()}),vg,{kind:"mutation"}),deleteTemplate:b(d({id:o()}),O(),{kind:"mutation"}),getCapabilities:b(O(),I$),getAddonModels:b(d({addonId:o()}),T$),downloadModel:b(d({addonId:o(),modelId:o(),format:ey}),M$,{kind:"mutation"}),deleteModel:b(d({addonId:o(),modelId:o(),format:ey}),d({success:Q(!0)}),{kind:"mutation"}),runPipeline:b(d({engine:da.optional(),steps:w(Do).min(1),frame:Vv.optional(),frameRef:o$.optional(),frameHandle:rr.optional(),imageBase64:o().optional(),image:$t(Uint8Array).optional(),referenceImage:o().optional(),deviceId:l().optional(),sessionId:o().optional(),plane:N(["full","frame"]).optional(),deviceKey:o().optional(),nativeCropRef:r$.optional()}),ny,{kind:"mutation"}),runPipelineBatch:b(d({engine:da.optional(),steps:w(Do).min(1),frames:w(Vv).min(1).max(255),deviceId:l().optional(),sessionId:o().optional(),frameId:l().int().nonnegative().optional(),deviceKey:o().optional()}),d({results:w(ny).readonly()}),{kind:"mutation"}),cacheFrameInPool:b(d({data:$t(Uint8Array),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","bgr","gray"])}),d({frameId:l(),width:l(),height:l()}),{kind:"mutation"}),inferCached:b(d({stepId:o(),frameId:l().int()}),Y(o(),J()),{kind:"mutation"}),uncacheFrame:b(d({frameId:l().int()}),O(),{kind:"mutation"}),getEffectiveTuning:b(O(),d({batchMode:o(),windowMs:l(),maxBatchSize:l(),concurrency:l()})),listLoadedEngines:b(O(),w(d({engineKey:o(),engine:da,modelsLoaded:w(o()).readonly(),inUseByCameras:w(l()).readonly(),kind:N(["runtime","warm-override","device-pool"]),poolPid:l().nullable(),idleMs:l().nullable(),idleTtlMs:l().nullable()})).readonly()),spinEngine:b(d({engine:da}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),killEngine:b(d({engine:da,force:A().optional()}),d({success:A(),reason:o().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:b(O(),w(y$).readonly()),getReferenceImage:b(d({filename:o()}),b$.nullable()),getReferenceAudioFiles:b(O(),w(S$).readonly()),getReferenceAudio:b(d({filename:o()}),x$.nullable()),getAudioCapabilities:b(O(),w$),runAudioTest:b(d({addonId:o(),modelId:o(),filename:o().optional(),settings:Y(o(),J()).optional()}),C$,{kind:"mutation"}),getDetectionConfigSchema:b(O(),R$)}},N$=N(["include","exclude"]),Io=d({id:o(),name:o().optional(),zoneIds:w(o()).min(1).readonly(),mode:N$,classFilter:w(o()).readonly().optional(),overlapThreshold:l().min(0).max(1).optional(),bboxInclusionPct:l().min(0).max(100).optional(),preferMask:A().optional(),enabled:A().default(!0)});w(Io).readonly();var O$=N(["polygon","tripwire"]),j$=d({x:l(),y:l()}),Ys=d({id:o(),name:o(),kind:O$.default("polygon"),polygon:w(j$).readonly(),color:o().default("#3b82f6")}),P$={name:"zones",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{listZones:b(d({deviceId:l()}),w(Ys).readonly()),addZone:b(d({deviceId:l(),zone:Ys}),O(),{kind:"mutation",auth:"admin"}),removeZone:b(d({deviceId:l(),zoneId:o()}),O(),{kind:"mutation",auth:"admin"}),updateZone:b(d({deviceId:l(),zone:Ys}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({zones:w(Ys).readonly()}),durability:"restored"},Yb=N(["new","entered","left","moving","idle"]),D$=N(["motion","object","audio"]),z$=wt("kind",[pl,Pm]),L$=N(["motion","audio","person","vehicle","animal","door","pir","smoke","water","button","package","generic"]),q$=N(["motion","audio","detection","sensor","control","custom","package"]),B$=N(["macro","sub"]),zI=d({kind:o(),labelKey:o(),label:o(),color:o(),iconId:o(),icon:L$,category:q$,parentKind:o().nullable(),level:B$,source:d({capName:o(),deviceId:l()})}),F$=d({deviceId:l(),kinds:w(zI).readonly()}),U$=d({id:o(),deviceId:l(),sourceDeviceId:l(),kind:o(),value:Y(o(),J()).nullable(),timestamp:l()}),LI=d({x:l(),y:l(),timestamp:l(),bbox:dr,source:N(["frame","recovery"]).optional(),score:l().optional()}),H$=d({timestamp:l(),position:LI,mediaId:l().int()}),$$=d({minX:l(),minY:l(),maxX:l(),maxY:l()}),qI=N(["full","slim"]),Q$=d({label:o(),peakScore:l(),count:l(),firstAt:l(),lastAt:l()}),Xb=N(["pipeline","onboard","sensor","audio"]),Jb=N(["none","staging","trained"]),e0={markForTrain:A().optional(),debug:A().optional(),debugNote:o().max(500).optional(),favourited:A().optional()},BI={retrainStatus:Jb.optional()},V$=d(e0),G$=d({trackId:o(),markForTrain:A(),debug:A(),debugNote:o(),favourited:A(),retrainStatus:Jb});tt([Q(1),Q(2)]);var eM=d({stepId:o(),modelId:o().optional(),decidedAt:l(),identityId:o().optional()}),t0={label:o().optional(),labelScore:l().optional(),labelMeta:eM.optional(),subLabel:o().optional(),subLabelScore:l().optional(),subLabelMeta:eM.optional()},Z$=d({deviceId:l(),tracks:l().int(),files:l().int(),bytes:l().int()}),K$=d({generatedAt:l(),trackCount:l().int(),fileCount:l().int(),byteCount:l().int(),truncated:A(),devices:w(Z$).readonly()}),Cp=d({trackId:o(),deviceId:l(),className:o(),...t0,producingDeviceName:o().optional(),source:Xb.optional(),firstSeen:l(),lastSeen:l(),positions:w(LI).readonly(),snapshots:w(H$).readonly(),zonesVisited:w(o()).readonly(),zoneNames:w(o()).readonly().optional(),classes:w(o()).readonly().optional(),totalDistance:l(),state:Yb,active:A(),importance:l().optional(),bestEventId:o().optional(),importanceReason:o().optional(),audioLabels:w(Q$).readonly().optional(),envelope:$$.optional(),hasFace:A().optional(),hasEmbeddedFace:A().optional(),hasRider:A().optional(),previewMissReason:o().optional(),...e0,...BI}),n0={id:l().int(),deviceId:l(),timestamp:l()},W$=d({...n0,kind:Q("motion"),regionCount:l(),regions:w(d({bbox:dr,pixelCount:l(),intensity:l()})).readonly().optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaUrl:o().optional(),durationMs:l().nullable().optional(),edges:w(l()).readonly().optional()}),a0=N(["pipeline","onboard"]),Y$=N(["enter","exit"]),X$=d({direction:Y$,zoneId:o(),zoneName:o().optional()}),J$=d({zoneId:o(),zoneName:o().optional(),overlapPct:l()}),FI=d({...n0,kind:Q("object"),source:a0.optional(),frameId:o().optional(),idempotencyKey:o().optional(),trackId:o().optional(),className:o(),...t0,confidence:l().optional(),bbox:dr.optional(),zones:w(o()).readonly().optional(),zoneOverlaps:w(J$).readonly().optional(),spawnRefused:o().optional(),state:Yb.optional(),zoneCrossing:X$.optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaId:l().int().optional(),keyFrameMediaId:l().int().optional(),mediaUrl:o().optional(),importance:l().optional()}),eQ=d({...n0,kind:Q("audio"),rms:l(),dbfs:l(),classification:d({className:o(),originalClass:o().optional(),score:l()}).optional(),mediaUrl:o().optional()}),ml=N(["crop","thumbnail","snapshot","firstFrame","lastFrame","fullFrame","fullFrameBoxed","faceCrop","plateCrop","keyFrame","keyFrameSmall","thumbnailSmall","confirmationCrop","debugCrop","sceneFrame"]),tQ=d({mediaId:l().int(),kind:ml,sizeBytes:l(),timestamp:l()}),ay=tQ.extend({url:o(),base64:o()}),tM=ay.omit({base64:!0}),nQ=N(["person","vehicle","animal","package","face","plate"]),aQ=N(["subject","model_error"]),iQ=N(["operator","assist"]),UI=d({x:l(),y:l(),w:l(),h:l()}),iy=d({id:o(),trackId:o(),deviceId:l(),mediaKey:o(),bbox:UI,macroClass:nQ,label:o().optional(),subLabel:o().optional(),kind:aQ,source:iQ,assistModelId:o().optional(),assistScore:l().optional(),exportedInBatch:o().optional(),createdAt:l()}),HI=iy.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),rQ=d({trackId:o(),deviceId:l(),className:o(),label:o().optional(),firstSeen:l(),lastSeen:l(),frameCount:l().int(),annotationCount:l().int()}),oQ=d({mediaId:l().int(),kind:ml,timestamp:l(),sizeBytes:l().int(),copied:A()}),$I=d({frameId:o(),deviceId:l(),trackId:o(),sourceMediaId:l().int(),sourceKind:ml,sizeBytes:l().int(),width:l().int(),height:l().int(),copiedAt:l()}),sQ=N(["source-missing","unreadable-image","write-failed"]),lQ=d({copied:w($I).readonly(),refused:w(d({sourceMediaId:l().int(),reason:sQ})).readonly()}),cQ=d({candidates:w(oQ).readonly(),copies:w($I).readonly(),autoPickMediaId:l().int().optional()}),uQ=wt("kind",[d({kind:Q("package"),zone:UI.optional()}),d({kind:Q("objects"),modelId:o(),minScore:l().optional()})]),dQ=wt("kind",[d({kind:Q("proposed"),modelId:o(),stepId:o(),minScore:l(),proposals:w(HI).readonly(),belowThreshold:l().int()}),d({kind:Q("refused"),reason:o(),detail:o().optional()})]),nM=d({trackId:o(),retrainStatus:Jb,changed:A(),reason:N(["unknown-track","no-frames-copied","not-staging","not-trained","unchanged"]).optional()}),QI=1e3,VI=5e3,ry=d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(VI).default(QI),projection:N(["full","slim"]).optional()}),pQ=ry.extend({classFilter:o().optional()}),mQ=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(1e3).default(200),cursor:o().optional(),projection:qI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Xb).optional()}),GI=d({id:o(),deviceId:l(),openedAt:l(),lastActiveAt:l(),sealedAt:l().nullable(),memberCount:l().int().nonnegative(),groupShotMediaId:l().int().nullable()}),fQ=d({deviceIds:w(l()).min(1),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(200).default(50),classes:w(o().min(1).max(60)).max(40).optional()}),hQ=d({trackId:o(),className:o().nullable(),role:N(["primary","sibling","child"]).nullable(),joinedAt:l(),label:o().optional(),subLabel:o().optional()}),gQ=d({summary:GI,members:w(hQ).readonly()}),ZI=d({summary:GI,classes:w(d({className:o().nullable(),count:l().int().positive()})).readonly()}),vQ=d({summaries:w(ZI).readonly()}),yQ=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100),cursor:o().optional(),classes:w(o().min(1).max(60)).max(40).optional()}),bQ=d({summaries:w(ZI).readonly(),nextCursor:o().nullable()}),SQ=d({tracks:w(Cp).readonly(),nextCursor:o().nullable()}),KI=50,WI=200,xQ=d({deviceId:l(),since:l(),until:l(),limit:l().int().min(1).max(WI).default(KI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),YI=d({id:o(),trackId:o(),timestamp:l(),className:o(),...t0,importance:l(),bestEventId:o(),windowMs:l().optional(),...e0,...BI}),kQ=d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),limit:l().int().min(1).max(WI).default(KI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),wQ=d({deviceId:l(),events:w(YI).readonly()}),XI=d({bucketStart:l(),motion:l().int(),object:l().int(),audio:l().int(),audioDbfs:l().optional()}),MQ=d({deviceId:l(),read:N(["read","unreadable"]),buckets:w(XI).readonly()});d({trackId:o(),className:o(),confidence:l(),bbox:dr,zones:w(o()).readonly(),state:Yb});var CQ=gw({id:o(),kind:N(["first-level","detail"]),macroClass:o(),score:l(),bbox:d({x:l(),y:l(),width:l(),height:l()}),labels:w(gw({label:o(),score:l()})).readonly(),parentId:o().optional()}),AQ=FI.extend({score:l()}),EQ=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)}),aM=d({tracks:l().int(),events:l().int(),media:l().int(),faces:l().int(),plates:l().int(),embeddings:l().int()}),RQ=d({mediaDropped:l().int(),tracks:l().int(),events:l().int()}),IQ=d({deviceId:l(),rows:l().int(),bytes:l().int()}),TQ=d({totalRows:l().int(),totalBytes:l().int(),devices:w(IQ).readonly()}),_Q=d({kind:ml,rows:l().int(),bytes:l().int()}),NQ=d({totalRows:l().int(),totalBytes:l().int(),kinds:w(_Q).readonly(),unaccountedRows:l().int(),unaccountedBytes:l().int()}),iM=d({motion:l().int(),object:l().int(),audio:l().int()}),OQ=d({deviceId:l().optional(),since:l().optional(),until:l().optional(),maxTracks:l().int().positive().optional(),executeOnNodeId:o().optional(),pacingMs:l().int().nonnegative().optional()}),jQ=d({deleted:l()}),PQ=d({started:A(),alreadyRunning:A()}),DQ=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()}),zQ=d({started:A(),alreadyRunning:A()}),LQ=d({mode:N(["report","reclaim"]).default("report"),scopes:w(N(["motion-still","track-filmstrip"])).min(1).optional(),deviceIds:w(l().int()).min(1).optional(),restart:A().optional(),pageSize:l().int().min(50).max(5e3).optional(),maxRowsPerDevice:l().int().min(1).max(5e5).optional(),maxReclaimPerDevice:l().int().min(1).max(5e5).optional(),maxBytesPerRun:l().int().min(1).optional(),budgetMinutes:l().int().min(1).max(720).optional(),throttleBytesPerSec:l().int().min(64*1024).optional(),graceMinutes:l().int().min(1).max(10080).optional()}),qQ=d({running:A(),mode:N(["report","reclaim"]).nullable(),totalExamined:l(),totalEligible:l(),totalReclaimed:l(),totalBytesReclaimed:l(),totalRefused:l(),devicesDone:l(),complete:A().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable(),error:o().nullable()}),BQ=d({timestamp:l(),frame:ny}),FQ=d({className:o(),firstSeenMs:l(),lastSeenMs:l(),bbox:dr,framesMatched:l().int()}),UQ=d({tracks:w(FQ).readonly()}),HQ=N(["motion","audio-dbfs","battery","occupancy"]),$Q=d({scope:o(),bucketStart:l().int(),samples:l().int().nonnegative(),sum:l(),min:l(),max:l()}),QQ={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:b(d({deviceId:l()}),w(Cp).readonly()),getTrack:b(d({deviceId:l(),trackId:o()}),Cp.nullable()),listTracks:b(d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().optional(),zone:z$.optional(),projection:qI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Xb).optional()}),w(Cp).readonly()),listRecentTracks:b(mQ,SQ),listSummaries:b(fQ,vQ),listRecentSummaries:b(yQ,bQ),getSummary:b(d({id:o()}),gQ.nullable()),clearTracks:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getMotionEvents:b(ry,w(W$).readonly()),getObjectEvents:b(pQ,w(FI).readonly()),getAudioEvents:b(ry,w(eQ).readonly()),listEventKinds:b(d({deviceId:l()}),w(zI).readonly()),listEventKindsBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w(F$).readonly()),getSensorEvents:b(d({deviceId:l(),since:l().optional(),until:l().optional(),kinds:w(o()).optional(),limit:l().int().min(1).max(VI).default(QI)}),w(U$).readonly()),getKeyEvents:b(xQ,w(YI).readonly()),getKeyEventsBatch:b(kQ,w(wQ).readonly()),readLongTermSeries:b(d({deviceId:l(),series:HQ,scope:o().optional(),from:l(),to:l(),limit:l().int().positive().optional()}),w($Q).readonly()),getEventDensity:b(d({deviceId:l(),since:l(),until:l(),bucketMs:l().int().positive()}),w(XI).readonly()),getEventDensityBatch:b(d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),bucketMs:l().int().positive()}),w(MQ).readonly()),pruneEventsBefore:b(d({deviceId:l(),cutoffMs:l()}),d({motion:l().int(),object:l().int(),audio:l().int()}),{kind:"mutation",auth:"admin"}),pruneTracksBefore:b(d({deviceId:l(),cutoffMs:l()}),aM,{kind:"mutation",auth:"admin"}),wipeAllAnalytics:b(d({deviceId:l()}),aM,{kind:"mutation",auth:"admin"}),reconcileFromDisk:b(d({deviceId:l()}),RQ,{kind:"mutation",auth:"admin"}),deleteTracks:b(d({deviceId:l(),trackIds:w(o()).min(1)}),d({deleted:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),setTrackFlags:b(d({deviceId:l(),trackId:o(),flags:V$}),G$,{kind:"mutation"}),listArchivedDebugNotes:b(jq,w(Oq).readonly(),{kind:"query"}),listBirthDecisions:b(Nq,w(_q).readonly(),{kind:"query"}),getEventStoreFootprint:b(d({}),TQ,{kind:"query",auth:"admin"}),getEventMediaFootprintByKind:b(d({deviceId:l().int().optional()}),NQ,{kind:"query",auth:"admin"}),pruneEvents:b(d({olderThanMs:l(),reason:Nb.optional()}),iM,{kind:"mutation",auth:"admin"}),deleteDeviceEvents:b(d({deviceId:l()}),iM,{kind:"mutation",auth:"admin"}),pauseForStorageMigration:b(Vr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(Vr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(Vr,d({refreshed:Q(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(Zq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),Xc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateMedia:b(jR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),countUnstampedEventMedia:b(d({}),Gq,{auth:"admin"}),countRelocatableMedia:b(f7,m7,{kind:"query",auth:"admin"}),listRelocateMediaJobs:b(d({}),w(Xc).readonly(),{kind:"query",auth:"admin"}),cancelRelocateMedia:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(ER,w(AR).readonly(),{kind:"query",auth:"admin"}),reclaimDebugMedia:b(LQ,zQ,{kind:"mutation",auth:"admin"}),getMediaReclaimStatus:b(d({}),qQ,{kind:"query",auth:"admin"}),getTrainingExportSummary:b(d({deviceIds:w(l()).optional()}),K$,{kind:"query",auth:"admin"}),getTrainingExportUrl:b(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),listRetrainStaging:b(d({deviceIds:w(l()).optional(),limit:l().int().min(1).max(500).optional()}),w(rQ).readonly(),{kind:"query",auth:"admin"}),listRetrainFrames:b(d({trackId:o()}),cQ,{kind:"query",auth:"admin"}),selectRetrainFrames:b(d({deviceId:l(),trackId:o(),mediaIds:w(l().int()).min(1)}),lQ,{kind:"mutation",auth:"admin"}),deselectRetrainFrame:b(d({deviceId:l(),trackId:o(),frameId:o()}),d({removed:A(),removedAnnotations:l().int()}),{kind:"mutation",auth:"admin"}),getRetrainFrameImage:b(d({frameId:o()}),d({base64:o(),width:l().int(),height:l().int()}),{kind:"query",auth:"admin"}),proposeRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),subject:uQ,nodeId:o().optional()}),dQ,{kind:"mutation",auth:"admin"}),runReplayFrameProcessor:b(d({deviceId:l(),source:a0,zones:w(Ys).readonly().optional(),detectionRules:w(Io).readonly().optional(),zoneMembershipMinOverlap:l().min(0).max(1).optional(),frames:w(BQ).min(1)}),UQ,{kind:"mutation",auth:"admin"}),listRetrainAnnotations:b(d({trackId:o()}),w(iy).readonly(),{kind:"query",auth:"admin"}),saveRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),annotations:w(HI)}),w(iy).readonly(),{kind:"mutation",auth:"admin"}),completeRetrainTrack:b(d({deviceId:l(),trackId:o()}),nM,{kind:"mutation",auth:"admin"}),restageRetrainTrack:b(d({deviceId:l(),trackId:o()}),nM,{kind:"mutation",auth:"admin"}),getRetrainExportUrl:b(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),getEventMedia:b(d({ownerType:xw,eventId:l().int(),kind:ml.optional(),deviceId:l()}),w(ay).readonly()),getTrackMedia:b(d({trackId:o(),kinds:w(ml).optional(),deviceId:l()}),w(ay).readonly()),listTrackMedia:b(d({trackId:o(),deviceId:l()}),w(tM).readonly()),listEventMedia:b(d({ownerType:xw,eventId:l().int(),deviceId:l()}),w(tM).readonly()),searchObjectEvents:b(EQ,w(AQ).readonly()),wipeObjectEmbeddings:b(d({}),jQ,{kind:"mutation",auth:"admin"}),rebuildObjectEmbeddings:b(OQ,PQ,{kind:"mutation",auth:"admin"}),getObjectEmbeddingRebuildStatus:b(d({}),DQ)},events:{onFrameTracked:{data:d({deviceId:l(),timestamp:l(),frameWidth:l(),frameHeight:l(),detections:w(CQ).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:D$,eventId:o(),timestamp:l()})}}};d({activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()});var i0=d({detectionMode:N(["disabled","always-on","on-motion"]),configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceTimeMs:l(),droppedFrames:l(),phase:N(["idle","watching","active"])}),VQ=i0.extend({deviceId:l()}),Uc=d({x:l(),y:l(),w:l(),h:l()}),GQ=d({bytes:$t(Uint8Array).optional(),jpeg:o().optional(),jpegBytes:$t(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),tier:N(["native","ram-fullframe"]).optional()}),rM=N(["keyFrame","thumbnail"]),ZQ=N(["handle-gone","encode-failed"]),KQ=wt("parked",[d({parked:Q(!0),nodeId:o(),width:l().int().positive(),height:l().int().positive(),bytes:l().int().nonnegative(),replaced:A()}),d({parked:Q(!1),nodeId:o(),reason:ZQ,handleAgeMs:l().nullable(),detail:o().optional()})]),WQ=d({jpeg:o().optional(),jpegBytes:$t(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),timestamp:l(),parkedAt:l()}),YQ=d({bbox:Uc,className:o()}),JI=d({stepId:o(),className:o(),score:l(),bbox:Uc.optional(),embedding:o().optional(),embeddingMagnitude:l().optional(),embeddingModelId:o().optional(),label:o().optional(),labelTier:tt([Q(1),Q(2)]).optional(),labelModelId:o().optional(),alignedCropJpeg:o().optional(),nativeFaceShortSidePx:l().optional()}),XQ=N(["unknown-step","model-not-servable","unreadable-frame","execution-failed"]),JQ=wt("kind",[d({kind:Q("ran"),nodeId:o(),modelId:o(),details:w(JI)}),d({kind:Q("refused"),nodeId:o(),reason:XQ,detail:o()})]),oM={min:0,default:3e4},sM={min:0,max:6e5},lM={min:5e3,max:6e5},yg={min:1,max:30,default:4},bg={min:1,max:30,default:10},Sg={min:0,max:300,default:300},xg={min:1,max:10,default:4},kg={min:0,max:30,default:12},r0=N(["onboard","analyzer","device-activity"]),eV=w(r0),tV=yR(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,w(a0).max(1)),nV=d({deviceId:l(),detected:A(),source:r0.default("analyzer"),regions:w(am).readonly().optional()}),aV=wt("kind",[d({kind:Q("local-broker")}),d({kind:Q("remote-restream"),ownerNodeId:o(),ownerReachableHost:o().optional(),hubHostnameOverride:o().optional()})]).describe("Per-camera frame-source mode for the runner (P2c)"),iV=d({deviceKey:o(),weight:l().positive().default(1),maxSessions:l().int().positive().nullable().default(null)}),rV=d({deviceId:l(),detectionMode:N(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:N(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:l().min(oM.min).default(oM.default),maxSessionHoldMs:l().min(sM.min).max(sM.max).optional(),audioMotionWindowMs:l().min(lM.min).max(lM.max).optional(),motionFps:l().min(yg.min).max(yg.max).default(yg.default),detectionFps:l().min(bg.min).max(bg.max).default(bg.default),motionStreamId:o(),detectionStreamId:o(),audioStreamPick:Q8.optional(),motionSources:eV.default(["analyzer"]),detectionSources:tV.default(["pipeline"]),pipelineEnabled:A().default(!0),steps:w(Do).readonly().optional(),audio:d({modelId:o().optional(),enabled:A()}).nullable().optional(),zones:w(Ys).readonly().default([]),onboardMotionDrivesAnalyzer:A().default(!0),preRollInferenceEnabled:A().default(!0),preRollInferenceFrames:l().min(kg.min).max(kg.max).default(kg.default),occupancyRecheckEnabled:A().default(!0),occupancyRecheckSec:l().min(Sg.min).max(Sg.max).default(Sg.default),occupancyRecheckFrames:l().min(xg.min).max(xg.max).default(xg.default),frameSource:aV.default({kind:"local-broker"}),deviceKey:o().optional(),inferenceDevices:w(iV).readonly().optional()}),eT=d({nodeId:o(),attachedCameras:l(),activeCameras:l(),avgInferenceFps:l(),avgInferenceTimeMs:l(),queueDepthTotal:l(),devices:w(d({deviceKey:o(),backend:o(),attachedCameras:l(),queueDepthTotal:l()})).default([]),hardware:d({hasGpu:A(),inferenceBackend:o().optional(),cpuCores:l().optional()})}),cM=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()}),oV=d({node:cM,cameras:w(cM.extend({deviceId:l()}))}),sV=d({nodeId:o(),activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l(),frameLazy:oV.optional()}),lV=N(["not-attached","battery-asleep","not-watching","already-bursting"]),cV={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:b(rV,d({success:Q(!0)}),{kind:"mutation"}),detachCamera:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation"}),reportMotion:b(nV,d({success:Q(!0)}),{kind:"mutation"}),getLocalLoad:b(O(),eT),getLocalMetrics:b(O(),sV),getCameraMetrics:b(d({deviceId:l()}),i0.nullable()),getAllCameraMetrics:b(O(),w(VQ).readonly()),getLocalCameras:b(O(),w(l()).readonly()),requestOccupancyBurst:b(d({deviceId:l(),frames:l().int().positive().optional(),reason:o()}),d({started:A(),refusedBecause:lV.optional()}),{auth:"admin",kind:"mutation"}),getNativeCrop:b(d({handle:rr,bbox:Uc,maxWidth:l().int().positive().optional(),acceptJpegBytes:A().optional(),encodeJpeg:A().optional()}),GQ.nullable()),runDetailSubtree:b(d({deviceId:l(),frameHandle:rr.optional(),frameJpeg:o().optional(),cropJpeg:o().optional(),parent:YQ,steps:w(o()).optional()}),d({details:w(JI)}).nullable(),{kind:"mutation"}),runStatelessStep:b(d({stepId:o(),modelId:o(),frameJpeg:o(),bbox:Uc,className:o(),sourceDeviceId:l()}),JQ,{kind:"mutation"}),parkTrackFrame:b(d({deviceId:l(),trackId:o(),kind:rM,handle:rr,bbox:Uc,maxWidth:l().int().positive().optional(),timestamp:l()}),KQ,{kind:"mutation"}),getParkedTrackFrame:b(d({deviceId:l(),trackId:o(),kind:rM,acceptJpegBytes:A().optional()}),WQ.nullable()),releaseParkedTrackFrames:b(d({deviceId:l(),trackId:o()}),d({released:l().int().nonnegative()}),{kind:"mutation"})}},Ap=d({engine:da.optional(),steps:w(Do).readonly(),audio:d({engine:da.optional(),modelId:o().optional(),enabled:A(),settings:Y(o(),J()).readonly().optional()}).nullable().optional()}),wg=d({id:o(),name:o(),description:o().optional(),config:Ap,createdAt:o(),updatedAt:o()}),o0=d({modelId:o().optional(),settings:Y(o(),J()).optional(),jumpDeviceKey:o().optional()}),uM=d({maxCameras:l().int().nonnegative().nullable().default(null),detectWeight:l().positive().optional(),detect:A().optional(),decode:A().optional(),audio:A().optional(),ingest:A().optional(),decodeBudgetMb:l().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).optional(),reachableHost:o().optional(),inferenceDevices:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),o0).optional()})).optional()}),tT=d({steps:w(Do).readonly(),audio:d({modelId:o(),enabled:A()}).nullable()}),oy=d({modelId:o().optional(),settings:Y(o(),J()).readonly().optional()}),uV=d({pinnedAgentNodeId:o().optional(),stepToggles:Y(o(),A()).optional(),stepOverridesByDevice:Y(o(),Y(o(),Y(o(),oy))).optional(),pipelineByAgent:Y(o(),tT).optional()}),dM=d({deviceId:l(),agentNodeId:o(),pinned:A(),reason:N(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:l()}),dV=d({nodeId:o(),online:A(),load:eT,score:l(),decodeHwaccel:o().nullable()}),pV=d({totalAgents:l(),onlineAgents:l(),totalCameras:l(),attachedCameras:l(),activeCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()}),mV=Y(o(),o()),fV=d({ownerNodeId:o(),reachableHost:o().optional(),configIssue:o().optional()}),hV=d({camStreamId:o(),codec:o(),width:l(),height:l(),fps:l(),kind:o()}),gV=d({streams:w(hV).readonly()}),vV=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()})}),yV=d({profile:o(),status:o(),codec:o(),width:l(),height:l(),subscribers:l(),inFps:l(),outFps:l()}),bV=d({profiles:w(yV).readonly(),webrtcSessions:l(),rtspRestream:A()}),SV=d({framesWritten:l(),getFrameHits:l(),getFrameMisses:l(),budgetMb:l()}),xV=d({nodeId:o(),formats:w(o()).readonly(),sessionCount:l(),shm:SV}),kV=d({enabled:A(),fps:l()}),wV=N(["idle","installing","verifying","ready","failed"]),MV=d({state:wV,error:o().optional()}),CV=N(["idle","watching","active"]),AV=d({nodeId:o(),engine:d({backend:o(),device:o()}),phase:CV,configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceMs:l(),provisioning:MV}),EV=d({nodeId:o(),enabled:A()}),RV=Ob,IV=d({mode:RV,active:A(),storageBytes:l()}),TV=N(["source","broker","detection","recording","switches"]),_V=N(["timeout","error","partial"]),NV=d({stage:TV,reason:_V,elapsedMs:l()}),pM=d({state:N(["idle","running","done","error"]),total:l().int().nonnegative(),completed:l().int().nonnegative(),currentDeviceId:l().int().nullable(),failed:w(l().int()).readonly(),mediaDropped:l().int().nonnegative(),tracks:l().int().nonnegative(),events:l().int().nonnegative(),startedAtMs:l().int().nullable(),finishedAtMs:l().int().nullable(),error:o().nullable()}),mM=d({deviceId:l(),assignment:vV,source:gV,broker:bV.nullable(),decoder:xV.nullable(),motion:kV.nullable(),detection:AV.nullable(),audio:EV.nullable(),recording:IV.nullable(),switchedOff:w(yu).readonly(),degraded:w(NV).readonly(),fetchedAt:l()}),OV=["disabled","unavailable","cannot-host-camera-root","accelerator-preferred"],jV=N(OV),PV=d({key:o(),backend:o(),device:o(),format:N(Nm),available:A(),enabled:A(),weight:l(),maxSessions:l().nullable(),defaultModelId:o(),steps:Y(o(),o0).optional(),exclusion:jV.nullable()}),DV=d({nodeId:o(),reachable:A(),devices:w(PV).readonly()}),zV={name:"pipeline-orchestrator",scope:"system",mode:"singleton",nodeIdMode:"data",exposesDeviceSettings:!0,methods:{pauseForStorageMigration:b(Vr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(Vr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),assignPipeline:b(d({deviceId:l(),agentNodeId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setPipelineDevicePin:b(d({deviceId:l(),deviceKey:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getPipelineDevicePin:b(d({deviceId:l()}),d({deviceKey:o().nullable()})),rebalance:b(O(),d({migrated:l()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:b(O(),w(dM).readonly()),getPipelineAssignment:b(d({deviceId:l()}),dM.nullable()),getAgentLoad:b(O(),w(dV).readonly()),getGlobalMetrics:b(O(),pV),getCameraMetrics:b(d({deviceId:l()}),i0.nullable()),getCapabilityBindings:b(d({nodeId:o()}),mV),setCapabilityBinding:b(d({nodeId:o(),capName:o(),addonId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getIngestOwner:b(O(),fV),assignAudio:b(d({deviceId:l(),nodeId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:b(d({deviceId:l()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:b(d({deviceId:l()}),d({nodeId:o(),pinned:A(),assignedAt:l()}).nullable()),getAudioNodeLoad:b(O(),w(d({nodeId:o(),deviceCount:l()}))),getAudioAssignments:b(O(),w(d({deviceId:l(),nodeId:o(),pinned:A(),assignedAt:l()}))),getAgentSettings:b(d({agentNodeId:o()}),uM.nullable()),listAgentSettings:b(O(),w(d({nodeId:o(),settings:uM})).readonly()),removeAgentSettings:b(d({agentNodeId:o()}),d({success:A(),removed:A()}),{kind:"mutation",auth:"admin"}),setAgentMaxCameras:b(d({agentNodeId:o(),maxCameras:l().int().nonnegative().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentDetectWeight:b(d({agentNodeId:o(),detectWeight:l().positive().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentCapabilities:b(d({agentNodeId:o(),detect:A().nullable().optional(),audio:A().nullable().optional(),ingest:A().nullable().optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentDecodeLimits:b(d({agentNodeId:o(),decodeBudgetMb:l().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).nullable().optional()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentReachableHost:b(d({agentNodeId:o(),reachableHost:o().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setAgentInferenceDevices:b(d({agentNodeId:o(),inferenceDevices:Y(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:Y(o(),o0).optional()}))}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getNodeInferenceDevices:b(d({nodeId:o()}),DV),resetNodePipelineDefaults:b(d({agentNodeId:o()}),d({success:Q(!0),effectiveModelId:o().nullable(),clearedCameraOverrides:l()}),{kind:"mutation",auth:"admin"}),getCameraSettings:b(d({deviceId:l()}),uV.nullable()),setCameraStepToggle:b(d({deviceId:l(),addonId:o(),enabled:A().nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:b(d({deviceId:l()}),Y(o(),Y(o(),Y(o(),oy))).nullable()),setCameraStepOverride:b(d({deviceId:l(),agentNodeId:o(),deviceKey:o(),addonId:o(),patch:oy.nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:b(d({deviceId:l(),agentNodeId:o(),pipeline:tT.nullable()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:b(d({deviceId:l(),agentNodeId:o().optional()}),Ap),getCameraSwitches:b(d({deviceId:l()}),ww),setCameraSwitch:b(d({deviceId:l(),switchId:yu,enabled:A()}),ww,{kind:"mutation",auth:"admin"}),getCameraStatus:b(d({deviceId:l()}),mM),getCameraStatuses:b(d({deviceIds:w(l()).optional()}),w(mM).readonly()),reconcileFromDisk:b(O(),pM,{kind:"mutation",auth:"admin"}),getReconcileFromDiskStatus:b(O(),pM,{auth:"admin"}),listTemplates:b(O(),w(wg).readonly()),saveTemplate:b(d({name:o(),description:o().optional(),config:Ap}),wg,{kind:"mutation",auth:"admin"}),updateTemplate:b(d({id:o(),name:o().optional(),description:o().optional(),config:Ap.optional()}),wg,{kind:"mutation",auth:"admin"}),deleteTemplate:b(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"})}},LV={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 qV(e){return LV[e]??"generic"}var BV={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 FV(e,t){const n=Vb[t];if(n===void 0)throw new Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:qV(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(BV).map(([e,t])=>[e,FV(e,t)])));var UV=N(["workspace","baked","data-root"]),HV=N(["idle","checking","staging","pending-restart","awaiting-confirmation"]),$V=N(["in-sync","behind-patch","behind-series","ahead","unknown"]),QV=d({state:$V,seedVersion:o().nullable(),contractVersion:o().nullable(),contractSource:N(["registry","running"]).nullable(),message:o()}),VV=N(["docker","electron","native","contradictory","unknown"]),GV=d({fact:N(["dockerenv-file","proc-1-cgroup","platform","electron-app-version-env"]),mode:N(["observed","declared"]),holds:A(),detail:o()}),ZV=d({kind:VV,evidence:w(GV),currentVersion:o().nullable()}),KV=d({fromVersion:o(),toVersion:o().nullable(),atMs:l(),reason:o()}),WV=d({packageName:o(),runningVersion:o().nullable(),nodeRuntimeVersion:o().nullable(),activeVersion:o().nullable(),previousVersion:o().nullable(),seedVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),bootMode:UV,updateState:HV,pendingVersion:o().nullable(),rolledBack:KV.nullable(),stateFileCorrupt:A(),lastCheckedAtMs:l().nullable(),imageContract:QV.optional(),wrapper:ZV.optional()}),YV=d({packageName:o(),runningVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),checkedAtMs:l(),error:o().nullable()}),Mg=d({accepted:A(),targetVersion:o().nullable(),restarting:A(),message:o()}),XV={name:"server-management",scope:"system",mode:"singleton",methods:{getServerPackageStatus:b(O(),WV,{auth:"admin"}),checkServerUpdate:b(O(),YV,{kind:"mutation",auth:"admin"}),applyServerUpdate:b(d({version:o().optional()}),Mg,{kind:"mutation",auth:"admin",timeoutMs:16*6e4}),rollbackServerUpdate:b(O(),Mg,{kind:"mutation",auth:"admin"}),restartServer:b(O(),Mg,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},Xs=QL(),JV=d({to:tt([Xs,w(Xs).min(1)]),cc:w(Xs).optional(),bcc:w(Xs).optional(),from:o().optional(),replyTo:o().optional(),subject:o(),text:o(),html:o().optional()}),eG=d({messageId:o(),accepted:w(Xs).default([]),rejected:w(Xs).default([])}),fM=d({ready:A(),host:o(),error:o().optional(),lastVerifiedAt:l().optional()}),tG={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:b(JV,eG,{kind:"mutation",auth:"admin",access:"create"}),verify:b(O(),fM,{kind:"mutation",auth:"admin",access:"view"}),getStatus:b(O(),fM,{auth:"admin"})}},nG=d({base64:o(),contentType:o()}),aG=d({lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),lastBytes:l().nullable(),lastStreamId:o().nullable()}),iG={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:b(d({deviceId:l(),streamId:o().optional(),force:A().optional()}),nG.nullable()),invalidateCache:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getSnapshotOverview:sg(d({deviceIds:w(l()).min(1).max(200)}),w(d({deviceId:l(),lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),etag:o().nullable()}))),getDebugState:sg(d({deviceId:l()}),d({battery:d({sleeping:A(),lastUpdated:l(),lastContactAt:l().optional()}).nullable(),state:d({isBattery:A(),reason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable()}),frame:d({capturedAt:l().nullable(),ageMs:l().nullable()}),waking:A()})),getSnapshotLinks:sg(d({targets:w(d({deviceId:l(),width:l().int().positive().optional()})).min(1).max(200)}),w(d({deviceId:l(),url:o().nullable(),capturedAt:l().nullable(),ageMs:l().nullable(),expiresAt:l().nullable(),width:l().nullable(),neverCaptured:A(),sleeping:A(),stateReason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable(),battery:A()})))},status:{schema:aG,kind:"poll"}},hM=d({userId:o(),username:o(),isAdmin:A(),provider:o(),email:o().optional(),displayName:o().optional(),hubUrl:o().optional(),scopes:w(Ia).optional(),redirectUri:o().optional(),integrationId:o().optional(),jti:o().optional(),codeChallenge:o().optional(),sessionId:o().optional(),refreshTtl:tt([l().int().positive(),Q("never")]).optional()}),rG={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:b(d({claims:hM,ttlSec:tt([l().int().positive(),Q("never")]).optional()}),d({token:o()}),{auth:"admin"}),verifyBridgeToken:b(d({token:o()}),hM.nullable(),{auth:"admin"})}},oG=wt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:Q(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:Q(!1),minFreePercent:Q(null)})]),sG={name:"storage",scope:"system",mode:"singleton",methods:{resolve:b(d({location:Xi,relativePath:o()}),o()),write:b(d({location:Xi,relativePath:o(),data:$t(Uint8Array)}),O(),{kind:"mutation"}),read:b(d({location:Xi,relativePath:o()}),$t(Uint8Array)),exists:b(d({location:Xi,relativePath:o()}),A()),list:b(d({location:Xi,prefix:o().optional()}),w(o()).readonly()),delete:b(d({location:Xi,relativePath:o()}),O(),{kind:"mutation"}),getAvailableSpace:b(d({location:Xi}),l().nullable()),beginUpload:b(d({location:Xi,relativePath:o(),sizeBytes:l().optional()}),d({uploadId:o()}),{kind:"mutation"}),writeChunk:b(d({uploadId:o(),offset:l(),data:$t(Uint8Array)}),O(),{kind:"mutation"}),finalizeUpload:b(d({uploadId:o()}),O(),{kind:"mutation"}),abortUpload:b(d({uploadId:o()}),O(),{kind:"mutation"}),beginDownload:b(d({location:Xi,relativePath:o()}),d({downloadId:o(),sizeBytes:l()}),{kind:"mutation"}),readChunk:b(d({downloadId:o(),offset:l(),length:l()}),$t(Uint8Array)),endDownload:b(d({downloadId:o()}),O(),{kind:"mutation"}),listLocations:b(d({type:PR.optional()}),w(Ha).readonly()),listLocationDeclarations:b(O(),w(w7).readonly()),upsertLocation:b(Ha.omit({createdAt:!0,updatedAt:!0}),Ha,{kind:"mutation",auth:"admin"}),deleteLocation:b(d({id:o(),force:A().optional()}),O(),{kind:"mutation",auth:"admin"}),listDrainProgress:b(O(),w(x7).readonly()),testLocation:b(d({id:o()}),d({ok:A(),error:o().optional()}),{auth:"admin"}),listProviders:b(O(),w(oG).readonly()),testConfig:b(d({providerId:o(),locationId:o().optional(),config:Y(o(),J())}),d({ok:A(),error:o().optional()}),{auth:"admin"})}},lG=d({bytes:l().int().nonnegative()}),cG=d({reclaimedBytes:l().int().nonnegative(),exhausted:A()}),uG={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:b(d({locationId:o()}),lG,{auth:"admin"}),evict:b(d({locationId:o(),targetBytes:l().int().positive()}),cG,{kind:"mutation",auth:"admin"})}},dG={name:"storage-migration",scope:"system",mode:"singleton",methods:{plan:b(Ew,t7,{auth:"admin"}),start:b(Ew,d({jobId:o()}),{kind:"mutation",auth:"admin"}),status:b(d({jobId:o().optional()}),Rw.nullable(),{auth:"admin"}),cancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),movers:b(d({}),w(a7).readonly(),{auth:"admin"}),residue:b(d({}),w(i7).readonly(),{auth:"admin"}),drain:b(r7,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStart:b(g7,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStatus:b(y7,v7.nullable(),{auth:"admin"}),cleanupCancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),history:b(d({}),w(Rw).readonly(),{auth:"admin"})}},pG=d({locationId:o(),ownedBytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}),mG={name:"storage-occupancy",scope:"system",mode:"collection",internal:!0,methods:{getOccupancy:b(d({locationIds:w(o()).readonly()}),w(pG).readonly(),{auth:"admin"})}},fG=wt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:Q(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:Q(!1),minFreePercent:Q(null)})]),hG=d({ok:A(),error:o().optional()}),gG=d({location:Ha,relativePath:o(),sizeBytes:l().optional()}),vG=d({uploadId:o()}),yG=d({uploadId:o(),offset:l(),data:$t(Uint8Array)}),bG=d({uploadId:o()}),SG=d({uploadId:o()}),xG=d({location:Ha,relativePath:o()}),kG=d({downloadId:o(),sizeBytes:l()}),wG=d({downloadId:o(),offset:l(),length:l()}),MG=d({downloadId:o()}),CG={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:b(O(),fG,{auth:"admin"}),testLocation:b(d({config:Y(o(),J())}),hG,{auth:"admin"}),resolve:b(d({location:Ha,relativePath:o()}),o(),{auth:"admin"}),write:b(d({location:Ha,relativePath:o(),data:$t(Uint8Array)}),O(),{kind:"mutation",auth:"admin"}),read:b(d({location:Ha,relativePath:o()}),$t(Uint8Array),{auth:"admin"}),exists:b(d({location:Ha,relativePath:o()}),A(),{auth:"admin"}),list:b(d({location:Ha,prefix:o().optional()}),w(o()).readonly(),{auth:"admin"}),delete:b(d({location:Ha,relativePath:o()}),O(),{kind:"mutation",auth:"admin"}),getAvailableSpace:b(d({location:Ha}),l().nullable(),{auth:"admin"}),beginUpload:b(gG,vG,{kind:"mutation",auth:"admin"}),writeChunk:b(yG,O(),{kind:"mutation",auth:"admin"}),finalizeUpload:b(bG,O(),{kind:"mutation",auth:"admin"}),abortUpload:b(SG,O(),{kind:"mutation",auth:"admin"}),beginDownload:b(xG,kG,{kind:"mutation",auth:"admin"}),readChunk:b(wG,$t(Uint8Array),{auth:"admin"}),endDownload:b(MG,O(),{kind:"mutation",auth:"admin"})}},AG=J().nullable(),sy=Y(o(),J()),gM=d({sessionId:o(),profileId:o(),label:o(),cols:l().int().positive(),rows:l().int().positive(),startedAt:l()}),EG=d({profileId:o(),label:o(),description:o().optional(),executable:o().optional(),args:w(o()).readonly().optional(),cwd:o().optional(),environment:w(o()).readonly().optional(),settingsSchema:AG.optional()}),xc=d({instanceId:o(),cameraStableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),enabled:A(),executable:o(),args:w(o()).readonly(),cwd:o(),environment:w(o()).readonly(),profileSettings:sy}),RG=d({stableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),adoptable:A()}),IG=wt("kind",[d({seq:l().int().positive(),kind:Q("data"),data:o()}),d({seq:l().int().positive(),kind:Q("exit"),exitCode:l().int(),signal:l().int().optional()})]),TG=d({cursor:l().int().nonnegative(),reset:A(),snapshot:o().optional(),events:w(IG).readonly()}),_G={name:"terminal-session",scope:"system",mode:"singleton",methods:{listProfiles:b(O(),w(EG).readonly(),{auth:"admin"}),listInstances:b(O(),w(xc).readonly(),{auth:"admin"}),createInstance:b(d({targetNodeId:o().min(1),profileId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:sy.optional()}),xc,{kind:"mutation",auth:"admin"}),updateInstance:b(d({instanceId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:sy.optional()}),xc,{kind:"mutation",auth:"admin"}),deleteInstance:b(d({instanceId:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),setInstanceEnabled:b(d({instanceId:o().min(1),enabled:A()}),xc,{kind:"mutation",auth:"admin"}),listLegacyCameras:b(O(),w(RG).readonly(),{auth:"admin"}),adoptLegacyMonitor:b(d({stableId:o().min(1),name:o().trim().min(1).max(160).optional()}),xc,{kind:"mutation",auth:"admin"}),listSessions:b(O(),w(gM).readonly(),{auth:"admin"}),openSession:b(d({profileId:o(),cols:l().int().positive(),rows:l().int().positive(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional()}),gM,{kind:"mutation",auth:"admin"}),resize:b(d({sessionId:o(),cols:l().int().positive(),rows:l().int().positive()}),O(),{kind:"mutation",auth:"admin"}),pullOutput:b(d({sessionId:o(),afterSeq:l().int().nonnegative(),waitMs:l().int().min(0).max(2e3).default(0),waitForOutput:A().optional()}),TG,{kind:"mutation",auth:"admin",timeoutMs:15e3}),writeInput:b(d({sessionId:o(),data:o().max(64*1024)}),O(),{kind:"mutation",auth:"admin"}),close:b(d({sessionId:o()}),O(),{kind:"mutation",auth:"admin"})}},NG=d({urls:tt([o(),w(o())]),username:o().optional(),credential:o().optional()}),OG={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:b(O(),w(NG).readonly())}},jG=d({credentialId:o(),label:o(),createdAt:l(),lastUsedAt:l().nullable(),transports:w(o()).default([])}),PG={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:b(d({userId:o(),username:o()}),d({optionsJSON:Y(o(),J())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:b(d({userId:o(),response:Y(o(),J()),label:o()}),d({success:Q(!0),credentialId:o()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:b(d({userId:o().optional()}),d({optionsJSON:Y(o(),J())}),{kind:"mutation",access:"view",auth:"admin"}),finishAuthentication:b(d({userId:o(),response:Y(o(),J())}),d({verified:A()}),{kind:"mutation",access:"view",auth:"admin"}),beginDiscoverableAuthentication:b(d({}),d({optionsJSON:Y(o(),J())}),{kind:"mutation",access:"view",auth:"admin"}),finishDiscoverableAuthentication:b(d({response:Y(o(),J())}),d({verified:A(),userId:o().nullable()}),{kind:"mutation",access:"view",auth:"admin"}),listPasskeys:b(d({userId:o()}),w(jG),{auth:"admin"}),removePasskey:b(d({userId:o(),credentialId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getSecondFactorPreference:b(d({userId:o()}),d({enabled:A()}),{auth:"admin"}),setSecondFactorPreference:b(d({userId:o(),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"})}},nT=N(["cosine","dot","euclidean"]),ku=Y(o(),tt([o(),l(),A()])),aT=d({equals:Y(o(),tt([o(),l(),A()])).optional(),between:Y(o(),gu([l(),l()])).optional()}),DG=d({id:o(),vector:o(),metadata:ku}),zG=d({id:o(),score:l(),metadata:ku}),LG=d({index:o(),dim:l().int().positive(),metric:nT.default("cosine")}),qG=d({index:o(),items:w(DG)}),BG=d({upserted:l(),rejected:l()}),FG=d({index:o(),vector:o(),topK:l().int().positive(),minScore:l().optional(),filter:aT.optional()}),UG=d({matches:w(zG),scanned:l(),truncated:A(),effectiveTopK:l().int().positive()}),HG=d({index:o(),ids:w(o())}),$G=d({index:o(),filter:aT}),vM=d({deleted:l()}),QG=d({index:o(),ids:w(o())}),VG=d({items:w(d({id:o(),metadata:ku}))}),GG=d({index:o(),ids:w(o())}),ZG=d({items:w(d({id:o(),vector:o(),metadata:ku}))}),KG=d({index:o(),cursor:l().int().nonnegative().default(0),limit:l().int().positive()}),WG=d({items:w(d({id:o(),metadata:ku})),nextCursor:l().int().nonnegative().nullable()}),YG=d({index:o()}),XG=d({backend:o(),count:l(),dim:l(),metric:nT,bytes:l().optional(),exact:A()}),JG={name:"vector-store",scope:"system",mode:"singleton",internal:!0,methods:{declareIndex:b(LG,O(),{kind:"mutation",auth:"admin"}),upsert:b(qG,BG,{kind:"mutation",auth:"admin"}),query:b(FG,UG,{auth:"admin"}),getByIds:b(QG,VG,{auth:"admin"}),fetchByIds:b(GG,ZG,{auth:"admin"}),scan:b(KG,WG,{auth:"admin"}),deleteByIds:b(HG,vM,{kind:"mutation",auth:"admin"}),deleteByFilter:b($G,vM,{kind:"mutation",auth:"admin"}),stats:b(YG,XG,{auth:"admin"})}},eZ=d({id:o(),source:o(),kind:N(["motion","object","audio","native"]),timeRange:d({startMs:l(),endMs:l()}),labels:w(o()).max(3).optional(),thumbnail:o().optional(),stillAtMs:l().optional(),eventIds:w(o()).optional(),eventCount:l().int().nonnegative().optional(),holes:w(d({startMs:l(),endMs:l()})).optional()}),tZ=d({playbackUrl:o(),playbackEndpoints:w(o()).optional(),token:o().optional()}),nZ={name:"videoclips",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{listClips:b(d({deviceId:l(),since:l(),until:l(),limit:l().int().positive().optional()}),w(eZ).readonly(),{kind:"query",auth:"admin"}),getClipPlayback:b(d({deviceId:l(),clipId:o()}),tZ,{kind:"query",auth:"admin"})}},yM=d({viewportWidth:l().int().positive().optional(),viewportHeight:l().int().positive().optional(),devicePixelRatio:l().positive().optional(),downlinkMbps:l().nonnegative().optional(),prefersTier:o().optional()}).partial(),Ep=wt("kind",[d({kind:Q("adaptive")}),d({kind:Q("profile"),profile:Ht}),d({kind:Q("cam-stream"),camStreamId:o().min(1)})]),aZ=d({id:o(),label:o(),target:Ep,codec:o().nullable(),resolution:d({width:l(),height:l()}).nullable(),status:N(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:l().nullable(),decodeFps:l().nullable(),bitrateKbps:l().nullable()}),iZ=d({cause:N(["loss","stall","healthy"]),tier:Ht.nullable(),forcedTranscodeDown:A(),lossRatio:l().nullable(),clientKbps:l().nullable(),stalledForMs:l().nullable(),serverSending:A().nullable(),at:l()}),rZ=d({tier:Ht,failures:l().int().nonnegative()}),oZ=d({sessionId:o(),alive:A(),observedAt:l(),brokerId:o().nullable(),camStreamId:o().nullable(),sourceKind:N(["native","derived","unknown"]),adaptive:A(),servedTier:Ht.nullable(),ingestNodeId:o().nullable(),ingestIsRemote:A().nullable(),sourceCodec:o().nullable(),negotiatedCodec:o().nullable(),egressLeg:N(["copy","transcode","unknown"]),brokerStatus:o().nullable(),brokerCodec:o().nullable(),brokerBitrateKbps:l().nullable(),brokerInputFps:l().nullable(),brokerUptimeMs:l().nullable(),rtpPacketsSent:l().nullable(),trackMode:N(["live","recorded"]).nullable(),lastDecision:iZ.nullable(),tierFailures:w(rZ),upgradeCount:l().nullable()}),sZ={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[H.Camera],methods:{listStreams:b(d({deviceId:l().int().nonnegative()}),w(aZ)),createSession:b(d({deviceId:l().int().nonnegative(),target:Ep,hints:yM.optional(),relayOnly:A().optional(),consumerAttribution:Kv.optional()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation"}),handleOffer:b(d({deviceId:l().int().nonnegative(),target:Ep.optional(),sdpOffer:o(),sessionId:o().optional(),relayOnly:A().optional(),nonTrickle:A().optional(),disableTurn:A().optional(),disableIpv6:A().optional(),consumerAttribution:Kv.optional(),hints:yM.optional()}),d({sessionId:o(),sdpAnswer:o()}),{kind:"mutation"}),handleAnswer:b(d({deviceId:l().int().nonnegative(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation"}),addIceCandidate:b(d({deviceId:l().int().nonnegative(),sessionId:o(),candidate:o(),sdpMid:o().nullable().optional(),sdpMLineIndex:l().int().nullable().optional()}),O(),{kind:"mutation"}),getIceCandidates:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({candidates:w(d({candidate:o(),sdpMid:o().nullable(),sdpMLineIndex:l().int().nullable()})),done:A()}),{kind:"query"}),closeSession:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),O(),{kind:"mutation"}),hasAdaptiveBitrate:b(d({deviceId:l().int().nonnegative(),profile:Ht}),A()),getSessionState:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({pendingRenegotiation:d({target:Ep,epoch:l()}).nullable(),alive:A()})),getSessionDebug:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),oZ,{kind:"query"})},mount:{kind:"server-provided"}},lZ=d({childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()}),cZ={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Hub,H.Switch,H.Light,H.Sensor,H.Thermostat,H.Cover,H.Lock,H.Fan,H.MediaPlayer,H.AlarmPanel,H.Generic],methods:{setChildHidden:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative(),hidden:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onAccessoriesChanged:{data:d({deviceId:l(),childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:l(),childDeviceId:l(),hidden:A()})}},status:{schema:lZ,kind:"command-driven"}},uZ=N(["install","update","uninstall","restart"]),iT=N(["queued","fetching","staged","validating","applying","restarting","applied","done","failed","skipped"]),dZ=N(["framework","addon"]),pZ=d({tsMs:l(),nodeId:o(),packageName:o(),phase:iT,message:o()}),mZ=d({taskId:o(),nodeId:o(),packageName:o(),fromVersion:o().nullable(),toVersion:o(),target:dZ,phase:iT,stagedPath:o().nullable(),attempts:l(),steps:w(pZ),error:o().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable()}),fZ=N(["running","completed","failed","partially-failed","cancelled"]),hZ=N(["single","bulk","cluster"]),bM=d({jobId:o(),kind:uZ,createdAtMs:l(),createdBy:o(),scope:hZ,tasks:w(mZ),state:fZ,schemaVersion:Q(1)}),SM=N(["debug","info","warn","error"]),ly=N(["off","latest","beta"]),rT=N(["off","latest","beta","inherit"]),gZ=d({id:o(),name:o().optional(),version:o().optional(),description:o().optional(),icon:o().optional(),color:o().optional(),capabilities:w(J()).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()}),vZ=d({pid:l().optional(),mode:o(),state:o()}),yZ=d({phase:N(["pending","healthy","failed"]),retryCount:l(),firstFailureAt:l().nullable(),lastAttemptAt:l().nullable(),lastError:d({message:o(),stack:o().optional()}).nullable(),nextRetryAt:l().nullable(),alertEmitted:A(),retrying:A(),inGracePeriod:A()}),bZ=d({manifest:gZ,declaration:J().optional(),source:o(),installSource:o().optional(),process:vZ.optional(),hasBackup:A().optional(),health:yZ.nullable().optional()}),SZ=d({name:o(),version:o(),dir:o(),installSource:o().optional()}),xZ=d({name:o(),currentVersion:o(),latestVersion:o(),category:N(["addon","core"]),requiresRestart:A(),isSystem:A()}),kZ=d({version:o(),publishedAt:o(),deprecated:o().optional(),distTags:w(o()).readonly()}),wZ=d({name:o(),version:o(),description:o(),keywords:w(o()).readonly(),publishedAt:o(),author:o(),installed:A(),installedVersion:o().optional()}),MZ=d({channel:ly,intervalSeconds:l(),updateCheckIntervalSeconds:l()}),CZ=rT,AZ=J(),xM=J(),EZ=J(),RZ=N(["queued","updating","done","done-pending-restart","failed"]),IZ=d({name:o(),isSystem:A(),fromVersion:o(),toVersion:o(),status:RZ,error:o().optional(),startedAtMs:l().optional(),completedAtMs:l().optional()}),TZ=N(["regular","system","restarting","finalizing"]);d({id:o(),nodeId:o(),startedAtMs:l(),completedAtMs:l().optional(),total:l(),completed:l(),failed:l(),current:o().nullable(),phase:TZ,cancelled:A(),items:w(IZ).readonly()});var _Z=d({packageName:o(),currentVersion:o(),latestVersion:o().nullable(),hasUpdate:A(),description:o().optional(),buildId:o().nullable()}),NZ=d({timestamp:o(),level:o(),message:o(),scope:o().optional()}),OZ=J(),jZ=d({addonId:o().min(1),action:o().min(1),input:J()}),PZ={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:b(O(),w(bZ).readonly()),getLogs:b(d({addonId:o(),limit:l().min(1).max(500).default(100),level:SM.optional()}),w(OZ)),listPackages:b(O(),w(SZ).readonly()),installPackage:b(d({packageName:o(),version:o().optional()}),xM,{kind:"mutation",auth:"admin"}),installFromWorkspace:b(d({packageName:o()}),xM,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:b(O(),A()),listWorkspacePackages:b(O(),w(J()).readonly()),uninstallPackage:b(d({packageName:o()}),J(),{kind:"mutation",auth:"admin"}),reloadPackages:b(O(),EZ,{kind:"mutation",auth:"admin"}),searchAvailable:b(d({query:o().optional()}),w(wZ)),listUpdates:b(d({nodeId:o().optional()}),w(xZ).readonly(),{auth:"admin"}),updatePackage:b(d({name:o().min(1),version:o().optional(),nodeId:o().optional()}),J(),{kind:"mutation",auth:"admin"}),rollbackPackage:b(d({name:o().min(1)}),d({rolledBackTo:o().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:b(d({nodeId:o().optional()}),J(),{kind:"mutation",auth:"admin"}),restartServer:b(d({confirm:Q(!0)}),J(),{kind:"mutation",auth:"admin"}),getLastRestart:b(O(),d({kind:N(["framework-update","manual","system","framework-bulk-update"]),packageName:o().optional(),fromVersion:o().optional(),toVersion:o().optional(),requestedBy:o().optional(),requestedAt:l()}).nullable(),{auth:"admin"}),listFrameworkPackages:b(O(),w(_Z).readonly(),{auth:"admin"}),listCapabilityProviders:b(d({capName:o().min(1)}),w(d({addonId:o(),mode:N(["singleton","collection"]),isActive:A()})).readonly()),setCapabilityProviderEnabled:b(d({capName:o().min(1),addonId:o().min(1),enabled:A()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getVersions:b(d({name:o()}),w(kZ).readonly()),restartAddon:b(d({addonId:o()}),AZ,{kind:"mutation",auth:"admin"}),retryLoad:b(d({packageName:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:b(O(),MZ,{auth:"admin"}),setAutoUpdateSettings:b(d({channel:ly,intervalSeconds:l().min(300).max(86400).optional(),updateCheckIntervalSeconds:l().min(900).max(604800).optional()}),J(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:b(d({addonId:o()}),CZ,{auth:"admin"}),setAddonAutoUpdate:b(d({addonId:o(),channel:rT}),J(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:b(d({channel:ly}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),custom:b(jZ,J(),{kind:"mutation"}),startJob:b(d({kind:N(["install","update","uninstall","restart"]),targets:w(d({name:o().min(1),version:o().min(1)})).min(1),nodeIds:w(o()).optional()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),getJob:b(d({jobId:o()}),bM.nullable(),{auth:"admin"}),listJobs:b(d({activeOnly:A().optional()}),w(bM),{auth:"admin"}),cancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),onAddonLogs:b(d({addonId:o(),level:SM.optional()}),NZ,{kind:"subscription"})},mount:{kind:"server-provided"}},kM=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()}),DZ={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:kM,kind:"push"},runtimeState:kM,durability:"restored",volatileStateFields:["lastFetchedAt"]},wM=d({lux:l().min(0),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),zZ={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:wM,kind:"push"},runtimeState:wM,durability:"restored",volatileStateFields:["lastFetchedAt"]},LZ=d({className:o(),hits:l().int().nonnegative(),avgScore:l().min(0).max(1),peakScore:l().min(0).max(1)}),MM=d({ts:l().int(),windowSec:l().int().positive(),level:d({rms:l(),dbfs:l()}),peakDbfs:l(),avgDbfs:l(),current:d({className:o(),score:l().min(0).max(1),timestamp:l().int()}).nullable(),byClass:w(LZ).readonly()}),qZ=d({ts:l().int(),dbfs:l().nullable(),peakDbfs:l(),avgDbfs:l(),topClass:o().nullable(),topScore:l().min(0).max(1).nullable()}),BZ=d({points:w(qZ).readonly(),effectiveSampleEveryMs:l().int().positive(),windowMsActual:l().int().nonnegative()}),FZ={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),MM.nullable()),getHistory:b(d({deviceId:l(),windowSec:l().int().positive().optional(),sampleEveryMs:l().int().positive().optional()}),BZ)},runtimeState:MM,durability:"session"},CM=d({enabled:A(),isRunning:A(),lastTriggeredAt:l(),lastError:o().nullable(),lastChangedAt:l()}),UZ={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Automation],methods:{enable:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),trigger:b(d({deviceId:l().int().nonnegative(),skipCondition:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:CM,kind:"push"},runtimeState:CM,durability:"session"},Cg=d({percentage:l().min(0).max(100).nullable(),charging:N(["dc","solar","none","unknown"]),sleeping:A(),lastUpdated:l(),lastContactAt:l().optional(),binary:A().optional()}),HZ={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Button,H.Switch],methods:{wakeForStream:b(d({deviceId:l(),timeoutMs:l().int().min(500).max(3e4).default(8e3)}),d({awoke:A(),durationMs:l()}),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:Cg})}},status:{schema:Cg,kind:"push",empty:{percentage:0,charging:"unknown",sleeping:!1,lastUpdated:0}},runtimeState:Cg,durability:"restored",volatileStateFields:["lastUpdated"]},AM=d({on:A(),lastChangedAt:l()}),$Z={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:AM,kind:"push"},runtimeState:AM,durability:"restored",volatileStateFields:["lastChangedAt"]},EM=d({percentage:l().min(0).max(100),lastChangedAt:l()}),QZ={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light],methods:{setBrightness:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},events:{onBrightnessChanged:{data:d({deviceId:l(),percentage:l().min(0).max(100),lastChangedAt:l()})}},status:{schema:EM,kind:"command-driven"},runtimeState:EM,durability:"session"},VZ={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Button],methods:{press:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})}},GZ=d({host:o(),port:l().int().positive().optional(),onvifPort:l().int().positive().optional(),rtspPort:l().int().positive().optional(),https:A().optional(),username:o().optional(),password:o().optional(),onvifProfile:o().optional()}),ZZ=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()}),KZ={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getCredentials:b(d({deviceId:l()}),GZ.nullable(),{kind:"query",auth:"admin"})},status:{schema:ZZ,kind:"command-driven"}},RM=d({detected:A(),lastChangedAt:l()}),WZ={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:RM,kind:"push"},runtimeState:RM,durability:"restored",volatileStateFields:["lastChangedAt"]},cy=N(["off","heat","cool","auto","heat_cool","fan_only","dry"]),IM=d({mode:cy,availableModes:w(cy),fanMode:o(),availableFanModes:w(o()),preset:o(),availablePresets:w(o()),target:l().nullable(),targetHigh:l().nullable(),targetLow:l().nullable(),targetHumidity:l().min(0).max(100).nullable(),currentTemp:l().nullable(),currentHumidity:l().min(0).max(100).nullable(),swingVertical:A().nullable(),swingHorizontal:A().nullable(),lastFetchedAt:l()}),YZ={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Thermostat,H.Climate],methods:{setMode:b(d({deviceId:l().int().nonnegative(),mode:cy}),O(),{kind:"mutation",auth:"protected"}),setFanMode:b(d({deviceId:l().int().nonnegative(),fanMode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setTarget:b(d({deviceId:l().int().nonnegative(),target:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetRange:b(d({deviceId:l().int().nonnegative(),targetLow:l(),targetHigh:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),targetHumidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setSwingVertical:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setSwingHorizontal:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:IM,kind:"push"},runtimeState:IM,durability:"session"},s0=d({r:l().int().min(0).max(255),g:l().int().min(0).max(255),b:l().int().min(0).max(255)}),l0=d({h:l().min(0).max(360),s:l().min(0).max(100),v:l().min(0).max(100)}),XZ=wt("mode",[d({mode:Q("rgb"),rgb:s0}),d({mode:Q("hsv"),hsv:l0}),d({mode:Q("mired"),mireds:l().int().min(50).max(1e3)})]),TM=d({mode:N(["rgb","hsv","mired"]),rgb:s0.optional(),hsv:l0.optional(),mireds:l().int().optional(),lastChangedAt:l()}),JZ={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light],methods:{setColor:b(d({deviceId:l().int().nonnegative(),color:XZ}),O(),{kind:"mutation",auth:"protected"})},events:{onColorChanged:{data:d({deviceId:l(),mode:N(["rgb","hsv","mired"]),rgb:s0.optional(),hsv:l0.optional(),mireds:l().int().optional(),lastChangedAt:l()})}},status:{schema:TM,kind:"command-driven"},runtimeState:TM,durability:"session"},eK=wt("outcome",[d({outcome:Q("validated"),latencyMs:l().nonnegative().optional(),detail:o().optional()}).strict(),d({outcome:Q("rejected"),error:o()}).strict(),d({outcome:Q("inconclusive"),error:o()}).strict()]),tK=d({settings:Y(o(),J())}),nK=d({label:o()}),aK={name:"connection-test",scope:"system",mode:"collection",methods:{testSettings:b(tK,eK,{kind:"mutation",auth:"admin"}),describeTest:b(O(),nK,{auth:"admin"})}},_M=d({connected:A(),lastChangedAt:l()}),iK={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:_M,kind:"push"},runtimeState:_M,durability:"restored",volatileStateFields:["lastChangedAt"]},oT=d({key:o().min(1),label:o().min(1),level:l().min(0).max(100).nullable(),status:N(["ok","replace"]).nullable(),lastResetAt:l().nullable(),resettable:A()}),NM=d({items:w(oT),lastChangedAt:l()}),rK={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(H),deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:b(d({deviceId:l().int().nonnegative(),key:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},status:{schema:NM,kind:"push",empty:{items:[],lastChangedAt:0},itemArray:{path:"items",keyField:"key",labelField:"label",itemSchema:oT,emptyItem:{key:"",label:"",level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:NM.extend({lastFetchedAt:l()}),durability:"session"},OM=d({entryOpen:A(),lastChangedAt:l()}),oK={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:OM,kind:"push"},runtimeState:OM,durability:"restored",volatileStateFields:["lastChangedAt"]},sK=N(["numeric","select","text","datetime"]),jM=d({kind:sK,value:tt([l(),o()]),options:w(o()),lastChangedAt:l(),unit:o().optional(),min:l().optional(),max:l().optional(),step:l().optional(),precision:l().int().min(0).max(10).optional(),format:N(["date","time","datetime"]).optional()}),lK=wt("kind",[d({kind:Q("numeric"),value:l()}),d({kind:Q("select"),value:o().min(1)}),d({kind:Q("text"),value:o()}),d({kind:Q("datetime"),value:o().min(1)})]),cK={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Control],methods:{setValue:b(d({deviceId:l().int().nonnegative(),control:lK}),O(),{kind:"mutation",auth:"protected"})},status:{schema:jM,kind:"push"},runtimeState:jM,durability:"session"},uK=N(["open","opening","closing","closed","stopped"]),PM=d({state:uK,position:l().min(0).max(100).nullable(),tiltPosition:l().min(0).max(100).nullable(),lastChangedAt:l()}),dK={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Cover],methods:{open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setTiltPosition:b(d({deviceId:l().int().nonnegative(),tiltPosition:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:PM,kind:"push"},runtimeState:PM,durability:"restored",volatileStateFields:["lastChangedAt"]},c0=N(["auto","day","night","schedule"]),DM=d({min:l(),max:l(),step:l()}),zM=d({mode:c0,sensitivity:l().optional(),switchDelaySec:l().optional(),lastFetchedAt:l()}),pK=d({modes:w(c0),supportsSensitivity:A(),sensitivity:DM.optional(),supportsSwitchDelay:A(),switchDelaySec:DM.optional()}),mK=d({mode:c0.optional(),sensitivity:l().optional(),switchDelaySec:l().optional()}),fK={name:"day-night",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"day-night",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),pK),setSettings:b(d({deviceId:l(),settings:mK}),O(),{kind:"mutation",auth:"admin"})},status:{schema:zM,kind:"poll"},runtimeState:zM,durability:"restored",volatileStateFields:["lastFetchedAt"]},Ag=d({online:A(),lastChangedAt:l()}),hK={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:Ag})}},status:{schema:Ag,kind:"push"},runtimeState:Ag,durability:"restored",volatileStateFields:["lastChangedAt"]},LM=d({lastPressedAt:l().nullable(),pressCountSinceStart:l()}),gK=d({deviceId:l(),timestamp:l()}),vK={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[H.Button,H.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:gK}},status:{schema:LM,kind:"push"},runtimeState:LM,durability:"restored"},yK=N(["date","time","datetime"]),qM=d({value:o(),format:yK.optional(),lastFetchedAt:l()}),bK={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:qM,kind:"push"},runtimeState:qM,durability:"restored",volatileStateFields:["lastFetchedAt"]},sT=d({deviceId:l(),eventType:o(),data:Y(o(),J()).nullable(),timestamp:l(),seq:l()}),BM=d({eventTypes:w(o()),lastEvent:sT.nullable(),eventCountSinceStart:l()}),SK={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.EventEmitter],methods:{},events:{onEvent:{data:sT}},status:{schema:BM,kind:"push"},runtimeState:BM,durability:"session"},xK=d({id:o(),type:o(),timestamp:l(),label:o().optional(),thumbnailUrl:o().optional(),clipUrl:o().optional(),metadata:Y(o(),J()).optional()}),kK={name:"events",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getEvents:b(d({deviceId:l(),from:l().optional(),to:l().optional(),limit:l().optional()}),w(xK)),getEventThumbnail:b(d({deviceId:l(),eventId:o()}),d({base64:o(),contentType:o()}).nullable()),getEventClipUrl:b(d({deviceId:l(),eventId:o()}),o().nullable())}},FM=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),wK=d({id:o(),source:N(["detected","photo"]),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),MK=d({sampleId:o(),enrolledAt:l().int(),deviceId:l().int().optional(),source:N(["detected","photo"]),mediaId:l().int().optional(),comparable:A(),selfMean:l().nullable(),bestForeign:d({identityId:o(),name:o(),score:l()}).optional(),suspicion:l()}),CK=d({identityId:o(),name:o(),modelId:o(),totalSamples:l().int(),comparableSamples:l().int(),flagged:l().int(),flagThreshold:l(),rows:w(MK).readonly()}),UM=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:dr.optional(),keyFrameMediaId:l().int().optional(),bestMatchScore:l().optional(),nativeFaceShortSidePx:l().optional(),suggestedIdentityId:o().optional(),suggestedMatchScore:l().optional()}),AK=N(["unassigned","recognized","identified","all"]),EK=N(["timestamp","suggestionConfidence"]),RK=N(["asc","desc"]),IK=d({faceIds:w(o()).readonly(),representativeFaceId:o(),size:l().int(),cohesion:l()}),TK=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),_K={name:"face-gallery",scope:"system",mode:"singleton",methods:{listIdentities:b(d({includeCrops:A().optional()}).optional(),w(FM).readonly()),createIdentity:b(d({name:o().min(1)}),FM,{kind:"mutation",auth:"admin"}),renameIdentity:b(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteIdentity:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listIdentitySamples:b(d({identityId:o()}),w(wK).readonly()),auditIdentitySamples:b(d({identityId:o().min(1)}),CK,{auth:"admin"}),removeSample:b(d({identityId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),listRecentFaces:b(d({deviceId:l().int().optional(),deviceIds:w(l().int()).optional(),limit:l().int().positive().optional(),filter:AK.optional(),since:l().int().optional(),until:l().int().optional(),sortBy:EK.optional(),sortDirection:RK.optional(),includeCrops:A().optional()}).optional(),w(UM).readonly()),getFaceByTrack:b(d({deviceId:l().int(),trackId:o()}),UM.nullable()),getFaceMedia:b(d({faceId:o()}),w(TK).readonly()),assignFace:b(d({faceId:o(),identityId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignFace:b(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),deleteFace:b(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),assignFaces:b(d({faceIds:w(o()).min(1),identityId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignFaces:b(d({faceIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),suggestFaceClusters:b(d({threshold:l().min(0).max(1).optional(),minClusterSize:l().int().min(2).optional(),maxClusters:l().int().positive().optional(),limit:l().int().positive().optional(),maxFacesScanned:l().int().positive().optional()}).optional(),w(IK).readonly())}},lT=N(["forward","reverse"]),HM=d({percentage:l().min(0).max(100).nullable(),percentageStep:l().positive().optional(),preset:o(),availablePresets:w(o()),direction:lT.nullable(),oscillating:A().nullable(),lastChangedAt:l()}),NK={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Fan],methods:{setPercentage:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setDirection:b(d({deviceId:l().int().nonnegative(),direction:lT}),O(),{kind:"mutation",auth:"protected"}),setOscillating:b(d({deviceId:l().int().nonnegative(),oscillating:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:HM,kind:"push"},runtimeState:HM,durability:"session"},Eg=d({flags:Y(o(),J()),deviceType:o().nullable(),model:o().nullable(),channelCount:l().nullable(),lastProbedAt:l(),lastFetchedAt:l()}),OK={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:d({deviceId:l(),status:Eg})}},status:{schema:Eg,kind:"push"},runtimeState:Eg,durability:"session"},$M=d({flooded:A(),lastChangedAt:l()}),jK={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:$M,kind:"push"},runtimeState:$M,durability:"restored",volatileStateFields:["lastChangedAt"]},QM=d({detected:A(),lastChangedAt:l()}),PK={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:QM,kind:"push"},runtimeState:QM,durability:"restored",volatileStateFields:["lastChangedAt"]},VM=d({on:A(),currentHumidity:l().min(0).max(100).nullable(),targetHumidity:l().min(0).max(100).nullable(),mode:o().nullable(),availableModes:w(o()),action:o().nullable(),minHumidity:l().nullable(),maxHumidity:l().nullable(),lastChangedAt:l()}),DK={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Humidifier],methods:{setOn:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),humidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:VM,kind:"push"},runtimeState:VM,durability:"session"},GM=d({percent:l().min(0).max(100),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),zK={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor,H.Thermostat],methods:{},status:{schema:GM,kind:"push"},runtimeState:GM,durability:"restored",volatileStateFields:["lastFetchedAt"]},ZM=d({url:o().nullable(),lastUpdated:l().nullable()}),LK={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Image],methods:{},status:{schema:ZM,kind:"push"},runtimeState:ZM,durability:"session"},u0=N(["0","90","180","270"]),d0=N(["auto","manual"]),p0=N(["auto","manual"]),m0=N(["off","blc","wdr","hlc"]),kc=d({min:l(),max:l(),step:l()}),KM=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:u0.optional(),whiteBalance:d0.optional(),warmth:l().optional(),exposureMode:p0.optional(),backlightMode:m0.optional(),lastFetchedAt:l()}),qK=d({supportsBrightness:A(),brightness:kc.optional(),supportsContrast:A(),contrast:kc.optional(),supportsSaturation:A(),saturation:kc.optional(),supportsSharpness:A(),sharpness:kc.optional(),supportsMirror:A(),supportsFlip:A(),rotateOptions:w(u0),whiteBalanceModes:w(d0),supportsWarmth:A(),warmth:kc.optional(),exposureModes:w(p0),backlightModes:w(m0)}),BK=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:u0.optional(),whiteBalance:d0.optional(),warmth:l().optional(),exposureMode:p0.optional(),backlightMode:m0.optional()}),FK={name:"image-settings",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"image-settings",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),qK),setSettings:b(d({deviceId:l(),settings:BK}),O(),{kind:"mutation",auth:"admin"})},status:{schema:KM,kind:"poll"},runtimeState:KM,durability:"restored",volatileStateFields:["lastFetchedAt"]},WM=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),J()).readonly(),createdAt:l(),updatedAt:l(),processState:o()}),Rg=d({id:o(),addonId:o(),name:o(),enabled:A(),info:Y(o(),J()).readonly(),createdAt:l(),updatedAt:l()}),UK=d({addonId:o(),name:o(),description:o(),iconUrl:o().nullable(),color:o(),instanceMode:o(),mode:N(["standalone","account","broker"]),discoveryMode:o(),kind:N(["device-adoption","device-provider"]),brokerKind:o().nullable(),supportsLocationImport:A(),canTest:A(),existingInstances:w(d({id:o(),name:o()})),canAdd:A()}),HK=N(["validated","rejected","inconclusive","unsupported"]),$K=d({success:A(),error:o().optional(),status:HK.optional(),testedBy:o().nullable().optional(),latencyMs:l().nonnegative().optional(),detail:o().optional()}),QK=d({addonId:o(),name:o(),enabled:A().optional(),info:Y(o(),J()).optional(),settings:Y(o(),J()).optional(),skipRestart:A().optional()}),VK=d({id:o(),name:o().optional(),enabled:A().optional(),info:Y(o(),J()).optional()}),GK=d({success:A(),deletedId:o()}),ZK={name:"integrations",scope:"system",mode:"singleton",methods:{list:b(O(),w(WM)),get:b(d({id:o()}),WM),getByAddonId:b(d({addonId:o()}),Rg.nullable()),create:b(QK,Rg,{kind:"mutation",auth:"admin"}),update:b(VK,Rg,{kind:"mutation",auth:"admin"}),delete:b(d({id:o()}),GK,{kind:"mutation",auth:"admin"}),getSettings:b(d({id:o()}),Y(o(),J()),{auth:"admin"}),setSettings:b(d({id:o(),settings:Y(o(),J())}),d({success:A()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:b(O(),w(UK),{auth:"admin"}),testConnection:b(d({addonId:o(),settings:Y(o(),J())}),$K,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},KK=d({codecs:w(o()),sampleRate:l(),duplex:N(["half","full"]),maxBacklogMs:l()}),Ig=d({talking:A(),lastSessionAt:l().nullable(),ability:KK.nullable()}),WK=N(["opus","s16le","g711ulaw","g711alaw"]),YK={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{startSession:b(d({deviceId:l()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation",auth:"protected"}),handleAnswer:b(d({deviceId:l(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation",auth:"protected"}),stopSession:b(d({deviceId:l(),sessionId:o()}),O(),{kind:"mutation",auth:"protected"}),startTalkSession:b(d({deviceId:l()}),d({sessionId:o()}),{kind:"mutation",auth:"protected"}),pushTalkAudio:b(d({deviceId:l(),audioBase64:o(),codec:WK.optional(),sampleRate:l().int().positive().optional(),channels:l().int().positive().optional(),sequenceNumber:l().int()}),d({accepted:A()}),{kind:"mutation",auth:"protected"}),endTalkSession:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"protected"})},events:{onStatusChanged:{data:d({deviceId:l(),status:Ig})}},status:{schema:Ig,kind:"command-driven"},runtimeState:Ig,durability:"session"},XK=N(["idle","mowing","paused","docked","error"]),JK=N(["info","warning","error"]),YM=d({activity:XK,batteryLevel:l().min(0).max(100).nullable(),progressPercent:l().min(0).max(100).nullable(),currentCode:l().nullable(),currentCodeLabel:o().nullable(),severity:JK,lastChangedAt:l()}),eW={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.LawnMower],methods:{startMowing:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),dock:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:YM,kind:"push"},runtimeState:YM,durability:"session"},tW=N(["lan","wifi","docker","vpn","loopback","other"]),cT=d({name:o(),family:N(["IPv4","IPv6"]),address:o(),cidr:o(),netmask:o(),internal:A(),mac:o(),kind:tW,preferred:A(),plausible:A(),plausibleReason:o()}),nW=d({interfaces:w(cT).readonly(),probedAt:l()}),aW=cT.nullable(),iW=d({label:o(),baseUrl:o(),kind:N(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:N(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:A(),plausibleReason:o(),priority:l()}),rW=N(["server-config","server-env","caller-hint","default"]),oW=d({port:l().int().min(1).max(65535),source:rW}),sW=d({endpoints:w(iW).readonly(),localPort:oW}),XM=d({baseUrl:o().nullable(),resolved:o().nullable()}),JM=d({baseUrls:w(o()).readonly(),resolved:w(o()).readonly()}),Tg=d({addresses:w(o()).readonly()}),ep=d({mode:N(["generated","uploaded","disabled"]),leafFingerprintSha256:o().nullable(),caFingerprintSha256:o().nullable(),validTo:o().nullable(),sans:w(o()),caCertPem:o().nullable(),reissueError:o().nullable(),restartRequired:A()}),lW={name:"local-network",scope:"system",mode:"singleton",methods:{list:b(O(),nW),getPreferred:b(O(),aW),getConnectionEndpoints:b(d({port:l().int().min(1).max(65535).optional(),includeLoopback:A().optional(),ipv4Only:A().optional(),scheme:N(["http","https"]).optional()}),sW),getNotificationEndpoint:b(O(),XM),setNotificationEndpoint:b(d({baseUrl:o().nullable()}),XM,{kind:"mutation"}),getViewerEndpoints:b(O(),JM),setViewerEndpoints:b(d({baseUrls:w(o()).readonly()}),JM,{kind:"mutation"}),getAllowedAddresses:b(O(),Tg),setAllowedAddresses:b(Tg,d({success:Q(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:b(O(),Tg,{kind:"mutation"}),getTlsStatus:b(O(),ep),regenerateCertificate:b(d({reason:o().optional()}),ep,{kind:"mutation",auth:"admin"}),uploadCertificate:b(d({certPem:o().min(1),keyPem:o().min(1),caPem:o().optional()}),ep,{kind:"mutation",auth:"admin"}),downloadCa:b(O(),d({pem:o()})),revertToGeneratedCertificate:b(O(),ep,{kind:"mutation",auth:"admin"})},mount:{kind:"hub-only"}},cW=N(["locked","unlocked","locking","unlocking","jammed"]),e2=d({state:cW,lastChangedAt:l()}),uW={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Lock],methods:{lock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),unlock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:e2,kind:"push"},runtimeState:e2,durability:"restored",volatileStateFields:["lastChangedAt"]},dW=N(["off","on","idle","playing","paused","buffering","standby"]),uT=N(["off","all","one"]),pW=d({type:o(),title:o(),artist:o().optional(),album:o().optional(),imageUrl:o().optional()}),t2=d({state:dW,volumeLevel:l().min(0).max(100).nullable(),isMuted:A().nullable(),source:o(),availableSources:w(o()),currentMedia:pW.nullable(),positionMs:l().int().nonnegative().nullable(),durationMs:l().int().nonnegative().nullable(),shuffle:A().nullable(),repeat:uT.nullable(),lastChangedAt:l()}),mW={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.MediaPlayer],methods:{play:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),next:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),previous:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),seek:b(d({deviceId:l().int().nonnegative(),positionMs:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setVolume:b(d({deviceId:l().int().nonnegative(),volumeLevel:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMute:b(d({deviceId:l().int().nonnegative(),muted:A()}),O(),{kind:"mutation",auth:"protected"}),setShuffle:b(d({deviceId:l().int().nonnegative(),shuffle:A()}),O(),{kind:"mutation",auth:"protected"}),setRepeat:b(d({deviceId:l().int().nonnegative(),repeat:uT}),O(),{kind:"mutation",auth:"protected"}),selectSource:b(d({deviceId:l().int().nonnegative(),source:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),playMedia:b(d({deviceId:l().int().nonnegative(),mediaId:o().min(1),mediaType:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:t2,kind:"push"},runtimeState:t2,durability:"session"},fW=d({id:o(),label:o(),scope:N(["mesh","public"]),url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),hW=d({id:o(),hostname:o(),magicDns:o(),addresses:w(o()).readonly(),os:o().optional(),online:A(),lastSeenMs:l(),isSelf:A(),connection:N(["direct","relay","idle"]),relay:o().nullable(),lastHandshakeMs:l(),rxBytes:l(),txBytes:l(),tags:w(o()).readonly(),exitNodeOption:A(),advertisedRoutes:w(o()).readonly(),userLogin:o().nullable(),keyExpiry:l().nullable()}),gW=d({joined:A(),meshIp:o(),magicDnsHostname:o(),peerCount:l(),endpoints:w(fW).readonly(),error:o().optional(),tenantName:o(),magicDnsSuffix:o(),userLogin:o().nullable(),controlPlaneUrl:o(),keyExpiry:l().nullable(),daemonSocket:o().optional(),daemonCliPath:o().optional()}),vW={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:b(O(),gW),join:b(d({authKey:o().min(8),hostname:o().optional()}),d({joined:Q(!0)}),{kind:"mutation"}),startLogin:b(d({hostname:o().optional()}),d({loginUrl:o()}),{kind:"mutation"}),leave:b(O(),d({left:Q(!0)}),{kind:"mutation"}),logout:b(O(),d({loggedOut:Q(!0)}),{kind:"mutation"}),listPeers:b(O(),d({peers:w(hW).readonly()})),testConnection:b(d({authKey:o().optional()}),d({ok:A(),tenant:o().optional(),daemonVersion:o().optional(),error:o().optional()}),{kind:"mutation"})}},n2=d({detected:A(),lastDetectedAt:l().nullable(),autoClearAfterMs:l().nullable()}),yW=d({deviceId:l(),detected:A(),timestamp:l(),source:r0,regions:w(am).readonly().optional()}),bW={name:"motion",scope:"device",mode:"singleton",deviceNative:!0,deviceTypes:[H.Camera,H.Sensor],methods:{isDetected:b(d({deviceId:l()}),A())},events:{onMotionChanged:{data:yW}},status:{schema:n2,kind:"push"},runtimeState:n2,durability:"session"},dT=d({enabled:A(),lastChangedAt:l()}),SW=dT.extend({lastFetchedAt:l()}),xW={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Light,H.Siren,H.Switch],methods:{setMotionTrigger:b(d({deviceId:l().int().nonnegative(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:d({deviceId:l(),enabled:A(),lastChangedAt:l()})}},status:{schema:dT,kind:"command-driven"},runtimeState:SW,durability:"session"},a2=d({x:l().min(0).max(1),y:l().min(0).max(1),width:l().gt(0).max(1),height:l().gt(0).max(1)}),pT=d({deviceId:l().int().positive(),source:a2,cell:a2}),kW=d({profile:N(["high","mid","low"]),offered:A(),missingSources:w(l().int().positive()),canvas:o(),published:A()}),i2=d({instanceId:o(),deviceId:l().int().nonnegative(),name:o(),fps:l().int(),cells:w(pT),profiles:w(kW)}),wW=d({deviceId:l().int().nonnegative(),name:o().min(1).max(160).optional(),fps:l().int().min(1).max(60).optional(),publishedProfiles:w(N(["high","mid","low"])).max(3).optional(),cells:w(pT).max(16)}),MW={name:"camera-grid-layout",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],exposesDeviceSettings:!0,methods:{getLayout:b(d({deviceId:l().int().nonnegative()}),i2.nullable(),{auth:"admin"}),saveLayout:b(wW,i2,{kind:"mutation",auth:"admin"})}},mT=d({id:l(),enabled:A(),shape:CI}),r2=d({enabled:A(),sensitivity:l(),regions:w(mT),lastFetchedAt:l()}),CW=d({maxRegions:l(),supportedShapes:w(AI),grid:vH,sensitivity:d({min:l(),max:l(),step:l()})}),AW=d({enabled:A().optional(),sensitivity:l().optional(),regions:w(mT).optional()}),EW={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:b(d({deviceId:l()}),CW),setZone:b(d({deviceId:l(),patch:AW}),O(),{kind:"mutation",auth:"admin"})},status:{schema:r2,kind:"poll"},runtimeState:r2,durability:"restored",volatileStateFields:["lastFetchedAt"]},sm=N(["person","vehicle","animal","face","package","other"]),fT=d({class:sm,timestamp:l(),confidence:l().min(0).max(1).optional()}),hT=d({lastByClass:k8(sm,fT.nullable()),supportedClasses:w(sm).readonly(),enabled:A()}),RW=N(["boxed","while-streaming","flag-only"]),IW=d({supportedClasses:w(sm).readonly(),geometry:RW}),TW=d({enabled:A().optional()}),_W=hT.extend({lastFetchedAt:l()}),NW={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getOptions:b(d({deviceId:l()}),IW),setSettings:b(d({deviceId:l(),settings:TW}),O(),{kind:"mutation",auth:"admin"}),setEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:d({deviceId:l(),detection:fT})}},status:{schema:hT,kind:"push"},runtimeState:_W,durability:"restored",volatileStateFields:["lastFetchedAt"]},OW=d({pan:l().min(-1).max(1).optional(),tilt:l().min(-1).max(1).optional(),speed:l().min(0).max(1).optional()}),jW=N(["goHome","locate","spotClean","findPet","personFollow","stop","startClean","pauseClean","dockWash","autoEmpty","flashOn","flashOff"]),PW=N(["action","sound"]),DW=d({id:o(),kind:PW,label:o(),icon:o(),soundId:l().int().optional(),enabled:A()}),zW=d({x:l(),y:l()}),LW=d({move:A(),stop:A(),goToPoint:A(),runAction:A(),playSound:A(),light:A(),lightMode:A()}),gT=N(["auto","manual"]),qW=N(["idle","cleaning","spot","following","goto","returning","paused","unknown"]),uy=d({mode:qW,following:A(),flash:A(),lightMode:gT,lightLevel:l().min(40).max(100),lastChangedAt:l()}),BW=uy.extend({lastFetchedAt:l()}),FW={name:"navigation",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/navigation-panel",tab:"navigation",topTab:!0,label:"Navigation",order:0}},methods:{move:b(OW.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:b(d({deviceId:l()}),O(),{kind:"mutation"}),goToPoint:b(zW.extend({deviceId:l()}),O(),{kind:"mutation"}),listActions:b(d({deviceId:l()}),w(DW)),runAction:b(d({deviceId:l(),actionId:jW}),O(),{kind:"mutation"}),playSound:b(d({deviceId:l(),soundId:l().int()}),O(),{kind:"mutation"}),setLightOn:b(d({deviceId:l(),on:A()}),O(),{kind:"mutation"}),setLightMode:b(d({deviceId:l(),mode:gT,level:l().min(40).max(100).optional()}),O(),{kind:"mutation"}),setLightLevel:b(d({deviceId:l(),level:l().min(40).max(100)}),O(),{kind:"mutation"}),getFeatures:b(d({deviceId:l()}),LW)},events:{onStatusChanged:{data:d({deviceId:l(),status:uy})}},status:{schema:uy,kind:"push"},runtimeState:BW,durability:"session"},UW=["wifi","ethernet","cellular","unknown"],_g=d({type:N(UW),signalPercent:l().min(0).max(100).nullable(),rssiDbm:l().optional(),ssid:o().optional(),lastUpdated:l()}),HW={type:"unknown",signalPercent:null,lastUpdated:0},$W={name:"network-link",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Button,H.Switch,H.Light,H.Lock,H.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:_g})}},status:{schema:_g,kind:"push",empty:HW},runtimeState:_g,durability:"restored",volatileStateFields:["lastUpdated"]},QW=d({nominalBitrateKbps:l(),observedBitrateKbps:l(),peakBitrateKbps:l(),packetLossPercent:l(),lastUpdated:l()}),VW=d({rttMs:l(),jitterMs:l(),estimatedBandwidthKbps:l(),packetLossPercent:l().min(0).max(100),lastUpdated:l()}),o2=d({deviceId:l(),streams:Y(o(),QW),client:VW.optional()}),GW={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:b(d({deviceId:l()}),o2.nullable()),getAllStats:b(O(),w(o2).readonly()),reportClientStats:b(d({deviceId:l(),rttMs:l().min(0).max(6e4),jitterMs:l().min(0).max(1e4),estimatedBandwidthKbps:l().min(0).max(1e6),packetLossPercent:l().min(0).max(100)}),O(),{kind:"mutation"})},mount:{kind:"server-provided"}},ZW=d({addonId:o(),capabilities:w(o()).readonly(),status:o()}),KW=d({pid:l(),name:o(),state:o(),cpuPercent:l(),memoryRss:l(),uptimeSeconds:l(),services:w(ZW).readonly(),groupId:o().optional()}),WW=d({id:o(),status:o(),cpuPercent:l(),memoryRss:l()}),YW=d({category:o(),total:l(),healthy:l(),addons:w(WW).readonly()}),XW=d({name:o(),version:o()}),JW=d({id:o(),name:o(),hostname:o(),platform:o(),arch:o(),cpuModel:o().nullable(),cpuCores:l(),memoryMB:l(),engines:w(o()).readonly(),isHub:A(),isOnline:A(),cpuPercent:l(),memoryPercent:l(),uptime:l(),lastSeen:o(),localIps:w(o()).readonly(),addons:w(d({id:o(),capabilities:w(o()).readonly(),status:o()})).readonly(),processes:w(KW).readonly(),categories:w(YW).readonly(),rootPackage:XW.nullable()}),eY=d({callerAddonId:o(),providerAddonId:o(),capName:o(),callsPerMin:l(),lastCallAtMs:l()}),tY=d({nodeId:o(),name:o(),version:o(),status:o(),synced:A()}),nY=d({hubVersion:o(),nodes:w(tY)}),Ng=d({nodeId:o(),addonId:o()}),aY=d({id:o(),status:o(),version:o().optional(),packageName:o().optional()}),wc=d({success:A()}),iY=d({success:A(),reason:o().optional()}),rY=d({restarted:w(o()).readonly(),failed:w(o()).readonly()}),oY=d({nodeId:o(),name:o()}),sY={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:b(O(),w(JW).readonly(),{auth:"admin"}),deployAddon:b(Ng,wc,{kind:"mutation",auth:"admin"}),undeployAddon:b(Ng,wc,{kind:"mutation",auth:"admin"}),restartAddon:b(Ng,wc,{kind:"mutation",auth:"admin"}),restartProcess:b(d({nodeId:o(),processName:o()}),iY,{kind:"mutation",auth:"admin"}),restartNode:b(d({nodeId:o()}),rY,{kind:"mutation",auth:"admin"}),shutdownNode:b(d({nodeId:o()}),wc,{kind:"mutation",auth:"admin"}),renameNode:b(d({nodeId:o(),name:o().min(1).max(64)}),oY,{kind:"mutation",auth:"admin"}),clusterAddonStatus:b(O(),Y(o(),nY),{auth:"admin"}),getCapUsageGraph:b(d({windowSeconds:l().int().positive().max(300).default(60)}),w(eY).readonly(),{auth:"admin"}),getNodeAddons:b(d({nodeId:o()}),w(aY).readonly(),{auth:"admin"}),setProcessLogLevel:b(d({nodeId:o(),level:o()}),wc,{kind:"mutation",auth:"admin"}),executeQuery:b(d({nodeId:o(),addonId:o(),queryName:o(),params:Y(o(),J()).optional()}),J(),{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},lY=N(["min","low","normal","high"]),cY=d({id:o().min(1),title:o().min(1),uri:VL().optional(),destructive:A().optional()}),uY=d({image:A(),priority:A(),data:A(),actions:A(),recipients:A()}),s2=d({lastSentAt:l(),lastError:o().nullable(),queueDepth:l().int().nonnegative(),supports:uY}),dY=d({deviceId:l().int().nonnegative(),title:o().optional(),body:o().min(1),image:o().optional(),priority:lY.optional(),channel:o().optional(),recipients:w(o()).optional(),actions:w(cY).optional(),data:Y(o(),J()).optional()}),pY=d({notificationId:o(),acceptedAt:l()}),mY={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Notifier],methods:{send:b(dY,pY,{kind:"mutation",auth:"admin"}),cancel:b(d({deviceId:l().int().nonnegative(),notificationId:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},events:{onSent:{data:d({deviceId:l(),notificationId:o(),success:A(),error:o().nullable(),acceptedAt:l()})}},status:{schema:s2,kind:"command-driven"},runtimeState:s2,durability:"session"},l2=d({value:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional(),lastFetchedAt:l()}),fY={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:l2,kind:"push"},runtimeState:l2,durability:"restored",volatileStateFields:["lastFetchedAt"]},vT=N(["text","timestamp","watermark"]),dy=N(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),hY=d({id:o(),kind:vT,enabled:A(),text:o().optional(),position:dy.optional(),availablePositions:w(dy).readonly(),readOnly:A().optional()}),c2=d({overlays:w(hY).readonly()}),gY=d({enabled:A().optional(),text:o().optional(),position:dy.optional()}).partial(),vY={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{setOverlay:b(d({deviceId:l(),overlayId:o(),patch:gY}),O(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:d({deviceId:l(),status:c2})}},status:{schema:c2,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}}}]}},yY=wt("kind",[d({kind:Q("static"),text:o().max(64)}),d({kind:Q("clock"),pattern:o().min(1).max(32).default("HH:mm"),timezone:o().min(1).max(64).optional()}),d({kind:Q("device-state"),deviceId:l().int().optional(),capName:o().min(1).max(64),valuePath:o().min(1).max(64)}),d({kind:Q("latest-recognition"),recognition:N(["person","plate"])})]),py=d({enabled:A().default(!0),source:yY,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:Dm.optional(),conditions:Wb.optional(),fallbackText:o().max(64).default("")}),u2=d({slotId:o(),kind:vT,readOnly:A(),cameraEnabled:A(),cameraText:o().optional(),binding:py.nullable()}),bY=N(["written","unchanged","gated","unreadable","disabled","unbound","failed"]),Og=d({slotId:o(),outcome:bY,text:o(),reason:o().optional()}),SY=N(["number","boolean","string","enum"]),xY=d({deviceId:l().int(),deviceName:o(),capName:o(),valuePath:o(),label:o(),valueType:SY,enumValues:w(o()).readonly().optional()}),kY={name:"osd-manager",scope:"system",mode:"singleton",methods:{getDeviceOsd:b(d({deviceId:l().int()}),d({supported:A(),slots:w(u2)}),{auth:"admin"}),getSourceCatalog:b(d({deviceId:l().int()}),d({sources:w(xY)}),{auth:"admin"}),getConditionSupport:b(d({}),d({supported:w(o()),catalog:w(_I)}),{auth:"admin"}),setSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1),binding:py}),d({slot:u2,render:Og}),{kind:"mutation",auth:"admin"}),clearSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"}),copyDeviceConfiguration:b(d({sourceDeviceId:l().int(),targetDeviceId:l().int()}),d({copied:l().int().nonnegative(),skipped:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),previewSlot:b(d({deviceId:l().int(),slotId:o().min(1),binding:py.optional()}),Og,{kind:"mutation",auth:"admin"}),renderDevice:b(d({deviceId:l().int()}),d({results:w(Og)}),{kind:"mutation",auth:"admin"})}},yT=4,f0=200,wY=N(["normal","offline","on_batteries"]),jg=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:wY.nullable(),error:o().nullable(),errorCode:l().nullable(),isDualHopper:A(),childLock:A(),indicatorLight:A(),feedSound:A(),volume:l(),lastFetchedAt:l()}),MY={name:"pet-feeder",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.PetFeeder],methods:{feed:b(d({deviceId:l().int().nonnegative(),grams:jg.optional(),hopper1:jg.optional(),hopper2:jg.optional()}),O(),{kind:"mutation",auth:"protected"}),cancelFeed:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),resetDesiccant:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),markFoodReplenished:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),callPet:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),playSound:b(d({deviceId:l().int().nonnegative(),soundId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setChildLock:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setIndicatorLight:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setFeedSound:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setVolume:b(d({deviceId:l().int().nonnegative(),level:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:d2,kind:"poll"},runtimeState:d2,durability:"session"},p2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),CY=d({id:o(),text:o(),score:l(),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),Pg=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:dr.optional(),keyFrameMediaId:l().int().optional(),base64:o().optional(),cropUrl:o().optional()}),AY=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),EY=d({plateIds:w(o()).readonly(),representativePlateId:o(),representativeText:o(),size:l().int(),cohesion:l()}),RY={name:"plate-gallery",scope:"system",mode:"singleton",methods:{listPlates:b(d({deviceId:l().int().optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}).optional(),w(Pg).readonly()),getPlateByTrack:b(d({deviceId:l().int(),trackId:o()}),Pg.nullable()),getPlateMedia:b(d({plateId:o()}),w(AY).readonly()),searchPlates:b(d({text:o().min(1),maxDistance:l().int().min(0).optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}),w(Pg).readonly()),suggestPlateClusters:b(d({maxDistance:l().int().min(0).optional(),minClusterSize:l().int().min(2).optional(),limit:l().int().positive().optional()}).optional(),w(EY).readonly()),correctPlateText:b(d({plateId:o(),text:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deletePlate:b(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicles:b(d({includeCrops:A().optional()}).optional(),w(p2).readonly()),createVehicle:b(d({name:o().min(1)}),p2,{kind:"mutation",auth:"admin"}),renameVehicle:b(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteVehicle:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicleSamples:b(d({vehicleId:o()}),w(CY).readonly()),removeVehicleSample:b(d({vehicleId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlate:b(d({plateId:o(),vehicleId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignPlate:b(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlates:b(d({plateIds:w(o()).min(1),vehicleId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignPlates:b(d({plateIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"})}},bT=N(Nm),IY=N(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),TY=d({preferred:w(o()).readonly(),rationale:o()}),my=N(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),_Y=d({encoder:my,codec:N(["H264","H265"]),family:N(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:A(),reason:o().optional()});d({encoders:w(_Y).readonly(),defaultH264:my,defaultH265:my,probedAt:l()});d({methods:w(o()).readonly(),probedAt:l()});var NY=N(["darwin","linux","win32"]),OY=N(["arm64","x64"]),jY=d({type:N(["nvidia","amd","intel","apple"]),name:o(),memoryMB:l().optional()}),PY=d({type:N(["apple-ane","intel-npu"])}),DY=d({type:Q("coral-edgetpu"),bus:o().optional()}),ST=d({platform:NY,arch:OY,cpuModel:o(),cpuCores:l(),totalRAM_MB:l(),availableRAM_MB:l(),gpu:jY.nullable(),npu:PY.nullable(),coral:DY.nullable().optional()}),m2=d({runtime:N(["node","python"]),backend:o(),format:N(["onnx","coreml","openvino","tflite"]),score:l(),reason:o(),available:A()}),zY=d({key:o(),backend:o(),device:o(),format:bT,runtime:Q("python"),score:l(),available:A()}),LY=d({hardware:ST,scores:w(m2).readonly(),bestScore:m2,pythonPath:o().nullable(),devices:w(zY).readonly()}),qY=d({modelId:o(),name:o(),minRAM_MB:l(),accuracyScore:l(),formats:w(o()).readonly()}),BY=d({modelId:o(),runtime:N(["node","python"]),backend:o(),format:bT,reason:o()}),FY={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:b(O(),LY),getHardware:b(O(),ST),resolveInferenceConfig:b(d({requirements:w(qY).readonly()}),BY),resolveHwAccel:b(d({prefer:IY}),TY)}},f2=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()}),UY={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:f2,kind:"push"},runtimeState:f2,durability:"restored",volatileStateFields:["lastFetchedAt"]},HY=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),accuracyMeters:l().nonnegative()}),h2=d({state:o(),location:o().nullable(),gps:HY.nullable(),batteryPercent:l().min(0).max(100).nullable(),lastChangedAt:l()}),$Y={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Presence],methods:{},status:{schema:h2,kind:"push"},runtimeState:h2,durability:"restored",volatileStateFields:["lastChangedAt"]},g2=d({hpa:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),QY={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:g2,kind:"push"},runtimeState:g2,durability:"restored",volatileStateFields:["lastFetchedAt"]},VY=wt("kind",[pl,Pm]),xT=d({id:l(),enabled:A(),shape:VY}),v2=d({enabled:A(),regions:w(xT).nullable(),audioEnabled:A().nullable(),lastFetchedAt:l()}),GY=d({maxRegions:l(),supportedShapes:w(AI),polygonVertices:gH.optional(),supportsAudioMute:A()}),ZY=d({enabled:A().optional(),regions:w(xT).optional()}),KY={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:b(d({deviceId:l()}),GY),setMask:b(d({deviceId:l(),patch:ZY}),O(),{kind:"mutation",auth:"admin"}),setAudioEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:v2,kind:"poll"},runtimeState:v2,durability:"restored",volatileStateFields:["lastFetchedAt"]},WY=N(["home","day-mode","night-mode","day-night-auto","set-limits","save-limits","reboot","osd-menu"]),YY=d({id:o(),name:o(),fn:WY.nullable(),writable:A()}),kT=d({pan:l().nullable(),tilt:l().nullable(),zoom:l().nullable()}),y2=d({pan:l().optional(),tilt:l().optional(),zoom:l().optional(),speed:l().optional()}),XY=kT.extend({autofocus:A()}),JY=d({hasPan:A(),hasTilt:A(),hasZoom:A(),supportsPresets:A(),maxPresets:l().optional(),hasAutofocus:A(),speedSteps:l().int().positive().nullable(),moveImpulseMs:l().int().positive().nullable()}),eX=d({presetId:o().nullable(),source:N(["operator","firmware","native","none"])}),tX=d({enabled:A(),seconds:l().int()}),nX={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:b(y2.extend({deviceId:l()}),O(),{kind:"mutation"}),continuousMove:b(y2.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:b(d({deviceId:l()}),O(),{kind:"mutation"}),getPresets:b(d({deviceId:l()}),w(YY)),goToPreset:b(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation"}),savePreset:b(d({deviceId:l(),presetId:o(),name:o()}),O(),{kind:"mutation",auth:"admin"}),deletePreset:b(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation",auth:"admin"}),getOptions:b(d({deviceId:l()}),JY),goHome:b(d({deviceId:l()}),O(),{kind:"mutation"}),getHomePreset:b(d({deviceId:l()}),eX),setHomePreset:b(d({deviceId:l(),presetId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),captureHomeHere:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getHomeReturn:b(d({deviceId:l()}),tX.nullable()),setHomeReturn:b(d({deviceId:l(),enabled:A(),seconds:l().int().min(0).max(3600)}),O(),{kind:"mutation",auth:"admin"}),getPosition:b(d({deviceId:l()}),kT),setAutofocus:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"})},status:{schema:XY,kind:"command-driven"}},aX=o().describe("Vendor target string (people/vehicle/pet); empty = camera default"),fy=d({targetType:aX,stopDelaySeconds:l().int().min(0).max(300),disappearDelaySeconds:l().int().min(0).max(300)}),iX=d({value:o(),label:o()}),Rp=d({enabled:A(),lastChangedAt:l(),currentSettings:fy.nullable(),supportedTargetTypes:w(iX)}),rX=Rp.extend({lastFetchedAt:l()}),oX={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:b(d({deviceId:l()}),Rp),setEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"}),getSettings:b(d({deviceId:l()}),fy.nullable()),setSettings:b(d({deviceId:l(),settings:fy.partial()}),O(),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:Rp})}},status:{schema:Rp,kind:"command-driven"},runtimeState:rX,durability:"session"},sX={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera,H.Sensor,H.Switch],methods:{reboot:b(d({deviceId:l().int().nonnegative()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin"})}},b2=d({deviceId:l(),enabled:A(),activeMode:Ob,nodeId:o(),storageBytes:l()}),wT=d({profile:o(),startMs:l(),endMs:l()}),lX=d({deviceId:l(),ranges:w(wT),profilesWithFootage:w(o())}),cX=d({deviceId:l(),days:w(l())}),uX=d({deviceId:l(),read:N(["read","unreadable"]),ranges:w(wT).readonly(),profilesWithFootage:w(o()).readonly()}),dX=d({deviceId:l(),read:N(["read","unreadable"]),days:w(l()).readonly()}),pX=d({deviceId:l(),localMasterPath:o().nullable(),playbackUrl:o().nullable(),playbackEndpoints:w(o())}),mX=d({deviceId:l(),usedBytes:l(),oldestMs:l().nullable().optional(),segments:l().optional(),residentBytes:l().optional(),residentOldestMs:l().nullable().optional()}),fX=d({locationId:o().nullable(),locationIds:w(o()).optional(),root:o().optional(),usedBytes:l(),availableBytes:l().nullable(),totalBytes:l().nullable()}),hX=d({nodeId:o(),totalUsedBytes:l(),devices:w(mX),devicesRead:N(["archive","unavailable"]).optional(),locations:w(fX).optional()}),gX=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o(),bytes:l(),files:l().int()}),vX=N(["unassigned","target-not-writable","below-threshold","no-headroom"]),yX=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o().nullable(),bytes:l(),reason:vX}),S2=d({moves:w(gX),skipped:w(yX),bytesToMove:l(),jobIds:w(o())}),x2=d({throttleMbps:l().min(1).max(1e3).optional(),minMoveGb:l().min(0).optional()}),bX=d({deviceId:l().int(),profile:o(),locationId:o()}),SX=d({deviceId:l().int(),locationId:o()}),xX=d({assignments:w(bX),pins:w(SX),defaultLocations:Y(o(),o())}),kX=d({deviceId:l().int(),locationId:o().nullable()}),wX=wt("kind",[d({kind:Q("segment"),startMs:l(),durMs:l(),bytes:l()}),d({kind:Q("gap"),nearestEdgeMs:l().nullable(),prevEndMs:l().nullable().optional()})]),MX=d({data:$t(Uint8Array)}),CX=d({data:$t(Uint8Array),gopStartMs:l(),gopDurMs:l()}),AX=wt("kind",[d({kind:Q("ok"),data:$t(Uint8Array),gopStartMs:l(),gopDurMs:l(),reachesRequestedEnd:A()}),d({kind:Q("spans-multiple-segments"),segmentEndMs:l()})]),EX={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:b2,kind:"command-driven"},methods:{getAvailability:b(d({deviceId:l(),fromMs:l(),toMs:l(),profile:o().optional()}),lX,{kind:"query",auth:"protected"}),getAvailabilityBatch:b(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l()}),w(uX).readonly(),{kind:"query",auth:"protected"}),getDaysWithRecordings:b(d({deviceId:l(),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),cX,{kind:"query",auth:"protected"}),getDaysWithRecordingsBatch:b(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),w(dX).readonly(),{kind:"query",auth:"protected"}),getPlaybackManifest:b(d({deviceId:l(),fromMs:l(),toMs:l()}),pX,{kind:"query",auth:"protected"}),getStorageUsage:b(d({}),hX,{kind:"query",auth:"admin"}),getDeviceConfig:b(d({deviceId:l()}),lg,{kind:"query",auth:"admin"}),locateSegment:b(d({deviceId:l(),profile:o(),epochMs:l()}),wX,{kind:"query",auth:"admin"}),readSegmentBytes:b(d({deviceId:l(),profile:o(),startMs:l()}),MX,{kind:"query",auth:"admin"}),readGopBytes:b(d({deviceId:l(),profile:o(),startMs:l(),epochMs:l()}),CX,{kind:"query",auth:"admin"}),readWindowBytes:b(d({deviceId:l(),profile:o(),startMs:l(),fromMs:l(),toMs:l()}),AX,{kind:"query",auth:"admin"}),setDeviceConfig:b(d({deviceId:l(),config:lg}),lg,{kind:"mutation",auth:"admin"}),rescanStorage:b(d({deviceId:l()}),b2,{kind:"mutation",auth:"admin"}),pruneFootage:b(d({deviceId:l(),reason:Nb.optional()}),d({floorMs:l().nullable(),deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),deleteFootprint:b(d({deviceId:l(),fromMs:l().optional(),toMs:l().optional()}),d({deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(ER,w(AR).readonly(),{kind:"query",auth:"admin"}),renderGif:b(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(2),postRollSec:l().min(0).max(30).default(5),maxWidth:l().int().min(120).max(1280).default(480),fps:l().int().min(1).max(15).default(5)}),d({gifBase64:o(),fromMs:l(),toMs:l()}),{kind:"mutation",auth:"admin"}),renderClip:b(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(3),postRollSec:l().min(0).max(30).default(7),maxWidth:l().int().min(160).max(1920).default(640)}),d({clipBase64:o(),mime:o(),fromMs:l(),toMs:l(),bytes:l().int()}),{kind:"mutation",auth:"admin"}),pauseForStorageMigration:b(Vr,d({paused:Q(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(Vr,d({resumed:Q(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(Vr,d({refreshed:Q(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(Vq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),Xc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateFootage:b(NR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),listRelocateJobs:b(d({}),w(Xc).readonly(),{kind:"query",auth:"admin"}),getRelocateResidue:b(o7,s7,{kind:"query",auth:"admin"}),reconcileLedgerAgainstDisk:b(l7,p7,{kind:"mutation",auth:"admin"}),cancelRelocateJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),planStorageRebalance:b(x2,S2,{kind:"query",auth:"admin"}),startStorageRebalance:b(x2,S2,{kind:"mutation",auth:"admin"}),getPlacement:b(d({}),xX,{kind:"query",auth:"admin"}),setDevicePlacement:b(kX,d({ok:Q(!0)}),{kind:"mutation",auth:"admin"})}},RX=l().min(.25).max(32),IX=d({fromSec:l().nonnegative(),toSec:l().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:"dense range must have toSec > fromSec"}),TX=d({everyMs:l().int().positive(),ranges:w(IX).min(1).max(200)}),_X=d({everyMs:l().int().positive(),outputFps:l().int().min(1).max(60).optional(),dense:TX.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:Tb.custom,message:"dense.everyMs must be strictly smaller than the base everyMs",path:["dense","everyMs"]})}),MT=d({speed:RX.optional(),timelapse:_X.optional(),includeAudio:A(),maxLifeMs:l().int().positive(),deleteAfterDownload:A(),title:o().max(200).optional(),notifyTargetIds:w(o().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:Tb.custom,message:"speed and timelapse are mutually exclusive",path:["timelapse"]})}),NX=N(["queued","rendering","ready","failed","expired","deleted"]),Mc=d({id:o(),deviceId:l(),profile:o(),fromMs:l(),toMs:l(),options:MT,state:NX,progressPct:l().nullable(),fileBytes:l().nullable(),expiresAt:l(),deleteAfterDownload:A(),downloadedAt:l().nullable(),createdAt:l(),createdBy:o(),error:o().nullable()}),OX=d({url:o(),endpoints:w(o())}),jX=d({base64:o(),contentType:o(),name:o(),bytes:l().int().nonnegative()}),PX={name:"recording-export",scope:"system",mode:"singleton",methods:{createExport:b(d({deviceId:l(),profile:o().optional(),profiles:w(o()).min(1).optional(),fromMs:l(),toMs:l(),options:MT}).superRefine((e,t)=>{(e.profiles!==void 0&&e.profiles.length>0?e.profiles:e.profile!==void 0?[e.profile]:[]).length<1&&t.addIssue({code:Tb.custom,message:"pass profiles[] (min 1) or legacy profile",path:["profiles"]})}),Mc,{kind:"mutation",auth:"protected"}),listExports:b(d({deviceId:l().optional()}),w(Mc),{kind:"query",auth:"protected"}),getExport:b(d({exportId:o()}),Mc,{kind:"query",auth:"protected"}),cancelExport:b(d({exportId:o()}),Mc,{kind:"mutation",auth:"protected"}),deleteExport:b(d({exportId:o()}),Mc,{kind:"mutation",auth:"protected"}),getDownloadUrl:b(d({exportId:o()}),OX,{kind:"query",auth:"protected"}),readExportBytes:b(d({exportId:o()}),jX,{kind:"query",auth:"protected"})}},hy=d({active:A(),reason:o(),lastChangedAt:l()}),DX=hy.extend({lastFetchedAt:l()}),zX={name:"recording-signal",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getStatus:b(d({deviceId:l()}),hy)},status:{schema:hy,kind:"push",empty:{active:!1,reason:"unknown",lastChangedAt:0}},runtimeState:DX,durability:"session"},Hc=o(),CT=N(["skip","judge-anyway"]),LX=N(["matched","diverged","unknown"]),qX=N(["no-reference-for-condition","view-shifted","no-vision-profile","encoder-model-changed","no-snapshot"]),BX=d({embedding:w(l()),modelId:o(),condition:Hc,capturedAt:l(),thumbnailMediaId:l().int().optional(),anchorEmbedding:w(l()).optional()}),FX=d({id:o(),label:o(),references:w(BX),textPrompts:w(o()).optional(),referenceCount:l(),currentlyMatched:A()}),gy=wt("mode",[d({mode:Q("similarity"),threshold:l().min(0).max(1),hysteresisCount:l().int().positive()}),d({mode:Q("llm"),prompt:o(),profileId:o().optional(),hysteresisCount:l().int().positive()})]),UX=.85,HX="skip",$X=8e3,AT=d({enabled:A().default(!1),prompt:o().min(1).max(1e3),profileId:o().optional(),timeoutMs:l().int().min(1e3).max(2e4).default($X),maxImagePx:l().int().min(64).max(2048).default(448),onTimeout:N(["flip","hold"]).default("hold")}),ET=d({id:o(),label:o(),roi:pl,enabled:A(),triggerMode:N(["periodic","on-motion","both"]),checkIntervalSec:l().optional(),check:gy,states:w(FX),currentStateId:o().nullable(),lastCheckedAt:l().nullable(),lastConfidence:l().nullable(),currentCondition:Hc.nullable(),availability:N(["ok","unavailable"]),unavailableReason:o().nullable(),baselineStateId:o().nullable(),emit:N(["latched","live"]).default("latched"),verdict:LX,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:AT.optional(),anchorThreshold:l().min(0).max(1).default(UX),autoRestore:A().default(!1),onUncoveredCondition:CT.default(HX),suspendedCondition:Hc.nullable().default(null),unavailable:qX.nullable(),coveredConditions:w(Hc)}),Ip=d({monitors:w(ET),lastFetchedAt:l()}),QX=d({deviceId:l(),status:Ip.nullable()}),VX={name:"scene-monitor",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[H.Camera],methods:{listScenes:b(d({deviceId:l()}),Ip),listScenesBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w(QX).readonly()),createScene:b(d({deviceId:l(),label:o(),roi:pl,check:gy,triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional()}),ET,{kind:"mutation",auth:"admin"}),updateScene:b(d({deviceId:l(),monitorId:o(),patch:d({label:o().optional(),roi:pl.optional(),enabled:A().optional(),triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional(),check:gy.optional(),emit:N(["latched","live"]).optional(),quietSeconds:l().int().min(0).max(3600).optional(),minObservationSpacingSec:l().int().min(0).max(3600).optional(),anchorThreshold:l().min(0).max(1).optional(),autoRestore:A().optional(),onUncoveredCondition:CT.optional(),confirm:AT.nullable().optional()})}),O(),{kind:"mutation",auth:"admin"}),deleteScene:b(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),captureReference:b(d({deviceId:l(),monitorId:o(),stateId:o().optional(),label:o().optional(),condition:Hc.optional()}),d({stateId:o(),referenceCount:l()}),{kind:"mutation",auth:"admin"}),deleteReference:b(d({deviceId:l(),monitorId:o(),stateId:o(),index:l()}),O(),{kind:"mutation",auth:"admin"}),recheckNow:b(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),resetScene:b(d({deviceId:l(),monitorId:o(),recapture:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:Ip,kind:"push"},runtimeState:Ip,durability:"session"},k2=d({isRunning:A(),lastRunAt:l(),lastRunSuccess:A().nullable(),lastError:o().nullable(),lastChangedAt:l()}),GX={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Script],methods:{run:b(d({deviceId:l().int().nonnegative(),variables:Y(o(),J()).optional()}),O(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:k2,kind:"push"},runtimeState:k2,durability:"session"},w2=d({detected:A(),lastChangedAt:l()}),ZX={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:w2,kind:"push"},runtimeState:w2,durability:"restored",volatileStateFields:["lastChangedAt"]},RT=d({camStreamId:o().min(1),kind:_b,url:o().optional(),codec:o().optional(),resolution:kl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ht.optional(),metadata:Y(o(),J()).optional()}),KX=d({descriptors:w(RT),lastFetchedAt:l()}),WX={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],methods:{getCatalog:b(d({deviceId:l().int().nonnegative()}),w(RT).readonly())},runtimeState:KX,durability:"restored",volatileStateFields:["lastFetchedAt"]},YX=N(["main","sub","ext"]),Dg=d({width:l(),height:l(),codec:N(["h264","h265"]),framerate:l(),bitrate:l(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional(),audio:A().optional()}),M2=d({main:Dg.optional(),sub:Dg.optional(),ext:Dg.optional(),lastFetchedAt:l()}),zg=d({resolutions:w(d({width:l(),height:l()})),codecs:w(N(["h264","h265"])),framerates:w(l()),bitrates:w(l()),bitrateRange:gu([l(),l()]).optional(),supportsBitrateMode:A(),supportsEncoderProfile:A(),supportsGop:A(),gop:d({min:l(),max:l(),step:l()}).optional()}),XX=d({main:zg.optional(),sub:zg.optional(),ext:zg.optional()}),JX=d({width:l().optional(),height:l().optional(),codec:N(["h264","h265"]).optional(),framerate:l().optional(),bitrate:l().optional(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional()}),eJ={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:b(d({deviceId:l()}),XX),setProfile:b(d({deviceId:l(),profile:YX,patch:JX}),O(),{kind:"mutation",auth:"admin"}),getConfigSchema:b(d({deviceId:l()}),J().nullable())},status:{schema:M2,kind:"poll"},runtimeState:M2,durability:"restored",volatileStateFields:["lastFetchedAt"]},C2=d({on:A(),lastChangedAt:l()}),tJ={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Switch,H.Siren,H.Light],methods:{setState:b(d({deviceId:l(),on:A()}),O(),{kind:"mutation",auth:"protected"})},events:{onStateChanged:{data:d({deviceId:l(),on:A(),lastChangedAt:l()})}},status:{schema:C2,kind:"command-driven"},runtimeState:C2,durability:"restored",volatileStateFields:["lastChangedAt"],settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},A2=d({streaming:A(),notifications:A(),objectDetection:A(),remoteAccess:A(),agentCluster:A(),smartHome:A(),recordings:A(),backup:A(),repl:A()}),nJ=d({status:Q("ok"),uptime:l()}),aJ=d({name:o(),address:o(),family:o(),internal:A()}),iJ=N(["operator-set","derived-from-ip"]),rJ=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),source:iJ,updatedAt:l(),label:o().optional()}),Lg=d({location:rJ.nullable(),derivationAttemptedAt:l().nullable(),derivationError:o().nullable()}),oJ=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180)}).nullable(),sJ=N(["http","ws","mesh","unknown"]),IT=d({http:l(),ws:l(),mesh:l(),unknown:l()}),lJ=d({plane:sJ,procedure:o(),userAgent:o(),ip:o(),principal:o(),calls:l(),subscriptions:l(),perMin:l()}),cJ=d({procedure:o(),calls:l(),planes:IT,subscriptions:l(),perMin:l()}),uJ=d({armed:A(),elapsedMs:l(),windowMs:l(),armedUntilMs:l(),httpRequests:l(),batchedRequests:l(),procedureCalls:l(),planes:IT,planesExplainTotal:A(),wsConnections:l(),wsMessages:l(),subscriptions:l(),subscriptionStops:l(),distinctGroups:l(),unattributedCalls:l(),procedures:w(cJ).readonly(),groups:w(lJ).readonly()}),dJ=uJ.extend({persisted:A()}),h0=N(["debug","info","warn","error"]),TT=N(["request-census"]),pJ=N(["cluster","node","component"]),mJ=N(["default","cluster","node","component"]),fJ=d({scope:pJ,nodeId:o().nullable(),component:o().nullable(),level:h0.nullable()}),hJ=d({level:h0,levelSource:mJ}),gJ=d({layers:w(fJ).readonly()}),vJ=d({id:TT,armed:A(),armedUntilMs:l(),remainingMs:l(),persisted:A()}),yJ=d({id:TT,armMs:l().int().min(0),reportEveryMs:l().int().positive().optional()}),bJ=d({channel:o(),armed:A(),armedUntilMs:l(),remainingMs:l(),deviceIds:w(l().int()).readonly().nullable()}),SJ=d({channel:o().min(1),armMs:l().int().min(0),deviceIds:w(l().int()).readonly().nullable().optional()}),xJ=d({level:h0.nullable().optional(),diagnostics:w(yJ).readonly().optional(),channels:w(SJ).readonly().optional(),opsLogRetentionDays:l().int().min(0).max(3650).optional()}),kJ=vI.extend({addonId:o()}),wJ=uI.extend({addonId:o()}),MJ=d({scopeNodeId:o().optional(),scopeComponent:o().optional()}),CJ=d({scopeNodeId:o().optional(),scopeComponent:o().optional(),patch:xJ}),E2=d({scopeNodeId:o().nullable(),scopeComponent:o().nullable(),effective:hJ,explicit:gJ,activeWindows:w(vJ).readonly(),channels:w(DR).readonly(),activeChannels:w(bJ).readonly(),opsLogRetentionDays:l().int().min(0),persisted:A()}),AJ={name:"system",scope:"system",mode:"singleton",methods:{info:b(O(),A2),health:b(O(),nJ),featureFlags:b(O(),A2),networkAddresses:b(O(),w(aJ).readonly()),getRetentionConfig:b(O(),J().nullable(),{auth:"admin"}),setRetentionConfig:b(Y(o(),J()),uR(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:b(O(),O(),{kind:"mutation",auth:"admin"}),getSiteLocation:b(O(),Lg),setSiteLocation:b(oJ,Lg,{kind:"mutation",auth:"admin"}),detectSiteLocation:b(O(),Lg,{kind:"mutation",auth:"admin"}),getRequestCensus:b(O(),dJ,{auth:"admin"}),getLoadContributions:b(O(),w(kJ).readonly(),{auth:"admin"}),getFailureContributions:b(O(),w(wJ).readonly(),{auth:"admin"}),getLoggingSettings:b(MJ,E2,{auth:"admin"}),setLoggingSettings:b(CJ,E2,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},R2=d({tampered:A(),lastChangedAt:l()}),EJ={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:R2,kind:"push"},runtimeState:R2,durability:"restored",volatileStateFields:["lastChangedAt"]},I2=d({celsius:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),RJ={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor,H.Thermostat],methods:{},status:{schema:I2,kind:"push"},runtimeState:I2,durability:"restored",volatileStateFields:["lastFetchedAt"]},IJ=d({title:o(),message:o(),severity:N(["info","warning","critical"]),duration:l().optional(),action:d({label:o(),url:o()}).optional()}),TJ={name:"toast",scope:"system",mode:"singleton",methods:{onToast:b(O(),IJ,{kind:"subscription"})},mount:{kind:"server-provided"}},T2=d({currentVersion:o().nullable(),availableVersion:o().nullable(),updatable:A(),state:o().nullable(),inProgress:A()}),_J={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Update],methods:{installUpdate:b(O(),O(),{kind:"mutation",auth:"admin"})},status:{schema:T2,kind:"poll"},runtimeState:T2,durability:"session"},qg=d({id:o(),username:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),Q("*")]),allowedDevices:Y(o(),tt([w(o()),Q("*")])),scopes:w(Ia).default([]),totpEnabled:A().default(!1),createdAt:l(),updatedAt:l()}),NJ=d({username:o(),password:o().min(6),isAdmin:A().default(!1),allowedProviders:tt([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),tt([w(o()),Q("*")])).optional(),scopes:w(Ia).optional()}),OJ=d({id:o(),isAdmin:A().optional(),allowedProviders:tt([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),tt([w(o()),Q("*")])).optional(),scopes:w(Ia).optional()}),vy=d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),tt([w(o()),Q("*")])).optional(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()}),jJ=d({label:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),Q("*")]).optional(),allowedDevices:Y(o(),tt([w(o()),Q("*")])).optional()}),PJ=d({token:o(),record:vy}),yy=d({id:o(),userId:o(),name:o(),tokenPrefix:o(),scopes:w(Ia),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()}),DJ=d({userId:o(),name:o(),scopes:w(Ia),expiresAt:l().optional()}),zJ=d({token:o(),record:yy}),LJ=d({id:o(),userId:o(),username:o(),integrationId:o(),scopes:w(Ia),createdAt:l(),lastUsedAt:l(),revokedAt:l().nullable()}),qJ=d({secret:o(),otpauthUrl:o()}),BJ=d({enabled:A(),confirmedAt:l().nullable()}),FJ={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:b(O(),w(qg),{auth:"admin"}),createUser:b(NJ,qg,{kind:"mutation",auth:"admin",access:"create"}),updateUser:b(OJ,d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:b(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:b(d({id:o(),newPassword:o().min(6)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:b(d({userId:o(),scopes:w(Ia)}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:b(d({username:o(),password:o()}),qg.extend({passwordHash:o()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:b(O(),w(vy),{auth:"admin"}),createApiKey:b(jJ,PJ,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:b(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:b(d({token:o()}),vy.nullable(),{kind:"mutation",access:"view"}),createScopedToken:b(DJ,zJ,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:b(d({id:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:b(d({token:o()}),yy.nullable(),{access:"view"}),listScopedTokens:b(d({userId:o()}),w(yy),{auth:"admin"}),setupTotp:b(d({userId:o()}),qJ,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:b(d({userId:o(),code:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:b(d({userId:o()}),d({success:Q(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:b(d({userId:o()}),BJ,{auth:"admin"}),verifyTotp:b(d({userId:o(),code:o()}),d({valid:A()}),{kind:"mutation",access:"view"}),oauthIssueCode:b(d({integrationId:o(),userId:o(),username:o(),scopes:w(Ia),redirectUri:o(),hubUrl:o(),codeChallenge:o().optional(),refreshTtlSec:tt([l().int().positive(),Q("never")]).optional()}),d({code:o()}),{kind:"mutation",access:"create"}),oauthExchangeCode:b(d({code:o(),redirectUri:o(),codeVerifier:o().optional()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:b(d({refreshToken:o()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:b(d({token:o()}),d({userId:o(),username:o(),scopes:w(Ia)}).nullable(),{access:"view"}),listOauthSessions:b(O(),w(LJ),{auth:"admin"}),revokeOauthSession:b(d({id:o()}),d({success:A()}),{kind:"mutation",auth:"admin",access:"delete"})}},UJ=N(["idle","cleaning","paused","returning","docked","drying","error"]),tp=d({level:l().min(0).max(100).nullable(),status:N(["ok","low","full"]).nullable()}),_2=d({state:UJ,batteryLevel:l().min(0).max(100).nullable(),fanSpeed:o().nullable(),availableFanSpeeds:w(o()),cleanWater:tp.nullable(),dirtyWater:tp.nullable(),detergent:tp.nullable(),dustBin:tp.nullable(),progressPercent:l().min(0).max(100).nullable(),errorCode:l().nullable(),errorLabel:o().nullable(),lastChangedAt:l()}),HJ={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Vacuum],methods:{start:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),returnToBase:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),locate:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setFanSpeed:b(d({deviceId:l().int().nonnegative(),speed:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:_2,kind:"push"},runtimeState:_2,durability:"session"},$J=N(["open","opening","closing","closed","stopped"]),N2=d({state:$J,position:l().min(0).max(100).nullable(),lastChangedAt:l()}),QJ={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Valve],methods:{open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:N2,kind:"push"},runtimeState:N2,durability:"session"},O2=d({detected:A(),lastChangedAt:l()}),VJ={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Sensor],methods:{},status:{schema:O2,kind:"push"},runtimeState:O2,durability:"restored",volatileStateFields:["lastChangedAt"]},j2=d({currentTemp:l().nullable(),targetTemp:l().nullable(),operationMode:o().nullable(),availableModes:w(o()),away:A().nullable(),minTemp:l().nullable(),maxTemp:l().nullable(),lastChangedAt:l()}),GJ={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.WaterHeater],methods:{setTargetTemp:b(d({deviceId:l().int().nonnegative(),temp:l().finite()}),O(),{kind:"mutation",auth:"protected"}),setOperationMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setAway:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:j2,kind:"push"},runtimeState:j2,durability:"session"},P2=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()}),ZJ={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[H.Weather],methods:{},status:{schema:P2,kind:"push"},runtimeState:P2,durability:"session"},by=d({totalObjects:l().int().nonnegative(),byClass:Y(o(),l().int().nonnegative()),standingObjects:l().int().nonnegative().optional(),transientObjects:l().int().nonnegative().optional()}),KJ=by.extend({zoneId:o(),zoneName:o(),trackIds:w(o()).readonly()}),WJ=d({id:o(),className:o(),bbox:d({x:l(),y:l(),w:l(),h:l()}),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),firstSeenAt:l().int(),becameStationaryAt:l().int(),lastConfirmedAt:l().int(),label:o().optional(),keyFrameMediaId:l().int().optional()}),Sy=d({ts:l().int(),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),zones:w(KJ).readonly(),frame:by,unzoned:by,stationaryObjects:w(WJ).readonly().optional()}),YJ=d({deviceId:l(),read:N(["read","unreadable"]),snapshot:Sy.nullable()}),XJ=N(["minute","5min","hour"]),Bg=d({from:l().int(),to:l().int(),resolution:XJ}),Fg=d({ts:l().int(),count:l().int().nonnegative()}),JJ={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),Sy.nullable()),getCurrentSnapshotBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w(YJ).readonly()),getZoneHistory:b(d({deviceId:l(),zoneId:o(),className:o().optional()}).extend(Bg.shape),w(Fg).readonly()),getCameraHistory:b(d({deviceId:l(),className:o().optional()}).extend(Bg.shape),w(Fg).readonly()),getUnzonedHistory:b(d({deviceId:l(),className:o().optional()}).extend(Bg.shape),w(Fg).readonly())},runtimeState:Sy,durability:"session"},D2=N(["motion","detection","package"]),eee={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[H.Camera],methods:{listRules:b(d({deviceId:l(),stage:D2}),w(Io).readonly()),setRules:b(d({deviceId:l(),stage:D2,rules:w(Io).readonly()}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({motion:w(Io).readonly(),detection:w(Io).readonly(),package:w(Io).readonly()}),durability:"restored"};$e.Siren,$e.Floodlight,$e.Spotlight,$e.PirSensor,$e.Chime,$e.Autotrack,$e.Nightvision,$e.PrivacyMask;var tee={[H.Cover]:"cover",[H.Valve]:"valve",[H.Humidifier]:"humidifier",[H.WaterHeater]:"water-heater",[H.Camera]:"dummy",[H.Hub]:"dummy",[H.Switch]:"switch",[H.Siren]:"switch",[H.Light]:"light",[H.Fan]:"fan",[H.Sensor]:"sensor",[H.Thermostat]:"thermostat",[H.Climate]:"climate",[H.Button]:"button",[H.EventEmitter]:"dummy",[H.Update]:"update",[H.Generic]:"dummy",[H.Notifier]:"dummy",[H.Script]:"script",[H.Automation]:"automation",[H.Lock]:"lock",[H.MediaPlayer]:"media-player",[H.AlarmPanel]:"alarm",[H.Control]:"control",[H.Presence]:"sensor",[H.Weather]:"weather",[H.Vacuum]:"vacuum",[H.LawnMower]:"lawn-mower",[H.Container]:"dummy",[H.Image]:"image",[H.PetFeeder]:"pet-feeder"};new Set(Object.values(H));ma.BatteryOperated;var nee="device.state-changed",aee="capability.binding-changed",iee="device.registered",ree="device.unregistered",oee="device.updated",see=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=gq(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const t=(p,f)=>Number.isFinite(e)?new Promise((m,h)=>{const c=setTimeout(()=>h(new Error(`SystemMirror.init: '${f}' timed out after ${e}ms`)),e);p.then(x=>{clearTimeout(c),m(x)},x=>{clearTimeout(c),h(x)})}):p,[n,a,s]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),"deviceManager.getAllBindings"),t(this.api.deviceState.getAllSnapshots.query({}),"deviceState.getAllSnapshots"),t(this.api.deviceManager.listAll.query({}),"deviceManager.listAll")]);for(const p of n)this.bindings.set(p.deviceId,p);for(const[p,f]of Object.entries(a)){const m=Number(p);if(!Number.isFinite(m))continue;const h=new Map;for(const[c,x]of Object.entries(f))h.set(c,x);this.stateMirror.set(m,h)}for(const p of s)this.devices.set(p.id,p);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(const e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){const t=this.bindings.get(e);return t?xR(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&&!np(n,e.id)||e.stableId!==void 0&&(!s||!np(s.stableId,e.stableId))||e.addonId!==void 0&&(!s||!np(s.addonId,e.addonId))||e.type!==void 0&&(!s||!np(s.type,e.type)))continue;if(e.caps!==void 0){const f=Ug(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=Ug(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||!lee(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||!Ug(e.feature).every(f=>s.features.includes(f)))||e.isCamera!==void 0&&(!s||s.isCamera!==e.isCamera))continue;const p=this.getDeviceById(n);if(p){if(e.where&&s){if(!e.where(s,p))continue}else if(e.where&&!s)continue;t.push(p)}}return t}whereState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);if(!p||!t(p,a))continue;const f=this.getDeviceById(a);f&&n.push(f)}return n}mapState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);p&&n.push(t(p,a))}return n}findState(e,t){for(const[n,a]of this.stateMirror){const s=a.get(e);if(s&&t(s,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(const n of this.bindings.values())n.entries.some(a=>a.capName===e)&&t++;return t}countByState(e,t){let n=0;for(const[a,s]of this.stateMirror){const p=s.get(e);p&&t(p,a)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,a=3e4){return new Promise((s,p)=>{const m=(()=>{const x=this.stateMirror.get(e)?.get(t);return x&&n(x)?x:null})();if(m){s(m);return}let h=null;const c=this.listenDevice(e,(x,M,C)=>{M===t&&C&&n(C)&&(h&&clearTimeout(h),c(),s(C))});Number.isFinite(a)&&(h=setTimeout(()=>{c(),p(new Error(`waitForState timed out after ${a}ms (deviceId=${e}, capName=${t})`))},a))})}waitForDevice(e,t=3e4){return new Promise((n,a)=>{const s=this.getDeviceById(e);if(s){n(s);return}let p=null;const f=this.onDeviceAdded(m=>{if(m!==e)return;const h=this.getDeviceById(m);h&&(p&&clearTimeout(p),f(),n(h))});Number.isFinite(t)&&(p=setTimeout(()=>{f(),a(new Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(const n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,a={}){const s=this.filterByCap(e),p=Math.max(1,a.parallelism??s.length),f=[];for(let m=0;m<s.length;m+=p){const h=s.slice(m,m+p),c=await Promise.allSettled(h.map(async x=>{const M=x[e];if(!M||typeof M[t]!="function")throw new Error(`device '${x.deviceId}' does not expose '${e}.${t}'`);return await M[t](n)}));for(let x=0;x<c.length;x++){const M=h[x],C=c[x];C.status==="fulfilled"?f.push({deviceId:M.deviceId,ok:!0,result:C.value}):f.push({deviceId:M.deviceId,ok:!1,error:C.reason})}}return f}summary(){const e={},t={},n={};let a=0,s=0;for(const p of this.bindings.values())for(const f of p.entries)e[f.capName]=(e[f.capName]??0)+1;for(const p of this.devices.values())t[p.addonId]=(t[p.addonId]??0)+1,n[p.type]=(n[p.type]??0)+1,p.online?a++:s++;return{totalDevices:this.bindings.size,online:a,offline:s,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){const t=a=>{const s=this.devices.get(a)??null,p=this.bindings.get(a)??null,f={},m=this.stateMirror.get(a);if(m)for(const[h,c]of m)f[h]={...c};return{deviceId:a,info:s,binding:p?{...p,entries:p.entries.map(h=>({...h}))}:null,state:f}};if(e!==void 0)return t(e);const n=[];for(const a of this.bindings.keys())n.push(t(a));return n}getRawMirror(){return this.stateMirror}getSystemState(){const e=new Map;for(const[t,n]of this.stateMirror){const a=new Map;for(const[s,p]of n)a.set(s,{...p});e.set(t,a)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;const e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:nee},{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:aee},{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:iee},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"added")}})),this.bridges.push(e.subscribe({category:ree},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.applyDeviceRemoval(n.deviceId)}})),this.bridges.push(e.subscribe({category:oee},{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 np(e,t){return Array.isArray(t)?t.includes(e):e===t}function Ug(e){return Array.isArray(e)?e:[e]}function lee(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 cee=[cZ,iB,oB,uB,mB,vB,hB,PZ,sq,DZ,fH,xB,zZ,kB,TB,DB,FZ,zB,UZ,GB,HZ,$Z,QZ,u9,VZ,KZ,MW,d9,D9,WZ,YZ,JZ,aK,iK,rK,oK,cK,B9,dK,U9,Q9,fK,G9,Z9,eF,W9,lF,RF,fq,fF,IF,hK,vK,_F,bK,SK,kK,_K,OF,NK,OK,DF,jK,PK,DK,zK,LK,FK,ZK,YK,eW,eU,QF,aU,lW,uW,rU,oU,dU,mW,vW,AU,RU,_U,bW,OU,xW,EW,HU,NW,FW,VU,$W,GW,sY,aH,XH,mY,fY,i$,vY,kY,MY,QQ,_$,zV,cV,RY,FY,UY,$Y,QY,KY,nX,oX,sX,EX,PX,zX,VX,GX,XV,H9,ZX,tG,iG,rG,sG,uG,dG,mG,CG,N9,WX,eJ,m9,tJ,AJ,EJ,RJ,_G,TJ,OG,_J,FJ,PG,HJ,QJ,JG,VJ,nZ,uq,GJ,ZJ,sZ,JJ,eee,P$];function z2(e){const t=e;function n(a,s,p,f,m){const h=t[a]?.[s];if(!h)throw new Error(`SystemProxy: api has no '${a}.${s}'`);const c=h;return p==="mutation"?c.mutate(f):p==="subscription"?c.subscribe(f,m):c.query(f)}return{addonPages:{listPages:a=>n("addonPages","listPages","query",a)},addons:{list:a=>n("addons","list","query",a),getLogs:a=>n("addons","getLogs","query",a),listPackages:a=>n("addons","listPackages","query",a),installPackage:a=>n("addons","installPackage","mutation",a),installFromWorkspace:a=>n("addons","installFromWorkspace","mutation",a),isWorkspaceAvailable:a=>n("addons","isWorkspaceAvailable","query",a),listWorkspacePackages:a=>n("addons","listWorkspacePackages","query",a),uninstallPackage:a=>n("addons","uninstallPackage","mutation",a),reloadPackages:a=>n("addons","reloadPackages","mutation",a),searchAvailable:a=>n("addons","searchAvailable","query",a),listUpdates:a=>n("addons","listUpdates","query",a),updatePackage:a=>n("addons","updatePackage","mutation",a),rollbackPackage:a=>n("addons","rollbackPackage","mutation",a),forceRefresh:a=>n("addons","forceRefresh","mutation",a),restartServer:a=>n("addons","restartServer","mutation",a),getLastRestart:a=>n("addons","getLastRestart","query",a),listFrameworkPackages:a=>n("addons","listFrameworkPackages","query",a),listCapabilityProviders:a=>n("addons","listCapabilityProviders","query",a),setCapabilityProviderEnabled:a=>n("addons","setCapabilityProviderEnabled","mutation",a),getVersions:a=>n("addons","getVersions","query",a),restartAddon:a=>n("addons","restartAddon","mutation",a),retryLoad:a=>n("addons","retryLoad","mutation",a),getAutoUpdateSettings:a=>n("addons","getAutoUpdateSettings","query",a),setAutoUpdateSettings:a=>n("addons","setAutoUpdateSettings","mutation",a),getAddonAutoUpdate:a=>n("addons","getAddonAutoUpdate","query",a),setAddonAutoUpdate:a=>n("addons","setAddonAutoUpdate","mutation",a),applyAutoUpdateToAll:a=>n("addons","applyAutoUpdateToAll","mutation",a),custom:a=>n("addons","custom","mutation",a),startJob:a=>n("addons","startJob","mutation",a),getJob:a=>n("addons","getJob","query",a),listJobs:a=>n("addons","listJobs","query",a),cancelJob:a=>n("addons","cancelJob","mutation",a),onAddonLogs:(a,s)=>n("addons","onAddonLogs","subscription",a,s)},addonSettings:{getGlobalSettings:a=>n("addonSettings","getGlobalSettings","query",a),updateGlobalSettings:a=>n("addonSettings","updateGlobalSettings","mutation",a),getIntegrationSettings:a=>n("addonSettings","getIntegrationSettings","query",a)},addonWidgets:{listWidgets:a=>n("addonWidgets","listWidgets","query",a)},alerts:{emit:a=>n("alerts","emit","mutation",a),update:a=>n("alerts","update","mutation",a),list:a=>n("alerts","list","query",a),getUnreadCount:a=>n("alerts","getUnreadCount","query",a),markRead:a=>n("alerts","markRead","mutation",a),markAllRead:a=>n("alerts","markAllRead","mutation",a),dismiss:a=>n("alerts","dismiss","mutation",a)},audioAnalyzer:{analyseChunk:a=>n("audioAnalyzer","analyseChunk","mutation",a),classify:a=>n("audioAnalyzer","classify","query",a),attachDevice:a=>n("audioAnalyzer","attachDevice","mutation",a),isReady:a=>n("audioAnalyzer","isReady","query",a),dispose:a=>n("audioAnalyzer","dispose","mutation",a),reprobeAudioEngine:a=>n("audioAnalyzer","reprobeAudioEngine","mutation",a)},audioCodec:{listSupportedCodecs:a=>n("audioCodec","listSupportedCodecs","query",a),canHandle:a=>n("audioCodec","canHandle","query",a),createDecodeSession:a=>n("audioCodec","createDecodeSession","mutation",a),createEncodeSession:a=>n("audioCodec","createEncodeSession","mutation",a),closeSession:a=>n("audioCodec","closeSession","mutation",a),pushEncodedFrame:a=>n("audioCodec","pushEncodedFrame","mutation",a),pullPcm:a=>n("audioCodec","pullPcm","query",a),pushPcm:a=>n("audioCodec","pushPcm","mutation",a),pullEncoded:a=>n("audioCodec","pullEncoded","query",a),flushEncode:a=>n("audioCodec","flushEncode","mutation",a),listActiveSessions:a=>n("audioCodec","listActiveSessions","query",a)},backup:{listDestinations:a=>n("backup","listDestinations","query",a),trigger:a=>n("backup","trigger","mutation",a),listRuns:a=>n("backup","listRuns","query",a),cancel:a=>n("backup","cancel","mutation",a),list:a=>n("backup","list","query",a),listLocations:a=>n("backup","listLocations","query",a),getEntries:a=>n("backup","getEntries","query",a),restore:a=>n("backup","restore","mutation",a),delete:a=>n("backup","delete","mutation",a),listArchives:a=>n("backup","listArchives","query",a),upsertDestinationPolicy:a=>n("backup","upsertDestinationPolicy","mutation",a),previewSchedule:a=>n("backup","previewSchedule","query",a),listSchedules:a=>n("backup","listSchedules","query",a),upsertSchedule:a=>n("backup","upsertSchedule","mutation",a),deleteSchedule:a=>n("backup","deleteSchedule","mutation",a)},broker:{list:a=>n("broker","list","query",a),get:a=>n("broker","get","query",a),listProviders:a=>n("broker","listProviders","query",a),add:a=>n("broker","add","mutation",a),remove:a=>n("broker","remove","mutation",a),testConnection:a=>n("broker","testConnection","mutation",a),getSettings:a=>n("broker","getSettings","query",a),setSettings:a=>n("broker","setSettings","mutation",a),getBrokerConfig:a=>n("broker","getBrokerConfig","query",a),getSettingsSchema:a=>n("broker","getSettingsSchema","query",a),testSettings:a=>n("broker","testSettings","mutation",a),publish:a=>n("broker","publish","mutation",a),subscribe:a=>n("broker","subscribe","mutation",a),unsubscribe:a=>n("broker","unsubscribe","mutation",a),getState:a=>n("broker","getState","query",a),getStatus:a=>n("broker","getStatus","query",a)},connectionTest:{testSettings:a=>n("connectionTest","testSettings","mutation",a),describeTest:a=>n("connectionTest","describeTest","query",a)},coreBlocks:{list:a=>n("coreBlocks","list","query",a),get:a=>n("coreBlocks","get","query",a),create:a=>n("coreBlocks","create","mutation",a),update:a=>n("coreBlocks","update","mutation",a),delete:a=>n("coreBlocks","delete","mutation",a),setEnabled:a=>n("coreBlocks","setEnabled","mutation",a),restart:a=>n("coreBlocks","restart","mutation",a),compile:a=>n("coreBlocks","compile","mutation",a),getTypeDefs:a=>n("coreBlocks","getTypeDefs","query",a)},decoder:{supportsCodec:a=>n("decoder","supportsCodec","query",a),getInfo:a=>n("decoder","getInfo","query",a),createSession:a=>n("decoder","createSession","query",a),destroySession:a=>n("decoder","destroySession","query",a),pushPacket:a=>n("decoder","pushPacket","query",a),openStream:a=>n("decoder","openStream","query",a),pullFrames:a=>n("decoder","pullFrames","query",a),pullHandles:a=>n("decoder","pullHandles","query",a),getFrame:a=>n("decoder","getFrame","query",a),getShmStats:a=>n("decoder","getShmStats","query",a),updateConfig:a=>n("decoder","updateConfig","query",a),getStats:a=>n("decoder","getStats","query",a),listActiveSessions:a=>n("decoder","listActiveSessions","query",a),reprobeHwaccel:a=>n("decoder","reprobeHwaccel","mutation",a)},deviceAdoption:{listCandidateFilters:a=>n("deviceAdoption","listCandidateFilters","query",a),listCandidates:a=>n("deviceAdoption","listCandidates","query",a),getCandidate:a=>n("deviceAdoption","getCandidate","query",a),refresh:a=>n("deviceAdoption","refresh","mutation",a),adopt:a=>n("deviceAdoption","adopt","mutation",a),release:a=>n("deviceAdoption","release","mutation",a),resync:a=>n("deviceAdoption","resync","mutation",a)},deviceExport:{getStatus:a=>n("deviceExport","getStatus","query",a),listSupportedDeviceKinds:a=>n("deviceExport","listSupportedDeviceKinds","query",a),listExposedDevices:a=>n("deviceExport","listExposedDevices","query",a),exposeDevice:a=>n("deviceExport","exposeDevice","mutation",a),unexposeDevice:a=>n("deviceExport","unexposeDevice","mutation",a)},deviceManager:{allocateDeviceId:a=>n("deviceManager","allocateDeviceId","mutation",a),migrateDevice:a=>n("deviceManager","migrateDevice","mutation",a),registerDevice:a=>n("deviceManager","registerDevice","mutation",a),removeDevice:a=>n("deviceManager","removeDevice","mutation",a),persistConfig:a=>n("deviceManager","persistConfig","mutation",a),getRoleDisplayDefaults:a=>n("deviceManager","getRoleDisplayDefaults","query",a),setRoleDisplayDefaults:a=>n("deviceManager","setRoleDisplayDefaults","mutation",a),listLocations:a=>n("deviceManager","listLocations","query",a),addLocation:a=>n("deviceManager","addLocation","mutation",a),removeLocation:a=>n("deviceManager","removeLocation","mutation",a),renameLocation:a=>n("deviceManager","renameLocation","mutation",a),listLocationIcons:a=>n("deviceManager","listLocationIcons","query",a),setLocationIcon:a=>n("deviceManager","setLocationIcon","mutation",a),listLocationDescriptions:a=>n("deviceManager","listLocationDescriptions","query",a),setLocationDescription:a=>n("deviceManager","setLocationDescription","mutation",a),listSiteZones:a=>n("deviceManager","listSiteZones","query",a),setSiteZone:a=>n("deviceManager","setSiteZone","mutation",a),removeSiteZone:a=>n("deviceManager","removeSiteZone","mutation",a),renameSiteZone:a=>n("deviceManager","renameSiteZone","mutation",a),setLocationZone:a=>n("deviceManager","setLocationZone","mutation",a),listPersistedByAddon:a=>n("deviceManager","listPersistedByAddon","query",a),listAll:a=>n("deviceManager","listAll","query",a),getChildren:a=>n("deviceManager","getChildren","query",a),getChildrenBatch:a=>n("deviceManager","getChildrenBatch","query",a),getLinkedDevicesBatch:a=>n("deviceManager","getLinkedDevicesBatch","query",a),removeByIntegration:a=>n("deviceManager","removeByIntegration","mutation",a),getBindingsBatch:a=>n("deviceManager","getBindingsBatch","query",a),getAllBindings:a=>n("deviceManager","getAllBindings","query",a),listWrappersForCap:a=>n("deviceManager","listWrappersForCap","query",a),listBindableCapsForDeviceType:a=>n("deviceManager","listBindableCapsForDeviceType","query",a),discoverDevices:a=>n("deviceManager","discoverDevices","mutation",a),adoptDevice:a=>n("deviceManager","adoptDevice","mutation",a),getCreationSchema:a=>n("deviceManager","getCreationSchema","query",a),createDevice:a=>n("deviceManager","createDevice","mutation",a),testCreationField:a=>n("deviceManager","testCreationField","mutation",a),adoptionListCandidateFilters:a=>n("deviceManager","adoptionListCandidateFilters","query",a),adoptionListCandidates:a=>n("deviceManager","adoptionListCandidates","query",a),adoptionRefresh:a=>n("deviceManager","adoptionRefresh","mutation",a),adoptionAdopt:a=>n("deviceManager","adoptionAdopt","mutation",a),adoptionRelease:a=>n("deviceManager","adoptionRelease","mutation",a),adoptionStartJob:a=>n("deviceManager","adoptionStartJob","mutation",a),adoptionListJobs:a=>n("deviceManager","adoptionListJobs","query",a),adoptionCancelJob:a=>n("deviceManager","adoptionCancelJob","mutation",a),adoptionResync:a=>n("deviceManager","adoptionResync","mutation",a),discoveryProviders:a=>n("deviceManager","discoveryProviders","query",a),discoverAllProviders:a=>n("deviceManager","discoverAllProviders","mutation",a),discoverProvider:a=>n("deviceManager","discoverProvider","mutation",a),providerCreationType:a=>n("deviceManager","providerCreationType","query",a),providerDiscoveryParamsSchema:a=>n("deviceManager","providerDiscoveryParamsSchema","query",a),getDeviceStatusAggregateBatch:a=>n("deviceManager","getDeviceStatusAggregateBatch","query",a)},deviceProvider:{start:a=>n("deviceProvider","start","mutation",a),stop:a=>n("deviceProvider","stop","mutation",a),getStatus:a=>n("deviceProvider","getStatus","query",a),getDevices:a=>n("deviceProvider","getDevices","query",a),supportsDiscovery:a=>n("deviceProvider","supportsDiscovery","query",a),discoverDevices:a=>n("deviceProvider","discoverDevices","mutation",a),getDiscoveryParamsSchema:a=>n("deviceProvider","getDiscoveryParamsSchema","query",a),getManualCreationType:a=>n("deviceProvider","getManualCreationType","query",a),adoptDiscoveredDevice:a=>n("deviceProvider","adoptDiscoveredDevice","mutation",a),supportsManualCreation:a=>n("deviceProvider","supportsManualCreation","query",a),getChildCreationSchema:a=>n("deviceProvider","getChildCreationSchema","query",a),createDevice:a=>n("deviceProvider","createDevice","mutation",a),testCreationField:a=>n("deviceProvider","testCreationField","mutation",a)},deviceState:{getAllSnapshots:a=>n("deviceState","getAllSnapshots","query",a)},faceGallery:{listIdentities:a=>n("faceGallery","listIdentities","query",a),createIdentity:a=>n("faceGallery","createIdentity","mutation",a),renameIdentity:a=>n("faceGallery","renameIdentity","mutation",a),deleteIdentity:a=>n("faceGallery","deleteIdentity","mutation",a),listIdentitySamples:a=>n("faceGallery","listIdentitySamples","query",a),auditIdentitySamples:a=>n("faceGallery","auditIdentitySamples","query",a),removeSample:a=>n("faceGallery","removeSample","mutation",a),getFaceMedia:a=>n("faceGallery","getFaceMedia","query",a),assignFace:a=>n("faceGallery","assignFace","mutation",a),unassignFace:a=>n("faceGallery","unassignFace","mutation",a),deleteFace:a=>n("faceGallery","deleteFace","mutation",a),assignFaces:a=>n("faceGallery","assignFaces","mutation",a),unassignFaces:a=>n("faceGallery","unassignFaces","mutation",a),suggestFaceClusters:a=>n("faceGallery","suggestFaceClusters","query",a)},integrations:{list:a=>n("integrations","list","query",a),get:a=>n("integrations","get","query",a),getByAddonId:a=>n("integrations","getByAddonId","query",a),create:a=>n("integrations","create","mutation",a),update:a=>n("integrations","update","mutation",a),delete:a=>n("integrations","delete","mutation",a),getSettings:a=>n("integrations","getSettings","query",a),setSettings:a=>n("integrations","setSettings","mutation",a),getAvailableTypes:a=>n("integrations","getAvailableTypes","query",a),testConnection:a=>n("integrations","testConnection","mutation",a)},llm:{generate:a=>n("llm","generate","mutation",a),generateVision:a=>n("llm","generateVision","mutation",a),cancel:a=>n("llm","cancel","mutation",a),listProfileKinds:a=>n("llm","listProfileKinds","query",a),listProfiles:a=>n("llm","listProfiles","query",a),upsertProfile:a=>n("llm","upsertProfile","mutation",a),deleteProfile:a=>n("llm","deleteProfile","mutation",a),testProfile:a=>n("llm","testProfile","mutation",a),listModels:a=>n("llm","listModels","query",a),getDefaults:a=>n("llm","getDefaults","query",a),setDefault:a=>n("llm","setDefault","mutation",a),getUsage:a=>n("llm","getUsage","query",a),listModelCatalog:a=>n("llm","listModelCatalog","query",a),listRuntimeNodes:a=>n("llm","listRuntimeNodes","query",a),listNodeModels:a=>n("llm","listNodeModels","query",a),resolveModelRef:a=>n("llm","resolveModelRef","mutation",a),installModel:a=>n("llm","installModel","mutation",a),deleteModel:a=>n("llm","deleteModel","mutation",a),getRuntimeStatus:a=>n("llm","getRuntimeStatus","query",a),startRuntime:a=>n("llm","startRuntime","mutation",a),stopRuntime:a=>n("llm","stopRuntime","mutation",a)},localNetwork:{list:a=>n("localNetwork","list","query",a),getPreferred:a=>n("localNetwork","getPreferred","query",a),getConnectionEndpoints:a=>n("localNetwork","getConnectionEndpoints","query",a),getNotificationEndpoint:a=>n("localNetwork","getNotificationEndpoint","query",a),setNotificationEndpoint:a=>n("localNetwork","setNotificationEndpoint","mutation",a),getViewerEndpoints:a=>n("localNetwork","getViewerEndpoints","query",a),setViewerEndpoints:a=>n("localNetwork","setViewerEndpoints","mutation",a),getAllowedAddresses:a=>n("localNetwork","getAllowedAddresses","query",a),setAllowedAddresses:a=>n("localNetwork","setAllowedAddresses","mutation",a),resetAllowlistToBestMatch:a=>n("localNetwork","resetAllowlistToBestMatch","mutation",a),getTlsStatus:a=>n("localNetwork","getTlsStatus","query",a),regenerateCertificate:a=>n("localNetwork","regenerateCertificate","mutation",a),uploadCertificate:a=>n("localNetwork","uploadCertificate","mutation",a),downloadCa:a=>n("localNetwork","downloadCa","query",a),revertToGeneratedCertificate:a=>n("localNetwork","revertToGeneratedCertificate","mutation",a)},meshNetwork:{getStatus:a=>n("meshNetwork","getStatus","query",a),join:a=>n("meshNetwork","join","mutation",a),startLogin:a=>n("meshNetwork","startLogin","mutation",a),leave:a=>n("meshNetwork","leave","mutation",a),logout:a=>n("meshNetwork","logout","mutation",a),listPeers:a=>n("meshNetwork","listPeers","query",a),testConnection:a=>n("meshNetwork","testConnection","mutation",a)},metricsProvider:{collectSnapshot:a=>n("metricsProvider","collectSnapshot","query",a),getCached:a=>n("metricsProvider","getCached","query",a),getCurrent:a=>n("metricsProvider","getCurrent","query",a),getDiskSpace:a=>n("metricsProvider","getDiskSpace","query",a),getGpuInfo:a=>n("metricsProvider","getGpuInfo","query",a),getCpuTemperature:a=>n("metricsProvider","getCpuTemperature","query",a),getProcessStats:a=>n("metricsProvider","getProcessStats","query",a),listAddonInstances:a=>n("metricsProvider","listAddonInstances","query",a),getAddonStats:a=>n("metricsProvider","getAddonStats","query",a),listNodeProcesses:a=>n("metricsProvider","listNodeProcesses","query",a),getLoadSeries:a=>n("metricsProvider","getLoadSeries","query",a)},mqttBroker:{listBrokers:a=>n("mqttBroker","listBrokers","query",a),getBrokerConfig:a=>n("mqttBroker","getBrokerConfig","query",a),addBroker:a=>n("mqttBroker","addBroker","mutation",a),removeBroker:a=>n("mqttBroker","removeBroker","mutation",a),testConnection:a=>n("mqttBroker","testConnection","mutation",a),startEmbeddedBroker:a=>n("mqttBroker","startEmbeddedBroker","mutation",a),stopEmbeddedBroker:a=>n("mqttBroker","stopEmbeddedBroker","mutation",a),getStatus:a=>n("mqttBroker","getStatus","query",a)},networkAccess:{start:a=>n("networkAccess","start","mutation",a),stop:a=>n("networkAccess","stop","mutation",a),getEndpoint:a=>n("networkAccess","getEndpoint","query",a),getStatus:a=>n("networkAccess","getStatus","query",a),listEndpoints:a=>n("networkAccess","listEndpoints","query",a)},networkQuality:{getAllStats:a=>n("networkQuality","getAllStats","query",a)},nodes:{topology:a=>n("nodes","topology","query",a),deployAddon:a=>n("nodes","deployAddon","mutation",a),undeployAddon:a=>n("nodes","undeployAddon","mutation",a),restartAddon:a=>n("nodes","restartAddon","mutation",a),restartProcess:a=>n("nodes","restartProcess","mutation",a),restartNode:a=>n("nodes","restartNode","mutation",a),shutdownNode:a=>n("nodes","shutdownNode","mutation",a),renameNode:a=>n("nodes","renameNode","mutation",a),clusterAddonStatus:a=>n("nodes","clusterAddonStatus","query",a),getCapUsageGraph:a=>n("nodes","getCapUsageGraph","query",a),getNodeAddons:a=>n("nodes","getNodeAddons","query",a),setProcessLogLevel:a=>n("nodes","setProcessLogLevel","mutation",a),executeQuery:a=>n("nodes","executeQuery","mutation",a)},notificationOutput:{listTargetKinds:a=>n("notificationOutput","listTargetKinds","query",a),listTargets:a=>n("notificationOutput","listTargets","query",a),discoverTargets:a=>n("notificationOutput","discoverTargets","query",a),send:a=>n("notificationOutput","send","mutation",a),testTarget:a=>n("notificationOutput","testTarget","mutation",a),upsertTarget:a=>n("notificationOutput","upsertTarget","mutation",a),deleteTarget:a=>n("notificationOutput","deleteTarget","mutation",a),setTargetEnabled:a=>n("notificationOutput","setTargetEnabled","mutation",a)},osdManager:{getConditionSupport:a=>n("osdManager","getConditionSupport","query",a),copyDeviceConfiguration:a=>n("osdManager","copyDeviceConfiguration","mutation",a)},pipelineExecutor:{getAvailableEngines:a=>n("pipelineExecutor","getAvailableEngines","query",a),getSelectedEngine:a=>n("pipelineExecutor","getSelectedEngine","query",a),getDefaultSteps:a=>n("pipelineExecutor","getDefaultSteps","query",a),getEngineProvisioning:a=>n("pipelineExecutor","getEngineProvisioning","query",a),getVideoPipelineSteps:a=>n("pipelineExecutor","getVideoPipelineSteps","query",a),setVideoPipelineSteps:a=>n("pipelineExecutor","setVideoPipelineSteps","mutation",a),clearDeviceOverrides:a=>n("pipelineExecutor","clearDeviceOverrides","mutation",a),getInferenceDeviceHealth:a=>n("pipelineExecutor","getInferenceDeviceHealth","query",a),rearmInferenceDevice:a=>n("pipelineExecutor","rearmInferenceDevice","mutation",a),getSchema:a=>n("pipelineExecutor","getSchema","query",a),getGlobalSteps:a=>n("pipelineExecutor","getGlobalSteps","query",a),getGlobalPipelineConfig:a=>n("pipelineExecutor","getGlobalPipelineConfig","query",a),getOrchestratorConfigSchema:a=>n("pipelineExecutor","getOrchestratorConfigSchema","query",a),validatePipeline:a=>n("pipelineExecutor","validatePipeline","query",a),listTemplates:a=>n("pipelineExecutor","listTemplates","query",a),saveTemplate:a=>n("pipelineExecutor","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineExecutor","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineExecutor","deleteTemplate","mutation",a),getCapabilities:a=>n("pipelineExecutor","getCapabilities","query",a),getAddonModels:a=>n("pipelineExecutor","getAddonModels","query",a),downloadModel:a=>n("pipelineExecutor","downloadModel","mutation",a),deleteModel:a=>n("pipelineExecutor","deleteModel","mutation",a),cacheFrameInPool:a=>n("pipelineExecutor","cacheFrameInPool","mutation",a),inferCached:a=>n("pipelineExecutor","inferCached","mutation",a),uncacheFrame:a=>n("pipelineExecutor","uncacheFrame","mutation",a),getEffectiveTuning:a=>n("pipelineExecutor","getEffectiveTuning","query",a),listLoadedEngines:a=>n("pipelineExecutor","listLoadedEngines","query",a),spinEngine:a=>n("pipelineExecutor","spinEngine","mutation",a),killEngine:a=>n("pipelineExecutor","killEngine","mutation",a),listReferenceImages:a=>n("pipelineExecutor","listReferenceImages","query",a),getReferenceImage:a=>n("pipelineExecutor","getReferenceImage","query",a),getReferenceAudioFiles:a=>n("pipelineExecutor","getReferenceAudioFiles","query",a),getReferenceAudio:a=>n("pipelineExecutor","getReferenceAudio","query",a),getAudioCapabilities:a=>n("pipelineExecutor","getAudioCapabilities","query",a),runAudioTest:a=>n("pipelineExecutor","runAudioTest","mutation",a),getDetectionConfigSchema:a=>n("pipelineExecutor","getDetectionConfigSchema","query",a)},pipelineOrchestrator:{pauseForStorageMigration:a=>n("pipelineOrchestrator","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("pipelineOrchestrator","resumeForStorageMigration","mutation",a),rebalance:a=>n("pipelineOrchestrator","rebalance","mutation",a),getPipelineAssignments:a=>n("pipelineOrchestrator","getPipelineAssignments","query",a),getAgentLoad:a=>n("pipelineOrchestrator","getAgentLoad","query",a),getGlobalMetrics:a=>n("pipelineOrchestrator","getGlobalMetrics","query",a),getCapabilityBindings:a=>n("pipelineOrchestrator","getCapabilityBindings","query",a),setCapabilityBinding:a=>n("pipelineOrchestrator","setCapabilityBinding","mutation",a),getIngestOwner:a=>n("pipelineOrchestrator","getIngestOwner","query",a),getAudioNodeLoad:a=>n("pipelineOrchestrator","getAudioNodeLoad","query",a),getAgentSettings:a=>n("pipelineOrchestrator","getAgentSettings","query",a),listAgentSettings:a=>n("pipelineOrchestrator","listAgentSettings","query",a),removeAgentSettings:a=>n("pipelineOrchestrator","removeAgentSettings","mutation",a),setAgentMaxCameras:a=>n("pipelineOrchestrator","setAgentMaxCameras","mutation",a),setAgentDetectWeight:a=>n("pipelineOrchestrator","setAgentDetectWeight","mutation",a),setAgentCapabilities:a=>n("pipelineOrchestrator","setAgentCapabilities","mutation",a),setAgentDecodeLimits:a=>n("pipelineOrchestrator","setAgentDecodeLimits","mutation",a),setAgentReachableHost:a=>n("pipelineOrchestrator","setAgentReachableHost","mutation",a),setAgentInferenceDevices:a=>n("pipelineOrchestrator","setAgentInferenceDevices","mutation",a),getNodeInferenceDevices:a=>n("pipelineOrchestrator","getNodeInferenceDevices","query",a),resetNodePipelineDefaults:a=>n("pipelineOrchestrator","resetNodePipelineDefaults","mutation",a),getCameraStatuses:a=>n("pipelineOrchestrator","getCameraStatuses","query",a),reconcileFromDisk:a=>n("pipelineOrchestrator","reconcileFromDisk","mutation",a),getReconcileFromDiskStatus:a=>n("pipelineOrchestrator","getReconcileFromDiskStatus","query",a),listTemplates:a=>n("pipelineOrchestrator","listTemplates","query",a),saveTemplate:a=>n("pipelineOrchestrator","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineOrchestrator","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineOrchestrator","deleteTemplate","mutation",a)},pipelineRunner:{attachCamera:a=>n("pipelineRunner","attachCamera","mutation",a),reportMotion:a=>n("pipelineRunner","reportMotion","mutation",a),getLocalLoad:a=>n("pipelineRunner","getLocalLoad","query",a),getLocalMetrics:a=>n("pipelineRunner","getLocalMetrics","query",a),getAllCameraMetrics:a=>n("pipelineRunner","getAllCameraMetrics","query",a),getLocalCameras:a=>n("pipelineRunner","getLocalCameras","query",a),getNativeCrop:a=>n("pipelineRunner","getNativeCrop","query",a),runStatelessStep:a=>n("pipelineRunner","runStatelessStep","mutation",a)},plateGallery:{getPlateMedia:a=>n("plateGallery","getPlateMedia","query",a),searchPlates:a=>n("plateGallery","searchPlates","query",a),suggestPlateClusters:a=>n("plateGallery","suggestPlateClusters","query",a),correctPlateText:a=>n("plateGallery","correctPlateText","mutation",a),deletePlate:a=>n("plateGallery","deletePlate","mutation",a),listVehicles:a=>n("plateGallery","listVehicles","query",a),createVehicle:a=>n("plateGallery","createVehicle","mutation",a),renameVehicle:a=>n("plateGallery","renameVehicle","mutation",a),deleteVehicle:a=>n("plateGallery","deleteVehicle","mutation",a),listVehicleSamples:a=>n("plateGallery","listVehicleSamples","query",a),removeVehicleSample:a=>n("plateGallery","removeVehicleSample","mutation",a),assignPlate:a=>n("plateGallery","assignPlate","mutation",a),unassignPlate:a=>n("plateGallery","unassignPlate","mutation",a),assignPlates:a=>n("plateGallery","assignPlates","mutation",a),unassignPlates:a=>n("plateGallery","unassignPlates","mutation",a)},recording:{getAvailabilityBatch:a=>n("recording","getAvailabilityBatch","query",a),getDaysWithRecordingsBatch:a=>n("recording","getDaysWithRecordingsBatch","query",a),getStorageUsage:a=>n("recording","getStorageUsage","query",a),listOpsLog:a=>n("recording","listOpsLog","query",a),pauseForStorageMigration:a=>n("recording","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("recording","resumeForStorageMigration","mutation",a),refreshStorageLocationsForMigration:a=>n("recording","refreshStorageLocationsForMigration","mutation",a),startStorageMigrationMove:a=>n("recording","startStorageMigrationMove","mutation",a),getStorageMigrationMoveStatus:a=>n("recording","getStorageMigrationMoveStatus","query",a),cancelStorageMigrationMove:a=>n("recording","cancelStorageMigrationMove","mutation",a),relocateFootage:a=>n("recording","relocateFootage","mutation",a),listRelocateJobs:a=>n("recording","listRelocateJobs","query",a),getRelocateResidue:a=>n("recording","getRelocateResidue","query",a),reconcileLedgerAgainstDisk:a=>n("recording","reconcileLedgerAgainstDisk","mutation",a),cancelRelocateJob:a=>n("recording","cancelRelocateJob","mutation",a),planStorageRebalance:a=>n("recording","planStorageRebalance","query",a),startStorageRebalance:a=>n("recording","startStorageRebalance","mutation",a),getPlacement:a=>n("recording","getPlacement","query",a),setDevicePlacement:a=>n("recording","setDevicePlacement","mutation",a)},recordingExport:{createExport:a=>n("recordingExport","createExport","mutation",a),getExport:a=>n("recordingExport","getExport","query",a),cancelExport:a=>n("recordingExport","cancelExport","mutation",a),deleteExport:a=>n("recordingExport","deleteExport","mutation",a),getDownloadUrl:a=>n("recordingExport","getDownloadUrl","query",a),readExportBytes:a=>n("recordingExport","readExportBytes","query",a)},serverManagement:{getServerPackageStatus:a=>n("serverManagement","getServerPackageStatus","query",a),checkServerUpdate:a=>n("serverManagement","checkServerUpdate","mutation",a),applyServerUpdate:a=>n("serverManagement","applyServerUpdate","mutation",a),rollbackServerUpdate:a=>n("serverManagement","rollbackServerUpdate","mutation",a),restartServer:a=>n("serverManagement","restartServer","mutation",a)},settingsStore:{get:a=>n("settingsStore","get","query",a),set:a=>n("settingsStore","set","mutation",a),query:a=>n("settingsStore","query","query",a),upsert:a=>n("settingsStore","upsert","mutation",a),insert:a=>n("settingsStore","insert","mutation",a),insertMany:a=>n("settingsStore","insertMany","mutation",a),update:a=>n("settingsStore","update","mutation",a),delete:a=>n("settingsStore","delete","mutation",a),deleteWhere:a=>n("settingsStore","deleteWhere","mutation",a),updateWhere:a=>n("settingsStore","updateWhere","mutation",a),count:a=>n("settingsStore","count","query",a),aggregate:a=>n("settingsStore","aggregate","query",a),histogram:a=>n("settingsStore","histogram","query",a),isEmpty:a=>n("settingsStore","isEmpty","query",a),declareCollection:a=>n("settingsStore","declareCollection","mutation",a)},storage:{resolve:a=>n("storage","resolve","query",a),write:a=>n("storage","write","mutation",a),read:a=>n("storage","read","query",a),exists:a=>n("storage","exists","query",a),list:a=>n("storage","list","query",a),delete:a=>n("storage","delete","mutation",a),getAvailableSpace:a=>n("storage","getAvailableSpace","query",a),beginUpload:a=>n("storage","beginUpload","mutation",a),writeChunk:a=>n("storage","writeChunk","mutation",a),finalizeUpload:a=>n("storage","finalizeUpload","mutation",a),abortUpload:a=>n("storage","abortUpload","mutation",a),beginDownload:a=>n("storage","beginDownload","mutation",a),readChunk:a=>n("storage","readChunk","query",a),endDownload:a=>n("storage","endDownload","mutation",a),listLocations:a=>n("storage","listLocations","query",a),listLocationDeclarations:a=>n("storage","listLocationDeclarations","query",a),upsertLocation:a=>n("storage","upsertLocation","mutation",a),deleteLocation:a=>n("storage","deleteLocation","mutation",a),listDrainProgress:a=>n("storage","listDrainProgress","query",a),testLocation:a=>n("storage","testLocation","query",a),listProviders:a=>n("storage","listProviders","query",a),testConfig:a=>n("storage","testConfig","query",a)},storageMigration:{plan:a=>n("storageMigration","plan","query",a),start:a=>n("storageMigration","start","mutation",a),status:a=>n("storageMigration","status","query",a),cancel:a=>n("storageMigration","cancel","mutation",a),movers:a=>n("storageMigration","movers","query",a),residue:a=>n("storageMigration","residue","query",a),drain:a=>n("storageMigration","drain","mutation",a),cleanupStart:a=>n("storageMigration","cleanupStart","mutation",a),cleanupStatus:a=>n("storageMigration","cleanupStatus","query",a),cleanupCancel:a=>n("storageMigration","cleanupCancel","mutation",a),history:a=>n("storageMigration","history","query",a)},streamBroker:{fetchEventMedia:a=>n("streamBroker","fetchEventMedia","mutation",a),listAllCameraStreams:a=>n("streamBroker","listAllCameraStreams","query",a),listAllProfileSlots:a=>n("streamBroker","listAllProfileSlots","query",a),getBrokerStats:a=>n("streamBroker","getBrokerStats","query",a),probeStream:a=>n("streamBroker","probeStream","mutation",a),listClients:a=>n("streamBroker","listClients","query",a),killClient:a=>n("streamBroker","killClient","mutation",a),getStreamUrl:a=>n("streamBroker","getStreamUrl","query",a),getStreamWithCodec:a=>n("streamBroker","getStreamWithCodec","mutation",a),releaseStreamWithCodec:a=>n("streamBroker","releaseStreamWithCodec","mutation",a),acquireEgressTranscode:a=>n("streamBroker","acquireEgressTranscode","mutation",a),releaseEgressTranscode:a=>n("streamBroker","releaseEgressTranscode","mutation",a),subscribeAudioChunks:a=>n("streamBroker","subscribeAudioChunks","mutation",a),pullAudioChunks:a=>n("streamBroker","pullAudioChunks","query",a),unsubscribeAudioChunks:a=>n("streamBroker","unsubscribeAudioChunks","mutation",a),subscribeFrames:a=>n("streamBroker","subscribeFrames","mutation",a),pullFrameHandles:a=>n("streamBroker","pullFrameHandles","query",a),unsubscribeFrames:a=>n("streamBroker","unsubscribeFrames","mutation",a),setPreBufferDuration:a=>n("streamBroker","setPreBufferDuration","mutation",a),getPreBufferInfo:a=>n("streamBroker","getPreBufferInfo","query",a),getRtspPort:a=>n("streamBroker","getRtspPort","query",a),getAllRtspEntries:a=>n("streamBroker","getAllRtspEntries","query",a),getRtspEntry:a=>n("streamBroker","getRtspEntry","query",a),regenerateRtspToken:a=>n("streamBroker","regenerateRtspToken","mutation",a),setRtspEnabled:a=>n("streamBroker","setRtspEnabled","mutation",a),isRtspEnabled:a=>n("streamBroker","isRtspEnabled","query",a)},system:{info:a=>n("system","info","query",a),health:a=>n("system","health","query",a),featureFlags:a=>n("system","featureFlags","query",a),networkAddresses:a=>n("system","networkAddresses","query",a),getRetentionConfig:a=>n("system","getRetentionConfig","query",a),setRetentionConfig:a=>n("system","setRetentionConfig","mutation",a),forceRetentionCleanup:a=>n("system","forceRetentionCleanup","mutation",a),getSiteLocation:a=>n("system","getSiteLocation","query",a),setSiteLocation:a=>n("system","setSiteLocation","mutation",a),detectSiteLocation:a=>n("system","detectSiteLocation","mutation",a),getRequestCensus:a=>n("system","getRequestCensus","query",a),getLoadContributions:a=>n("system","getLoadContributions","query",a),getFailureContributions:a=>n("system","getFailureContributions","query",a),getLoggingSettings:a=>n("system","getLoggingSettings","query",a),setLoggingSettings:a=>n("system","setLoggingSettings","mutation",a)},terminalSession:{listProfiles:a=>n("terminalSession","listProfiles","query",a),listInstances:a=>n("terminalSession","listInstances","query",a),createInstance:a=>n("terminalSession","createInstance","mutation",a),updateInstance:a=>n("terminalSession","updateInstance","mutation",a),deleteInstance:a=>n("terminalSession","deleteInstance","mutation",a),setInstanceEnabled:a=>n("terminalSession","setInstanceEnabled","mutation",a),listLegacyCameras:a=>n("terminalSession","listLegacyCameras","query",a),adoptLegacyMonitor:a=>n("terminalSession","adoptLegacyMonitor","mutation",a),listSessions:a=>n("terminalSession","listSessions","query",a),openSession:a=>n("terminalSession","openSession","mutation",a),resize:a=>n("terminalSession","resize","mutation",a),pullOutput:a=>n("terminalSession","pullOutput","mutation",a),writeInput:a=>n("terminalSession","writeInput","mutation",a),close:a=>n("terminalSession","close","mutation",a)},toast:{onToast:(a,s)=>n("toast","onToast","subscription",a,s)},turnProvider:{getTurnServers:a=>n("turnProvider","getTurnServers","query",a)},userManagement:{listUsers:a=>n("userManagement","listUsers","query",a),createUser:a=>n("userManagement","createUser","mutation",a),updateUser:a=>n("userManagement","updateUser","mutation",a),deleteUser:a=>n("userManagement","deleteUser","mutation",a),resetPassword:a=>n("userManagement","resetPassword","mutation",a),setUserScopes:a=>n("userManagement","setUserScopes","mutation",a),validateCredentials:a=>n("userManagement","validateCredentials","mutation",a),listApiKeys:a=>n("userManagement","listApiKeys","query",a),createApiKey:a=>n("userManagement","createApiKey","mutation",a),revokeApiKey:a=>n("userManagement","revokeApiKey","mutation",a),validateApiKey:a=>n("userManagement","validateApiKey","mutation",a),createScopedToken:a=>n("userManagement","createScopedToken","mutation",a),revokeScopedToken:a=>n("userManagement","revokeScopedToken","mutation",a),validateScopedToken:a=>n("userManagement","validateScopedToken","query",a),listScopedTokens:a=>n("userManagement","listScopedTokens","query",a),setupTotp:a=>n("userManagement","setupTotp","mutation",a),confirmTotp:a=>n("userManagement","confirmTotp","mutation",a),disableTotp:a=>n("userManagement","disableTotp","mutation",a),getTotpStatus:a=>n("userManagement","getTotpStatus","query",a),verifyTotp:a=>n("userManagement","verifyTotp","mutation",a),oauthIssueCode:a=>n("userManagement","oauthIssueCode","mutation",a),oauthExchangeCode:a=>n("userManagement","oauthExchangeCode","mutation",a),oauthRefresh:a=>n("userManagement","oauthRefresh","mutation",a),oauthVerifyAccessToken:a=>n("userManagement","oauthVerifyAccessToken","query",a),listOauthSessions:a=>n("userManagement","listOauthSessions","query",a),revokeOauthSession:a=>n("userManagement","revokeOauthSession","mutation",a)}}}var uee=["devices","classes"];new Set(uee);var _T=d({title:o().max(500).optional(),body:o().max(2e3).optional()}),NT=o().min(1).max(200),OT=w(l()).min(1),jT=l().int().min(2).max(3600),PT=l().int().min(1).max(60),DT=w(RI).min(1),zT=l().int().min(1).max(5),dee=.1,LT=l().min(dee).max(3600),qT=l().min(0).max(60),BT=o().max(200),FT=N(["image","gif"]),UT=w(o().min(1).max(40)).max(20),pee=d({name:NT,enabled:A().default(!0),deviceIds:OT,schedule:Dm,cadenceSec:jT.default(15),framerate:PT.default(10),denseCadenceSec:LT.optional(),minDwellSec:qT.optional(),targets:DT,template:_T.optional(),previewText:BT.optional(),previewMode:FT.default("image"),reportClasses:UT.optional(),priority:zT.default(3)});d({name:NT.optional(),enabled:A().optional(),deviceIds:OT.optional(),schedule:Dm.optional(),cadenceSec:jT.optional(),framerate:PT.optional(),denseCadenceSec:LT.optional(),minDwellSec:qT.optional(),targets:DT.optional(),template:_T.nullable().optional(),previewText:BT.optional(),previewMode:FT.optional(),reportClasses:UT.optional(),priority:zT.optional()});pee.extend({id:o(),ownerUserId:o().optional(),lastGeneratedAt:l().optional(),generatedByDevice:Y(o(),l()).optional(),createdBy:o(),createdAt:l(),updatedAt:l()});var mee=[{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(mee.map(e=>[e.stepId,e.defaultModelId])));o().min(1);var fee=[{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 hee(e,t){return`clusterStepSetting:${e}:${t}`}var gee=l().finite();function vee(e){const t={};for(const n of fee){const a=gee.safeParse(e[hee(n.stepId,n.key)]),s=a.success?a.data:n.default,p=t[n.stepId]??{};t[n.stepId]={...p,[n.key]:s}}return t}vee({});d({paddingRatio:l().min(0).max(4),square:A()});var yee=N(["all","inferred"]);d({holdFrames:l().int().min(1).max(64),budgetMb:l().int().min(0).max(4096),activityMs:l().int().min(0).max(12e4),admission:yee,tileBudgetMb:l().int().min(0).max(1024),sceneBudgetMb:l().int().min(0).max(1024)});var L2={"°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 xy(e){return Object.hasOwn(L2,e)?L2[e]:void 0}function q2(e){return xy(e)?.dimension}function bee(e,t){return e*t.factor+t.offset}function See(e,t){return(e-t.offset)/t.factor}function xee(e,t,n){if(t===n)return e;const a=xy(t);if(!a)return;const s=xy(n);if(s&&a.dimension===s.dimension)return See(bee(e,a),s)}function kee(e,t){if(e===t)return!0;const n=q2(e);return n===void 0?!1:n===q2(t)}var wee=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()}},HT=class{constructor(t){this.generateIdentifier=t,this.kv=new wee}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)}},Mee=class extends HT{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 Cee(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 Aee(e,t){const n=Cee(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 fl(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function Tp(e,t){return e.indexOf(t)!==-1}function B2(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var Eee=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Aee(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}},Ree=e=>Object.prototype.toString.call(e).slice(8,-1),$T=e=>typeof e>"u",Iee=e=>e===null,tu=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ky=e=>tu(e)&&Object.keys(e).length===0,Kr=e=>Array.isArray(e),Tee=e=>typeof e=="string",_ee=e=>typeof e=="number"&&!isNaN(e),Nee=e=>typeof e=="boolean",Oee=e=>e instanceof RegExp,nu=e=>e instanceof Map,au=e=>e instanceof Set,QT=e=>Ree(e)==="Symbol",jee=e=>e instanceof Date&&!isNaN(e.valueOf()),VT=e=>e instanceof Error,F2=e=>typeof e=="number"&&isNaN(e),Pee=e=>Nee(e)||Iee(e)||$T(e)||_ee(e)||Tee(e)||QT(e),Dee=e=>typeof e=="bigint",zee=e=>e===1/0||e===-1/0,Lee=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),qee=e=>e instanceof URL,wy=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Hg=e=>e.map(String).map(wy).join("."),$c=(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 yi(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var GT=[yi($T,"undefined",()=>null,()=>{}),yi(Dee,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),yi(jee,"Date",e=>e.toISOString(),e=>new Date(e)),yi(VT,"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}),yi(Oee,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),yi(au,"set",e=>[...e.values()],e=>new Set(e)),yi(nu,"map",e=>[...e.entries()],e=>new Map(e)),yi(e=>F2(e)||zee(e),"number",e=>F2(e)?"NaN":e>0?"Infinity":"-Infinity",Number),yi(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),yi(qee,"URL",e=>e.toString(),e=>new URL(e))];function zm(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var ZT=zm((e,t)=>QT(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}),Bee=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),KT=zm(Lee,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Bee[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function WT(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var YT=zm(WT,(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)}),XT=zm((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)}),Fee=[YT,ZT,XT,KT],U2=(e,t)=>{const n=B2(Fee,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=B2(GT,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},JT={};GT.forEach(e=>{JT[e.annotation]=e});var Uee=(e,t,n)=>{if(Kr(t))switch(t[0]){case"symbol":return ZT.untransform(e,t,n);case"class":return YT.untransform(e,t,n);case"custom":return XT.untransform(e,t,n);case"typed-array":return KT.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=JT[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Js=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function e_(e){if(Tp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Tp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Tp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Hee=(e,t)=>{e_(t);for(let n=0;n<t.length;n++){const a=t[n];if(au(e))e=Js(e,+a);else if(nu(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Js(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},My=(e,t,n)=>{if(e_(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Kr(a)){const m=+f;a=a[m]}else if(tu(a))a=a[f];else if(au(a)){const m=+f;a=Js(a,m)}else if(nu(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=Js(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if(Kr(a)?a[+s]=n(a[+s]):tu(a)&&(a[s]=n(a[s])),au(a)){const p=Js(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(nu(a)){const p=+t[t.length-2],f=Js(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},t_=e=>e<1;function Cy(e,t,n,a=[]){if(!e)return;const s=t_(n);if(!Kr(e)){fl(e,(m,h)=>Cy(m,t,n,[...a,...$c(h,s)]));return}const[p,f]=e;f&&fl(f,(m,h)=>{Cy(m,t,n,[...a,...$c(h,s)])}),t(p,a)}function $ee(e,t,n,a){return Cy(t,(s,p)=>{e=My(e,p,f=>Uee(f,s,a))},n),e}function Qee(e,t,n){const a=t_(n);function s(p,f){const m=Hee(e,$c(f,a));p.map(h=>$c(h,a)).forEach(h=>{e=My(e,h,()=>m)})}if(Kr(t)){const[p,f]=t;p.forEach(m=>{e=My(e,$c(m,a),()=>e)}),f&&fl(f,s)}else fl(t,s);return e}var Vee=(e,t)=>tu(e)||Kr(e)||nu(e)||au(e)||VT(e)||WT(e,t);function Gee(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function Zee(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(Hg):n[Hg(p)]=f.map(Hg)}),a?ky(n)?[a]:[a,n]:ky(n)?void 0:n}var n_=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=Pee(e);if(!m){Gee(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!Vee(e,n)){const E=U2(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(Tp(p,e))return{transformedValue:null};const h=U2(e,n),c=h?.value??e,x=Kr(c)?[]:{},M={};fl(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=n_(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,Kr(_.annotations)?M[wy(R)]=_.annotations:tu(_.annotations)&&fl(_.annotations,(j,D)=>{M[wy(R)+"."+D]=j})});const C=ky(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function a_(e){return Object.prototype.toString.call(e).slice(8,-1)}function H2(e){return a_(e)==="Array"}function Kee(e){if(a_(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Wee(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 Ay(e,t={}){if(H2(e))return e.map(s=>Ay(s,t));if(!Kee(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||H2(t.props)&&!t.props.includes(p))return s;const f=e[p];return Wee(s,p,Ay(f,t),e,t.nonenumerable),s},{})}var bt=class{constructor({dedupe:t=!1}={}){this.classRegistry=new Mee,this.symbolRegistry=new HT(n=>n.description??""),this.customTransformerRegistry=new Eee,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,a=n_(t,n,this,this.dedupe),s={json:a.transformedValue};a.annotations&&(s.meta={...s.meta,values:a.annotations});const p=Zee(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:Ay(a);return s?.values&&(p=$ee(p,s.values,s.v??0,this)),s?.referentialEqualities&&(p=Qee(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)}};bt.defaultInstance=new bt;bt.serialize=bt.defaultInstance.serialize.bind(bt.defaultInstance);bt.deserialize=bt.defaultInstance.deserialize.bind(bt.defaultInstance);bt.stringify=bt.defaultInstance.stringify.bind(bt.defaultInstance);bt.parse=bt.defaultInstance.parse.bind(bt.defaultInstance);bt.registerClass=bt.defaultInstance.registerClass.bind(bt.defaultInstance);bt.registerSymbol=bt.defaultInstance.registerSymbol.bind(bt.defaultInstance);bt.registerCustom=bt.defaultInstance.registerCustom.bind(bt.defaultInstance);bt.allowErrorProps=bt.defaultInstance.allowErrorProps.bind(bt.defaultInstance);bt.serialize;bt.deserialize;bt.stringify;bt.parse;bt.registerClass;bt.registerCustom;bt.registerSymbol;bt.allowErrorProps;var Yee=1e4,Xee=6e3,Jee=2e3,ete=3e4,tte=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??Jee,this.maxRetryMs=t.maxRetryDelayMs??ete,this._trpcClient=this.buildTrpcClient(),this._systemProxy=z2(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 see(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=z2(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,includeLoopback:!1})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(m.length===0)return{winner:this._serverUrl,switched:!1};const h=await nte(m.map(c=>c.baseUrl),n);return!h||h===this._serverUrl?{winner:h??this._serverUrl,switched:!1}:(this.switchServerUrl(h),{winner:h,switched:!0})}close(){this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._wsClient?.close()}disposeMirror(){this.mirror?.dispose(),this.mirror=null,this.mirrorInit=null}async login(t,n){const a=await this._trpcClient.auth.login.mutate({username:t,password:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a,p=s.token,f=s.requiresTotp===!0||Array.isArray(s.secondFactors)&&s.secondFactors.length>0;typeof p=="string"&&!f&&this.setToken(p)}return a}async loginVerifyTotp(t,n){const a=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:t,code:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async loginBeginPasskey(t){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:t})}async loginVerifyPasskey(t,n){const a=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:t,response:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(t){const n=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:t});if(typeof n=="object"&&n!==null&&"token"in n){const a=n,s=a.requiresTotp===!0||Array.isArray(a.secondFactors)&&a.secondFactors.length>0;typeof a.token=="string"&&!s&&this.setToken(a.token)}return n}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(t){return await this._trpcClient.auth.changeOwnPassword.mutate(t)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(t){return await this._trpcClient.auth.confirmOwnTotp.mutate(t)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(t){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(t)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(t){return await this._trpcClient.auth.removeOwnPasskey.mutate(t)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(t){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(t)}setToken(t){this.token=t}listDevices(t){return this.mirror?(t?this.mirror.query(t):this.mirror.getAllDevices()).map(n=>this.attachBinding(n)):[]}getDeviceInfo(t){return this.mirror?.getDeviceInfo(t)??null}listDeviceInfos(t){const n=this.mirror;if(!n)return[];const a=t?n.query(t):n.getAllDevices(),s=[];for(const p of a){const f=n.getDeviceInfo(p.deviceId);f&&s.push(f)}return s}getDevice(t){const n=this.mirror?.getDeviceById(t)??null;return n?this.attachBinding(n):null}getDeviceByName(t){const n=this.mirror?.getDeviceByName(t)??null;return n?this.attachBinding(n):null}getDeviceByStableId(t){const n=this.mirror?.getDeviceByStableId(t)??null;return n?this.attachBinding(n):null}async waitForDevice(t,n){this.mirror||await this.init();const a=await this.mirror.waitForDevice(t,n??3e4);return this.attachBinding(a)}onDeviceAdded(t){if(!this.mirror)throw new Error("System.onDeviceAdded: call init() before subscribing");return this.mirror.onDeviceAdded(t)}onDeviceRemoved(t){if(!this.mirror)throw new Error("System.onDeviceRemoved: call init() before subscribing");return this.mirror.onDeviceRemoved(t)}attachBinding(t){const n=this.lookupBinding(t.deviceId);if(n===t.binding)return t;const a=t;return a.binding=n,t}lookupBinding(t){return this.mirror?this.mirror.getDeviceById(t)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(t,n){const a=n;let s=this._eventSubs.get(t);if(s===void 0){const f=new Set,m=this._trpcClient.live.onEvent.subscribe({category:t},{onData:h=>{for(const c of[...f])try{c(h)}catch{}}});s={listeners:f,unsubscribe:()=>{try{m.unsubscribe()}catch{}}},this._eventSubs.set(t,s)}s.listeners.add(a);let p=!1;return()=>{if(p)return;p=!0;const f=this._eventSubs.get(t);f!==void 0&&(f.listeners.delete(a),f.listeners.size===0&&(f.unsubscribe(),this._eventSubs.delete(t)))}}resetEventSubs(){for(const t of this._eventSubs.values())t.unsubscribe();this._eventSubs.clear()}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){const t=()=>{const n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),n};if(this.useWs){const n=this._serverUrl.replace(/^http/,"ws")+"/trpc",a=this.baseRetryMs,s=this.maxRetryMs,p=this._wsEpoch;return this._wsClient=I3({url:n,connectionParams:()=>({token:this.token}),retryDelayMs:f=>Math.min(a*Math.pow(2,f),s),keepAlive:{enabled:!0,intervalMs:Yee,pongTimeoutMs:Xee},onOpen:()=>{p===this._wsEpoch&&(this._connectionVersion+=1,this.emitConnectionEvent("connected"))},onClose:()=>{p===this._wsEpoch&&this.emitConnectionEvent("disconnected")}}),Lv({links:[T3({client:this._wsClient,transformer:bt})]})}return this._wsClient=null,Lv({links:[h3({url:`${this._serverUrl}/trpc`,headers:t,transformer:bt})]})}};function Lm(e){return new tte(e)}async function nte(e,t){if(e.length===0)return null;if(typeof fetch!="function")return e[0]??null;const n=typeof window<"u"&&typeof window.location<"u"&&window.location.protocol==="https:"?e.filter(p=>p.toLowerCase().startsWith("https://")):e;if(n.length===0)return null;const a=n.map(()=>new AbortController),s=n.map(async(p,f)=>{const m=a[f],h=setTimeout(()=>m.abort(),t);try{const c=await fetch(`${p.replace(/\/+$/,"")}/trpc/health`,{method:"GET",signal:m.signal,credentials:"omit"});if(!c.ok)throw new Error(`${c.status}`);return p}finally{clearTimeout(h)}});try{const p=await Promise.any(s);for(const f of a)try{f.abort()}catch{}return p}catch{return null}}var ate=(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})({}),ite=["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"],rte=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],ote=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],ste=["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"],lte=["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"],cte=["motion","movement","other"],ute=["package","packet"],dte=["audio"],pte=["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"],mte=["doorbell","ring"],fte=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...ite.reduce((e,t)=>({...e,[t]:"animal"}),{}),...rte.reduce((e,t)=>({...e,[t]:"person"}),{}),...ote.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...cte.reduce((e,t)=>({...e,[t]:"motion"}),{}),...ute.reduce((e,t)=>({...e,[t]:"package"}),{}),...ste.reduce((e,t)=>({...e,[t]:"face"}),{}),...lte.reduce((e,t)=>({...e,[t]:"plate"}),{}),...dte.reduce((e,t)=>({...e,[t]:"audio"}),{}),...pte.reduce((e,t)=>({...e,[t]:"audio"}),{}),...mte.reduce((e,t)=>({...e,[t]:"doorbell"}),{}),...fte.reduce((e,t)=>({...e,[t]:"sensor"}),{})});var hte=Object.values(ate),gte=hte.filter(e=>e!=="motion");[...gte];var T=yb();const Mn=wP(T),vte=kP({__proto__:null,default:Mn},[T]);T.createContext(null);var Qo=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(){}},yte=class extends Qo{#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"}},g0=new yte,bte={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ste=class{#t=bte;#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)}},No=new Ste;function xte(e){setTimeout(e,0)}var kte=typeof window>"u"||"Deno"in globalThis;function Qn(){}function wte(e,t){return typeof e=="function"?e(t):e}function Ey(e){return typeof e=="number"&&e>=0&&e!==1/0}function i_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Gr(e,t){return typeof e=="function"?e(t):e}function Ea(e,t){return typeof e=="function"?e(t):e}function $2(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:p,queryKey:f,stale:m}=e;if(f){if(a){if(t.queryHash!==v0(f,t.options))return!1}else if(!iu(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 Q2(e,t){const{exact:n,status:a,predicate:s,mutationKey:p}=e;if(p){if(!t.options.mutationKey)return!1;if(n){if(Wr(t.options.mutationKey)!==Wr(p))return!1}else if(!iu(t.options.mutationKey,p))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function v0(e,t){return(t?.queryKeyHashFn||Wr)(e)}function Wr(e){return JSON.stringify(e,(t,n)=>Ry(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function iu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>iu(e[n],t[n])):!1}var Mte=Object.prototype.hasOwnProperty;function y0(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=V2(e)&&V2(t);if(!a&&!(Ry(e)&&Ry(t)))return t;const p=(a?e:Object.keys(e)).length,f=a?t:Object.keys(t),m=f.length,h=a?new Array(m):{};let c=0;for(let x=0;x<m;x++){const M=a?x:f[x],C=e[M],E=t[M];if(C===E){h[M]=C,(a?x<p:Mte.call(e,M))&&c++;continue}if(C===null||E===null||typeof C!="object"||typeof E!="object"){h[M]=E;continue}const R=y0(C,E,n+1);h[M]=R,R===C&&c++}return p===m&&c===p?e:h}function ru(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 V2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ry(e){if(!G2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!G2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function G2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Cte(e){return new Promise(t=>{No.setTimeout(t,e)})}function Iy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?y0(e,t):t}function Ate(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function Ete(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Ra=Symbol();function r_(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ra?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b0(e,t){return typeof e=="function"?e(...t):!!e}function Rte(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 ou=(()=>{let e=()=>kte;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ty(){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 Ite=xte;function Tte(){let e=[],t=0,n=m=>{m()},a=m=>{m()},s=Ite;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 dn=Tte(),_te=class extends Qo{#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}},lm=new _te;function Nte(e){return Math.min(1e3*2**e,3e4)}function o_(e){return(e??"online")==="online"?lm.isOnline():!0}var _y=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function s_(e){let t=!1,n=0,a;const s=Ty(),p=()=>s.status!=="pending",f=_=>{if(!p()){const j=new _y(_);C(j),e.onCancel?.(j)}},m=()=>{t=!0},h=()=>{t=!1},c=()=>g0.isFocused()&&(e.networkMode==="always"||lm.isOnline())&&e.canRun(),x=()=>o_(e.networkMode)&&e.canRun(),M=_=>{p()||(a?.(),s.resolve(_))},C=_=>{p()||(a?.(),s.reject(_))},E=()=>new Promise(_=>{a=j=>{(p()||c())&&_(j)},e.onPause?.()}).then(()=>{a=void 0,p()||e.onContinue?.()}),R=()=>{if(p())return;let _;const j=n===0?e.initialPromise:void 0;try{_=j??e.fn()}catch(D){_=Promise.reject(D)}Promise.resolve(_).then(M).catch(D=>{if(p())return;const z=e.retry??(ou.isServer()?0:3),F=e.retryDelay??Nte,L=typeof F=="function"?F(n,D):F,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),Cte(L).then(()=>c()?void 0:E()).then(()=>{t?C(D):R()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(a?.(),s),cancelRetry:m,continueRetry:h,canStart:x,start:()=>(x()?R():E().then(R),s)}}var l_=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ey(this.gcTime)&&(this.#t=No.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ou.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(No.clearTimeout(this.#t),this.#t=void 0)}};function Ote(e){return{onFetch:(t,n)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,p=t.state.data?.pages||[],f=t.state.data?.pageParams||[];let m={pages:[],pageParams:[]},h=0;const c=async()=>{let x=!1;const M=R=>{Rte(R,()=>t.signal,()=>x=!0)},C=r_(t.options,t.fetchOptions),E=async(R,_,j)=>{if(x)return Promise.reject(t.signal.reason);if(_==null&&R.pages.length)return Promise.resolve(R);const z=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return M(ne),ne})(),F=await C(z),{maxPages:L}=t.options,Z=j?Ete:Ate;return{pages:Z(R.pages,F,L),pageParams:Z(R.pageParams,_,L)}};if(s&&p.length){const R=s==="backward",_=R?c_:Ny,j={pages:p,pageParams:f},D=_(a,j);m=await E(j,D,R)}else{const R=e??p.length;do{const _=h===0?f[0]??a.initialPageParam:Ny(a,m);if(h>0&&_==null)break;m=await E(m,_),h++}while(h<R)}return m};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function Ny(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 c_(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function jte(e,t){return t?Ny(e,t)!=null:!1}function Pte(e,t){return!t||!e.getPreviousPageParam?!1:c_(e,t)!=null}var Dte=class extends l_{#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=K2(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=K2(this.options);t.data!==void 0&&(this.setState(Z2(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=Iy(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(Qn).catch(Qn):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=>Ea(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ra||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Gr(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:!i_(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(c=>c.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const h=r_(this.options,t),x=(()=>{const M={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(M),M})();return this.#o=!1,this.options.persister?this.options.persister(h,x,this):h(x)},f=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return a(h),h})();(this.#t==="infinite"?Ote(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=s_({initialPromise:t?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof _y&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(h,c)=>{this.#l({type:"failed",failureCount:h,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#a.config.onSuccess?.(h,this),this.#a.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof _y){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,...u_(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...Z2(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),dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function u_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Z2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function K2(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 wu=class extends Qo{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#s=Ty(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#a=void 0;#i;#r;#s;#o;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),W2(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oy(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oy(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 Ea(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&&!ru(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Y2(this.#e,n,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==n||Ea(this.options.enabled,this.#e)!==Ea(t.enabled,this.#e)||Gr(this.options.staleTime,this.#e)!==Gr(t.staleTime,this.#e))&&this.#g();const s=this.#v();a&&(this.#e!==n||Ea(this.options.enabled,this.#e)!==Ea(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 Lte(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(Qn)),t}#g(){this.#S();const e=Gr(this.options.staleTime,this.#e);if(ou.isServer()||this.#a.isStale||!Ey(e))return;const n=i_(this.#a.dataUpdatedAt,e)+1;this.#d=No.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,!(ou.isServer()||Ea(this.options.enabled,this.#e)===!1||!Ey(this.#c)||this.#c===0)&&(this.#f=No.setInterval(()=>{(this.options.refetchIntervalInBackground||g0.isFocused())&&this.#p()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(No.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(No.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#e,a=this.options,s=this.#a,p=this.#i,f=this.#r,h=e!==n?e.state:this.#n,{state:c}=e;let x={...c},M=!1,C;if(t._optimisticResults){const U=this.hasListeners(),pe=!U&&W2(e,t),we=U&&Y2(e,n,t,a);(pe||we)&&(x={...x,...u_(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:E,errorUpdatedAt:R,status:_}=x;C=x.data;let j=!1;if(t.placeholderData!==void 0&&C===void 0&&_==="pending"){let U;s?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(U=s.data,j=!0):U=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,U!==void 0&&(_="success",C=Iy(s?.data,U,t),M=!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=Iy(s?.data,C,t),this.#l=C,this.#o=null}catch(U){this.#o=U}this.#o&&(E=this.#o,C=this.#l,R=Date.now(),_="error");const D=x.fetchStatus==="fetching",z=_==="pending",F=_==="error",L=z&&D,Z=C!==void 0,V={status:_,fetchStatus:x.fetchStatus,isPending:z,isSuccess:_==="success",isError:F,isInitialLoading:L,isLoading:L,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:F&&!Z,isPaused:x.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:F&&Z,isStale:S0(e,t),refetch:this.refetch,promise:this.#s,isEnabled:Ea(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const U=V.data!==void 0,pe=V.status==="error"&&!U,we=Ce=>{pe?Ce.reject(V.error):U&&Ce.resolve(V.data)},ke=()=>{const Ce=this.#s=V.promise=Ty();we(Ce)},Ae=this.#s;switch(Ae.status){case"pending":e.queryHash===n.queryHash&&we(Ae);break;case"fulfilled":(pe||V.data!==Ae.value)&&ke();break;case"rejected":(!pe||V.error!==Ae.reason)&&ke();break}}return V}updateResult(){const e=this.#a,t=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#e),ru(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){dn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function zte(e,t){return Ea(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ea(t.retryOnMount,e)===!1)}function W2(e,t){return zte(e,t)||e.state.data!==void 0&&Oy(e,t,t.refetchOnMount)}function Oy(e,t,n){if(Ea(t.enabled,e)!==!1&&Gr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&S0(e,t)}return!1}function Y2(e,t,n,a){return(e!==t||Ea(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&S0(e,n)}function S0(e,t){return Ea(t.enabled,e)!==!1&&e.isStaleByTime(Gr(t.staleTime,e))}function Lte(e,t){return!ru(e.getCurrentResult(),t)}var d_=class extends wu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,a=super.createResult(e,t),{isFetching:s,isRefetching:p,isError:f,isRefetchError:m}=a,h=n.fetchMeta?.fetchMore?.direction,c=f&&h==="forward",x=s&&h==="forward",M=f&&h==="backward",C=s&&h==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:jte(t,n.data),hasPreviousPage:Pte(t,n.data),isFetchNextPageError:c,isFetchingNextPage:x,isFetchPreviousPageError:M,isFetchingPreviousPage:C,isRefetchError:m&&!c&&!M,isRefetching:p&&!x&&!C}}},qte=class extends l_{#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||p_(),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=s_({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),dn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function p_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bte=class extends Qo{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 qte({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=ap(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=ap(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=ap(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=ap(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){dn.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=>Q2(t,n))}findAll(e={}){return this.getAll().filter(t=>Q2(e,t))}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return dn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Qn))))}};function ap(e){return e.options.scope?.id}var Fte=class extends Qo{#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),ru(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Wr(n.mutationKey)!==Wr(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??p_();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){dn.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 X2(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function Ute(e,t,n){const a=e.slice(0);return a[t]=n,a}var Hte=class extends Qo{#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,dn.batch(()=>{const n=this.#i,a=this.#c(this.#n);a.forEach(x=>x.observer.setOptions(x.defaultedQueryOptions));const s=a.map(x=>x.observer),p=s.map(x=>x.getCurrentResult()),f=n.length!==s.length,m=s.some((x,M)=>x!==n[M]),h=f||m,c=h?!0:p.some((x,M)=>{const C=this.#e[M];return!C||!ru(x,C)});!h&&!c||(h&&(this.#l=a,this.#i=s),this.#e=p,this.hasListeners()&&(h&&(X2(n,s).forEach(x=>{x.destroy()}),X2(s,n).forEach(x=>{x.subscribe(M=>{this.#h(x,M)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){const n=this.#c(e),a=n.map(p=>p.observer.getOptimisticResult(p.defaultedQueryOptions)),s=n.map(p=>p.defaultedQueryOptions.queryHash);return[a,p=>this.#d(p??a,t,s),()=>this.#m(a,n)]}#m(e,t){return t.map((n,a)=>{const s=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,p=>{t.forEach(f=>{f.observer.trackProp(p)})})})}#d(e,t,n){if(t){const a=this.#u,s=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((p,f)=>p!==a[f]));return(!this.#r||this.#e!==this.#o||s||t!==this.#s)&&(this.#s=t,this.#o=this.#e,n!==void 0&&(this.#u=n),this.#r=y0(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 wu(this.#t,s);n.push({defaultedQueryOptions:s,observer:f})}),n}#h(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=Ute(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)&&dn.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},$te=class extends Qo{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,s=t.queryHash??v0(a,t);let p=this.get(s);return p||(p=new Dte({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(){dn.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=>$2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>$2(e,n)):t}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},m_=class{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e={}){this.#t=e.queryCache||new $te,this.#e=e.mutationCache||new Bte,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=g0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=lm.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(Gr(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=wte(t,p);if(f!==void 0)return this.#t.build(this,a).setData(f,{...n,manual:!0})}setQueriesData(e,t,n){return dn.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;dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return dn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=dn.batch(()=>this.#t.findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(Qn).catch(Qn)}invalidateQueries(e,t={}){return dn.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=dn.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(Qn)),s.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(a).then(Qn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Gr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qn).catch(Qn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qn).catch(Qn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return lm.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(Wr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(a=>{iu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Wr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(a=>{iu(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=v0(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===Ra&&(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()}},f_=T.createContext(void 0),Mu=e=>{const t=T.useContext(f_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},h_=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(f_.Provider,{value:e,children:t})),g_=T.createContext(!1),v_=()=>T.useContext(g_);g_.Provider;function Qte(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vte=T.createContext(Qte()),y_=()=>T.useContext(Vte),b_=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?b0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},S_=e=>{T.useEffect(()=>{e.clearReset()},[e])},x_=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||b0(n,[e.error,a])),x0=(e,t)=>t.state.data===void 0,k_=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))}},Gte=(e,t)=>e.isLoading&&e.isFetching&&!t,jy=(e,t)=>e?.suspense&&t.isPending,Py=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function w_({queries:e,...t},n){const a=Mu(n),s=v_(),p=y_(),f=T.useMemo(()=>e.map(_=>{const j=a.defaultQueryOptions(_);return j._optimisticResults=s?"isRestoring":"optimistic",j}),[e,a,s]);f.forEach(_=>{k_(_);const j=a.getQueryCache().get(_.queryHash);b_(_,p,j)}),S_(p);const[m]=T.useState(()=>new Hte(a,f,t)),[h,c,x]=m.getOptimisticResult(f,t.combine),M=!s&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(_=>M?m.subscribe(dn.batchCalls(_)):Qn,[m,M]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setQueries(f,t)},[f,t,m]);const E=h.some((_,j)=>jy(f[j],_))?h.flatMap((_,j)=>{const D=f[j];if(D&&jy(D,_)){const z=new wu(a,D);return Py(D,z,p)}return[]}):[];if(E.length>0)throw Promise.all(E);const R=h.find((_,j)=>{const D=f[j];return D&&x_({result:_,errorResetBoundary:p,throwOnError:D.throwOnError,query:a.getQueryCache().get(D.queryHash),suspense:D.suspense})});if(R?.error)throw R.error;return c(x())}function qm(e,t,n){const a=v_(),s=y_(),p=Mu(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,k_(f),b_(f,s,m),S_(s);const c=!p.getQueryCache().get(f.queryHash),[x]=T.useState(()=>new t(p,f)),M=x.getOptimisticResult(f),C=!a&&h;if(T.useSyncExternalStore(T.useCallback(E=>{const R=C?x.subscribe(dn.batchCalls(E)):Qn;return x.updateResult(),R},[x,C]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),T.useEffect(()=>{x.setOptions(f)},[f,x]),jy(f,M))throw Py(f,x,s);if(x_({result:M,errorResetBoundary:s,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw M.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(f,M),f.experimental_prefetchInRender&&!ou.isServer()&&Gte(M,a)&&(c?Py(f,x,s):m?.promise)?.catch(Qn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?M:x.trackResult(M)}function Zte(e,t){return qm(e,wu,t)}function Kte(e,t){return qm({...e,enabled:!0,suspense:!0,throwOnError:x0,placeholderData:void 0},wu,t)}function Wte(e,t){return qm({...e,enabled:!0,suspense:!0,throwOnError:x0},d_,t)}function Yte(e,t){return w_({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:x0,enabled:!0,placeholderData:void 0}))},t)}function Xte(e,t){const n=Mu(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function Jte(e,t){const n=Mu(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function ene(e,t){const n=Mu(t),[a]=T.useState(()=>new Fte(n,e));T.useEffect(()=>{a.setOptions(e)},[a,e]);const s=T.useSyncExternalStore(T.useCallback(f=>a.subscribe(dn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p=T.useCallback((f,m)=>{a.mutate(f,m).catch(Qn)},[a]);if(s.error&&b0(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:p,mutateAsync:s.mutate}}function tne(e,t){return qm(e,d_,t)}var nne=Object.create,M_=Object.defineProperty,ane=Object.getOwnPropertyDescriptor,C_=Object.getOwnPropertyNames,ine=Object.getPrototypeOf,rne=Object.prototype.hasOwnProperty,eo=(e,t)=>function(){return t||(0,e[C_(e)[0]])((t={exports:{}}).exports,t),t.exports},one=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=C_(t),p=0,f=s.length,m;p<f;p++)m=s[p],!rne.call(e,m)&&m!==n&&M_(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=ane(t,m))||a.enumerable});return e},Vo=(e,t,n)=>(n=e!=null?nne(ine(e)):{},one(t||!e||!e.__esModule?M_(n,"default",{value:e,enumerable:!0}):n,e)),sne=eo({"../../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}}),lne=eo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=sne();function a(s,p){if(s==null)return{};var f,m,h=n(s,p);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(m=0;m<c.length;m++)f=c[m],p.includes(f)||{}.propertyIsEnumerable.call(s,f)&&(h[f]=s[f])}return h}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),A_=eo({"../../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}}),cne=eo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=A_().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}}),une=eo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=A_().default,a=cne();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}}),dne=eo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=une();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}}),Cu=eo({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=dne();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),pne=Vo(lne(),1),J2=Vo(Cu(),1);const mne=["cursor","direction"];function ki(e,t,n){const a=e.flatMap(s=>s.split("."));if(!t&&(!n||n==="any"))return a.length?[a]:[];if(n==="infinite"&&Fo(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:p}=t,f=(0,pne.default)(t,mne);return[a,{input:f,type:"infinite"}]}return[a,(0,J2.default)((0,J2.default)({},typeof t<"u"&&t!==Ra&&{input:t}),n&&n!=="any"&&{type:n})]}function _p(e){return ki(e,void 0,"any")}function fne(e){return Am(({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 $g;const hne=["client","ssrContext","ssrState","abortOnUnmount"],gne=($g=T.createContext)===null||$g===void 0?void 0:$g.call(vte,null),vne=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 yne(e){return Am(t=>{const n=[...t.path],a=n.pop(),s=[...t.args],p=s.shift(),f=vne(a),m=ki(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(_p(n),p),getMutationDefaults:()=>e.getMutationDefaults(_p(n)),isMutating:()=>e.isMutating({mutationKey:_p(n)})}[a]()})}function bne(e){const t=IE(e.client),n=yne(e);return bb(a=>{const s=a;return s==="client"?t:hne.includes(s)?e[s]:n[a]})}var Sne=Vo(Cu(),1);function eC(e){const t=e instanceof Em?e:xb(e);return Am(n=>{const a=n.path,s=a.join("."),[p,f]=n.args;return(0,Sne.default)({queryKey:ki(a,p,"query"),queryFn:()=>t.query(s,p,f?.trpc)},f)})}var Qg=Vo(Cu(),1);function ea(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,Qg.default)((0,Qg.default)((0,Qg.default)({},(f=p)!==null&&f!==void 0?f:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.join("."),p,t?.trpc]}var xne=eo({"../../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}}),kne=Vo(xne(),1);function Dy(e){return{path:e.path.join(".")}}function Cc(e){const t=Dy(e);return T.useMemo(()=>t,[t])}async function E_(e,t,n){const s=t.getQueryCache().build(t,{queryKey:n});s.setState({data:[],status:"success"});const p=[];var f=!1,m=!1,h;try{for(var c=(0,kne.default)(e),x;f=!(x=await c.next()).done;f=!1){const M=x.value;p.push(M),s.setState({data:[...p]})}}catch(M){m=!0,h=M}finally{try{f&&c.return!=null&&await c.return()}finally{if(m)throw h}}return p}var It=Vo(Cu(),1);function wne(e){const{client:t,queryClient:n}=e,a=t instanceof Em?t:xb(t);return{infiniteQueryOptions:(s,p,f)=>{var m,h;const c=((m=p[1])===null||m===void 0?void 0:m.input)===Ra,x=async M=>{var C;const E=(0,It.default)((0,It.default)({},f),{},{trpc:(0,It.default)((0,It.default)({},f?.trpc),!(f==null||(C=f.trpc)===null||C===void 0)&&C.abortOnUnmount?{signal:M.signal}:{signal:null})});return await a.query(...ea(p,E,{direction:M.direction,pageParam:M.pageParam}))};return Object.assign((0,It.default)((0,It.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:c?Ra:x,initialPageParam:(h=f?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:Dy({path:s})})},queryOptions:(s,p,f)=>{var m;const h=((m=p[1])===null||m===void 0?void 0:m.input)===Ra,c=async x=>{var M;const C=(0,It.default)((0,It.default)({},f),{},{trpc:(0,It.default)((0,It.default)({},f?.trpc),!(f==null||(M=f.trpc)===null||M===void 0)&&M.abortOnUnmount?{signal:x.signal}:{signal:null})}),E=await a.query(...ea(p,C));return fE(E)?E_(E,n,p):E};return Object.assign((0,It.default)((0,It.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:h?Ra:c}),{trpc:Dy({path:s})})},fetchQuery:(s,p)=>n.fetchQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...ea(s,p))})),fetchInfiniteQuery:(s,p)=>{var f;return n.fetchInfiniteQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...ea(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},prefetchQuery:(s,p)=>n.prefetchQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...ea(s,p))})),prefetchInfiniteQuery:(s,p)=>{var f;return n.prefetchInfiniteQuery((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...ea(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},ensureQueryData:(s,p)=>n.ensureQueryData((0,It.default)((0,It.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...ea(s,p))})),invalidateQueries:(s,p,f)=>n.invalidateQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),resetQueries:(s,p,f)=>n.resetQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),refetchQueries:(s,p,f)=>n.refetchQueries((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f),cancelQuery:(s,p)=>n.cancelQueries({queryKey:s},p),setQueryData:(s,p,f)=>n.setQueryData(s,p,f),setQueriesData:(s,p,f,m)=>n.setQueriesData((0,It.default)((0,It.default)({},p),{},{queryKey:s}),f,m),getQueryData:s=>n.getQueryData(s),setInfiniteQueryData:(s,p,f)=>n.setQueryData(s,p,f),getInfiniteQueryData:s=>n.getQueryData(s),setMutationDefaults:(s,p)=>{const f=s[0],m=h=>a.mutation(...ea([f,{input:h}],e));return n.setMutationDefaults(s,typeof p=="function"?p({canonicalMutationFn:m}):p)},getMutationDefaults:s=>n.getMutationDefaults(s),isMutating:s=>n.isMutating((0,It.default)((0,It.default)({},s),{},{exact:!0}))}}var _e=Vo(Cu());const tC=(e,t)=>new Proxy(e,{get(a,s){return t(s),a[s]}});function Mne(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:gne,p=Lv,f=Z=>{var ne;const{abortOnUnmount:V=!1,queryClient:U,ssrContext:pe}=Z,[we,ke]=T.useState((ne=Z.ssrState)!==null&&ne!==void 0?ne:!1),Ae=Z.client instanceof Em?Z.client:xb(Z.client),Ce=T.useMemo(()=>wne({client:Ae,queryClient:U}),[Ae,U]),Me=T.useMemo(()=>(0,_e.default)({abortOnUnmount:V,queryClient:U,client:Ae,ssrContext:pe??null,ssrState:we},Ce),[V,Ae,Ce,U,pe,we]);return T.useEffect(()=>{ke(Te=>Te?"mounted":!1)},[]),v.jsx(s.Provider,{value:Me,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,ne){var V;const{queryClient:U,ssrState:pe}=m();return pe&&pe!=="mounted"&&((V=U.getQueryCache().find({queryKey:Z}))===null||V===void 0?void 0:V.state.status)==="error"?(0,_e.default)({retryOnMount:!1},ne):ne}function c(Z,ne,V){var U,pe,we,ke,Ae;const Ce=m(),{abortOnUnmount:Me,client:Te,ssrState:B,queryClient:ue,prefetchQuery:ge}=Ce,Re=ki(Z,ne,"query"),fe=ue.getQueryDefaults(Re),q=ne===Ra;typeof window>"u"&&B==="prepass"&&(V==null||(U=V.trpc)===null||U===void 0?void 0:U.ssr)!==!1&&((pe=V?.enabled)!==null&&pe!==void 0?pe:fe?.enabled)!==!1&&!q&&!ue.getQueryCache().find({queryKey:Re})&&ge(Re,V);const ee=h(Re,(0,_e.default)((0,_e.default)({},fe),V)),X=(we=(ke=V==null||(Ae=V.trpc)===null||Ae===void 0?void 0:Ae.abortOnUnmount)!==null&&ke!==void 0?ke:void 0)!==null&&we!==void 0?we:Me,ye=Zte((0,_e.default)((0,_e.default)({},ee),{},{queryKey:Re,queryFn:q?ne:async te=>{const he=(0,_e.default)((0,_e.default)({},ee),{},{trpc:(0,_e.default)((0,_e.default)({},ee?.trpc),X?{signal:te.signal}:{signal:null})}),Be=await Te.query(...ea(Re,he));return fE(Be)?E_(Be,ue,Re):Be}}),ue);return ye.trpc=Cc({path:Z}),ye}function x(Z,ne,V){var U,pe,we;const ke=m(),Ae=ki(Z,ne,"query"),Ce=ne===Ra,Me=(U=(pe=V==null||(we=V.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&pe!==void 0?pe:void 0)!==null&&U!==void 0?U:ke.abortOnUnmount;Xte((0,_e.default)((0,_e.default)({},V),{},{queryKey:Ae,queryFn:Ce?ne:Te=>{const B={trpc:(0,_e.default)((0,_e.default)({},V?.trpc),Me?{signal:Te.signal}:{})};return ke.client.query(...ea(Ae,B))}}))}function M(Z,ne,V){var U,pe,we;const ke=m(),Ae=ki(Z,ne,"query"),Ce=(U=(pe=V==null||(we=V.trpc)===null||we===void 0?void 0:we.abortOnUnmount)!==null&&pe!==void 0?pe:void 0)!==null&&U!==void 0?U:ke.abortOnUnmount,Me=Kte((0,_e.default)((0,_e.default)({},V),{},{queryKey:Ae,queryFn:Te=>{const B=(0,_e.default)((0,_e.default)({},V),{},{trpc:(0,_e.default)((0,_e.default)({},V?.trpc),Ce?{signal:Te.signal}:{signal:null})});return ke.client.query(...ea(Ae,B))}}),ke.queryClient);return Me.trpc=Cc({path:Z}),[Me.data,Me]}function C(Z,ne){const{client:V,queryClient:U}=m(),pe=_p(Z),we=U.defaultMutationOptions(U.getMutationDefaults(pe)),ke=ene((0,_e.default)((0,_e.default)({},ne),{},{mutationKey:pe,mutationFn:Ae=>V.mutation(...ea([Z,{input:Ae}],ne)),onSuccess(...Ae){var Ce,Me;return a({originalFn:()=>{var B,ue,ge;return(B=ne==null||(ue=ne.onSuccess)===null||ue===void 0?void 0:ue.call(ne,...Ae))!==null&&B!==void 0?B:we==null||(ge=we.onSuccess)===null||ge===void 0?void 0:ge.call(we,...Ae)},queryClient:U,meta:(Ce=(Me=ne?.meta)!==null&&Me!==void 0?Me:we?.meta)!==null&&Ce!==void 0?Ce:{}})}}),U);return ke.trpc=Cc({path:Z}),ke}const E={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};function _(Z,ne,V){var U;const pe=(U=V?.enabled)!==null&&U!==void 0?U:ne!==Ra,we=Wr(ki(Z,ne,"any")),{client:ke}=m(),Ae=T.useRef(V);T.useEffect(()=>{Ae.current=V});const[Ce]=T.useState(new Set([])),Me=T.useCallback(q=>{Ce.add(q)},[Ce]),Te=T.useRef(null),B=T.useCallback(q=>{const ee=ge.current,X=ge.current=q(ee);let ye=!1;for(const te of Ce)if(ee[te]!==X[te]){ye=!0;break}ye&&fe(tC(X,Me))},[Me,Ce]),ue=T.useCallback(()=>{var q;if((q=Te.current)===null||q===void 0||q.unsubscribe(),!pe){B(()=>(0,_e.default)((0,_e.default)({},E),{},{reset:ue}));return}B(()=>(0,_e.default)((0,_e.default)({},R),{},{reset:ue}));const ee=ke.subscription(Z.join("."),ne??void 0,{onStarted:()=>{var X,ye;(X=(ye=Ae.current).onStarted)===null||X===void 0||X.call(ye),B(te=>(0,_e.default)((0,_e.default)({},te),{},{status:"pending",error:null}))},onData:X=>{var ye,te;(ye=(te=Ae.current).onData)===null||ye===void 0||ye.call(te,X),B(he=>(0,_e.default)((0,_e.default)({},he),{},{status:"pending",data:X,error:null}))},onError:X=>{var ye,te;(ye=(te=Ae.current).onError)===null||ye===void 0||ye.call(te,X),B(he=>(0,_e.default)((0,_e.default)({},he),{},{status:"error",error:X}))},onConnectionStateChange:X=>{B(ye=>{switch(X.state){case"idle":return(0,_e.default)((0,_e.default)({},ye),{},{status:X.state,error:null,data:void 0});case"connecting":return(0,_e.default)((0,_e.default)({},ye),{},{error:X.error,status:X.state});case"pending":return ye}})},onComplete:()=>{var X,ye;(X=(ye=Ae.current).onComplete)===null||X===void 0||X.call(ye),B(te=>(0,_e.default)((0,_e.default)({},te),{},{status:"idle",error:null,data:void 0}))}});Te.current=ee},[ke,we,pe,B]);T.useEffect(()=>(ue(),()=>{var q;(q=Te.current)===null||q===void 0||q.unsubscribe()}),[ue]);const ge=T.useRef(pe?(0,_e.default)((0,_e.default)({},R),{},{reset:ue}):(0,_e.default)((0,_e.default)({},E),{},{reset:ue})),[Re,fe]=T.useState(tC(ge.current,Me));return Re}function j(Z,ne,V){var U,pe,we,ke,Ae;const{client:Ce,ssrState:Me,prefetchInfiniteQuery:Te,queryClient:B,abortOnUnmount:ue}=m(),ge=ki(Z,ne,"infinite"),Re=B.getQueryDefaults(ge),fe=ne===Ra;typeof window>"u"&&Me==="prepass"&&(V==null||(U=V.trpc)===null||U===void 0?void 0:U.ssr)!==!1&&((pe=V?.enabled)!==null&&pe!==void 0?pe:Re?.enabled)!==!1&&!fe&&!B.getQueryCache().find({queryKey:ge})&&Te(ge,(0,_e.default)((0,_e.default)({},Re),V));const q=h(ge,(0,_e.default)((0,_e.default)({},Re),V)),ee=(we=V==null||(ke=V.trpc)===null||ke===void 0?void 0:ke.abortOnUnmount)!==null&&we!==void 0?we:ue,X=tne((0,_e.default)((0,_e.default)({},q),{},{initialPageParam:(Ae=V.initialCursor)!==null&&Ae!==void 0?Ae:null,persister:V.persister,queryKey:ge,queryFn:fe?ne:ye=>{var te;const he=(0,_e.default)((0,_e.default)({},q),{},{trpc:(0,_e.default)((0,_e.default)({},q?.trpc),ee?{signal:ye.signal}:{signal:null})});return Ce.query(...ea(ge,he,{pageParam:(te=ye.pageParam)!==null&&te!==void 0?te:V.initialCursor,direction:ye.direction}))}}),B);return X.trpc=Cc({path:Z}),X}function D(Z,ne,V){var U,pe,we;const ke=m(),Ae=ki(Z,ne,"infinite"),Ce=ke.queryClient.getQueryDefaults(Ae),Me=ne===Ra,Te=h(Ae,(0,_e.default)((0,_e.default)({},Ce),V)),B=(U=V==null||(pe=V.trpc)===null||pe===void 0?void 0:pe.abortOnUnmount)!==null&&U!==void 0?U:ke.abortOnUnmount;Jte((0,_e.default)((0,_e.default)({},V),{},{initialPageParam:(we=V.initialCursor)!==null&&we!==void 0?we:null,queryKey:Ae,queryFn:Me?ne:ue=>{var ge;const Re=(0,_e.default)((0,_e.default)({},Te),{},{trpc:(0,_e.default)((0,_e.default)({},Te?.trpc),B?{signal:ue.signal}:{})});return ke.client.query(...ea(Ae,Re,{pageParam:(ge=ue.pageParam)!==null&&ge!==void 0?ge:V.initialCursor,direction:ue.direction}))}}))}function z(Z,ne,V){var U,pe,we;const ke=m(),Ae=ki(Z,ne,"infinite"),Ce=ke.queryClient.getQueryDefaults(Ae),Me=h(Ae,(0,_e.default)((0,_e.default)({},Ce),V)),Te=(U=V==null||(pe=V.trpc)===null||pe===void 0?void 0:pe.abortOnUnmount)!==null&&U!==void 0?U:ke.abortOnUnmount,B=Wte((0,_e.default)((0,_e.default)({},V),{},{initialPageParam:(we=V.initialCursor)!==null&&we!==void 0?we:null,queryKey:Ae,queryFn:ue=>{var ge;const Re=(0,_e.default)((0,_e.default)({},Me),{},{trpc:(0,_e.default)((0,_e.default)({},Me?.trpc),Te?{signal:ue.signal}:{})});return ke.client.query(...ea(Ae,Re,{pageParam:(ge=ue.pageParam)!==null&&ge!==void 0?ge:V.initialCursor,direction:ue.direction}))}}),ke.queryClient);return B.trpc=Cc({path:Z}),[B.data,B]}return{Provider:f,createClient:p,useContext:m,useUtils:m,useQuery:c,usePrefetchQuery:x,useSuspenseQuery:M,useQueries:(Z,ne)=>{const{ssrState:V,queryClient:U,prefetchQuery:pe,client:we}=m(),ke=eC(we),Ae=Z(ke);if(typeof window>"u"&&V==="prepass")for(const Me of Ae){var Ce;const Te=Me;((Ce=Te.trpc)===null||Ce===void 0?void 0:Ce.ssr)!==!1&&!U.getQueryCache().find({queryKey:Te.queryKey})&&pe(Te.queryKey,Te)}return w_({queries:Ae.map(Me=>(0,_e.default)((0,_e.default)({},Me),{},{queryKey:Me.queryKey})),combine:ne?.combine},U)},useSuspenseQueries:Z=>{const{queryClient:ne,client:V}=m(),U=eC(V),pe=Z(U),we=Yte({queries:pe.map(ke=>(0,_e.default)((0,_e.default)({},ke),{},{queryFn:ke.queryFn,queryKey:ke.queryKey}))},ne);return[we.map(ke=>ke.data),we]},useMutation:C,useSubscription:_,useInfiniteQuery:j,usePrefetchInfiniteQuery:D,useSuspenseInfiniteQuery:z}}function Cne(e){const t=fne(e);return bb(n=>n==="useContext"||n==="useUtils"?()=>{const a=e.useUtils();return T.useMemo(()=>bne(a),[a])}:e.hasOwnProperty(n)?e[n]:t[n])}function Ane(e){const t=Mne();return Cne(t)}cE();var Vg={};var R_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();var Ene=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Rne=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());var nC=e=>{const t=Rne(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ine={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 Tne=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var _ne=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,...Ine,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:R_("lucide",s),...!p&&!Tne(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));var G=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(_ne,{ref:p,iconNode:t,className:R_(`lucide-${Ene(nC(e))}`,`lucide-${e}`,a),...s}));return n.displayName=nC(e),n};var I_=G("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 Nne=G("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 One=G("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"}]]);G("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"}]]);G("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);G("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);G("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);G("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"}]]);G("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var jne=G("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 zy=G("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var Pne=G("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"}]]);G("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"}]]);G("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 cm=G("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 Dne=G("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"}]]);G("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 Gg=G("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 um=G("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 aC=G("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 iC=G("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 zne=G("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 Lne=G("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 qne=G("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 rC=G("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"}]]);G("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 Bne=G("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"}]]);G("cable",[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]);var Fne=G("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 Zg=G("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"}]]);G("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 oC=G("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 T_=G("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Go=G("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);G("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var Une=G("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Bm=G("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);G("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);G("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);G("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"}]]);G("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 Hne=G("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var __=G("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);G("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"}]]);G("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);G("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 $ne=G("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);G("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 sC=G("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var Qne=G("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 Vne=G("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 N_=G("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 lC=G("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 O_=G("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 Gne=G("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 Zne=G("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"}]]);G("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"}]]);G("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"}]]);G("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 j_=G("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"}]]);G("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 cC=G("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 Kne=G("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 hl=G("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 P_=G("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 k0=G("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 wl=G("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"}]]);G("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"}]]);G("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 Wne=G("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"}]]);G("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var dm=G("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 Yne=G("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"}]]);G("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 pm=G("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"}]]);G("flashlight-off",[["path",{d:"M11.652 6H18",key:"voqkpr"}],["path",{d:"M12 13v1",key:"176q98"}],["path",{d:"M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6",key:"dzyf92"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007",key:"1hvcfn"}]]);var Xne=G("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 Jne=G("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 D_=G("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"}]]);G("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"}]]);G("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 Np=G("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var Ove=G("grid-2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);G("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 eae=G("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"}]]);G("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);G("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 tae=G("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 Fm=G("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 z_=G("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 nae=G("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"}]]);G("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"}]]);G("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 aae=G("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"}]]);G("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 iae=G("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 Um=G("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"}]]);G("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 rae=G("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 oae=G("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 w0=G("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);G("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 Ly=G("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=G("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 sae=G("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 lae=G("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"}]]);G("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 L_=G("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"}]]);G("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var q_=G("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 jve=G("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"}]]);G("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"}]]);G("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var cae=G("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 M0=G("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 B_=G("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 uae=G("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 dae=G("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"}]]);G("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 F_=G("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 pae=G("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var mae=G("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 fae=G("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 Eu=G("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 Aa=G("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"}]]);G("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 hae=G("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 gae=G("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 vae=G("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 Zo=G("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"}]]);G("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);G("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"}]]);G("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=G("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);G("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 U_=G("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"}]]);G("radio-tower",[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]);var yae=G("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var C0=G("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 bae=G("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"}]]);G("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 Sae=G("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"}]]);G("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"}]]);G("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 xae=G("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"}]]);G("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);G("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"}]]);G("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"}]]);G("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 Hm=G("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 kae=G("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 wae=G("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 Mae=G("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"}]]);G("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 mm=G("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 Cae=G("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 Aae=G("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 A0=G("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 Eae=G("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var H_=G("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 $_=G("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 Rae=G("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 Iu=G("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);G("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 Iae=G("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 Q_=G("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 Tae=G("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"}]]);var V_=G("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"}]]);G("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 $m=G("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var qy=G("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 _ae=G("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 Nae=G("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 Oae=G("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 jae=G("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"}]]);G("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);G("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var gl=G("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 Pae=G("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 Dae=G("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"}]]);G("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);G("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]);G("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 zae=G("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 Lae=G("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 qae=G("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 uC=G("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 G_=G("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 Tu=G("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 Z_=G("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 Bae=G("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"}]]);G("wifi-high",[["path",{d:"M12 20h.01",key:"zekei9"}],["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"}]]);G("wifi-low",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var dC=G("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"}]]);G("wifi-zero",[["path",{d:"M12 20h.01",key:"zekei9"}]]);var Fae=G("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 or=G("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 Uae=G("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"}]]);G("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 Hae=G("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Qr=G("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 $ae=G("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 Qae=G("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"}]]),K_=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,y=K_??Ane();typeof globalThis<"u"&&!K_&&(globalThis.__camstackTrpcReact=y);function Ai(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 W_=Ai("camstack:system",null);function Y_({system:e,children:t}){return v.jsx(W_.Provider,{value:e,children:t})}function Vae(){const e=T.useContext(W_);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function Mi(e,t){const n=Vae(),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.attachDevice.useMutation;y.audioAnalyzer.detachDevice.useMutation;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.listRuns.useQuery;y.backup.cancel.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.cameraGridLayout.getLayout.useQuery;y.cameraGridLayout.saveLayout.useMutation;y.cameraGridLayout.getDeviceSettingsContribution.useQuery;y.cameraGridLayout.getDeviceLiveContribution.useQuery;y.cameraGridLayout.applyDeviceSettingsPatch.useMutation;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.migrateDevice.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 X_=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.listLocationIcons.useQuery;y.deviceManager.setLocationIcon.useMutation;y.deviceManager.listLocationDescriptions.useQuery;y.deviceManager.setLocationDescription.useMutation;y.deviceManager.listSiteZones.useQuery;y.deviceManager.setSiteZone.useMutation;y.deviceManager.removeSiteZone.useMutation;y.deviceManager.renameSiteZone.useMutation;y.deviceManager.setLocationZone.useMutation;y.deviceManager.setDisabled.useMutation;y.deviceManager.listPersistedByAddon.useQuery;y.deviceManager.listAll.useQuery;var J_=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.reloadDevice.useMutation;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.auditIdentitySamples.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 Gae=y.intercom.startSession.useMutation,Zae=y.intercom.handleAnswer.useMutation,Kae=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.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.getOptions.useQuery;y.nativeObjectDetection.setSettings.useMutation;y.nativeObjectDetection.setEnabled.useMutation;y.nativeObjectDetection.getStatus.useQuery;y.navigation.move.useMutation;y.navigation.stop.useMutation;y.navigation.goToPoint.useMutation;y.navigation.listActions.useQuery;y.navigation.runAction.useMutation;y.navigation.playSound.useMutation;y.navigation.setLightOn.useMutation;y.navigation.setLightMode.useMutation;y.navigation.setLightLevel.useMutation;y.navigation.getFeatures.useQuery;y.navigation.getStatus.useQuery;y.networkAccess.start.useMutation;y.networkAccess.stop.useMutation;y.networkAccess.getEndpoint.useQuery;y.networkAccess.getStatus.useQuery;y.networkAccess.listEndpoints.useQuery;y.networkLink.getStatus.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.getClipRetentionAsks.useQuery;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.listSummaries.useQuery;y.pipelineAnalytics.listRecentSummaries.useQuery;y.pipelineAnalytics.getSummary.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.readLongTermSeries.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.listArchivedDebugNotes.useQuery;y.pipelineAnalytics.listBirthDecisions.useQuery;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.setAgentDecodeLimits.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.requestOccupancyBurst.useMutation;y.pipelineRunner.getNativeCrop.useQuery;y.pipelineRunner.runDetailSubtree.useMutation;y.pipelineRunner.runStatelessStep.useMutation;y.pipelineRunner.parkTrackFrame.useMutation;y.pipelineRunner.getParkedTrackFrame.useQuery;y.pipelineRunner.releaseParkedTrackFrames.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.getHomePreset.useQuery;y.ptz.setHomePreset.useMutation;y.ptz.captureHomeHere.useMutation;y.ptz.getHomeReturn.useQuery;y.ptz.setHomeReturn.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.recordingSignal.getStatus.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.upsert.useMutation;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.listLocationDeclarations.useQuery;y.storage.upsertLocation.useMutation;y.storage.deleteLocation.useMutation;y.storage.listDrainProgress.useQuery;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.reportStreamSignal.useMutation;y.streamBroker.publishCameraStream.useMutation;y.streamBroker.retractCameraStream.useMutation;y.streamBroker.assignProfile.useMutation;y.streamBroker.unassignProfile.useMutation;y.streamBroker.forgetDeviceHardware.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.streamSignals.listSignals.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.webrtcSession.getSessionDebug.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;function eN(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=eN(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function tN(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=eN(e))&&(a&&(a+=" "),a+=t);return a}var Wae=(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},Yae=(e,t)=>({classGroupId:e,validator:t}),nN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fm="-",pC=[],Xae="arbitrary..",Jae=e=>{const t=tie(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return eie(f);const m=f.split(fm);return aN(m,m[0]===""&&m.length>1?1:0,t)},getConflictingClassGroupIds:(f,m)=>{if(m){const h=a[f],c=n[f];return h?c?Wae(c,h):h:c||pC}return n[f]||pC}}},aN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=aN(e,t+1,s);if(h)return h}const p=n.validators;if(p===null)return;const f=t===0?e.join(fm):e.slice(t).join(fm),m=p.length;for(let h=0;h<m;h++){const c=p[h];if(c.validator(f))return c.classGroupId}},eie=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?Xae+a:void 0})(),tie=e=>{const{theme:t,classGroups:n}=e;return nie(n,t)},nie=(e,t)=>{const n=nN();for(const a in e){const s=e[a];E0(s,n,a,t)}return n},E0=(e,t,n,a)=>{const s=e.length;for(let p=0;p<s;p++){const f=e[p];aie(f,t,n,a)}},aie=(e,t,n,a)=>{if(typeof e=="string"){iie(e,t,n);return}if(typeof e=="function"){rie(e,t,n,a);return}oie(e,t,n,a)},iie=(e,t,n)=>{const a=e===""?t:iN(t,e);a.classGroupId=n},rie=(e,t,n,a)=>{if(sie(e)){E0(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Yae(n,e))},oie=(e,t,n,a)=>{const s=Object.entries(e),p=s.length;for(let f=0;f<p;f++){const[m,h]=s[f];E0(h,iN(t,m),n,a)}},iN=(e,t)=>{let n=e;const a=t.split(fm),s=a.length;for(let p=0;p<s;p++){const f=a[p];let m=n.nextPart.get(f);m||(m=nN(),n.nextPart.set(f,m)),n=m}return n},sie=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lie=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)}}},By="!",mC=":",cie=[],fC=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),uie=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const p=[];let f=0,m=0,h=0,c;const x=s.length;for(let _=0;_<x;_++){const j=s[_];if(f===0&&m===0){if(j===mC){p.push(s.slice(h,_)),h=_+1;continue}if(j==="/"){c=_;continue}}j==="["?f++:j==="]"?f--:j==="("?m++:j===")"&&m--}const M=p.length===0?s:s.slice(h);let C=M,E=!1;M.endsWith(By)?(C=M.slice(0,-1),E=!0):M.startsWith(By)&&(C=M.slice(1),E=!0);const R=c&&c>h?c-h:void 0;return fC(p,E,C,R)};if(t){const s=t+mC,p=a;a=f=>f.startsWith(s)?p(f.slice(s.length)):fC(cie,!1,f,void 0,!0)}if(n){const s=a;a=p=>n({className:p,parseClassName:s})}return a},die=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}},pie=e=>({cache:lie(e.cacheSize),parseClassName:uie(e),sortModifiers:die(e),postfixLookupClassGroupIds:mie(e),...Jae(e)}),mie=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},fie=/\s+/,hie=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:p,postfixLookupClassGroupIds:f}=t,m=[],h=e.trim().split(fie);let c="";for(let x=h.length-1;x>=0;x-=1){const M=h[x],{isExternal:C,modifiers:E,hasImportantModifier:R,baseClassName:_,maybePostfixModifierPosition:j}=n(M);if(C){c=M+(c.length>0?" "+c:c);continue}let D=!!j,z;if(D){z=a(_.substring(0,j));const V=z&&f[z]?a(_):void 0;V&&V!==z&&(z=V,D=!1)}else z=a(_);if(!z){if(!D){c=M+(c.length>0?" "+c:c);continue}if(z=a(_),!z){c=M+(c.length>0?" "+c:c);continue}D=!1}const F=E.length===0?"":E.length===1?E[0]:p(E).join(":"),L=R?F+By:F,Z=L+z;if(m.indexOf(Z)>-1)continue;m.push(Z);const ne=s(z,D);for(let V=0;V<ne.length;++V){const U=ne[V];m.push(L+U)}c=M+(c.length>0?" "+c:c)}return c},gie=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=rN(n))&&(s&&(s+=" "),s+=a);return s},rN=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=rN(e[a]))&&(n&&(n+=" "),n+=t);return n},vie=(e,...t)=>{let n,a,s,p;const f=h=>(n=pie(t.reduce((c,x)=>x(c),e())),a=n.cache.get,s=n.cache.set,p=m,m(h)),m=h=>{const c=a(h);if(c)return c;const x=hie(h,n);return s(h,x),x};return p=f,(...h)=>p(gie(...h))},yie=[],On=e=>{const t=n=>n[e]||yie;return t.isThemeGetter=!0,t},oN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Sie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xie=/\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$/,kie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qr=e=>bie.test(e),pt=e=>!!e&&!Number.isNaN(Number(e)),bi=e=>!!e&&Number.isInteger(Number(e)),Kg=e=>e.endsWith("%")&&pt(e.slice(0,-1)),Ji=e=>Sie.test(e),lN=()=>!0,Cie=e=>xie.test(e)&&!kie.test(e),R0=()=>!1,Aie=e=>wie.test(e),Eie=e=>Mie.test(e),Rie=e=>!je(e)&&!Pe(e),Iie=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)),Tie=e=>to(e,dN,R0),je=e=>oN.test(e),Co=e=>to(e,pN,Cie),hC=e=>to(e,Lie,pt),_ie=e=>to(e,fN,lN),Nie=e=>to(e,mN,R0),gC=e=>to(e,cN,R0),Oie=e=>to(e,uN,Eie),ip=e=>to(e,hN,Aie),Pe=e=>sN.test(e),Ac=e=>Ko(e,pN),jie=e=>Ko(e,mN),vC=e=>Ko(e,cN),Pie=e=>Ko(e,dN),Die=e=>Ko(e,uN),rp=e=>Ko(e,hN,!0),zie=e=>Ko(e,fN,!0),to=(e,t,n)=>{const a=oN.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Ko=(e,t,n=!1)=>{const a=sN.exec(e);return a?a[1]?t(a[1]):n:!1},cN=e=>e==="position"||e==="percentage",uN=e=>e==="image"||e==="url",dN=e=>e==="length"||e==="size"||e==="bg-size",pN=e=>e==="length",Lie=e=>e==="number",mN=e=>e==="family-name",fN=e=>e==="number"||e==="weight",hN=e=>e==="shadow",qie=()=>{const e=On("color"),t=On("font"),n=On("text"),a=On("font-weight"),s=On("tracking"),p=On("leading"),f=On("breakpoint"),m=On("container"),h=On("spacing"),c=On("radius"),x=On("shadow"),M=On("inset-shadow"),C=On("text-shadow"),E=On("drop-shadow"),R=On("blur"),_=On("perspective"),j=On("aspect"),D=On("ease"),z=On("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Z=()=>[...L(),Pe,je],ne=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],U=()=>[Pe,je,h],pe=()=>[qr,"full","auto",...U()],we=()=>[bi,"none","subgrid",Pe,je],ke=()=>["auto",{span:["full",bi,Pe,je]},bi,Pe,je],Ae=()=>[bi,"auto",Pe,je],Ce=()=>["auto","min","max","fr",Pe,je],Me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Te=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...U()],ue=()=>[qr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ge=()=>[qr,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Re=()=>[qr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],fe=()=>[e,Pe,je],q=()=>[...L(),vC,gC,{position:[Pe,je]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",Pie,Tie,{size:[Pe,je]}],ye=()=>[Kg,Ac,Co],te=()=>["","none","full",c,Pe,je],he=()=>["",pt,Ac,Co],Be=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[pt,Kg,vC,gC],Ee=()=>["","none",R,Pe,je],nt=()=>["none",pt,Pe,je],Ye=()=>["none",pt,Pe,je],St=()=>[pt,Pe,je],Le=()=>[qr,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ji],breakpoint:[Ji],color:[lN],container:[Ji],"drop-shadow":[Ji],ease:["in","out","in-out"],font:[Rie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ji],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ji],shadow:[Ji],spacing:["px",pt],text:[Ji],"text-shadow":[Ji],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qr,je,Pe,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Pe,je]}],"container-named":[Iie],columns:[{columns:[pt,je,Pe,m]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:ne()}],"overflow-x":[{"overflow-x":ne()}],"overflow-y":[{"overflow-y":ne()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[bi,"auto",Pe,je]}],basis:[{basis:[qr,"full","auto",m,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,qr,"auto","initial","none",je]}],grow:[{grow:["",pt,Pe,je]}],shrink:[{shrink:["",pt,Pe,je]}],order:[{order:[bi,"first","last","none",Pe,je]}],"grid-cols":[{"grid-cols":we()}],"col-start-end":[{col:ke()}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":we()}],"row-start-end":[{row:ke()}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ce()}],"auto-rows":[{"auto-rows":Ce()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Me(),"normal"]}],"justify-items":[{"justify-items":[...Te(),"normal"]}],"justify-self":[{"justify-self":["auto",...Te()]}],"align-content":[{content:["normal",...Me()]}],"align-items":[{items:[...Te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Te(),{baseline:["","last"]}]}],"place-content":[{"place-content":Me()}],"place-items":[{"place-items":[...Te(),"baseline"]}],"place-self":[{"place-self":["auto",...Te()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ue()}],"inline-size":[{inline:["auto",...ge()]}],"min-inline-size":[{"min-inline":["auto",...ge()]}],"max-inline-size":[{"max-inline":["none",...ge()]}],"block-size":[{block:["auto",...Re()]}],"min-block-size":[{"min-block":["auto",...Re()]}],"max-block-size":[{"max-block":["none",...Re()]}],w:[{w:[m,"screen",...ue()]}],"min-w":[{"min-w":[m,"screen","none",...ue()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...ue()]}],h:[{h:["screen","lh",...ue()]}],"min-h":[{"min-h":["screen","lh","none",...ue()]}],"max-h":[{"max-h":["screen","lh",...ue()]}],"font-size":[{text:["base",n,Ac,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,zie,_ie]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kg,je]}],"font-family":[{font:[jie,Nie,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":[pt,"none",Pe,hC]}],leading:[{leading:[p,...U()]}],"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:fe()}],"text-color":[{text:fe()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Be(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Pe,Co]}],"text-decoration-color":[{decoration:fe()}],"underline-offset":[{"underline-offset":[pt,"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:U()}],"tab-size":[{tab:[bi,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:q()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bi,Pe,je],radial:["",Pe,je],conic:[bi,Pe,je]},Die,Oie]}],"bg-color":[{bg:fe()}],"gradient-from-pos":[{from:ye()}],"gradient-via-pos":[{via:ye()}],"gradient-to-pos":[{to:ye()}],"gradient-from":[{from:fe()}],"gradient-via":[{via:fe()}],"gradient-to":[{to:fe()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Be(),"hidden","none"]}],"divide-style":[{divide:[...Be(),"hidden","none"]}],"border-color":[{border:fe()}],"border-color-x":[{"border-x":fe()}],"border-color-y":[{"border-y":fe()}],"border-color-s":[{"border-s":fe()}],"border-color-e":[{"border-e":fe()}],"border-color-bs":[{"border-bs":fe()}],"border-color-be":[{"border-be":fe()}],"border-color-t":[{"border-t":fe()}],"border-color-r":[{"border-r":fe()}],"border-color-b":[{"border-b":fe()}],"border-color-l":[{"border-l":fe()}],"divide-color":[{divide:fe()}],"outline-style":[{outline:[...Be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Pe,je]}],"outline-w":[{outline:["",pt,Ac,Co]}],"outline-color":[{outline:fe()}],shadow:[{shadow:["","none",x,rp,ip]}],"shadow-color":[{shadow:fe()}],"inset-shadow":[{"inset-shadow":["none",M,rp,ip]}],"inset-shadow-color":[{"inset-shadow":fe()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:fe()}],"ring-offset-w":[{"ring-offset":[pt,Co]}],"ring-offset-color":[{"ring-offset":fe()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":fe()}],"text-shadow":[{"text-shadow":["none",C,rp,ip]}],"text-shadow-color":[{"text-shadow":fe()}],opacity:[{opacity:[pt,Pe,je]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"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":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":fe()}],"mask-image-linear-to-color":[{"mask-linear-to":fe()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":fe()}],"mask-image-t-to-color":[{"mask-t-to":fe()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":fe()}],"mask-image-r-to-color":[{"mask-r-to":fe()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":fe()}],"mask-image-b-to-color":[{"mask-b-to":fe()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":fe()}],"mask-image-l-to-color":[{"mask-l-to":fe()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":fe()}],"mask-image-x-to-color":[{"mask-x-to":fe()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":fe()}],"mask-image-y-to-color":[{"mask-y-to":fe()}],"mask-image-radial":[{"mask-radial":[Pe,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":fe()}],"mask-image-radial-to-color":[{"mask-radial-to":fe()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":L()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":fe()}],"mask-image-conic-to-color":[{"mask-conic-to":fe()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,je]}],filter:[{filter:["","none",Pe,je]}],blur:[{blur:Ee()}],brightness:[{brightness:[pt,Pe,je]}],contrast:[{contrast:[pt,Pe,je]}],"drop-shadow":[{"drop-shadow":["","none",E,rp,ip]}],"drop-shadow-color":[{"drop-shadow":fe()}],grayscale:[{grayscale:["",pt,Pe,je]}],"hue-rotate":[{"hue-rotate":[pt,Pe,je]}],invert:[{invert:["",pt,Pe,je]}],saturate:[{saturate:[pt,Pe,je]}],sepia:[{sepia:["",pt,Pe,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,je]}],"backdrop-blur":[{"backdrop-blur":Ee()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Pe,je]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Pe,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Pe,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Pe,je]}],"backdrop-invert":[{"backdrop-invert":["",pt,Pe,je]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Pe,je]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Pe,je]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Pe,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Pe,je]}],ease:[{ease:["linear","initial",D,Pe,je]}],delay:[{delay:[pt,Pe,je]}],animate:[{animate:["none",z,Pe,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Pe,je]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:nt()}],"rotate-x":[{"rotate-x":nt()}],"rotate-y":[{"rotate-y":nt()}],"rotate-z":[{"rotate-z":nt()}],scale:[{scale:Ye()}],"scale-x":[{"scale-x":Ye()}],"scale-y":[{"scale-y":Ye()}],"scale-z":[{"scale-z":Ye()}],"scale-3d":["scale-3d"],skew:[{skew:St()}],"skew-x":[{"skew-x":St()}],"skew-y":[{"skew-y":St()}],transform:[{transform:[Pe,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[bi,Pe,je]}],accent:[{accent:fe()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:fe()}],"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":fe()}],"scrollbar-track-color":[{"scrollbar-track":fe()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,je]}],fill:[{fill:["none",...fe()]}],"stroke-w":[{stroke:[pt,Ac,Co,hC]}],stroke:[{stroke:["none",...fe()]}],"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"]}},Bie=vie(qie);function se(...e){return Bie(tN(e))}T.createContext(null);Ai("camstack:custom-field-renderers",{});var yC={motion:I_,audio:Tu,person:Lae,vehicle:Zg,animal:Aa,package:fae,sensor:yae,control:A0,car:Zg,truck:Pae,bus:Bne,motorcycle:aC,bicycle:aC,airplane:vae,boat:Sae,train:Oae,bird:iC,cat:oC,dog:cC,horse:Aa,sheep:Aa,cow:Aa,elephant:Aa,bear:Aa,zebra:Aa,giraffe:Aa,door:hl,pir:U_,smoke:pm,water:k0,gas:or,vibration:G_,tamper:Hm,presence:zae,generic:V_,lock:Au,siren:mm,switch:_ae,doorbell:Gg,button:__,"audio-speech":q_,"audio-scream":L_,"audio-crying":jne,"audio-laughter":aae,"audio-music":F_,"audio-dog":cC,"audio-cat":oC,"audio-bird":iC,"audio-animal":Aa,"audio-alarm":Gg,"audio-doorbell":Gg,"audio-glass_breaking":gl,"audio-gunshot":j_,"audio-vehicle":Zg,"audio-siren":mm,"audio-fire":pm,"audio-water":wl,"audio-wind":or,"audio-door":hl,"audio-footsteps":D_,"audio-crowd":qae,"audio-telephone":hae,"audio-engine":Zne,"audio-tools":eae,"audio-silence":Z_};function bC(e){return Object.hasOwn(yC,e)?yC[e]:e.startsWith("audio-")?Tu:V_}Ai("camstack:confirm-dialog",null);Ai("camstack:device-context",null);var Fie="FEDERATION_DEBUG",Fy=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),no=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function gN(){return no}function vN(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function Uie(){try{if(gN()&&window.localStorage)return!!localStorage.getItem(Fie)}catch{return!1}return!1}function Uy(){return typeof process<"u"&&Vg&&Vg.FEDERATION_DEBUG?!!Vg.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Uie()}var Hie="[ Federation Runtime ]",yN=function(...e){return e.length?e.reduce((t,n)=>n?t?`${t}:${n}`:n:t,""):""},Hy=(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?!gN()&&!vN()&&"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),"")},bN=e=>{console.warn(`${Hie}: ${e}`)};function SN(e){try{return JSON.stringify(e,null,2)}catch{return""}}var Wg=(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 $ie(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Qie(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?$ie(s):e.metaData.publicPath:e.metaData.getPublicPath,m=Object.keys(a);let h={};Object.keys(n).length||(h=e.remotes?.reduce((z,F)=>{let L;const Z=F.federationContainerName;return m.includes(Z)?L=a[Z]:"version"in F?L=F.version:L=F.entry,z[Z]={matchedVersion:L},z},{})||{}),Object.keys(n).forEach(z=>h[z]={matchedVersion:m.includes(z)?a[z]:n[z]});const{remoteEntry:{path:c,name:x,type:M},types:C={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:E},globalName:R,ssrRemoteEntry:_}=e.metaData,{exposes:j}=e;let D={version:s||"",buildVersion:E,globalName:R,remoteEntry:Wg(c,x),remoteEntryType:M,remoteTypes:Wg(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()},_){const z=Wg(_.path,_.name);p.ssrRemoteEntry=z,p.ssrRemoteEntryType=_.type||"commonjs-module"}return p}function xN(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Vie="[ Module Federation ]",Ec=console,Gie=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Zie(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
75
+ `),n=t.filter(a=>!Gie.some(s=>a.includes(s)));return n.length?`Stack trace:
76
+ ${n.slice(0,5).join(`
77
+ `)}`:void 0}catch{return}}var kN=class{constructor(e,t=Ec){this.prefix=e,this.delegate=t??Ec}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Ec}emit(e,t){const n=this.delegate,a=Uy()?Zie():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=Ec[f];if(typeof m=="function"){m.call(Ec,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){Uy()&&this.emit("debug",e)}};function Kie(e){return new kN(e)}function Wie(e){const t=new kN(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Wie(Vie);async function wN(e,t){try{return await e()}catch(n){bN(n);return}}function $y(e,t){const n=/^(https?:)?\/\//i;return e.replace(n,"").replace(/\/$/,"")===t.replace(n,"").replace(/\/$/,"")}function MN(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("script");for(let c=0;c<p.length;c++){const x=p[c],M=x.getAttribute("src");if(M&&$y(M,e.url)){t=x,n=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=c?.type==="module"?"module":"text/javascript";let x;e.createScriptHook&&(x=e.createScriptHook(e.url,e.attrs),x instanceof HTMLScriptElement?t=x:typeof x=="object"&&("script"in x&&x.script&&(t=x.script),"timeout"in x&&x.timeout&&(a=x.timeout))),t.src||(t.src=e.url),c&&!x&&Object.keys(c).forEach(M=>{t&&(M==="async"||M==="defer"?t[M]=c[M]:t.getAttribute(M)||t.setAttribute(M,c[M]))})}let f=null;const m=typeof window<"u"?c=>{if(c.filename&&$y(c.filename,e.url)){const x=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);x.name="ScriptExecutionError",f=x}}:null;m&&window.addEventListener("error",m);const h=async(c,x)=>{clearTimeout(s),m&&window.removeEventListener("error",m);const M=()=>{if(x?.type==="error"){const C=new Error(x?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);C.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(C)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,wN(()=>{const{needDeleteScript:C=!0}=e;C&&t?.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const C=c(x);if(C instanceof Promise){const E=await C;return M(),E}return M(),C}M()};return t.onerror=h.bind(null,t.onerror),t.onload=h.bind(null,t.onload),s=setTimeout(()=>{h(null,{type:"error",isTimeout:!0})},a),{script:t,needAttach:n}}function Yie(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("link");for(let m=0;m<p.length;m++){const h=p[m],c=h.getAttribute("href"),x=h.getAttribute("rel");if(c&&$y(c,e.url)&&x===e.attrs.rel){t=h,n=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let m,h=!0;const c=e.attrs;e.createLinkHook&&(m=e.createLinkHook(e.url,c),m instanceof HTMLLinkElement?(t=m,h=!1):typeof m=="object"&&("link"in m&&m.link&&(t=m.link,h=!1),"timeout"in m&&m.timeout&&(a=m.timeout))),c&&h&&Object.keys(c).forEach(x=>{t&&!t.getAttribute(x)&&t.setAttribute(x,c[x])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};const f=(m,h)=>{s&&clearTimeout(s);const c=()=>{if(h?.type==="error"){const x=new Error(h?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);x.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(x)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,wN(()=>{const{needDeleteLink:x=!0}=e;x&&t?.parentNode&&t.parentNode.removeChild(t)}),m)){const x=m(h);return c(),x}c()};return t.onerror=f.bind(null,t.onerror),t.onload=f.bind(null,t.onload),s=setTimeout(()=>{f(null,{type:"error",isTimeout:!0})},a),{link:t,needAttach:n}}function Xie(e,t){const{attrs:n={},createScriptHook:a}=t;return new Promise((s,p)=>{const{script:f,needAttach:m}=MN({url:e,cb:s,onErrorCallback:p,attrs:{fetchpriority:"high",...n},createScriptHook:a,needDeleteScript:!0});m&&document.head.appendChild(f)})}var op=new Map;function Vs(e){if(!e)throw new Error("import specifier is required");if(op.has(e))return op.get(e);const t=new Function("name","return import(name)")(e).then(n=>n).catch(n=>{throw console.error(`Error importing module ${e}:`,n),op.delete(e),n});return op.set(e,t),t}var CN=async()=>{const e=await Vs("node-fetch");return e.default||e},Jie=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 CN():fetch)(e,t||{}):s},ere=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)=>Jie(m,h,a):typeof fetch>"u"?CN():fetch,f=async(m,h)=>{try{const c=await(await m(h.href)).text(),[x,M]=await Promise.all([Vs("path"),Vs("vm")]),C={exports:{},module:{exports:{}}},E=h.pathname.split("/").slice(0,-1).join("/"),R=x.basename(h.pathname),_=new M.Script(`(function(exports, module, require, __dirname, __filename) {${c}
78
+ })`,{filename:R,importModuleDynamically:M.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??Vs});let j;j=(await Vs("node:module")).createRequire(h.protocol==="file:"||h.protocol==="node:"?h.href:x.join(process.cwd(),"__mf_require_base__.js")),_.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(c){t(c instanceof Error?c:new Error(`Script execution error: ${c}`))}};p().then(async m=>{if(n?.type==="esm"||n?.type==="module")return Qy(s.href,{fetch:m,vm:await Vs("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"))},tre=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((n,a)=>{ere(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")},Yg=new Map;async function Qy(e,t){if(Yg.has(e))return Yg.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 Qy(h,t)}});return Yg.set(e,p),await p.link(async f=>{const m=new URL(f,e).href;return await Qy(m,t)}),p}var nre=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,AN=(e,t,n,a)=>{const s=[`${[t[e]]} #${e}`];return n&&s.push(`args: ${JSON.stringify(n)}`),s.push(nre(e)),a&&s.push(`Original Error Message:
79
+ ${a}`),s.join(`
80
+ `)};function are(e,t,n,a,s,p){return a(AN(e,t,n,s))}var Oo="[ Federation Runtime ]",Vy=Kie(Oo);function ir(e,t,n,a,s){e||Wt(t)}function Wt(e,t,n,a,s){if(t!==void 0)return are(e,t,n??{},f=>{throw new Error(`${Oo}: ${f}`)},a);const p=e;throw p instanceof Error?(p.message.startsWith(Oo)||(p.message=`${Oo}: ${p.message}`),p):new Error(`${Oo}: ${p}`)}function su(e){e instanceof Error&&(e.message.startsWith(Oo)||(e.message=`${Oo}: ${e.message}`)),Vy.warn(e)}function ire(e,t){return e.findIndex(n=>n===t)===-1&&e.push(t),e}function hm(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function I0(e){return typeof e.entry<"u"}function EN(e){return!e.entry.includes(".json")}function T0(e){return e&&typeof e=="object"}var rre=Object.prototype.toString;function ore(e){return rre.call(e)==="[object Object]"}function RN(e){return Array.isArray(e)?e:[e]}function IN(e){const t={url:"",type:"global",globalName:""};return no||vN()||!("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 sre=(e,t)=>{let n;return e.endsWith("/")?n=e.slice(0,-1):n=e,t.startsWith(".")&&(t=t.slice(1)),n=n+t,n},Un=typeof globalThis=="object"?globalThis:window,ii=(()=>{try{return document.defaultView}catch{return Un}})(),lu=ii;function Op(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function jp(e,t){return Object.hasOwnProperty.call(e,t)}jp(Un,"__GLOBAL_LOADING_REMOTE_ENTRY__")||Op(Un,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var el=Un.__GLOBAL_LOADING_REMOTE_ENTRY__;function TN(e){jp(e,"__VMOK__")&&!jp(e,"__FEDERATION__")&&Op(e,"__FEDERATION__",e.__VMOK__),jp(e,"__FEDERATION__")||(Op(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Op(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}TN(Un);TN(ii);function lre(e,t=Uy()){t&&(Un.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Un.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.5.1")}function vl(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 Wt(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var SC=()=>ii.__FEDERATION__.moduleInfo,cre=(e,t)=>{const n=vl(t,hm(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=hm(s),f=vl(ii.__FEDERATION__.moduleInfo,p).value;if(f?.version===a)return f}},Pp=e=>cre(e,ii.__FEDERATION__.moduleInfo),xC=(e,t)=>{const n=hm(e);return ii.__FEDERATION__.moduleInfo[n]=t,ii.__FEDERATION__.moduleInfo},ure=e=>(ii.__FEDERATION__.moduleInfo={...ii.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const n of t)delete ii.__FEDERATION__.moduleInfo[n]}),_0=(e,t)=>{const n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Un[n]}},dre=()=>ii.__FEDERATION__.__GLOBAL_PLUGIN__,pre=e=>Un.__FEDERATION__.__PRELOADED_MAP__.get(e),mre=e=>Un.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),kC="[0-9A-Za-z-]+",N0=`(?:\\+(${kC}(?:\\.${kC})*))`,Qc="0|[1-9]\\d*",Dp="[0-9]+",_N="\\d*[a-zA-Z-][a-zA-Z0-9-]*",wC=`(?:${Dp}|${_N})`,fre=`(?:-?(${wC}(?:\\.${wC})*))`,MC=`(?:${Qc}|${_N})`,NN=`(?:-(${MC}(?:\\.${MC})*))`,Xg=`${Qc}|x|X|\\*`,yl=`[v=\\s]*(${Xg})(?:\\.(${Xg})(?:\\.(${Xg})(?:${NN})?${N0}?)?)?`,hre=`^\\s*(${yl})\\s+-\\s+(${yl})\\s*$`,gre=`[v=\\s]*${`(${Dp})\\.(${Dp})\\.(${Dp})`}${fre}?${N0}?`,O0="((?:<|>)?=?)",vre=`(\\s*)${O0}\\s*(${gre}|${yl})`,ON="(?:~>?)",yre=`(\\s*)${ON}\\s+`,jN="(?:\\^)",bre=`(\\s*)${jN}\\s+`,Sre="(<|>)?=?\\s*\\*",xre=`^${jN}${yl}$`,kre=`v?${`(${Qc})\\.(${Qc})\\.(${Qc})`}${NN}?${N0}?`,wre=`^${ON}${yl}$`,Mre=`^${O0}\\s*${yl}$`,Cre=`^${O0}\\s*(${kre})$|^$`,Are="^\\s*>=\\s*0.0.0\\s*$";function Ei(e){return new RegExp(e)}function ta(e){return!e||e.toLowerCase()==="x"||e==="*"}function PN(...e){return t=>e.reduce((n,a)=>a(n),t)}function CC(e){return e.match(Ei(Cre))}function AC(e,t,n,a){const s=`${e}.${t}.${n}`;return a?`${s}-${a}`:s}function Ere(e){return e.replace(Ei(hre),(t,n,a,s,p,f,m,h,c,x,M,C)=>(ta(a)?n="":ta(s)?n=`>=${a}.0.0`:ta(p)?n=`>=${a}.${s}.0`:n=`>=${n}`,ta(c)?h="":ta(x)?h=`<${Number(c)+1}.0.0-0`:ta(M)?h=`<${c}.${Number(x)+1}.0-0`:C?h=`<=${c}.${x}.${M}-${C}`:h=`<=${h}`,`${n} ${h}`.trim()))}function Rre(e){return e.replace(Ei(vre),"$1$2$3")}function Ire(e){return e.replace(Ei(yre),"$1~")}function Tre(e){return e.replace(Ei(bre),"$1^")}function _re(e){return e.trim().split(/\s+/).map(t=>t.replace(Ei(xre),(n,a,s,p,f)=>ta(a)?"":ta(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:ta(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 Nre(e){return e.trim().split(/\s+/).map(t=>t.replace(Ei(wre),(n,a,s,p,f)=>ta(a)?"":ta(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:ta(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 Ore(e){return e.split(/\s+/).map(t=>t.trim().replace(Ei(Mre),(n,a,s,p,f,m)=>{const h=ta(s),c=h||ta(p),x=c||ta(f);return a==="="&&x&&(a=""),m="",h?a===">"||a==="<"?"<0.0.0-0":"*":a&&x?(c&&(p=0),f=0,a===">"?(a=">=",c?(s=Number(s)+1,p=0,f=0):(p=Number(p)+1,f=0)):a==="<="&&(a="<",c?s=Number(s)+1:p=Number(p)+1),a==="<"&&(m="-0"),`${a+s}.${p}.${f}${m}`):c?`>=${s}.0.0${m} <${Number(s)+1}.0.0-0`:x?`>=${s}.${p}.0${m} <${s}.${Number(p)+1}.0-0`:n})).join(" ")}function jre(e){return e.trim().replace(Ei(Sre),"")}function Pre(e){return e.trim().replace(Ei(Are),"")}function zp(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Dre(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?zp(f,m):-1:1}return 0}function sp(e,t){return zp(e.major,t.major)||zp(e.minor,t.minor)||zp(e.patch,t.patch)||Dre(e,t)}function Jg(e,t){return e.version===t.version}function zre(e,t){switch(e.operator){case"":case"=":return Jg(e,t);case">":return sp(e,t)<0;case">=":return Jg(e,t)||sp(e,t)<0;case"<":return sp(e,t)>0;case"<=":return Jg(e,t)||sp(e,t)>0;case void 0:return!0;default:return!1}}function Lre(e){return PN(_re,Nre,Ore,jre)(e)}function qre(e){return PN(Ere,Rre,Ire,Tre)(e.trim()).split(/\s+/).join(" ")}function Lc(e,t){if(!e)return!1;const n=CC(e);if(!n)return!1;const[,a,,s,p,f,m]=n,h={operator:a,version:AC(s,p,f,m),major:s,minor:p,patch:f,preRelease:m?.split(".")},c=t.split("||");for(const x of c){const M=x.trim();if(!M||M==="*"||M==="x")return!0;try{const C=qre(M);if(!C.trim())return!0;const E=C.split(" ").map(j=>Lre(j)).join(" ");if(!E.trim())return!0;const R=E.split(/\s+/).map(j=>Pre(j)).filter(Boolean);if(R.length===0)continue;let _=!0;for(const j of R){const D=CC(j);if(!D){_=!1;break}const[,z,,F,L,Z,ne]=D;if(!zre({operator:z,version:AC(F,L,Z,ne),major:F,minor:L,patch:Z,preRelease:ne?.split(".")},h)){_=!1;break}}if(_)return!0}catch(C){console.error(`[semver] Error processing range part "${M}":`,C);continue}}return!1}var Qm="default",Bre="global";function Fre(e,t,n,a){let s;return"get"in e?s=e.get:"lib"in e?s=()=>Promise.resolve(e.lib):s=()=>Promise.resolve(()=>{Wt(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Wt(`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??Fy.UNKNOWN,useIn:[]}:void 0}}function DN(e,t){const n=t.shared||{},a=t.name,s=Object.keys(n).reduce((f,m)=>{const h=RN(n[m]);return f[m]=f[m]||[],h.forEach(c=>{f[m].push(Fre(c,a,m,t.shareStrategy))}),f},{}),p={...e.shared};return Object.keys(s).forEach(f=>{p[f]?s[f].forEach(m=>{p[f].find(h=>h.version===m.version)||p[f].push(m)}):p[f]=s[f]}),{allShareInfos:p,newShareInfos:s}}function cu(e,t){if(!e)return!1;const{status:n,mode:a}=e;return n===Fy.NO_USE?!1:n===Fy.CALCULATED?!0:a==="runtime-infer"?t?Hre(e,t):!0:!1}function zo(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!!Lc(n(e),`<=${n(t)}`)}var uu=(e,t)=>{const n=t||function(a,s){return zo(a,s)};return Object.keys(e).reduce((a,s)=>!a||n(a,s)||a==="0"?s:a,0)},gm=e=>!!e.loaded||typeof e.lib=="function",Ure=e=>!!e.loading,Hre=(e,t)=>{if(!e||!t)return!1;const{usedExports:n}=e;return n?!!t.every(a=>n.includes(a)):!1};function $re(e,t,n,a){const s=e[t][n];let p="",f=cu(a);const m=function(h,c){return f?s[h].treeShaking?s[c].treeShaking?!gm(s[h].treeShaking)&&zo(h,c):!1:!0:!gm(s[h])&&zo(h,c)};if(f){if(p=uu(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:uu(e[t][n],m),useTreesShaking:f}}var Fs=e=>gm(e)||Ure(e);function Qre(e,t,n,a){const s=e[t][n];let p="",f=cu(a);const m=function(h,c){if(f){if(!s[h].treeShaking)return!0;if(!s[c].treeShaking)return!1;if(Fs(s[c].treeShaking))return Fs(s[h].treeShaking)?!!zo(h,c):!0;if(Fs(s[h].treeShaking))return!1}return Fs(s[c])?Fs(s[h])?!!zo(h,c):!0:Fs(s[h])?!1:zo(h,c)};if(f){if(p=uu(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:uu(e[t][n],m),useTreesShaking:f}}function Vre(e){return e==="loaded-first"?Qre:$re}function Lp(e,t,n,a){if(!e)return;const{shareConfig:s,scope:p=Qm,strategy:f,treeShaking:m}=n,h=Array.isArray(p)?p:[p];for(const c of h)if(s&&e[c]&&e[c][t]){const{requiredVersion:x}=s,{version:M,useTreesShaking:C}=Vre(f)(e,c,t,m),E=()=>{const _=e[c][t][M];if(s.singleton){if(typeof x=="string"&&!Lc(M,x)){const j=`Version ${M} from ${M&&_.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${x})`;s.strictVersion?Wt(j):su(j)}return{shared:_,useTreesShaking:C}}else{if(x===!1||x==="*")return{shared:_,useTreesShaking:C};if(Lc(M,x))return{shared:_,useTreesShaking:C};const j=cu(m);if(j){for(const[D,z]of Object.entries(e[c][t]))if(cu(z.treeShaking,m?.usedExports)&&Lc(D,x))return{shared:z,useTreesShaking:j}}for(const[D,z]of Object.entries(e[c][t]))if(Lc(D,x))return{shared:z,useTreesShaking:!1}}},R={shareScopeMap:e,scope:c,pkgName:t,version:M,GlobalFederation:lu.__FEDERATION__,shareInfo:n,resolver:E};return(a.emit(R)||R).resolver()}}function zN(){return lu.__FEDERATION__.__SHARE__}function EC(e){const{pkgName:t,extraOptions:n,shareInfos:a}=e,s=h=>{if(!h)return;const c={};return h.forEach(M=>{c[M.version]=M}),c[uu(c,function(M,C){return!gm(c[M])&&zo(M,C)})]},p=n?.resolver??s,f=h=>h!==null&&typeof h=="object"&&!Array.isArray(h),m=(...h)=>{const c={};for(const x of h)if(x)for(const[M,C]of Object.entries(x)){const E=c[M];f(E)&&f(C)?c[M]=m(E,C):C!==void 0&&(c[M]=C)}return c};return m(p(a[t]),n?.customShareInfo)}var Us=(e,t)=>{e.useIn||(e.useIn=[]),ire(e.useIn,t)};function lp(e,t){return t&&e.treeShaking?e.treeShaking:e}function j0(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function RC(e,t){for(const n of e){const a=t.startsWith(n.name);let s=t.replace(n.name,"");if(a){if(s.startsWith("/")){const m=n.name;return s=`.${s}`,{pkgNameOrAlias:m,expose:s,remote:n}}else if(s==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const p=n.alias&&t.startsWith(n.alias);let f=n.alias&&t.replace(n.alias,"");if(n.alias&&p){if(f&&f.startsWith("/")){const m=n.alias;return f=`.${f}`,{pkgNameOrAlias:m,expose:f,remote:n}}else if(f==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function Gre(e,t){for(const n of e)if(t===n.name||n.alias&&t===n.alias)return n}var LN="RUNTIME-001",qN="RUNTIME-002",BN="RUNTIME-003",FN="RUNTIME-004",UN="RUNTIME-005",Gy="RUNTIME-006",HN="RUNTIME-007",$N="RUNTIME-008",Zre="RUNTIME-009",QN="RUNTIME-010",VN="RUNTIME-011",Kre="RUNTIME-012",GN="RUNTIME-013",ZN="RUNTIME-014",KN="RUNTIME-015",fa={[LN]:"Failed to get remoteEntry exports.",[qN]:'The remote entry interface does not contain "init"',[BN]:"Failed to get manifest.",[FN]:"Failed to locate remote.",[UN]:"Invalid loadShareSync function call from bundler runtime",[Gy]:"Invalid loadShareSync function call from runtime",[HN]:"Failed to get remote snapshot.",[$N]:"Failed to load script resources.",[Zre]:"Please call createInstance first.",[QN]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[VN]:"The remoteEntry URL is missing from the remote snapshot.",[Kre]:'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.',[GN]:"The manifest is not a valid Module Federation manifest.",[ZN]:"The remote does not expose the requested module.",[KN]:"Remote container initialization failed."};({...fa});var WN=".then(callbacks[0]).catch(callbacks[1])";async function Wre({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${WN}`)([n,a]):import(e).then(n).catch(a)}catch(s){Wt(`Failed to load ESM entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}async function Yre({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}")${WN}`)([n,a])}catch(s){Wt(`Failed to load SystemJS entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}function YN(e,t,n){const{remoteEntryKey:a,entryExports:s}=_0(e,t);return s||Wt(LN,fa,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:a}),s}async function Xre({name:e,globalName:t,entry:n,remoteInfo:a,loaderHook:s,getEntryUrl:p,resourceContext:f}){const{entryExports:m}=_0(e,t);if(m)return m;const h=p?p(n):n;return Xie(h,{attrs:{},createScriptHook:(c,x)=>{const M=s.lifecycle.createScript.emit({url:c,attrs:x,remoteInfo:a,resourceContext:f?{...f,url:c}:void 0});if(M&&(M instanceof HTMLScriptElement||"script"in M||"timeout"in M))return M}}).then(()=>YN(e,t,n),c=>{const x=c instanceof Error?c.message:String(c);Wt($N,fa,{remoteName:e,resourceUrl:h},x)})}async function Jre({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 Wre({entry:p,remoteEntryExports:t});case"system":return Yre({entry:p,remoteEntryExports:t});default:return Xre({entry:p,globalName:f,name:m,remoteInfo:e,loaderHook:n,getEntryUrl:a,resourceContext:s})}}async function eoe({remoteInfo:e,loaderHook:t,resourceContext:n}){const{entry:a,entryGlobalName:s,name:p,type:f}=e,{entryExports:m}=_0(p,s);return m||tre(a,{attrs:{name:p,globalName:s,type:f},loaderHook:{createScriptHook:(h,c={})=>{const x=t.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:e,resourceContext:n?{...n,url:h}:void 0});if(x&&"url"in x)return x}}}).then(()=>YN(p,s,a)).catch(h=>{Wt(`Failed to load Node.js entry for remote "${p}" from "${a}". ${h instanceof Error?h.message:String(h)}`)})}function Zy(e){const{entry:t,name:n}=e;return yN(n,t)}async function P0(e){const{origin:t,remoteEntryExports:n,remoteInfo:a,getEntryUrl:s,resourceContext:p,_inErrorHandling:f=!1}=e,m=Zy(a);if(n)return n;if(!el[m]){const h=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;el[m]=h.emit({origin:t,loaderHook:c,remoteInfo:a,remoteEntryExports:n}).then(x=>x||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":no)?Jre({remoteInfo:a,remoteEntryExports:n,loaderHook:c,getEntryUrl:s,resourceContext:p}):eoe({remoteInfo:a,loaderHook:c,resourceContext:p}))).then(async x=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:x}),x)).catch(async x=>{const M=Zy(a),C=x instanceof Error&&x.message.includes("ScriptExecutionError");if(x instanceof Error&&x.message.includes("RUNTIME-008")&&!C&&!f){const E=_=>P0({..._,_inErrorHandling:!0}),R=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:E,origin:t,remoteInfo:a,remoteEntryExports:n,globalLoading:el,uniqueKey:M});if(R)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:R,recovered:!0}),R}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,error:x}),x})}return el[m]}function tl(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function toe(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function noe(e,t){const n=dre(),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 aoe(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 sr(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(aoe)??[],shared:t}}}function XN(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function ioe(e,t){return t.map(n=>{const a=Gre(e,n.nameOrAlias);return ir(a,`Unable to preload ${n.nameOrAlias} as it is not included in ${!a&&SN({remoteInfo:a,remotes:e})}`),{remote:a,preloadConfig:XN(n)}})}function roe(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function D0(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function Lo(e,t,n,a){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:a}}async function ooe(e,t,n,a){const s=e.moduleCache.get(n.name),p=n.entry;if(s?.remoteEntryExports)return Lo(a,p,"cached");try{if(!await P0({origin:e,remoteInfo:n,remoteEntryExports:s?.remoteEntryExports,resourceContext:{...a,url:p}}))throw new Error(`Failed to load remoteEntry "${p}".`);return Lo(a,p,"success")}catch(f){return Lo(a,p,D0(f)?"timeout":"error",f)}}function ev({host:e,remoteInfo:t,url:n,attrs:a,context:s,needDeleteLink:p}){return new Promise(f=>{const{link:m,needAttach:h}=Yie({url:n,cb:()=>{f(Lo(s,n,h?"success":"cached"))},onErrorCallback:c=>{f(Lo(s,n,D0(c)?"timeout":"error",c))},attrs:a,createLinkHook:(c,x)=>{const M=e.loaderHook.lifecycle.createLink.emit({url:c,attrs:x,remoteInfo:t,resourceContext:{...s,url:c}});return M instanceof HTMLLinkElement,M},needDeleteLink:p});h&&document.head.appendChild(m)})}function soe({host:e,remoteInfo:t,url:n,attrs:a,context:s}){return new Promise(p=>{const{script:f,needAttach:m}=MN({url:n,cb:()=>{p(Lo(s,n,m?"success":"cached"))},onErrorCallback:h=>{p(Lo(s,n,D0(h)?"timeout":"error",h))},attrs:a,createScriptHook:(h,c)=>{const x=e.loaderHook.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:t,resourceContext:{...s,url:h}});return x instanceof HTMLScriptElement,x},needDeleteScript:!0});m&&document.head.appendChild(f)})}function Rc(e,t){return{...e,resourceType:t}}function JN(e,t,n,a=!0,s={initiator:"preloadRemote",id:e.name}){const{cssAssets:p,jsAssetsWithoutEntry:f,entryAssets:m}=n,h=[];if(t.options.inBrowser){if(m.forEach(c=>{const{moduleInfo:x}=c;h.push(ooe(t,e,x,Rc(s,"remoteEntry")))}),a){const c={rel:"preload",as:"style"};p.forEach(x=>{h.push(ev({host:t,remoteInfo:e,url:x,attrs:c,context:Rc(s,"css")}))})}else{const c={rel:"stylesheet",type:"text/css"};p.forEach(x=>{h.push(ev({host:t,remoteInfo:e,url:x,attrs:c,needDeleteLink:!1,context:Rc(s,"css")}))})}if(a){const c={rel:"preload",as:"script"};f.forEach(x=>{h.push(ev({host:t,remoteInfo:e,url:x,attrs:c,context:Rc(s,"js")}))})}else{const c={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};f.forEach(x=>{h.push(soe({host:t,remoteInfo:e,url:x,attrs:c,context:Rc(s,"js")}))})}}return Promise.all(h)}function loe(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 coe(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 e4=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 P0({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:j0(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return ir(t,`remoteEntryExports is undefined
81
+ ${SN(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}=coe(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"&&Wt(qN,fa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,sr(this.host.options));try{await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions)}catch(c){Wt(KN,fa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${c}`,sr(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,origin:this.host}),p}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,n,a){const{loadFactory:s=!0}=n||{loadFactory:!0},p=await this.init(e,a,void 0,t);this.lib=p,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,origin:this.host});let f;try{const c=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:p,expose:t,moduleInfo:this.remoteInfo});f=typeof c=="function"?c:void 0,f||(f=await p.get(t)),f||Wt(ZN,fa,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:loe(a)},void 0,sr(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,moduleFactory:f,origin:this.host})}catch(c){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,error:c,origin:this.host}),c}const m=sre(this.remoteInfo.name,t),h=this.wraperFactory(f,m);if(!s)return h;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,origin:this.host});try{const c=await h();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,exposeModule:c,origin:this.host}),c}catch(c){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,error:c,origin:this.host}),c}}wraperFactory(e,t){function n(a,s){a&&typeof a=="object"&&Object.isExtensible(a)&&!Object.getOwnPropertyDescriptor(a,Symbol.for("mf_module_id"))&&Object.defineProperty(a,Symbol.for("mf_module_id"),{value:s,enumerable:!1})}return()=>{const a=e();return a instanceof Promise?a.then(s=>(n(s,t),s)):(n(a,t),a)}}},pa=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()}},Cn=class extends pa{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 t4(e,t){if(!T0(t))return!1;if(e!==t){for(const n in e)if(!(n in t))return!1}return!0}var rl=class extends pa{constructor(e){super(),this.onerror=Wt,this.type=e}emit(e){T0(e)||Wt(`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(t4(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){su(n),this.onerror(n)}return e}},Zr=class extends pa{constructor(e){super(),this.onerror=Wt,this.type=e}emit(e){T0(e)||Wt(`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=>(su(p),this.onerror(p),e),s=p=>{if(p!==void 0&&t4(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)}},ol=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){ir(ore(e),"Plugin configuration is invalid.");const n=e.name;ir(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){ir(e,"A name is required.");const t=this.registerPlugins[e];ir(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(t[n])})}};function n4(e,t){const n=IN(t);n.url||Wt(VN,fa,{remoteName:e.name});let a=Hy(t,n.url);!no&&!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 uoe(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:n,expose:a,origin:s,remoteInfo:p,id:f}=e;if(!I0(t)||!EN(t)){const{remoteSnapshot:m,globalSnapshot:h}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:j0(t.name,a)});n4(p,m);const c={remote:t,preloadConfig:{nameOrAlias:n,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},x=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:c,remoteInfo:p,remote:t,remoteSnapshot:m,globalSnapshot:h});return x&&JN(p,s,x,!1,{initiator:"loadRemote",id:f}).catch(()=>{}),{...e,remoteSnapshot:m}}return e}}}function doe(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 a4(e,t,n,a,s={},p){const{value:f}=vl(e,hm(t)),m=p||f;if(m&&!xN(m)&&(n(m,t,a),m.remotesInfo)){const h=Object.keys(m.remotesInfo);for(const c of h){if(s[c])continue;s[c]=!0;const x=doe(c),M=m.remotesInfo[c];a4(e,{name:x.name,version:M.matchedVersion},n,!1,s,void 0)}}}var tv=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function poe(e,t,n,a,s){const p=[],f=[],m=[],h=new Set,c=new Set,{options:x}=e,{preloadConfig:M}=t,{depsRemote:C}=M;if(a4(a,n,(R,_,j)=>{let D;if(j)D=M;else if(Array.isArray(C)){const ne=C.find(V=>V.nameOrAlias===_.name||V.nameOrAlias===_.alias);if(!ne)return;D=XN(ne)}else if(C===!0)D=M;else return;const z=Hy(R,IN(R).url);z&&m.push({name:_.name,moduleInfo:{name:_.name,entry:z,type:"remoteEntryType"in R?R.remoteEntryType:"global",entryGlobalName:"globalName"in R?R.globalName:_.name,shareScope:"",version:"version"in R?R.version:void 0},url:z});let F="modules"in R?R.modules:[];const L=roe(D.exposes);L.length&&"modules"in R&&(F=R?.modules?.reduce((ne,V)=>(L?.indexOf(V.moduleName)!==-1&&ne.push(V),ne),[]));function Z(ne){const V=ne.map(U=>Hy(R,U));return D.filter?V.filter(D.filter):V}if(F){const ne=F.length;for(let V=0;V<ne;V++){const U=F[V],pe=`${_.name}/${U.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:U.moduleName==="."?_.name:pe,name:_.name,remoteSnapshot:R,preloadConfig:D,remote:_,origin:e}),!pre(pe)&&(D.resourceCategory==="all"?(p.push(...Z(U.assets.css.async)),p.push(...Z(U.assets.css.sync)),f.push(...Z(U.assets.js.async)),f.push(...Z(U.assets.js.sync))):D.resourceCategory==="sync"&&(p.push(...Z(U.assets.css.sync)),f.push(...Z(U.assets.js.sync))),mre(pe))}}},!0,{},s),s.shared&&s.shared.length>0){const R=(_,j)=>{const{shared:D}=Lp(e.shareScopeMap,j.sharedName,_,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=>{c.add(z)}))};s.shared.forEach(_=>{const j=x.shared?.[_.sharedName];if(!j)return;const D=_.version?j.find(z=>z.version===_.version):j;D&&RN(D).forEach(z=>{R(z,_)})})}const E=f.filter(R=>!h.has(R)&&!tv("script",R));return{cssAssets:p.filter(R=>!c.has(R)&&!tv("link",R)),jsAssetsWithoutEntry:E,entryAssets:m.filter(R=>!tv("script",R.url))}}var moe=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 no?I0(s)&&EN(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:a.name,entry:s.entry,type:a.type||"global",entryGlobalName:"",shareScope:""}}]}:(n4(a,f),poe(t,n,a,p,f)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function i4(e,t){const n=Pp({name:t.name,version:t.options.version}),a=n&&"remotesInfo"in n&&n.remotesInfo&&vl(n.remotesInfo,e.name).value;return a&&a.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:SC(),remoteSnapshot:Pp({name:e.name,version:a.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:SC(),remoteSnapshot:Pp({name:e.name,version:"version"in e?e.version:void 0})}}var foe=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new ol({beforeLoadRemoteSnapshot:new Cn("beforeLoadRemoteSnapshot"),loadSnapshot:new Zr("loadGlobalSnapshot"),loadRemoteSnapshot:new Zr("loadRemoteSnapshot"),afterLoadSnapshot:new Zr("afterLoadSnapshot")}),this.manifestLoading=lu.__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=Pp({name:this.HostInstance.options.name,version:this.HostInstance.options.version});s||(s={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},ure({[this.HostInstance.options.name]:s})),s&&"remotesInfo"in s&&!vl(s.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(s.remotesInfo={...s?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:a,moduleInfo:e,hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m});let x,M;if(h)if(xN(h)){const C=no?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",E=await this.loadManifestSnapshot(C,e,{},{initiator:n,id:t||e.name}),R=xC({...e,entry:C},E);x=E,M=R}else{const{remoteSnapshot:C}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});x=C,M=c}else if(I0(e)){const C=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),E=xC(e,C);x=C,M=E}else Wt(HN,fa,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,sr(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:a,moduleInfo:e,remoteSnapshot:x}),{remoteSnapshot:x,globalSnapshot:M}}getGlobalRemoteInfo(e){return i4(e,this.HostInstance)}async getManifestJson(e,t,n,a){return(async()=>{const p=tl(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],Wt(BN,fa,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,sr(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&&Wt(GN,fa,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:m.join(",")},void 0,sr(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=Qie(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]}},hoe=class{constructor(e){this.hooks=new ol({beforeRegisterShare:new rl("beforeRegisterShare"),afterResolve:new Zr("afterResolve"),beforeLoadShare:new Zr("beforeLoadShare"),loadShare:new Cn,afterLoadShare:new pa("afterLoadShare"),errorLoadShare:new pa("errorLoadShare"),resolveShare:new rl("resolveShare"),initContainerShareScopeMap:new rl("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){su(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){su(p)}}registerShared(e,t){const{newShareInfos:n,allShareInfos:a}=DN(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=EC({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,ir(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}=Lp(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(f){const h=lp(f,m);if(h.lib)return Us(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),h.lib;if(h.loading&&!h.loaded){const c=await h.loading;return h.loaded=!0,h.lib||(h.lib=c),Us(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),c}else{const x=(async()=>{const C=await h.get();return Us(h,n.options.name),h.loaded=!0,h.lib=C,C})();this.setShared({pkgName:e,loaded:!1,shared:f,from:n.options.name,lib:null,loading:x,treeShaking:m?h:void 0});const M=await x;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),M}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,recovered:!0}),!1;const h=cu(p.treeShaking),c=lp(p,h),M=(async()=>{const E=await c.get();c.lib=E,c.loaded=!0,Us(c,n.options.name);const{shared:R,useTreesShaking:_}=Lp(this.shareScopeMap,e,p,this.hooks.lifecycle.resolveShare)||{};if(R){const j=lp(R,_);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:M,treeShaking:h?c:void 0});const C=await M;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:p}),C}}catch(p){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:p}),p}}initializeSharing(e=Qm,t){const{host:n}=this,a=t?.from,s=t?.strategy;let p=t?.initScope;const f=[];if(a!=="build"){const{initTokens:C}=this;p||(p=[]);let E=C[e];if(E||(E=C[e]={from:this.host.name}),p.indexOf(E)>=0)return f;p.push(E)}const m=this.shareScopeMap,h=n.options.name;m[e]||(m[e]={});const c=m[e],x=(C,E)=>{const{version:R,eager:_}=E;c[C]=c[C]||{};const j=c[C],D=j[R]&&lp(j[R]),z=!!(D&&("eager"in D&&D.eager||"shareConfig"in D&&D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!_!=!z?_:h>j[R].from))&&(j[R]=E)},M=async C=>{const{module:E}=await n.remoteHandler.getRemoteModuleAndOptions({id:C});let R;try{R=await E.getEntry()}catch(_){if(R=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:C,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:E.remoteInfo,origin:n}),!R)return}finally{R?.init&&!E.initing&&(E.remoteEntryExports=R,await E.init(void 0,void 0,p))}};return Object.keys(n.options.shared).forEach(C=>{n.options.shared[C].forEach(E=>{E.scope.includes(e)&&x(C,E)})}),(n.options.shareStrategy==="version-first"||s==="version-first")&&n.options.remotes.forEach(C=>{C.shareScope===e&&f.push(M(C.name))}),f}loadShareSync(e,t){const{host:n}=this,a=EC({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{a?.scope&&a.scope.forEach(p=>{this.initializeSharing(p,{strategy:a.strategy})});const{shared:s}=Lp(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){if(typeof s.lib=="function")return Us(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 Us(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&&Wt(t?.from==="build"?UN:Gy,fa,{hostName:n.options.name,sharedPkgName:e},void 0,sr(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}Wt(Gy,fa,{hostName:n.options.name,sharedPkgName:e},void 0,sr(n.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,error:s}),s}}initShareScopeMap(e,t,n={}){const{host:a}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:a.options,origin:a,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:a,loading:s,loaded:p,get:f,treeShaking:m}){const{version:h,scope:c="default",...x}=t,M=Array.isArray(c)?c:[c],C=E=>{const R=(j,D,z)=>{z&&!j[D]&&(j[D]=z)},_=m?E.treeShaking:E;R(_,"loaded",p),R(_,"loading",s),R(_,"get",f)};M.forEach(E=>{this.shareScopeMap[E]||(this.shareScopeMap[E]={}),this.shareScopeMap[E][e]||(this.shareScopeMap[E][e]={}),this.shareScopeMap[E][e][h]||(this.shareScopeMap[E][e][h]={version:h,scope:[E],...x,lib:a});const R=this.shareScopeMap[E][e][h];C(R),n&&R.from!==n&&(R.from=n)})}_setGlobalShareScopeMap(e){const t=zN(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},goe=class{constructor(e){this.hooks=new ol({beforeRegisterRemote:new rl("beforeRegisterRemote"),registerRemote:new rl("registerRemote"),beforeRequest:new Zr("beforeRequest"),afterMatchRemote:new Cn("afterMatchRemote"),onLoad:new Cn("onLoad"),afterLoadRemote:new Cn("afterLoadRemote"),handlePreloadModule:new pa("handlePreloadModule"),errorLoadRemote:new Cn("errorLoadRemote"),beforePreloadRemote:new Cn("beforePreloadRemote"),generatePreloadAssets:new Cn("generatePreloadAssets"),afterPreloadRemote:new Cn("afterPreloadRemote"),loadEntry:new Cn}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((n,a)=>(this.registerRemote(a,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,t){const{remote:n,expose:a}=t,{name:s,alias:p}=n;if(this.idToRemoteMap[e]={name:n.name,expose:a},p&&e.startsWith(s)){const f=e.replace(s,p);this.idToRemoteMap[f]={name:n.name,expose:a};return}if(p&&e.startsWith(p)){const f=e.replace(p,s);this.idToRemoteMap[f]={name:n.name,expose:a}}}async loadRemote(e,t){const{host:n}=this,a=RC(n.options.remotes,e);let s=e,p=a?.expose,f=a?tl(a.remote):void 0,m;try{const{loadFactory:h=!0}=t||{loadFactory:!0},{module:c,moduleOptions:x,remoteMatchInfo:M}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:C,remote:E,expose:R,id:_,remoteSnapshot:j}=M;s=_,p=R,f=tl(E);const D=await c.get(_,R,t,j),z=await this.hooks.lifecycle.onLoad.emit({id:_,pkgNameOrAlias:C,expose:R,exposeModule:h?D:void 0,exposeModuleFactory:h?void 0:D,remote:E,options:x,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,M),m={id:s,expose:p,remote:f,options:t,origin:n},typeof z=="function"?z:D}catch(h){const{from:c="runtime"}=t||{from:"runtime"};let x;try{x=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:c,lifecycle:"onLoad",expose:p,remote:f,origin:n})}catch(M){throw m={id:s,expose:p,remote:f,options:t,error:M,origin:n},M}if(!x)throw m={id:s,expose:p,remote:f,options:t,error:h,origin:n},h;return m={id:s,expose:p,remote:f,options:t,error:h,origin:n,recovered:!0},x}finally{m&&await this.hooks.lifecycle.afterLoadRemote.emit(m)}}async preloadRemote(e){const{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const a=ioe(t.options.remotes,e),s=m=>{const{preloadConfig:h,remote:c}=m,x=h.exposes||[];return x.length?x.map(M=>({ops:{...m,preloadConfig:{...h,exposes:[M]}},id:j0(c.name,M)})):[{ops:m,id:`${c.name}/*`}]};let p;await Promise.all(a.flatMap(s).map(async m=>{const{ops:h,id:c}=m,{remote:x,preloadConfig:M}=h,C=tl(x);try{const{globalSnapshot:E,remoteSnapshot:R}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:x,id:c,initiator:"preloadRemote"}),_=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:h,remote:x,remoteInfo:C,globalSnapshot:E,remoteSnapshot:R});if(!_)return;const j=await JN(C,t,_,!0,{initiator:"preloadRemote",id:c});n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:j})}catch(E){n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:[{url:C.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(C.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:c,error:E}]})}}));const f=n.flatMap(m=>m.results.filter(h=>h.status==="error"||h.status==="timeout"));if(f.length>0&&(p=new Error(`preloadRemote failed to load ${f.length} resource(s).`),Object.assign(p,{results:n,failedResults:f})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:p}),p)throw p}registerRemotes(e,t){const{host:n}=this;e.forEach(a=>{this.registerRemote(a,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:n}=e;let a;try{a=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(E){if(a=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:"runtime",error:E,lifecycle:"beforeRequest"}),!a)throw E}const{id:s}=a,p=RC(t.options.remotes,s);if(!p)try{Wt(FN,fa,{hostName:t.options.name,requestId:s},void 0,sr(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=tl(f);await this.hooks.lifecycle.afterMatchRemote.emit({id:s,...p,options:t.options,remoteInfo:m,origin:t});const h=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:s,...p,options:t.options,origin:t,remoteInfo:m}),{remote:c,expose:x}=h;ir(c&&x,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${s}.`);let M=t.moduleCache.get(c.name);const C={host:t,remoteInfo:m};return M||(M=new e4(C),t.moduleCache.set(c.name,M)),{module:M,moduleOptions:C,remoteMatchInfo:h}}registerRemote(e,t,n){const{host:a}=this,s=()=>{if(e.alias){const f=t.find(m=>e.alias&&(m.name.startsWith(e.alias)||m.alias?.startsWith(e.alias)));ir(!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&&no&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Qm),e.type||(e.type=Bre)};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}),bN(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;Un[f]&&(Object.getOwnPropertyDescriptor(Un,f)?.configurable?delete Un[f]:Un[f]=void 0);const m=Zy(s.remoteInfo);el[m]&&delete el[m],t.snapshotHandler.manifestCache.delete(p.entry);let h=p.buildVersion?yN(p.name,p.buildVersion):p.name;const c=Un.__FEDERATION__.__INSTANCES__.findIndex(M=>p.buildVersion?M.options.id===h:M.name===h);if(c!==-1){const M=Un.__FEDERATION__.__INSTANCES__[c];h=M.options.id||h;const C=zN();let E=!0;const R=[];Object.keys(C).forEach(_=>{const j=C[_];j&&Object.keys(j).forEach(D=>{const z=j[D];z&&Object.keys(z).forEach(F=>{const L=z[F];L&&Object.keys(L).forEach(Z=>{const ne=L[Z];ne&&typeof ne=="object"&&ne.from===p.name&&(ne.loaded||ne.loading?(ne.useIn=ne.useIn.filter(V=>V!==p.name),ne.useIn.length?E=!1:R.push([_,D,F,Z])):R.push([_,D,F,Z]))})})})}),E&&(M.shareScopeMap={},delete C[h]),R.forEach(([_,j,D,z])=>{delete C[_]?.[j]?.[D]?.[z]}),Un.__FEDERATION__.__INSTANCES__.splice(c,1)}const{hostGlobalSnapshot:x}=i4(e,t);if(x){const M=x&&"remotesInfo"in x&&x.remotesInfo&&vl(x.remotesInfo,e.name).key;M&&(delete x.remotesInfo[M],lu.__FEDERATION__.__MANIFEST_LOADING__[M]&&delete lu.__FEDERATION__.__MANIFEST_LOADING__[M])}t.moduleCache.delete(e.name)}}catch(t){Vy.error(`removeRemote failed: ${t instanceof Error?t.message:String(t)}`)}}},voe=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,yoe=class{constructor(e){this.hooks=new ol({beforeInit:new rl("beforeInit"),init:new pa,beforeInitContainer:new Zr("beforeInitContainer"),initContainer:new Zr("initContainer")}),this.version="2.5.1",this.moduleCache=new Map,this.loaderHook=new ol({getModuleInfo:new pa,createScript:new pa,createLink:new pa,fetch:new Cn,loadEntryError:new Cn,afterLoadEntry:new Cn("afterLoadEntry"),beforeInitRemote:new Cn("beforeInitRemote"),afterInitRemote:new Cn("afterInitRemote"),beforeGetExpose:new Cn("beforeGetExpose"),afterGetExpose:new Cn("afterGetExpose"),beforeExecuteFactory:new Cn("beforeExecuteFactory"),afterExecuteFactory:new Cn("afterExecuteFactory"),getModuleFactory:new Cn}),this.bridgeHook=new ol({beforeBridgeRender:new pa,afterBridgeRender:new pa,beforeBridgeDestroy:new pa,afterBridgeDestroy:new pa});const t=voe?[uoe(),moe()]:[],n={id:toe(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:no};this.name=e.name,this.options=n,this.snapshotHandler=new foe(this),this.sharedHandler=new hoe(this),this.remoteHandler=new goe(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&&Wt(AN(QN,fa)),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=Qm,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){const a=tl({name:e,entry:t}),s=new e4({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}=DN(e,t),{userOptions:a,options:s}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),p=this.remoteHandler.formatAndRegisterRemote(s,a),{allShareInfos:f}=this.sharedHandler.registerShared(s,a),m=[...s.plugins];a.plugins&&a.plugins.forEach(c=>{m.includes(c)||m.push(c)});const h={...e,...t,plugins:m,remotes:p,shared:f,id:a.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:h}),h}registerPlugins(e){const t=noe(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})}};lre(yoe);var boe="camstack-mount",Soe=/^\/(?:[A-Za-z0-9_\-.]+\/)*$/,nv=null;function IC(e){if(e==null||e==="")return null;const t=e.endsWith("/")?e:`${e}/`;return!Soe.test(t)||t.includes("/../")||t.includes("/./")?null:t}function xoe(){if(typeof document>"u")return"/";const e=IC(document.querySelector(`meta[name="${boe}"]`)?.getAttribute("content"));if(e!==null)return e;if(document.querySelector("base[href]")!==null)try{const t=new URL(document.baseURI);if(t.origin===window.location.origin){const n=IC(t.pathname);if(n!==null)return n}}catch{}return"/"}function r4(){return nv===null&&(nv=xoe()),nv}function z0(){return r4().replace(/\/$/,"")}function koe(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function Pve(e){if(koe(e))return e;const t=r4(),n=e.replace(/^\/+/,"");return t!=="/"&&(e===z0()||e.startsWith(t))?e:`${t}${n}`}function woe(){return`${typeof window<"u"?window.location.origin:""}${z0()}`}Ai("camstack:widget-registry",null);function Dve({title:e,icon:t,headerRight:n,collapsible:a=!1,defaultOpen:s=!0,bodyClassName:p="p-3",children:f}){const[m,h]=T.useState(s),c=!a||m,x=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground",children:[t,e]}),a?m?v.jsx(Go,{className:"h-3.5 w-3.5 text-foreground-subtle"}):v.jsx(Une,{className:"h-3.5 w-3.5 text-foreground-subtle"}):n]}),M=`px-4 py-2 flex items-center justify-between ${c?"border-b border-border":""}`;return v.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[a?v.jsx("button",{type:"button",onClick:()=>h(C=>!C),className:`w-full text-left ${M}`,children:x}):v.jsx("div",{className:M,children:x}),c?v.jsx("div",{className:p,children:f}):null]})}var Moe="capability.binding-changed";function _u(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:Moe},{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?xR(e,n):null,[e,n])}function qo(e){const t=T.useCallback(a=>e?e.subscribe(()=>a()):()=>{},[e]),n=T.useCallback(()=>e?.value,[e]);return T.useSyncExternalStore(t,n,n)}var Coe="/addon/snapshot/media";function zve(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(/\/+$/,""):z0(),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}${Coe}/${String(e)}.jpg${h.length>0?`?${h}`:""}`},[e,n,a,s]),loading:!1,refresh:T.useCallback(()=>{p(f=>f+1)},[])}}H.Camera;function gt(e){const t=_u(e.trpc,e.deviceId),n=qo(t!==null?e.slice(t):void 0),a=t!==null?e.cap(t):void 0,s=qo(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 Aoe(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 Lve(e){const t=Aoe(e);return t!==null?t==="no-provider"||t==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}Ai("camstack:vod-playback",{request:null,play:()=>{},clear:()=>{}});Ai("camstack:recorded-playback",{bindControlChannel:null,channelOpen:!1,mode:"live",positionMs:null,send:()=>!1});T.lazy(()=>ll(()=>import("./MotionZonesSettings-7c3yiT5E-9PMziv1F.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings}))),T.lazy(()=>ll(()=>import("./PrivacyMaskSettings-PkYs077O-DXkWrrAk.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));var Eoe=Object.defineProperty,vm=Object.getOwnPropertySymbols,o4=Object.prototype.hasOwnProperty,s4=Object.prototype.propertyIsEnumerable,TC=(e,t,n)=>t in e?Eoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ky=(e,t)=>{for(var n in t||(t={}))o4.call(t,n)&&TC(e,n,t[n]);if(vm)for(var n of vm(t))s4.call(t,n)&&TC(e,n,t[n]);return e},Wy=(e,t)=>{var n={};for(var a in e)o4.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&vm)for(var a of vm(e))t.indexOf(a)<0&&s4.call(e,a)&&(n[a]=e[a]);return n};var Uo;(e=>{const t=class ht{constructor(h,c,x,M){if(this.version=h,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],h<ht.MIN_VERSION||h>ht.MAX_VERSION)throw new RangeError("Version value out of range");if(M<-1||M>7)throw new RangeError("Mask value out of range");this.size=h*4+17;let C=[];for(let R=0;R<this.size;R++)C.push(!1);for(let R=0;R<this.size;R++)this.modules.push(C.slice()),this.isFunction.push(C.slice());this.drawFunctionPatterns();const E=this.addEccAndInterleave(x);if(this.drawCodewords(E),M==-1){let R=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const j=this.getPenaltyScore();j<R&&(M=_,R=j),this.applyMask(_)}}s(0<=M&&M<=7),this.mask=M,this.applyMask(M),this.drawFormatBits(M),this.isFunction=[]}static encodeText(h,c){const x=e.QrSegment.makeSegments(h);return ht.encodeSegments(x,c)}static encodeBinary(h,c){const x=e.QrSegment.makeBytes(h);return ht.encodeSegments([x],c)}static encodeSegments(h,c,x=1,M=40,C=-1,E=!0){if(!(ht.MIN_VERSION<=x&&x<=M&&M<=ht.MAX_VERSION)||C<-1||C>7)throw new RangeError("Invalid value");let R,_;for(R=x;;R++){const F=ht.getNumDataCodewords(R,c)*8,L=f.getTotalBits(h,R);if(L<=F){_=L;break}if(R>=M)throw new RangeError("Data too long")}for(const F of[ht.Ecc.MEDIUM,ht.Ecc.QUARTILE,ht.Ecc.HIGH])E&&_<=ht.getNumDataCodewords(R,F)*8&&(c=F);let j=[];for(const F of h){n(F.mode.modeBits,4,j),n(F.numChars,F.mode.numCharCountBits(R),j);for(const L of F.getData())j.push(L)}s(j.length==_);const D=ht.getNumDataCodewords(R,c)*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 F=236;j.length<D;F^=253)n(F,8,j);let z=[];for(;z.length*8<j.length;)z.push(0);return j.forEach((F,L)=>z[L>>>3]|=F<<7-(L&7)),new ht(R,c,z,C)}getModule(h,c){return 0<=h&&h<this.size&&0<=c&&c<this.size&&this.modules[c][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let x=0;x<this.size;x++)this.setFunctionModule(6,x,x%2==0),this.setFunctionModule(x,6,x%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),c=h.length;for(let x=0;x<c;x++)for(let M=0;M<c;M++)x==0&&M==0||x==0&&M==c-1||x==c-1&&M==0||this.drawAlignmentPattern(h[x],h[M]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const c=this.errorCorrectionLevel.formatBits<<3|h;let x=c;for(let C=0;C<10;C++)x=x<<1^(x>>>9)*1335;const M=(c<<10|x)^21522;s(M>>>15==0);for(let C=0;C<=5;C++)this.setFunctionModule(8,C,a(M,C));this.setFunctionModule(8,7,a(M,6)),this.setFunctionModule(8,8,a(M,7)),this.setFunctionModule(7,8,a(M,8));for(let C=9;C<15;C++)this.setFunctionModule(14-C,8,a(M,C));for(let C=0;C<8;C++)this.setFunctionModule(this.size-1-C,8,a(M,C));for(let C=8;C<15;C++)this.setFunctionModule(8,this.size-15+C,a(M,C));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let x=0;x<12;x++)h=h<<1^(h>>>11)*7973;const c=this.version<<12|h;s(c>>>18==0);for(let x=0;x<18;x++){const M=a(c,x),C=this.size-11+x%3,E=Math.floor(x/3);this.setFunctionModule(C,E,M),this.setFunctionModule(E,C,M)}}drawFinderPattern(h,c){for(let x=-4;x<=4;x++)for(let M=-4;M<=4;M++){const C=Math.max(Math.abs(M),Math.abs(x)),E=h+M,R=c+x;0<=E&&E<this.size&&0<=R&&R<this.size&&this.setFunctionModule(E,R,C!=2&&C!=4)}}drawAlignmentPattern(h,c){for(let x=-2;x<=2;x++)for(let M=-2;M<=2;M++)this.setFunctionModule(h+M,c+x,Math.max(Math.abs(M),Math.abs(x))!=1)}setFunctionModule(h,c,x){this.modules[c][h]=x,this.isFunction[c][h]=!0}addEccAndInterleave(h){const c=this.version,x=this.errorCorrectionLevel;if(h.length!=ht.getNumDataCodewords(c,x))throw new RangeError("Invalid argument");const M=ht.NUM_ERROR_CORRECTION_BLOCKS[x.ordinal][c],C=ht.ECC_CODEWORDS_PER_BLOCK[x.ordinal][c],E=Math.floor(ht.getNumRawDataModules(c)/8),R=M-E%M,_=Math.floor(E/M);let j=[];const D=ht.reedSolomonComputeDivisor(C);for(let F=0,L=0;F<M;F++){let Z=h.slice(L,L+_-C+(F<R?0:1));L+=Z.length;const ne=ht.reedSolomonComputeRemainder(Z,D);F<R&&Z.push(0),j.push(Z.concat(ne))}let z=[];for(let F=0;F<j[0].length;F++)j.forEach((L,Z)=>{(F!=_-C||Z>=R)&&z.push(L[F])});return s(z.length==E),z}drawCodewords(h){if(h.length!=Math.floor(ht.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let x=this.size-1;x>=1;x-=2){x==6&&(x=5);for(let M=0;M<this.size;M++)for(let C=0;C<2;C++){const E=x-C,R=(x+1&2)==0?this.size-1-M:M;!this.isFunction[R][E]&&c<h.length*8&&(this.modules[R][E]=a(h[c>>>3],7-(c&7)),c++)}}s(c==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let x=0;x<this.size;x++){let M;switch(h){case 0:M=(x+c)%2==0;break;case 1:M=c%2==0;break;case 2:M=x%3==0;break;case 3:M=(x+c)%3==0;break;case 4:M=(Math.floor(x/3)+Math.floor(c/2))%2==0;break;case 5:M=x*c%2+x*c%3==0;break;case 6:M=(x*c%2+x*c%3)%2==0;break;case 7:M=((x+c)%2+x*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][x]&&M&&(this.modules[c][x]=!this.modules[c][x])}}getPenaltyScore(){let h=0;for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[C][j]==E?(R++,R==5?h+=ht.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*ht.PENALTY_N3),E=this.modules[C][j],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*ht.PENALTY_N3}for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][C]==E?(R++,R==5?h+=ht.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*ht.PENALTY_N3),E=this.modules[j][C],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*ht.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+=ht.PENALTY_N2)}let c=0;for(const C of this.modules)c=C.reduce((E,R)=>E+(R?1:0),c);const x=this.size*this.size,M=Math.ceil(Math.abs(c*20-x*10)/x)-1;return s(0<=M&&M<=9),h+=M*ht.PENALTY_N4,s(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let x=[6];for(let M=this.size-7;x.length<h;M-=c)x.splice(1,0,M);return x}}static getNumRawDataModules(h){if(h<ht.MIN_VERSION||h>ht.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*h+128)*h+64;if(h>=2){const x=Math.floor(h/7)+2;c-=(25*x-10)*x-55,h>=7&&(c-=36)}return s(208<=c&&c<=29648),c}static getNumDataCodewords(h,c){return Math.floor(ht.getNumRawDataModules(h)/8)-ht.ECC_CODEWORDS_PER_BLOCK[c.ordinal][h]*ht.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let c=[];for(let M=0;M<h-1;M++)c.push(0);c.push(1);let x=1;for(let M=0;M<h;M++){for(let C=0;C<c.length;C++)c[C]=ht.reedSolomonMultiply(c[C],x),C+1<c.length&&(c[C]^=c[C+1]);x=ht.reedSolomonMultiply(x,2)}return c}static reedSolomonComputeRemainder(h,c){let x=c.map(M=>0);for(const M of h){const C=M^x.shift();x.push(0),c.forEach((E,R)=>x[R]^=ht.reedSolomonMultiply(E,C))}return x}static reedSolomonMultiply(h,c){if(h>>>8||c>>>8)throw new RangeError("Byte out of range");let x=0;for(let M=7;M>=0;M--)x=x<<1^(x>>>7)*285,x^=(c>>>M&1)*h;return s(x>>>8==0),x}finderPenaltyCountPatterns(h){const c=h[1];s(c<=this.size*3);const x=c>0&&h[2]==c&&h[3]==c*3&&h[4]==c&&h[5]==c;return(x&&h[0]>=c*4&&h[6]>=c?1:0)+(x&&h[6]>=c*4&&h[0]>=c?1:0)}finderPenaltyTerminateAndCount(h,c,x){return h&&(this.finderPenaltyAddHistory(c,x),c=0),c+=this.size,this.finderPenaltyAddHistory(c,x),this.finderPenaltyCountPatterns(x)}finderPenaltyAddHistory(h,c){c[0]==0&&(h+=this.size),c.pop(),c.unshift(h)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(m,h,c){if(h<0||h>31||m>>>h)throw new RangeError("Value out of range");for(let x=h-1;x>=0;x--)c.push(m>>>x&1)}function a(m,h){return(m>>>h&1)!=0}function s(m){if(!m)throw new Error("Assertion error")}const p=class un{constructor(h,c,x){if(this.mode=h,this.numChars=c,this.bitData=x,c<0)throw new RangeError("Invalid argument");this.bitData=x.slice()}static makeBytes(h){let c=[];for(const x of h)n(x,8,c);return new un(un.Mode.BYTE,h.length,c)}static makeNumeric(h){if(!un.isNumeric(h))throw new RangeError("String contains non-numeric characters");let c=[];for(let x=0;x<h.length;){const M=Math.min(h.length-x,3);n(parseInt(h.substring(x,x+M),10),M*3+1,c),x+=M}return new un(un.Mode.NUMERIC,h.length,c)}static makeAlphanumeric(h){if(!un.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],x;for(x=0;x+2<=h.length;x+=2){let M=un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x))*45;M+=un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x+1)),n(M,11,c)}return x<h.length&&n(un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x)),6,c),new un(un.Mode.ALPHANUMERIC,h.length,c)}static makeSegments(h){return h==""?[]:un.isNumeric(h)?[un.makeNumeric(h)]:un.isAlphanumeric(h)?[un.makeAlphanumeric(h)]:[un.makeBytes(un.toUtf8ByteArray(h))]}static makeEci(h){let c=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)n(h,8,c);else if(h<16384)n(2,2,c),n(h,14,c);else if(h<1e6)n(6,3,c),n(h,21,c);else throw new RangeError("ECI assignment value out of range");return new un(un.Mode.ECI,0,c)}static isNumeric(h){return un.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return un.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,c){let x=0;for(const M of h){const C=M.mode.numCharCountBits(c);if(M.numChars>=1<<C)return 1/0;x+=4+C+M.bitData.length}return x}static toUtf8ByteArray(h){h=encodeURI(h);let c=[];for(let x=0;x<h.length;x++)h.charAt(x)!="%"?c.push(h.charCodeAt(x)):(c.push(parseInt(h.substring(x+1,x+3),16)),x+=2);return c}};p.NUMERIC_REGEX=/^[0-9]*$/,p.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,p.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=p;e.QrSegment=p})(Uo||(Uo={}));(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={}))})(Uo||(Uo={}));(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={}))})(Uo||(Uo={}));var nl=Uo;var Roe={L:nl.QrCode.Ecc.LOW,M:nl.QrCode.Ecc.MEDIUM,Q:nl.QrCode.Ecc.QUARTILE,H:nl.QrCode.Ecc.HIGH},l4=128,c4="L",u4="#FFFFFF",d4="#000000",p4=!1,m4=1,Ioe=4,Toe=0,_oe=.1;function f4(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 h4(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 Noe(e,t,n,a){if(a==null)return null;const s=e.length+n*2,p=Math.floor(t*_oe),f=s/t,m=(a.width||p)*f,h=(a.height||p)*f,c=a.x==null?e.length/2-m/2:a.x*f,x=a.y==null?e.length/2-h/2:a.y*f,M=a.opacity==null?1:a.opacity;let C=null;if(a.excavate){let R=Math.floor(c),_=Math.floor(x);C={x:R,y:_,w:Math.ceil(m+c-R),h:Math.ceil(h+x-_)}}const E=a.crossOrigin;return{x:c,y:x,h,w:m,excavation:C,opacity:M,crossOrigin:E}}function Ooe(e,t){return t!=null?Math.max(Math.floor(t),0):e?Ioe:Toe}function g4({value:e,level:t,minVersion:n,includeMargin:a,marginSize:s,imageSettings:p,size:f,boostLevel:m}){let h=Mn.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((R,_)=>(R.push(...nl.QrSegment.makeSegments(_)),R),[]);return nl.QrCode.encodeSegments(E,Roe[t],n,void 0,void 0,m)},[e,t,n,m]);const{cells:c,margin:x,numCells:M,calculatedImageSettings:C}=Mn.useMemo(()=>{let E=h.getModules();const R=Ooe(a,s);return{cells:E,margin:R,numCells:E.length+R*2,calculatedImageSettings:Noe(E,f,R,p)}},[h,f,p,a,s]);return{qrcode:h,margin:x,cells:c,numCells:M,calculatedImageSettings:C}}var joe=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Poe=Mn.forwardRef(function(t,n){const a=t,{value:s,size:p=l4,level:f=c4,bgColor:m=u4,fgColor:h=d4,includeMargin:c=p4,minVersion:x=m4,boostLevel:M,marginSize:C,imageSettings:E}=a,R=Wy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:_}=R,j=Wy(R,["style"]),D=E?.src,z=Mn.useRef(null),F=Mn.useRef(null),L=Mn.useCallback(Ce=>{z.current=Ce,typeof n=="function"?n(Ce):n&&(n.current=Ce)},[n]),[Z,ne]=Mn.useState(!1),{margin:V,cells:U,numCells:pe,calculatedImageSettings:we}=g4({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:C,imageSettings:E,size:p});Mn.useEffect(()=>{if(z.current!=null){const Ce=z.current,Me=Ce.getContext("2d");if(!Me)return;let Te=U;const B=F.current,ue=we!=null&&B!==null&&B.complete&&B.naturalHeight!==0&&B.naturalWidth!==0;ue&&we.excavation!=null&&(Te=h4(U,we.excavation));const ge=window.devicePixelRatio||1;Ce.height=Ce.width=p*ge;const Re=p/pe*ge;Me.scale(Re,Re),Me.fillStyle=m,Me.fillRect(0,0,pe,pe),Me.fillStyle=h,joe?Me.fill(new Path2D(f4(Te,V))):U.forEach(function(fe,q){fe.forEach(function(ee,X){ee&&Me.fillRect(X+V,q+V,1,1)})}),we&&(Me.globalAlpha=we.opacity),ue&&Me.drawImage(B,we.x+V,we.y+V,we.w,we.h)}}),Mn.useEffect(()=>{ne(!1)},[D]);const ke=Ky({height:p,width:p},_);let Ae=null;return D!=null&&(Ae=Mn.createElement("img",{src:D,key:D,style:{display:"none"},onLoad:()=>{ne(!0)},ref:F,crossOrigin:we?.crossOrigin})),Mn.createElement(Mn.Fragment,null,Mn.createElement("canvas",Ky({style:ke,height:p,width:p,ref:L,role:"img"},j)),Ae)});Poe.displayName="QRCodeCanvas";var Doe=Mn.forwardRef(function(t,n){const a=t,{value:s,size:p=l4,level:f=c4,bgColor:m=u4,fgColor:h=d4,includeMargin:c=p4,minVersion:x=m4,boostLevel:M,title:C,marginSize:E,imageSettings:R}=a,_=Wy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:D,numCells:z,calculatedImageSettings:F}=g4({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:E,imageSettings:R,size:p});let L=D,Z=null;R!=null&&F!=null&&(F.excavation!=null&&(L=h4(D,F.excavation)),Z=Mn.createElement("image",{href:R.src,height:F.h,width:F.w,x:F.x+j,y:F.y+j,preserveAspectRatio:"none",opacity:F.opacity,crossOrigin:F.crossOrigin}));const ne=f4(L,j);return Mn.createElement("svg",Ky({height:p,width:p,viewBox:`0 0 ${z} ${z}`,ref:n,role:"img"},_),!!C&&Mn.createElement("title",null,C),Mn.createElement("path",{fill:m,d:`M0,0 h${z}v${z}H0z`,shapeRendering:"crispEdges"}),Mn.createElement("path",{fill:h,d:ne,shapeRendering:"crispEdges"}),Z)});Doe.displayName="QRCodeSVG";var _C=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,NC=tN,Wo=(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 c=n?.[h],x=p?.[h];if(c===null)return null;const M=_C(c)||_C(x);return s[h][M]}),m=n&&Object.entries(n).reduce((h,c)=>{let[x,M]=c;return M===void 0||(h[x]=M),h},{});return NC(e,f,t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,c)=>{let{class:x,className:M,...C}=c;return Object.entries(C).every(E=>{let[R,_]=E;return Array.isArray(_)?_.includes({...p,...m}[R]):{...p,...m}[R]===_})?[...h,x,M]:h},[]),n?.class,n?.className)},zoe=Wo("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"}}),Yy=T.forwardRef(({className:e,variant:t,size:n,...a},s)=>v.jsx("button",{ref:s,className:se(zoe({variant:t,size:n}),e),...a}));Yy.displayName="Button";var Loe=Wo("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"}}),qoe=T.forwardRef(({className:e,variant:t,size:n,icon:a,...s},p)=>v.jsx("button",{ref:p,className:se(Loe({variant:t,size:n}),e),...s,children:v.jsx(a,{className:"h-4 w-4"})}));qoe.displayName="IconButton";var Boe=Wo("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"}}),Foe=T.forwardRef(({className:e,variant:t,style:n,...a},s)=>v.jsx("span",{ref:s,className:se(Boe({variant:t,styleVariant:n}),e),...a}));Foe.displayName="Badge";var Uoe=Wo("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Hoe=T.forwardRef(({className:e,variant:t,...n},a)=>v.jsx("div",{ref:a,className:se(Uoe({variant:t}),e),...n}));Hoe.displayName="Card";var $oe=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}));$oe.displayName="Label";var Qoe=Wo("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Voe=T.forwardRef(({className:e,orientation:t,...n},a)=>v.jsx("div",{ref:a,role:"separator",className:se(Qoe({orientation:t}),e),...n}));Voe.displayName="Separator";var Goe=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}));Goe.displayName="Skeleton";var OC=Wo("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"}}),Zoe=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(OC({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(OC({state:t}),e),...s}));Zoe.displayName="Input";var Koe=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(Go,{className:"h-3.5 w-3.5"})})]}));Koe.displayName="Select";var Woe=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}));Woe.displayName="Checkbox";var Yoe=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})]}));Yoe.displayName="Switch";var v4=T.createContext(null);function Xoe(){const e=T.useContext(v4);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function y4({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(v4.Provider,{value:{open:p,setOpen:m,contentId:f},children:e})}var Joe=Wo("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"}}),L0=T.forwardRef(({className:e,width:t,placement:n,scroll:a,children:s,...p},f)=>{const{open:m,setOpen:h,contentId:c}=Xoe(),x=T.useRef(null),M=f??x;T.useEffect(()=>{const E=M.current;E&&(m&&!E.open&&E.showModal(),!m&&E.open&&E.close())},[m,M]);const C=E=>{E.target===E.currentTarget&&h(!1)};return v.jsx("dialog",{ref:M,id:c,className:se(Joe({width:t,placement:n,scroll:a}),e),onClick:C,onClose:()=>h(!1),...p,children:s})});L0.displayName="DialogContent";function ese({className:e,...t}){return v.jsx("div",{className:se("flex flex-col gap-1 mb-3 shrink-0",e),...t})}function tse({className:e,...t}){return v.jsx("div",{className:se("flex justify-end gap-2 mt-4 shrink-0",e),...t})}function nse({className:e,...t}){return v.jsx("h2",{className:se("text-sm font-semibold text-foreground",e),...t})}function ase({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);var ise=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}));ise.displayName="ScrollArea";var av={baseDelayMs:1500,maxDelayMs:15e3,maxAttempts:40};function rse(e,t=Math.random){if(e>=av.maxAttempts)return{kind:"exhausted",attempts:e};const n=Math.min(av.maxDelayMs,av.baseDelayMs*2**e);return{kind:"retry",delayMs:Math.round(n*(.8+t()*.4))}}var ose="/adaptive-probe",sse=2500;function b4(e){return e>=8?"high":e>=2.5?"mid":"low"}function lse(e){const{downlinkMbps:t,...n}=e;return n}function jC(e){return b4(e)!=="low"}function PC(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}${t.pathname.replace(/\/+$/,"")}`}function cse(e,t){return PC(e)??PC(t)}function use(e){const t=e.downlinkMbps===void 0?"none":b4(e.downlinkMbps);return[e.phase,e.viewportWidth??"-",e.viewportHeight??"-",e.devicePixelRatio??"-",t,e.prefersTier??"-",e.probeOrigin??"unreachable"].join("|")}async function dse(e,t){const n=e.replace(/\/+$/,""),a=new AbortController,s=setTimeout(()=>a.abort(),sse),p=t.now();try{const f=await t.fetchImpl(`${n}${ose}`,{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)}}var DC=8;function Fn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ai(e){return typeof e=="string"&&e.length>0?e:null}function Ja(e,t){if(e===null||t===null)return null;const n=e-t;return n<0?null:n}function S4(e,t){if(e===null||t===null)return null;const n=e+t;return n<=0?null:e/n*100}function pse(e){return e===null?null:/profile-level-id=([0-9a-fA-F]+)/.exec(e)?.[1]??null}function mse(e){const t={inbound:null,codecs:new Map,candidates:new Map,pair:null,selectedPairId:null},n=[];e.forEach(s=>{const p=s,f=ai(p.id);switch(p.type){case"inbound-rtp":(p.kind??p.mediaType)==="video"&&(t.inbound=p);break;case"codec":f!==null&&t.codecs.set(f,p);break;case"local-candidate":case"remote-candidate":f!==null&&t.candidates.set(f,p);break;case"candidate-pair":n.push(p);break;case"transport":t.selectedPairId=ai(p.selectedCandidatePairId);break}});const a=t.selectedPairId;return t.pair=n.find(s=>ai(s.id)===a)??n.find(s=>s.selected===!0)??n.find(s=>s.nominated===!0&&s.state==="succeeded")??n.find(s=>s.nominated===!0)??n.find(s=>s.state==="succeeded")??null,t}function fse(e){return e===null?{timestamp:null,bytesReceived:null,packetsReceived:null,packetsLost:null,framesDecoded:null,framesDropped:null,freezeCount:null,totalFreezesDurationS:null,totalDecodeTimeS:null,nackCount:null,pliCount:null}:{timestamp:Fn(e.timestamp),bytesReceived:Fn(e.bytesReceived),packetsReceived:Fn(e.packetsReceived),packetsLost:Fn(e.packetsLost),framesDecoded:Fn(e.framesDecoded),framesDropped:Fn(e.framesDropped),freezeCount:Fn(e.freezeCount),totalFreezesDurationS:Fn(e.totalFreezesDuration),totalDecodeTimeS:Fn(e.totalDecodeTime),nackCount:Fn(e.nackCount),pliCount:Fn(e.pliCount)}}var zC={spanMs:null,kbps:null,packetsReceived:null,packetsLost:null,lossPercent:null,framesDecoded:null,framesDropped:null,freezeCount:null,freezeMs:null,nackCount:null,pliCount:null,decodeMs:null};function hse(e,t){if(t===null)return zC;const n=Ja(e.timestamp,t.timestamp);if(n===null||n<=0)return zC;const a=Ja(e.bytesReceived,t.bytesReceived),s=Ja(e.packetsLost,t.packetsLost),p=Ja(e.packetsReceived,t.packetsReceived),f=Ja(e.framesDecoded,t.framesDecoded),m=Ja(e.totalDecodeTimeS,t.totalDecodeTimeS),h=Ja(e.totalFreezesDurationS,t.totalFreezesDurationS);return{spanMs:n,kbps:a===null?null:Math.round(a*8/n),packetsReceived:p,packetsLost:s,lossPercent:S4(s,p),framesDecoded:f,framesDropped:Ja(e.framesDropped,t.framesDropped),freezeCount:Ja(e.freezeCount,t.freezeCount),freezeMs:h===null?null:Math.round(h*1e3),nackCount:Ja(e.nackCount,t.nackCount),pliCount:Ja(e.pliCount,t.pliCount),decodeMs:m===null||f===null||f<=0?null:m/f*1e3}}function gse(e,t,n,a){if(t===null||n===null)return e;const s=e.at(-1);if(s!==void 0&&s.width===t&&s.height===n)return e;const p=[...e,{width:t,height:n,at:a}];return p.length>DC?p.slice(p.length-DC):p}function vse(e){const{inbound:t,codecs:n,candidates:a,pair:s}=mse(e.report),p=fse(t),f=t!==null?n.get(ai(t.codecId)??""):void 0,m=ai(f?.mimeType),h=ai(f?.sdpFmtpLine),c=s!==null?a.get(ai(s.localCandidateId)??""):void 0,x=s!==null?a.get(ai(s.remoteCandidateId)??""):void 0,M=ai(c?.candidateType),C=ai(x?.candidateType),E=Fn(t?.frameWidth),R=Fn(t?.frameHeight),_=p.totalFreezesDurationS,j=p.totalDecodeTimeS,D=p.framesDecoded;return{at:e.now,hasInboundVideo:t!==null,width:E,height:R,fps:Fn(t?.framesPerSecond),codec:m===null?null:m.split("/")[1]??m,codecProfileLevelId:pse(h),jitterMs:yse(t),packetsReceived:p.packetsReceived,packetsLost:p.packetsLost,lossPercent:S4(p.packetsLost,p.packetsReceived),nackCount:p.nackCount,pliCount:p.pliCount,framesDecoded:D,framesDropped:p.framesDropped,freezeCount:p.freezeCount,totalFreezeMs:_===null?null:Math.round(_*1e3),avgDecodeMs:j===null||D===null||D<=0?null:j/D*1e3,rttMs:bse(s),availableIncomingKbps:Sse(s),localCandidateType:M,remoteCandidateType:C,candidatePairType:M===null&&C===null?null:`${M??"?"}/${C??"?"}`,candidateProtocol:ai(c?.protocol),iceConnectionState:e.iceConnectionState,dtlsState:e.dtlsState,window:hse(p,e.prev?.raw??null),resolutionLog:gse(e.prev?.resolutionLog??[],E,R,e.now),raw:p}}function yse(e){const t=Fn(e?.jitter);return t===null?null:t*1e3}function bse(e){const t=Fn(e?.currentRoundTripTime);return t===null?null:t*1e3}function Sse(e){const t=Fn(e?.availableIncomingBitrate);return t===null?null:Math.round(t/1e3)}var xse={unknown:"no window yet",decoding:"decoding","decoder-stall":"DECODER STALL — bytes arriving, no frames out","transport-stall":"TRANSPORT STALL — nothing arriving","frozen-unknown":"frames stopped — byte rate unknown"};function x4(e){const t=kse(e);return{kind:t,label:xse[t]}}function kse(e){if(e===null||!e.hasInboundVideo)return"unknown";const t=e.window.framesDecoded;if(t===null)return"unknown";if(t>0)return"decoding";const n=e.window.kbps;return n===null?"frozen-unknown":n>0?"decoder-stall":"transport-stall"}var Bo="—";function Dt(e,t){if(e==null||!Number.isFinite(e))return Bo;const n=t?.digits??0;return`${e.toFixed(n)}${t?.suffix??""}`}function ei(e){return e==null||e===""?Bo:e}function cp(e){return e==null?Bo:e?"yes":"no"}function Xy(e,t){if(e===null)return Bo;const n=Math.max(0,t-e);return n<1e3?`${n}ms ago`:n<6e4?`${(n/1e3).toFixed(1)}s ago`:`${Math.floor(n/6e4)}m${Math.floor(n%6e4/1e3)}s ago`}var k4=3e3,wse={unknown:"bg-white/15 text-white/70",decoding:"bg-emerald-500/25 text-emerald-200","decoder-stall":"bg-amber-500/30 text-amber-100","transport-stall":"bg-rose-500/30 text-rose-100","frozen-unknown":"bg-white/15 text-white/70"};function ct({label:e,value:t,window:n,strong:a=!1}){return v.jsxs("div",{className:"flex items-baseline justify-between gap-2 leading-[1.25]",children:[v.jsx("span",{className:"text-white/55 shrink-0",children:e}),v.jsxs("span",{className:"flex items-baseline gap-1 text-right",children:[v.jsx("span",{className:a?"text-white font-semibold tabular-nums":"text-white/90 tabular-nums",children:t}),n!==void 0&&v.jsx("span",{className:"text-sky-300/80 tabular-nums",children:n})]})]})}function up({title:e,measuredAt:t,now:n}){const a=t!==null&&n-t>k4;return v.jsxs("div",{className:"flex items-baseline justify-between gap-3 mt-2 first:mt-0 pb-0.5 border-b border-white/20",children:[v.jsx("span",{className:"text-white/80 font-semibold tracking-wide uppercase text-[9px]",children:e}),v.jsxs("span",{className:a?"text-amber-300 text-[9px]":"text-white/45 text-[9px]",children:[a?"STALE · ":"",Xy(t,n)]})]})}var Mse={unknown:"bg-white/50",decoding:"bg-emerald-400","decoder-stall":"bg-amber-400","transport-stall":"bg-rose-400","frozen-unknown":"bg-white/50"};function Cse(e){const{stats:t,server:n,serverError:a,serverWired:s,now:p,sessionId:f}=e,m=x4(t),h=t?.window,[c,x]=T.useState(!1),M=t!==null&&p-t.at>k4;return c?v.jsxs("div",{className:"absolute bottom-10 left-2 z-20 transform-gpu w-[13.5rem] max-h-[70%] overflow-y-auto rounded-md bg-neutral-950/95 ring-1 ring-white/25 shadow-lg px-1.5 py-1 text-[9px] font-mono text-white/90 select-text","data-testid":"stream-debug-overlay",children:[v.jsx("button",{type:"button",onClick:()=>x(!1),className:`w-full text-left rounded px-1.5 py-0.5 mb-1 text-[9px] font-semibold ${wse[m.kind]}`,children:m.label}),v.jsx(up,{title:"decode",measuredAt:t?.at??null,now:p}),v.jsx(ct,{label:"framesDecoded",value:Dt(t?.framesDecoded),window:h?.framesDecoded===null?void 0:`+${Dt(h?.framesDecoded)}`,strong:!0}),v.jsx(ct,{label:"freezeCount",value:Dt(t?.freezeCount),strong:!0}),v.jsx(ct,{label:"frozen",value:Dt(t?.totalFreezeMs,{suffix:"ms"}),window:h?.freezeMs===null?void 0:`+${Dt(h?.freezeMs)}ms`,strong:!0}),v.jsx(ct,{label:"pliCount",value:Dt(t?.pliCount),window:h?.pliCount===null?void 0:`+${Dt(h?.pliCount)}`,strong:!0}),v.jsx(ct,{label:"framesDropped",value:Dt(t?.framesDropped)}),v.jsx(ct,{label:"decode",value:Dt(t?.avgDecodeMs,{digits:1,suffix:"ms"}),window:h?.decodeMs===null?void 0:`${Dt(h?.decodeMs,{digits:1})}ms`}),v.jsx(up,{title:"picture",measuredAt:t?.at??null,now:p}),v.jsx(ct,{label:"resolution",value:t?.width!==null&&t?.width!==void 0&&t.height!==null?`${t.width}×${t.height}`:Bo}),v.jsx(ct,{label:"fps",value:Dt(t?.fps)}),v.jsx(ct,{label:"codec",value:t?.codec===null||t?.codec===void 0?Bo:`${t.codec}${t.codecProfileLevelId!==null?` ${t.codecProfileLevelId}`:""}`}),(t?.resolutionLog.length??0)>1&&v.jsx("div",{className:"mt-0.5 text-white/60 leading-tight",children:t?.resolutionLog.map(C=>v.jsxs("div",{className:"flex justify-between",children:[v.jsxs("span",{children:[C.width,"×",C.height]}),v.jsx("span",{className:"text-white/40",children:Xy(C.at,p)})]},`${C.at}-${C.width}x${C.height}`))}),v.jsx(up,{title:"transport",measuredAt:t?.at??null,now:p}),v.jsx(ct,{label:"bitrate",value:Dt(h?.kbps,{suffix:" kbps"})}),v.jsx(ct,{label:"rtt",value:Dt(t?.rttMs,{digits:0,suffix:"ms"})}),v.jsx(ct,{label:"jitter",value:Dt(t?.jitterMs,{digits:1,suffix:"ms"})}),v.jsx(ct,{label:"packetsLost",value:Dt(t?.packetsLost),window:h?.packetsLost===null?void 0:`+${Dt(h?.packetsLost)}`}),v.jsx(ct,{label:"loss",value:Dt(t?.lossPercent,{digits:2,suffix:"%"}),window:h?.lossPercent===null?void 0:Dt(h?.lossPercent,{digits:2,suffix:"%"})}),v.jsx(ct,{label:"nackCount",value:Dt(t?.nackCount),window:h?.nackCount===null?void 0:`+${Dt(h?.nackCount)}`}),v.jsx(ct,{label:"candidate pair",value:ei(t?.candidatePairType)}),v.jsx(ct,{label:"protocol",value:ei(t?.candidateProtocol)}),v.jsx(ct,{label:"ice",value:ei(t?.iceConnectionState)}),v.jsx(ct,{label:"dtls",value:ei(t?.dtlsState)}),v.jsx(up,{title:"server",measuredAt:n?.observedAt??null,now:p}),s?a!==null?v.jsx("div",{className:"text-rose-300 leading-tight py-0.5 break-words",children:a}):n===null?v.jsx("div",{className:"text-white/50 leading-tight py-0.5",children:"waiting for the first answer…"}):n.alive?v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"served rung",value:ei(n.servedTier),strong:!0}),v.jsx(ct,{label:"adaptive",value:cp(n.adaptive)}),v.jsx(ct,{label:"source",value:ei(n.camStreamId)}),v.jsx(ct,{label:"source kind",value:n.sourceKind}),v.jsx(ct,{label:"ingest node",value:ei(n.ingestNodeId)}),v.jsx(ct,{label:"· remote",value:cp(n.ingestIsRemote)}),v.jsx(ct,{label:"egress leg",value:n.egressLeg,strong:!0}),v.jsx(ct,{label:"codec src→out",value:`${ei(n.sourceCodec)}→${ei(n.negotiatedCodec)}`}),v.jsx(ct,{label:"broker",value:ei(n.brokerStatus)}),v.jsx(ct,{label:"· bitrate",value:Dt(n.brokerBitrateKbps,{suffix:" kbps"})}),v.jsx(ct,{label:"· input fps",value:Dt(n.brokerInputFps)}),v.jsx(ct,{label:"rtp sent",value:Dt(n.rtpPacketsSent)}),v.jsx(ct,{label:"track mode",value:ei(n.trackMode)}),n.lastDecision===null?v.jsx(ct,{label:"ladder",value:"never moved"}):v.jsxs(v.Fragment,{children:[v.jsx(ct,{label:"ladder move",value:`${n.lastDecision.cause}${n.lastDecision.tier!==null?` → ${n.lastDecision.tier}`:""}`,strong:!0}),v.jsx(ct,{label:"· when",value:Xy(n.lastDecision.at,p)}),v.jsx(ct,{label:"· lossRatio",value:Dt(n.lastDecision.lossRatio,{digits:4})}),v.jsx(ct,{label:"· clientKbps",value:Dt(n.lastDecision.clientKbps,{suffix:" kbps"})}),v.jsx(ct,{label:"· stalledFor",value:Dt(n.lastDecision.stalledForMs,{suffix:"ms"})}),v.jsx(ct,{label:"· serverSending",value:cp(n.lastDecision.serverSending)}),v.jsx(ct,{label:"· transcode-down",value:cp(n.lastDecision.forcedTranscodeDown)})]}),v.jsx(ct,{label:"promotions",value:Dt(n.upgradeCount)}),n.tierFailures.length>0&&v.jsx(ct,{label:"tier failures",value:n.tierFailures.map(C=>`${C.tier}:${C.failures}`).join(" ")})]}):v.jsx("div",{className:"text-amber-300 leading-tight py-0.5",children:"session not found on the server — it ended, or this node never had it"}):v.jsxs("div",{className:"text-amber-300/90 leading-tight py-0.5",children:["not wired on this surface — this player was mounted without",v.jsx("span",{className:"text-white/80",children:" getSessionDebug"}),", so the server half cannot be asked"]}),f!==null&&v.jsx("div",{className:"mt-1 pt-0.5 border-t border-white/15 text-white/40 break-all leading-tight",children:f})]}):v.jsxs("button",{type:"button",onClick:()=>x(!0),className:"absolute bottom-10 left-2 z-20 transform-gpu flex items-center gap-1.5 rounded bg-neutral-950/90 ring-1 ring-white/20 px-1.5 py-0.5 text-[9px] font-mono text-white/85 tabular-nums select-text","data-testid":"stream-debug-pill",title:m.label,children:[v.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Mse[m.kind]}`}),v.jsx("span",{children:t?.width!==null&&t?.width!==void 0?`${t.width}×${t.height}`:Bo}),v.jsxs("span",{children:[Dt(t?.fps),"fps"]}),v.jsxs("span",{children:[Dt(h?.kbps),"k"]}),M&&v.jsx("span",{className:"text-amber-300",children:"stale"})]})}function Ao(e,t){e.muted=t;const n=e.srcObject;if(n instanceof MediaStream)for(const a of n.getAudioTracks())a.enabled=!t}function Ase(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function Ese(e,t,n){let f=0;for(let m=0;m<8;m++)for(let h=0;h<8;h++){const c=Math.min(t-1,Math.floor((h+.5)/8*t)),x=Math.min(n-1,Math.floor((m+.5)/8*n)),{data:M}=e.getImageData(c,x,1,1);.2126*(M[0]??0)+.7152*(M[1]??0)+.0722*(M[2]??0)>12&&f++}return f<=1}function iv(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 Ic=null,Rse=3e4;function qp(e){return cse(e,typeof window<"u"?woe():void 0)}async function Tc(e){const t=qp(e);if(t===null)return;if(Ic&&Ic.origin===t&&Date.now()-Ic.at<Rse)return Ic.mbps;const n=await dse(t,{fetchImpl:(a,s)=>fetch(a,s),now:()=>Date.now()});if(!(n===null||!Number.isFinite(n)))return Ic={origin:t,mbps:n,at:Date.now()},n}function LC(e,t,n,a){const s={...e,...n!==void 0?{downlinkMbps:n}:{},...t};return a?lse(s):s}var Ise=8e3;function w4({serverUrl:e,streamKey:t,label:n,autoPlay:a=!0,muted:s=!0,showControls:p=!0,showStats:f=!1,onDebugStats:m,onPlaybackStats:h,onClientNetworkSample:c,onConnectTiming:x,className:M="",onStateChange:C,onError:E,onReconnectAttempt:R,overlay:_,createSession:j,sendAnswer:D,handleOffer:z,getIceServers:F,addIceCandidate:L,getIceCandidates:Z,closeSession:ne,getSessionState:V,getSessionDebug:U,reoffer:pe,posterUrl:we,hintsOverride:ke,onAdaptiveHints:Ae,reconnectSignal:Ce,onControlChannel:Me,onVideoElement:Te}){const B=T.useRef(null),ue=T.useRef(null),ge=T.useRef(null),Re=T.useRef(new Set),fe=T.useRef(null),q=T.useRef(null),ee=T.useRef(0),X=T.useRef(!0),ye=T.useRef(Me);ye.current=Me;const te=T.useRef(Te);te.current=Te,T.useEffect(()=>(te.current?.(B.current),()=>te.current?.(null)),[]);const he=T.useRef(Ae);he.current=Ae;const Be=T.useRef(null),Ue=T.useCallback((le,Ne,at)=>{const At=he.current;if(!At)return;const Xe={phase:le,probeOrigin:at,...Ne},Nt=use(Xe);Nt!==Be.current&&(Be.current=Nt,At(Xe))},[]),re=T.useRef(null),Ee=T.useRef(null),nt=T.useRef(0),Ye=T.useRef(!1),St=T.useRef(!1),Le=T.useRef(async()=>{}),[qe,Ie]=T.useState("idle"),[Ge,Je]=T.useState(""),[Ct,dt]=T.useState(s),Tt=T.useRef(Ct);Tt.current=Ct;const[Yt,En]=T.useState(!1),[pn,Vn]=T.useState(!1),aa=Ase(),[pr,ia]=T.useState(!0),ga=T.useRef(null),it=T.useRef(!1);(D||j)&&(it.current=!0);const nn=it.current,Ta=T.useRef(!1);z&&(Ta.current=!0);const Gn=Ta.current,[Rn,_a]=T.useState(!1),In=T.useRef(null),[io,Yo]=T.useState(null),[Xo,li]=T.useState(!1),be=T.useCallback(()=>{const le=B.current;if(!(!le||le.readyState<2||!le.videoWidth||!le.videoHeight))try{const Ne=document.createElement("canvas");Ne.width=le.videoWidth,Ne.height=le.videoHeight;const at=Ne.getContext("2d");if(!at||(at.drawImage(le,0,0),Ese(at,Ne.width,Ne.height)))return;In.current=Ne.toDataURL("image/jpeg",.6)}catch{}},[]),xe=T.useCallback(le=>{Ie(le),le==="playing"&&_a(!0),C?.(le)},[C]),st=T.useCallback(()=>{if(fe.current?.abort(),fe.current=null,q.current&&(clearTimeout(q.current),q.current=null),Ee.current&&(clearTimeout(Ee.current),Ee.current=null),re.current=null,St.current=!1,nt.current=0,ge.current&&(ge.current.close(),ge.current=null),ne&&Re.current.size>0){for(const le of Re.current)ne(le).catch(()=>{});Re.current.clear()}},[ne]),Qt=T.useCallback(()=>{fe.current?.abort(),fe.current=null,q.current&&(clearTimeout(q.current),q.current=null),Ee.current&&(clearTimeout(Ee.current),Ee.current=null),re.current=null,St.current=!1,nt.current=0},[]),Zn=1e3,Qa=T.useCallback(le=>{if(!V||!pe)return;Ee.current&&(clearTimeout(Ee.current),Ee.current=null);const Ne=async()=>{if(X.current&&re.current===le){if(!St.current)try{const{pendingRenegotiation:at}=await V(le);if(X.current&&re.current===le&&at&&at.epoch>nt.current&&!St.current){nt.current=at.epoch,await Le.current(le,at.target);return}}catch{}!X.current||re.current!==le||(Ee.current=setTimeout(()=>{Ne()},Zn))}};Ee.current=setTimeout(()=>{Ne()},Zn)},[V,pe]),Jo=T.useCallback(async(le=!1,Ne=le)=>{if(!X.current||!j||!D)return;const at=le?ge.current:null,At=le?new Set(Re.current):null;le?Qt():st(),xe("connecting");const Xe=new AbortController;fe.current=Xe;try{const Nt=Ne?void 0:Tc(e),He=LC(iv(ue.current),ke,Ne?await Tc(e):void 0,!Ne);Ue(Ne?"probe-climb":"cold-start",He,qp(e));const{sessionId:et,sdpOffer:an,iceServers:Tn}=await j(He);if(Re.current.add(et),Nt!==void 0&&Nt.then(rt=>{rt===void 0||!jC(rt)||!X.current||Xe.signal.aborted||Ye.current||(Ye.current=!0,Jo(!0,!0))}),!X.current||Xe.signal.aborted){ne?.(et).catch(()=>{}),Re.current.delete(et);return}const Ve=new RTCPeerConnection({iceServers:[...Tn??[],{urls:"stun:stun.l.google.com:19302"}]});le||(ge.current=Ve);const Xt=new MediaStream;let sn=!1;const Dn=()=>{if(!(sn||!X.current)){if(sn=!0,ge.current=Ve,B.current&&(B.current.srcObject=Xt,Ao(B.current,Tt.current),B.current.play().catch(()=>{})),at&&at!==Ve)try{at.close()}catch{}if(At)for(const rt of At)Re.current.delete(rt),ne?.(rt).catch(()=>{})}};Ve.ontrack=rt=>{if(console.debug("[WebRTC] ontrack",rt.track.kind,rt.track.readyState),Xt.addTrack(rt.track),le){Dn();return}B.current&&(B.current.srcObject=Xt,Ao(B.current,Tt.current),B.current.play().catch(()=>{}))},Ve.oniceconnectionstatechange=()=>{if(!X.current)return;const rt=Ve.iceConnectionState;if(console.debug("[WebRTC] ICE state:",rt),rt==="connected"||rt==="completed")ee.current=0,le&&Dn(),xe("playing"),B.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),B.current.play().catch(()=>{}));else if(rt==="failed"||rt==="disconnected"||rt==="closed"){if(le&&!sn)try{Ve.close()}catch{}xe("disconnected"),Na()}},Ve.onicecandidateerror=rt=>{console.debug("[WebRTC] ICE candidate error:",rt)},console.debug("[WebRTC] Setting remote description (server offer)..."),await Ve.setRemoteDescription({type:"offer",sdp:an});const _n=await Ve.createAnswer();if(await Ve.setLocalDescription(_n),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await qC(Ve),!X.current)return;const mn=(Ve.localDescription?.sdp??"").split(`
82
+ `).filter(rt=>rt.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:mn,sessionId:et.slice(0,8)}),await D(et,Ve.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const qt=Ve,va=()=>{const rt=qt.connectionState;if(rt==="closed"||rt==="failed")return;const ui=B.current;ui&&ui.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${qt.iceConnectionState})`)};setTimeout(va,3e3),setTimeout(va,8e3)}catch(Nt){if(!X.current)return;const He=Nt instanceof Error?Nt.message:String(Nt);Je(He),xe("error"),E?.(He),Na()}},[e,t,j,D,st,Qt,ne,xe,E,ke,Ue]),Ml=T.useCallback(async()=>{if(X.current){st(),xe("connecting");try{const le=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});ge.current=le,le.addTransceiver("video",{direction:"recvonly"}),le.addTransceiver("audio",{direction:"recvonly"});const Ne=new MediaStream;le.ontrack=He=>{Ne.addTrack(He.track),B.current&&(B.current.srcObject=Ne,Ao(B.current,Tt.current),B.current.play().catch(()=>{}))},le.oniceconnectionstatechange=()=>{if(!X.current)return;const He=le.iceConnectionState;He==="connected"||He==="completed"?(ee.current=0,xe("playing"),B.current?.paused&&B.current.play().catch(()=>{})):(He==="failed"||He==="disconnected"||He==="closed")&&(xe("disconnected"),Na())};const at=await le.createOffer();if(await le.setLocalDescription(at),await qC(le),!X.current)return;const At=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,Xe=await fetch(At,{method:"POST",headers:{"Content-Type":"application/sdp"},body:le.localDescription?.sdp??""});if(!Xe.ok)throw new Error(`WHEP ${Xe.status}: ${Xe.statusText}`);const Nt=await Xe.text();await le.setRemoteDescription({type:"answer",sdp:Nt})}catch(le){if(!X.current)return;const Ne=le instanceof Error?le.message:String(le);Je(Ne),xe("error"),E?.(Ne),Na()}}},[e,t,st,xe,E]),Ri=T.useCallback(async(le=!1,Ne=le)=>{if(!X.current||!z)return;const at=le?ge.current:null,At=le?new Set(Re.current):null;le?Qt():st(),xe("connecting");const Xe=new AbortController;fe.current=Xe;const Nt=performance.now(),He=()=>Math.round(performance.now()-Nt),et={};try{const an=Ne?void 0:Tc(e),Tn=await F?.();if(et.iceServersMs=He(),!X.current||Xe.signal.aborted)return;const Ve=new RTCPeerConnection({iceServers:[...Tn??[],{urls:"stun:stun.l.google.com:19302"}]});le||(ge.current=Ve);const Xt=new MediaStream;let sn=!1;const Dn=()=>{if(!(sn||!X.current)){if(sn=!0,ge.current=Ve,B.current&&(B.current.srcObject=Xt,Ao(B.current,Tt.current),B.current.play().catch(()=>{})),at&&at!==Ve)try{at.close()}catch{}if(At)for(const xt of At)Re.current.delete(xt),ne?.(xt).catch(()=>{})}};Ve.ontrack=xt=>{if(et.firstTrackMs===void 0&&(et.firstTrackMs=He()),console.debug("[WebRTC] ontrack (client-offer)",xt.track.kind,xt.track.readyState),Xt.addTrack(xt.track),le){Dn();return}B.current&&(B.current.srcObject=Xt,Ao(B.current,Tt.current),B.current.play().catch(()=>{}))};let _n=!1;Ve.oniceconnectionstatechange=()=>{if(!X.current)return;const xt=Ve.iceConnectionState;if(console.debug("[WebRTC] ICE state (client-offer):",xt),xt==="connected"||xt==="completed"){if(!_n){_n=!0,et.iceConnectedMs=He(),console.info("[WebRTC timing] client-offer connected",{streamKey:t,...et}),x?.({...et});const Kn=B.current;Kn&&"requestVideoFrameCallback"in Kn&&(Kn.requestVideoFrameCallback(()=>{et.firstFrameMs=He(),console.info("[WebRTC timing] first decoded frame",{streamKey:t,firstFrameMs:et.firstFrameMs}),x?.({...et})}),setTimeout(()=>{X.current&&et.firstFrameMs===void 0&&(console.warn("[WebRTC timing] NO decoded frame (stalled)",{streamKey:t,sinceIceConnectedMs:He()-(et.iceConnectedMs??0),iceConnectedMs:et.iceConnectedMs,firstTrackMs:et.firstTrackMs}),es.current("no decoded frame after connect"),Na())},Ise))}ee.current=0,le&&Dn(),xe("playing"),B.current?.paused&&B.current.play().catch(()=>{})}else if(xt==="failed"||xt==="disconnected"||xt==="closed"){if(le&&!sn)try{Ve.close()}catch{}xe("disconnected"),Na()}};let mn=null;const qt=[];if(Ve.onicecandidate=xt=>{if(!xt.candidate)return;const Kn=xt.candidate.toJSON();mn&&L?L(mn,Kn).catch(()=>{}):qt.push(Kn)},Ve.addTransceiver("video",{direction:"recvonly"}),Ve.addTransceiver("audio",{direction:"recvonly"}),ye.current){const xt=Ve.createDataChannel("camstack-control");ye.current(xt)}const va=await Ve.createOffer();if(et.offerCreatedMs=He(),await Ve.setLocalDescription(va),et.localSetMs=He(),!X.current||Xe.signal.aborted)return;const rt=Ne?await Tc(e):void 0,ui=LC(iv(ue.current),ke,rt,!Ne);Ue(Ne?"probe-climb":"cold-start",ui,qp(e));const di=He(),{sessionId:Hn,sdpAnswer:Ze}=await z(Ve.localDescription?.sdp??va.sdp??"",void 0,ui);if(et.signalingRttMs=He()-di,mn=Hn,Re.current.add(Hn),an!==void 0&&an.then(xt=>{xt===void 0||!jC(xt)||!X.current||Xe.signal.aborted||Ye.current||(Ye.current=!0,Ri(!0,!0))}),re.current=Hn,!X.current||Xe.signal.aborted){ne?.(Hn).catch(()=>{}),Re.current.delete(Hn);return}if(L)for(const xt of qt)L(Hn,xt).catch(()=>{});if(qt.length=0,await Ve.setRemoteDescription({type:"answer",sdp:Ze}),et.answerSetMs=He(),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:Hn.slice(0,8)}),Z){const xt=new Set,Kn=Date.now(),Ka=async()=>{if(!(!X.current||Xe.signal.aborted)&&!(Ve.connectionState==="closed"||Ve.signalingState==="closed")){try{const{candidates:pi,done:oo}=await Z(Hn);for(const ji of pi){const Pi=ji.candidate??"";Pi&&!xt.has(Pi)&&(xt.add(Pi),Ve.addIceCandidate(new RTCIceCandidate(ji)).catch(()=>{}))}const Oi=Ve.iceConnectionState;if(oo||Date.now()-Kn>1e4||Oi==="connected"||Oi==="completed")return}catch{}setTimeout(()=>{Ka()},200)}};Ka()}Qa(Hn)}catch(an){if(!X.current)return;const Tn=an instanceof Error?an.message:String(an);Je(Tn),xe("error"),E?.(Tn),Na()}},[e,z,F,L,Z,ne,st,Qt,xe,E,Qa,ke,Ue]);Le.current=T.useCallback(async(le,Ne)=>{const at=pe;if(!X.current||!at)return;const At=ge.current;St.current=!0;try{let Xe=function(){if(an||!X.current){Dn();return}an=!0,ge.current=He,B.current&&(B.current.srcObject=et,B.current.play().catch(()=>{})),At&&At!==He&&At.close(),Dn()};const Nt=await F?.();if(!X.current)return;const He=new RTCPeerConnection({iceServers:[...Nt??[],{urls:"stun:stun.l.google.com:19302"}]}),et=new MediaStream;let an=!1,Tn=!1,Ve=null,Xt,sn;const Dn=()=>{sn!==void 0&&(clearTimeout(sn),sn=void 0);const Ze=Ve;if(Ve=null,!!Ze){Xt!==void 0&&typeof Ze.cancelVideoFrameCallback=="function"&&Ze.cancelVideoFrameCallback(Xt),Ze.removeEventListener("loadeddata",Xe);try{Ze.srcObject=null}catch{}Ze.remove()}},_n=()=>{if(Tn||an||!X.current)return;if(Tn=!0,typeof document>"u"){Xe();return}const Ze=document.createElement("video");Ze.muted=!0,Ze.playsInline=!0,Ze.autoplay=!0,Ze.style.cssText="position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",Ze.srcObject=et,Ve=Ze,(ue.current??document.body).appendChild(Ze),Ze.play().catch(()=>{}),typeof Ze.requestVideoFrameCallback=="function"&&(Xt=Ze.requestVideoFrameCallback(()=>Xe())),Ze.addEventListener("loadeddata",Xe,{once:!0}),sn=setTimeout(()=>Xe(),1800)};He.ontrack=Ze=>{console.debug("[WebRTC] ontrack (reoffer)",Ze.track.kind,Ze.track.readyState),et.addTrack(Ze.track),_n()},He.oniceconnectionstatechange=()=>{if(!X.current)return;const Ze=He.iceConnectionState;console.debug("[WebRTC] ICE state (reoffer):",Ze),Ze==="connected"||Ze==="completed"?(ee.current=0,_n(),xe("playing"),B.current?.paused&&B.current.play().catch(()=>{})):(Ze==="failed"||Ze==="closed")&&(Dn(),!an&&Ze==="failed"&&He.close(),xe("disconnected"),Na())};let mn=null;const qt=[];if(He.onicecandidate=Ze=>{if(!Ze.candidate)return;const xt=Ze.candidate.toJSON();mn&&L?L(mn,xt).catch(()=>{}):qt.push(xt)},He.addTransceiver("video",{direction:"recvonly"}),He.addTransceiver("audio",{direction:"recvonly"}),ye.current){const Ze=He.createDataChannel("camstack-control");ye.current(Ze)}const va=await He.createOffer();if(await He.setLocalDescription(va),!X.current){He.close();return}const rt=await Tc(e),ui={...iv(ue.current),...rt!==void 0?{downlinkMbps:rt}:{},...ke};Ue("renegotiate",ui,qp(e));const{sessionId:di,sdpAnswer:Hn}=await at(le,He.localDescription?.sdp??va.sdp??"",Ne,ui);if(!X.current){He.close();return}if(mn=di,Re.current.add(di),re.current=di,L)for(const Ze of qt)L(di,Ze).catch(()=>{});if(qt.length=0,await He.setRemoteDescription({type:"answer",sdp:Hn}),Z){const Ze=new Set,xt=Date.now(),Kn=async()=>{if(X.current&&!(He.connectionState==="closed"||He.signalingState==="closed")){try{const{candidates:Ka,done:pi}=await Z(di);for(const Oi of Ka){const ji=Oi.candidate??"";ji&&!Ze.has(ji)&&(Ze.add(ji),He.addIceCandidate(new RTCIceCandidate(Oi)).catch(()=>{}))}const oo=He.iceConnectionState;if(pi||Date.now()-xt>1e4||oo==="connected"||oo==="completed")return}catch{}setTimeout(()=>{Kn()},200)}};Kn()}Qa(di)}catch(Xe){console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll",Xe instanceof Error?Xe.message:String(Xe)),Qa(le)}finally{St.current=!1}},[e,pe,F,L,Z,xe,Qa,ke,Ue]);const Ii=Gn?Ri:nn?Jo:Ml,Cl=T.useRef(()=>{}),Al=T.useRef(R);Al.current=R;const es=T.useRef(()=>{});es.current=le=>{console.warn("[WebRTC] hard error",{streamKey:t,msg:le}),Je(le),E?.(le),xe("error")},Cl.current=Ii;const Na=T.useCallback(()=>{if(!X.current)return;const le=ee.current,Ne=rse(le);if(Al.current?.(Ne),Ne.kind==="exhausted"){es.current(`reconnect attempts exhausted (${Ne.attempts})`);return}ee.current+=1,q.current=setTimeout(()=>{X.current&&Cl.current()},Ne.delayMs)},[]);T.useEffect(()=>(X.current=!0,ee.current=0,a&&Ii(),()=>{X.current=!1,st()}),[]);const ts=T.useRef(!1);T.useEffect(()=>{if(a){if(Gn){if(!z)return}else if(nn){if(!j||!D)return}else return;ts.current||ge.current||(ts.current=!0,Ii())}},[a,Gn,nn,z,j,D,Ii]);const El=()=>{ee.current=0,Ii()},Rl=()=>{if(ee.current=0,ge.current&&Gn){Ri(!0);return}if(ge.current&&nn){Jo(!0);return}Ii()},Va=T.useRef(e),yn=T.useRef(t);T.useEffect(()=>{const le=Va.current!==e,Ne=yn.current!==t;if(Va.current=e,yn.current=t,!(!le&&!Ne)&&X.current){if(ee.current=0,Ye.current=!1,le){st(),Ii();return}Rl()}},[e,t]);const Pn=T.useRef(Ce);T.useEffect(()=>{Pn.current!==Ce&&(Pn.current=Ce,X.current&&Rl())},[Ce]);const mr=()=>{if(B.current){const le=!B.current.muted;Ao(B.current,le),dt(le)}},Il=async()=>{if(ue.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(ue.current.requestFullscreen){await ue.current.requestFullscreen();return}const le=B.current;le?.webkitEnterFullscreen&&le.webkitEnterFullscreen()}catch(le){console.warn(`Fullscreen toggle failed: ${le instanceof Error?le.message:le}`)}},Wm=async()=>{const le=B.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(Ne){console.warn(`PiP toggle failed: ${Ne instanceof Error?Ne.message:String(Ne)}`)}},Ym=()=>{if(!B.current)return;const le=document.createElement("canvas");le.width=B.current.videoWidth||1280,le.height=B.current.videoHeight||720;const Ne=le.getContext("2d");if(!Ne)return;Ne.drawImage(B.current,0,0);const at=document.createElement("a");at.download=`${t.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,at.href=le.toDataURL("image/jpeg",.92),at.click()};T.useEffect(()=>{const le=()=>En(!!document.fullscreenElement);document.addEventListener("fullscreenchange",le);const Ne=B.current;return Ne?.addEventListener("webkitbeginfullscreen",le),Ne?.addEventListener("webkitendfullscreen",le),()=>{document.removeEventListener("fullscreenchange",le),Ne?.removeEventListener("webkitbeginfullscreen",le),Ne?.removeEventListener("webkitendfullscreen",le)}},[]),T.useEffect(()=>{const le=B.current,Ne=typeof document<"u"&&document.pictureInPictureEnabled===!0,at=le!==null&&typeof le.webkitSetPresentationMode=="function";Vn(Ne||at)},[]);const[Tl,fr]=T.useState(null),[ns,Ti]=T.useState(null),[_i,ci]=T.useState(null),[hr,bn]=T.useState(()=>Date.now()),ro=f||m!==void 0;T.useEffect(()=>{if(!f)return;const le=setInterval(()=>bn(Date.now()),500);return()=>clearInterval(le)},[f]),T.useEffect(()=>{if(!ro){fr(null);return}const le={current:null};let Ne=!1;const at=async()=>{const Xe=ge.current;if(Xe)try{const Nt=await Xe.getStats();if(Ne)return;const He=vse({report:Nt,prev:le.current,now:Date.now(),iceConnectionState:Xe.iceConnectionState,dtlsState:Xe.connectionState});le.current=He,fr(He)}catch{}};at();const At=setInterval(()=>{at()},1e3);return()=>{Ne=!0,clearInterval(At)}},[ro]),T.useEffect(()=>{if(!ro||!U){Ti(null),ci(null);return}let le=!1;const Ne=async()=>{const At=re.current;if(At===null){ci("no session id on this player yet — nothing to ask the server about");return}try{const Xe=await U(At);if(le)return;Ti(Xe),ci(null)}catch(Xe){if(le)return;ci(Xe instanceof Error?Xe.message:String(Xe))}};Ne();const at=setInterval(()=>{Ne()},1e3);return()=>{le=!0,clearInterval(at)}},[ro,U]);const _l=T.useRef(m);_l.current=m,T.useEffect(()=>{if(m===void 0)return;const le=()=>{_l.current?.({at:Date.now(),verdict:x4(Ga.current).kind,sessionId:re.current,stats:Ga.current,server:Ni.current,serverError:ju.current,serverWired:U!==void 0})};le();const Ne=setInterval(le,1e3);return()=>clearInterval(Ne)},[m===void 0,U]);const Ga=T.useRef(null);Ga.current=Tl;const Ni=T.useRef(null);Ni.current=ns;const ju=T.useRef(null);ju.current=_i;const as=T.useRef(null);T.useEffect(()=>{if(!c){as.current=null;return}const le=async()=>{const at=ge.current;if(at)try{const At=await at.getStats();let Xe=0,Nt=0,He=0,et=0,an=0,Tn=0;At.forEach(mn=>{const qt=mn;qt.type==="inbound-rtp"&&(qt.kind??qt.mediaType)==="video"?(Xe=qt.packetsLost??0,Nt=qt.packetsReceived??0,He=qt.bytesReceived??0,et=qt.timestamp,an=qt.jitter??0):qt.type==="candidate-pair"&&qt.nominated&&typeof qt.currentRoundTripTime=="number"&&(Tn=qt.currentRoundTripTime)});const Ve=as.current;if(as.current={lost:Xe,recv:Nt,bytes:He,ts:et},!Ve||et<=Ve.ts)return;const Xt=Math.max(0,Xe-Ve.lost),sn=Xt+Math.max(0,Nt-Ve.recv),Dn=sn>0?Math.min(100,Xt/sn*100):0,_n=Math.max(0,Math.round((He-Ve.bytes)*8/(et-Ve.ts)));c({rttMs:Math.round(Tn*1e3),jitterMs:Math.round(an*1e3),estimatedBandwidthKbps:_n,packetLossPercent:Dn})}catch{}},Ne=setInterval(()=>{le()},2e3);return()=>clearInterval(Ne)},[c]);const is=T.useRef(null);T.useEffect(()=>{if(!h){is.current=null;return}const le=async()=>{const at=ge.current,At=B.current;if(at)try{const Xe=await at.getStats();let Nt=0,He=0,et=0,an=0,Tn=0,Ve=0,Xt=0,sn=0;Xe.forEach(va=>{const rt=va;rt.type==="inbound-rtp"&&(rt.kind??rt.mediaType)==="video"&&(Nt=rt.framesReceived??0,He=rt.framesDecoded??0,et=rt.framesDropped??0,an=rt.framesPerSecond??0,Tn=rt.freezeCount??0,Ve=rt.totalFreezesDuration??0,Xt=rt.jitterBufferDelay??0,sn=rt.jitterBufferEmittedCount??0)});const Dn=At?.currentTime??0,_n=Date.now(),mn=is.current,qt=sn>0?Math.round(Xt/sn*1e3):0;mn&&h({dRecv:Nt-mn.recv,dDec:He-mn.dec,dDrop:et-mn.drop,fps:Math.round(an),dFreeze:Tn-mn.freeze,freezeTotalMs:Math.round(Ve*1e3),avgJitterMs:qt,dCtMs:Math.round((Dn-mn.ct)*1e3),dtMs:_n-mn.ts,readyState:At?.readyState??-1}),is.current={recv:Nt,dec:He,drop:et,freeze:Tn,ct:Dn,ts:_n}}catch{}};le();const Ne=setInterval(()=>{le()},5e3);return()=>clearInterval(Ne)},[h]),T.useEffect(()=>{dt(s);const le=B.current;le&&(Ao(le,s),s||le.play().catch(()=>{}))},[s]);const Pu=()=>{aa||(ia(!0),ga.current&&clearTimeout(ga.current),ga.current=setTimeout(()=>ia(!1),3e3))},rs=()=>{ia(le=>!le),ga.current&&clearTimeout(ga.current)};T.useEffect(()=>{if(qe==="playing"){be();const le=setInterval(be,2e3);return()=>clearInterval(le)}Rn&&In.current&&Yo(In.current)},[qe,Rn,be]),T.useEffect(()=>{if(qe!=="playing"){li(!1);return}const le=B.current;if(!le)return;let Ne=!1;const at=()=>{Ne||li(!0)};let At;typeof le.requestVideoFrameCallback=="function"&&(At=le.requestVideoFrameCallback(()=>at())),le.addEventListener("loadeddata",at,{once:!0});const Xe=setTimeout(at,12e3);return()=>{Ne=!0,clearTimeout(Xe),At!==void 0&&typeof le.cancelVideoFrameCallback=="function"&&le.cancelVideoFrameCallback(At),le.removeEventListener("loadeddata",at)}},[qe]);const Oa=Rn&&io?io:we??null,Za=!Xo&&Oa!==null;return v.jsxs("div",{ref:ue,className:`relative isolate bg-black overflow-hidden group ${M}`,onMouseMove:Pu,onMouseEnter:Pu,onTouchStart:rs,children:[v.jsx("video",{ref:B,autoPlay:a,muted:Ct,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),Za&&Oa&&v.jsx("img",{src:Oa,alt:"",className:"absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"}),n&&qe==="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&&v.jsx(Cse,{stats:Tl,server:ns,serverError:_i,serverWired:U!==void 0,now:hr,sessionId:re.current}),_,p&&!Oa&&qe==="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&&!Oa&&(qe==="error"||qe==="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:qe==="error"?Ge||"Connection failed":"Disconnected"}),v.jsx("button",{onClick:El,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&&Oa&&(qe==="connecting"||qe==="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&&Oa&&qe==="error"&&v.jsx("button",{onClick:El,title:Ge||"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&&qe!=="idle"&&qe!=="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 ${aa||pr?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(dp,{onClick:mr,title:Ct?"Unmute":"Mute",children:Ct?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(dp,{onClick:Ym,title:"Take snapshot",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("path",{d:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"}),v.jsx("circle",{cx:"12",cy:"13",r:"4"})]})}),pn&&v.jsx(dp,{onClick:Wm,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(dp,{onClick:Il,title:Yt?"Exit fullscreen":"Fullscreen",children:Yt?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 dp({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 qC(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 rv=["day","ir"],Tse={day:"Daylight",ir:"Night (IR)",night:"Night",dawn:"Dawn",dusk:"Dusk"};function Bp(e){return Tse[e]??e}function Fve(e){const t=new Set(e.coveredConditions),n=rv.map(f=>`${Bp(f)} ${t.has(f)?"✓":"✗"}`),a=[...t].filter(f=>!rv.some(m=>m===f));for(const f of a)n.push(`${Bp(f)} ✓`);const s=rv.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=>Bp(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 _se(e){if(e.suspendedCondition===null)return null;const t=Bp(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 Nse={"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 Uve(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?Nse[e.unavailable]:"can’t tell right now.";const n=e.verdict==="diverged"?e.divergedAt:e.armedAt,a=n!==null?` for ${jse(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=_se(e);return s!==null?s:e.verdict==="diverged"?`CHANGED${a}`:`Normal${a}`}function Hve(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 Ose=.4;function $ve(e){return e.width*e.height>Ose}function jse(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 Qve="text-[10px] text-foreground-subtle",Pse={face:"#a855f7",plate:"#ec4899"};Object.freeze({...Object.fromEntries(Object.values(Vb).filter(e=>e.category==="detection"||e.kind==="motion").map(e=>[e.kind,e.color])),...Pse});var Dse=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 Dse}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)}},zse=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 Lse(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 qse(e,t){const n=Lse(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 bl(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function Fp(e,t){return e.indexOf(t)!==-1}function BC(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var Bse=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return qse(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Fse=e=>Object.prototype.toString.call(e).slice(8,-1),C4=e=>typeof e>"u",Use=e=>e===null,du=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Jy=e=>du(e)&&Object.keys(e).length===0,Yr=e=>Array.isArray(e),Hse=e=>typeof e=="string",$se=e=>typeof e=="number"&&!isNaN(e),Qse=e=>typeof e=="boolean",Vse=e=>e instanceof RegExp,pu=e=>e instanceof Map,mu=e=>e instanceof Set,A4=e=>Fse(e)==="Symbol",Gse=e=>e instanceof Date&&!isNaN(e.valueOf()),E4=e=>e instanceof Error,FC=e=>typeof e=="number"&&isNaN(e),Zse=e=>Qse(e)||Use(e)||C4(e)||$se(e)||Hse(e)||A4(e),Kse=e=>typeof e=="bigint",Wse=e=>e===1/0||e===-1/0,Yse=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Xse=e=>e instanceof URL,eb=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),ov=e=>e.map(String).map(eb).join("."),Vc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function Si(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var R4=[Si(C4,"undefined",()=>null,()=>{}),Si(Kse,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),Si(Gse,"Date",e=>e.toISOString(),e=>new Date(e)),Si(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}),Si(Vse,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Si(mu,"set",e=>[...e.values()],e=>new Set(e)),Si(pu,"map",e=>[...e.entries()],e=>new Map(e)),Si(e=>FC(e)||Wse(e),"number",e=>FC(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Si(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Si(Xse,"URL",e=>e.toString(),e=>new URL(e))];function Vm(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var I4=Vm((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}),Jse=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),T4=Vm(Yse,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Jse[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function _4(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var N4=Vm(_4,(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=Vm((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)}),ele=[N4,I4,O4,T4],UC=(e,t)=>{const n=BC(ele,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=BC(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 tle=(e,t,n)=>{if(Yr(t))switch(t[0]){case"symbol":return I4.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)}},al=(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(Fp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Fp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Fp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var nle=(e,t)=>{P4(t);for(let n=0;n<t.length;n++){const a=t[n];if(mu(e))e=al(e,+a);else if(pu(e)){const s=+a,p=+t[++n]==0?"key":"value",f=al(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},tb=(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(Yr(a)){const m=+f;a=a[m]}else if(du(a))a=a[f];else if(mu(a)){const m=+f;a=al(a,m)}else if(pu(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=al(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if(Yr(a)?a[+s]=n(a[+s]):du(a)&&(a[s]=n(a[s])),mu(a)){const p=al(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(pu(a)){const p=+t[t.length-2],f=al(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 nb(e,t,n,a=[]){if(!e)return;const s=D4(n);if(!Yr(e)){bl(e,(m,h)=>nb(m,t,n,[...a,...Vc(h,s)]));return}const[p,f]=e;f&&bl(f,(m,h)=>{nb(m,t,n,[...a,...Vc(h,s)])}),t(p,a)}function ale(e,t,n,a){return nb(t,(s,p)=>{e=tb(e,p,f=>tle(f,s,a))},n),e}function ile(e,t,n){const a=D4(n);function s(p,f){const m=nle(e,Vc(f,a));p.map(h=>Vc(h,a)).forEach(h=>{e=tb(e,h,()=>m)})}if(Yr(t)){const[p,f]=t;p.forEach(m=>{e=tb(e,Vc(m,a),()=>e)}),f&&bl(f,s)}else bl(t,s);return e}var rle=(e,t)=>du(e)||Yr(e)||pu(e)||mu(e)||E4(e)||_4(e,t);function ole(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function sle(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(ov):n[ov(p)]=f.map(ov)}),a?Jy(n)?[a]:[a,n]:Jy(n)?void 0:n}var z4=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=Zse(e);if(!m){ole(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!rle(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(Fp(p,e))return{transformedValue:null};const h=UC(e,n),c=h?.value??e,x=Yr(c)?[]:{},M={};bl(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=z4(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,Yr(_.annotations)?M[eb(R)]=_.annotations:du(_.annotations)&&bl(_.annotations,(j,D)=>{M[eb(R)+"."+D]=j})});const C=Jy(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function L4(e){return Object.prototype.toString.call(e).slice(8,-1)}function HC(e){return L4(e)==="Array"}function lle(e){if(L4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function cle(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 ab(e,t={}){if(HC(e))return e.map(s=>ab(s,t));if(!lle(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||HC(t.props)&&!t.props.includes(p))return s;const f=e[p];return cle(s,p,ab(f,t),e,t.nonenumerable),s},{})}var Gt=class{constructor({dedupe:e=!1}={}){this.classRegistry=new zse,this.symbolRegistry=new M4(t=>t.description??""),this.customTransformerRegistry=new Bse,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=sle(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:ab(n);return a?.values&&(s=ale(s,a.values,a.v??0,this)),a?.referentialEqualities&&(s=ile(s,a.referentialEqualities,a.v??0)),s}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Gt.defaultInstance=new Gt;Gt.serialize=Gt.defaultInstance.serialize.bind(Gt.defaultInstance);Gt.deserialize=Gt.defaultInstance.deserialize.bind(Gt.defaultInstance);Gt.stringify=Gt.defaultInstance.stringify.bind(Gt.defaultInstance);Gt.parse=Gt.defaultInstance.parse.bind(Gt.defaultInstance);Gt.registerClass=Gt.defaultInstance.registerClass.bind(Gt.defaultInstance);Gt.registerSymbol=Gt.defaultInstance.registerSymbol.bind(Gt.defaultInstance);Gt.registerCustom=Gt.defaultInstance.registerCustom.bind(Gt.defaultInstance);Gt.allowErrorProps=Gt.defaultInstance.allowErrorProps.bind(Gt.defaultInstance);T.createContext(null);We.AddonStarted+"",We.AddonInstalled+"",We.AddonRestarted+"",We.AddonUpdated+"",We.AddonStopped+"",We.AddonUninstalled+"",We.AddonCrashed+"",We.AddonError+"",We.DetectionPhaseTransition+"",We.DetectionResult+"",We.DetectionEvent+"",We.DetectionCameraNative+"",We.ProviderMotion+"",We.MotionOnMotionChanged+"",We.MotionAnalysis+"",We.MotionZonesRaw+"",We.ProviderDetection+"",We.PipelineAudioInferenceResult+"",We.AgentOnline+"",We.AgentOffline+"",We.DeviceRegistered+"",We.DeviceUnregistered+"",We.DeviceStateChanged+"",We.EventEmitted+"";var ule=Object.freeze([...new Set(Object.values(We))].toSorted()),dle=Object.freeze([We.PipelineCameraMetricsSnapshot,We.PipelineRunnerLoadSnapshot,We.PipelineEngineMetricsSnapshot,We.PipelineInferenceResult,We.PipelineTrace,We.PipelineProgress,We.StreamBrokerMetricsSnapshot,We.MetricsNodeResourcesSnapshot,We.MetricsNodeProcessesSnapshot,We.ClusterTopologySnapshot,We.MotionAnalysis,We.MotionZonesRaw,We.DetectionResult,We.PipelineAudioInferenceResult,We.PlatformProbePhase,We.BenchmarkProgress,We.ModelDownloadProgress]),ple=new Set(dle);Object.freeze(ule.filter(e=>!ple.has(e)));Object.freeze([...new Set(cee.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 mle({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 fle=2,$C=270,hle=315;function gle(e){const t=(e-135+360)%360;return t>$C?t<=hle?1:0:t/$C}function Up({fraction:e,color:t,knobTopPx:n,onDragFraction:a}){const s=-135+e*270,p=T.useRef(null),[f,m]=T.useState(!1),h=a!==void 0,c=n??fle,x=E=>{a!==void 0&&(E.preventDefault(),E.stopPropagation(),E.currentTarget.setPointerCapture?.(E.pointerId),m(!0))},M=E=>{if(a===void 0||!f)return;const R=p.current;if(R===null)return;const _=R.getBoundingClientRect(),j=_.left+_.width/2,D=_.top+_.height/2;a(gle(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:c,border:`3px solid ${t}`},...h?{onPointerDown:x,onPointerMove:M,onPointerUp:C,onPointerCancel:C}:{}})})}function ib({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 er=150,Hp=64,vle=er/2,rb=2*Math.PI*Hp,sv=rb*(270/360);function B4({fraction:e,color:t,children:n,onDragFraction:a}){const s=Math.min(1,Math.max(0,e)),p=er/2,f=er/2,m=rb-sv,h=s*sv;return v.jsxs("div",{className:"relative",style:{width:er,height:er},children:[v.jsxs("svg",{width:er,height:er,viewBox:`0 0 ${er} ${er}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:p,cy:f,r:Hp,fill:"none",stroke:"var(--color-border)",strokeWidth:11,strokeDasharray:`${sv} ${m}`,strokeLinecap:"round"}),v.jsx("circle",{cx:p,cy:f,r:Hp,fill:"none",stroke:t,strokeWidth:11,strokeDasharray:`${h} ${rb-h}`,strokeLinecap:"round"})]}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Up,{fraction:s,color:t,knobTopPx:vle-Hp-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 q0({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 yle({trpc:e,deviceId:t}){const n=_u(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(B_,{className:"h-3 w-3"}),v.jsx("span",{children:"Press"})]})}function ble({trpc:e,deviceId:t}){const n=_u(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(B_,{className:"h-6 w-6"})}),v.jsx("span",{className:"text-sm font-medium text-foreground",children:"Press"})]})}var Sle=4e3;function QC(e){if(e!==void 0)return e!==null&&typeof e=="object"&&"lastChangedAt"in e&&typeof e.lastChangedAt=="number"?e.lastChangedAt:e}function zt(e,t){const n=t?.enabled!==!1,a=t?.timeoutMs??Sle,[s,p]=T.useState(void 0),f=T.useRef(void 0),m=T.useRef(void 0),h=T.useRef(!1),c=T.useRef(void 0),x=T.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0),f.current=void 0,h.current=!1,m.current=void 0,p(void 0)},[]);T.useEffect(()=>{if(!n||!h.current)return;const C=QC(e),E=m.current;C!==void 0&&C!==E&&x()}),T.useEffect(()=>()=>{c.current!==void 0&&clearTimeout(c.current)},[]);const M=T.useCallback(C=>{if(!n)return;c.current!==void 0&&(clearTimeout(c.current),c.current=void 0);const E=f.current??e;if(E!==void 0){const R={...E,...C};f.current=R,p(R)}m.current=QC(e),h.current=!0,c.current=setTimeout(x,a)},[n,e,x,a]);return n?{display:s!==void 0?s:e,applyOptimistic:M}:{display:e,applyOptimistic:()=>{}}}function xle(e){return e instanceof Error?e.message:String(e)}function kle({trpc:e,deviceId:t,layout:n,optimistic:a,features:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:B=>B.lockControl,slice:B=>B.state.lockControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:a??!0}),[x,M]=T.useState(null),[C,E]=T.useState(!1),[R,_]=T.useState(null);if(h===void 0)return null;const j=h.state==="locked"||h.state==="locking",D=!m||h.state==="jammed",z=s?.includes(ma.LockOpen)===!0,F=n==="compact",L=()=>{c({state:"locking"}),p?.lock({})},Z=()=>{c({state:"unlocking"}),p?.unlock({})},ne=()=>{p?.open({})},V=()=>{if(!D){if(!j){L();return}if(F){_(null),M("unlock");return}Z()}},U=()=>{if(!D){if(F){_(null),M("open");return}ne()}},pe=()=>{C||M(null)},we=async()=>{if(!(C||x===null)){_(null),E(!0);try{x==="unlock"?(c({state:"unlocking"}),await p?.unlock({})):await p?.open({}),M(null)}catch(B){_(xle(B))}finally{E(!1)}}},ke=j?"Unlock":"Lock",Ae=x==="open"?"Open door?":"Unlock device?",Ce=x==="open"?"This will release the latch and open the door.":"This will unlock the device.",Me=x==="open"?"Confirm open":"Confirm unlock",Te=x==="open"?v.jsx(hl,{className:"h-4 w-4 text-amber-400"}):v.jsx(Ly,{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":ke,title:h.state==="jammed"?"Jammed":ke,disabled:D,onClick:B=>{B.stopPropagation(),V()},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(Ly,{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:B=>{B.stopPropagation(),U()},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(hl,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:"Open"})]}),F&&v.jsx(y4,{open:x!==null,onOpenChange:B=>{B||pe()},children:v.jsxs(L0,{width:"sm",onClick:B=>B.stopPropagation(),children:[v.jsxs(ese,{children:[v.jsxs(nse,{className:"flex items-center gap-2",children:[Te,Ae]}),v.jsx(ase,{children:Ce})]}),R!==null&&v.jsx("div",{className:"mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10 text-xs text-danger",children:R}),v.jsxs(tse,{children:[v.jsx(Yy,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:()=>pe(),children:"Cancel"}),v.jsxs(Yy,{type:"button",variant:"danger",size:"sm","aria-label":Me,disabled:C,onClick:()=>{we()},children:[C&&v.jsx(w0,{className:"h-3.5 w-3.5 animate-spin"}),Me]})]})]})})]})}function B0({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:R=>R.switch,slice:R=>R.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),[h,c]=T.useState(!1);if(f===void 0)return null;const x=f.on===!0,M=h||!p,C={transform:x?"translateX(14px)":"translateX(2px)"},E=async()=>{if(M||!a)return;const R=!x;m({on:R}),c(!0);try{await a.setState({on:R})}finally{c(!1)}};return v.jsx("button",{type:"button","aria-pressed":x,title:x?"Turn off":"Turn on",disabled:M,onClick:R=>{R.stopPropagation(),E()},className: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",M&&"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 wle({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:x=>x.brightness,slice:x=>x.state.brightness}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(m===void 0)return null;const c=!f;return v.jsxs("label",{className: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:c,onChange:x=>{const M=Number(x.target.value);h({percentage:M}),c||s?.setBrightness({percentage:M})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[m.percentage,"%"]})]})}function Mle({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:_=>_.fanControl,slice:_=>_.state.fanControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=n??[],C=M.includes("fan-speed"),E=M.includes("fan-preset"),R=f?.percentageStep!=null&&f.percentageStep>0?f.percentageStep:1;return v.jsxs("div",{className: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:_=>{const j=Number(_.target.value),D=Math.min(100,Math.max(0,Math.round(j/R)*R));c({percentage:D}),x||p?.setPercentage({percentage:D})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.percentage??"—","%"]})]}),E&&h.availablePresets.length>0&&v.jsx("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:v.jsxs("select",{"aria-label":"Fan preset",value:h.preset,disabled:x,onChange:_=>{const j=_.target.value;!x&&j&&(c({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(_=>v.jsx("option",{value:_,children:_},_))]})})]})}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"},F4={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"},Cle={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 Ale({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:E=>E.climateControl,slice:E=>E.state.climateControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(p===void 0||h===void 0)return null;const x=!m;if(a==="compact")return v.jsxs("div",{"data-mode":h.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",F4[h.mode]),children:h.target!==null?v.jsxs(v.Fragment,{children:[h.target,"°",h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",h.currentTemp,"°)"]})]}):h.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}):null}),h.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;c({target:R}),p.setTarget({target:R})}},className: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;c({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||(c({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 M=h.mode==="heat_cool"||h.targetLow!==null&&h.targetHigh!==null,C=!M&&h.target!==null;return v.jsxs("div",{"data-mode":h.mode,className: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;c({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;c({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||(c({mode:E}),p.setMode({mode:E}))},className:se("rounded px-1.5 py-0.5 text-xs transition-colors",E===h.mode?Cle[E]:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:E},E))}),M&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"Low"}),v.jsx("input",{"aria-label":"Target low",type:"number",step:.5,value:h.targetLow??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetHigh??R;c({targetLow:R}),p.setTargetRange({targetLow:R,targetHigh:_})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]}),v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"High"}),v.jsx("input",{"aria-label":"Target high",type:"number",step:.5,value:h.targetHigh??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetLow??R;c({targetHigh:R}),p.setTargetRange({targetLow:_,targetHigh:R})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]})]}),h.availableFanModes.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Fan"}),v.jsxs("select",{"aria-label":"Fan mode",value:h.fanMode,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({fanMode:R}),p.setFanMode({fanMode:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableFanModes.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.availablePresets.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Preset",value:h.preset,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({preset:R}),p.setPreset({preset:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.targetHumidity!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Humidity"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:0,max:100,step:1,value:h.targetHumidity,disabled:x,onChange:E=>{const R=Number(E.target.value);c({targetHumidity:R}),x||p.setTargetHumidity({targetHumidity:R})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.targetHumidity,"%"]})]})]})}var Ele={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"},Rle={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"},U4=["off","all","one"];function Ile(e){return U4.includes(e)}var Tle={off:"Off",all:"All",one:"One"};function _le(e){return e==="playing"||e==="buffering"?"pause":"play"}function Nle({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:C=>C.mediaPlayer,slice:C=>C.state.mediaPlayer}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=_le(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",Ele[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",Rle[h.state])}),v.jsx("button",{type:"button","aria-label":M==="play"?"Play":"Pause",disabled:x,onClick:C=>{C.stopPropagation(),!x&&(M==="play"?(c({state:"playing"}),p?.play({})):(c({state:"paused"}),p?.pause({})))},className: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:M==="play"?"▶":"⏸"})]}),a==="full"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Previous",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.previous({})},className: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);c({volumeLevel:E}),x||p?.setVolume({volumeLevel:E})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.volumeLevel,"%"]})]}),h.isMuted!==null&&v.jsx("button",{type:"button","aria-label":h.isMuted?"Unmute":"Mute",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.isMuted!==null){const E=!h.isMuted;c({isMuted:E}),p?.setMute({muted:E})}},className: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&&(c({source:E}),p?.selectSource({source:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableSources.map(C=>v.jsx("option",{value:C,children:C},C))]})]}),h.shuffle!==null&&v.jsx("button",{type:"button","aria-label":"Shuffle",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.shuffle!==null){const E=!h.shuffle;c({shuffle:E}),p?.setShuffle({shuffle:E})}},className: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&&Ile(E)&&(c({repeat:E}),p?.setRepeat({repeat:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:U4.map(C=>v.jsx("option",{value:C,children:Tle[C]},C))})]})]})]})}function Gc(e,t){return t!==void 0?e.toFixed(t):Number.isInteger(e)?String(e):e.toFixed(1)}var Ole=/^(\d{4})-(\d{2})-(\d{2})/,jle=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function Ple(e,t){const n=Ole.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 Dle(e,t){const n=jle.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 zle(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 U0(e,t,n){return e===""?e:t==="date"?Ple(e,n):t==="time"?Dle(e,n):zle(e,n)}function Lle(e){return e.slice(0,10)}function qle(e){return e.slice(0,5)}function Ble(e){return(e.includes("T")?e:e.replace(" ","T")).slice(0,16)}function Fle({value:e,busy:t,onCommit:n,unit:a,min:s,max:p,step:f,precision:m}){const[h,c]=T.useState(Gc(e,m)),x=Number(h),M=h!==""&&!Number.isNaN(x),C=f??1,E=_=>{let j=_;return s!==void 0&&(j=Math.max(s,j)),p!==void 0&&(j=Math.min(p,j)),j},R=()=>{!t&&M&&n(E(x))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Decrement",disabled:t,onClick:_=>{if(_.stopPropagation(),!t){const j=E(e-C);c(Gc(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:_=>{c(_.target.value);const j=Number(_.target.value);_.target.value!==""&&!Number.isNaN(j)&&(t||n(E(j)))},onBlur:R,onKeyDown:_=>{_.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:_=>{if(_.stopPropagation(),!t){const j=E(e+C);c(Gc(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 Ule({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 Hle({slice:e,busy:t,setValueFn:n,layout:a}){switch(e.kind){case"numeric":return v.jsx(Fle,{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(Ule,{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:U0(s,p)}):v.jsx("input",{type:p==="date"?"date":p==="time"?"time":"datetime-local","aria-label":"Control value",disabled:t,value:p==="date"?Lle(s):p==="time"?qle(s):Ble(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}=gt({trpc:e,deviceId:t,cap:C=>C.control,slice:C=>C.state.control}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=C=>{!x&&p&&(c({value:C.control.value}),p.setValue(C))};return v.jsx("div",{"data-kind":h.kind,className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-border px-2 py-1 transition-colors",children:v.jsx(Hle,{slice:h,busy:x,setValueFn:M,layout:a})})}var $le=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&&kee(a,s)?{unit:s,precision:n,toDisplayValue:p=>xee(p,a,s)??p}:{unit:a??"",precision:n,toDisplayValue:$le}}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 Qle(e){return typeof e=="object"&&e!==null}function Vle(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function Zc(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 Gle(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}function Zle({trpc:e,device:t}){const n=t.role!=null?Z4[t.role]:void 0,a=V4(t.role),{data:s}=X_({},{staleTime:6e4}),p=_u(e,t.id),f=qo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=qo(p!==null&&n?.kind==="numeric"?p.state.enumSensor:void 0),h=qo(p!==null&&a?p.state.binary:void 0),c=a&&n?.kind==="numeric"&&!G4(f,n.field)&&h!==void 0,x=c?Q4:n,M=c?h:f;if(x===void 0||M===void 0)return null;if(x.kind==="numeric"){if(!K4(M))return null;const E=M[x.field];if(typeof E!="number")return null;const R=M.lastFetchedAt,_=E===0&&R===0;if(_&&Zc(m)&&m.value!=="")return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:m.value});if(_)return null;const j=M,D=typeof j.unit=="string"?j.unit:void 0,z=typeof j.precision=="number"?j.precision:void 0,F=$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}),L=F.unit,Z=Gc(F.toDisplayValue(E),F.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}),L&&v.jsx("span",{className:"text-foreground-subtle",children:L})]})}if(x.kind==="binary"){if(!Qle(M))return null;const R=!!M[x.field],_=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:_})}if(x.kind==="string")return!Zc(M)||M.value===""?null:v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:M.value});if(x.kind==="datetime"){if(!Zc(M)||M.value==="")return null;const E=W4(M)??x.format,R=U0(M.value,E);return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:R})}if(!Vle(M))return null;const C=Gle(M.state);return v.jsx("span",{className:se("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",M.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:C})}function Gm(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 Kle(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function lv({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",Kle(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Wle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.cover,slice:M=>M.state.cover}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=Gm(f?.state),c=!p,x=(M,C)=>{c||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(lv,{label:"Open",busy:c,variant:h.up,onClick:()=>x(a?.open,{state:"opening"}),children:v.jsx(Bm,{className:"h-3.5 w-3.5"})}),v.jsx(lv,{label:"Stop",busy:c,variant:h.stop,onClick:()=>x(a?.stop,{state:"stopped"}),children:v.jsx(Iu,{className:"h-3 w-3"})}),v.jsx(lv,{label:"Close",busy:c,variant:h.down,onClick:()=>x(a?.close,{state:"closing"}),children:v.jsx(Go,{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 cv({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 Yle({position:e,interactive:t,onSetPosition:n}){const a=(1-e/100)*100,s=T.useRef(null),p=T.useRef(!1),f=T.useRef(null),m=C=>{const E=s.current;if(E===null)return e;const R=E.getBoundingClientRect();if(R.height<=0)return e;const _=(C-R.top)/R.height,j=Math.round(100-_*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))},c=C=>{t&&(C.stopPropagation(),C.preventDefault(),p.current=!0,f.current=null,C.currentTarget.setPointerCapture(C.pointerId),h(C.clientY))},x=C=>{!t||!p.current||(C.stopPropagation(),h(C.clientY))},M=C=>{!t||!p.current||(C.stopPropagation(),p.current=!1,f.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))};return v.jsxs("div",{ref:s,"data-testid":"cover-window",...t?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e}:{"aria-hidden":"true"},onPointerDown:t?c:void 0,onPointerMove:t?x:void 0,onPointerUp:t?M:void 0,onPointerCancel:t?M:void 0,className: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 Xle({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 Jle({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:z=>z.cover,slice:z=>z.state.cover}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(ma.CoverPositionable),M=(n??[]).includes(ma.CoverTilt),C=Gm(m?.state),E=m?.position??null,R=E!==null,_=m?.state==="open"||m?.state==="opening",j=(z,F)=>{c||!z||(F!==void 0&&h(F),z({}))},D=z=>{c||(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(Yle,{position:E,interactive:x,onSetPosition:x?D:void 0}):v.jsx(Xle,{isOpen:_}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:"text-3xl font-semibold capitalize text-foreground",children:m?.state??"—"})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(cv,{label:"Open",busy:c,variant:C.up,onClick:()=>j(s?.open,{state:"opening"}),children:v.jsx(Bm,{className:"h-5 w-5"})}),v.jsx(cv,{label:"Stop",busy:c,variant:C.stop,onClick:()=>j(s?.stop,{state:"stopped"}),children:v.jsx(Iu,{className:"h-4 w-4"})}),v.jsx(cv,{label:"Close",busy:c,variant:C.down,onClick:()=>j(s?.close,{state:"closing"}),children:v.jsx(Go,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange: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,"%"]})]}),M&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Tilt"}),v.jsx("input",{"aria-label":"Tilt position",type:"range",min:0,max:100,step:1,value:m?.tiltPosition??0,disabled:c,className:"flex-1",onChange:z=>{const F=Number(z.target.value);h({tiltPosition:F}),c||s?.setTiltPosition({tiltPosition:F})}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[m?.tiltPosition??"—","%"]})]})]})}function ece(e){return v.jsx("span",{className:"text-foreground-subtle text-xs select-none","aria-hidden":"true",children:"—"})}function tce(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 nce(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 ace({trpc:e,deviceId:t}){const{data:n}=J_({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(Zle,{trpc:e,device:nce(n)})}function ice(e){return typeof e=="object"&&e!==null}function rce(e){return typeof e=="object"&&e!==null}function oce(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function sce(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}var lce={low:"bg-danger",medium:"bg-warning",high:"bg-success"};function cce(e){return e<=20?"low":e<=50?"medium":"high"}function uce({percent:e}){const t=Math.min(100,Math.max(0,e)),n=cce(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",lce[n]),style:{width:`${t}%`}})})}function dce({trpc:e,device:t}){const n=t.role!=null?Z4[t.role]:void 0,a=V4(t.role),{data:s}=X_({},{staleTime:6e4}),p=_u(e,t.id),f=qo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=qo(p!==null&&a?p.state.binary:void 0),h=a&&n?.kind==="numeric"&&!G4(f,n.field)&&m!==void 0,c=h?Q4:n,x=h?m:f;if(c===void 0||x===void 0)return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});if(c.kind==="numeric"){if(!ice(x))return null;const C=x[c.field];if(typeof C!="number")return null;const E=x,R=typeof E.unit=="string"?E.unit:void 0,_=typeof E.precision=="number"?E.precision:void 0,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:_,canonicalUnit:c.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:Gc(j.toDisplayValue(C),j.precision)}),D&&v.jsx("span",{className:"text-base text-foreground-subtle",children:D})]}),a&&v.jsx(uce,{percent:C}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="binary"){if(!rce(x))return null;const E=!!x[c.field],R=E?c.onLabel:c.offLabel;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className: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(c.kind==="datetime"){if(!Zc(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)??c.format;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:U0(x.value,C)}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="string")return!Zc(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(!oce(x))return null;const M=sce(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:M}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}function pce({trpc:e,deviceId:t}){const{data:n}=J_({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(dce,{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 gt({trpc:e,deviceId:t,cap:n=>n.update,slice:n=>n.state.update})}function mce({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(w0,{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(P_,{className:"h-3 w-3"}),"Update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[v.jsx(T_,{className:"h-3 w-3 text-success"}),a?.currentVersion??"Up to date"]})}function fce({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(w0,{className:"h-4 w-4 animate-spin"}),"Installing…"]}):f?v.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),h()},disabled:!s,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[v.jsx(P_,{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(T_,{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 hce(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 e5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.vacuumControl,slice:n=>n.state.vacuumControl})}function uv({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 gce(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 vce=`
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 yce({state:e,batteryLevel:t}){const n=gce(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:vce}),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 t5({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(cm,{className:"h-3.5 w-3.5"}),e,"%"]})}function bce(e){switch(e){case"cleanWater":return!0;case"detergent":return!0;case"dirtyWater":return!1;case"dustBin":return!1;default:return e}}function Sce(e,t){const n=bce(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 xce(e){switch(e){case"cleanWater":return{label:"Clean water",icon:v.jsx(k0,{className:"h-3.5 w-3.5"})};case"dirtyWater":return{label:"Dirty water",icon:v.jsx(wl,{className:"h-3.5 w-3.5"})};case"detergent":return{label:"Detergent",icon:v.jsx(Jne,{className:"h-3.5 w-3.5"})};case"dustBin":return{label:"Dust bin",icon:v.jsx(jae,{className:"h-3.5 w-3.5"})};default:return e}}function kce({kind:e,tank:t}){if(t===null)return null;const n=xce(e),a=Sce(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 wce({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(kce,{kind:p,tank:f},p))}):null}function Mce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=e5(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=f==="cleaning",h=c=>{p||c===void 0||c({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(uv,{label:"Start",busy:p,active:m,onClick:()=>h(n.start),children:v.jsx(Zo,{className:"h-3 w-3"})}),v.jsx(uv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(Eu,{className:"h-3 w-3"})}),v.jsx(uv,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>h(n.returnToBase),children:v.jsx(Fm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(t5,{level:a.batteryLevel})})]})}function _c({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 Cce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=e5(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=hce(f),h=a?.availableFanSpeeds??[],c=M=>{p||M===void 0||M({})},x=M=>{p||M===""||n.setFanSpeed({speed:M})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(yce,{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(t5,{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(gl,{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(_c,{label:"Start",busy:p,active:f==="cleaning",onClick:()=>c(n.start),children:v.jsx(Zo,{className:"h-5 w-5"})}),v.jsx(_c,{label:"Pause",busy:p,active:f==="paused",onClick:()=>c(n.pause),children:v.jsx(Eu,{className:"h-5 w-5"})}),v.jsx(_c,{label:"Stop",busy:p,active:!1,onClick:()=>c(n.stop),children:v.jsx(Iu,{className:"h-4 w-4"})}),v.jsx(_c,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>c(n.returnToBase),children:v.jsx(Fm,{className:"h-5 w-5"})}),v.jsx(_c,{label:"Locate",busy:p,active:!1,onClick:()=>c(n.locate),children:v.jsx(L_,{className:"h-5 w-5"})})]})]})]}),h.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16 shrink-0",children:"Fan speed"}),v.jsxs("select",{"aria-label":"Fan speed",value:a?.fanSpeed??"",disabled:p,onChange:M=>{x(M.target.value)},onClick:M=>{M.stopPropagation()},className:"flex-1 rounded border border-border bg-surface px-2 py-1 text-foreground disabled:opacity-50",children:[a?.fanSpeed==null&&v.jsx("option",{value:"",children:"—"}),h.map(M=>v.jsx("option",{value:M,children:M},M))]})]}),v.jsx(wce,{cleanWater:a?.cleanWater??null,dirtyWater:a?.dirtyWater??null,detergent:a?.detergent??null,dustBin:a?.dustBin??null})]})}function Ace(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 n5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.lawnMowerControl,slice:n=>n.state.lawnMowerControl})}function Ece(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 Rce=`
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 Ice({activity:e,batteryLevel:t}){const n=Ece(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:Rce}),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 Tce(e){switch(e){case"error":return"text-destructive";case"warning":return"text-warning";case"info":return"text-foreground-subtle"}}function _ce({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 Nce({code:e,label:t,severity:n}){return v.jsxs("div",{className:se("inline-flex items-center gap-1 text-xs",Tce(n)),children:[n!=="info"&&v.jsx(gl,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:t??`Code ${e}`})]})}function a5({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(cm,{className:"h-3.5 w-3.5"}),e,"%"]})}function dv({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 Oce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=n5(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(dv,{label:"Mow",busy:p,active:f==="mowing",onClick:()=>m(n.startMowing),children:v.jsx(Zo,{className:"h-3 w-3"})}),v.jsx(dv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>m(n.pause),children:v.jsx(Eu,{className:"h-3 w-3"})}),v.jsx(dv,{label:"Dock",busy:p,active:f==="docked",onClick:()=>m(n.dock),children:v.jsx(Fm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(a5,{level:a.batteryLevel})})]})}function pv({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 jce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=n5(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=Ace(f),h=c=>{p||c===void 0||c({})};return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Ice,{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(a5,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsx(_ce,{percent:a.progressPercent}),a?.currentCode!=null&&v.jsx(Nce,{code:a.currentCode,label:a.currentCodeLabel,severity:a.severity}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(pv,{label:"Start mowing",busy:p,active:f==="mowing",onClick:()=>h(n.startMowing),children:v.jsx(Zo,{className:"h-5 w-5"})}),v.jsx(pv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(Eu,{className:"h-5 w-5"})}),v.jsx(pv,{label:"Dock",busy:p,active:f==="docked",onClick:()=>h(n.dock),children:v.jsx(Fm,{className:"h-5 w-5"})})]})]})]})})}function Pce(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 i5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.valve,slice:n=>n.state.valve})}function r5(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function mv({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",r5(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Dce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=i5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=Gm(f?.state),x=(M,C)=>{h||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(mv,{label:"Open",busy:h,variant:c.up,onClick:()=>x(a.open,{state:"opening"}),children:v.jsx(Bm,{className:"h-3.5 w-3.5"})}),v.jsx(mv,{label:"Stop",busy:h,variant:c.stop,onClick:()=>x(a.stop,{state:"stopped"}),children:v.jsx(Iu,{className:"h-3 w-3"})}),v.jsx(mv,{label:"Close",busy:h,variant:c.down,onClick:()=>x(a.close,{state:"closing"}),children:v.jsx(Go,{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 zce(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 Lce(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 qce({state:e,position:t,interactive:n,onSetPosition:a}){const s=zce(e),p=t!==null?1-t/100:Lce(e),f=41+p*8,m=-90*(1-p),h=T.useRef(null),c=T.useRef(!1),x=T.useRef(null),M=j=>{const D=t??0,z=h.current;if(z===null)return D;const F=z.getBoundingClientRect();if(F.height<=0)return D;const L=(j-F.top)/F.height,Z=Math.round(100-L*100);return Math.min(100,Math.max(0,Z))},C=j=>{if(a===void 0)return;const D=M(j);x.current!==D&&(x.current=D,a(D))},E=j=>{n&&(j.stopPropagation(),j.preventDefault(),c.current=!0,x.current=null,j.currentTarget.setPointerCapture(j.pointerId),C(j.clientY))},R=j=>{!n||!c.current||(j.stopPropagation(),C(j.clientY))},_=j=>{!n||!c.current||(j.stopPropagation(),c.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?_:void 0,onPointerCancel:n?_: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 fv({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",r5(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Bce({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=i5(e,t),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(ma.ValvePositionable),M=Gm(m?.state),C=Pce(m?.state),E=m?.position??null,R=E!==null,_=(D,z)=>{c||!D||(z!==void 0&&h(z),D({}))},j=D=>{c||(h({position:D}),s.setPosition({position:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(qce,{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(fv,{label:"Open",busy:c,variant:M.up,onClick:()=>_(s.open,{state:"opening"}),children:v.jsx(Bm,{className:"h-5 w-5"})}),v.jsx(fv,{label:"Stop",busy:c,variant:M.stop,onClick:()=>_(s.stop,{state:"stopped"}),children:v.jsx(Iu,{className:"h-4 w-4"})}),v.jsx(fv,{label:"Close",busy:c,variant:M.down,onClick:()=>_(s.close,{state:"closing"}),children:v.jsx(Go,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange:D=>{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 Fce(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 o5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.humidifier,slice:n=>n.state.humidifier})}function Uce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=o5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=f?.on??!1,x=()=>{h||(m({on:!c}),a.setOn({on:!c}))};return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":c?"Turn off":"Turn on",title:c?"Turn off":"Turn on",disabled:h,onClick:M=>{M.stopPropagation(),x()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-xs transition-colors",c?"bg-primary text-primary-foreground":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:v.jsx(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 Hce({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 $ce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=o5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Fce(f.on,f.action),x=f.minHumidity??0,M=f.maxHumidity??100,C=f.targetHumidity,E=f.currentHumidity,R=E??C??0,_=()=>{h||(m({on:!f.on}),a.setOn({on:!f.on}))},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(Hce,{fillPct:R,tint:c}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:C!==null?C:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"target"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Current: ",E!==null?`${E}%`:"—",f.action!==null&&v.jsxs("span",{className:"ml-2 capitalize",children:["· ",f.action]})]}),v.jsxs("button",{type:"button","aria-label":f.on?"Turn off":"Turn on",disabled:h,onClick:D=>{D.stopPropagation(),_()},className: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:M,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(F=>F===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 Qce(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 Vce(e,t,n){return e===null||e==="off"?"off":t!==null&&n!==null&&t<n?"heating":"idle"}function s5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.waterHeater,slice:n=>n.state.waterHeater})}function Gce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s}=s5(e,t),{display:p}=zt(s,{enabled:n??!0});return a===void 0||p===void 0?null:v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsxs("span",{className:"tabular-nums",children:[p.currentTemp!==null&&v.jsxs(v.Fragment,{children:[p.currentTemp,"°",v.jsx("span",{className:"mx-0.5",children:"→"})]}),p.targetTemp!==null?`${p.targetTemp}°`:"—"]}),p.operationMode!==null&&v.jsxs("span",{className:"capitalize text-foreground-subtle/80",children:["· ",p.operationMode.replace(/_/g," ")]})]})}function Zce({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 Kce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=s5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Vce(f.operationMode,f.currentTemp,f.targetTemp),x=Qce(c),M=f.currentTemp,C=f.targetTemp,E=f.minTemp,R=f.maxTemp,_=M!==null&&C!==null&&C>0?Math.min(100,M/C*100):M!==null&&R!==null&&R>0?Math.min(100,M/R*100):50,j=F=>{let L=F;return E!==null&&(L=Math.max(E,L)),R!==null&&(L=Math.min(R,L)),L},D=F=>{if(h||C===null)return;const L=j(C+F);m({targetTemp:L}),a.setTargetTemp({temp:L})},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(Zce,{fillPct:_,tint:x}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:M!==null?M:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"°"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Target: ",C!==null?`${C}°`:"—",v.jsxs("span",{className:"ml-2 capitalize",children:["· ",c]})]}),C!==null&&v.jsx("div",{className:"w-[180px]",children:v.jsx(q4,{value:C,unit:"°",onDelta:D})})]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Operation mode",value:f.operationMode??"",disabled:h,onChange:F=>{F.stopPropagation();const L=f.availableModes.find(Z=>Z===F.target.value);!h&&L!==void 0&&(m({operationMode:L}),a.setOperationMode({mode:L}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",h&&"opacity-40 cursor-not-allowed"),children:f.availableModes.map(F=>v.jsx("option",{value:F,children:F},F))}),f.away!==null&&v.jsxs("button",{type:"button","aria-label":f.away?"Disable away mode":"Enable away mode",disabled:h,onClick:F=>{F.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 l5(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 c5(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 Wce(e){const t="h-4 w-4";switch(e){case"sun":return v.jsx(Q_,{className:t});case"clear-night":return v.jsx(M0,{className:t});case"partly-cloudy":return v.jsx(O_,{className:t});case"cloudy":return v.jsx(Gne,{className:t});case"rain":return v.jsx(N_,{className:t});case"snow":return v.jsx(lC,{className:t});case"lightning":return v.jsx(Vne,{className:t});case"fog":return v.jsx(Qne,{className:t});case"wind":return v.jsx(or,{className:t});case"hail":return v.jsx(lC,{className:t});default:return null}}function u5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.weather,slice:n=>n.state.weather})}function Yce(e,t){return e===null?"—":`${Math.round(e)}${t??"°"}`}function Xce({trpc:e,deviceId:t}){const{slice:n}=u5(e,t);if(n===void 0)return null;const a=l5(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",c5(n.condition).accent),title:a.label,"aria-label":a.label,children:Wce(a.glyph)}),v.jsx("span",{className:"tabular-nums",children:Yce(n.temperature,n.temperatureUnit)})]})}function Jce({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:eue(e,n)})})]})}function Eo({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 eue(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(Eo,{cx:58,cy:60})]});case"cloudy":return v.jsxs("g",{children:[v.jsx(Eo,{cx:40,cy:44,scale:.9}),v.jsx(Eo,{cx:62,cy:58})]});case"rain":return v.jsxs("g",{children:[v.jsx(Eo,{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(Eo,{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(Eo,{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(Eo,{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 hv({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 tue({trpc:e,deviceId:t}){const{slice:n}=u5(e,t);if(n===void 0)return null;const a=l5(n.condition),s=c5(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(Jce,{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(hv,{icon:v.jsx(wl,{className:"h-3.5 w-3.5"}),label:"Humidity",value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&v.jsx(hv,{icon:n.windBearing!==null?v.jsx(pae,{className:"h-3.5 w-3.5",style:{transform:`rotate(${n.windBearing}deg)`}}):v.jsx(or,{className:"h-3.5 w-3.5"}),label:"Wind",value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??""}`.trim()}),n.pressure!==null&&v.jsx(hv,{icon:v.jsx(Np,{className:"h-3.5 w-3.5"}),label:"Pressure",value:`${Math.round(n.pressure)} ${n.pressureUnit??""}`.trim()})]})]})]})})}function d5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.image,slice:n=>n.state.image})}var VC=1,GC=6,ZC=.5;function p5({url:e,alt:t,open:n,onOpenChange:a}){const[s,p]=T.useState(1);T.useEffect(()=>{n&&p(1)},[n,e]);const f=T.useCallback(()=>p(c=>Math.min(GC,c+ZC)),[]),m=T.useCallback(()=>p(c=>Math.max(VC,c-ZC)),[]),h=T.useCallback(()=>p(1),[]);return v.jsx(y4,{open:n,onOpenChange:a,children:v.jsxs(L0,{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(pp,{label:"Zoom out",disabled:s<=VC,onClick:m,children:v.jsx(Qae,{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(pp,{label:"Zoom in",disabled:s>=GC,onClick:f,children:v.jsx($ae,{className:"h-4 w-4"})}),v.jsx(pp,{label:"Reset zoom",disabled:s===1,onClick:h,children:v.jsx(bae,{className:"h-4 w-4"})}),v.jsx(pp,{label:"Close",onClick:()=>a(!1),children:v.jsx(Hae,{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 pp({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 nue({trpc:e,deviceId:t}){const{slice:n}=d5(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(z_,{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(p5,{url:p,alt:"Image",open:a,onOpenChange:s})]})}function aue({trpc:e,deviceId:t,deviceName:n}){const{slice:a}=d5(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(z_,{className:"h-8 w-8","aria-hidden":"true"}),v.jsx("span",{className:"text-xs",children:"No image"})]})}),h!==null&&!s&&v.jsx(p5,{url:h,alt:n??"Image",open:f,onOpenChange:m})]})}var mp=20,KC=9,m5="#f59e0b",f5="#ef4444";function Kc(e){return Math.min(f0,Math.max(yT,e))}var iue=`
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 h5({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:L=>L.petFeeder,slice:L=>L.state.petFeeder}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0}),[c,x]=T.useState(mp),[M,C]=T.useState(mp),[E,R]=T.useState(mp);if(s===void 0||m===void 0)return null;const _=!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(dC,{className:"h-3.5 w-3.5","aria-hidden":!0}):v.jsx(gl,{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(uC,{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(cm,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.batteryPower,"%"]}),v.jsxs("button",{type:"button","aria-label":"Feed now",disabled:_||m.feeding,onClick:L=>{L.stopPropagation(),!(_||m.feeding)&&(h({feeding:!0}),s.feed({grams:mp}))},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",(_||m.feeding)&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Aa,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feed"]})]});const F=L=>{_||m.feeding||(h({feeding:!0}),s.feed({grams:Kc(L)}))};return v.jsxs("div",{className:"relative flex flex-col items-stretch gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4",children:[v.jsx("style",{children:iue}),v.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3",children:[v.jsx(rue,{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?f5:m5},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(YC,{icon:v.jsx(cm,{className:"h-3.5 w-3.5"}),label:`${m.batteryPower}%`}),m.desiccantLeftDays!==null&&v.jsx(YC,{icon:v.jsx(or,{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(Dne,{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(dC,{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(Aa,{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(zy,{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(Hne,{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(gl,{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(gv,{label:"Hopper 1",grams:M,busy:_||m.feeding,onGrams:C,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper1:Kc(M)}))}}),v.jsx(gv,{label:"Hopper 2",grams:E,busy:_||m.feeding,onGrams:R,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper2:Kc(E)}))}})]}):v.jsx(gv,{label:"Manual feed",grams:c,busy:_||m.feeding,onGrams:x,onFeed:()=>F(c)}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(vv,{icon:v.jsx(Aa,{className:"h-4 w-4"}),label:"Call pet",busy:_,onClick:()=>{s.callPet({})}}),v.jsx(vv,{icon:v.jsx(C0,{className:"h-4 w-4"}),label:"Reset desiccant",busy:_,onClick:()=>{s.resetDesiccant({})}}),v.jsx(vv,{icon:v.jsx(uC,{className:"h-4 w-4"}),label:"Mark refilled",busy:_,onClick:()=>{s.markFoodReplenished({})}})]}),m.feeding&&v.jsxs("button",{type:"button",disabled:_,onClick:()=>{h({feeding:!1}),s.cancelFeed({})},className: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",_&&"opacity-40 cursor-not-allowed"),children:[v.jsx(zy,{className:"h-4 w-4","aria-hidden":!0}),"Cancel feed"]}),v.jsx(WC,{label:"Settings",children:v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(yv,{icon:v.jsx(Au,{className:"h-4 w-4"}),label:"Child lock",on:m.childLock,busy:_,onToggle:L=>{h({childLock:L}),s.setChildLock({on:L})}}),v.jsx(yv,{icon:v.jsx(Um,{className:"h-4 w-4"}),label:"Light",on:m.indicatorLight,busy:_,onToggle:L=>{h({indicatorLight:L}),s.setIndicatorLight({on:L})}}),v.jsx(yv,{icon:v.jsx(um,{className:"h-4 w-4"}),label:"Feed sound",on:m.feedSound,busy:_,onToggle:L=>{h({feedSound:L}),s.setFeedSound({on:L})}})]})}),v.jsx(WC,{label:"Volume",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Tu,{className:"h-4 w-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),v.jsx(ym,{label:"Decrease volume",symbol:"−",disabled:_||m.volume<=0,onClick:()=>{const L=Math.max(0,m.volume-1);h({volume:L}),s.setVolume({level:L})}}),v.jsx("span",{className:"w-6 text-center text-lg font-semibold tabular-nums text-foreground",children:m.volume}),v.jsx(ym,{label:"Increase volume",symbol:"+",disabled:_||m.volume>=KC,onClick:()=>{const L=Math.min(KC,m.volume+1);h({volume:L}),s.setVolume({level:L})}})]})})]})}function WC({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 YC({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 rue({grams:e,low:t,eating:n}){const a=Math.min(1,Math.max(0,(e??0)/f0)),s=t?f5:m5,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 gv({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(ym,{label:`Decrease ${e} portion`,symbol:"−",disabled:n||t<=yT,onClick:()=>a(Kc(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(ym,{label:`Increase ${e} portion`,symbol:"+",disabled:n||t>=f0,onClick:()=>a(Kc(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(Aa,{className:"h-4 w-4","aria-hidden":!0}),"Feed"]})]})]})}function ym({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 vv({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 yv({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 oue({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(h5,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})}function sue({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(h5,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}var bv={cool:"Cool",heat:"Heat",auto:"Auto",heat_cool:"Heat·Cool",fan_only:"Fan",dry:"Dry",off:"Off"},lue={cool:H_,heat:pm,auto:$_,heat_cool:$m,fan_only:dm,dry:wl,off:Ru},cue={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#a1a1aa"},uue=16,due=30;function XC(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}function pue(e){switch(e){case"turbo":return Qr;case"quiet":return Yne;case"sleep":return M0;case"eco":return iae;case"8c_heat":return H_;case"none":return zy;default:return $_}}function mue(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 fue=`
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 g5({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:z=>z.climateControl,slice:z=>z.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f;if(n==="compact")return v.jsxs("div",{"data-mode":m.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",F4[m.mode]),children:m.target!==null?v.jsxs(v.Fragment,{children:[m.target,"°",m.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",m.currentTemp,"°)"]})]}):m.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[m.currentTemp,"°"]}):null}),m.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:c,onClick:z=>{if(z.stopPropagation(),!c&&m.target!==null){const F=m.target-1;h({target:F}),s.setTarget({target:F})}},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",c&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:c,onClick:z=>{if(z.stopPropagation(),!c&&m.target!==null){const F=m.target+1;h({target:F}),s.setTarget({target:F})}},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",c&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:c,onChange:z=>{z.stopPropagation();const F=m.availableModes.find(L=>L===z.target.value);!c&&F&&(h({mode:F}),s.setMode({mode:F}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(z=>v.jsx("option",{value:z,children:bv[z]},z))})]});const x=cue[m.mode],M=m.mode!=="off",C=pue(m.preset),E=m.preset==="turbo",R=Math.max(.55,mue(m.fanMode)*(E?.6:1)),_=m.swingVertical!==null,j=m.swingHorizontal!==null,D=M&&(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:fue}),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(vue,{mode:m.mode,accent:x,periodSec:R,swaying:D})}),v.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-surface/50 via-transparent to-surface/50"}),M&&v.jsx("span",{"aria-hidden":!0,className:"acv-glow pointer-events-none absolute left-1/2 top-1/2 h-16 w-16 -translate-x-1/2 -translate-y-1/2 rounded-full blur-2xl",style:{background:x,animation:"acv-glow 3.2s ease-in-out infinite"}}),v.jsxs("div",{className:"relative z-10 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide",style:{color:x},children:[v.jsx(JC,{mode:m.mode,className:"h-3.5 w-3.5"}),bv[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(wl,{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(eA,{label:"Decrease target",symbol:"−",disabled:c,onClick:()=>{if(c||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(eA,{label:"Increase target",symbol:"+",disabled:c,onClick:()=>{if(c||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(gue,{value:m.target,min:uue,max:due,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(Sv,{label:"Mode",icon:v.jsx("span",{style:{color:x},className:"flex",children:v.jsx(JC,{mode:m.mode,className:"h-4 w-4"})}),value:m.mode,options:m.availableModes.map(z=>({value:z,label:bv[z]})),disabled:c,onChange:z=>{const F=m.availableModes.find(L=>L===z);F&&(h({mode:F}),s.setMode({mode:F}))}}),m.availableFanModes.length>0&&v.jsx(Sv,{label:"Fan",icon:v.jsx(or,{className:"h-4 w-4 text-sky-500"}),value:m.fanMode,options:m.availableFanModes.map(z=>({value:z,label:XC(z)})),disabled:c,onChange:z=>{h({fanMode:z}),s.setFanMode({fanMode:z})}}),m.availablePresets.length>0&&v.jsx(Sv,{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:XC(z)})),disabled:c,onChange:z=>{h({preset:z}),s.setPreset({preset:z})}})]}),(_||j)&&v.jsx(hue,{label:"Swing",children:v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[_&&v.jsx(tA,{axis:"vertical",on:m.swingVertical??!1,busy:c,onToggle:z=>{h({swingVertical:z}),s.setSwingVertical({on:z})}}),j&&v.jsx(tA,{axis:"horizontal",on:m.swingHorizontal??!1,busy:c,onToggle:z=>{h({swingHorizontal:z}),s.setSwingHorizontal({on:z})}})]})})]})}function hue({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 JC({mode:e,className:t}){const n=lue[e];return v.jsx(n,{className:t,"aria-hidden":!0})}function Sv({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(Go,{className:"h-3 w-3 shrink-0 text-foreground-subtle"})]})]})}function eA({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 gue({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 vue({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(yue,{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 yue({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 tA({axis:e,on:t,busy:n,onToggle:a}){const s=e==="vertical"?"Vertical":"Horizontal",p=e==="vertical"?dae:uae,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 bue=5,Sue=35;function xv(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function kv(e,t,n){return Math.round(t+e*(n-t))}var tr=176,bm=76,$p=2*Math.PI*bm,Nc=$p*(270/360),wv=tr/2-bm-10;function nA(e){const t=tr/2,n=tr/2,a=$p-Nc,s=e.mode==="band"?(()=>{const p=e.band.from*Nc,f=Math.max(0,(e.band.to-e.band.from)*Nc);return{dasharray:`${f} ${$p-f}`,dashoffset:-p}})():(()=>{const p=e.fraction*Nc;return{dasharray:`${p} ${$p-p}`,dashoffset:void 0}})();return v.jsxs("svg",{width:tr,height:tr,viewBox:`0 0 ${tr} ${tr}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:t,cy:n,r:bm,fill:"none",stroke:"var(--color-border)",strokeWidth:12,strokeDasharray:`${Nc} ${a}`,strokeLinecap:"round"}),v.jsx("circle",{cx:t,cy:n,r:bm,fill:"none",stroke:e.color,strokeWidth:12,strokeDasharray:s.dasharray,...s.dashoffset!==void 0?{strokeDashoffset:s.dashoffset}:{},strokeLinecap:"round"})]})}var xue={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#d4d4d8"};function kue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:D=>D.climateControl,slice:D=>D.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=xue[m.mode],M=m.mode==="heat_cool"||m.targetLow!==null&&m.targetHigh!==null,C=bue,E=Sue,R=!M&&m.target!==null?xv(m.target,C,E):0,_=M&&m.targetLow!==null?xv(m.targetLow,C,E):0,j=M&&m.targetHigh!==null?xv(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:tr,height:tr},children:[M?v.jsx(nA,{mode:"band",band:{from:_,to:j},color:x}):v.jsx(nA,{mode:"fill",fraction:R,color:x}),M?v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Up,{fraction:_,color:x,knobTopPx:wv,onDragFraction:D=>{if(c||m.targetHigh===null)return;const z=Math.min(kv(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(Up,{fraction:j,color:x,knobTopPx:wv,onDragFraction:D=>{if(c||m.targetLow===null)return;const z=Math.max(kv(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(Up,{fraction:R,color:x,knobTopPx:wv,onDragFraction:D=>{if(c)return;const z=kv(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:"°"})]}),!M&&m.target!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:["set ",m.target,"°"]}),M&&m.targetLow!==null&&m.targetHigh!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:[m.targetLow,"° – ",m.targetHigh,"°"]})]})]}),!M&&m.target!==null&&v.jsx("div",{className:"w-[200px]",children:v.jsx(q4,{value:`${m.target}°`,onDelta:D=>{if(c||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:c,onChange:D=>{D.stopPropagation();const z=D.target.value;!c&&z&&(h({mode:m.availableModes.find(F=>F===z)??m.mode}),s.setMode({mode:m.availableModes.find(F=>F===z)??m.mode}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function wue(e){return e==="locked"||e==="locking"}function v5(e){return e==="jammed"}var Mue={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 Cue({state:e}){const t=Mue[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(Ly,{className:"h-8 w-8","aria-hidden":"true"})})}function Aue({state:e}){return v.jsx("span",{className:se("text-sm font-medium capitalize",v5(e)?"text-danger":"text-foreground-muted"),children:e})}function Eue({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(hl,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Open"]})}function Rue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:_=>_.lockControl,slice:_=>_.state.lockControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=wue(m.state),x=v5(m.state)||!f,M=n?.includes(ma.LockOpen)===!0,C=()=>{x||(c?(h({state:"unlocking"}),s.unlock({})):(h({state:"locking"}),s.lock({})))},E=()=>{x||s.open({})},R=c?"Unlock":"Lock";return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx(Cue,{state:m.state}),v.jsx(Aue,{state:m.state})]}),v.jsx("div",{className:se(x&&"pointer-events-none opacity-40"),children:v.jsx(mle,{on:c,targetLabel:R,onConfirm:C})}),M&&v.jsx("div",{className:"flex justify-center",children:v.jsx(Eue,{busy:x,onOpen:E})})]})}var ob=500,y5=150,Iue="linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)";function Tue(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function _ue(e){return Tue(e,y5,ob)}var Nue="#f4b740",Oue="#d4d4d8";function jue({trpc:e,deviceId:t,features:n,optimistic:a}){const s=gt({trpc:e,deviceId:t,cap:L=>L.switch,slice:L=>L.state.switch}),p=gt({trpc:e,deviceId:t,cap:L=>L.brightness,slice:L=>L.state.brightness}),f=gt({trpc:e,deviceId:t,cap:L=>L.color,slice:L=>L.state.color}),m=zt(s.slice,{enabled:a??!0}),h=zt(p.slice,{enabled:a??!0}),c=zt(f.slice,{enabled:a??!0});if(s.cap===void 0||m.display===void 0)return null;const x=m.display.on===!0,M=!s.available,C=h.display?.percentage??0,E=!p.available,R=x?C/100:0,_=x?Nue:Oue,j=(n?.includes(ma.LightColorMired)??!1)&&f.cap!==void 0,D=c.display?.mireds,z=!f.available,F=()=>{if(M)return;const L=!x;m.applyOptimistic({on:L}),s.cap?.setState({on:L})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs(B4,{fraction:R,color:_,children:[v.jsxs("div",{"data-testid":"brightness-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[C,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(Um,{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:L=>{const Z=Number(L.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(q0,{on:x,busy:M,onToggle:F})]}),j&&v.jsxs("div",{className:"flex items-center gap-2","data-testid":"color-temp-strip",children:[v.jsx($m,{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:y5,max:ob,step:1,className:"w-full",value:D??ob,disabled:z||!x,onChange:L=>{const Z=Number(L.target.value);c.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(ib,{fraction:D!==void 0?_ue(D):.5,color:Iue})})]})]})]})}var Pue="#3aa6a0",Due="#d4d4d8";function zue({trpc:e,deviceId:t,features:n,optimistic:a}){const s=gt({trpc:e,deviceId:t,cap:U=>U.switch,slice:U=>U.state.switch}),p=gt({trpc:e,deviceId:t,cap:U=>U.fanControl,slice:U=>U.state.fanControl}),f=zt(s.slice,{enabled:a??!0}),m=zt(p.slice,{enabled:a??!0});if(s.cap===void 0||f.display===void 0)return null;const h=f.display.on===!0,c=!s.available,x=m.display?.percentage??0,M=!p.available,C=h?x/100:0,E=h?Pue:Due,R=n?.includes(ma.FanSpeed)??!1,_=(n?.includes(ma.FanOscillating)??!1)&&p.cap!==void 0,j=m.display?.availablePresets??[],D=(n?.includes(ma.FanPreset)??!1)&&p.cap!==void 0&&j.length>0,z=m.display?.preset??"",F=m.display?.oscillating===!0,L=()=>{if(c)return;const U=!h;f.applyOptimistic({on:U}),s.cap?.setState({on:U})},Z=()=>{if(M)return;const U=!F;m.applyOptimistic({oscillating:U}),p.cap?.setOscillating({oscillating:U})},ne=U=>{if(M)return;const pe=m.display;if(pe===void 0)return;const we=pe.percentageStep!==void 0&&pe.percentageStep>0?pe.percentageStep:1,ke=Math.min(100,Math.max(0,Math.round(U*100/we)*we));m.applyOptimistic({percentage:ke}),p.cap?.setPercentage({percentage:ke})},V=U=>{M||U===""||(m.applyOptimistic({preset:U}),p.cap?.setPreset({preset:U}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex flex-col items-center gap-3",children:R?v.jsxs(B4,{fraction:C,color:E,onDragFraction:ne,children:[v.jsxs("div",{"data-testid":"speed-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[x,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(dm,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}):v.jsx("div",{"data-testid":"fan-onoff-icon",className:"flex h-[150px] w-[150px] items-center justify-center",children:v.jsx(dm,{className:"h-16 w-16",style:{color:E},"aria-hidden":"true"})})}),D&&v.jsx("div",{className:"flex justify-center",children:v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Fan preset",value:z,disabled:M,onChange:U=>{U.stopPropagation(),V(U.target.value)},className:se("bg-surface border border-border rounded px-1 py-0.5",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),j.map(U=>v.jsx("option",{value:U,children:U},U))]})]})}),v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_?v.jsxs("button",{type:"button","aria-label":"Oscillate","aria-pressed":F,disabled:M,onClick:U=>{U.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",F?"border-success/50 bg-success/10 text-success":"border-border text-foreground-muted hover:bg-surface-hover",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx(C0,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Oscillate"]}):v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:h?"On":"Off"}),v.jsx(q0,{on:h,busy:c,onToggle:L})]})]})}function Lue({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.switch,slice:M=>M.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=f.on===!0,c=!p,x=()=>{if(c)return;const M=!h;m({on:M}),a.setState({on:M})};return v.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx("div",{"data-testid":"switch-glyph","data-state":h?"on":"off",className: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(q0,{on:h,busy:c,onToggle:x})]})}function que(e){return e==="playing"||e==="buffering"?"pause":"play"}function Bue(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function aA(e){if(e===null)return"--:--";const t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function Fue({title:e,subtitle:t}){return v.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v.jsx(F_,{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 Mv({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 Uue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:F=>F.mediaPlayer,slice:F=>F.state.mediaPlayer}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=que(m.state),M=(n?.includes(ma.MediaPlayerSeek)??!1)&&m.durationMs!==null&&m.durationMs>0,C=n?.includes(ma.MediaPlayerNext)??!1,E=n?.includes(ma.MediaPlayerPrevious)??!1,R=(n?.includes(ma.MediaPlayerVolume)??!1)&&m.volumeLevel!==null,_=()=>{c||(x==="play"?(h({state:"playing"}),s.play({})):(h({state:"paused"}),s.pause({})))},j=m.currentMedia?.artist??m.currentMedia?.album??null,D=Bue(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(Fue,{title:m.currentMedia?.title??null,subtitle:j}),M&&v.jsxs("div",{"data-testid":"media-seek",className:"flex flex-col gap-1",children:[v.jsxs("label",{className:"relative block",children:[v.jsx("span",{className:"sr-only",children:"Seek"}),v.jsx("input",{"aria-label":"Seek",type:"range",min:0,max:m.durationMs??0,step:1e3,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:m.positionMs??0,disabled:c,onChange:F=>{if(c)return;const L=Number(F.target.value);h({positionMs:L}),s.seek({positionMs:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(ib,{fraction:D})})]}),v.jsxs("div",{className:"flex justify-between text-[11px] tabular-nums text-foreground-subtle",children:[v.jsx("span",{children:aA(m.positionMs)}),v.jsx("span",{children:aA(m.durationMs)})]})]}),v.jsxs("div",{className:"flex items-center justify-center gap-4",children:[E&&v.jsx(Mv,{label:"Previous",busy:c,onPress:()=>{s.previous({})},children:v.jsx(Cae,{className:"h-5 w-5","aria-hidden":"true"})}),v.jsx(Mv,{label:x==="play"?"Play":"Pause",busy:c,onPress:_,primary:!0,children:x==="play"?v.jsx(Zo,{className:"h-6 w-6","aria-hidden":"true"}):v.jsx(Eu,{className:"h-6 w-6","aria-hidden":"true"})}),C&&v.jsx(Mv,{label:"Next",busy:c,onPress:()=>{s.next({})},children:v.jsx(Aae,{className:"h-5 w-5","aria-hidden":"true"})})]}),R&&v.jsxs("div",{"data-testid":"media-volume",className:"flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":m.isMuted===!0?"Unmute":"Mute",title:m.isMuted===!0?"Unmute":"Mute",disabled:c,onClick:F=>{if(F.stopPropagation(),c||m.isMuted===null)return;const L=!m.isMuted;h({isMuted:L}),s.setMute({muted:L})},className:se("inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",c&&"opacity-40 cursor-not-allowed"),children:m.isMuted===!0?v.jsx(Z_,{className:"h-4 w-4","aria-hidden":"true"}):v.jsx(Tu,{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:c,onChange:F=>{if(c)return;const L=Number(F.target.value);h({volumeLevel:L}),s.setVolume({volumeLevel:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(ib,{fraction:z/100})})]}),v.jsxs("span",{className:"w-9 text-right text-[11px] tabular-nums text-foreground-subtle",children:[z,"%"]})]})]})}var b5={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"}},S5={home:"Home",away:"Away",night:"Night",vacation:"Vacation",custom_bypass:"Bypass"};function x5(e){return e.startsWith("armed_")}function H0(e){return e==="arming"||e==="disarming"}function k5({icon:e,sizeClass:t="h-8 w-8"}){return e==="disarmed"?v.jsx(wae,{className:t,"aria-hidden":"true"}):e==="triggered"?v.jsx(Hm,{className:t,"aria-hidden":"true"}):e==="pending"?v.jsx(Mae,{className:t,"aria-hidden":"true"}):v.jsx(kae,{className:t,"aria-hidden":"true"})}function iA({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 Hue({state:e,availableModes:t,busy:n,onDisarm:a,onArm:s}){const p=x5(e),f=H0(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(iA,{label:"Disarm",active:!p&&!f,busy:n,onSelect:a}),t.map(m=>v.jsx(iA,{label:S5[m],active:!f&&e===`armed_${m}`,busy:n,onSelect:()=>s(m)},m))]})}function w5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.alarmPanel,slice:M=>M.state.alarmPanel}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,handleDisarm:()=>{a===void 0||h||(m({state:"disarming"}),a.disarm({}))},handleArm:M=>{a===void 0||h||(m({state:"arming"}),a.arm({mode:M}))}}}function $ue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=w5(e,t,n);if(!s||a===void 0)return null;const h=b5[a.state],c=x5(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,H0(a.state)&&"animate-pulse"),children:[v.jsx(k5,{icon:h.icon,sizeClass:"h-3 w-3"}),h.label]}),v.jsxs("select",{"aria-label":"Alarm mode",disabled:p,value:c,onClick:x=>x.stopPropagation(),onChange:x=>{x.stopPropagation();const M=x.target.value;M===""?f():m(M)},className: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:S5[x]},x))]})]})}function Que({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=w5(e,t,n);if(!s||a===void 0)return null;const h=b5[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,H0(a.state)&&"animate-pulse"),children:v.jsx(k5,{icon:h.icon})}),v.jsx("span",{className:se("text-sm font-medium",h.colorClass,"border-0 bg-transparent"),children:h.label})]}),v.jsx(Hue,{state:a.state,availableModes:a.availableModes,busy:p,onDisarm:f,onArm:m})]})}function Vue(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 $0({atMs:e,neverLabel:t}){const n=Vue(e,Date.now());return v.jsx("span",{className:"text-xs text-foreground-subtle","data-testid":"last-run",children:n===null?t:n})}function M5({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(gl,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),v.jsx("span",{className:"truncate",children:e})]})}function C5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:x=>x.scriptRunner,slice:x=>x.state.scriptRunner}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p,c=f?.isRunning===!0;return{display:f,capPresent:a!==void 0,busy:h,running:c,run:()=>{a===void 0||h||c||(m({isRunning:!0}),a.run({}))},stop:()=>{a===void 0||h||!c||(m({isRunning:!1}),a.stop({}))}}}function A5({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($ne,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}):v.jsx(Zo,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:p})]})}function Gue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=C5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(A5,{running:f,busy:p,large:!1,onRun:m,onStop:h}),v.jsx($0,{atMs:a.lastRunAt,neverLabel:"never run"})]})}function Zue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=C5(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(Zo,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:f?"Running":"Idle"}),v.jsx($0,{atMs:a.lastRunAt,neverLabel:"never run"}),v.jsx(M5,{error:a.lastError})]}),v.jsx("div",{className:"flex justify-center",children:v.jsx(A5,{running:f,busy:p,large:!0,onRun:m,onStop:h})})]})}function E5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:c=>c.automationControl,slice:c=>c.state.automationControl}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,setEnabled:c=>{a===void 0||h||(m({enabled:c}),c?a.enable({}):a.disable({}))},trigger:()=>{a===void 0||h||a.trigger({})}}}function R5({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 I5({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(Qr,{className:t?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:"Trigger"})]})}function Kue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=E5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(R5,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(I5,{busy:p,large:!1,onTrigger:m})]})}function Wue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=E5(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(Qr,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:a.enabled?"Enabled":"Disabled"}),v.jsx($0,{atMs:a.lastTriggeredAt,neverLabel:"never triggered"}),v.jsx(M5,{error:a.lastError})]}),v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx(R5,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(I5,{busy:p,large:!0,onTrigger:m})]})]})}function Yue({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 T5(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.switch,slice:a=>a.state.switch});return n!==void 0}function Xue({trpc:e,deviceId:t,features:n,optimistic:a}){return T5(e,t)?v.jsx(B0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function Jue(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.lockControl,slice:a=>a.state.lockControl});return n!==void 0}function ede({trpc:e,deviceId:t,features:n,optimistic:a}){return Jue(e,t)?v.jsx(kle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function tde({trpc:e,deviceId:t,features:n,optimistic:a}){return T5(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(B0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(wle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function nde(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.fanControl,slice:a=>a.state.fanControl});return n!==void 0}function ade({trpc:e,deviceId:t,features:n,optimistic:a}){return nde(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(B0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(Mle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function Q0(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.climateControl,slice:a=>a.state.climateControl});return n!==void 0}function ide({trpc:e,deviceId:t,features:n,optimistic:a}){return Q0(e,t)?v.jsx(Ale,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function rde({trpc:e,deviceId:t,features:n,optimistic:a}){return Q0(e,t)?v.jsx(g5,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function ode({trpc:e,deviceId:t,features:n,optimistic:a}){return Q0(e,t)?v.jsx(g5,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a}):null}function sde(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.mediaPlayer,slice:a=>a.state.mediaPlayer});return n!==void 0}function lde({trpc:e,deviceId:t,features:n,optimistic:a}){return sde(e,t)?v.jsx(Nle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function _5(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.control,slice:a=>a.state.control});return n!==void 0}function cde({trpc:e,deviceId:t,features:n,optimistic:a}){return _5(e,t)?v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function ude({trpc:e,deviceId:t,features:n,optimistic:a}){return _5(e,t)?v.jsx(Yue,{children:v.jsx(H4,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}):null}var dde={cover:{InlineControl:Wle,HeroCard:Jle},valve:{InlineControl:Dce,HeroCard:Bce},humidifier:{InlineControl:Uce,HeroCard:$ce},"water-heater":{InlineControl:Gce,HeroCard:Kce},switch:{InlineControl:Xue,HeroCard:Lue},light:{InlineControl:tde,HeroCard:jue},fan:{InlineControl:ade,HeroCard:zue},sensor:{InlineControl:ace,HeroCard:pce},thermostat:{InlineControl:ide,HeroCard:kue},climate:{InlineControl:rde,HeroCard:ode},button:{InlineControl:yle,HeroCard:ble},update:{InlineControl:mce,HeroCard:fce},lock:{InlineControl:ede,HeroCard:Rue},"media-player":{InlineControl:lde,HeroCard:Uue},alarm:{InlineControl:$ue,HeroCard:Que},control:{InlineControl:cde,HeroCard:ude},weather:{InlineControl:Xce,HeroCard:tue},vacuum:{InlineControl:Mce,HeroCard:Cce},"lawn-mower":{InlineControl:Oce,HeroCard:jce},image:{InlineControl:nue,HeroCard:aue},"pet-feeder":{InlineControl:oue,HeroCard:sue},script:{InlineControl:Gue,HeroCard:Zue},automation:{InlineControl:Kue,HeroCard:Wue},dummy:{InlineControl:ece,HeroCard:tce}};Object.fromEntries(Object.values(H).map(e=>[e,dde[tee[e]]]));H.Cover+"",H.Valve+"",H.Thermostat+"",H.Climate+"",H.Control+"",H.Button+"",H.MediaPlayer+"",H.AlarmPanel+"",H.Lock+"",H.Vacuum+"",H.LawnMower+"",H.Humidifier+"",H.Switch+"",H.Siren+"",H.Light+"",H.Fan+"",H.WaterHeater+"",H.Sensor+"",H.Presence+"",H.EventEmitter+"",H.Notifier+"",H.Script+"",H.Automation+"",H.Camera+"",H.Hub+"",H.Update+"",H.Generic+"",H.Weather+"",H.Container+"",H.Image+"",H.PetFeeder+"";new Set(Object.values(H));var N5={[H.Camera]:{icon:Fne,label:"Camera"},[H.Hub]:{icon:mae,label:"Hub"},[H.Light]:{icon:Um,label:"Light"},[H.Siren]:{icon:mm,label:"Siren"},[H.Switch]:{icon:qy,label:"Switch"},[H.Sensor]:{icon:I_,label:"Sensor"},[H.Thermostat]:{icon:$m,label:"Thermostat"},[H.Climate]:{icon:Nne,label:"Air conditioner"},[H.Button]:{icon:__,label:"Button"},[H.EventEmitter]:{icon:Qr,label:"Event Emitter"},[H.Update]:{icon:C0,label:"Update"},[H.Generic]:{icon:rC,label:"Generic"},[H.Notifier]:{icon:um,label:"Notifier"},[H.Script]:{icon:xae,label:"Script"},[H.Automation]:{icon:Uae,label:"Automation"},[H.Lock]:{icon:Au,label:"Lock"},[H.Cover]:{icon:zne,label:"Cover"},[H.Valve]:{icon:gae,label:"Valve"},[H.Humidifier]:{icon:Bae,label:"Humidifier"},[H.WaterHeater]:{icon:Pne,label:"Water heater"},[H.Fan]:{icon:dm,label:"Fan"},[H.MediaPlayer]:{icon:cae,label:"Media player"},[H.AlarmPanel]:{icon:Hm,label:"Alarm panel"},[H.Control]:{icon:A0,label:"Control"},[H.Presence]:{icon:lae,label:"Presence"},[H.Weather]:{icon:O_,label:"Weather"},[H.Vacuum]:{icon:qne,label:"Vacuum"},[H.LawnMower]:{icon:Nae,label:"Lawn mower"},[H.Container]:{icon:rC,label:"Container"},[H.Image]:{icon:nae,label:"Image"},[H.PetFeeder]:{icon:Lne,label:"Pet feeder"}},pde={[$e.Siren]:{icon:mm,label:"Siren"},[$e.Floodlight]:{icon:Um,label:"Floodlight"},[$e.Spotlight]:{icon:Xne,label:"Spotlight"},[$e.PirSensor]:{icon:U_,label:"PIR sensor"},[$e.Chime]:{icon:um,label:"Chime"},[$e.Autotrack]:{icon:j_,label:"Auto-track"},[$e.Nightvision]:{icon:M0,label:"Night vision"},[$e.PrivacyMask]:{icon:Wne,label:"Privacy mask"},[$e.Doorbell]:{icon:Kne,label:"Doorbell"},[$e.BinaryHelper]:{icon:qy,label:"Binary helper"},[$e.MotionSensor]:{icon:D_,label:"Motion sensor"},[$e.ContactSensor]:{icon:hl,label:"Contact sensor"},[$e.LeakSensor]:{icon:k0,label:"Leak sensor"},[$e.SmokeSensor]:{icon:One,label:"Smoke sensor"},[$e.COSensor]:{icon:or,label:"CO sensor"},[$e.GasSensor]:{icon:pm,label:"Gas sensor"},[$e.TamperSensor]:{icon:Hm,label:"Tamper sensor"},[$e.VibrationSensor]:{icon:G_,label:"Vibration sensor"},[$e.ConnectivitySensor]:{icon:Fae,label:"Connectivity"},[$e.SoundSensor]:{icon:Tu,label:"Sound sensor"},[$e.BinarySensor]:{icon:qy,label:"Binary sensor"},[$e.TemperatureSensor]:{icon:$m,label:"Temperature"},[$e.HumiditySensor]:{icon:wl,label:"Humidity"},[$e.AmbientLightSensor]:{icon:Q_,label:"Ambient light"},[$e.PressureSensor]:{icon:Np,label:"Pressure"},[$e.WindSensor]:{icon:or,label:"Wind"},[$e.RainSensor]:{icon:N_,label:"Rain"},[$e.UvSensor]:{icon:Iae,label:"UV index"},[$e.SolarRadiationSensor]:{icon:Tae,label:"Solar radiation"},[$e.SoilMoistureSensor]:{icon:Rae,label:"Soil moisture"},[$e.PowerSensor]:{icon:Qr,label:"Power"},[$e.EnergySensor]:{icon:Qr,label:"Energy"},[$e.VoltageSensor]:{icon:Qr,label:"Voltage"},[$e.CurrentSensor]:{icon:Qr,label:"Current"},[$e.AirQualitySensor]:{icon:or,label:"Air quality"},[$e.BatterySensor]:{icon:Np,label:"Battery"},[$e.NumericSensor]:{icon:tae,label:"Numeric sensor"},[$e.EnumSensor]:{icon:oae,label:"Enum sensor"},[$e.DateTimeSensor]:{icon:sC,label:"Date / time"},[$e.GenericSensor]:{icon:Np,label:"Sensor"},[$e.NumericControl]:{icon:A0,label:"Numeric control"},[$e.SelectControl]:{icon:rae,label:"Select control"},[$e.TextControl]:{icon:Dae,label:"Text control"},[$e.DateTimeControl]:{icon:sC,label:"Date / time control"},[$e.MobilePushNotifier]:{icon:Eae,label:"Mobile push"},[$e.MessagingNotifier]:{icon:q_,label:"Messaging"},[$e.EmailNotifier]:{icon:sae,label:"Email"},[$e.GenericNotifier]:{icon:um,label:"Notifier"}},mde=new Set(Object.values(H));new Set(Object.values($e));function fde(e){return mde.has(e)}var rA=N5[H.Generic];pde[$e.GenericSensor];function hde(e){return fde(e)?N5[e]??rA:rA}Object.values(H).map(e=>{const t=hde(e);return{id:e,label:t.label,icon:t.icon}});T.createContext(null);H.Sensor,H.Presence;d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),online:A(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),isCamera:A().optional()});Ai("camstack:player-overlays-state",null);var gde=Ai("camstack:player-overlays-actions",null);function Vve(e){const t=T.useContext(gde);T.useEffect(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}Ai("camstack:zone-editing",null);var oA=500,Cv=800;function Oc(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 fp(e,t){return e?.id===t}function vde(e,t){const[n,a]=T.useState(null),[s,p]=T.useState(null),[f,m]=T.useState(null),[h,c]=T.useState("watching"),x=T.useRef(void 0),M=T.useRef(void 0),C=T.useRef(void 0),E=T.useRef(0);return T.useEffect(()=>{if(t===null)return;const R=Oc(e,"detection.motion-analysis",_=>{const j=_;if(!fp(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),oA))});return()=>{R?.unsubscribe(),x.current&&clearTimeout(x.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Oc(e,"detection.motion-zones-raw",_=>{const j=_;if(!fp(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,F)=>z+F.changeScore,0)/D.zones.length:0}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>p(null),oA))});return()=>{R?.unsubscribe(),M.current&&clearTimeout(M.current)}},[e,t]),T.useEffect(()=>{if(E.current=0,t===null)return;const R=Oc(e,"pipeline-analytics.frame-tracked",_=>{const j=_?.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),Cv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Oc(e,"detection.result",_=>{const j=_;if(!fp(j?.source,t)||Date.now()-E.current<Cv)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),Cv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Oc(e,"detection.phase-transition",_=>{const j=_;fp(j?.source,t)&&j.data?.to&&c(j.data.to)});return()=>{R?.unsubscribe()}},[e,t]),{motion:n,motionRaw:s,detection:f,phase:h}}var yde=5*6e4,bde=720*6e4,Sde="camstack:turn-servers:v1";function xde(){const e=globalThis;try{return e.localStorage??null}catch{return null}}function kde(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 wde=class{freshTtlMs;staleCapMs;storage;now;storageKey;memory=new WeakMap;inflight=new WeakMap;constructor(e={}){this.freshTtlMs=e.freshTtlMs??yde,this.staleCapMs=e.staleCapMs??bde,this.storage="storage"in e?e.storage??null:xde(),this.now=e.now??(()=>Date.now()),this.storageKey=e.storageKey??Sde}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 kde(t)?t:void 0}catch{return}}writeStorage(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(e))}catch{}}},Mde=new wde;function O5(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 _=setInterval(R,n);return()=>{E=!0,clearInterval(_)}},[e,t,n]);const[p,f]=T.useState(null);T.useEffect(()=>{if(t===null)return;let E=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(R=>{E||!R||f({phase:R.phase,detectionFps:R.actualFps,avgInferenceMs:R.avgInferenceTimeMs,droppedFrames:R.droppedFrames})}).catch(()=>{}),()=>{E=!0}},[e,t]),Mi("pipeline.camera-metrics-snapshot",E=>{if(t===null)return;const R=E.data;R.deviceId!==t||!R.metrics||f({phase:R.metrics.phase,detectionFps:R.metrics.actualFps,avgInferenceMs:R.metrics.avgInferenceTimeMs,droppedFrames:R.metrics.droppedFrames})});const{streams:m,hasWebrtc:h}=T.useMemo(()=>t===null||a.length===0?{streams:[],hasWebrtc:!1}:{streams:a.map(E=>({id:E.id,label:E.label,target:E.target,status:E.status,inputFps:E.inputFps,decodeFps:E.decodeFps,bitrateKbps:E.bitrateKbps})),hasWebrtc:!0},[t,a]),c=T.useCallback(async()=>{const E=e.turnProvider;if(E)return Mde.getOrFetch(e,async()=>(await E.getTurnServers.query()).map(R=>({urls:typeof R.urls=="string"?R.urls:[...R.urls],...R.username!==void 0?{username:R.username}:{},...R.credential!==void 0?{credential:R.credential}:{}})))},[e]);T.useEffect(()=>{c()},[c]);const x=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");const _=await e.webrtcSession.createSession.mutate({deviceId:t,target:E,hints:R}),j=await c();return{sessionId:_.sessionId,sdpOffer:_.sdpOffer,...j?{iceServers:j}:{}}},[e,t,c]),M=T.useCallback(async(E,R,_,j)=>{if(t===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:t,target:E,sdpOffer:R,..._!==void 0?{sessionId:_}:{},...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:M,getIceServers:c,addIceCandidate:T.useCallback(async(E,R)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:E,candidate:R.candidate??"",sdpMid:R.sdpMid??null,sdpMLineIndex:R.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:T.useCallback(async E=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:E}),[e,t]),sendAnswer:C,closeSession:T.useCallback(async E=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:E}).catch(()=>{})},[e,t]),getSessionState:T.useCallback(async E=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:E})}catch{return{pendingRenegotiation:null}}},[e,t]),getSessionDebug:T.useCallback(async E=>{if(t===null)throw new Error("getSessionDebug: no device bound to this player");return e.webrtcSession.getSessionDebug.query({deviceId:t,sessionId:E})},[e,t])}}T.lazy(()=>ll(()=>import("./MaskShapeCanvas-DI4BY7W2-C0fGaeA-.js"),[],import.meta.url).then(e=>({default:e.MaskShapeCanvas})));T.lazy(()=>ll(()=>import("./MotionZonesSettings-7c3yiT5E-9PMziv1F.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings})));T.lazy(()=>ll(()=>import("./SceneMonitorEditor-BvDy3x3k-B9lXS5ns.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>({default:e.SceneMonitorEditor})));T.lazy(()=>ll(()=>import("./PrivacyMaskSettings-PkYs077O-DXkWrrAk.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));const j5=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Cde=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Ade=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const sA=e=>{const t=Ade(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ede={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 Rde=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Ide=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,...Ede,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:j5("lucide",s),...!p&&!Rde(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));const Tde=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Ide,{ref:p,iconNode:t,className:j5(`lucide-${Cde(sA(e))}`,`lucide-${e}`,a),...s}));return n.displayName=sA(e),n};const _de=[["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"}]],Nde=Tde("scan-face",_de),Sm={unassignedFace:"unassigned face",reviewed:"reviewed",debug:"debug",train:"train",favourite:"favourite",active:"active",loadingMore:"Loading more events"},Ode=Object.keys(Sm),P5=Y(o(),o());function jde(e){if(e===null||typeof e!="object")return Sm;const t=e,n={...Sm};for(const a of Ode){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 Pde="/viewer/camstack/embed/index.html",Dde=N(["reel","gallery"]),zde=N(["small","medium","large"]),Lde=N(["time","importance"]),qde=N(["text","semantic"]),Bde=["face","plate"],V0=N(Bde),Fde=["pipeline","sensor","audio"],D5=N(Fde),Ude=N(["auto","dark","light"]),Hde=tt([Q("auto"),l().int().min(1).max(12)]),$de=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()});d({view:Dde,rows:l().int().min(1).max(6).optional(),columns:Hde.optional(),thumb:zde,deviceIds:w(l().int().nonnegative()),classes:w(o()).optional(),attrs:w(V0).optional(),search:o().optional(),searchMode:qde.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:Lde.optional(),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),deviceNames:Y(o(),o()).optional(),fields:$de,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:Ude});function G0(e){return e.startsWith("/")&&!e.startsWith("//")}function Qde(e){return e!==void 0&&e.length>0?{Authorization:`Bearer ${e}`}:{}}function Vde(e,t,n){if(!t.endsWith(n))return e;const a=t.slice(0,t.length-n.length);return a.length>0?a:e}function z5(e,t){e.token===void 0&&(G0(e.serverUrl)||t.addIssue({code:"custom",path:["token"],message:"token is required unless serverUrl is a same-origin path served through an authenticating relay"}))}const L5=N(["reel","gallery"]),q5=N(["small","medium","large"]),B5=N(["auto","dark","light"]),F5=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()}),U5={label:!0,sublabel:!0,camera:!0,time:!0,badges:!0},H5=N(["time","importance"]),$5=N(["text","semantic"]),Q5=tt([Q("auto"),l().int().min(1).max(12)]),Gde=60,Zde=5e3,Kde=600;function Wde(e){return e.view==="reel"?Math.min(e.maxRows,Kde):e.maxRows}const Yde=0,Xde=720*60*60*1e3,Jde=d({serverUrl:o().min(1),token:o().min(1).optional(),view:L5.default("reel"),rows:l().int().min(1).max(6).default(1),columns:Q5.default("auto"),thumbSize:q5.default("medium"),fields:F5.default(U5),deviceIds:w(l().int().nonnegative()).default([]),classes:w(o()).default([]),attrs:w(V0).catch([]).default([]),deviceNames:Y(o(),o()).default({}),kindLabels:Y(o(),o()).default({}),labels:P5.default({}),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).default({}),search:o().default(""),searchMode:$5.default("text"),semanticLimit:l().int().min(1).max(200).default(50),semanticMinScore:l().min(0).max(1).default(.2),sort:H5.default("time"),filterDebug:A().default(!1),filterTrain:A().default(!1),filterFavourited:A().default(!1),showStationary:A().default(!1),excludeSources:w(D5).default([]),reviewedTrackIds:w(o()).default([]),showAdminFlags:A().default(!1),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),pageSize:l().int().min(1).max(500).default(Gde),maxRows:l().int().min(1).max(5e3).default(Zde),refreshMs:l().int().min(0).max(6e5).default(Yde),maxAgeMs:l().int().min(6e4).default(Xde),theme:B5.default("auto"),nativePullToRefresh:A().default(!1)}).superRefine(z5),V5=d({view:L5.optional(),rows:l().int().min(1).max(6).optional(),columns:Q5.optional(),thumbSize:q5.optional(),fields:F5.partial().optional(),deviceIds:w(l().int().nonnegative()).optional(),classes:w(o()).optional(),attrs:w(V0).optional(),deviceNames:Y(o(),o()).optional(),kindLabels:Y(o(),o()).optional(),labels:P5.optional(),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).optional(),search:o().optional(),searchMode:$5.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:H5.optional(),filterDebug:A().optional(),filterTrain:A().optional(),filterFavourited:A().optional(),showStationary:A().optional(),excludeSources:w(D5).optional(),reviewedTrackIds:w(o()).optional(),showAdminFlags:A().optional(),sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional(),pageSize:l().int().min(1).max(500).optional(),maxRows:l().int().min(1).max(5e3).optional(),refreshMs:l().int().min(0).max(6e5).optional(),maxAgeMs:l().int().min(6e4).optional(),theme:B5.optional(),nativePullToRefresh:A().optional()});function Z0(e){return e==="small"?80:e==="large"?132:106}function epe(e,t=1){const n=Number.isFinite(t)&&t>0?t:1,a=Math.round(Z0(e)*n);return Math.max(tpe,Math.min(npe,a))}const tpe=64,npe=320,Qp=3,Vp=14,ape=4;function ipe(e){return Z0(e)+Qp*2+Vp}function G5(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jde.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 sb(e,t){const n=t.fields!==void 0?{...e.fields,...t.fields}:e.fields,{sinceMs:a,untilMs:s,...p}=t,{sinceMs:f,untilMs:m,...h}=e,c=lA(a,f),x=lA(s,m);return{...h,...p,fields:n,...c!==void 0?{sinceMs:c}:{},...x!==void 0?{untilMs:x}:{}}}function lA(e,t){if(e!==null)return e??t}function rpe(e,t,n){const a=n[String(e)];return a!==void 0&&a.trim().length>0?a:t}const ope={empty:"No events",emptyFiltered:"No events match this filter",error:"Couldn't load events",retry:"Retry",end:"·",loadOlder:"Load older events"};function Hs(e,t){const n=e.strings[t];return n!==void 0&&n.trim().length>0?n:ope[t]}const spe="/addon/pipeline-analytics/event-media",lpe="o",cA=64,cpe=320;function upe(e){return e.replace(/\/+$/,"")}function dpe(e){const t=Math.round(e);return Number.isFinite(t)?Math.max(cA,Math.min(cpe,t)):cA}function Z5(e,t,n){const a=upe(e),s=encodeURIComponent(t);return`${a}${spe}/${lpe}/track/${s}?kind=thumbnailSmall&variant=thumb&size=${dpe(n)}`}const ppe="audio";function xm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mpe(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!xm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!xm(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 K5(e,t){return t.get(e)??e}const uA="audio-",dA="audio";function Nu(e){const t=e.toLowerCase();return t.startsWith(uA)?t:`${uA}${t}`}function fpe(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!xm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!xm(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 hpe(e,t,n=!1){if(n){const s=t.get(e);if(s!==void 0)return s;if(e.toLowerCase()===dA)return dA;const p=Nu(e);return t.get(p)??p}const a=e.toLowerCase();return t.get(e)??t.get(a)??a}function gpe(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 K0=new Map;function Gp(e,t){return t.get(e)??t.get(e.toLowerCase())??e}function W5(e,t){const n=Nu(e);return t.get(n)??t.get(e)??e}const pA={background:"#09090b",card:"#18181b",cardHover:"#27272a",border:"#27272a",text:"#fafafa",textMuted:"#a1a1aa",skeleton:"#27272a",chip:"#3f3f46",colorScheme:"dark"},mA={background:"#ffffff",card:"#f4f4f5",cardHover:"#e4e4e7",border:"#e4e4e7",text:"#18181b",textMuted:"#71717a",skeleton:"#e4e4e7",chip:"#d4d4d8",colorScheme:"light"};function Y5(e,t){return e==="light"?mA:e==="dark"||t?pA:mA}const lb="#f472b6";function vpe(e,t=!1){if(t)return lb;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")?lb:n.includes("motion")?"#94a3b8":"#71717a"}function ype(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function bpe(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 Spe=/[_\-/.]+/g;function X5(e){return e.toLowerCase().replace(Spe," ").replace(/\s+/g," ").trim()}function xpe(e){if(e===void 0)return[];const t=e.trim().toLowerCase();if(t.length===0)return[];const n=X5(e);return n===t||n.length===0?[t]:[t,n]}const Zm=new Map,kpe=new Set(["plate-detection","plate-ocr","operator:plate-gallery"]),fA=new Set(["face-recognizer","face-embedding","operator:face-gallery"]),wpe=[],Mpe=[];function Av(e,t){if(!W0(e))return!1;const n=e.stepId;return typeof n=="string"&&t.has(n)}function J5(e){return e.source==="audio"}function W0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ur(e){return typeof e=="string"&&e.length>0?e:void 0}function Ev(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 Cpe(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const a=W0(n)?Ur(n.label):void 0;a!==void 0&&!t.includes(a)&&t.push(a)}return t}function Ape(e,t){if(!W0(e))return null;const n=Ur(e.trackId),a=Ur(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=Ur(e.label),p=Ur(e.subLabel),f=Ur(e.producingDeviceName),m=Ur(e.source),h=Ev(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:Ev(e.zonesVisited),zoneNames:Ev(e.zoneNames),classes:h.includes(a)?h:[a,...h],audioLabels:Cpe(e.audioLabels),bestEventId:Ur(e.bestEventId)??n,...f!==void 0?{producingDeviceName:f}:{},...m!==void 0?{source:m}:{},...e.hasEmbeddedFace===!0||Av(e.subLabelMeta,fA)?{hasAssignableFace:!0}:{},...e.hasEmbeddedFace===!0&&!Av(e.subLabelMeta,fA)?{hasUnassignedFace:!0}:{},...Av(e.subLabelMeta,kpe)?{hasPlate:!0}:{},...e.debug===!0?{debug:!0}:{},...e.markForTrain===!0?{markForTrain:!0}:{},...e.favourited===!0?{favourited:!0}:{}}}function hA(e,t){if(!Array.isArray(e))return[];const n=[];for(const a of e){const s=Ape(a,t);s!==null&&n.push(s)}return n}function Epe(e,t){const n=new Set;for(const a of[e.className,...e.classes])a.length!==0&&(n.add(a),n.add(K5(a,t)));if(e.audioLabels.length>0){n.add(ppe);for(const a of e.audioLabels)n.add(Nu(a))}return n}function Rpe(e,t,n=Zm){if(t.size===0)return!0;const a=Epe(e,n);for(const s of t)if(a.has(s))return!0;return!1}function Ipe(e,t=Zm){const n=new Set,a=s=>{for(const p of xpe(s))n.add(p)};for(const s of[e.className,...e.classes])a(s),s.length>0&&a(K5(s,t));a(e.label),a(e.subLabel),a(e.cameraName),a(e.producingDeviceName);for(const s of e.audioLabels)a(s),a(Nu(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 Tpe(e,t,n=Zm){const a=t.trim().toLowerCase();if(a.length===0)return!0;const s=X5(t);for(const p of Ipe(e,n))if(p.includes(a)||s.length>0&&p.includes(s))return!0;return!1}function _pe(e,t){return!!(t.size===0||t.has("face")&&e.hasAssignableFace===!0||t.has("plate")&&e.hasPlate===!0)}function Npe(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 Ope(e,t){return t.size===0?!0:!t.has(e.source??"pipeline")}function gA(e,t,n,a=Zm,s=wpe,p={},f=Mpe){const m=new Set(t),h=new Set(s),c=new Set(f);return e.filter(x=>Ope(x,c)&&Rpe(x,m,a)&&_pe(x,h)&&Tpe(x,n,a)&&Npe(x,p))}function jpe(e,t=K0){return e.producingDeviceName!==void 0?{text:Gp(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:Gp(e.label,t),tier:"kind"}:{text:Gp(e.className,t),tier:"class"}}function Ppe(e,t,n,a=K0){if(t)return"";const s=[n];for(const p of e.audioLabels){if(p===e.className||p===e.label)continue;const f=W5(p,a);s.includes(f)||s.push(f)}return s.join(" · ")}function vA(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 yA(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=zpe(p,f);return m!==p&&(a=!0),m});return a?s:e}function Dpe(e){const{debug:t,markForTrain:n,favourited:a,...s}=e;return s}function zpe(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:{...Dpe(e),...n===!0?{debug:!0}:{},...a===!0?{markForTrain:!0}:{},...s===!0?{favourited:!0}:{}}}function Lpe(e){const t=e.filter(n=>n.isCamera===!0).map(n=>n.id);return t.length>0?t:e.map(n=>n.id)}const cb=11,bA=9,Rv=3,qpe=8,Bpe=12,Fpe=24,Upe=.58,Hpe=.85;function $pe(e,t){return[...e].length*t*Upe}function Qpe(e){return Math.max(Fpe,e-qpe-Bpe)}function SA(e,t,n){const a=Qpe(t),s=n.maxLines===1?a:a*n.maxLines*Hpe;return $pe(e,n.fontSizePx)<=s}function Vpe(e,t){for(let n=1;n<=Rv;n+=1){const a={fontSizePx:cb,maxLines:n};if(SA(e,t,a))return a}for(let n=cb-1;n>=bA;n-=1){const a={fontSizePx:n,maxLines:Rv};if(SA(e,t,a))return a}return{fontSizePx:bA,maxLines:Rv}}const Gpe=1e4;function eO(){try{return window.parent!==window}catch{return!0}}let ub=null;function tO(e){ub=e}function Zpe(e){if(ub===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:ub,...n}}}function en(e){const t=Zpe(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}eO()&&window.parent.postMessage(t,"*")}function Ou(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 Kpe(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(!eO()){const f=a!==void 0?a():null;return f!==null?Promise.resolve(f):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`})}return new Promise(f=>{let m;const h=c=>{const x=c.data;if(typeof x!="object"||x===null)return;const M=x;M.type==="embed-config"&&(clearTimeout(m),window.removeEventListener("message",h),f(n(M.config)))};window.addEventListener("message",h),m=setTimeout(()=>{window.removeEventListener("message",h),f({ok:!1,error:"config handshake timed out"})},Gpe),window.parent.postMessage({type:"embed-ready",mode:e},"*")})}function Km(e,t,n,a,s){const[p,f]=T.useState(null),m=T.useRef(t);m.current=t;const h=T.useRef(n);h.current=n;const c=T.useRef(a);c.current=a;const x=s?.urlFirst===!0;return T.useEffect(()=>{let M=!0;return Kpe(e,()=>m.current(),C=>h.current(C),()=>c.current!==void 0?c.current():null,{urlFirst:x}).then(C=>{M&&f(C)}),()=>{M=!1}},[e,x]),p}const ri=1,Wpe=["window","sort","semantic-search","macro-classes","device-names","kind-labels","heartbeat","track-list","attr-filters","flag-filters","debug-status","native-pull-refresh","track-list-delta"];function Ype(e){return{v:ri,type:"ready",view:e,features:[...Wpe]}}function Xpe(e){return{v:ri,type:"error",message:e}}function Zp(e,t){return t!==void 0?{v:ri,type:"state",state:e,message:t}:{v:ri,type:"state",state:e}}function Jpe(e){return{v:ri,type:"trackClick",...e}}function eme(e,t){return{v:ri,type:"trackList",tracks:e,seq:t}}function tme(e){return{v:ri,type:"trackListDelta",...e}}function xA(e,t,n,a="feed"){return{v:ri,type:"countChanged",loaded:e,shown:t,hasMore:n,mode:a}}function nme(){return{v:ri,type:"heartbeat"}}function ame(e){return{v:ri,type:"scroll",atTop:e}}function ime(){return{v:ri,type:"refreshed"}}function Ua(e){en(e)}function wi(e,t,n="feed"){en({type:"log",scope:n,msg:e,...t!==void 0?{data:t}:{}})}const rme=N(["full","delta"]),ome=d({debug:A().optional(),markForTrain:A().optional(),favourited:A().optional()}),sme=Y(o(),ome);function jc(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=lme.safeParse(t);return s.success?{type:"setWindow",...s.data.sinceMs!==void 0?{sinceMs:s.data.sinceMs}:{},...s.data.untilMs!==void 0?{untilMs:s.data.untilMs}:{}}:null}if(n==="setTrackListMode"){const s=rme.safeParse(t.mode);return s.success?{type:"setTrackListMode",mode:s.data}:null}if(n==="setTrackFlagPatches"){const s=sme.safeParse(t.patches);return s.success?{type:"setTrackFlagPatches",patches:s.data}:null}if(n!=="setConfig")return null;const a=V5.safeParse(t.patch);return a.success?{type:"setConfig",patch:a.data}:null}const lme=d({sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional()});function cme(e){return{...e.sinceMs!==void 0?{sinceMs:e.sinceMs}:{},...e.untilMs!==void 0?{untilMs:e.untilMs}:{}}}const ume={blockedMs:0,maxLagMs:0,samples:0};function dme(e,t,n){if(n<=t)return ume;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 db(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 pme=250,kA=600,mme=8;let Gs=[],wA=null;function fme(e){e.lagMs<mme||(Gs.push(e),Gs.length>kA&&(Gs=Gs.slice(Gs.length-kA)))}function pb(e,t){return dme(Gs,e,t)}function hme(e=pme,t=()=>performance.now(),n=(a,s)=>{const p=setInterval(a,s);return()=>clearInterval(p)}){if(wA!==null)return;let a=t()+e;wA={stop:n(()=>{const p=t();fme({at:p,lagMs:Math.max(0,p-a)}),a=p+e},e)}}function gme(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 vme(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 yme(){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 bme(e,t,n=yme()){if(n===null)return null;try{const a=vme(n.getEntriesByName(e,"resource"),t);return a===null?null:gme(a)}catch{return null}}const Sme=250,ar=new Map,Iv=new Map,xme=6,kme=1e4,wme=5e3,Tv=[250,750];let _v=5;const MA=32;function Mme(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,MA);return{origin:"(unparseable)",path:e.length>MA?`${t}…`:t,query:""}}}function Cme(e){return e instanceof Error?{errorName:e.name,errorMessage:e.message}:{errorName:"unknown",errorMessage:String(e)}}let km=0,nO=[];async function Ame(){if(km<xme){km+=1;return}await new Promise(e=>{nO.push(e)})}function Eme(){const e=nO.shift();if(e!==void 0){e();return}km=Math.max(0,km-1)}function Rme(e,t){for(ar.set(e,t);ar.size>Sme;){const n=ar.keys().next();if(n.done===!0)break;const a=ar.get(n.value);ar.delete(n.value),a!==void 0&&URL.revokeObjectURL(a)}}async function aO(e,t){const n=ar.get(e);if(n!==void 0)return ar.delete(e),ar.set(e,n),{status:"ready",src:n};const a=Iv.get(e);if(a!==void 0)return a;const s=(async()=>{const p=performance.now(),f=Mme(e);let m={lastStatus:null,errorName:null,errorMessage:null},h=0;try{for(let c=0;c<=Tv.length;c+=1){const x=performance.now();await Ame(),h+=performance.now()-x;const M=performance.now(),C=new AbortController,E=setTimeout(()=>C.abort(),kme);try{const _=await fetch(e,{headers:Qde(t),signal:C.signal});if(_.ok){const j=Math.round(performance.now()-M),D=await _.blob(),z=Math.round(performance.now()-p),F=Math.round(performance.now()-M),L=URL.createObjectURL(D);if(Rme(e,L),_v>0||z>=500){_v=Math.max(0,_v-1);const Z=bme(e,M),ne=db(performance.now()-M,pb(M,performance.now()));wi("thumbnail ready",{ms:z,queuedMs:Math.round(h),headersMs:j,blobMs:F-j,blockedMs:ne.blockedMs,maxLagMs:ne.maxLagMs,netTotalMs:Z?.totalMs??null,netQueuedMs:Z?.queuedMs??null,netTtfbMs:Z?.ttfbMs??null,bytes:D.size,attempt:c+1,serverTiming:_.headers?.get("server-timing")??null},"media")}return{status:"ready",src:L}}if(_.status===401||_.status===403||_.status===404)return wi("thumbnail missing",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),status:_.status,attempt:c+1,...f},"media"),{status:"missing"};m={lastStatus:_.status,errorName:null,errorMessage:null}}catch(_){m={lastStatus:null,...Cme(_)}}finally{clearTimeout(E),Eme()}const R=Tv[c];R!==void 0&&await new Promise(_=>setTimeout(_,R))}return wi("thumbnail transient failure",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),attempts:Tv.length+1,...m,...f},"media"),{status:"transient-failure"}}finally{Iv.delete(e)}})();return Iv.set(e,s),s}async function Ime(e,t){const n=await aO(e,t);return n.status==="ready"?n.src:null}function Tme(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=ar.get(e);if(f!==void 0){a({status:"ready",src:f});return}let m=!0,h;return a({status:"loading"}),aO(e,t).then(c=>{if(m){if(c.status==="ready"){a({status:"ready",src:c.src});return}if(c.status==="missing"){a({status:"failed"});return}h=setTimeout(()=>p(x=>x+1),wme)}}),()=>{m=!1,h!==void 0&&clearTimeout(h)}},[e,t,s]),n}function _me(e){const t=e?.clientHeight??0;return t>0?t:600}function Nme(e,t){const{root:n,disabled:a}=t,[s,p]=T.useState(a===!0),f=T.useRef(s);return f.current=s,T.useEffect(()=>{if(f.current)return;if(a===!0){p(!0);return}const m=e.current;if(!m||typeof IntersectionObserver!="function"){p(!0);return}const h=new IntersectionObserver(c=>{c.some(x=>x.isIntersecting)&&(p(!0),h.disconnect())},{root:n,rootMargin:`${_me(n)}px`});return h.observe(m),()=>h.disconnect()},[e,n,a]),s}const hp={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},Ome=T.memo(function({row:t,serverUrl:n,token:a,thumbPx:s,width:p,heroPx:f,fields:m,palette:h,nowMs:c,variant:x,iconId:M,kindLabels:C=K0,labels:E=Sm,scrollRoot:R,eagerImages:_,showAdminFlags:j,onClick:D,onAssignFace:z}){const F=T.useRef(null),Z=Nme(F,{root:R,..._===!0?{disabled:!0}:{}})?Z5(n,t.trackId,s):null,ne=Tme(Z,a),V=vpe(t.className,J5(t)),U=x==="reel",pe=f+Qp*2+Vp,we=jpe(t,C),ke=we.tier!=="class",Ae=!ke,Ce=Vpe(we.text,f),Me=m.label,Te=Ppe(t,Me,we.text,C),B=bC(M),ue=v.jsxs("div",{style:{position:"relative",width:U?f:"100%",height:U?f:void 0,aspectRatio:U?void 0:"1 / 1",borderRadius:10,overflow:"hidden",background:h.skeleton,border:`1px solid ${h.border}`,boxSizing:"border-box",flex:"0 0 auto"},children:[v.jsx("div",{className:ne.status==="loading"?"events-skeleton":void 0,"data-testid":"card-image-backing",style:{position:"absolute",inset:0,background:ne.status==="failed"?`${V}22`:h.skeleton,boxShadow:`inset 0 0 0 1px ${h.border}`}}),ne.status==="ready"?v.jsx("img",{src:ne.src,alt:"",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null,m.label&&v.jsxs("div",{style:{position:"absolute",left:4,right:4,bottom:4,display:"flex",flexWrap:U?"nowrap":"wrap",gap:3,alignItems:"center",pointerEvents:"none"},children:[Ae&&v.jsx("span",{"data-testid":"card-class-glyph",title:Gp(t.className,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${V}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(B,{size:13,color:"#fff"})}),ke&&v.jsx("span",{"data-testid":"card-title",title:we.fullText??we.text,style:{background:"#000000B3",color:"#fff",fontSize:U?cb:Ce.fontSizePx,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,overflow:"hidden",minWidth:0,...U?{textOverflow:"ellipsis",whiteSpace:"nowrap"}:{display:"-webkit-box",WebkitLineClamp:Ce.maxLines,WebkitBoxOrient:"vertical",whiteSpace:"normal",overflowWrap:"anywhere"}},children:we.text}),t.hasUnassignedFace===!0&&v.jsxs("span",{...z===void 0?{}:{role:"button",tabIndex:0},"data-testid":"card-face-unassigned",title:E.unassignedFace,onClick:q=>{q.stopPropagation(),z?.(t)},onKeyDown:q=>{z!==void 0&&(q.key!=="Enter"&&q.key!==" "||(q.stopPropagation(),q.preventDefault(),z(t)))},style:{border:"none",cursor:z?"pointer":"default",pointerEvents:z?"auto":"none",display:"inline-flex",alignItems:"center",gap:3,background:"#000000B3",color:"#fff",fontSize:11,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,flex:"0 0 auto"},children:[v.jsx(Nde,{size:13,color:"#fff"}),"?"]}),!U&&t.audioLabels.filter(q=>q!==t.className&&q!==t.label).map(q=>{const ee=Nu(q),X=bC(ee);return v.jsx("span",{title:W5(q,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${lb}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(X,{size:13,color:"#fff"})},`audio-${q}`)})]}),(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:hp,children:"✓"}),j===!0&&t.debug===!0&&t.reviewed!==!0&&v.jsx("span",{title:E.debug,style:hp,children:"D"}),j===!0&&t.markForTrain===!0&&v.jsx("span",{title:E.train,style:hp,children:"T"}),t.favourited===!0&&v.jsx("span",{title:E.favourite,style:{...hp,color:"#fbbf24"},children:"★"})]}),m.badges&&t.active&&v.jsx("span",{title:E.active,style:{position:"absolute",top:4,right:4,width:8,height:8,borderRadius:999,background:"#22c55e",boxShadow:"0 0 0 2px rgba(0,0,0,0.35)"}}),m.badges&&!U&&t.importance!==void 0&&v.jsxs("span",{"data-testid":"card-importance",style:{position:"absolute",top:4,left:4,display:"inline-flex",alignItems:"center",gap:2,background:"#000000B3",color:"#fff",fontSize:10,fontWeight:700,fontVariantNumeric:"tabular-nums",padding:"1px 5px",borderRadius:8},children:["★",Math.round(t.importance*100)]})]});if(U)return v.jsxs("button",{ref:F,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,height:pe,minWidth:p,minHeight:pe,display:"flex",flexDirection:"column",alignItems:"center",padding:0,border:"none",background:"transparent",cursor:"pointer",font:"inherit",color:h.text,boxSizing:"border-box",contain:"layout paint",overflow:"hidden"},children:[ue,v.jsxs("div",{style:{paddingTop:Qp,paddingBottom:Qp,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:`${Vp}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:`${Vp}px`,color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:ype(t.lastSeen)})]})]});const ge=m.camera,Re=t.cameraName,fe=ge||m.time||m.sublabel&&Te.length>0;return v.jsxs("button",{ref:F,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,display:"flex",flexDirection:"column",gap:4,padding:0,border:"none",background:"transparent",cursor:"pointer",textAlign:"left",font:"inherit",color:h.text,boxSizing:"border-box"},children:[ue,fe&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0,paddingTop:2,paddingBottom:2},children:[m.sublabel&&Te.length>0&&v.jsx("span",{style:{fontSize:11,color:h.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te}),ge&&v.jsx("span",{"data-testid":"card-camera",title:Re,style:{fontSize:12,fontWeight:600,lineHeight:"15px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:Re}),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:bpe(t.lastSeen,c)}),m.badges&&t.zonesVisited.length>0&&v.jsx("span",{style:{fontSize:10,color:h.textMuted,background:h.chip,borderRadius:5,padding:"1px 5px",alignSelf:"flex-start",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.zonesVisited.join(" · ")})]})]})});function jme(e){return{listRecentTracks:t=>e.trpcClient.pipelineAnalytics.listRecentTracks.query(t),listDevices:()=>e.trpcClient.deviceManager.listAll.query({isCamera:!0,projection:"slim"}),searchObjectEvents:t=>e.trpcClient.pipelineAnalytics.searchObjectEvents.query(t),listEventKinds:t=>e.trpcClient.pipelineAnalytics.listEventKindsBatch.query({deviceIds:t})}}const Pme=2e3,Dme=1e3;function CA(e,t){const n=Math.max(1,Math.floor(e)),a=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(Pme/a));return Math.min(n,Dme,s)}function Y0(e,t){return e.lastSeen!==t.lastSeen?t.lastSeen-e.lastSeen:e.trackId===t.trackId?0:e.trackId<t.trackId?1:-1}const qc={rows:[],cursor:null,exhausted:!1,rebuild:null},zme=8;function mb(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(Y0)}function Lme(e,t,n){const a=e.rebuild;if(a===null)return{rows:mb(e.rows,t),cursor:n,exhausted:n===null,rebuild:null};const s=mb(a.rows,t),p=a.pages+1,f=s.length>=a.floor;return n===null||f||p>=zme?{rows:s,cursor:n,exhausted:n===null,rebuild:null}:{...e,rebuild:{rows:s,cursor:n,exhausted:!1,floor:a.floor,pages:p}}}function qme(e){return e.rows.length===0?qc:{...e,rebuild:{rows:[],cursor:null,exhausted:!1,floor:e.rows.length,pages:0}}}function Bme(e){return e.rebuild===null?e:{...e,rebuild:null}}function Fme(e){return e.rebuild!==null}function AA(e){return e.rebuild!==null?e.rebuild.cursor:e.cursor}function Ume(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:mb(e.rows,t)},gap:n!==null,deltaCursor:n,added:s}}function Hme(e){const t=e.rows[0];return t!==void 0?t.lastSeen:null}function iO(e,t){const n=e.rebuild??e;return n.exhausted?"exhausted":n.rows.length<Math.max(1,t)?"more":"ceiling"}function EA(e,t){return iO(e,t)==="more"}function $me(e,t){return Math.max(0,e-Math.max(0,t))}function Qme(e){const t=e.sinceMs??$me(e.anchorMs,e.maxAgeMs);return e.untilMs!==void 0?{since:t,until:e.untilMs}:{since:t}}function Vme(e,t){return e===void 0||e>t}function rO(e,t){return t==="time"?e:[...e].sort((n,a)=>{const s=n.importance??-1,p=a.importance??-1;return s!==p?p-s:Y0(n,a)})}const RA=200,Gme=45;function fb(e){return{trackId:e.trackId,deviceId:e.deviceId,bestEventId:e.bestEventId,className:e.className,firstSeen:e.firstSeen,lastSeen:e.lastSeen}}function hb(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Zme(e,t){const n=t.map(E=>E.trackId);if(hb(e,n))return{kind:"unchanged"};if(e.length===0)return{kind:"reset"};const a=new Set(e);let s=n.length-1,p=e.length-1,f=n.length;for(;s>=0&&!a.has(n[s]);)f=s,s-=1;const m=[];for(;s>=0&&p>=0;){if(n[s]===e[p]){s-=1,p-=1;continue}m.push(e[p]),p-=1}const h=s+1;for(;p>=0;)m.push(e[p]),p-=1;const c=new Set(m),x=[...n.slice(0,h),...e.filter(E=>!c.has(E)),...n.slice(f)];if(!hb(x,n))return{kind:"reset"};const M=h+(n.length-f);return RA*M+Gme*m.length>=RA*n.length?{kind:"reset"}:{kind:"delta",prepend:t.slice(0,h).map(fb),append:f===n.length?[]:t.slice(f).map(fb),removeIds:m}}const Kme={seq:0,sentIds:null,mode:"full"};function Kp(e,t,n){const a=e.seq+1;return{state:{seq:a,sentIds:n,mode:e.mode},message:eme(t.map(fb),a)}}function Wme(e,t){const n=t.map(p=>p.trackId);if(e.sentIds===null)return Kp(e,t,n);if(e.mode==="full")return hb(e.sentIds,n)?{state:e,message:null}:Kp(e,t,n);const a=Zme(e.sentIds,t);if(a.kind==="unchanged")return{state:e,message:null};if(a.kind==="reset")return Kp(e,t,n);const s=e.seq+1;return{state:{seq:s,sentIds:n,mode:e.mode},message:tme({seq:s,baseSeq:e.seq,prepend:a.prepend,append:a.append,removeIds:a.removeIds,count:n.length})}}function Yme(e,t,n){const a=n.map(s=>s.trackId);return Kp({...e,mode:t},n,a)}function Xme(e){let t=Kme,n=[];const a=s=>{t=s.state,s.message!==null&&e(s.message)};return{report:s=>{n=s,a(Wme(t,s))},setMode:s=>{a(Yme(t,s,n))}}}function Jme(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pc(e){return typeof e=="string"&&e.length>0?e:void 0}function efe(e,t){if(!Jme(e))return null;const n=Pc(e.id),a=Pc(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=Pc(e.trackId),p=typeof e.mediaId=="number"?String(e.mediaId):void 0,f=Pc(e.label),m=Pc(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 tfe(e,t){if(!Array.isArray(e))return[];const n=new Map;for(const a of e){const s=efe(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 nfe(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 rO([...a.values()].sort(Y0),n)}function afe(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 ife=34;function rfe(e){const t=Math.max(0,e.gap),n=Math.max(1,e.cardWidth),a=Math.max(0,e.viewportWidth),s=e.columns??"auto",p=s==="auto"?Math.max(1,Math.floor((a+t)/(n+t))):Math.max(1,Math.floor(s)),f=a>0?(a-(p-1)*t)/p:n;return{columns:p,columnWidth:f,rowStridePx:Math.max(1,f+ife+t)}}const ofe=2,sfe={startRow:0,endRow:0,padTopPx:0,padBottomPx:0,totalPx:0};function lfe(e){const t=Math.max(0,Math.floor(e.rowCount));if(t===0)return sfe;const n=e.estimatedRowPx>0?e.estimatedRowPx:1,a=j=>{const D=e.measuredPx.get(j);return D!==void 0&&D>0?D:n};let s=0;for(let j=0;j<t;j+=1)s+=a(j);if(e.viewportHeight<=0)return{startRow:0,endRow:t,padTopPx:0,padBottomPx:0,totalPx:s};const p=Math.max(0,e.scrollTop),f=p+e.viewportHeight;let m=0,h=0;for(;m<t-1&&h+a(m)<=p;)h+=a(m),m+=1;let c=m,x=h;for(;c<t&&x<f;)x+=a(c),c+=1;const M=Math.max(0,Math.floor(e.overscanRows??ofe)),C=Math.max(0,m-M),E=Math.min(t,c+M);let R=0;for(let j=0;j<C;j+=1)R+=a(j);let _=0;for(let j=C;j<E;j+=1)_+=a(j);return{startRow:C,endRow:E,padTopPx:R,padBottomPx:Math.max(0,s-R-_),totalPx:s}}function cfe(e,t){let n=0,a=0;for(const s of e.values())s>0&&(n+=s,a+=1);return a===0?Math.max(1,t):Math.max(1,n/a)}const ufe=24,dfe=2;function pfe(e,t,n){if(e.length===0)return e;const a=Math.max(1,Math.floor(n)),s=Math.max(0,t.startRow)*a,p=Math.max(1,t.endRow-t.startRow+dfe),f=Math.min(e.length,s+Math.min(p*a,ufe));return e.slice(s,f)}function mfe(e){const{rowCount:t,scrollTop:n,viewportHeight:a,fallbackRowPx:s,geometryKey:p}=e,f=T.useRef(new Map),m=T.useRef(new Map),[h,c]=T.useState(()=>new Map),x=T.useRef(p);T.useEffect(()=>{x.current!==p&&(x.current=p,m.current=new Map,c(new Map))},[p]);const M=T.useCallback(E=>{const R=m.current.get(E);if(R!==void 0)return R;const _=j=>{j===null?f.current.delete(E):f.current.set(E,j)};return m.current.set(E,_),_},[]);return T.useLayoutEffect(()=>{let E=null;for(const[R,_]of f.current){const j=Math.round(_.getBoundingClientRect().height);j<=0||h.get(R)!==j&&(E??=new Map(h),E.set(R,j))}E!==null&&c(E)}),{window:T.useMemo(()=>lfe({rowCount:t,scrollTop:n,viewportHeight:a,estimatedRowPx:cfe(h,s),measuredPx:h}),[t,n,a,s,h]),measureRow:M}}const ffe=1,hfe=Pde,gfe=["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 vfe(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 gb(e){if(e!==null)return e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function yfe(e){if(e===null)return;const t=new Set((gb(e)??[]).map(a=>a.toLowerCase())),n={};for(const a of gfe)n[a]=t.has(a.toLowerCase());return n}function bfe(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 Sfe(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 IA(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 xfe(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 kfe(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 oO(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)!==ffe)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=xfe(t.get("cols"));m!==void 0&&(s.columns=m);const h=t.get("thumb");h!==null&&(s.thumbSize=h);const c=yfe(t.get("fields"));c!==void 0&&(s.fields=c);const x=vfe(t.get("devices"));x!==void 0&&(s.deviceIds=x);const M=gb(t.get("classes"));M!==void 0&&(s.classes=M);const C=gb(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 _=$s(t,"max");_!==void 0&&(s.maxRows=_);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 F=t.get("sort");F!==null&&(s.sort=F);const L=t.get("smode");L!==null&&(s.searchMode=L);const Z=$s(t,"slimit");Z!==void 0&&(s.semanticLimit=Z);const ne=t.get("sscore");if(ne!==null&&ne.trim()!==""){const ke=Number.parseFloat(ne);Number.isFinite(ke)&&(s.semanticMinScore=ke)}const V=IA(t,"since");V!==void 0&&(s.sinceMs=V);const U=IA(t,"until");U!==void 0&&(s.untilMs=U);const pe=Sfe(bfe(e,"names"));pe!==void 0&&(s.deviceNames=pe);const we=V5.safeParse(s);return we.success?{ok:!0,patch:we.data}:{ok:!1,error:we.error.issues.map(ke=>`${ke.path.join(".")||"(root)"}: ${ke.message}`).join("; ")}}function wfe(e,t,n,a=""){const s=oO(e);if(s===null)return null;if(!s.ok)return{ok:!1,error:s.error};const p=Vde(n,a,hfe),f=kfe(t);return f===null&&!G0(p)?null:G5({serverUrl:p,...f!==null?{token:f}:{},fields:U5,...s.patch})}function Mfe(){const e=wfe(location.search,location.hash,location.origin,location.pathname);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}function Cfe(){const e=oO(location.search);return e===null||!e.ok?null:e.patch}function Afe(e,t){return!e.ok||t===null?e:{ok:!0,config:sb(e.config,t)}}const TA=5,_A=3,Efe=[300,900];let Rfe=0;function Ife(e){if(typeof e!="object"||e===null)return!1;const t=e;return"tracks"in t&&(t.nextCursor===null||typeof t.nextCursor=="string")}const Tfe=[],_fe=/^(10\.|127\.|192\.168\.|169\.254\.|172\.(1[6-9]|2\d|3[01])\.)/;function Nfe(e){let t;try{const p=G0(e)&&typeof location<"u"?location.href:void 0;t=new URL(e,p).host}catch{return"unknown:(unparseable)"}const n=t.trim().toLowerCase().replace(/^\[([^\]]*)\].*$/,"$1"),a=n.lastIndexOf(":"),s=a!==-1&&n.indexOf(":")===a?n.slice(0,a):n;return s==="localhost"||s==="::1"||s.startsWith("127.")?`loopback:${t}`:_fe.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 Ofe(e){const{client:t,deviceIds:n,nameById:a,pageSize:s,maxRows:p,refreshMs:f,maxAgeMs:m}=e,{sinceMs:h,untilMs:c,devicesResolved:x}=e,M=e.includeStationary===!0,C=e.excludeSources??Tfe,E=[...C].toSorted().join(","),[R,_]=T.useState(qc),[j,D]=T.useState(!1),[z,F]=T.useState(!1),[L,Z]=T.useState(null),[ne,V]=T.useState(0),[U,pe]=T.useState(p),we=T.useRef(p);we.current=U;const ke=T.useRef(qc);ke.current=R;const Ae=T.useRef(!1),Ce=T.useRef(!1),Me=T.useRef(0),Te=T.useRef(null),B=T.useRef(Date.now()),ue=T.useRef(a);ue.current=a;const ge=T.useRef(e.channel);ge.current=e.channel;const Re=T.useRef(null);T.useEffect(()=>{hme()},[]);const fe=n.join(","),q=T.useCallback(async(Le,qe=0)=>{const Ie=`feed-${String(++Rfe)}`,Ge=performance.now();try{const Je=await t.listRecentTracks(Le),Ct=performance.now(),dt=db(Ct-Ge,pb(Ge,Ct)),Tt={requestId:Ie,waitMs:Math.round(qe),...dt};return Ife(Je)?{ok:!0,page:Je,timing:Tt}:(wi("request invalid",{...Tt,channel:ge.current}),{ok:!1,message:"unexpected response shape"})}catch(Je){const Ct=Je instanceof Error?Je.message:String(Je),dt=performance.now();return wi("listRecentTracks failed",{error:Ct,devices:Le.deviceIds.length,limit:Le.limit,since:Le.since,cursor:Le.cursor??null,requestId:Ie,channel:ge.current,waitMs:Math.round(qe),...db(dt-Ge,pb(Ge,dt))}),{ok:!1,message:Ct}}},[t]),ee=T.useCallback((Le,qe)=>{wi("request complete",{...Le,channel:ge.current,...qe})},[]),X=T.useCallback(()=>{if(Ae.current){Ce.current=!0,Re.current===null&&(Re.current=performance.now());return}const Le=ke.current;if(!EA(Le,we.current)||n.length===0)return;const qe=Re.current;Re.current=null;const Ie=qe===null?0:performance.now()-qe;Ae.current=!0,F(!0);const Ge=CA(s,n.length),Je=Qme({anchorMs:B.current,maxAgeMs:m,...h!==void 0?{sinceMs:h}:{},...c!==void 0?{untilMs:c}:{}}),Ct=AA(Le)!==null;q({deviceIds:[...n],since:Je.since,limit:Ge,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...Je.until!==void 0?{until:Je.until}:{},...(()=>{const dt=AA(Le);return dt!==null?{cursor:dt}:{}})()},Ie).then(dt=>{if(dt.ok){const pn=performance.now(),Vn=hA(dt.page.tracks,ue.current),aa=Lme(ke.current,Vn,dt.page.nextCursor);ke.current=aa,_(aa),ee(dt.timing,{rows:Vn.length,devices:n.length,limit:Ge,paged:Ct,parseMs:Math.round(performance.now()-pn)}),Me.current=0,Z(null),D(!0);return}const Tt=Me.current,Yt=Efe[Tt];if(Tt+1<_A&&Yt!==void 0){Me.current=Tt+1,wi("page failed — retrying",{attempt:Tt+1,of:_A,backoffMs:Yt}),Te.current=setTimeout(()=>{Te.current=null,ye.current()},Yt);return}Me.current=0;const En=Bme(ke.current);ke.current=En,_(En),Z(dt.message),D(!0)}).finally(()=>{if(Ae.current=!1,F(!1),Fme(ke.current)){ye.current();return}Ce.current&&(Ce.current=!1,ye.current())})},[q,ee,n,fe,s,m,h,c,M,E]),ye=T.useRef(X);ye.current=X;const te=T.useCallback(()=>{if(Ae.current||n.length===0)return Promise.resolve();const Le=Hme(ke.current);if(Le===null)return re.current(),Promise.resolve();Ae.current=!0;const qe=CA(s,n.length);return(async()=>{let Ie=null,Ge=0,Je=!0;for(;Je&&Ge<TA;){const Ct=await q({deviceIds:[...n],since:Le,limit:qe,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...c!==void 0?{until:c}:{},...Ie!==null?{cursor:Ie}:{}});if(!Ct.ok)return;const dt=Ct.page,Tt=performance.now(),Yt=hA(dt.tracks,ue.current),En=Ume(ke.current,Yt,dt.nextCursor);ke.current=En.state,_(En.state),ee(Ct.timing,{rows:Yt.length,devices:n.length,limit:qe,paged:Ie!==null,delta:!0,parseMs:Math.round(performance.now()-Tt)}),Z(null),Je=En.gap,Ie=En.deltaCursor,Ge+=1}Je&&wi("delta drain hit its page bound — newer rows may be missing",{since:Le,pages:Ge,bound:TA})})().finally(()=>{Ae.current=!1,Ce.current&&(Ce.current=!1,ye.current())})},[q,ee,n,fe,s,X,c,M,E]),he=T.useCallback(()=>{Te.current!==null&&(clearTimeout(Te.current),Te.current=null),Me.current=0},[]),Be=T.useCallback(()=>{const Le=we.current+Math.max(1,p);we.current=Le,pe(Le),ye.current()},[p]),Ue=T.useCallback(()=>{he(),Z(null),D(!1),ye.current()},[he]),re=T.useRef(()=>{}),Ee=T.useCallback(()=>{he(),B.current=Date.now(),Ce.current=!1,ke.current=qc,_(qc),D(!1),F(!1),Z(null),we.current=p,pe(p),V(Le=>Le+1)},[he,p]),nt=T.useCallback(()=>{he(),B.current=Date.now(),Ce.current=!1;const Le=qme(ke.current);ke.current=Le,_(Le),Le.rows.length===0&&D(!1),F(!1),Z(null),V(qe=>qe+1)},[he]),Ye=`${fe}|${m}|${h??""}|${c??""}|${M?"1":"0"}|${E}`,St=T.useRef(Ye);return T.useEffect(()=>{St.current!==Ye&&(St.current=Ye,!(ke.current.rows.length===0&&!j)&&Ee())},[Ye,Ee,j]),T.useEffect(()=>{if(n.length===0){x&&D(!0);return}X()},[ne,fe,x]),T.useEffect(()=>{if(f<=0||n.length===0||!Vme(c,Date.now()))return;const Le=setInterval(()=>{te()},f);return()=>clearInterval(Le)},[f,te,n.length,c]),re.current=Ue,T.useEffect(()=>he,[he]),{rows:R.rows,retry:Ue,loading:!j,loadingMore:z&&j,error:L,hasMore:EA(R,U),tail:iO(R,U),loadMore:X,loadOlder:Be,refresh:te,reload:nt}}const jfe=3,Pfe=250;function Dfe(e){const{urls:t,token:n,paused:a,enabled:s}=e,p=T.useRef(0),f=T.useRef(0),m=T.useRef(!1),h=T.useRef(t),c=T.useRef(t[0]??"");h.current=t;const x=t[0]??"";c.current!==x&&(c.current=x,p.current=0),T.useEffect(()=>{if(m.current=!1,!s||a)return;let M=!1;const C=()=>{if(!(M||m.current))for(;f.current<jfe;){const E=h.current,R=p.current;if(R>=E.length)return;p.current=R+1;const _=E[R];_===void 0||_.length===0||(f.current+=1,Ime(_,n).finally(()=>{f.current=Math.max(0,f.current-1),C()}))}};return C(),()=>{M=!0,m.current=!0}},[s,a,n,t.length])}const zfe=.5,sO=56,Lfe=88;function qfe(e){return e<=0?0:Math.min(e*zfe,Lfe)}function NA(e){return e>=sO}function Bfe(e,t,n){return e==="gallery"&&!t&&!n}function Ffe(e){const{root:t,onRefresh:n,enabled:a}=e,[s,p]=T.useState(0),f=T.useRef(null),m=T.useRef(0);m.current=s;const h=T.useRef(n);h.current=n;const c=T.useCallback(()=>{f.current=null,p(0)},[]);return T.useEffect(()=>{if(!a||t===null)return;const x=R=>{if(t.scrollTop>0){f.current=null;return}const _=R.touches[0];f.current=_!==void 0?_.clientY:null},M=R=>{const _=f.current;if(_===null)return;const j=R.touches[0];if(j!==void 0){if(t.scrollTop>0){f.current=null,p(0);return}p(qfe(j.clientY-_))}},C=()=>{if(f.current===null)return;const R=m.current;c(),NA(R)&&h.current()},E={passive:!0};return t.addEventListener("touchstart",x,E),t.addEventListener("touchmove",M,E),t.addEventListener("touchend",C,E),t.addEventListener("touchcancel",c,E),()=>{t.removeEventListener("touchstart",x),t.removeEventListener("touchmove",M),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",c)}},[t,a,c]),{distance:s,armed:NA(s)}}const Qs=8,OA=10,Ufe=400;function Hfe(e){return Math.max(Ufe,Math.round(e))}function lO(e,t){return{display:"flex",alignItems:"center",justifyContent:"center",padding:e?"0 12px":"10px 0",width:e?"max-content":"100%",height:e?t:void 0,...e?{gridColumn:"auto"}:{},whiteSpace:"nowrap"}}function jA(e,t,n){return{...lO(e,t),font:"inherit",fontSize:12,color:n.text,background:n.card,border:`1px solid ${n.border}`,borderRadius:8,cursor:"pointer"}}const $fe=8;function PA({message:e,palette:t}){return T.useEffect(()=>{Ua(Xpe(e)),Ua(Zp("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 Qfe({client:e,initialConfig:t}){const[n,a]=T.useState(t),[s,p]=T.useState({}),[f,m]=T.useState(()=>window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0),[h,c]=T.useState(()=>Date.now()),[x,M]=T.useState(null);T.useEffect(()=>{let be=!1;return e.listDevices().then(xe=>{be||M(xe)}).catch(()=>{be||M([])}),()=>{be=!0}},[e]);const C=T.useMemo(()=>{const be=new Map;for(const xe of x??[])be.set(xe.id,rpe(xe.id,xe.name??`Camera ${xe.id}`,n.deviceNames));for(const[xe,st]of Object.entries(n.deviceNames)){const Qt=Number(xe);Number.isInteger(Qt)&&!be.has(Qt)&&st.trim().length>0&&be.set(Qt,st)}return be},[x,n.deviceNames]),[E,R]=T.useState(()=>new Map),[_,j]=T.useState(()=>new Map),D=T.useMemo(()=>gpe(n.kindLabels),[n.kindLabels]),z=T.useMemo(()=>jde(n.labels),[n.labels]),F=T.useMemo(()=>n.deviceIds.length>0?n.deviceIds:x===null?[]:Lpe(x),[n.deviceIds,x]);T.useEffect(()=>{if(F.length===0)return;let be=!1;return e.listEventKinds([...F]).then(xe=>{be||(R(mpe(xe)),j(fpe(xe)))}).catch(()=>{wi("event-kind taxonomy unavailable — class filter is exact-id only")}),()=>{be=!0}},[e,F]);const L=Ofe({client:e,deviceIds:F,nameById:C,pageSize:n.pageSize,maxRows:Wde(n),refreshMs:n.refreshMs,maxAgeMs:n.maxAgeMs,channel:Nfe(n.serverUrl),devicesResolved:n.deviceIds.length>0||x!==null,...n.showStationary?{includeStationary:!0}:{},excludeSources:n.excludeSources,...n.sinceMs!==void 0?{sinceMs:n.sinceMs}:{},...n.untilMs!==void 0?{untilMs:n.untilMs}:{}}),Z=n.searchMode==="semantic"?n.search.trim():"",[ne,V]=T.useState({query:"",rows:[],loading:!1});T.useEffect(()=>{if(Z.length===0||F.length===0){V({query:"",rows:[],loading:!1});return}let be=!1;return V(xe=>({...xe,query:Z,loading:!0})),e.searchObjectEvents({text:Z,limit:n.semanticLimit,minScore:n.semanticMinScore,...F.length===1&&F[0]!==void 0?{deviceId:F[0]}:{},...n.sinceMs!==void 0?{since:n.sinceMs}:{},...n.untilMs!==void 0?{until:n.untilMs}:{}}).then(xe=>{be||V({query:Z,rows:tfe(xe,C),loading:!1})}).catch(xe=>{be||(wi("searchObjectEvents failed",{error:xe instanceof Error?xe.message:String(xe)}),V({query:Z,rows:[],loading:!1}))}),()=>{be=!0}},[e,Z,F,C,n.semanticLimit,n.semanticMinScore,n.sinceMs,n.untilMs]);const U=Z.length>0,pe=T.useMemo(()=>new Set(n.reviewedTrackIds),[n.reviewedTrackIds]),we=be=>pe.size===0?[...be]:be.map(xe=>pe.has(xe.trackId)?{...xe,reviewed:!0}:xe),ke=T.useMemo(()=>we(yA(vA(L.rows,C),s)),[L.rows,C,pe,s]),Ae=T.useMemo(()=>we(yA(vA(ne.rows,C),s)),[ne.rows,C,pe,s]),Ce=T.useMemo(()=>{const be={debug:n.filterDebug,train:n.filterTrain,favourited:n.filterFavourited,reviewedTrackIds:n.reviewedTrackIds},xe=gA(ke,n.classes,n.search,E,n.attrs,be,n.excludeSources);if(U){const st=gA(Ae,n.classes,"",E,n.attrs,be,n.excludeSources);return nfe(st,xe,n.sort)}return rO(xe,n.sort)},[U,Ae,ke,n.classes,n.attrs,n.filterDebug,n.filterTrain,n.filterFavourited,n.reviewedTrackIds,n.search,n.sort,n.excludeSources,E]),Me=Y5(n.theme,f),Te=T.useRef(null),[B,ue]=T.useState(null),ge=T.useRef(null),Re=T.useRef(L.loadMore);Re.current=L.loadMore;const fe=T.useRef(L.refresh);fe.current=L.refresh;const q=T.useRef(L.reload);q.current=L.reload;const[ee]=T.useState(()=>Xme(Ua)),X=T.useCallback(be=>{if(be.type==="setConfig"){a(xe=>sb(xe,be.patch));return}if(be.type==="setWindow"){a(xe=>sb(xe,cme(be)));return}if(be.type==="setTrackFlagPatches"){p(be.patches);return}if(be.type==="setTrackListMode"){ee.setMode(be.mode);return}if(be.type==="refresh"){fe.current().finally(()=>Ua(ime()));return}if(be.type==="reload"){q.current();return}if(be.type==="loadMore"){Re.current();return}if(be.type==="ping"){Ua(nme());return}Te.current?.scrollTo({top:0,left:0,behavior:"smooth"})},[ee]);T.useEffect(()=>(window.__camstackEvents={setConfig:be=>{const xe=jc({type:"setConfig",patch:be});xe!==null&&X(xe)},setWindow:be=>{const xe=jc({type:"setWindow",...be});xe!==null&&X(xe)},setTrackFlagPatches:be=>{const xe=jc({type:"setTrackFlagPatches",patches:be});xe!==null&&X(xe)},setTrackListMode:be=>{const xe=jc({type:"setTrackListMode",mode:be});xe!==null&&X(xe)},refresh:()=>X({type:"refresh"}),reload:()=>X({type:"reload"}),loadMore:()=>X({type:"loadMore"}),scrollToTop:()=>X({type:"scrollToTop"}),ping:()=>X({type:"ping"})},Ou(be=>{const xe=jc(be);xe!==null&&X(xe)})),[X]),T.useEffect(()=>{Ua(Ype(n.view))},[]),T.useEffect(()=>{Ua(U?xA(ne.rows.length,Ce.length,!1,"semantic"):xA(L.rows.length,Ce.length,L.hasMore,"feed"))},[L.rows.length,Ce.length,L.hasMore,U,ne.rows.length]),T.useEffect(()=>{ee.report(Ce)},[ee,Ce]),T.useEffect(()=>{if(L.error!==null&&!U){Ua(Zp("error",L.error));return}if(U?ne.loading:L.loading){Ua(Zp("loading"));return}Ua(Zp(Ce.length===0?"empty":"ready"))},[L.loading,L.error,Ce.length,U,ne.loading]),T.useEffect(()=>{const be=window.matchMedia?.("(prefers-color-scheme: dark)");if(!be)return;const xe=st=>m(st.matches);return be.addEventListener("change",xe),()=>be.removeEventListener("change",xe)},[]),T.useEffect(()=>{document.documentElement.style.colorScheme=Me.colorScheme,document.body.style.background=Me.background},[Me]),T.useEffect(()=>{const be="camstack-events-keyframes";if(document.getElementById(be)!==null)return;const xe=document.createElement("style");xe.id=be,xe.textContent="@keyframes camstack-spin{to{transform:rotate(360deg)}}",document.head.appendChild(xe)},[]),T.useEffect(()=>{const be=setInterval(()=>c(Date.now()),6e4);return()=>clearInterval(be)},[]);const[ye,te]=T.useState(0);T.useEffect(()=>{const be=B;if(be===null)return;const xe=()=>{const Qt=n.view==="reel"?be.clientWidth:be.clientHeight;te(Zn=>Zn===Qt?Zn:Qt)};if(xe(),typeof ResizeObserver!="function")return;const st=new ResizeObserver(xe);return st.observe(be),()=>st.disconnect()},[B,n.view]);const he=L.rows.length,Be=he>0;T.useEffect(()=>{const be=Te.current,xe=ge.current;if(!be||!xe||U||!Be)return;const st=Hfe(n.view==="reel"?be.clientWidth:be.clientHeight),Qt=new IntersectionObserver(Zn=>{Zn.some(Qa=>Qa.isIntersecting)&&Re.current()},{root:be,rootMargin:`${st}px`});return Qt.observe(xe),()=>Qt.disconnect()},[n.view,L.hasMore,U,Be,ye]);const Ue=T.useRef(0),re=T.useRef(0);T.useEffect(()=>{if(U||L.loading||L.loadingMore||!L.hasMore)return;const be=Te.current;if(!be||he===0)return;const xe=n.view==="reel";if((xe?be.clientWidth:be.clientHeight)===0)return;if(xe?be.scrollWidth>be.clientWidth+1:be.scrollHeight>be.clientHeight+1){Ue.current=0,re.current=he;return}he>re.current&&(Ue.current=0,re.current=he),!(Ue.current>=$fe)&&(Ue.current+=1,Re.current())},[Ce.length,he,L.loading,L.loadingMore,L.hasMore,U,n.view]);const Ee=Ffe({root:B,enabled:Bfe(n.view,U,n.nativePullToRefresh),onRefresh:()=>{fe.current()}}),nt=T.useRef(null);T.useEffect(()=>{const be=B;if(!n.nativePullToRefresh||be===null){nt.current=null;return}const xe=()=>{const st=n.view==="gallery"&&!U&&be.scrollTop<=0;nt.current!==st&&(nt.current=st,Ua(ame(st)))};return xe(),be.addEventListener("scroll",xe,{passive:!0}),()=>be.removeEventListener("scroll",xe)},[B,n.nativePullToRefresh,n.view,U]);const Ye=Z0(n.thumbSize),St=ipe(n.thumbSize),Le=epe(n.thumbSize,window.devicePixelRatio||1),qe=n.view==="reel",[Ie,Ge]=T.useState(!1),[Je,Ct]=T.useState({scrollLeft:0,scrollTop:0,viewportWidth:0,viewportHeight:0});T.useEffect(()=>{const be=B;if(be===null)return;let xe=null;const st=()=>{Ct({scrollLeft:be.scrollLeft,scrollTop:be.scrollTop,viewportWidth:be.clientWidth,viewportHeight:be.clientHeight})},Qt=()=>{st(),Ge(!0),xe!==null&&clearTimeout(xe),xe=setTimeout(()=>Ge(!1),Pfe)};return st(),be.addEventListener("scroll",Qt,{passive:!0}),window.addEventListener("resize",st),()=>{be.removeEventListener("scroll",Qt),window.removeEventListener("resize",st),xe!==null&&clearTimeout(xe)}},[B]);const dt=T.useMemo(()=>rfe({viewportWidth:Je.viewportWidth,cardWidth:Ye,gap:Qs,columns:n.columns}),[Je.viewportWidth,Ye,n.columns]),Tt=qe?0:Math.ceil(Ce.length/dt.columns),Yt=mfe({rowCount:Tt,scrollTop:Je.scrollTop,viewportHeight:Je.viewportHeight,fallbackRowPx:dt.rowStridePx,geometryKey:`${dt.columns}|${Ye}|${n.fields.sublabel?"s":""}${n.fields.camera?"c":""}${n.fields.time?"t":""}${n.fields.badges?"b":""}`}),En=T.useMemo(()=>qe?afe(Ce,{scrollLeft:Je.scrollLeft,viewportWidth:Je.viewportWidth,cardWidth:Ye,gap:Qs,rowsPerColumn:n.rows}):pfe(Ce,Yt.window,dt.columns),[qe,Ce,Je.scrollLeft,Je.viewportWidth,Ye,n.rows,Yt.window,dt.columns]),pn=T.useMemo(()=>En.map(be=>Z5(n.serverUrl,be.trackId,Le)),[En,n.serverUrl,Le]);Dfe({urls:pn,token:n.token,paused:Ie,enabled:!L.loading&&Ce.length>0});const Vn=T.useCallback((be,xe)=>{Ua(Jpe({trackId:be.trackId,deviceId:be.deviceId,bestEventId:be.bestEventId,className:be.className,firstSeen:be.firstSeen,lastSeen:be.lastSeen,...xe===void 0?{}:{intent:xe}}))},[]),aa=T.useCallback(be=>Vn(be),[Vn]),pr=T.useCallback(be=>Vn(be,"assign-face"),[Vn]),ia=qe?{display:"grid",gridTemplateRows:`repeat(${n.rows}, ${St}px)`,gridAutoFlow:"column",gridAutoColumns:`${Ye}px`,gap:Qs,alignContent:"start"}:{display:"grid",gridTemplateColumns:`repeat(${dt.columns}, minmax(0, 1fr))`,columnGap:Qs,rowGap:Qs,paddingBottom:Qs,alignContent:"start"},ga=U?ne.loading:L.loading,it=!U&&L.loadingMore&&he>0,nn=!U&&L.error!==null,Ta=!U&&!L.loadingMore&&he>0,Gn=Ta&&nn,Rn=Ta&&!nn&&L.tail==="exhausted",_a=Ta&&!nn&&L.tail==="ceiling",In=nn&&Ce.length===0,io=!ga&&!nn&&!L.loadingMore&&Ce.length===0,Yo=io&&he>0,Xo=(be,xe)=>v.jsx(Ome,{row:be,eagerImages:!qe&&xe<8,serverUrl:n.serverUrl,token:n.token,thumbPx:Le,width:qe?`${Ye}px`:"100%",heroPx:Ye,variant:qe?"reel":"gallery",iconId:hpe(be.className,_,J5(be)),kindLabels:D,labels:z,scrollRoot:B,fields:n.fields,showAdminFlags:n.showAdminFlags===!0,palette:Me,nowMs:h,onClick:aa,onAssignFace:pr},be.trackId),li=v.jsxs(v.Fragment,{children:[it&&v.jsx("div",{"data-testid":"tail-loading","aria-label":z.loadingMore,style:{width:qe?Ye:"100%",height:qe?St:void 0,aspectRatio:qe?void 0:"1 / 1",borderRadius:10,background:Me.skeleton,border:`1px solid ${Me.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 ${Me.chip}`,borderTopColor:Me.textMuted,animation:"camstack-spin 700ms linear infinite"}})}),Rn&&v.jsx("div",{"data-testid":"tail-end",style:{...lO(qe,Ye),color:Me.textMuted,fontSize:11,opacity:.75},children:Hs(n,"end")}),_a&&v.jsx("button",{type:"button","data-testid":"tail-more",onClick:()=>L.loadOlder(),style:jA(qe,Ye,Me),children:Hs(n,"loadOlder")}),Gn&&v.jsx("button",{type:"button","data-testid":"tail-error",onClick:()=>L.retry(),style:{...jA(qe,Ye,Me),color:"#f87171"},children:Hs(n,"retry")}),v.jsx("div",{ref:ge,style:{width:1,height:1,gridRow:qe?1:"auto"},"aria-hidden":!0})]});return v.jsxs("div",{ref:be=>{Te.current=be,ue(xe=>xe===be?xe:be)},"data-testid":"events-scroller",className:qe?"events-reel-scroller":void 0,style:{position:"fixed",inset:0,background:Me.background,color:Me.text,fontFamily:"system-ui, -apple-system, sans-serif",overflowX:qe?"auto":"hidden",overflowY:qe?"hidden":"auto",padding:qe?`${ape}px ${OA}px`:OA,boxSizing:"border-box",WebkitOverflowScrolling:"touch"},children:[Ee.distance>0&&v.jsx("div",{"data-testid":"pull-indicator","data-armed":Ee.armed?"true":"false","aria-hidden":!0,style:{position:"absolute",top:Math.max(0,Ee.distance-28),left:0,right:0,display:"flex",justifyContent:"center",pointerEvents:"none",zIndex:2,opacity:Math.min(1,Ee.distance/sO)},children:v.jsx("span",{style:{width:22,height:22,borderRadius:999,border:`2px solid ${Me.chip}`,borderTopColor:Me.textMuted,background:Me.card,boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transform:`rotate(${Ee.distance*4}deg)`,animation:L.loadingMore?"camstack-spin 700ms linear infinite":void 0}})}),In&&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:Hs(n,"error")}),v.jsx("button",{type:"button","data-testid":"state-retry",onClick:()=>L.retry(),style:{marginTop:10,font:"inherit",fontSize:12,color:Me.text,background:Me.card,border:`1px solid ${Me.border}`,borderRadius:8,padding:"5px 14px",cursor:"pointer"},children:Hs(n,"retry")})]}),io&&v.jsx("div",{"data-testid":Yo?"state-empty-filtered":"state-empty",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:Me.textMuted,fontSize:13,padding:"0 24px",textAlign:"center"},children:Hs(n,Yo?"emptyFiltered":"empty")}),ga&&Ce.length===0&&v.jsx("div",{"data-testid":"state-loading",style:ia,children:Array.from({length:qe?8:12},(be,xe)=>v.jsx("div",{style:{width:qe?Ye:"100%",height:qe?St:void 0,aspectRatio:qe?void 0:"1 / 1",borderRadius:10,background:Me.skeleton,border:`1px solid ${Me.border}`,boxSizing:"border-box",opacity:.6}},`skeleton-${xe}`))}),qe?v.jsxs("div",{style:ia,children:[Ce.map(Xo),li]}):v.jsxs("div",{"data-testid":"events-gallery",children:[v.jsx("div",{"data-testid":"gallery-pad-top",style:{height:Yt.window.padTopPx},"aria-hidden":!0}),Array.from({length:Yt.window.endRow-Yt.window.startRow},(be,xe)=>{const st=Yt.window.startRow+xe,Qt=st*dt.columns;return v.jsx("div",{"data-row-index":st,ref:Yt.measureRow(st),style:ia,children:Ce.slice(Qt,Qt+dt.columns).map((Zn,Qa)=>Xo(Zn,Qt+Qa))},st)}),v.jsx("div",{"data-testid":"gallery-pad-bottom",style:{height:Yt.window.padBottomPx},"aria-hidden":!0}),li]})]})}function Vfe(){const e=Km("events",()=>window.__CAMSTACK_EVENTS__,G5,Mfe,{urlFirst:!0}),t=T.useMemo(()=>Cfe(),[]),n=T.useMemo(()=>e===null?null:Afe(e,t),[e,t]),a=T.useMemo(()=>{if(n===null||!n.ok)return null;const p=Lm({serverUrl:n.config.serverUrl,token:n.config.token});return{system:p,client:jme(p)}},[n]);T.useEffect(()=>{if(a)return()=>a.system.close()},[a]);const s=Y5(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(Qfe,{client:a.client,initialConfig:n.config}):v.jsx(PA,{message:"Failed to initialise the events embed",palette:s}):v.jsx(PA,{message:n.error,palette:s})}const wm={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"},Gfe=Object.keys(wm),Zfe=Y(o(),o()).optional();function Kfe(e){if(e===null||typeof e!="object")return wm;const t=e,n={...wm};for(const a of Gfe){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return n}const cO=N(["auto","high","mid","low"]).catch("auto"),Wfe=tt([Q("auto"),l().int().min(1)]),uO=d({enabled:A(),motion:A(),motionHoldSec:l().optional(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),Nv=N(["off","top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"]),Yfe=d({motionBoxes:A().optional(),motionBadge:Nv.optional(),audioMeter:Nv.optional(),occupancy:Nv.optional(),stats:A().optional()}),Xfe=d({cw:l(),ch:l()}),Jfe=d({serverUrl:o().min(1),token:o().min(1).optional(),devices:w(l().int().nonnegative()).min(1),layout:Wfe,quality:cO,showName:A(),showBadges:A(),muted:A(),paused:A(),highlight:uO.optional(),activeOnly:A().optional(),showBoxes:A().optional(),audioOnIds:w(l().int().nonnegative()).optional(),pausedIds:w(l().int().nonnegative()).optional(),snapshots:Y(o(),o()).optional(),ptzIds:w(l().int().nonnegative()).optional(),overlays:Y(o(),Yfe).optional(),editable:A().optional(),cellPanels:A().optional(),spans:Y(o(),Xfe).optional(),labels:Zfe}).superRefine(z5);function dO(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jfe.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 ehe=1,pO=N(["auto","high","mid","low"]),the=tt([Q("auto"),l().int().min(1)]),mO=d({enabled:A(),motion:A(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),nhe=d({devices:w(l().int().nonnegative()).min(1),layout:the,quality:pO,showName:A(),audioOnIds:w(l().int().nonnegative()).optional(),activeOnly:A().optional(),boxes:A().optional(),highlight:mO.optional()}),ahe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function ihe(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 rhe(e){if(e.length%4===1)return null;const t=[];for(const s of e){const p=ahe.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=ihe(n);if(a===null)return null;try{return JSON.parse(a)}catch{return null}}function X0(e,t){return e.startsWith(t)?e.slice(t.length):e}function fO(e){const n=new URLSearchParams(X0(e,"#")).get("t");return n!==null&&n.length>0?n:null}function ohe(e,t){return new URLSearchParams(X0(e,"?")).has("v")||fO(t)!==null}function DA(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 ti(e){return{ok:!1,error:e}}function she(e,t){const n=new URLSearchParams(X0(e,"?")),a=n.get("mode");if(a!==null&&a!=="grid")return ti(`unsupported mode "${a}"`);const s=n.get("v");if(s===null)return ti("missing share-link version (v)");if(s!==String(ehe))return ti(`unsupported share-link version "${s}"`);const p=n.get("devices"),f=p===null?null:DA(p);if(f===null||f.length===0)return ti("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 ti(`invalid layout "${m}"`);const c=n.get("q")??"auto",x=pO.safeParse(c),M=x.success?x.data:"auto",C=n.get("names")??"0";if(C!=="0"&&C!=="1")return ti(`invalid names flag "${C}"`);const E=n.get("audio");let R;if(E!==null){const V=DA(E);if(V===null)return ti(`invalid audio list "${E}"`);R=V}const _=n.get("activeOnly");if(_!==null&&_!=="0"&&_!=="1")return ti(`invalid activeOnly flag "${_}"`);const j=_==="1",D=n.get("boxes");if(D!==null&&D!=="0"&&D!=="1")return ti(`invalid boxes flag "${D}"`);const z=D==="1",F=n.get("hl");let L;if(F!==null){const V=rhe(F),U=mO.safeParse(V);if(V===null||!U.success)return ti("invalid highlight config (hl)");L=U.data}const Z={devices:[...f],layout:h,quality:M,showName:C==="1",...R!==void 0&&R.length>0?{audioOnIds:[...R]}:{},...j?{activeOnly:!0}:{},...z?{boxes:!0}:{},...L!==void 0?{highlight:L}:{}},ne=nhe.safeParse(Z);return ne.success?{ok:!0,params:ne.data,token:fO(t)}:ti(ne.error.issues.map(V=>`${V.path.join(".")||"(root)"}: ${V.message}`).join("; "))}function lhe(e,t,n){if(!ohe(e,t))return null;const a=she(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 dO(p)}function che(){const e=lhe(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}const Mm=16/9,zA={cols:0,rows:0,cellW:0,cellH:0,wallW:0,wallH:0};function LA(e,t,n,a,s){const p=Math.min(a/e,s/t*Mm),f=p/Mm;return{cols:e,rows:t,cellW:p,cellH:f,wallW:Math.min(e,n)*p,wallH:t*f,empty:e*t-n}}function qA(e){return{cols:e.cols,rows:e.rows,cellW:e.cellW,cellH:e.cellH,wallW:e.wallW,wallH:e.wallH}}const BA=1e-9;function uhe(e,t){const n=e.cellW*e.cellH,a=t.cellW*t.cellH,s=Math.max(n,a,1);return n-a>s*BA?!0:a-n>s*BA?!1:e.empty!==t.empty?e.empty<t.empty:e.rows<t.rows}function dhe(e,t,n,a){if(e<=0||t<=0||n<=0)return zA;if(typeof a=="number"&&a>=1){const p=Math.floor(a);return qA(LA(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=LA(f,p,e,t,n);(s===null||uhe(m,s))&&(s=m)}return s===null?zA:qA(s)}function phe(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 mhe(e,t){if(e.length===0||t.cellW<=0||t.cellH<=0)return[];const n=[];return phe(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 FA={wallW:0,wallH:0,placements:[]};function fhe(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 hhe(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 ghe(e,t,n){const a=new Set,s=[];let p=0;const f=(m,h,c,x)=>{for(let M=m;M<m+x;M++)for(let C=h;C<h+c;C++)if(a.has(`${M}:${C}`))return!1;return!0};for(const m of e){const{cw:h,ch:c}=fhe(t[String(m)],n),x=p+c+e.length;let M=!1;for(let C=0;C<=x&&!M;C++)for(let E=0;E+h<=n;E++)if(f(C,E,h,c)){for(let R=C;R<C+c;R++)for(let _=E;_<E+h;_++)a.add(`${R}:${_}`);s.push({deviceId:m,col:E,row:C,cw:h,ch:c}),p=Math.max(p,C+c),M=!0;break}}return{cells:s,rows:p,cols:n}}function vhe(e,t,n,a,s){const p=dhe(e.length,t,n,a);if(!hhe(s)||p.cols<=0)return{wallW:p.wallW,wallH:p.wallH,placements:mhe(e,p)};if(e.length===0||t<=0||n<=0)return FA;const f=ghe(e,s??{},p.cols);if(f.rows<=0)return FA;const m=Math.min(t/f.cols,n/f.rows*Mm),h=m/Mm;return{wallW:f.cells.reduce((x,M)=>Math.max(x,M.col+M.cw),0)*m,wallH:f.rows*h,placements:f.cells.map(x=>({deviceId:x.deviceId,x:x.col*m,y:x.row*h,w:x.cw*m,h:x.ch*h}))}}function hO(){const[e,t]=T.useState(null),[n,a]=T.useState("idle"),s=T.useRef(null),p=T.useRef(null),f=T.useRef(null),m=T.useRef(0),h=T.useRef(null),c=Gae(),x=Zae(),M=Kae(),C=T.useRef({start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync});C.current={start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync};const E=T.useCallback(()=>{if(s.current){try{s.current.close()}catch{}s.current=null}if(p.current){for(const D of p.current.getTracks())try{D.stop()}catch{}p.current=null}},[]),R=T.useCallback(async()=>{const D=f.current;if(f.current=null,E(),D)try{await C.current.stop({deviceId:D.deviceId,sessionId:D.sessionId})}catch{}},[E]),_=T.useCallback(async D=>{if(h.current===D){m.current+=1,h.current=null,t(null),a("idle"),await R();return}m.current+=1;const z=m.current;h.current=D,t(D),a("starting");let F;try{F=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 F.getTracks())Z.stop();return}if(await R(),z!==m.current){for(const Z of F.getTracks())Z.stop();return}let L=null;try{p.current=F;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},L=new RTCPeerConnection,s.current=L,L.oniceconnectionstatechange=()=>{if(z!==m.current||!L)return;const V=L.iceConnectionState;V==="connected"||V==="completed"?a("talking"):(V==="failed"||V==="closed"||V==="disconnected")&&(h.current=null,t(null),a("idle"),R())};for(const V of F.getAudioTracks())L.addTrack(V,F);await L.setRemoteDescription({type:"offer",sdp:Z.sdpOffer});const ne=await L.createAnswer();if(await L.setLocalDescription(ne),z!==m.current)return;await C.current.answer({deviceId:D,sessionId:Z.sessionId,sdpAnswer:L.localDescription?.sdp??ne.sdp??""})}catch{if(L)try{L.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&&_(D)},[R,_]);return T.useEffect(()=>()=>{m.current+=1,R()},[R]),{activeMicId:e,micState:n,toggleMic:D=>{_(D)},setActiveMic:j}}const yhe=6e3,bhe=500;function She(e,t){const n=T.useRef(new Map),[,a]=T.useState(0),s=t?.motion??!1,p=t?.audio??"off",f=t?.audioDb??-30,m=t?.audioHoldSec??5,h=t?.detection??!1,c=t?.detectionHoldSec??3,x=t?.detectionClasses??[],M=(R,_)=>{n.current.set(R,Date.now()+_),a(j=>j+1)};Mi(We.MotionOnMotionChanged,R=>{if(!s)return;const _=R.data;_&&_.detected&&M(_.deviceId,yhe)}),Mi(We.PipelineAudioInferenceResult,R=>{if(p==="off")return;const _=R.data;if(!_)return;(p==="sensor"?_.frame.detections.length>0:(_.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=f)&&M(_.deviceId,m*1e3)}),Mi(We.DetectionResult,R=>{if(!h)return;const _=R.data;if(!_)return;_.frame.detections.some(D=>x.length===0||x.includes(D.macroClass))&&M(_.frame.deviceId,c*1e3)}),T.useEffect(()=>{const R=setInterval(()=>a(_=>_+1),bhe);return()=>clearInterval(R)},[]);const C=Date.now(),E=new Set;for(const R of e){const _=n.current.get(R);_!==void 0&&C<_&&E.add(R)}return E}function xhe(e){return{type:"tileOpen",deviceId:e}}function khe(e){return{type:"audioToggle",deviceId:e}}function whe(e){return{type:"pauseToggle",deviceId:e}}function Mhe(e){return{type:"ptzOpen",deviceId:e}}function Che(e,t){return{type:"cellPanelOpen",deviceId:e,panel:t}}function Ahe(e){return{type:"tileRemove",deviceId:e}}function Ehe(e,t,n){return{type:"tileResize",deviceId:e,cw:t,ch:n}}function gO(e,t,n){return{type:"state",state:e,...t!==void 0?{message:t}:{},...n!==void 0?{commands:n}:{}}}function Rhe(e){return{type:"layout",tiles:e}}function xi(e){en(e)}const Ihe=["top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"];function UA(e){return typeof e=="string"&&Ihe.includes(e)}const The={"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 vO(e){return{position:"absolute",display:"flex",...The[e]}}const yO=[-60,-53,-46,-39,-32,-24],_he=yO.length,Ov=["#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444"];function Nhe(e){const t=Math.min(Math.max(0,e),Ov.length-1);return Ov[t]??Ov[0]}function Ohe(e){if(e===null||!Number.isFinite(e))return 0;let t=0;for(const n of yO)e>=n&&(t+=1);return t}function jhe(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 HA=[8,11,14,17,21,26],jv={horizontal:{width:8,height:16},vertical:{width:24,height:7},compactWidth:4};function Phe(e,t){if(e==="vertical")return jv.vertical;if(e==="horizontal")return jv.horizontal;const n=HA[t]??HA[0];return{width:jv.compactWidth,height:n}}function Dhe(e){const t=Array.from({length:_he},(n,a)=>a);return e==="vertical"?[...t].reverse():t}function jo(e){return typeof e=="object"&&e!==null}function zhe(e){if(!jo(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(!jo(p)||!jo(p.bbox))continue;const{x:f,y:m,w:h,h:c}=p.bbox;typeof f!="number"||typeof m!="number"||typeof h!="number"||typeof c!="number"||!(h>0)||!(c>0)||s.push({x:f/t,y:m/n,w:h/t,h:c/n,pixelCount:typeof p.pixelCount=="number"?p.pixelCount:0})}return s}function Lhe(e){return!Number.isFinite(e)||e<=0?.08:Math.min(.28,.08+e/4e3*.28)}function $A(e){if(!jo(e))return[];const t=jo(e.frame)?e.frame.byClass:void 0,n=jo(t)?t:e.byClass;if(!jo(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 qhe(e,t,n){if(n<=0)return 0;const a=t-e;return a<=0?0:Math.round(a*1e3/n)}function Bhe(e){if(e===null)return"—";const t=[e.resolution,`${e.fps}fps`];return e.dropped>0&&t.push(`${e.dropped} dropped`),t.join(" · ")}const Fhe=1200,Uhe=1e3;function Hhe({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return Mi(We.MotionAnalysis,s=>{const p=s.data;!p||p.deviceId!==e||(n(zhe(p)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),Fhe))}),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,${Lhe(s.pixelCount)})`}},`${s.x}:${s.y}:${s.w}:${s.h}:${p}`))})}function $he({deviceId:e,anchor:t}){const[n,a]=T.useState(null);Mi(We.PipelineAudioInferenceResult,h=>{const c=h.data;!c||c.deviceId!==e||a(c.frame.level?.dbfs??null)});const s=Ohe(n),p=jhe(t);if(p===null)return null;const f=p==="horizontal",m=p==="vertical";return v.jsx("div",{style:{...vO(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:Dhe(p).map(h=>{const c=h<s,x=Phe(p,h);return v.jsx("span",{style:{width:x.width,height:x.height,borderRadius:2,background:c?Nhe(h):"#71717a",opacity:c?1:.35}},h)})})})}function Qhe(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 Vhe({system:e,deviceId:t,anchor:n}){const[a,s]=T.useState([]);return T.useEffect(()=>{let p=!1;const f=Qhe(e.trpcClient,t);if(f!==null)return f.then(m=>{p||s($A(m))}).catch(()=>{p||s([])}),()=>{p=!0}},[e,t]),Mi(We.ZoneAnalyticsOccupancyChanged,p=>{const f=p.data;f.deviceId===t&&s($A(f))}),a.length===0?null:v.jsx("div",{style:{...vO(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 Ghe({containerRef:e}){const[t,n]=T.useState(null),a=T.useRef(null);return T.useEffect(()=>{const s=()=>{const f=e.current?.querySelector("video");if(!f){n(null);return}const m=typeof f.getVideoPlaybackQuality=="function"?f.getVideoPlaybackQuality():null,h=m?.totalVideoFrames??0,c=Date.now(),x=a.current;a.current={frames:h,at:c},n({resolution:f.videoWidth>0?`${f.videoWidth}x${f.videoHeight}`:"—",fps:x===null?0:qhe(x.frames,h,c-x.at),dropped:m?.droppedVideoFrames??0})};s();const p=setInterval(s,Uhe);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:Bhe(t)})}const Zhe=1e4,QA=1e3,VA=[0,5e3,15e3,3e4],Khe=4;function Whe(e){const t=Math.max(0,Math.min(e,VA.length-1));return VA[t]??0}function Yhe(e){return!e.playing||e.lastFrameAt===null?!1:e.nowMs-e.lastFrameAt>=e.stallMs}function Xhe(e){const{containerRef:t,playing:n,onRecover:a,stallMs:s=Zhe}=e,p=e.now??Date.now,[f,m]=T.useState({recovering:!1,attempts:0}),h=T.useRef(null),c=T.useRef(0),x=T.useRef(0),M=T.useRef(a);M.current=a;const C=T.useRef(p);C.current=p;const E=T.useCallback(()=>{const R=C.current(),_=h.current;h.current=R,c.current>0&&_!==null&&R-_<s&&(c.current=0,m({recovering:!1,attempts:0}))},[s]);return T.useEffect(()=>{if(!n){h.current=null;return}const _=t.current?.querySelector("video");if(!_)return;let j=!1,D=null;if(typeof _.requestVideoFrameCallback=="function"){const L=()=>{j||(E(),D=_.requestVideoFrameCallback?.(L)??null)};return D=_.requestVideoFrameCallback(L),()=>{j=!0,D!==null&&_.cancelVideoFrameCallback?.(D)}}let z=_.currentTime;const F=setInterval(()=>{if(j)return;const L=_.currentTime;L!==z&&(z=L,E())},QA);return()=>{j=!0,clearInterval(F)}},[n,t,E]),T.useEffect(()=>{if(!n)return;const R=setInterval(()=>{const _=C.current();if(_<x.current||!Yhe({lastFrameAt:h.current,nowMs:_,stallMs:s,playing:n})||c.current>=Khe)return;const j=c.current;c.current=j+1,h.current=_,x.current=_+Whe(j+1)+s,m({recovering:!0,attempts:j+1}),M.current()},QA);return()=>clearInterval(R)},[n,s]),f}const Jhe=300,ege=130,tge=["devices","viewOptions"],nge={inline:tge,overflow:!1},age={inline:[],overflow:!0};function ige(e,t){return e>=Jhe&&t>=ege?nge:age}const rge=120,oge=68;function sge(e,t,n){return e&&t>=rge&&n>=oge}const lge=16/9,cge={left:0,top:0,width:0,height:0},GA=.5;function uge(e,t,n){if(!(e>0)||!(t>0))return cge;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<GA&&t-p<GA?a:{left:(e-s)/2,top:(t-p)/2,width:s,height:p}}const dge=500;function bO(e,t,n){const{motion:a,detection:s}=vde(e.trpcClient,t),p=T.useRef(0),f=T.useRef(0),m=T.useRef(0),h=T.useRef(!1),[,c]=T.useState(0),x=n?.audio??"off",M=n?.audioDb??-30,C=n?.audioHoldSec??5,E=n?.motionHoldSec??0,R=n?.detectionHoldSec??3,_=n?.detectionClasses??[],j=_.join(",");Mi(We.MotionOnMotionChanged,F=>{const L=F.data;!L||L.deviceId!==t||!n?.motion||(L.detected===!0?(m.current=Date.now()+Math.max(1,E)*1e3,h.current=!0,c(Z=>Z+1)):L.detected===!1&&h.current&&(m.current=Date.now()+E*1e3,h.current=!1,c(Z=>Z+1)))}),Mi(We.PipelineAudioInferenceResult,F=>{const L=F.data;if(!L||L.deviceId!==t||x==="off")return;(x==="sensor"?L.frame.detections.length>0:(L.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=M)&&(p.current=Date.now()+C*1e3,c(ne=>ne+1))}),T.useEffect(()=>{if(!s)return;s.detections.some(L=>_.length===0||_.includes(L.macroClass))&&(f.current=Date.now()+R*1e3,c(L=>L+1))},[s,R,j]),T.useEffect(()=>{const F=a!==null;(F||h.current)&&(m.current=Date.now()+E*1e3,F||c(L=>L+1)),h.current=F},[a,E]);const D=n?.enabled===!0;if(T.useEffect(()=>{if(!D)return;const F=setInterval(()=>c(L=>L+1),dge);return()=>clearInterval(F)},[D]),!n?.enabled)return null;const z=Date.now();return n.detection&&z<f.current?"detection":x!=="off"&&z<p.current?"audio":n.motion&&(a!==null||z<m.current)?"motion":null}const sl={motion:"#DC2626",audio:"#3B82F6",detection:"#22C55E"},pge=2500,mge={person:"#f59e0b",vehicle:"#3b82f6",animal:"#22c55e",face:"#a855f7",plate:"#ec4899"},fge="#ef4444";function hge(e){return mge[e]??fge}function gp(e){return e<0?0:e>1?1:e}function gge(e){if(e.width<=0||e.height<=0)return[];const t=[];for(const n of e.detections){const{bbox:a}=n,s=gp(a.x/e.width),p=gp(a.y/e.height),f=gp((a.x+a.width)/e.width),m=gp((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 vge({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return Mi(We.DetectionResult,s=>{const p=s.data;!p||p.frame.deviceId!==e||(n(gge(p.frame)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),pge))}),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=hge(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 yge(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 bge(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function ZA(e,t,n,a){if(!Number.isFinite(e))return 0;const s=bge(t,n,a);return Math.max(-s,Math.min(s,e))}const Sge=4,KA=8,xge=300;function WA(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function YA(e){return e>1?"none":"pan-y"}function kge({children:e,onTap:t}){const n=T.useRef(null),a=T.useRef(null),s=T.useRef(new Map),p=T.useRef(1),f=T.useRef(0),m=T.useRef(0),h=T.useRef(null),c=T.useRef(null),x=T.useRef(0),M=()=>{const D=a.current;D&&(D.style.transform=`translate(${f.current}px, ${m.current}px) scale(${p.current})`);const z=n.current;z&&(z.style.touchAction=YA(p.current))},C=()=>{const D=n.current?.getBoundingClientRect();if(!D||D.width<=0||D.height<=0)return;const z=a.current?.querySelector("video")??null,F=z?null:a.current?.querySelector("img")??null,L=z?.videoWidth??F?.naturalWidth??0,Z=z?.videoHeight??F?.naturalHeight??0,ne=yge(D.width,D.height,L,Z);f.current=ZA(f.current,D.width,ne.width,p.current),m.current=ZA(m.current,D.height,ne.height,p.current)},E=()=>{p.current=1,f.current=0,m.current=0,M()},R=D=>{try{D.currentTarget.setPointerCapture(D.pointerId)}catch{}if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size===2){const z=[...s.current.values()],F=z[0],L=z[1];F&&L&&(h.current={dist:WA(F,L),scale:p.current,cx:(F.x+L.x)/2,cy:(F.y+L.y)/2,tx:f.current,ty:m.current}),c.current=null}else s.current.size===1&&(c.current={x:D.clientX,y:D.clientY,tx:f.current,ty:m.current,moved:!1})},_=D=>{if(!s.current.has(D.pointerId))return;if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size>=2&&h.current){const F=[...s.current.values()],L=F[0],Z=F[1];if(!L||!Z)return;const ne=WA(L,Z);h.current.dist>0&&(p.current=Math.max(1,Math.min(Sge,h.current.scale*(ne/h.current.dist))));const V=(L.x+Z.x)/2,U=(L.y+Z.y)/2;f.current=h.current.tx+(V-h.current.cx),m.current=h.current.ty+(U-h.current.cy),C(),M();return}const z=c.current;if(s.current.size===1&&z){const F=D.clientX-z.x,L=D.clientY-z.y;(Math.abs(F)>KA||Math.abs(L)>KA)&&(z.moved=!0),p.current>1&&(f.current=z.tx+F,m.current=z.ty+L,C(),M())}},j=D=>{const z=s.current.size===1,F=c.current;if(s.current.delete(D.pointerId),s.current.size<2&&(h.current=null),s.current.size===0&&(c.current=null,z&&F&&!F.moved)){const L=Date.now();L-x.current<xge?(x.current=0,E()):(x.current=L,t())}};return v.jsx("div",{ref:n,style:{position:"absolute",inset:0,overflow:"hidden",touchAction:YA(1)},onPointerDown:R,onPointerMove:_,onPointerUp:j,onPointerCancel:j,children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%",transformOrigin:"center center",willChange:"transform"},children:e})})}function wge(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 Mge(e,t){const n=t[0];return n===void 0?null:wge(e,n.url)}function Cge(e,t){return{handleOffer:(n,a,s)=>e(t,n,a,s),reoffer:(n,a,s,p)=>e(s,a,n,p)}}const Age=3500;function Ege(e){return e==="auto"?{kind:"adaptive"}:{kind:"profile",profile:e}}function Rge({system:e,deviceId:t,name:n,online:a,quality:s,muted:p,paused:f,showName:m,audioActive:h,micActive:c,onTogglePause:x,onToggleAudio:M,onToggleMic:C,onOpen:E,ptzSupported:R,onPtz:_,cellW:j,cellH:D,onCellPanel:z,highlight:F,showBoxes:L,overlay:Z,reconnectSignal:ne,onStall:V,posterUrl:U,labels:pe=wm,editable:we,span:ke,onRemove:Ae,onResize:Ce}){const{handleOffer:Me,getIceServers:Te,addIceCandidate:B,getIceCandidates:ue,closeSession:ge,getSessionState:Re,getSessionDebug:fe}=O5(e.trpcClient,t),q=bO(e,t,F),ee=T.useRef(null),[X,ye]=T.useState(0),[te,he]=T.useState("idle"),Be=Xhe({containerRef:ee,playing:te==="playing"&&!f,onRecover:()=>{ye(it=>it+1),V?.(t)}}),[Ue,re]=T.useState(void 0);T.useEffect(()=>{if(U||f)return;let it=!1;const nn=j!==void 0&&j>0?Math.round(j):void 0;return e.trpcClient.snapshot.getSnapshotLinks.query({targets:[{deviceId:t,...nn!==void 0?{width:nn}:{}}]}).then(Ta=>{if(it)return;const Gn=Mge(e.serverUrl,Ta??[]);Gn!==null&&re(Gn)}).catch(()=>{}),()=>{it=!0}},[U,f,e,t,j]);const Ee=U??Ue,nt=T.useMemo(()=>Ege(s),[s]),Ye=`grid:${t}:${s}`,St=T.useMemo(()=>Cge(Me,nt),[Me,nt]),[Le,qe]=T.useState(!1),Ie=T.useRef(null),Ge=()=>{Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(()=>qe(!1),Age)},Je=()=>{qe(!0),Ge()},Ct=()=>{qe(it=>{const nn=!it;return nn&&Ge(),nn})},dt=ige(j??0,D??0),Tt=it=>{it.stopPropagation(),Je()},Yt=j!==void 0&&D!==void 0&&j>0&&D>0,En=uge(j??0,D??0,lge),pn=Yt?{position:"absolute",left:En.left,top:En.top,width:En.width,height:En.height}:{position:"absolute",inset:0},Vn=Math.max(1,Math.round(ke?.cw??1)),aa=Math.max(1,Math.round(ke?.ch??1)),pr=Yt&&j!==void 0?j/Vn:0,ia=Yt&&D!==void 0?D/aa:0,ga=sge(we===!0,j??0,D??0);return T.useEffect(()=>()=>{Ie.current&&clearTimeout(Ie.current)},[]),v.jsxs("div",{ref:ee,"data-stall-recovering":Be.recovering?"true":void 0,style:{position:"relative",width:"100%",height:"100%",background:"#000"},children:[v.jsxs("div",{style:pn,children:[v.jsx(kge,{onTap:Ct,children:f?v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#fafaf9"},children:v.jsx(JA,{size:28})}):v.jsx(w4,{serverUrl:e.serverUrl,streamKey:Ye,autoPlay:!0,muted:p,showControls:!1,className:"w-full h-full",handleOffer:St.handleOffer,reoffer:St.reoffer,getSessionState:Re,getSessionDebug:fe,getIceServers:Te,addIceCandidate:B,getIceCandidates:ue,closeSession:ge,reconnectSignal:(ne??0)+X,onStateChange:he,posterUrl:Ee,onClientNetworkSample:s==="auto"?it=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...it}).catch(()=>{})}:void 0},Ye)}),L&&!f?v.jsx(vge,{deviceId:t}):null,Z?.motionBoxes===!0&&!f?v.jsx(Hhe,{deviceId:t}):null]}),UA(Z?.audioMeter)&&!f?v.jsx($he,{deviceId:t,anchor:Z.audioMeter}):null,UA(Z?.occupancy)&&!f?v.jsx(Vhe,{system:e,deviceId:t,anchor:Z.occupancy}):null,Z?.stats===!0&&!f?v.jsx(Ghe,{containerRef:ee}):null,q&&(()=>{const it=F?.appearance,nn=q==="motion"?it?.motionColor??sl.motion:q==="audio"?it?.audioColor??sl.audio:it?.detectionColor??sl.detection,Ta=it?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${Ta}px solid ${nn}`,boxShadow:`inset 0 0 12px ${nn}`,pointerEvents:"none"}})})(),(m||Le)&&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||Le?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:Le?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(Br,{label:f?pe.play:pe.pause,big:!0,enabled:Le,onClick:it=>{Tt(it),x(t)},children:f?v.jsx(JA,{size:22}):v.jsx(Ige,{size:22})})}),v.jsxs("div",{style:{position:"absolute",left:8,bottom:8,display:"flex",gap:8,pointerEvents:"none"},children:[v.jsx(Br,{label:h?pe.mute:pe.listen,active:h,enabled:Le,onClick:it=>{Tt(it),M(t)},children:h?v.jsx(Tge,{size:18}):v.jsx(_ge,{size:18})}),v.jsx(Br,{label:c?pe.stopTalk:pe.talk,active:c,enabled:Le,onClick:it=>{Tt(it),C(t)},children:v.jsx(Nge,{size:18,muted:!c})}),R&&_&&(!z||!dt.overflow)?v.jsx(Br,{label:pe.ptz,enabled:Le,onClick:it=>{Tt(it),_(t)},children:v.jsx(Lge,{size:18})}):null,z?dt.inline.map(it=>v.jsx(Br,{label:it==="devices"?pe.linkedDevices:pe.viewOptions,enabled:Le,onClick:nn=>{Tt(nn),z(t,it)},children:it==="devices"?v.jsx(jge,{size:18}):v.jsx(Pge,{size:18})},it)):null,z&&dt.overflow?v.jsx(Br,{label:pe.moreActions,enabled:Le,onClick:it=>{Tt(it),z(t,"actions")},children:v.jsx(Dge,{size:18})}):null]}),v.jsx("div",{style:{position:"absolute",right:8,bottom:8,pointerEvents:"none"},children:v.jsx(Br,{label:pe.open,enabled:Le,onClick:it=>{Tt(it),E(t)},children:v.jsx(Oge,{size:18})})}),ga&&Ae?v.jsx("div",{style:{position:"absolute",right:8,top:8,pointerEvents:"none"},children:v.jsx(Br,{label:pe.removeFromView,enabled:Le,onClick:it=>{Tt(it),Ae(t)},children:v.jsx(zge,{size:18})})}):null,ga&&Ce?v.jsxs(v.Fragment,{children:[v.jsx(XA,{axis:"x",label:pe.resizeWidth,enabled:Le,track:pr,span:Vn,onSpan:it=>{Je(),Ce(t,it,aa)}}),v.jsx(XA,{axis:"y",label:pe.resizeHeight,enabled:Le,track:ia,span:aa,onSpan:it=>{Je(),Ce(t,Vn,it)}})]}):null]})]})}function XA({axis:e,label:t,enabled:n,track:a,span:s,onSpan:p}){const f=T.useRef(null),m=h=>e==="x"?h.clientX:h.clientY;return v.jsx("div",{role:"separator","aria-label":t,"aria-orientation":e==="x"?"vertical":"horizontal",onPointerDown:h=>{h.stopPropagation(),h.currentTarget.setPointerCapture(h.pointerId),f.current={origin:m(h),base:s}},onPointerMove:h=>{if(f.current===null||!(a>0))return;h.stopPropagation();const c=Math.round((m(h)-f.current.origin)/a),x=Math.max(1,f.current.base+c);x!==s&&p(x)},onPointerUp:h=>{f.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:()=>{f.current=null},style:{position:"absolute",...e==="x"?{right:0,top:"50%",width:14,height:48,transform:"translateY(-50%)"}:{bottom:0,left:"50%",width:48,height:14,transform:"translateX(-50%)"},borderRadius:7,background:"rgba(0,0,0,0.55)",border:"1px solid rgba(250,250,249,0.35)",cursor:e==="x"?"ew-resize":"ns-resize",touchAction:"none",pointerEvents:n?"auto":"none"}})}function Br({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 ao={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function JA({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 Ige({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 Tge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 _ge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 Nge({size:e,muted:t}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 Oge({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 jge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 Pge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 Dge({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 zge({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,children:v.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Lge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...ao,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 qge({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 eE({message:e}){return T.useEffect(()=>xi(gO("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 Bge=["setDevices","setSpans"];function Fge(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function Uge({system:e,config:t}){const[n,a]=T.useState(t.devices),[s,p]=T.useState(()=>new Set(t.audioOnIds??[])),f=hO(),m=T.useRef(f.setActiveMic);m.current=f.setActiveMic;const[h,c]=T.useState(()=>new Set(t.pausedIds??[])),[x,M]=T.useState(t.highlight),[C,E]=T.useState(t.activeOnly??!1),[R,_]=T.useState(t.showBoxes??!1),[j,D]=T.useState(()=>t.overlays??{}),[z,F]=T.useState(()=>t.spans??{}),L=She(n,x),Z=T.useMemo(()=>C?n.filter(te=>L.has(te)):n,[C,n,L]),[ne,V]=T.useState(t.quality),[U,pe]=T.useState(t.layout),[we,ke]=T.useState(t.showName),[Ae,Ce]=T.useState(0),Me=T.useMemo(()=>Kfe(t.labels),[t.labels]),[Te,B]=T.useState(()=>t.snapshots??{}),ue=T.useMemo(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[ge,Re]=T.useState({w:window.innerWidth,h:window.innerHeight}),fe=Me.camera,[q,ee]=T.useState({});T.useEffect(()=>{let te=!1;return e.trpcClient.deviceManager.listAll.query({deviceIds:[...n],projection:"slim"}).then(he=>{if(te)return;const Be={};for(const Ue of he)Be[Ue.id]={name:Ue.name??`${fe} ${Ue.id}`,online:Ue.online??!1};ee(Be)}).catch(()=>{}),()=>{te=!0}},[e,n,fe]),T.useEffect(()=>(window.__camstackGrid={setAudioOn:te=>p(new Set(te)),setMutedAll:te=>{te&&p(new Set)},setActiveMic:te=>m.current(te),setHighlight:te=>M(te),setActiveOnly:te=>E(te),setShowBoxes:te=>_(te),setOverlays:te=>D(te),setPaused:te=>c(new Set(te)),setDevices:te=>a(he=>Fge(he,te)?he:[...te]),setSpans:te=>F(te),setQuality:te=>V(te),setLayout:te=>pe(te),setShowName:ke,setShowBadges:()=>{},setSnapshots:te=>B(te),fit:(te,he)=>Re({w:te,h:he}),reconnect:()=>Ce(te=>te+1)},xi(gO("ready",void 0,Bge)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),T.useEffect(()=>Ou(te=>{const he=window.__camstackGrid;if(!he)return;switch(te.kind){case"setAudioOn":he.setAudioOn(te.value);break;case"setMutedAll":he.setMutedAll(te.value);break;case"setActiveMic":he.setActiveMic(te.value);break;case"setHighlight":he.setHighlight(te.value);break;case"setActiveOnly":he.setActiveOnly(te.value);break;case"setShowBoxes":he.setShowBoxes(te.value===!0);break;case"setOverlays":he.setOverlays(te.value);break;case"setPaused":he.setPaused(te.value);break;case"setDevices":he.setDevices(te.value);break;case"setSpans":he.setSpans(te.value);break;case"setQuality":he.setQuality(cO.parse(te.value));break;case"setLayout":he.setLayout(te.value);break;case"setShowName":he.setShowName(te.value);break;case"setShowBadges":he.setShowBadges(te.value);break;case"setSnapshots":he.setSnapshots(te.value);break;case"fit":he.fit(te.w,te.h);break;case"reconnect":he.reconnect();break}}),[]);const X=T.useMemo(()=>vhe(Z,ge.w,ge.h,U,z),[Z,ge.w,ge.h,U,z]),ye=T.useRef(null);return T.useEffect(()=>{const te=ye.current;if(!te)return;const he=[];te.querySelectorAll("[data-device-id]").forEach(Be=>{const Ue=Number(Be.dataset.deviceId),re=Be.getBoundingClientRect();he.push({deviceId:Ue,rect:{x:re.x,y:re.y,w:re.width,h:re.height}})}),he.length&&xi(Rhe(he))},[X,Z]),v.jsxs("div",{ref:ye,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:Me.noActiveCameras}),v.jsx(qge,{wall:X,renderTile:(te,he,Be)=>v.jsx(Rge,{system:e,deviceId:te,name:q[te]?.name??`${Me.camera} ${te}`,online:q[te]?.online??!1,quality:ne,muted:!s.has(te),paused:h.has(te),showName:we,audioActive:s.has(te),micActive:f.activeMicId===te,onTogglePause:Ue=>xi(whe(Ue)),onToggleAudio:Ue=>xi(khe(Ue)),onToggleMic:f.toggleMic,onOpen:Ue=>xi(xhe(Ue)),ptzSupported:ue.has(te),onPtz:Ue=>xi(Mhe(Ue)),cellW:he,cellH:Be,onCellPanel:t.cellPanels===!1?void 0:(Ue,re)=>xi(Che(Ue,re)),highlight:x,showBoxes:R,overlay:j[String(te)],reconnectSignal:Ae,posterUrl:Te[String(te)],editable:t.editable===!0,span:z[String(te)],onRemove:Ue=>xi(Ahe(Ue)),onResize:(Ue,re,Ee)=>xi(Ehe(Ue,re,Ee)),labels:Me})})]})}function Hge(){const e=Km("grid",()=>window.__CAMSTACK_GRID__,dO,che),t=T.useMemo(()=>{if(e===null||!e.ok)return null;const n=Lm({serverUrl:e.config.serverUrl,token:e.config.token}),a=new m_({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(Y_,{system:t.system,children:v.jsx(h_,{client:t.queryClient,children:v.jsx(y.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:v.jsx(Uge,{system:t.system,config:e.config})})})}):v.jsx(eE,{message:"Failed to initialise the grid embed"}):v.jsx(eE,{message:e.error})}const J0=tt([d({kind:Q("adaptive")}),d({kind:Q("profile"),profile:Ht})]),$ge=d({deviceId:l().int().nonnegative(),target:J0.optional(),muted:A().optional(),stats:A().optional(),snapshot:o().optional(),atMs:l().int().positive().optional()});function Qge(e){const t=$ge.safeParse(e);return t.success?t.data:null}const Vge=["live","loading","playing","paused","gap","ended","error"];function Gge(e){return typeof e=="string"&&Vge.includes(e)}const Ro="low",tE=5e3;class Zge{constructor(t){this.deps=t,this.deps.channel.addEventListener("message",this.onMessage)}deps;begun=!1;disposed=!1;lastSentProfile=null;degradedRequest=null;positionsSeen=0;firstFrameAnnounced=!1;rvfcHandle=null;lastPushSeq=null;retargets=0;renders=0;acks=0;lastCursorMs=null;lastState=null;playIntentAt=null;playIntentKind=null;playIntentDragId=void 0;pendingUpgrade=null;upgradeTimer=null;upgradeWarmTimer=null;onMessage=t=>{if(this.disposed||typeof t.data!="string")return;let n;try{n=JSON.parse(t.data)}catch{return}if(typeof n!="object"||n===null)return;const a=n;if(a.t==="liveProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")){this.deps.onLiveProfile?.(a.profile);return}if(a.t==="servedProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")&&typeof a.requested=="string"){const s=a.requested;this.lastSentProfile=a.profile,this.degradedRequest=a.profile===s?null:s,this.degradedRequest!==null&&this.pendingUpgrade?.desiredProfile===this.degradedRequest&&(this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:this.degradedRequest}),this.cancelPlaybackUpgrade()),this.deps.onServedProfile?.({profile:a.profile,requested:s});return}if(a.t==="state"&&Gge(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(),tE);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,tE-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:Ro,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,Ro,"land",s)?(this.lastCursorMs=n,a===this.degradedRequest?this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:a,epochMs:n}):a!==Ro&&(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=Ro){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!==Ro&&(this.lastSentProfile=Ro,this.send({t:"setProfile",profile:Ro})),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 Kge(e,t,n,a){return e?.isOpen()?(e.warm(n),e.playRecorded(t,n,a)):!1}const Wge=24e4;function Yge(e,t=Wge){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 Xge=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus"],nE=["video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp8","video/webm"];function Jge(e=n=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(n),t){const n=t?.audio?[...Xge,...nE]:nE;for(const a of n)try{if(e(a))return a}catch{}return""}function eve(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 tve(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 nve(e,t)}function nve(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 ave(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 ive(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function rve(e){let t=null,n=[],a=null,s="",p=!1;const f=()=>{if(t=null,n=[],p=!1,a){for(const h of a.getTracks())try{h.stop()}catch{}a=null}},m=h=>{f(),e.emit({type:"liveCaptureError",message:h})};return{start(){if(t)return;const h=e.getVideo();if(!h){m("no video");return}if(typeof MediaRecorder>"u"){m("MediaRecorder missing");return}const c=tve(h);if(!c){m("no video");return}const x=h.srcObject instanceof MediaStream?h.srcObject:null,M=eve(c,x);if(x&&x.getAudioTracks().length>0)for(const _ of c.getAudioTracks())try{_.stop()}catch{}const C=new MediaStream(M);a=C;const E=M.some(_=>_.kind==="audio"),R=Jge(void 0,{audio:E});try{t=R?new MediaRecorder(C,{mimeType:R,videoBitsPerSecond:25e5,...E?{audioBitsPerSecond:128e3}:{}}):new MediaRecorder(C)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing");return}n=[],s=ive(),p=!1,t.ondataavailable=_=>{_.data&&_.data.size>0&&n.push(_.data)},t.onerror=()=>m("MediaRecorder missing");try{t.start(1e3)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing")}},stop(){const h=t;if(!h||p){h||m("no video");return}p=!0;const c=s,x=h.mimeType||"video/mp4";h.onstop=()=>{const M=new Blob(n,{type:x});if(f(),M.size===0){e.emit({type:"liveCaptureError",message:"empty capture"});return}ave(M).then(C=>{e.emit({type:"liveCaptureStart",id:c,mime:x});const E=Yge(C),R=E.length;E.forEach((_,j)=>{e.emit({type:"liveCaptureChunk",id:c,index:j,total:R,data:_})}),e.emit({type:"liveCaptureDone",id:c})}).catch(C=>{e.emit({type:"liveCaptureError",message:C instanceof Error?C.message:"encode failed"})})};try{typeof h.requestData=="function"&&h.requestData(),h.stop()}catch(M){m(M instanceof Error?M.message:"stop failed")}},abort(){if(t&&t.state!=="inactive")try{t.stop()}catch{}f()}}}const ove=8,sve=2.5;function lve(e){return e>=ove?"high":e>=sve?"mid":"low"}function cve(e,t){return e.kind==="profile"?e.profile:"low"}function uve(e,t){return e.kind==="profile"?e.profile:lve(t)}const dve=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),target:J0,muted:A(),stats:A().optional(),highlight:uO.optional(),snapshot:o().optional(),initialSeekMs:l().positive().optional()}),aE=["setDevice","setDevice.atMs"];function vb(e,t){en(t!==void 0?{type:"state",state:e,message:t,caps:aE}:{type:"state",state:e,caps:aE})}function pve(e){switch(e){case"playing":return"playing";case"error":return"error";case"connecting":case"disconnected":case"idle":return"connecting"}}function iE(e,t){return cve(e)}async function mve(){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 rE(e,t,n,a){a.kind==="adaptive"&&mve().then(s=>{if(s===null)return;const p=uve(a,s);e.upgradePlayback(t,n,p)})}function fve(e){return e.kind==="adaptive"?{kind:"adaptive"}:{kind:"profile",profile:e.profile}}function hve(e){return e.kind==="adaptive"?"embed:adaptive":`embed:profile:${e.profile}`}function gve(e){const t=dve.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 oE({message:e}){return T.useEffect(()=>{vb("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 vve({system:e,deviceId:t,initialTarget:n,initialMuted:a,initialStats:s,initialHighlight:p,initialSnapshot:f,initialSeekMs:m}){const[h,c]=T.useState(n);T.useEffect(()=>tO(t),[t]);const x=T.useRef(h);x.current=h;const[M,C]=T.useState(a),[E,R]=T.useState(s),[_,j]=T.useState(p),[D,z]=T.useState(f),[F,L]=T.useState(0),[Z,ne]=T.useState({w:window.innerWidth,h:window.innerHeight}),V=bO(e,t,_),U=hO(),pe=T.useRef(U.setActiveMic);pe.current=U.setActiveMic;const{handleOffer:we,getIceServers:ke,addIceCandidate:Ae,getIceCandidates:Ce,closeSession:Me,getSessionState:Te,getSessionDebug:B}=O5(e.trpcClient,t),ue=T.useMemo(()=>fve(h),[h]),ge=T.useMemo(()=>(re,Ee,nt)=>we(ue,re,Ee,nt),[we,ue]),Re=T.useMemo(()=>(re,Ee,nt,Ye)=>we(nt,Ee,re,Ye),[we]),fe=T.useRef(null),q=T.useRef(null),ee=T.useRef("low"),X=T.useRef(!1),ye=T.useRef(null),te=T.useRef(null),he=()=>{const re=ye.current;if(re===null)return;const Ee=ee.current,nt=`${re.phase}|${re.viewportWidth??"-"}x${re.viewportHeight??"-"}|${re.devicePixelRatio??"-"}|${re.downlinkMbps??"-"}|${re.prefersTier??"-"}|${re.probeOrigin??"unreachable"}|${Ee}`;nt!==te.current&&(te.current=nt,en({type:"log",scope:"adaptive",msg:"tier decision",data:{deviceId:t,requested:h.kind==="adaptive"?"adaptive":`pinned:${h.kind}`,phase:re.phase,viewportWidth:re.viewportWidth??null,viewportHeight:re.viewportHeight??null,devicePixelRatio:re.devicePixelRatio??null,downlinkMbps:re.downlinkMbps??null,prefersTier:re.prefersTier??null,probeOrigin:re.probeOrigin,liveProfile:Ee}}))},Be=T.useRef(m??null);T.useEffect(()=>{if(!M)return;const re=setInterval(()=>{let Ee=0;for(const nt of Array.from(document.querySelectorAll("video"))){nt.muted||(nt.muted=!0,Ee++);const Ye=nt.srcObject;if(Ye instanceof MediaStream)for(const St of Ye.getAudioTracks())St.enabled&&(St.enabled=!1,Ee++)}Ee>0&&en({type:"log",scope:"live-audio",msg:"re-muted",data:{corrected:Ee}})},1e3);return()=>clearInterval(re)},[M]),T.useEffect(()=>()=>fe.current?.dispose(),[]),T.useEffect(()=>{const re=()=>{const Ie=fe.current;return Ie?.isOpen()?Ie:null},Ee=()=>iE(x.current,ee.current),nt=(Ie,Ge)=>{rE(Ie,t,Ge,x.current)},Ye=Ie=>{X.current||(X.current=!0,en({type:"log",scope:"recorded:session",msg:"pointer move with no open session",data:{what:Ie}}),en({type:"recState",state:"error"}))},St=(Ie,Ge)=>{const Je=re();return!Je||!Ge(Je)?(Ye(Ie),!1):(X.current=!1,!0)},Le=(Ie,Ge)=>{St("scrubCommit",Je=>{const Ct=Je.landFromScrub(t,Ie,Ee(),Ge);return Ct&&nt(Je,Ie),Ct})},qe=rve({emit:en,getVideo:()=>q.current});return window.__camstackEmbed={setMuted:Ie=>C(Ie),setTarget:Ie=>{const Ge=J0.safeParse(Ie);Ge.success&&c(Ge.data)},setStats:Ie=>R(Ie),setHighlight:Ie=>j(Ie),setSnapshot:Ie=>z(Ie),setMic:Ie=>pe.current(Ie?t:null),fit:(Ie,Ge)=>ne({w:Ie,h:Ge}),reconnect:()=>L(Ie=>Ie+1),playRecorded:(Ie,Ge,Je)=>{Number.isFinite(Ge)&&St("playRecorded",Ct=>Ct.playRecorded(Ie,Ge,Je))},seek:Ie=>{Number.isFinite(Ie)&&St("seek",Ge=>{const Je=Ge.playRecorded(t,Ie,Ee());return Je&&nt(Ge,Ie),Je})},scrubCommit:(Ie,Ge)=>{Number.isFinite(Ie)&&Le(Ie,Ge)},scrubStart:Ie=>{en({type:"log",scope:"recorded:scrub",msg:"scrubStart",data:{dragId:Ie}}),St("scrubStart",Ge=>Ge.begin(Ie))},scrubTo:(Ie,Ge,Je)=>{if(!Number.isFinite(Ie))return;const Ct=(Ge==="fine"||Ge==="coarse")&&Number.isFinite(Je)?{mode:Ge,velocityPxPerS:Je}:void 0;St("scrubTo",dt=>dt.isActive()?(dt.retarget(Ie,Ct),!0):!1)},timelineWarm:Ie=>{Number.isFinite(Ie)&&re()?.warm(Ie)},scrubEnd:Ie=>{Number.isFinite(Ie)&&Le(Ie)},setRate:Ie=>{Number.isFinite(Ie)&&St("setRate",Ge=>Ge.setRate(Ie))},stepFrame:Ie=>{Ie!==1&&Ie!==-1||St("stepFrame",Ge=>Ge.stepFrame(Ie))},goLive:()=>{St("goLive",Ie=>Ie.goLive())&&en({type:"recState",state:"live"})},startLiveCapture:()=>qe.start(),stopLiveCapture:()=>qe.stop()},()=>{qe.abort(),window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),T.useEffect(()=>{en({type:"micState",state:U.micState})},[U.micState]),T.useEffect(()=>Ou(re=>{const Ee=window.__camstackEmbed;if(!Ee)return;switch(re.kind){case"setMuted":Ee.setMuted(re.value);break;case"setTarget":Ee.setTarget(re.value);break;case"setStats":Ee.setStats(re.value);break;case"setHighlight":Ee.setHighlight(re.value);break;case"setSnapshot":Ee.setSnapshot(re.value);break;case"setMic":Ee.setMic(re.value);break;case"fit":Ee.fit(re.w,re.h);break;case"reconnect":Ee.reconnect();break;case"playRecorded":Ee.playRecorded(re.deviceId,re.epochMs,re.profile);break;case"seek":Ee.seek(re.epochMs??re.value);break;case"scrubCommit":Ee.scrubCommit(re.epochMs??re.value,re.dragId);break;case"scrubStart":Ee.scrubStart(re.dragId);break;case"scrubTo":Ee.scrubTo(re.epochMs??re.value,re.m,re.v);break;case"scrubEnd":Ee.scrubEnd(re.epochMs??re.value);break;case"timelineWarm":Ee.timelineWarm(re.epochMs??re.value);break;case"setRate":Ee.setRate(re.rate??re.value);break;case"stepFrame":{const Ye=re.dir;(Ye===1||Ye===-1)&&Ee.stepFrame(Ye);break}case"goLive":Ee.goLive();break;case"startLiveCapture":Ee.startLiveCapture();break;case"stopLiveCapture":Ee.stopLiveCapture();break}}),[]);const Ue=hve(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:Ue,autoPlay:!0,muted:M,showControls:!1,showStats:E,onDebugStats:re=>en({type:"log",scope:"stream-debug",msg:"sample",data:re}),onPlaybackStats:re=>en({type:"log",scope:"playback",msg:"stats",data:re}),onConnectTiming:re=>en({type:"log",scope:"webrtc-timing",msg:"connect",data:re}),onClientNetworkSample:h.kind==="adaptive"?re=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...re}).catch(()=>{})}:void 0,className:"w-full h-full",onAdaptiveHints:re=>{ye.current=re,he()},handleOffer:ge,reoffer:Re,getSessionState:Te,getSessionDebug:B,getIceServers:ke,addIceCandidate:Ae,getIceCandidates:Ce,closeSession:Me,reconnectSignal:F,posterUrl:D,onStateChange:re=>vb(pve(re)),onError:re=>vb("error",re),onReconnectAttempt:re=>en({type:"log",scope:"live:retry",msg:re.kind==="retry"?"auto-retry scheduled":"auto-retry exhausted",data:re}),onControlChannel:re=>{if(fe.current?.dispose(),X.current=!1,fe.current=new Zge({channel:re,video:()=>q.current,onState:Ee=>en({type:"recState",state:Ee}),onPosition:Ee=>en({type:"position",positionMs:Ee}),onServedProfile:Ee=>en({type:"servedProfile",profile:Ee.profile,requested:Ee.requested}),onLiveProfile:Ee=>{ee.current=Ee,he()},onFirstFrame:()=>en({type:"scrubDrawn"}),onLog:(Ee,nt)=>en({type:"log",scope:Ee.startsWith("playback:")?"playback":"scrub",msg:Ee,data:nt})}),Be.current!==null){const Ee=()=>{const nt=Be.current;if(nt===null)return;const Ye=iE(x.current,ee.current);Kge(fe.current,t,nt,Ye)&&(Be.current=null,fe.current&&rE(fe.current,t,nt,x.current),en({type:"log",scope:"recorded:initial-seek",msg:"config-carried seek fired",data:{epochMs:nt,profile:Ye}}))};re.readyState==="open"?Ee():re.addEventListener("open",Ee,{once:!0})}},onVideoElement:re=>{q.current=re}}),V&&(()=>{const re=_?.appearance,Ee=V==="motion"?re?.motionColor??sl.motion:V==="audio"?re?.audioColor??sl.audio:re?.detectionColor??sl.detection,nt=re?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${nt}px solid ${Ee}`,boxShadow:`inset 0 0 12px ${Ee}`,pointerEvents:"none",transform:"translateZ(0)"}})})()]})}function yve(){const e=Km("player",()=>window.__CAMSTACK_EMBED__,gve),[t,n]=T.useState(null);T.useEffect(()=>{const c=M=>{const C=Qge(M);C&&n(C)};window.__camstackEmbedPage={setDevice:c};const x=Ou(M=>{M.kind==="setDevice"&&c(M.value)});return()=>{window.__camstackEmbedPage&&delete window.__camstackEmbedPage,x()}},[]);const a=T.useMemo(()=>{if(e===null||!e.ok)return null;const c=Lm({serverUrl:e.config.serverUrl,token:e.config.token}),x=new m_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:c,queryClient:x}},[e]);if(T.useEffect(()=>{if(a)return()=>{a.system.close()}},[a]),e===null)return null;if(!e.ok)return v.jsx(oE,{message:e.error});if(!a)return v.jsx(oE,{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(Y_,{system:a.system,children:v.jsx(h_,{client:a.queryClient,children:v.jsx(y.Provider,{client:a.system.trpcClient,queryClient:a.queryClient,children:v.jsx(vve,{system:a.system,deviceId:s,initialTarget:p,initialMuted:f,initialStats:m,initialHighlight:e.config.highlight,initialSnapshot:h,initialSeekMs:t===null?e.config.initialSeekMs:t.atMs},s)})})})}const bve=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),startMs:l().int().nonnegative().optional()});function Sve(e){if(e==null)return{ok:!1,error:"config is required"};const t=bve.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 xve(e,t){const n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}const sE=360*60*1e3,kve="scrub unavailable: no open RecordedTrackSession";function ni(e){en(e)}function gn(e,t,n){try{en({type:"log",scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??"")}catch{}}function wve({system:e,config:t}){T.useEffect(()=>tO(t.deviceId),[t.deviceId]);const n=T.useRef(null),a=T.useRef(0),s=T.useRef(0),p=T.useRef(0),[f,m]=T.useState({w:window.innerWidth,h:window.innerHeight}),h=T.useMemo(()=>async c=>{const x=n.current;if(!x)return;const M=++p.current;s.current=performance.now(),gn("loadAt","start",{epochMs:c,window:sE}),ni({type:"state",state:"loading"});try{const C=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:c,toMs:c+sE});if(M!==p.current){gn("loadAt","superseded",{epochMs:c});return}if(gn("loadAt","manifest",{playbackUrl:C?.playbackUrl??null,endpoints:C?.playbackEndpoints?.length??0,localMaster:!!C?.localMasterPath}),!C?.playbackUrl){ni({type:"state",state:"error",message:"no footage"});return}x.src=C.playbackUrl;const E=()=>{if(M!==p.current)return;const R=typeof x.getStartDate=="function"?x.getStartDate():null,_=R instanceof Date&&!Number.isNaN(R.getTime())?R.getTime():c;a.current=_;const j=xve(c,_);if(j>0)try{x.currentTime=j}catch(D){gn("loadAt","seek-failed",{msg:String(D)})}x.play().catch(D=>{gn("loadAt","play-rejected",{msg:String(D)})}),gn("loadAt","seek",{epochMs:c,media0Ms:_,offsetSec:j})};x.readyState>=HTMLMediaElement.HAVE_METADATA?E():x.addEventListener("loadedmetadata",E,{once:!0}),gn("loadAt","src-set",{src:C.playbackUrl})}catch(C){gn("loadAt","error",{msg:C instanceof Error?C.message:String(C)}),ni({type:"state",state:"error",message:C instanceof Error?C.message:String(C)})}},[e,t.deviceId]);return T.useEffect(()=>{gn("init","mounted",{deviceId:t.deviceId,startMs:t.startMs??null,ua:navigator.userAgent});const c=(x,M)=>{gn("scrub","unavailable",{command:x,...M===void 0?{}:{epochMs:M}}),ni({type:"state",state:"error",message:kve})};return window.__camstackRecording={seekTo:x=>{gn("cmd","seekTo",{epochMs:x}),h(x)},play:()=>{gn("cmd","play"),n.current?.play().catch(()=>{})},pause:()=>{gn("cmd","pause"),n.current?.pause()},setRate:x=>{gn("cmd","setRate",{rate:x}),n.current&&(n.current.playbackRate=x)},fit:(x,M)=>{gn("cmd","fit",{w:x,h:M}),m({w:x,h:M})},scrubStart:()=>{gn("cmd","scrubStart"),c("scrubStart")},scrubTo:x=>{gn("cmd","scrubTo",{epochMs:x}),c("scrubTo",x)},scrubEnd:x=>{gn("cmd","scrubEnd",{epochMs:x}),c("scrubEnd",x)}},t.startMs&&t.startMs>0&&h(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording}},[h,t.startMs,t.deviceId]),T.useEffect(()=>Ou(c=>{const x=window.__camstackRecording;if(!x)return;switch(c.kind){case"seekTo":x.seekTo(c.value);break;case"play":x.play();break;case"pause":x.pause();break;case"setRate":x.setRate(c.value);break;case"scrubStart":x.scrubStart();break;case"scrubTo":x.scrubTo(c.value);break;case"scrubEnd":x.scrubEnd(c.value);break;case"fit":x.fit(c.w,c.h);break}}),[]),v.jsx("div",{style:{position:"fixed",left:0,top:0,width:f.w,height:f.h,background:"#000"},children:v.jsx("video",{ref:n,playsInline:!0,controls:!1,style:{width:"100%",height:"100%",objectFit:"contain",background:"#000"},onLoadedMetadata:c=>gn("video","loadedmetadata",{w:c.currentTarget.videoWidth,h:c.currentTarget.videoHeight,dur:c.currentTarget.duration}),onPlaying:()=>{gn("video","playing",{vodStartMs:Math.round(performance.now()-s.current)}),ni({type:"state",state:"playing"})},onPause:()=>ni({type:"state",state:"paused"}),onEnded:()=>ni({type:"state",state:"ended"}),onError:c=>{const x=c.currentTarget.error;gn("video","error",{code:x?.code??null,message:x?.message??null}),ni({type:"state",state:"error",message:x?.message||"video error"})},onTimeUpdate:c=>ni({type:"position",positionMs:a.current+c.currentTarget.currentTime*1e3})})})}function Mve(){const e=Km("recording",()=>window.__CAMSTACK_RECORDING__,Sve),t=T.useMemo(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,Lm({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return T.useEffect(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?v.jsx(wve,{system:t,config:e.config}):(ni({type:"state",state:"error",message:"init failed"}),null):(ni({type:"state",state:"error",message:e.error}),null)}function Cve(){const e=window.__CAMSTACK_EMBED_MODE__??new URLSearchParams(location.search).get("mode")??new URLSearchParams(location.hash.replace(/^#/,"")).get("mode")??"grid";return e==="player"?v.jsx(yve,{}):e==="recording"?v.jsx(Mve,{}):e==="events"?v.jsx(Vfe,{}):v.jsx(Hge,{})}const lE=document.getElementById("root");lE&&NP.createRoot(lE).render(v.jsx(Cve,{}));export{Fne as C,Wne as E,Ove as G,z_ as I,jve as M,bae as R,Iu as S,Qve as T,Dve as W,Vae as a,Vve as b,jae as c,G as d,qo as e,zve as f,$ve as g,Hve as h,Lve as i,v as j,Fve as k,rv as l,Pve as m,yb as n,EP as o,wP as p,Mn as q,T as r,Uve as s,_u as u,Bp as v};