Files
MultiRoombaRover/server/public/assets/index-DkDG6KGq.js
T
2025-12-22 19:47:48 -05:00

13 lines
396 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&r(m)}).observe(document,{childList:!0,subtree:!0});function s(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(f){if(f.ep)return;f.ep=!0;const d=s(f);fetch(f.href,d)}})();function xv(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Oc={exports:{}},ii={};var Gm;function bv(){if(Gm)return ii;Gm=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(r,f,d){var m=null;if(d!==void 0&&(m=""+d),f.key!==void 0&&(m=""+f.key),"key"in f){d={};for(var v in f)v!=="key"&&(d[v]=f[v])}else d=f;return f=d.ref,{$$typeof:l,type:r,key:m,ref:f!==void 0?f:null,props:d}}return ii.Fragment=i,ii.jsx=s,ii.jsxs=s,ii}var Xm;function Av(){return Xm||(Xm=1,Oc.exports=bv()),Oc.exports}var o=Av(),Dc={exports:{}},fe={};var Km;function Sv(){if(Km)return fe;Km=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),w=Symbol.iterator;function T(S){return S===null||typeof S!="object"?null:(S=w&&S[w]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,j={};function M(S,U,Q){this.props=S,this.context=U,this.refs=j,this.updater=Q||N}M.prototype.isReactComponent={},M.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},M.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function O(){}O.prototype=M.prototype;function X(S,U,Q){this.props=S,this.context=U,this.refs=j,this.updater=Q||N}var I=X.prototype=new O;I.constructor=X,E(I,M.prototype),I.isPureReactComponent=!0;var F=Array.isArray;function $(){}var V={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function te(S,U,Q){var K=Q.ref;return{$$typeof:l,type:S,key:U,ref:K!==void 0?K:null,props:Q}}function oe(S,U){return te(S.type,U,S.props)}function be(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function qe(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return U[Q]})}var Z=/\/+/g;function ne(S,U){return typeof S=="object"&&S!==null&&S.key!=null?qe(""+S.key):U.toString(36)}function J(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then($,$):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,U,Q,K,P){var re=typeof S;(re==="undefined"||re==="boolean")&&(S=null);var me=!1;if(S===null)me=!0;else switch(re){case"bigint":case"string":case"number":me=!0;break;case"object":switch(S.$$typeof){case l:case i:me=!0;break;case b:return me=S._init,z(me(S._payload),U,Q,K,P)}}if(me)return P=P(S),me=K===""?"."+ne(S,0):K,F(P)?(Q="",me!=null&&(Q=me.replace(Z,"$&/")+"/"),z(P,U,Q,"",function(en){return en})):P!=null&&(be(P)&&(P=oe(P,Q+(P.key==null||S&&S.key===P.key?"":(""+P.key).replace(Z,"$&/")+"/")+me)),U.push(P)),1;me=0;var Ze=K===""?".":K+":";if(F(S))for(var ke=0;ke<S.length;ke++)K=S[ke],re=Ze+ne(K,ke),me+=z(K,U,Q,re,P);else if(ke=T(S),typeof ke=="function")for(S=ke.call(S),ke=0;!(K=S.next()).done;)K=K.value,re=Ze+ne(K,ke++),me+=z(K,U,Q,re,P);else if(re==="object"){if(typeof S.then=="function")return z(J(S),U,Q,K,P);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return me}function G(S,U,Q){if(S==null)return S;var K=[],P=0;return z(S,K,"","",function(re){return U.call(Q,re,P++)}),K}function ae(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(Q){(S._status===0||S._status===-1)&&(S._status=1,S._result=Q)},function(Q){(S._status===0||S._status===-1)&&(S._status=2,S._result=Q)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var ee=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},se={map:G,forEach:function(S,U,Q){G(S,function(){U.apply(this,arguments)},Q)},count:function(S){var U=0;return G(S,function(){U++}),U},toArray:function(S){return G(S,function(U){return U})||[]},only:function(S){if(!be(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return fe.Activity=A,fe.Children=se,fe.Component=M,fe.Fragment=s,fe.Profiler=f,fe.PureComponent=X,fe.StrictMode=r,fe.Suspense=y,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,fe.__COMPILER_RUNTIME={__proto__:null,c:function(S){return V.H.useMemoCache(S)}},fe.cache=function(S){return function(){return S.apply(null,arguments)}},fe.cacheSignal=function(){return null},fe.cloneElement=function(S,U,Q){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var K=E({},S.props),P=S.key;if(U!=null)for(re in U.key!==void 0&&(P=""+U.key),U)!W.call(U,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&U.ref===void 0||(K[re]=U[re]);var re=arguments.length-2;if(re===1)K.children=Q;else if(1<re){for(var me=Array(re),Ze=0;Ze<re;Ze++)me[Ze]=arguments[Ze+2];K.children=me}return te(S.type,P,K)},fe.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:d,_context:S},S},fe.createElement=function(S,U,Q){var K,P={},re=null;if(U!=null)for(K in U.key!==void 0&&(re=""+U.key),U)W.call(U,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(P[K]=U[K]);var me=arguments.length-2;if(me===1)P.children=Q;else if(1<me){for(var Ze=Array(me),ke=0;ke<me;ke++)Ze[ke]=arguments[ke+2];P.children=Ze}if(S&&S.defaultProps)for(K in me=S.defaultProps,me)P[K]===void 0&&(P[K]=me[K]);return te(S,re,P)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(S){return{$$typeof:v,render:S}},fe.isValidElement=be,fe.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:ae}},fe.memo=function(S,U){return{$$typeof:g,type:S,compare:U===void 0?null:U}},fe.startTransition=function(S){var U=V.T,Q={};V.T=Q;try{var K=S(),P=V.S;P!==null&&P(Q,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then($,ee)}catch(re){ee(re)}finally{U!==null&&Q.types!==null&&(U.types=Q.types),V.T=U}},fe.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},fe.use=function(S){return V.H.use(S)},fe.useActionState=function(S,U,Q){return V.H.useActionState(S,U,Q)},fe.useCallback=function(S,U){return V.H.useCallback(S,U)},fe.useContext=function(S){return V.H.useContext(S)},fe.useDebugValue=function(){},fe.useDeferredValue=function(S,U){return V.H.useDeferredValue(S,U)},fe.useEffect=function(S,U){return V.H.useEffect(S,U)},fe.useEffectEvent=function(S){return V.H.useEffectEvent(S)},fe.useId=function(){return V.H.useId()},fe.useImperativeHandle=function(S,U,Q){return V.H.useImperativeHandle(S,U,Q)},fe.useInsertionEffect=function(S,U){return V.H.useInsertionEffect(S,U)},fe.useLayoutEffect=function(S,U){return V.H.useLayoutEffect(S,U)},fe.useMemo=function(S,U){return V.H.useMemo(S,U)},fe.useOptimistic=function(S,U){return V.H.useOptimistic(S,U)},fe.useReducer=function(S,U,Q){return V.H.useReducer(S,U,Q)},fe.useRef=function(S){return V.H.useRef(S)},fe.useState=function(S){return V.H.useState(S)},fe.useSyncExternalStore=function(S,U,Q){return V.H.useSyncExternalStore(S,U,Q)},fe.useTransition=function(){return V.H.useTransition()},fe.version="19.2.0",fe}var Zm;function po(){return Zm||(Zm=1,Dc.exports=Sv()),Dc.exports}var p=po();const ba=xv(p);var kc={exports:{}},si={},zc={exports:{}},Bc={};var Jm;function qv(){return Jm||(Jm=1,(function(l){function i(z,G){var ae=z.length;z.push(G);e:for(;0<ae;){var ee=ae-1>>>1,se=z[ee];if(0<f(se,G))z[ee]=G,z[ae]=se,ae=ee;else break e}}function s(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],ae=z.pop();if(ae!==G){z[0]=ae;e:for(var ee=0,se=z.length,S=se>>>1;ee<S;){var U=2*(ee+1)-1,Q=z[U],K=U+1,P=z[K];if(0>f(Q,ae))K<se&&0>f(P,Q)?(z[ee]=P,z[K]=ae,ee=K):(z[ee]=Q,z[U]=ae,ee=U);else if(K<se&&0>f(P,ae))z[ee]=P,z[K]=ae,ee=K;else break e}}return G}function f(z,G){var ae=z.sortIndex-G.sortIndex;return ae!==0?ae:z.id-G.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var m=Date,v=m.now();l.unstable_now=function(){return m.now()-v}}var y=[],g=[],b=1,A=null,w=3,T=!1,N=!1,E=!1,j=!1,M=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function I(z){for(var G=s(g);G!==null;){if(G.callback===null)r(g);else if(G.startTime<=z)r(g),G.sortIndex=G.expirationTime,i(y,G);else break;G=s(g)}}function F(z){if(E=!1,I(z),!N)if(s(y)!==null)N=!0,$||($=!0,qe());else{var G=s(g);G!==null&&J(F,G.startTime-z)}}var $=!1,V=-1,W=5,te=-1;function oe(){return j?!0:!(l.unstable_now()-te<W)}function be(){if(j=!1,$){var z=l.unstable_now();te=z;var G=!0;try{e:{N=!1,E&&(E=!1,O(V),V=-1),T=!0;var ae=w;try{t:{for(I(z),A=s(y);A!==null&&!(A.expirationTime>z&&oe());){var ee=A.callback;if(typeof ee=="function"){A.callback=null,w=A.priorityLevel;var se=ee(A.expirationTime<=z);if(z=l.unstable_now(),typeof se=="function"){A.callback=se,I(z),G=!0;break t}A===s(y)&&r(y),I(z)}else r(y);A=s(y)}if(A!==null)G=!0;else{var S=s(g);S!==null&&J(F,S.startTime-z),G=!1}}break e}finally{A=null,w=ae,T=!1}G=void 0}}finally{G?qe():$=!1}}}var qe;if(typeof X=="function")qe=function(){X(be)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ne=Z.port2;Z.port1.onmessage=be,qe=function(){ne.postMessage(null)}}else qe=function(){M(be,0)};function J(z,G){V=M(function(){z(l.unstable_now())},G)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return w},l.unstable_next=function(z){switch(w){case 1:case 2:case 3:var G=3;break;default:G=w}var ae=w;w=G;try{return z()}finally{w=ae}},l.unstable_requestPaint=function(){j=!0},l.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ae=w;w=z;try{return G()}finally{w=ae}},l.unstable_scheduleCallback=function(z,G,ae){var ee=l.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ee+ae:ee):ae=ee,z){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ae+se,z={id:b++,callback:G,priorityLevel:z,startTime:ae,expirationTime:se,sortIndex:-1},ae>ee?(z.sortIndex=ae,i(g,z),s(y)===null&&z===s(g)&&(E?(O(V),V=-1):E=!0,J(F,ae-ee))):(z.sortIndex=se,i(y,z),N||T||(N=!0,$||($=!0,qe()))),z},l.unstable_shouldYield=oe,l.unstable_wrapCallback=function(z){var G=w;return function(){var ae=w;w=G;try{return z.apply(this,arguments)}finally{w=ae}}}})(Bc)),Bc}var Fm;function Ev(){return Fm||(Fm=1,zc.exports=qv()),zc.exports}var Uc={exports:{}},ot={};var $m;function jv(){if($m)return ot;$m=1;var l=po();function i(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(y,g,b){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:A==null?null:""+A,children:y,containerInfo:g,implementation:b}}var m=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ot.createPortal=function(y,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return d(y,g,null,b)},ot.flushSync=function(y){var g=m.T,b=r.p;try{if(m.T=null,r.p=2,y)return y()}finally{m.T=g,r.p=b,r.d.f()}},ot.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(y,g))},ot.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},ot.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var b=g.as,A=v(b,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?r.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:A,integrity:w,fetchPriority:T}):b==="script"&&r.d.X(y,{crossOrigin:A,integrity:w,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ot.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=v(g.as,g.crossOrigin);r.d.M(y,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(y)},ot.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,A=v(b,g.crossOrigin);r.d.L(y,b,{crossOrigin:A,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ot.preloadModule=function(y,g){if(typeof y=="string")if(g){var b=v(g.as,g.crossOrigin);r.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(y)},ot.requestFormReset=function(y){r.d.r(y)},ot.unstable_batchedUpdates=function(y,g){return y(g)},ot.useFormState=function(y,g,b){return m.H.useFormState(y,g,b)},ot.useFormStatus=function(){return m.H.useHostTransitionStatus()},ot.version="19.2.0",ot}var Wm;function Nv(){if(Wm)return Uc.exports;Wm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Uc.exports=jv(),Uc.exports}var Im;function Cv(){if(Im)return si;Im=1;var l=Ev(),i=po(),s=Nv();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var c=u.alternate;if(c===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===c.child){for(c=u.child;c;){if(c===n)return y(u),e;if(c===a)return y(u),t;c=c.sibling}throw Error(r(188))}if(n.return!==a.return)n=u,a=c;else{for(var h=!1,x=u.child;x;){if(x===n){h=!0,n=u,a=c;break}if(x===a){h=!0,a=u,n=c;break}x=x.sibling}if(!h){for(x=c.child;x;){if(x===n){h=!0,n=c,a=u;break}if(x===a){h=!0,a=c,n=u;break}x=x.sibling}if(!h)throw Error(r(189))}}if(n.alternate!==a)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var A=Object.assign,w=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),X=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function qe(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case M:return"Profiler";case j:return"StrictMode";case F:return"Suspense";case $:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case X:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:ne(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var J=Array.isArray,z=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ee=[],se=-1;function S(e){return{current:e}}function U(e){0>se||(e.current=ee[se],ee[se]=null,se--)}function Q(e,t){se++,ee[se]=e.current,e.current=t}var K=S(null),P=S(null),re=S(null),me=S(null);function Ze(e,t){switch(Q(re,t),Q(P,e),Q(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hm(t),e=mm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(K),Q(K,e)}function ke(){U(K),U(P),U(re)}function en(e){e.memoizedState!==null&&Q(me,e);var t=K.current,n=mm(t,e.type);t!==n&&(Q(P,e),Q(K,n))}function tn(e){P.current===e&&(U(K),U(P)),me.current===e&&(U(me),ti._currentValue=ae)}var pe,tt;function Ve(e){if(pe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",tt=-1<n.stack.indexOf(`
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+pe+e+tt}var Ee=!1;function ze(e,t){if(!e||Ee)return"";Ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(B){var k=B}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(B){k=B}e.call(Y.prototype)}}else{try{throw Error()}catch(B){k=B}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(B){if(B&&k&&typeof B.stack=="string")return[B.stack,k.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=a.DetermineComponentFrameRoot(),h=c[0],x=c[1];if(h&&x){var q=h.split(`
`),D=x.split(`
`);for(u=a=0;a<q.length&&!q[a].includes("DetermineComponentFrameRoot");)a++;for(;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;if(a===q.length||u===D.length)for(a=q.length-1,u=D.length-1;1<=a&&0<=u&&q[a]!==D[u];)u--;for(;1<=a&&0<=u;a--,u--)if(q[a]!==D[u]){if(a!==1||u!==1)do if(a--,u--,0>u||q[a]!==D[u]){var L=`
`+q[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=u);break}}}finally{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ve(n):""}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve("Lazy");case 13:return e.child!==t&&t!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Ve("Activity");default:return""}}function Ei(e){try{var t="",n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var vr=Object.prototype.hasOwnProperty,xr=l.unstable_scheduleCallback,br=l.unstable_cancelCallback,W0=l.unstable_shouldYield,I0=l.unstable_requestPaint,xt=l.unstable_now,P0=l.unstable_getCurrentPriorityLevel,Go=l.unstable_ImmediatePriority,Xo=l.unstable_UserBlockingPriority,ji=l.unstable_NormalPriority,ey=l.unstable_LowPriority,Ko=l.unstable_IdlePriority,ty=l.log,ny=l.unstable_setDisableYieldValue,hl=null,bt=null;function Cn(e){if(typeof ty=="function"&&ny(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(hl,e)}catch{}}var At=Math.clz32?Math.clz32:iy,ay=Math.log,ly=Math.LN2;function iy(e){return e>>>=0,e===0?32:31-(ay(e)/ly|0)|0}var Ni=256,Ci=262144,Ti=4194304;function Pn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function wi(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~c,a!==0?u=Pn(a):(h&=x,h!==0?u=Pn(h):n||(n=x&~e,n!==0&&(u=Pn(n))))):(x=a&~c,x!==0?u=Pn(x):h!==0?u=Pn(h):n||(n=a&~e,n!==0&&(u=Pn(n)))),u===0?0:t!==0&&t!==u&&(t&c)===0&&(c=u&-u,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:u}function ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sy(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Zo(){var e=Ti;return Ti<<=1,(Ti&62914560)===0&&(Ti=4194304),e}function Ar(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,n,a,u,c){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,q=e.expirationTimes,D=e.hiddenUpdates;for(n=h&~n;0<n;){var L=31-At(n),Y=1<<L;x[L]=0,q[L]=-1;var k=D[L];if(k!==null)for(D[L]=null,L=0;L<k.length;L++){var B=k[L];B!==null&&(B.lane&=-536870913)}n&=~Y}a!==0&&Jo(e,a,0),c!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Jo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-At(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Fo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-At(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function $o(e,t){var n=t&-t;return n=(n&42)!==0?1:Sr(n),(n&(e.suspendedLanes|t))!==0?0:n}function Sr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function qr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wo(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Bm(e.type))}function Io(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var Tn=Math.random().toString(36).slice(2),lt="__reactFiber$"+Tn,dt="__reactProps$"+Tn,qa="__reactContainer$"+Tn,Er="__reactEvents$"+Tn,uy="__reactListeners$"+Tn,cy="__reactHandles$"+Tn,Po="__reactResources$"+Tn,yl="__reactMarker$"+Tn;function jr(e){delete e[lt],delete e[dt],delete e[Er],delete e[uy],delete e[cy]}function Ea(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qa]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Am(e);e!==null;){if(n=e[lt])return n;e=Am(e)}return t}e=n,n=e.parentNode}return null}function ja(e){if(e=e[lt]||e[qa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Na(e){var t=e[Po];return t||(t=e[Po]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[yl]=!0}var ef=new Set,tf={};function ea(e,t){Ca(e,t),Ca(e+"Capture",t)}function Ca(e,t){for(tf[e]=t,e=0;e<t.length;e++)ef.add(t[e])}var oy=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]*$"),nf={},af={};function fy(e){return vr.call(af,e)?!0:vr.call(nf,e)?!1:oy.test(e)?af[e]=!0:(nf[e]=!0,!1)}function Mi(e,t,n){if(fy(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ri(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function nn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dy(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nr(e){if(!e._valueTracker){var t=lf(e)?"checked":"value";e._valueTracker=dy(e,t,""+e[t])}}function sf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=lf(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function _i(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var hy=/[\n"\\]/g;function Mt(e){return e.replace(hy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cr(e,t,n,a,u,c,h,x){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wt(t)):e.value!==""+wt(t)&&(e.value=""+wt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Tr(e,h,wt(t)):n!=null?Tr(e,h,wt(n)):a!=null&&e.removeAttribute("value"),u==null&&c!=null&&(e.defaultChecked=!!c),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+wt(x):e.removeAttribute("name")}function rf(e,t,n,a,u,c,h,x){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Nr(e);return}n=n!=null?""+wt(n):"",t=t!=null?""+wt(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Nr(e)}function Tr(e,t,n){t==="number"&&_i(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ta(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+wt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function uf(e,t,n){if(t!=null&&(t=""+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wt(n):""}function cf(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(r(92));if(J(a)){if(1<a.length)throw Error(r(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=wt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Nr(e)}function wa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var my=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 of(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||my.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ff(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&of(e,u,a)}else for(var c in t)t.hasOwnProperty(c)&&of(e,c,t[c])}function wr(e){if(e.indexOf("-")===-1)return!1;switch(e){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 py=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"]]),yy=/^[\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 Oi(e){return yy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function an(){}var Mr=null;function Rr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,Ra=null;function df(e){var t=ja(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cr(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Mt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[dt]||null;if(!u)throw Error(r(90));Cr(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&sf(a)}break e;case"textarea":uf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ta(e,!!n.multiple,t,!1)}}}var _r=!1;function hf(e,t,n){if(_r)return e(t,n);_r=!0;try{var a=e(t);return a}finally{if(_r=!1,(Ma!==null||Ra!==null)&&(bs(),Ma&&(t=Ma,e=Ra,Ra=Ma=null,df(t),e)))for(t=0;t<e.length;t++)df(e[t])}}function vl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[dt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Or=!1;if(ln)try{var xl={};Object.defineProperty(xl,"passive",{get:function(){Or=!0}}),window.addEventListener("test",xl,xl),window.removeEventListener("test",xl,xl)}catch{Or=!1}var wn=null,Dr=null,Di=null;function mf(){if(Di)return Di;var e,t=Dr,n=t.length,a,u="value"in wn?wn.value:wn.textContent,c=u.length;for(e=0;e<n&&t[e]===u[e];e++);var h=n-e;for(a=1;a<=h&&t[n-a]===u[c-a];a++);return Di=u.slice(e,1<a?1-a:void 0)}function ki(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zi(){return!0}function pf(){return!1}function ht(e){function t(n,a,u,c,h){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(c):c[x]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?zi:pf,this.isPropagationStopped=pf,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zi)},persist:function(){},isPersistent:zi}),t}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=ht(ta),bl=A({},ta,{view:0,detail:0}),gy=ht(bl),kr,zr,Al,Ui=A({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ur,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Al&&(Al&&e.type==="mousemove"?(kr=e.screenX-Al.screenX,zr=e.screenY-Al.screenY):zr=kr=0,Al=e),kr)},movementY:function(e){return"movementY"in e?e.movementY:zr}}),yf=ht(Ui),vy=A({},Ui,{dataTransfer:0}),xy=ht(vy),by=A({},bl,{relatedTarget:0}),Br=ht(by),Ay=A({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),Sy=ht(Ay),qy=A({},ta,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ey=ht(qy),jy=A({},ta,{data:0}),gf=ht(jy),Ny={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cy={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"},Ty={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ty[e])?!!t[e]:!1}function Ur(){return wy}var My=A({},bl,{key:function(e){if(e.key){var t=Ny[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ki(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ur,charCode:function(e){return e.type==="keypress"?ki(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ki(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=ht(My),_y=A({},Ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vf=ht(_y),Oy=A({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ur}),Dy=ht(Oy),ky=A({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),zy=ht(ky),By=A({},Ui,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Uy=ht(By),Ly=A({},ta,{newState:0,oldState:0}),Hy=ht(Ly),Vy=[9,13,27,32],Lr=ln&&"CompositionEvent"in window,Sl=null;ln&&"documentMode"in document&&(Sl=document.documentMode);var Yy=ln&&"TextEvent"in window&&!Sl,xf=ln&&(!Lr||Sl&&8<Sl&&11>=Sl),bf=" ",Af=!1;function Sf(e,t){switch(e){case"keyup":return Vy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _a=!1;function Qy(e,t){switch(e){case"compositionend":return qf(t);case"keypress":return t.which!==32?null:(Af=!0,bf);case"textInput":return e=t.data,e===bf&&Af?null:e;default:return null}}function Gy(e,t){if(_a)return e==="compositionend"||!Lr&&Sf(e,t)?(e=mf(),Di=Dr=wn=null,_a=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return xf&&t.locale!=="ko"?null:t.data;default:return null}}var Xy={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 Ef(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xy[e.type]:t==="textarea"}function jf(e,t,n,a){Ma?Ra?Ra.push(a):Ra=[a]:Ma=a,t=Cs(t,"onChange"),0<t.length&&(n=new Bi("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ql=null,El=null;function Ky(e){rm(e,0)}function Li(e){var t=gl(e);if(sf(t))return e}function Nf(e,t){if(e==="change")return t}var Cf=!1;if(ln){var Hr;if(ln){var Vr="oninput"in document;if(!Vr){var Tf=document.createElement("div");Tf.setAttribute("oninput","return;"),Vr=typeof Tf.oninput=="function"}Hr=Vr}else Hr=!1;Cf=Hr&&(!document.documentMode||9<document.documentMode)}function wf(){ql&&(ql.detachEvent("onpropertychange",Mf),El=ql=null)}function Mf(e){if(e.propertyName==="value"&&Li(El)){var t=[];jf(t,El,e,Rr(e)),hf(Ky,t)}}function Zy(e,t,n){e==="focusin"?(wf(),ql=t,El=n,ql.attachEvent("onpropertychange",Mf)):e==="focusout"&&wf()}function Jy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Li(El)}function Fy(e,t){if(e==="click")return Li(t)}function $y(e,t){if(e==="input"||e==="change")return Li(t)}function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var St=typeof Object.is=="function"?Object.is:Wy;function jl(e,t){if(St(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!vr.call(t,u)||!St(e[u],t[u]))return!1}return!0}function Rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _f(e,t){var n=Rf(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rf(n)}}function Of(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Of(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Df(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_i(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_i(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Iy=ln&&"documentMode"in document&&11>=document.documentMode,Oa=null,Qr=null,Nl=null,Gr=!1;function kf(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gr||Oa==null||Oa!==_i(a)||(a=Oa,"selectionStart"in a&&Yr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Nl&&jl(Nl,a)||(Nl=a,a=Cs(Qr,"onSelect"),0<a.length&&(t=new Bi("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Oa)))}function na(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Da={animationend:na("Animation","AnimationEnd"),animationiteration:na("Animation","AnimationIteration"),animationstart:na("Animation","AnimationStart"),transitionrun:na("Transition","TransitionRun"),transitionstart:na("Transition","TransitionStart"),transitioncancel:na("Transition","TransitionCancel"),transitionend:na("Transition","TransitionEnd")},Xr={},zf={};ln&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete Da.animationend.animation,delete Da.animationiteration.animation,delete Da.animationstart.animation),"TransitionEvent"in window||delete Da.transitionend.transition);function aa(e){if(Xr[e])return Xr[e];if(!Da[e])return e;var t=Da[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zf)return Xr[e]=t[n];return e}var Bf=aa("animationend"),Uf=aa("animationiteration"),Lf=aa("animationstart"),Py=aa("transitionrun"),eg=aa("transitionstart"),tg=aa("transitioncancel"),Hf=aa("transitionend"),Vf=new Map,Kr="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(" ");Kr.push("scrollEnd");function Yt(e,t){Vf.set(e,t),ea(t,[e])}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Rt=[],ka=0,Zr=0;function Vi(){for(var e=ka,t=Zr=ka=0;t<e;){var n=Rt[t];Rt[t++]=null;var a=Rt[t];Rt[t++]=null;var u=Rt[t];Rt[t++]=null;var c=Rt[t];if(Rt[t++]=null,a!==null&&u!==null){var h=a.pending;h===null?u.next=u:(u.next=h.next,h.next=u),a.pending=u}c!==0&&Yf(n,u,c)}}function Yi(e,t,n,a){Rt[ka++]=e,Rt[ka++]=t,Rt[ka++]=n,Rt[ka++]=a,Zr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Jr(e,t,n,a){return Yi(e,t,n,a),Qi(e)}function la(e,t){return Yi(e,null,null,t),Qi(e)}function Yf(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,c=e.return;c!==null;)c.childLanes|=n,a=c.alternate,a!==null&&(a.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(u=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,u&&t!==null&&(u=31-At(n),e=c.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),c):null}function Qi(e){if(50<Jl)throw Jl=0,ac=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var za={};function ng(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,a){return new ng(e,t,n,a)}function Fr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sn(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Qf(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Gi(e,t,n,a,u,c){var h=0;if(a=e,typeof e=="function")Fr(e)&&(h=1);else if(typeof e=="string")h=rv(e,n,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=qt(31,n,t,u),e.elementType=te,e.lanes=c,e;case E:return ia(n.children,u,c,t);case j:h=8,u|=24;break;case M:return e=qt(12,n,t,u|2),e.elementType=M,e.lanes=c,e;case F:return e=qt(13,n,t,u),e.elementType=F,e.lanes=c,e;case $:return e=qt(19,n,t,u),e.elementType=$,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:h=10;break e;case O:h=9;break e;case I:h=11;break e;case V:h=14;break e;case W:h=16,a=null;break e}h=29,n=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=qt(h,n,t,u),t.elementType=e,t.type=a,t.lanes=c,t}function ia(e,t,n,a){return e=qt(7,e,a,t),e.lanes=n,e}function $r(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function Gf(e){var t=qt(18,null,null,0);return t.stateNode=e,t}function Wr(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xf=new WeakMap;function _t(e,t){if(typeof e=="object"&&e!==null){var n=Xf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ei(t)},Xf.set(e,t),t)}return{value:e,source:t,stack:Ei(t)}}var Ba=[],Ua=0,Xi=null,Cl=0,Ot=[],Dt=0,Mn=null,Zt=1,Jt="";function rn(e,t){Ba[Ua++]=Cl,Ba[Ua++]=Xi,Xi=e,Cl=t}function Kf(e,t,n){Ot[Dt++]=Zt,Ot[Dt++]=Jt,Ot[Dt++]=Mn,Mn=e;var a=Zt;e=Jt;var u=32-At(a)-1;a&=~(1<<u),n+=1;var c=32-At(t)+u;if(30<c){var h=u-u%5;c=(a&(1<<h)-1).toString(32),a>>=h,u-=h,Zt=1<<32-At(t)+u|n<<u|a,Jt=c+e}else Zt=1<<c|n<<u|a,Jt=e}function Ir(e){e.return!==null&&(rn(e,1),Kf(e,1,0))}function Pr(e){for(;e===Xi;)Xi=Ba[--Ua],Ba[Ua]=null,Cl=Ba[--Ua],Ba[Ua]=null;for(;e===Mn;)Mn=Ot[--Dt],Ot[Dt]=null,Jt=Ot[--Dt],Ot[Dt]=null,Zt=Ot[--Dt],Ot[Dt]=null}function Zf(e,t){Ot[Dt++]=Zt,Ot[Dt++]=Jt,Ot[Dt++]=Mn,Zt=t.id,Jt=t.overflow,Mn=e}var it=null,Be=null,Ae=!1,Rn=null,kt=!1,eu=Error(r(519));function _n(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tl(_t(t,e)),eu}function Jf(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[lt]=e,t[dt]=a,n){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(n=0;n<$l.length;n++)ge($l[n],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),rf(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),cf(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||fm(t.textContent,n)?(a.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),a.onScroll!=null&&ge("scroll",t),a.onScrollEnd!=null&&ge("scrollend",t),a.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||_n(e,!0)}function Ff(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:kt=!1;return;case 27:case 3:kt=!0;return;default:it=it.return}}function La(e){if(e!==it)return!1;if(!Ae)return Ff(e),Ae=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||vc(e.type,e.memoizedProps)),n=!n),n&&Be&&_n(e),Ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Be=bm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Be=bm(e)}else t===27?(t=Be,Kn(e.type)?(e=qc,qc=null,Be=e):Be=t):Be=it?Bt(e.stateNode.nextSibling):null;return!0}function sa(){Be=it=null,Ae=!1}function tu(){var e=Rn;return e!==null&&(gt===null?gt=e:gt.push.apply(gt,e),Rn=null),e}function Tl(e){Rn===null?Rn=[e]:Rn.push(e)}var nu=S(null),ra=null,un=null;function On(e,t,n){Q(nu,t._currentValue),t._currentValue=n}function cn(e){e._currentValue=nu.current,U(nu)}function au(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function lu(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var c=u.dependencies;if(c!==null){var h=u.child;c=c.firstContext;e:for(;c!==null;){var x=c;c=u;for(var q=0;q<t.length;q++)if(x.context===t[q]){c.lanes|=n,x=c.alternate,x!==null&&(x.lanes|=n),au(c.return,n,e),a||(h=null);break e}c=x.next}}else if(u.tag===18){if(h=u.return,h===null)throw Error(r(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),au(h,n,e),h=null}else h=u.child;if(h!==null)h.return=u;else for(h=u;h!==null;){if(h===e){h=null;break}if(u=h.sibling,u!==null){u.return=h.return,h=u;break}h=h.return}u=h}}function Ha(e,t,n,a){e=null;for(var u=t,c=!1;u!==null;){if(!c){if((u.flags&524288)!==0)c=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var h=u.alternate;if(h===null)throw Error(r(387));if(h=h.memoizedProps,h!==null){var x=u.type;St(u.pendingProps.value,h.value)||(e!==null?e.push(x):e=[x])}}else if(u===me.current){if(h=u.alternate,h===null)throw Error(r(387));h.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ti):e=[ti])}u=u.return}e!==null&&lu(t,e,n,a),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!St(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ua(e){ra=e,un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function st(e){return $f(ra,e)}function Zi(e,t){return ra===null&&ua(e),$f(e,t)}function $f(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},un===null){if(e===null)throw Error(r(308));un=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else un=un.next=t;return n}var ag=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},lg=l.unstable_scheduleCallback,ig=l.unstable_NormalPriority,Je={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function iu(){return{controller:new ag,data:new Map,refCount:0}}function wl(e){e.refCount--,e.refCount===0&&lg(ig,function(){e.controller.abort()})}var Ml=null,su=0,Va=0,Ya=null;function sg(e,t){if(Ml===null){var n=Ml=[];su=0,Va=cc(),Ya={status:"pending",value:void 0,then:function(a){n.push(a)}}}return su++,t.then(Wf,Wf),t}function Wf(){if(--su===0&&Ml!==null){Ya!==null&&(Ya.status="fulfilled");var e=Ml;Ml=null,Va=0,Ya=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rg(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var If=z.S;z.S=function(e,t){kh=xt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&sg(e,t),If!==null&&If(e,t)};var ca=S(null);function ru(){var e=ca.current;return e!==null?e:De.pooledCache}function Ji(e,t){t===null?Q(ca,ca.current):Q(ca,t.pool)}function Pf(){var e=ru();return e===null?null:{parent:Je._currentValue,pool:e}}var Qa=Error(r(460)),uu=Error(r(474)),Fi=Error(r(542)),$i={then:function(){}};function ed(e){return e=e.status,e==="fulfilled"||e==="rejected"}function td(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ad(e),e;default:if(typeof t.status=="string")t.then(an,an);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ad(e),e}throw fa=t,Qa}}function oa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(fa=n,Qa):n}}var fa=null;function nd(){if(fa===null)throw Error(r(459));var e=fa;return fa=null,e}function ad(e){if(e===Qa||e===Fi)throw Error(r(483))}var Ga=null,Rl=0;function Wi(e){var t=Rl;return Rl+=1,Ga===null&&(Ga=[]),td(Ga,e,t)}function _l(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ii(e,t){throw t.$$typeof===w?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ld(e){function t(R,C){if(e){var _=R.deletions;_===null?(R.deletions=[C],R.flags|=16):_.push(C)}}function n(R,C){if(!e)return null;for(;C!==null;)t(R,C),C=C.sibling;return null}function a(R){for(var C=new Map;R!==null;)R.key!==null?C.set(R.key,R):C.set(R.index,R),R=R.sibling;return C}function u(R,C){return R=sn(R,C),R.index=0,R.sibling=null,R}function c(R,C,_){return R.index=_,e?(_=R.alternate,_!==null?(_=_.index,_<C?(R.flags|=67108866,C):_):(R.flags|=67108866,C)):(R.flags|=1048576,C)}function h(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function x(R,C,_,H){return C===null||C.tag!==6?(C=$r(_,R.mode,H),C.return=R,C):(C=u(C,_),C.return=R,C)}function q(R,C,_,H){var ue=_.type;return ue===E?L(R,C,_.props.children,H,_.key):C!==null&&(C.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===W&&oa(ue)===C.type)?(C=u(C,_.props),_l(C,_),C.return=R,C):(C=Gi(_.type,_.key,_.props,null,R.mode,H),_l(C,_),C.return=R,C)}function D(R,C,_,H){return C===null||C.tag!==4||C.stateNode.containerInfo!==_.containerInfo||C.stateNode.implementation!==_.implementation?(C=Wr(_,R.mode,H),C.return=R,C):(C=u(C,_.children||[]),C.return=R,C)}function L(R,C,_,H,ue){return C===null||C.tag!==7?(C=ia(_,R.mode,H,ue),C.return=R,C):(C=u(C,_),C.return=R,C)}function Y(R,C,_){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=$r(""+C,R.mode,_),C.return=R,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case T:return _=Gi(C.type,C.key,C.props,null,R.mode,_),_l(_,C),_.return=R,_;case N:return C=Wr(C,R.mode,_),C.return=R,C;case W:return C=oa(C),Y(R,C,_)}if(J(C)||qe(C))return C=ia(C,R.mode,_,null),C.return=R,C;if(typeof C.then=="function")return Y(R,Wi(C),_);if(C.$$typeof===X)return Y(R,Zi(R,C),_);Ii(R,C)}return null}function k(R,C,_,H){var ue=C!==null?C.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return ue!==null?null:x(R,C,""+_,H);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case T:return _.key===ue?q(R,C,_,H):null;case N:return _.key===ue?D(R,C,_,H):null;case W:return _=oa(_),k(R,C,_,H)}if(J(_)||qe(_))return ue!==null?null:L(R,C,_,H,null);if(typeof _.then=="function")return k(R,C,Wi(_),H);if(_.$$typeof===X)return k(R,C,Zi(R,_),H);Ii(R,_)}return null}function B(R,C,_,H,ue){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return R=R.get(_)||null,x(C,R,""+H,ue);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case T:return R=R.get(H.key===null?_:H.key)||null,q(C,R,H,ue);case N:return R=R.get(H.key===null?_:H.key)||null,D(C,R,H,ue);case W:return H=oa(H),B(R,C,_,H,ue)}if(J(H)||qe(H))return R=R.get(_)||null,L(C,R,H,ue,null);if(typeof H.then=="function")return B(R,C,_,Wi(H),ue);if(H.$$typeof===X)return B(R,C,_,Zi(C,H),ue);Ii(C,H)}return null}function le(R,C,_,H){for(var ue=null,je=null,ie=C,he=C=0,xe=null;ie!==null&&he<_.length;he++){ie.index>he?(xe=ie,ie=null):xe=ie.sibling;var Ne=k(R,ie,_[he],H);if(Ne===null){ie===null&&(ie=xe);break}e&&ie&&Ne.alternate===null&&t(R,ie),C=c(Ne,C,he),je===null?ue=Ne:je.sibling=Ne,je=Ne,ie=xe}if(he===_.length)return n(R,ie),Ae&&rn(R,he),ue;if(ie===null){for(;he<_.length;he++)ie=Y(R,_[he],H),ie!==null&&(C=c(ie,C,he),je===null?ue=ie:je.sibling=ie,je=ie);return Ae&&rn(R,he),ue}for(ie=a(ie);he<_.length;he++)xe=B(ie,R,he,_[he],H),xe!==null&&(e&&xe.alternate!==null&&ie.delete(xe.key===null?he:xe.key),C=c(xe,C,he),je===null?ue=xe:je.sibling=xe,je=xe);return e&&ie.forEach(function(Wn){return t(R,Wn)}),Ae&&rn(R,he),ue}function ce(R,C,_,H){if(_==null)throw Error(r(151));for(var ue=null,je=null,ie=C,he=C=0,xe=null,Ne=_.next();ie!==null&&!Ne.done;he++,Ne=_.next()){ie.index>he?(xe=ie,ie=null):xe=ie.sibling;var Wn=k(R,ie,Ne.value,H);if(Wn===null){ie===null&&(ie=xe);break}e&&ie&&Wn.alternate===null&&t(R,ie),C=c(Wn,C,he),je===null?ue=Wn:je.sibling=Wn,je=Wn,ie=xe}if(Ne.done)return n(R,ie),Ae&&rn(R,he),ue;if(ie===null){for(;!Ne.done;he++,Ne=_.next())Ne=Y(R,Ne.value,H),Ne!==null&&(C=c(Ne,C,he),je===null?ue=Ne:je.sibling=Ne,je=Ne);return Ae&&rn(R,he),ue}for(ie=a(ie);!Ne.done;he++,Ne=_.next())Ne=B(ie,R,he,Ne.value,H),Ne!==null&&(e&&Ne.alternate!==null&&ie.delete(Ne.key===null?he:Ne.key),C=c(Ne,C,he),je===null?ue=Ne:je.sibling=Ne,je=Ne);return e&&ie.forEach(function(vv){return t(R,vv)}),Ae&&rn(R,he),ue}function Oe(R,C,_,H){if(typeof _=="object"&&_!==null&&_.type===E&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case T:e:{for(var ue=_.key;C!==null;){if(C.key===ue){if(ue=_.type,ue===E){if(C.tag===7){n(R,C.sibling),H=u(C,_.props.children),H.return=R,R=H;break e}}else if(C.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===W&&oa(ue)===C.type){n(R,C.sibling),H=u(C,_.props),_l(H,_),H.return=R,R=H;break e}n(R,C);break}else t(R,C);C=C.sibling}_.type===E?(H=ia(_.props.children,R.mode,H,_.key),H.return=R,R=H):(H=Gi(_.type,_.key,_.props,null,R.mode,H),_l(H,_),H.return=R,R=H)}return h(R);case N:e:{for(ue=_.key;C!==null;){if(C.key===ue)if(C.tag===4&&C.stateNode.containerInfo===_.containerInfo&&C.stateNode.implementation===_.implementation){n(R,C.sibling),H=u(C,_.children||[]),H.return=R,R=H;break e}else{n(R,C);break}else t(R,C);C=C.sibling}H=Wr(_,R.mode,H),H.return=R,R=H}return h(R);case W:return _=oa(_),Oe(R,C,_,H)}if(J(_))return le(R,C,_,H);if(qe(_)){if(ue=qe(_),typeof ue!="function")throw Error(r(150));return _=ue.call(_),ce(R,C,_,H)}if(typeof _.then=="function")return Oe(R,C,Wi(_),H);if(_.$$typeof===X)return Oe(R,C,Zi(R,_),H);Ii(R,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,C!==null&&C.tag===6?(n(R,C.sibling),H=u(C,_),H.return=R,R=H):(n(R,C),H=$r(_,R.mode,H),H.return=R,R=H),h(R)):n(R,C)}return function(R,C,_,H){try{Rl=0;var ue=Oe(R,C,_,H);return Ga=null,ue}catch(ie){if(ie===Qa||ie===Fi)throw ie;var je=qt(29,ie,null,R.mode);return je.lanes=H,je.return=R,je}finally{}}}var da=ld(!0),id=ld(!1),Dn=!1;function cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ou(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function kn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ce&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Qi(e),Yf(e,null,n),t}return Yi(e,a,t,n),Qi(e)}function Ol(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fo(e,n)}}function fu(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?u=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?u=c=t:c=c.next=t}else u=c=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var du=!1;function Dl(){if(du){var e=Ya;if(e!==null)throw e}}function kl(e,t,n,a){du=!1;var u=e.updateQueue;Dn=!1;var c=u.firstBaseUpdate,h=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var q=x,D=q.next;q.next=null,h===null?c=D:h.next=D,h=q;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==h&&(x===null?L.firstBaseUpdate=D:x.next=D,L.lastBaseUpdate=q))}if(c!==null){var Y=u.baseState;h=0,L=D=q=null,x=c;do{var k=x.lane&-536870913,B=k!==x.lane;if(B?(ve&k)===k:(a&k)===k){k!==0&&k===Va&&(du=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var le=e,ce=x;k=t;var Oe=n;switch(ce.tag){case 1:if(le=ce.payload,typeof le=="function"){Y=le.call(Oe,Y,k);break e}Y=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=ce.payload,k=typeof le=="function"?le.call(Oe,Y,k):le,k==null)break e;Y=A({},Y,k);break e;case 2:Dn=!0}}k=x.callback,k!==null&&(e.flags|=64,B&&(e.flags|=8192),B=u.callbacks,B===null?u.callbacks=[k]:B.push(k))}else B={lane:k,tag:x.tag,payload:x.payload,callback:x.callback,next:null},L===null?(D=L=B,q=Y):L=L.next=B,h|=k;if(x=x.next,x===null){if(x=u.shared.pending,x===null)break;B=x,x=B.next,B.next=null,u.lastBaseUpdate=B,u.shared.pending=null}}while(!0);L===null&&(q=Y),u.baseState=q,u.firstBaseUpdate=D,u.lastBaseUpdate=L,c===null&&(u.shared.lanes=0),Vn|=h,e.lanes=h,e.memoizedState=Y}}function sd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function rd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)sd(n[e],t)}var Xa=S(null),Pi=S(0);function ud(e,t){e=vn,Q(Pi,e),Q(Xa,t),vn=e|t.baseLanes}function hu(){Q(Pi,vn),Q(Xa,Xa.current)}function mu(){vn=Pi.current,U(Xa),U(Pi)}var Et=S(null),zt=null;function Bn(e){var t=e.alternate;Q(Xe,Xe.current&1),Q(Et,e),zt===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(zt=e)}function pu(e){Q(Xe,Xe.current),Q(Et,e),zt===null&&(zt=e)}function cd(e){e.tag===22?(Q(Xe,Xe.current),Q(Et,e),zt===null&&(zt=e)):Un()}function Un(){Q(Xe,Xe.current),Q(Et,Et.current)}function jt(e){U(Et),zt===e&&(zt=null),U(Xe)}var Xe=S(0);function es(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ac(n)||Sc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var on=0,de=null,Re=null,Fe=null,ts=!1,Ka=!1,ha=!1,ns=0,zl=0,Za=null,ug=0;function Ye(){throw Error(r(321))}function yu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!St(e[n],t[n]))return!1;return!0}function gu(e,t,n,a,u,c){return on=c,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Kd:_u,ha=!1,c=n(a,u),ha=!1,Ka&&(c=fd(t,n,a,u)),od(e),c}function od(e){z.H=Ll;var t=Re!==null&&Re.next!==null;if(on=0,Fe=Re=de=null,ts=!1,zl=0,Za=null,t)throw Error(r(300));e===null||$e||(e=e.dependencies,e!==null&&Ki(e)&&($e=!0))}function fd(e,t,n,a){de=e;var u=0;do{if(Ka&&(Za=null),zl=0,Ka=!1,25<=u)throw Error(r(301));if(u+=1,Fe=Re=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}z.H=Zd,c=t(n,a)}while(Ka);return c}function cg(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?Bl(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(de.flags|=1024),t}function vu(){var e=ns!==0;return ns=0,e}function xu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bu(e){if(ts){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ts=!1}on=0,Fe=Re=de=null,Ka=!1,zl=ns=0,Za=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?de.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Ke(){if(Re===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Fe===null?de.memoizedState:Fe.next;if(t!==null)Fe=t,Re=e;else{if(e===null)throw de.alternate===null?Error(r(467)):Error(r(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Fe===null?de.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bl(e){var t=zl;return zl+=1,Za===null&&(Za=[]),e=td(Za,e,t),t=de,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Kd:_u),e}function ls(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bl(e);if(e.$$typeof===X)return st(e)}throw Error(r(438,String(e)))}function Au(e){var t=null,n=de.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=de.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=as(),de.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=oe;return t.index++,n}function fn(e,t){return typeof t=="function"?t(e):t}function is(e){var t=Ke();return Su(t,Re,e)}function Su(e,t,n){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=n;var u=e.baseQueue,c=a.pending;if(c!==null){if(u!==null){var h=u.next;u.next=c.next,c.next=h}t.baseQueue=u=c,a.pending=null}if(c=e.baseState,u===null)e.memoizedState=c;else{t=u.next;var x=h=null,q=null,D=t,L=!1;do{var Y=D.lane&-536870913;if(Y!==D.lane?(ve&Y)===Y:(on&Y)===Y){var k=D.revertLane;if(k===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),Y===Va&&(L=!0);else if((on&k)===k){D=D.next,k===Va&&(L=!0);continue}else Y={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},q===null?(x=q=Y,h=c):q=q.next=Y,de.lanes|=k,Vn|=k;Y=D.action,ha&&n(c,Y),c=D.hasEagerState?D.eagerState:n(c,Y)}else k={lane:Y,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},q===null?(x=q=k,h=c):q=q.next=k,de.lanes|=Y,Vn|=Y;D=D.next}while(D!==null&&D!==t);if(q===null?h=c:q.next=x,!St(c,e.memoizedState)&&($e=!0,L&&(n=Ya,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=q,a.lastRenderedState=c}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function qu(e){var t=Ke(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,c=t.memoizedState;if(u!==null){n.pending=null;var h=u=u.next;do c=e(c,h.action),h=h.next;while(h!==u);St(c,t.memoizedState)||($e=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,a]}function dd(e,t,n){var a=de,u=Ke(),c=Ae;if(c){if(n===void 0)throw Error(r(407));n=n()}else n=t();var h=!St((Re||u).memoizedState,n);if(h&&(u.memoizedState=n,$e=!0),u=u.queue,Nu(pd.bind(null,a,u,e),[e]),u.getSnapshot!==t||h||Fe!==null&&Fe.memoizedState.tag&1){if(a.flags|=2048,Ja(9,{destroy:void 0},md.bind(null,a,u,n,t),null),De===null)throw Error(r(349));c||(on&127)!==0||hd(a,t,n)}return n}function hd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=de.updateQueue,t===null?(t=as(),de.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function md(e,t,n,a){t.value=n,t.getSnapshot=a,yd(t)&&gd(e)}function pd(e,t,n){return n(function(){yd(t)&&gd(e)})}function yd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!St(e,n)}catch{return!0}}function gd(e){var t=la(e,2);t!==null&&vt(t,e,2)}function Eu(e){var t=ft();if(typeof e=="function"){var n=e;if(e=n(),ha){Cn(!0);try{n()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t}function vd(e,t,n,a){return e.baseState=n,Su(e,Re,typeof a=="function"?a:fn)}function og(e,t,n,a,u){if(us(e))throw Error(r(485));if(e=t.action,e!==null){var c={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};z.T!==null?n(!0):c.isTransition=!1,a(c),n=t.pending,n===null?(c.next=t.pending=c,xd(t,c)):(c.next=n.next,t.pending=n.next=c)}}function xd(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var c=z.T,h={};z.T=h;try{var x=n(u,a),q=z.S;q!==null&&q(h,x),bd(e,t,x)}catch(D){ju(e,t,D)}finally{c!==null&&h.types!==null&&(c.types=h.types),z.T=c}}else try{c=n(u,a),bd(e,t,c)}catch(D){ju(e,t,D)}}function bd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Ad(e,t,a)},function(a){return ju(e,t,a)}):Ad(e,t,n)}function Ad(e,t,n){t.status="fulfilled",t.value=n,Sd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xd(e,n)))}function ju(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Sd(t),t=t.next;while(t!==a)}e.action=null}function Sd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qd(e,t){return t}function Ed(e,t){if(Ae){var n=De.formState;if(n!==null){e:{var a=de;if(Ae){if(Be){t:{for(var u=Be,c=kt;u.nodeType!==8;){if(!c){u=null;break t}if(u=Bt(u.nextSibling),u===null){u=null;break t}}c=u.data,u=c==="F!"||c==="F"?u:null}if(u){Be=Bt(u.nextSibling),a=u.data==="F!";break e}}_n(a)}a=!1}a&&(t=n[0])}}return n=ft(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qd,lastRenderedState:t},n.queue=a,n=Qd.bind(null,de,a),a.dispatch=n,a=Eu(!1),c=Ru.bind(null,de,!1,a.queue),a=ft(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=og.bind(null,de,u,c,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function jd(e){var t=Ke();return Nd(t,Re,e)}function Nd(e,t,n){if(t=Su(e,t,qd)[0],e=is(fn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Bl(t)}catch(h){throw h===Qa?Fi:h}else a=t;t=Ke();var u=t.queue,c=u.dispatch;return n!==t.memoizedState&&(de.flags|=2048,Ja(9,{destroy:void 0},fg.bind(null,u,n),null)),[a,c,e]}function fg(e,t){e.action=t}function Cd(e){var t=Ke(),n=Re;if(n!==null)return Nd(t,n,e);Ke(),t=t.memoizedState,n=Ke();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ja(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=de.updateQueue,t===null&&(t=as(),de.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Td(){return Ke().memoizedState}function ss(e,t,n,a){var u=ft();de.flags|=e,u.memoizedState=Ja(1|t,{destroy:void 0},n,a===void 0?null:a)}function rs(e,t,n,a){var u=Ke();a=a===void 0?null:a;var c=u.memoizedState.inst;Re!==null&&a!==null&&yu(a,Re.memoizedState.deps)?u.memoizedState=Ja(t,c,n,a):(de.flags|=e,u.memoizedState=Ja(1|t,c,n,a))}function wd(e,t){ss(8390656,8,e,t)}function Nu(e,t){rs(2048,8,e,t)}function dg(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=as(),de.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Md(e){var t=Ke().memoizedState;return dg({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Rd(e,t){return rs(4,2,e,t)}function _d(e,t){return rs(4,4,e,t)}function Od(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Dd(e,t,n){n=n!=null?n.concat([e]):null,rs(4,4,Od.bind(null,t,e),n)}function Cu(){}function kd(e,t){var n=Ke();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&yu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function zd(e,t){var n=Ke();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&yu(t,a[1]))return a[0];if(a=e(),ha){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[a,t],a}function Tu(e,t,n){return n===void 0||(on&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Bh(),de.lanes|=e,Vn|=e,n)}function Bd(e,t,n,a){return St(n,t)?n:Xa.current!==null?(e=Tu(e,n,a),St(e,t)||($e=!0),e):(on&42)===0||(on&1073741824)!==0&&(ve&261930)===0?($e=!0,e.memoizedState=n):(e=Bh(),de.lanes|=e,Vn|=e,t)}function Ud(e,t,n,a,u){var c=G.p;G.p=c!==0&&8>c?c:8;var h=z.T,x={};z.T=x,Ru(e,!1,t,n);try{var q=u(),D=z.S;if(D!==null&&D(x,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var L=rg(q,a);Ul(e,t,L,Tt(e))}else Ul(e,t,a,Tt(e))}catch(Y){Ul(e,t,{then:function(){},status:"rejected",reason:Y},Tt())}finally{G.p=c,h!==null&&x.types!==null&&(h.types=x.types),z.T=h}}function hg(){}function wu(e,t,n,a){if(e.tag!==5)throw Error(r(476));var u=Ld(e).queue;Ud(e,u,t,ae,n===null?hg:function(){return Hd(e),n(a)})}function Ld(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hd(e){var t=Ld(e);t.next===null&&(t=e.alternate.memoizedState),Ul(e,t.next.queue,{},Tt())}function Mu(){return st(ti)}function Vd(){return Ke().memoizedState}function Yd(){return Ke().memoizedState}function mg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=kn(n);var a=zn(t,e,n);a!==null&&(vt(a,t,n),Ol(a,t,n)),t={cache:iu()},e.payload=t;return}t=t.return}}function pg(e,t,n){var a=Tt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},us(e)?Gd(t,n):(n=Jr(e,t,n,a),n!==null&&(vt(n,e,a),Xd(n,t,a)))}function Qd(e,t,n){var a=Tt();Ul(e,t,n,a)}function Ul(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(us(e))Gd(t,u);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,x=c(h,n);if(u.hasEagerState=!0,u.eagerState=x,St(x,h))return Yi(e,t,u,0),De===null&&Vi(),!1}catch{}finally{}if(n=Jr(e,t,u,a),n!==null)return vt(n,e,a),Xd(n,t,a),!0}return!1}function Ru(e,t,n,a){if(a={lane:2,revertLane:cc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},us(e)){if(t)throw Error(r(479))}else t=Jr(e,n,a,2),t!==null&&vt(t,e,2)}function us(e){var t=e.alternate;return e===de||t!==null&&t===de}function Gd(e,t){Ka=ts=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xd(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Fo(e,n)}}var Ll={readContext:st,use:ls,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};Ll.useEffectEvent=Ye;var Kd={readContext:st,use:ls,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:wd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ss(4194308,4,Od.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ft();t=t===void 0?null:t;var a=e();if(ha){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=ft();if(n!==void 0){var u=n(t);if(ha){Cn(!0);try{n(t)}finally{Cn(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=pg.bind(null,de,e),[a.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Eu(e);var t=e.queue,n=Qd.bind(null,de,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cu,useDeferredValue:function(e,t){var n=ft();return Tu(n,e,t)},useTransition:function(){var e=Eu(!1);return e=Ud.bind(null,de,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=de,u=ft();if(Ae){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),De===null)throw Error(r(349));(ve&127)!==0||hd(a,t,n)}u.memoizedState=n;var c={value:n,getSnapshot:t};return u.queue=c,wd(pd.bind(null,a,c,e),[e]),a.flags|=2048,Ja(9,{destroy:void 0},md.bind(null,a,c,n,t),null),n},useId:function(){var e=ft(),t=De.identifierPrefix;if(Ae){var n=Jt,a=Zt;n=(a&~(1<<32-At(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ns++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ug++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mu,useFormState:Ed,useActionState:Ed,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ru.bind(null,de,!0,n),n.dispatch=t,[e,t]},useMemoCache:Au,useCacheRefresh:function(){return ft().memoizedState=mg.bind(null,de)},useEffectEvent:function(e){var t=ft(),n={impl:e};return t.memoizedState=n,function(){if((Ce&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},_u={readContext:st,use:ls,useCallback:kd,useContext:st,useEffect:Nu,useImperativeHandle:Dd,useInsertionEffect:Rd,useLayoutEffect:_d,useMemo:zd,useReducer:is,useRef:Td,useState:function(){return is(fn)},useDebugValue:Cu,useDeferredValue:function(e,t){var n=Ke();return Bd(n,Re.memoizedState,e,t)},useTransition:function(){var e=is(fn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Bl(e),t]},useSyncExternalStore:dd,useId:Vd,useHostTransitionStatus:Mu,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var n=Ke();return vd(n,Re,e,t)},useMemoCache:Au,useCacheRefresh:Yd};_u.useEffectEvent=Md;var Zd={readContext:st,use:ls,useCallback:kd,useContext:st,useEffect:Nu,useImperativeHandle:Dd,useInsertionEffect:Rd,useLayoutEffect:_d,useMemo:zd,useReducer:qu,useRef:Td,useState:function(){return qu(fn)},useDebugValue:Cu,useDeferredValue:function(e,t){var n=Ke();return Re===null?Tu(n,e,t):Bd(n,Re.memoizedState,e,t)},useTransition:function(){var e=qu(fn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Bl(e),t]},useSyncExternalStore:dd,useId:Vd,useHostTransitionStatus:Mu,useFormState:Cd,useActionState:Cd,useOptimistic:function(e,t){var n=Ke();return Re!==null?vd(n,Re,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Au,useCacheRefresh:Yd};Zd.useEffectEvent=Md;function Ou(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:A({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Du={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Tt(),u=kn(a);u.payload=t,n!=null&&(u.callback=n),t=zn(e,u,a),t!==null&&(vt(t,e,a),Ol(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Tt(),u=kn(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=zn(e,u,a),t!==null&&(vt(t,e,a),Ol(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),a=kn(n);a.tag=2,t!=null&&(a.callback=t),t=zn(e,a,n),t!==null&&(vt(t,e,n),Ol(t,e,n))}};function Jd(e,t,n,a,u,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,h):t.prototype&&t.prototype.isPureReactComponent?!jl(n,a)||!jl(u,c):!0}function Fd(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Du.enqueueReplaceState(t,t.state,null)}function ma(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=A({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function $d(e){Hi(e)}function Wd(e){console.error(e)}function Id(e){Hi(e)}function cs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Pd(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function ku(e,t,n){return n=kn(n),n.tag=3,n.payload={element:null},n.callback=function(){cs(e,t)},n}function eh(e){return e=kn(e),e.tag=3,e}function th(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var c=a.value;e.payload=function(){return u(c)},e.callback=function(){Pd(t,n,a)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Pd(t,n,a),typeof u!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function yg(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ha(t,n,u,!0),n=Et.current,n!==null){switch(n.tag){case 31:case 13:return zt===null?As():n.alternate===null&&Qe===0&&(Qe=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===$i?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),sc(e,a,u)),!1;case 22:return n.flags|=65536,a===$i?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),sc(e,a,u)),!1}throw Error(r(435,n.tag))}return sc(e,a,u),As(),!1}if(Ae)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==eu&&(e=Error(r(422),{cause:a}),Tl(_t(e,n)))):(a!==eu&&(t=Error(r(423),{cause:a}),Tl(_t(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=_t(a,n),u=ku(e.stateNode,a,u),fu(e,u),Qe!==4&&(Qe=2)),!1;var c=Error(r(520),{cause:a});if(c=_t(c,n),Zl===null?Zl=[c]:Zl.push(c),Qe!==4&&(Qe=2),t===null)return!0;a=_t(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=ku(n.stateNode,a,e),fu(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Yn===null||!Yn.has(c))))return n.flags|=65536,u&=-u,n.lanes|=u,u=eh(u),th(u,e,n,a),fu(n,u),!1}n=n.return}while(n!==null);return!1}var zu=Error(r(461)),$e=!1;function rt(e,t,n,a){t.child=e===null?id(t,null,n,a):da(t,e.child,n,a)}function nh(e,t,n,a,u){n=n.render;var c=t.ref;if("ref"in a){var h={};for(var x in a)x!=="ref"&&(h[x]=a[x])}else h=a;return ua(t),a=gu(e,t,n,h,c,u),x=vu(),e!==null&&!$e?(xu(e,t,u),dn(e,t,u)):(Ae&&x&&Ir(t),t.flags|=1,rt(e,t,a,u),t.child)}function ah(e,t,n,a,u){if(e===null){var c=n.type;return typeof c=="function"&&!Fr(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,lh(e,t,c,a,u)):(e=Gi(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Gu(e,u)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:jl,n(h,a)&&e.ref===t.ref)return dn(e,t,u)}return t.flags|=1,e=sn(c,a),e.ref=t.ref,e.return=t,t.child=e}function lh(e,t,n,a,u){if(e!==null){var c=e.memoizedProps;if(jl(c,a)&&e.ref===t.ref)if($e=!1,t.pendingProps=a=c,Gu(e,u))(e.flags&131072)!==0&&($e=!0);else return t.lanes=e.lanes,dn(e,t,u)}return Bu(e,t,n,a,u)}function ih(e,t,n,a){var u=a.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~c}else a=0,t.child=null;return sh(e,t,c,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ji(t,c!==null?c.cachePool:null),c!==null?ud(t,c):hu(),cd(t);else return a=t.lanes=536870912,sh(e,t,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(Ji(t,c.cachePool),ud(t,c),Un(),t.memoizedState=null):(e!==null&&Ji(t,null),hu(),Un());return rt(e,t,u,n),t.child}function Hl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sh(e,t,n,a,u){var c=ru();return c=c===null?null:{parent:Je._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Ji(t,null),hu(),cd(t),e!==null&&Ha(e,t,a,!0),t.childLanes=u,null}function os(e,t){return t=ds({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function rh(e,t,n){return da(t,e.child,null,n),e=os(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function gg(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(a.mode==="hidden")return e=os(t,a),t.lanes=536870912,Hl(null,e);if(pu(t),(e=Be)?(e=xm(e,kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mn!==null?{id:Zt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,it=t,Be=null)):e=null,e===null)throw _n(t);return t.lanes=536870912,null}return os(t,a)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(pu(t),u)if(t.flags&256)t.flags&=-257,t=rh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if($e||Ha(e,t,n,!1),u=(n&e.childLanes)!==0,$e||u){if(a=De,a!==null&&(h=$o(a,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,la(e,h),vt(a,e,h),zu;As(),t=rh(e,t,n)}else e=c.treeContext,Be=Bt(h.nextSibling),it=t,Ae=!0,Rn=null,kt=!1,e!==null&&Zf(t,e),t=os(t,a),t.flags|=4096;return t}return e=sn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bu(e,t,n,a,u){return ua(t),n=gu(e,t,n,a,void 0,u),a=vu(),e!==null&&!$e?(xu(e,t,u),dn(e,t,u)):(Ae&&a&&Ir(t),t.flags|=1,rt(e,t,n,u),t.child)}function uh(e,t,n,a,u,c){return ua(t),t.updateQueue=null,n=fd(t,a,n,u),od(e),a=vu(),e!==null&&!$e?(xu(e,t,c),dn(e,t,c)):(Ae&&a&&Ir(t),t.flags|=1,rt(e,t,n,c),t.child)}function ch(e,t,n,a,u){if(ua(t),t.stateNode===null){var c=za,h=n.contextType;typeof h=="object"&&h!==null&&(c=st(h)),c=new n(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Du,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},cu(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?st(h):za,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Ou(t,n,h,a),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&Du.enqueueReplaceState(c,c.state,null),kl(t,a,c,u),Dl(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var x=t.memoizedProps,q=ma(n,x);c.props=q;var D=c.context,L=n.contextType;h=za,typeof L=="object"&&L!==null&&(h=st(L));var Y=n.getDerivedStateFromProps;L=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x||D!==h)&&Fd(t,c,a,h),Dn=!1;var k=t.memoizedState;c.state=k,kl(t,a,c,u),Dl(),D=t.memoizedState,x||k!==D||Dn?(typeof Y=="function"&&(Ou(t,n,Y,a),D=t.memoizedState),(q=Dn||Jd(t,n,q,a,k,D,h))?(L||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=D),c.props=a,c.state=D,c.context=h,a=q):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,ou(e,t),h=t.memoizedProps,L=ma(n,h),c.props=L,Y=t.pendingProps,k=c.context,D=n.contextType,q=za,typeof D=="object"&&D!==null&&(q=st(D)),x=n.getDerivedStateFromProps,(D=typeof x=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==Y||k!==q)&&Fd(t,c,a,q),Dn=!1,k=t.memoizedState,c.state=k,kl(t,a,c,u),Dl();var B=t.memoizedState;h!==Y||k!==B||Dn||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof x=="function"&&(Ou(t,n,x,a),B=t.memoizedState),(L=Dn||Jd(t,n,L,a,k,B,q)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(D||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,B,q),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,B,q)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=B),c.props=a,c.state=B,c.context=q,a=L):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),a=!1)}return c=a,fs(e,t),a=(t.flags&128)!==0,c||a?(c=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&a?(t.child=da(t,e.child,null,u),t.child=da(t,null,n,u)):rt(e,t,n,u),t.memoizedState=c.state,e=t.child):e=dn(e,t,u),e}function oh(e,t,n,a){return sa(),t.flags|=256,rt(e,t,n,a),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lu(e){return{baseLanes:e,cachePool:Pf()}}function Hu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ct),e}function fh(e,t,n){var a=t.pendingProps,u=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Xe.current&2)!==0),h&&(u=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(u?Bn(t):Un(),(e=Be)?(e=xm(e,kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mn!==null?{id:Zt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,it=t,Be=null)):e=null,e===null)throw _n(t);return Sc(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,u?(Un(),u=t.mode,x=ds({mode:"hidden",children:x},u),a=ia(a,u,n,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Lu(n),a.childLanes=Hu(e,h,n),t.memoizedState=Uu,Hl(null,a)):(Bn(t),Vu(t,x))}var q=e.memoizedState;if(q!==null&&(x=q.dehydrated,x!==null)){if(c)t.flags&256?(Bn(t),t.flags&=-257,t=Yu(e,t,n)):t.memoizedState!==null?(Un(),t.child=e.child,t.flags|=128,t=null):(Un(),x=a.fallback,u=t.mode,a=ds({mode:"visible",children:a.children},u),x=ia(x,u,n,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,da(t,e.child,null,n),a=t.child,a.memoizedState=Lu(n),a.childLanes=Hu(e,h,n),t.memoizedState=Uu,t=Hl(null,a));else if(Bn(t),Sc(x)){if(h=x.nextSibling&&x.nextSibling.dataset,h)var D=h.dgst;h=D,a=Error(r(419)),a.stack="",a.digest=h,Tl({value:a,source:null,stack:null}),t=Yu(e,t,n)}else if($e||Ha(e,t,n,!1),h=(n&e.childLanes)!==0,$e||h){if(h=De,h!==null&&(a=$o(h,n),a!==0&&a!==q.retryLane))throw q.retryLane=a,la(e,a),vt(h,e,a),zu;Ac(x)||As(),t=Yu(e,t,n)}else Ac(x)?(t.flags|=192,t.child=e.child,t=null):(e=q.treeContext,Be=Bt(x.nextSibling),it=t,Ae=!0,Rn=null,kt=!1,e!==null&&Zf(t,e),t=Vu(t,a.children),t.flags|=4096);return t}return u?(Un(),x=a.fallback,u=t.mode,q=e.child,D=q.sibling,a=sn(q,{mode:"hidden",children:a.children}),a.subtreeFlags=q.subtreeFlags&65011712,D!==null?x=sn(D,x):(x=ia(x,u,n,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Hl(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Lu(n):(u=x.cachePool,u!==null?(q=Je._currentValue,u=u.parent!==q?{parent:q,pool:q}:u):u=Pf(),x={baseLanes:x.baseLanes|n,cachePool:u}),a.memoizedState=x,a.childLanes=Hu(e,h,n),t.memoizedState=Uu,Hl(e.child,a)):(Bn(t),n=e.child,e=n.sibling,n=sn(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Vu(e,t){return t=ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ds(e,t){return e=qt(22,e,null,t),e.lanes=0,e}function Yu(e,t,n){return da(t,e.child,null,n),e=Vu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dh(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),au(e.return,t,n)}function Qu(e,t,n,a,u,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=a,h.tail=n,h.tailMode=u,h.treeForkCount=c)}function hh(e,t,n){var a=t.pendingProps,u=a.revealOrder,c=a.tail;a=a.children;var h=Xe.current,x=(h&2)!==0;if(x?(h=h&1|2,t.flags|=128):h&=1,Q(Xe,h),rt(e,t,a,n),a=Ae?Cl:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dh(e,n,t);else if(e.tag===19)dh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&es(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Qu(t,!1,u,n,c,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&es(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Qu(t,!0,n,null,c,a);break;case"together":Qu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ha(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=sn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=sn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Gu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ki(e)))}function vg(e,t,n){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),On(t,Je,e.memoizedState.cache),sa();break;case 27:case 5:en(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:On(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,pu(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Bn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?fh(e,t,n):(Bn(t),e=dn(e,t,n),e!==null?e.sibling:null);Bn(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ha(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return hh(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Q(Xe,Xe.current),a)break;return null;case 22:return t.lanes=0,ih(e,t,n,t.pendingProps);case 24:On(t,Je,e.memoizedState.cache)}return dn(e,t,n)}function mh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$e=!0;else{if(!Gu(e,n)&&(t.flags&128)===0)return $e=!1,vg(e,t,n);$e=(e.flags&131072)!==0}else $e=!1,Ae&&(t.flags&1048576)!==0&&Kf(t,Cl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=oa(t.elementType),t.type=e,typeof e=="function")Fr(e)?(a=ma(e,a),t.tag=1,t=ch(null,t,e,a,n)):(t.tag=0,t=Bu(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===I){t.tag=11,t=nh(null,t,e,a,n);break e}else if(u===V){t.tag=14,t=ah(null,t,e,a,n);break e}}throw t=ne(e)||e,Error(r(306,t,""))}}return t;case 0:return Bu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=ma(a,t.pendingProps),ch(e,t,a,u,n);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var c=t.memoizedState;u=c.element,ou(e,t),kl(t,a,null,n);var h=t.memoizedState;if(a=h.cache,On(t,Je,a),a!==c.cache&&lu(t,[Je],n,!0),Dl(),a=h.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=oh(e,t,a,n);break e}else if(a!==u){u=_t(Error(r(424)),t),Tl(u),t=oh(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Be=Bt(e.firstChild),it=t,Ae=!0,Rn=null,kt=!0,n=id(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(sa(),a===u){t=dn(e,t,n);break e}rt(e,t,a,n)}t=t.child}return t;case 26:return fs(e,t),e===null?(n=jm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ae||(n=t.type,e=t.pendingProps,a=Ts(re.current).createElement(n),a[lt]=t,a[dt]=e,ut(a,n,e),nt(a),t.stateNode=a):t.memoizedState=jm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return en(t),e===null&&Ae&&(a=t.stateNode=Sm(t.type,t.pendingProps,re.current),it=t,kt=!0,u=Be,Kn(t.type)?(qc=u,Be=Bt(a.firstChild)):Be=u),rt(e,t,t.pendingProps.children,n),fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((u=a=Be)&&(a=Jg(a,t.type,t.pendingProps,kt),a!==null?(t.stateNode=a,it=t,Be=Bt(a.firstChild),kt=!1,u=!0):u=!1),u||_n(t)),en(t),u=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,a=c.children,vc(u,c)?a=null:h!==null&&vc(u,h)&&(t.flags|=32),t.memoizedState!==null&&(u=gu(e,t,cg,null,null,n),ti._currentValue=u),fs(e,t),rt(e,t,a,n),t.child;case 6:return e===null&&Ae&&((e=n=Be)&&(n=Fg(n,t.pendingProps,kt),n!==null?(t.stateNode=n,it=t,Be=null,e=!0):e=!1),e||_n(t)),null;case 13:return fh(e,t,n);case 4:return Ze(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=da(t,null,a,n):rt(e,t,a,n),t.child;case 11:return nh(e,t,t.type,t.pendingProps,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,On(t,t.type,a.value),rt(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,ua(t),u=st(u),a=a(u),t.flags|=1,rt(e,t,a,n),t.child;case 14:return ah(e,t,t.type,t.pendingProps,n);case 15:return lh(e,t,t.type,t.pendingProps,n);case 19:return hh(e,t,n);case 31:return gg(e,t,n);case 22:return ih(e,t,n,t.pendingProps);case 24:return ua(t),a=st(Je),e===null?(u=ru(),u===null&&(u=De,c=iu(),u.pooledCache=c,c.refCount++,c!==null&&(u.pooledCacheLanes|=n),u=c),t.memoizedState={parent:a,cache:u},cu(t),On(t,Je,u)):((e.lanes&n)!==0&&(ou(e,t),kl(t,null,null,n),Dl()),u=e.memoizedState,c=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),On(t,Je,a)):(a=c.cache,On(t,Je,a),a!==u.cache&&lu(t,[Je],n,!0))),rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function hn(e){e.flags|=4}function Xu(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Vh())e.flags|=8192;else throw fa=$i,uu}else e.flags&=-16777217}function ph(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Mm(t))if(Vh())e.flags|=8192;else throw fa=$i,uu}function hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zo():536870912,e.lanes|=t,Ia|=t)}function Vl(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function xg(e,t,n){var a=t.pendingProps;switch(Pr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return Ue(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cn(Je),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(La(t)?hn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tu())),Ue(t),null;case 26:var u=t.type,c=t.memoizedState;return e===null?(hn(t),c!==null?(Ue(t),ph(t,c)):(Ue(t),Xu(t,u,null,a,n))):c?c!==e.memoizedState?(hn(t),Ue(t),ph(t,c)):(Ue(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&hn(t),Ue(t),Xu(t,u,e,a,n)),null;case 27:if(tn(t),n=re.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&hn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ue(t),null}e=K.current,La(t)?Jf(t):(e=Sm(u,a,n),t.stateNode=e,hn(t))}return Ue(t),null;case 5:if(tn(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&hn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ue(t),null}if(c=K.current,La(t))Jf(t);else{var h=Ts(re.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?h.createElement("select",{is:a.is}):h.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?h.createElement(u,{is:a.is}):h.createElement(u)}}c[lt]=t,c[dt]=a;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(ut(c,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&hn(t)}}return Ue(t),Xu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&hn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=re.current,La(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=it,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||fm(e.nodeValue,n)),e||_n(t,!0)}else e=Ts(e).createTextNode(a),e[lt]=t,t.stateNode=e}return Ue(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=La(t),n!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[lt]=t}else sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),e=!1}else n=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Ue(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=La(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[lt]=t}else sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),u=!1}else u=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hs(t,t.updateQueue),Ue(t),null);case 4:return ke(),e===null&&hc(t.stateNode.containerInfo),Ue(t),null;case 10:return cn(t.type),Ue(t),null;case 19:if(U(Xe),a=t.memoizedState,a===null)return Ue(t),null;if(u=(t.flags&128)!==0,c=a.rendering,c===null)if(u)Vl(a,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=es(e),c!==null){for(t.flags|=128,Vl(a,!1),e=c.updateQueue,t.updateQueue=e,hs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qf(n,e),n=n.sibling;return Q(Xe,Xe.current&1|2),Ae&&rn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&xt()>vs&&(t.flags|=128,u=!0,Vl(a,!1),t.lanes=4194304)}else{if(!u)if(e=es(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,hs(t,e),Vl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!Ae)return Ue(t),null}else 2*xt()-a.renderingStartTime>vs&&n!==536870912&&(t.flags|=128,u=!0,Vl(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=xt(),e.sibling=null,n=Xe.current,Q(Xe,u?n&1|2:n&1),Ae&&rn(t,a.treeForkCount),e):(Ue(t),null);case 22:case 23:return jt(t),mu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),n=t.updateQueue,n!==null&&hs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&U(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),cn(Je),Ue(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function bg(e,t){switch(Pr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cn(Je),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return tn(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(r(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Xe),null;case 4:return ke(),null;case 10:return cn(t.type),null;case 22:case 23:return jt(t),mu(),e!==null&&U(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cn(Je),null;case 25:return null;default:return null}}function yh(e,t){switch(Pr(t),t.tag){case 3:cn(Je),ke();break;case 26:case 27:case 5:tn(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:U(Xe);break;case 10:cn(t.type);break;case 22:case 23:jt(t),mu(),e!==null&&U(ca);break;case 24:cn(Je)}}function Yl(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var c=n.create,h=n.inst;a=c(),h.destroy=a}n=n.next}while(n!==u)}}catch(x){we(t,t.return,x)}}function Ln(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var c=u.next;a=c;do{if((a.tag&e)===e){var h=a.inst,x=h.destroy;if(x!==void 0){h.destroy=void 0,u=t;var q=n,D=x;try{D()}catch(L){we(u,q,L)}}}a=a.next}while(a!==c)}}catch(L){we(t,t.return,L)}}function gh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{rd(t,n)}catch(a){we(e,e.return,a)}}}function vh(e,t,n){n.props=ma(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){we(e,t,a)}}function Ql(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){we(e,t,u)}}function Ft(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){we(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){we(e,t,u)}else n.current=null}function xh(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){we(e,e.return,u)}}function Ku(e,t,n){try{var a=e.stateNode;Yg(a,e.type,n,t),a[dt]=t}catch(u){we(e,e.return,u)}}function bh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kn(e.type)||e.tag===4}function Zu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ju(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(a!==4&&(a===27&&Kn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ju(e,t,n),e=e.sibling;e!==null;)Ju(e,t,n),e=e.sibling}function ms(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Kn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ms(e,t,n),e=e.sibling;e!==null;)ms(e,t,n),e=e.sibling}function Ah(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);ut(t,a,n),t[lt]=e,t[dt]=n}catch(c){we(e,e.return,c)}}var mn=!1,We=!1,Fu=!1,Sh=typeof WeakSet=="function"?WeakSet:Set,at=null;function Ag(e,t){if(e=e.containerInfo,yc=ks,e=Df(e),Yr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,x=-1,q=-1,D=0,L=0,Y=e,k=null;t:for(;;){for(var B;Y!==n||u!==0&&Y.nodeType!==3||(x=h+u),Y!==c||a!==0&&Y.nodeType!==3||(q=h+a),Y.nodeType===3&&(h+=Y.nodeValue.length),(B=Y.firstChild)!==null;)k=Y,Y=B;for(;;){if(Y===e)break t;if(k===n&&++D===u&&(x=h),k===c&&++L===a&&(q=h),(B=Y.nextSibling)!==null)break;Y=k,k=Y.parentNode}Y=B}n=x===-1||q===-1?null:{start:x,end:q}}else n=null}n=n||{start:0,end:0}}else n=null;for(gc={focusedElem:e,selectionRange:n},ks=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){switch(t=at,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,u=c.memoizedProps,c=c.memoizedState,a=n.stateNode;try{var le=ma(n.type,u);e=a.getSnapshotBeforeUpdate(le,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(ce){we(n,n.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)bc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,at=e;break}at=t.return}}function qh(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:yn(e,n),a&4&&Yl(5,n);break;case 1:if(yn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){we(n,n.return,h)}else{var u=ma(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){we(n,n.return,h)}}a&64&&gh(n),a&512&&Ql(n,n.return);break;case 3:if(yn(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{rd(e,t)}catch(h){we(n,n.return,h)}}break;case 27:t===null&&a&4&&Ah(n);case 26:case 5:yn(e,n),t===null&&a&4&&xh(n),a&512&&Ql(n,n.return);break;case 12:yn(e,n);break;case 31:yn(e,n),a&4&&Nh(e,n);break;case 13:yn(e,n),a&4&&Ch(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Mg.bind(null,n),$g(e,n))));break;case 22:if(a=n.memoizedState!==null||mn,!a){t=t!==null&&t.memoizedState!==null||We,u=mn;var c=We;mn=a,(We=t)&&!c?gn(e,n,(n.subtreeFlags&8772)!==0):yn(e,n),mn=u,We=c}break;case 30:break;default:yn(e,n)}}function Eh(e){var t=e.alternate;t!==null&&(e.alternate=null,Eh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Le=null,mt=!1;function pn(e,t,n){for(n=n.child;n!==null;)jh(e,t,n),n=n.sibling}function jh(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(hl,n)}catch{}switch(n.tag){case 26:We||Ft(n,t),pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:We||Ft(n,t);var a=Le,u=mt;Kn(n.type)&&(Le=n.stateNode,mt=!1),pn(e,t,n),Il(n.stateNode),Le=a,mt=u;break;case 5:We||Ft(n,t);case 6:if(a=Le,u=mt,Le=null,pn(e,t,n),Le=a,mt=u,Le!==null)if(mt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(c){we(n,t,c)}else try{Le.removeChild(n.stateNode)}catch(c){we(n,t,c)}break;case 18:Le!==null&&(mt?(e=Le,gm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),sl(e)):gm(Le,n.stateNode));break;case 4:a=Le,u=mt,Le=n.stateNode.containerInfo,mt=!0,pn(e,t,n),Le=a,mt=u;break;case 0:case 11:case 14:case 15:Ln(2,n,t),We||Ln(4,n,t),pn(e,t,n);break;case 1:We||(Ft(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&vh(n,t,a)),pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:We=(a=We)||n.memoizedState!==null,pn(e,t,n),We=a;break;default:pn(e,t,n)}}function Nh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{sl(e)}catch(n){we(t,t.return,n)}}}function Ch(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{sl(e)}catch(n){we(t,t.return,n)}}function Sg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sh),t;default:throw Error(r(435,e.tag))}}function ps(e,t){var n=Sg(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=Rg.bind(null,e,a);a.then(u,u)}})}function pt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],c=e,h=t,x=h;e:for(;x!==null;){switch(x.tag){case 27:if(Kn(x.type)){Le=x.stateNode,mt=!1;break e}break;case 5:Le=x.stateNode,mt=!1;break e;case 3:case 4:Le=x.stateNode.containerInfo,mt=!0;break e}x=x.return}if(Le===null)throw Error(r(160));jh(c,h,u),Le=null,mt=!1,c=u.alternate,c!==null&&(c.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Th(t,e),t=t.sibling}var Qt=null;function Th(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),yt(e),a&4&&(Ln(3,e,e.return),Yl(3,e),Ln(5,e,e.return));break;case 1:pt(t,e),yt(e),a&512&&(We||n===null||Ft(n,n.return)),a&64&&mn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=Qt;if(pt(t,e),yt(e),a&512&&(We||n===null||Ft(n,n.return)),a&4){var c=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":c=u.getElementsByTagName("title")[0],(!c||c[yl]||c[lt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=u.createElement(a),u.head.insertBefore(c,u.querySelector("head > title"))),ut(c,a,n),c[lt]=e,nt(c),a=c;break e;case"link":var h=Tm("link","href",u).get(a+(n.href||""));if(h){for(var x=0;x<h.length;x++)if(c=h[x],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(x,1);break t}}c=u.createElement(a),ut(c,a,n),u.head.appendChild(c);break;case"meta":if(h=Tm("meta","content",u).get(a+(n.content||""))){for(x=0;x<h.length;x++)if(c=h[x],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(x,1);break t}}c=u.createElement(a),ut(c,a,n),u.head.appendChild(c);break;default:throw Error(r(468,a))}c[lt]=e,nt(c),a=c}e.stateNode=a}else wm(u,e.type,e.stateNode);else e.stateNode=Cm(u,a,e.memoizedProps);else c!==a?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,a===null?wm(u,e.type,e.stateNode):Cm(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ku(e,e.memoizedProps,n.memoizedProps)}break;case 27:pt(t,e),yt(e),a&512&&(We||n===null||Ft(n,n.return)),n!==null&&a&4&&Ku(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pt(t,e),yt(e),a&512&&(We||n===null||Ft(n,n.return)),e.flags&32){u=e.stateNode;try{wa(u,"")}catch(le){we(e,e.return,le)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Ku(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Fu=!0);break;case 6:if(pt(t,e),yt(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(le){we(e,e.return,le)}}break;case 3:if(Rs=null,u=Qt,Qt=ws(t.containerInfo),pt(t,e),Qt=u,yt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{sl(t.containerInfo)}catch(le){we(e,e.return,le)}Fu&&(Fu=!1,wh(e));break;case 4:a=Qt,Qt=ws(e.stateNode.containerInfo),pt(t,e),yt(e),Qt=a;break;case 12:pt(t,e),yt(e);break;case 31:pt(t,e),yt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ps(e,a)));break;case 13:pt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(gs=xt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ps(e,a)));break;case 22:u=e.memoizedState!==null;var q=n!==null&&n.memoizedState!==null,D=mn,L=We;if(mn=D||u,We=L||q,pt(t,e),We=L,mn=D,yt(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||q||mn||We||pa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){q=n=t;try{if(c=q.stateNode,u)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{x=q.stateNode;var Y=q.memoizedProps.style,k=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;x.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(le){we(q,q.return,le)}}}else if(t.tag===6){if(n===null){q=t;try{q.stateNode.nodeValue=u?"":q.memoizedProps}catch(le){we(q,q.return,le)}}}else if(t.tag===18){if(n===null){q=t;try{var B=q.stateNode;u?vm(B,!0):vm(q.stateNode,!1)}catch(le){we(q,q.return,le)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,ps(e,n))));break;case 19:pt(t,e),yt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ps(e,a)));break;case 30:break;case 21:break;default:pt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(bh(a)){n=a;break}a=a.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var u=n.stateNode,c=Zu(e);ms(e,c,u);break;case 5:var h=n.stateNode;n.flags&32&&(wa(h,""),n.flags&=-33);var x=Zu(e);ms(e,x,h);break;case 3:case 4:var q=n.stateNode.containerInfo,D=Zu(e);Ju(e,D,q);break;default:throw Error(r(161))}}catch(L){we(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qh(e,t.alternate,t),t=t.sibling}function pa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ln(4,t,t.return),pa(t);break;case 1:Ft(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vh(t,t.return,n),pa(t);break;case 27:Il(t.stateNode);case 26:case 5:Ft(t,t.return),pa(t);break;case 22:t.memoizedState===null&&pa(t);break;case 30:pa(t);break;default:pa(t)}e=e.sibling}}function gn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:gn(u,c,n),Yl(4,c);break;case 1:if(gn(u,c,n),a=c,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(D){we(a,a.return,D)}if(a=c,u=a.updateQueue,u!==null){var x=a.stateNode;try{var q=u.shared.hiddenCallbacks;if(q!==null)for(u.shared.hiddenCallbacks=null,u=0;u<q.length;u++)sd(q[u],x)}catch(D){we(a,a.return,D)}}n&&h&64&&gh(c),Ql(c,c.return);break;case 27:Ah(c);case 26:case 5:gn(u,c,n),n&&a===null&&h&4&&xh(c),Ql(c,c.return);break;case 12:gn(u,c,n);break;case 31:gn(u,c,n),n&&h&4&&Nh(u,c);break;case 13:gn(u,c,n),n&&h&4&&Ch(u,c);break;case 22:c.memoizedState===null&&gn(u,c,n),Ql(c,c.return);break;case 30:break;default:gn(u,c,n)}t=t.sibling}}function $u(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&wl(n))}function Wu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wl(e))}function Gt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Mh(e,t,n,a),t=t.sibling}function Mh(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Gt(e,t,n,a),u&2048&&Yl(9,t);break;case 1:Gt(e,t,n,a);break;case 3:Gt(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wl(e)));break;case 12:if(u&2048){Gt(e,t,n,a),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,x=c.onPostCommit;typeof x=="function"&&x(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){we(t,t.return,q)}}else Gt(e,t,n,a);break;case 31:Gt(e,t,n,a);break;case 13:Gt(e,t,n,a);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Gt(e,t,n,a):Gl(e,t):c._visibility&2?Gt(e,t,n,a):(c._visibility|=2,Fa(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&$u(h,t);break;case 24:Gt(e,t,n,a),u&2048&&Wu(t.alternate,t);break;default:Gt(e,t,n,a)}}function Fa(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,x=n,q=a,D=h.flags;switch(h.tag){case 0:case 11:case 15:Fa(c,h,x,q,u),Yl(8,h);break;case 23:break;case 22:var L=h.stateNode;h.memoizedState!==null?L._visibility&2?Fa(c,h,x,q,u):Gl(c,h):(L._visibility|=2,Fa(c,h,x,q,u)),u&&D&2048&&$u(h.alternate,h);break;case 24:Fa(c,h,x,q,u),u&&D&2048&&Wu(h.alternate,h);break;default:Fa(c,h,x,q,u)}t=t.sibling}}function Gl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:Gl(n,a),u&2048&&$u(a.alternate,a);break;case 24:Gl(n,a),u&2048&&Wu(a.alternate,a);break;default:Gl(n,a)}t=t.sibling}}var Xl=8192;function $a(e,t,n){if(e.subtreeFlags&Xl)for(e=e.child;e!==null;)Rh(e,t,n),e=e.sibling}function Rh(e,t,n){switch(e.tag){case 26:$a(e,t,n),e.flags&Xl&&e.memoizedState!==null&&uv(n,Qt,e.memoizedState,e.memoizedProps);break;case 5:$a(e,t,n);break;case 3:case 4:var a=Qt;Qt=ws(e.stateNode.containerInfo),$a(e,t,n),Qt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Xl,Xl=16777216,$a(e,t,n),Xl=a):$a(e,t,n));break;default:$a(e,t,n)}}function _h(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Kl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];at=a,Dh(a,e)}_h(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Oh(e),e=e.sibling}function Oh(e){switch(e.tag){case 0:case 11:case 15:Kl(e),e.flags&2048&&Ln(9,e,e.return);break;case 3:Kl(e);break;case 12:Kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ys(e)):Kl(e);break;default:Kl(e)}}function ys(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];at=a,Dh(a,e)}_h(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ln(8,t,t.return),ys(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ys(t));break;default:ys(t)}e=e.sibling}}function Dh(e,t){for(;at!==null;){var n=at;switch(n.tag){case 0:case 11:case 15:Ln(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:wl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,at=a;else e:for(n=e;at!==null;){a=at;var u=a.sibling,c=a.return;if(Eh(a),a===n){at=null;break e}if(u!==null){u.return=c,at=u;break e}at=c}}}var qg={getCacheForType:function(e){var t=st(Je),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return st(Je).controller.signal}},Eg=typeof WeakMap=="function"?WeakMap:Map,Ce=0,De=null,ye=null,ve=0,Te=0,Nt=null,Hn=!1,Wa=!1,Iu=!1,vn=0,Qe=0,Vn=0,ya=0,Pu=0,Ct=0,Ia=0,Zl=null,gt=null,ec=!1,gs=0,kh=0,vs=1/0,xs=null,Yn=null,et=0,Qn=null,Pa=null,xn=0,tc=0,nc=null,zh=null,Jl=0,ac=null;function Tt(){return(Ce&2)!==0&&ve!==0?ve&-ve:z.T!==null?cc():Wo()}function Bh(){if(Ct===0)if((ve&536870912)===0||Ae){var e=Ci;Ci<<=1,(Ci&3932160)===0&&(Ci=262144),Ct=e}else Ct=536870912;return e=Et.current,e!==null&&(e.flags|=32),Ct}function vt(e,t,n){(e===De&&(Te===2||Te===9)||e.cancelPendingCommit!==null)&&(el(e,0),Gn(e,ve,Ct,!1)),pl(e,n),((Ce&2)===0||e!==De)&&(e===De&&((Ce&2)===0&&(ya|=n),Qe===4&&Gn(e,ve,Ct,!1)),$t(e))}function Uh(e,t,n){if((Ce&6)!==0)throw Error(r(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ml(e,t),u=a?Cg(e,t):ic(e,t,!0),c=a;do{if(u===0){Wa&&!a&&Gn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!jg(n)){u=ic(e,t,!1),c=!1;continue}if(u===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var x=e;u=Zl;var q=x.current.memoizedState.isDehydrated;if(q&&(el(x,h).flags|=256),h=ic(x,h,!1),h!==2){if(Iu&&!q){x.errorRecoveryDisabledLanes|=c,ya|=c,u=4;break e}c=gt,gt=u,c!==null&&(gt===null?gt=c:gt.push.apply(gt,c))}u=h}if(c=!1,u!==2)continue}}if(u===1){el(e,0),Gn(e,t,0,!0);break}e:{switch(a=e,c=u,c){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Gn(a,t,Ct,!Hn);break e;case 2:gt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(u=gs+300-xt(),10<u)){if(Gn(a,t,Ct,!Hn),wi(a,0,!0)!==0)break e;xn=t,a.timeoutHandle=pm(Lh.bind(null,a,n,gt,xs,ec,t,Ct,ya,Ia,Hn,c,"Throttled",-0,0),u);break e}Lh(a,n,gt,xs,ec,t,Ct,ya,Ia,Hn,c,null,-0,0)}}break}while(!0);$t(e)}function Lh(e,t,n,a,u,c,h,x,q,D,L,Y,k,B){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Rh(t,c,Y);var le=(c&62914560)===c?gs-xt():(c&4194048)===c?kh-xt():0;if(le=cv(Y,le),le!==null){xn=c,e.cancelPendingCommit=le(Zh.bind(null,e,t,c,n,a,u,h,x,q,L,Y,null,k,B)),Gn(e,c,h,!D);return}}Zh(e,t,c,n,a,u,h,x,q)}function jg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],c=u.getSnapshot;u=u.value;try{if(!St(c(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gn(e,t,n,a){t&=~Pu,t&=~ya,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var c=31-At(u),h=1<<c;a[c]=-1,u&=~h}n!==0&&Jo(e,n,t)}function bs(){return(Ce&6)===0?(Fl(0),!1):!0}function lc(){if(ye!==null){if(Te===0)var e=ye.return;else e=ye,un=ra=null,bu(e),Ga=null,Rl=0,e=ye;for(;e!==null;)yh(e.alternate,e),e=e.return;ye=null}}function el(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xn=0,lc(),De=e,ye=n=sn(e.current,null),ve=t,Te=0,Nt=null,Hn=!1,Wa=ml(e,t),Iu=!1,Ia=Ct=Pu=ya=Vn=Qe=0,gt=Zl=null,ec=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-At(a),c=1<<u;t|=e[u],a&=~c}return vn=t,Vi(),n}function Hh(e,t){de=null,z.H=Ll,t===Qa||t===Fi?(t=nd(),Te=3):t===uu?(t=nd(),Te=4):Te=t===zu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,ye===null&&(Qe=1,cs(e,_t(t,e.current)))}function Vh(){var e=Et.current;return e===null?!0:(ve&4194048)===ve?zt===null:(ve&62914560)===ve||(ve&536870912)!==0?e===zt:!1}function Yh(){var e=z.H;return z.H=Ll,e===null?Ll:e}function Qh(){var e=z.A;return z.A=qg,e}function As(){Qe=4,Hn||(ve&4194048)!==ve&&Et.current!==null||(Wa=!0),(Vn&134217727)===0&&(ya&134217727)===0||De===null||Gn(De,ve,Ct,!1)}function ic(e,t,n){var a=Ce;Ce|=2;var u=Yh(),c=Qh();(De!==e||ve!==t)&&(xs=null,el(e,t)),t=!1;var h=Qe;e:do try{if(Te!==0&&ye!==null){var x=ye,q=Nt;switch(Te){case 8:lc(),h=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var D=Te;if(Te=0,Nt=null,tl(e,x,q,D),n&&Wa){h=0;break e}break;default:D=Te,Te=0,Nt=null,tl(e,x,q,D)}}Ng(),h=Qe;break}catch(L){Hh(e,L)}while(!0);return t&&e.shellSuspendCounter++,un=ra=null,Ce=a,z.H=u,z.A=c,ye===null&&(De=null,ve=0,Vi()),h}function Ng(){for(;ye!==null;)Gh(ye)}function Cg(e,t){var n=Ce;Ce|=2;var a=Yh(),u=Qh();De!==e||ve!==t?(xs=null,vs=xt()+500,el(e,t)):Wa=ml(e,t);e:do try{if(Te!==0&&ye!==null){t=ye;var c=Nt;t:switch(Te){case 1:Te=0,Nt=null,tl(e,t,c,1);break;case 2:case 9:if(ed(c)){Te=0,Nt=null,Xh(t);break}t=function(){Te!==2&&Te!==9||De!==e||(Te=7),$t(e)},c.then(t,t);break e;case 3:Te=7;break e;case 4:Te=5;break e;case 7:ed(c)?(Te=0,Nt=null,Xh(t)):(Te=0,Nt=null,tl(e,t,c,7));break;case 5:var h=null;switch(ye.tag){case 26:h=ye.memoizedState;case 5:case 27:var x=ye;if(h?Mm(h):x.stateNode.complete){Te=0,Nt=null;var q=x.sibling;if(q!==null)ye=q;else{var D=x.return;D!==null?(ye=D,Ss(D)):ye=null}break t}}Te=0,Nt=null,tl(e,t,c,5);break;case 6:Te=0,Nt=null,tl(e,t,c,6);break;case 8:lc(),Qe=6;break e;default:throw Error(r(462))}}Tg();break}catch(L){Hh(e,L)}while(!0);return un=ra=null,z.H=a,z.A=u,Ce=n,ye!==null?0:(De=null,ve=0,Vi(),Qe)}function Tg(){for(;ye!==null&&!W0();)Gh(ye)}function Gh(e){var t=mh(e.alternate,e,vn);e.memoizedProps=e.pendingProps,t===null?Ss(e):ye=t}function Xh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uh(n,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=uh(n,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:bu(t);default:yh(n,t),t=ye=Qf(t,vn),t=mh(n,t,vn)}e.memoizedProps=e.pendingProps,t===null?Ss(e):ye=t}function tl(e,t,n,a){un=ra=null,bu(t),Ga=null,Rl=0;var u=t.return;try{if(yg(e,u,t,n,ve)){Qe=1,cs(e,_t(n,e.current)),ye=null;return}}catch(c){if(u!==null)throw ye=u,c;Qe=1,cs(e,_t(n,e.current)),ye=null;return}t.flags&32768?(Ae||a===1?e=!0:Wa||(ve&536870912)!==0?e=!1:(Hn=e=!0,(a===2||a===9||a===3||a===6)&&(a=Et.current,a!==null&&a.tag===13&&(a.flags|=16384))),Kh(t,e)):Ss(t)}function Ss(e){var t=e;do{if((t.flags&32768)!==0){Kh(t,Hn);return}e=t.return;var n=xg(t.alternate,t,vn);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Qe===0&&(Qe=5)}function Kh(e,t){do{var n=bg(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);Qe=6,ye=null}function Zh(e,t,n,a,u,c,h,x,q){e.cancelPendingCommit=null;do qs();while(et!==0);if((Ce&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(c=t.lanes|t.childLanes,c|=Zr,ry(e,n,c,h,x,q),e===De&&(ye=De=null,ve=0),Pa=t,Qn=e,xn=n,tc=c,nc=u,zh=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_g(ji,function(){return Ih(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=z.T,z.T=null,u=G.p,G.p=2,h=Ce,Ce|=4;try{Ag(e,t,n)}finally{Ce=h,G.p=u,z.T=a}}et=1,Jh(),Fh(),$h()}}function Jh(){if(et===1){et=0;var e=Qn,t=Pa,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var a=G.p;G.p=2;var u=Ce;Ce|=4;try{Th(t,e);var c=gc,h=Df(e.containerInfo),x=c.focusedElem,q=c.selectionRange;if(h!==x&&x&&x.ownerDocument&&Of(x.ownerDocument.documentElement,x)){if(q!==null&&Yr(x)){var D=q.start,L=q.end;if(L===void 0&&(L=D),"selectionStart"in x)x.selectionStart=D,x.selectionEnd=Math.min(L,x.value.length);else{var Y=x.ownerDocument||document,k=Y&&Y.defaultView||window;if(k.getSelection){var B=k.getSelection(),le=x.textContent.length,ce=Math.min(q.start,le),Oe=q.end===void 0?ce:Math.min(q.end,le);!B.extend&&ce>Oe&&(h=Oe,Oe=ce,ce=h);var R=_f(x,ce),C=_f(x,Oe);if(R&&C&&(B.rangeCount!==1||B.anchorNode!==R.node||B.anchorOffset!==R.offset||B.focusNode!==C.node||B.focusOffset!==C.offset)){var _=Y.createRange();_.setStart(R.node,R.offset),B.removeAllRanges(),ce>Oe?(B.addRange(_),B.extend(C.node,C.offset)):(_.setEnd(C.node,C.offset),B.addRange(_))}}}}for(Y=[],B=x;B=B.parentNode;)B.nodeType===1&&Y.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Y.length;x++){var H=Y[x];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}ks=!!yc,gc=yc=null}finally{Ce=u,G.p=a,z.T=n}}e.current=t,et=2}}function Fh(){if(et===2){et=0;var e=Qn,t=Pa,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var a=G.p;G.p=2;var u=Ce;Ce|=4;try{qh(e,t.alternate,t)}finally{Ce=u,G.p=a,z.T=n}}et=3}}function $h(){if(et===4||et===3){et=0,I0();var e=Qn,t=Pa,n=xn,a=zh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?et=5:(et=0,Pa=Qn=null,Wh(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Yn=null),qr(n),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(hl,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=z.T,u=G.p,G.p=2,z.T=null;try{for(var c=e.onRecoverableError,h=0;h<a.length;h++){var x=a[h];c(x.value,{componentStack:x.stack})}}finally{z.T=t,G.p=u}}(xn&3)!==0&&qs(),$t(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===ac?Jl++:(Jl=0,ac=e):Jl=0,Fl(0)}}function Wh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wl(t)))}function qs(){return Jh(),Fh(),$h(),Ih()}function Ih(){if(et!==5)return!1;var e=Qn,t=tc;tc=0;var n=qr(xn),a=z.T,u=G.p;try{G.p=32>n?32:n,z.T=null,n=nc,nc=null;var c=Qn,h=xn;if(et=0,Pa=Qn=null,xn=0,(Ce&6)!==0)throw Error(r(331));var x=Ce;if(Ce|=4,Oh(c.current),Mh(c,c.current,h,n),Ce=x,Fl(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(hl,c)}catch{}return!0}finally{G.p=u,z.T=a,Wh(e,t)}}function Ph(e,t,n){t=_t(n,t),t=ku(e.stateNode,t,2),e=zn(e,t,2),e!==null&&(pl(e,2),$t(e))}function we(e,t,n){if(e.tag===3)Ph(e,e,n);else for(;t!==null;){if(t.tag===3){Ph(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Yn===null||!Yn.has(a))){e=_t(n,e),n=eh(2),a=zn(t,n,2),a!==null&&(th(n,a,t,e),pl(a,2),$t(a));break}}t=t.return}}function sc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Eg;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(Iu=!0,u.add(n),e=wg.bind(null,e,t,n),t.then(e,e))}function wg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,De===e&&(ve&n)===n&&(Qe===4||Qe===3&&(ve&62914560)===ve&&300>xt()-gs?(Ce&2)===0&&el(e,0):Pu|=n,Ia===ve&&(Ia=0)),$t(e)}function em(e,t){t===0&&(t=Zo()),e=la(e,t),e!==null&&(pl(e,t),$t(e))}function Mg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),em(e,n)}function Rg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),em(e,n)}function _g(e,t){return xr(e,t)}var Es=null,nl=null,rc=!1,js=!1,uc=!1,Xn=0;function $t(e){e!==nl&&e.next===null&&(nl===null?Es=nl=e:nl=nl.next=e),js=!0,rc||(rc=!0,Dg())}function Fl(e,t){if(!uc&&js){uc=!0;do for(var n=!1,a=Es;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var c=0;else{var h=a.suspendedLanes,x=a.pingedLanes;c=(1<<31-At(42|e)+1)-1,c&=u&~(h&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,lm(a,c))}else c=ve,c=wi(a,a===De?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||ml(a,c)||(n=!0,lm(a,c));a=a.next}while(n);uc=!1}}function Og(){tm()}function tm(){js=rc=!1;var e=0;Xn!==0&&Gg()&&(e=Xn);for(var t=xt(),n=null,a=Es;a!==null;){var u=a.next,c=nm(a,t);c===0?(a.next=null,n===null?Es=u:n.next=u,u===null&&(nl=n)):(n=a,(e!==0||(c&3)!==0)&&(js=!0)),a=u}et!==0&&et!==5||Fl(e),Xn!==0&&(Xn=0)}function nm(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-At(c),x=1<<h,q=u[h];q===-1?((x&n)===0||(x&a)!==0)&&(u[h]=sy(x,t)):q<=t&&(e.expiredLanes|=x),c&=~x}if(t=De,n=ve,n=wi(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Te===2||Te===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&br(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ml(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&br(a),qr(n)){case 2:case 8:n=Xo;break;case 32:n=ji;break;case 268435456:n=Ko;break;default:n=ji}return a=am.bind(null,e),n=xr(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&br(a),e.callbackPriority=2,e.callbackNode=null,2}function am(e,t){if(et!==0&&et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qs()&&e.callbackNode!==n)return null;var a=ve;return a=wi(e,e===De?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Uh(e,a,t),nm(e,xt()),e.callbackNode!=null&&e.callbackNode===n?am.bind(null,e):null)}function lm(e,t){if(qs())return null;Uh(e,t,!0)}function Dg(){Kg(function(){(Ce&6)!==0?xr(Go,Og):tm()})}function cc(){if(Xn===0){var e=Va;e===0&&(e=Ni,Ni<<=1,(Ni&261888)===0&&(Ni=256)),Xn=e}return Xn}function im(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Oi(""+e)}function sm(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function kg(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var c=im((u[dt]||null).action),h=a.submitter;h&&(t=(t=h[dt]||null)?im(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var x=new Bi("action","action",null,a,u);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Xn!==0){var q=h?sm(u,h):new FormData(u);wu(n,{pending:!0,data:q,method:u.method,action:c},null,q)}}else typeof c=="function"&&(x.preventDefault(),q=h?sm(u,h):new FormData(u),wu(n,{pending:!0,data:q,method:u.method,action:c},c,q))},currentTarget:u}]})}}for(var oc=0;oc<Kr.length;oc++){var fc=Kr[oc],zg=fc.toLowerCase(),Bg=fc[0].toUpperCase()+fc.slice(1);Yt(zg,"on"+Bg)}Yt(Bf,"onAnimationEnd"),Yt(Uf,"onAnimationIteration"),Yt(Lf,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Py,"onTransitionRun"),Yt(eg,"onTransitionStart"),Yt(tg,"onTransitionCancel"),Yt(Hf,"onTransitionEnd"),Ca("onMouseEnter",["mouseout","mouseover"]),Ca("onMouseLeave",["mouseout","mouseover"]),Ca("onPointerEnter",["pointerout","pointerover"]),Ca("onPointerLeave",["pointerout","pointerover"]),ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $l="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(" "),Ug=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($l));function rm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var c=void 0;if(t)for(var h=a.length-1;0<=h;h--){var x=a[h],q=x.instance,D=x.currentTarget;if(x=x.listener,q!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=D;try{c(u)}catch(L){Hi(L)}u.currentTarget=null,c=q}else for(h=0;h<a.length;h++){if(x=a[h],q=x.instance,D=x.currentTarget,x=x.listener,q!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=D;try{c(u)}catch(L){Hi(L)}u.currentTarget=null,c=q}}}}function ge(e,t){var n=t[Er];n===void 0&&(n=t[Er]=new Set);var a=e+"__bubble";n.has(a)||(um(t,e,2,!1),n.add(a))}function dc(e,t,n){var a=0;t&&(a|=4),um(n,e,a,t)}var Ns="_reactListening"+Math.random().toString(36).slice(2);function hc(e){if(!e[Ns]){e[Ns]=!0,ef.forEach(function(n){n!=="selectionchange"&&(Ug.has(n)||dc(n,!1,e),dc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ns]||(t[Ns]=!0,dc("selectionchange",!1,t))}}function um(e,t,n,a){switch(Bm(t)){case 2:var u=dv;break;case 8:u=hv;break;default:u=Tc}n=u.bind(null,t,n,e),u=void 0,!Or||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function mc(e,t,n,a,u){var c=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var h=a.tag;if(h===3||h===4){var x=a.stateNode.containerInfo;if(x===u)break;if(h===4)for(h=a.return;h!==null;){var q=h.tag;if((q===3||q===4)&&h.stateNode.containerInfo===u)return;h=h.return}for(;x!==null;){if(h=Ea(x),h===null)return;if(q=h.tag,q===5||q===6||q===26||q===27){a=c=h;continue e}x=x.parentNode}}a=a.return}hf(function(){var D=c,L=Rr(n),Y=[];e:{var k=Vf.get(e);if(k!==void 0){var B=Bi,le=e;switch(e){case"keypress":if(ki(n)===0)break e;case"keydown":case"keyup":B=Ry;break;case"focusin":le="focus",B=Br;break;case"focusout":le="blur",B=Br;break;case"beforeblur":case"afterblur":B=Br;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=xy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Dy;break;case Bf:case Uf:case Lf:B=Sy;break;case Hf:B=zy;break;case"scroll":case"scrollend":B=gy;break;case"wheel":B=Uy;break;case"copy":case"cut":case"paste":B=Ey;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=vf;break;case"toggle":case"beforetoggle":B=Hy}var ce=(t&4)!==0,Oe=!ce&&(e==="scroll"||e==="scrollend"),R=ce?k!==null?k+"Capture":null:k;ce=[];for(var C=D,_;C!==null;){var H=C;if(_=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||_===null||R===null||(H=vl(C,R),H!=null&&ce.push(Wl(C,H,_))),Oe)break;C=C.return}0<ce.length&&(k=new B(k,le,null,n,L),Y.push({event:k,listeners:ce}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",k&&n!==Mr&&(le=n.relatedTarget||n.fromElement)&&(Ea(le)||le[qa]))break e;if((B||k)&&(k=L.window===L?L:(k=L.ownerDocument)?k.defaultView||k.parentWindow:window,B?(le=n.relatedTarget||n.toElement,B=D,le=le?Ea(le):null,le!==null&&(Oe=d(le),ce=le.tag,le!==Oe||ce!==5&&ce!==27&&ce!==6)&&(le=null)):(B=null,le=D),B!==le)){if(ce=yf,H="onMouseLeave",R="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ce=vf,H="onPointerLeave",R="onPointerEnter",C="pointer"),Oe=B==null?k:gl(B),_=le==null?k:gl(le),k=new ce(H,C+"leave",B,n,L),k.target=Oe,k.relatedTarget=_,H=null,Ea(L)===D&&(ce=new ce(R,C+"enter",le,n,L),ce.target=_,ce.relatedTarget=Oe,H=ce),Oe=H,B&&le)t:{for(ce=Lg,R=B,C=le,_=0,H=R;H;H=ce(H))_++;H=0;for(var ue=C;ue;ue=ce(ue))H++;for(;0<_-H;)R=ce(R),_--;for(;0<H-_;)C=ce(C),H--;for(;_--;){if(R===C||C!==null&&R===C.alternate){ce=R;break t}R=ce(R),C=ce(C)}ce=null}else ce=null;B!==null&&cm(Y,k,B,ce,!1),le!==null&&Oe!==null&&cm(Y,Oe,le,ce,!0)}}e:{if(k=D?gl(D):window,B=k.nodeName&&k.nodeName.toLowerCase(),B==="select"||B==="input"&&k.type==="file")var je=Nf;else if(Ef(k))if(Cf)je=$y;else{je=Jy;var ie=Zy}else B=k.nodeName,!B||B.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?D&&wr(D.elementType)&&(je=Nf):je=Fy;if(je&&(je=je(e,D))){jf(Y,je,n,L);break e}ie&&ie(e,k,D),e==="focusout"&&D&&k.type==="number"&&D.memoizedProps.value!=null&&Tr(k,"number",k.value)}switch(ie=D?gl(D):window,e){case"focusin":(Ef(ie)||ie.contentEditable==="true")&&(Oa=ie,Qr=D,Nl=null);break;case"focusout":Nl=Qr=Oa=null;break;case"mousedown":Gr=!0;break;case"contextmenu":case"mouseup":case"dragend":Gr=!1,kf(Y,n,L);break;case"selectionchange":if(Iy)break;case"keydown":case"keyup":kf(Y,n,L)}var he;if(Lr)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else _a?Sf(e,n)&&(xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(xe="onCompositionStart");xe&&(xf&&n.locale!=="ko"&&(_a||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&_a&&(he=mf()):(wn=L,Dr="value"in wn?wn.value:wn.textContent,_a=!0)),ie=Cs(D,xe),0<ie.length&&(xe=new gf(xe,e,null,n,L),Y.push({event:xe,listeners:ie}),he?xe.data=he:(he=qf(n),he!==null&&(xe.data=he)))),(he=Yy?Qy(e,n):Gy(e,n))&&(xe=Cs(D,"onBeforeInput"),0<xe.length&&(ie=new gf("onBeforeInput","beforeinput",null,n,L),Y.push({event:ie,listeners:xe}),ie.data=he)),kg(Y,e,D,n,L)}rm(Y,t)})}function Wl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cs(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,c=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||c===null||(u=vl(e,n),u!=null&&a.unshift(Wl(e,u,c)),u=vl(e,t),u!=null&&a.push(Wl(e,u,c))),e.tag===3)return a;e=e.return}return[]}function Lg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cm(e,t,n,a,u){for(var c=t._reactName,h=[];n!==null&&n!==a;){var x=n,q=x.alternate,D=x.stateNode;if(x=x.tag,q!==null&&q===a)break;x!==5&&x!==26&&x!==27||D===null||(q=D,u?(D=vl(n,c),D!=null&&h.unshift(Wl(n,D,q))):u||(D=vl(n,c),D!=null&&h.push(Wl(n,D,q)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Hg=/\r\n?/g,Vg=/\u0000|\uFFFD/g;function om(e){return(typeof e=="string"?e:""+e).replace(Hg,`
`).replace(Vg,"")}function fm(e,t){return t=om(t),om(e)===t}function _e(e,t,n,a,u,c){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||wa(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&wa(e,""+a);break;case"className":Ri(e,"class",a);break;case"tabIndex":Ri(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(e,n,a);break;case"style":ff(e,a,c);break;case"data":if(t!=="object"){Ri(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Oi(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&_e(e,t,"name",u.name,u,null),_e(e,t,"formEncType",u.formEncType,u,null),_e(e,t,"formMethod",u.formMethod,u,null),_e(e,t,"formTarget",u.formTarget,u,null)):(_e(e,t,"encType",u.encType,u,null),_e(e,t,"method",u.method,u,null),_e(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Oi(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=an);break;case"onScroll":a!=null&&ge("scroll",e);break;case"onScrollEnd":a!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Oi(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":ge("beforetoggle",e),ge("toggle",e),Mi(e,"popover",a);break;case"xlinkActuate":nn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":nn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":nn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":nn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":nn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":nn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":nn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":nn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":nn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Mi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=py.get(n)||n,Mi(e,n,a))}}function pc(e,t,n,a,u,c){switch(n){case"style":ff(e,a,c);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof a=="string"?wa(e,a):(typeof a=="number"||typeof a=="bigint")&&wa(e,""+a);break;case"onScroll":a!=null&&ge("scroll",e);break;case"onScrollEnd":a!=null&&ge("scrollend",e);break;case"onClick":a!=null&&(e.onclick=an);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tf.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),c=e[dt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,u),typeof a=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Mi(e,n,a)}}}function ut(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var a=!1,u=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:_e(e,t,c,h,n,null)}}u&&_e(e,t,"srcSet",n.srcSet,n,null),a&&_e(e,t,"src",n.src,n,null);return;case"input":ge("invalid",e);var x=c=h=u=null,q=null,D=null;for(a in n)if(n.hasOwnProperty(a)){var L=n[a];if(L!=null)switch(a){case"name":u=L;break;case"type":h=L;break;case"checked":q=L;break;case"defaultChecked":D=L;break;case"value":c=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,t));break;default:_e(e,t,a,L,n,null)}}rf(e,c,x,q,D,h,u,!1);return;case"select":ge("invalid",e),a=h=c=null;for(u in n)if(n.hasOwnProperty(u)&&(x=n[u],x!=null))switch(u){case"value":c=x;break;case"defaultValue":h=x;break;case"multiple":a=x;default:_e(e,t,u,x,n,null)}t=c,n=h,e.multiple=!!a,t!=null?Ta(e,!!a,t,!1):n!=null&&Ta(e,!!a,n,!0);return;case"textarea":ge("invalid",e),c=u=a=null;for(h in n)if(n.hasOwnProperty(h)&&(x=n[h],x!=null))switch(h){case"value":a=x;break;case"defaultValue":u=x;break;case"children":c=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:_e(e,t,h,x,n,null)}cf(e,a,u,c);return;case"option":for(q in n)if(n.hasOwnProperty(q)&&(a=n[q],a!=null))switch(q){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:_e(e,t,q,a,n,null)}return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(a=0;a<$l.length;a++)ge($l[a],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(D in n)if(n.hasOwnProperty(D)&&(a=n[D],a!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:_e(e,t,D,a,n,null)}return;default:if(wr(t)){for(L in n)n.hasOwnProperty(L)&&(a=n[L],a!==void 0&&pc(e,t,L,a,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(a=n[x],a!=null&&_e(e,t,x,a,n,null))}function Yg(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,c=null,h=null,x=null,q=null,D=null,L=null;for(B in n){var Y=n[B];if(n.hasOwnProperty(B)&&Y!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":q=Y;default:a.hasOwnProperty(B)||_e(e,t,B,null,a,Y)}}for(var k in a){var B=a[k];if(Y=n[k],a.hasOwnProperty(k)&&(B!=null||Y!=null))switch(k){case"type":c=B;break;case"name":u=B;break;case"checked":D=B;break;case"defaultChecked":L=B;break;case"value":h=B;break;case"defaultValue":x=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,t));break;default:B!==Y&&_e(e,t,k,B,a,Y)}}Cr(e,h,x,q,D,L,c,u);return;case"select":B=h=x=k=null;for(c in n)if(q=n[c],n.hasOwnProperty(c)&&q!=null)switch(c){case"value":break;case"multiple":B=q;default:a.hasOwnProperty(c)||_e(e,t,c,null,a,q)}for(u in a)if(c=a[u],q=n[u],a.hasOwnProperty(u)&&(c!=null||q!=null))switch(u){case"value":k=c;break;case"defaultValue":x=c;break;case"multiple":h=c;default:c!==q&&_e(e,t,u,c,a,q)}t=x,n=h,a=B,k!=null?Ta(e,!!n,k,!1):!!a!=!!n&&(t!=null?Ta(e,!!n,t,!0):Ta(e,!!n,n?[]:"",!1));return;case"textarea":B=k=null;for(x in n)if(u=n[x],n.hasOwnProperty(x)&&u!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:_e(e,t,x,null,a,u)}for(h in a)if(u=a[h],c=n[h],a.hasOwnProperty(h)&&(u!=null||c!=null))switch(h){case"value":k=u;break;case"defaultValue":B=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==c&&_e(e,t,h,u,a,c)}uf(e,k,B);return;case"option":for(var le in n)if(k=n[le],n.hasOwnProperty(le)&&k!=null&&!a.hasOwnProperty(le))switch(le){case"selected":e.selected=!1;break;default:_e(e,t,le,null,a,k)}for(q in a)if(k=a[q],B=n[q],a.hasOwnProperty(q)&&k!==B&&(k!=null||B!=null))switch(q){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:_e(e,t,q,k,a,B)}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 ce in n)k=n[ce],n.hasOwnProperty(ce)&&k!=null&&!a.hasOwnProperty(ce)&&_e(e,t,ce,null,a,k);for(D in a)if(k=a[D],B=n[D],a.hasOwnProperty(D)&&k!==B&&(k!=null||B!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(137,t));break;default:_e(e,t,D,k,a,B)}return;default:if(wr(t)){for(var Oe in n)k=n[Oe],n.hasOwnProperty(Oe)&&k!==void 0&&!a.hasOwnProperty(Oe)&&pc(e,t,Oe,void 0,a,k);for(L in a)k=a[L],B=n[L],!a.hasOwnProperty(L)||k===B||k===void 0&&B===void 0||pc(e,t,L,k,a,B);return}}for(var R in n)k=n[R],n.hasOwnProperty(R)&&k!=null&&!a.hasOwnProperty(R)&&_e(e,t,R,null,a,k);for(Y in a)k=a[Y],B=n[Y],!a.hasOwnProperty(Y)||k===B||k==null&&B==null||_e(e,t,Y,k,a,B)}function dm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],c=u.transferSize,h=u.initiatorType,x=u.duration;if(c&&x&&dm(h)){for(h=0,x=u.responseEnd,a+=1;a<n.length;a++){var q=n[a],D=q.startTime;if(D>x)break;var L=q.transferSize,Y=q.initiatorType;L&&dm(Y)&&(q=q.responseEnd,h+=L*(q<x?1:(x-D)/(q-D)))}if(--a,t+=8*(c+h)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var yc=null,gc=null;function Ts(e){return e.nodeType===9?e:e.ownerDocument}function hm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function vc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xc=null;function Gg(){var e=window.event;return e&&e.type==="popstate"?e===xc?!1:(xc=e,!0):(xc=null,!1)}var pm=typeof setTimeout=="function"?setTimeout:void 0,Xg=typeof clearTimeout=="function"?clearTimeout:void 0,ym=typeof Promise=="function"?Promise:void 0,Kg=typeof queueMicrotask=="function"?queueMicrotask:typeof ym<"u"?function(e){return ym.resolve(null).then(e).catch(Zg)}:pm;function Zg(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function gm(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),sl(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Il(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Il(n);for(var c=n.firstChild;c;){var h=c.nextSibling,x=c.nodeName;c[yl]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&Il(e.ownerDocument.body);n=u}while(n);sl(t)}function vm(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function bc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":bc(n),jr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Jg(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[yl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Bt(e.nextSibling),e===null)break}return null}function Fg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Bt(e.nextSibling),e===null))return null;return e}function xm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bt(e.nextSibling),e===null))return null;return e}function Ac(e){return e.data==="$?"||e.data==="$~"}function Sc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $g(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Bt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var qc=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Bt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Am(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Sm(e,t,n){switch(t=Ts(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Il(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jr(e)}var Ut=new Map,qm=new Set;function ws(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bn=G.d;G.d={f:Wg,r:Ig,D:Pg,C:ev,L:tv,m:nv,X:lv,S:av,M:iv};function Wg(){var e=bn.f(),t=bs();return e||t}function Ig(e){var t=ja(e);t!==null&&t.tag===5&&t.type==="form"?Hd(t):bn.r(e)}var al=typeof document>"u"?null:document;function Em(e,t,n){var a=al;if(a&&typeof t=="string"&&t){var u=Mt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),qm.has(u)||(qm.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function Pg(e){bn.D(e),Em("dns-prefetch",e,null)}function ev(e,t){bn.C(e,t),Em("preconnect",e,t)}function tv(e,t,n){bn.L(e,t,n);var a=al;if(a&&e&&t){var u='link[rel="preload"][as="'+Mt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Mt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Mt(n.imageSizes)+'"]')):u+='[href="'+Mt(e)+'"]';var c=u;switch(t){case"style":c=ll(e);break;case"script":c=il(e)}Ut.has(c)||(e=A({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ut.set(c,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(Pl(c))||t==="script"&&a.querySelector(ei(c))||(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function nv(e,t){bn.m(e,t);var n=al;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Mt(a)+'"][href="'+Mt(e)+'"]',c=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=il(e)}if(!Ut.has(c)&&(e=A({rel:"modulepreload",href:e},t),Ut.set(c,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ei(c)))return}a=n.createElement("link"),ut(a,"link",e),nt(a),n.head.appendChild(a)}}}function av(e,t,n){bn.S(e,t,n);var a=al;if(a&&e){var u=Na(a).hoistableStyles,c=ll(e);t=t||"default";var h=u.get(c);if(!h){var x={loading:0,preload:null};if(h=a.querySelector(Pl(c)))x.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ut.get(c))&&Ec(e,n);var q=h=a.createElement("link");nt(q),ut(q,"link",e),q._p=new Promise(function(D,L){q.onload=D,q.onerror=L}),q.addEventListener("load",function(){x.loading|=1}),q.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Ms(h,t,a)}h={type:"stylesheet",instance:h,count:1,state:x},u.set(c,h)}}}function lv(e,t){bn.X(e,t);var n=al;if(n&&e){var a=Na(n).hoistableScripts,u=il(e),c=a.get(u);c||(c=n.querySelector(ei(u)),c||(e=A({src:e,async:!0},t),(t=Ut.get(u))&&jc(e,t),c=n.createElement("script"),nt(c),ut(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(u,c))}}function iv(e,t){bn.M(e,t);var n=al;if(n&&e){var a=Na(n).hoistableScripts,u=il(e),c=a.get(u);c||(c=n.querySelector(ei(u)),c||(e=A({src:e,async:!0,type:"module"},t),(t=Ut.get(u))&&jc(e,t),c=n.createElement("script"),nt(c),ut(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(u,c))}}function jm(e,t,n,a){var u=(u=re.current)?ws(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ll(n.href),n=Na(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ll(n.href);var c=Na(u).hoistableStyles,h=c.get(e);if(h||(u=u.ownerDocument||u,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=u.querySelector(Pl(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ut.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ut.set(e,n),c||sv(u,e,n,h.state))),t&&a===null)throw Error(r(528,""));return h}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=il(n),n=Na(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function ll(e){return'href="'+Mt(e)+'"'}function Pl(e){return'link[rel="stylesheet"]['+e+"]"}function Nm(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function sv(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",n),nt(t),e.head.appendChild(t))}function il(e){return'[src="'+Mt(e)+'"]'}function ei(e){return"script[async]"+e}function Cm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Mt(n.href)+'"]');if(a)return t.instance=a,nt(a),a;var u=A({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),nt(a),ut(a,"style",u),Ms(a,n.precedence,e),t.instance=a;case"stylesheet":u=ll(n.href);var c=e.querySelector(Pl(u));if(c)return t.state.loading|=4,t.instance=c,nt(c),c;a=Nm(n),(u=Ut.get(u))&&Ec(a,u),c=(e.ownerDocument||e).createElement("link"),nt(c);var h=c;return h._p=new Promise(function(x,q){h.onload=x,h.onerror=q}),ut(c,"link",a),t.state.loading|=4,Ms(c,n.precedence,e),t.instance=c;case"script":return c=il(n.src),(u=e.querySelector(ei(c)))?(t.instance=u,nt(u),u):(a=n,(u=Ut.get(c))&&(a=A({},n),jc(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),nt(u),ut(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ms(a,n.precedence,e));return t.instance}function Ms(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,c=u,h=0;h<a.length;h++){var x=a[h];if(x.dataset.precedence===t)c=x;else if(c!==u)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ec(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Rs=null;function Tm(e,t,n){if(Rs===null){var a=new Map,u=Rs=new Map;u.set(n,a)}else u=Rs,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var c=n[u];if(!(c[yl]||c[lt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var x=a.get(h);x?x.push(c):a.set(h,[c])}}return a}function wm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function rv(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Mm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uv(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=ll(a.href),c=t.querySelector(Pl(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_s.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,nt(c);return}c=t.ownerDocument||t,a=Nm(a),(u=Ut.get(u))&&Ec(a,u),c=c.createElement("link"),nt(c);var h=c;h._p=new Promise(function(x,q){h.onload=x,h.onerror=q}),ut(c,"link",a),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=_s.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Nc=0;function cv(e,t){return e.stylesheets&&e.count===0&&Ds(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Ds(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Nc===0&&(Nc=62500*Qg());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ds(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Nc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function _s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ds(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Os=null;function Ds(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Os=new Map,t.forEach(ov,e),Os=null,_s.call(e))}function ov(e,t){if(!(t.state.loading&4)){var n=Os.get(e);if(n)var a=n.get(null);else{n=new Map,Os.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<u.length;c++){var h=u[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),a=h)}a&&n.set(null,a)}u=t.instance,h=u.getAttribute("data-precedence"),c=n.get(h)||a,c===a&&n.set(null,u),n.set(h,u),this.count++,a=_s.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),c?c.parentNode.insertBefore(u,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var ti={$$typeof:X,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function fv(e,t,n,a,u,c,h,x,q){this.tag=1,this.containerInfo=e,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=Ar(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.hiddenUpdates=Ar(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function Rm(e,t,n,a,u,c,h,x,q,D,L,Y){return e=new fv(e,t,n,h,q,D,L,Y,x),t=1,c===!0&&(t|=24),c=qt(3,null,null,t),e.current=c,c.stateNode=e,t=iu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:t},cu(c),e}function _m(e){return e?(e=za,e):za}function Om(e,t,n,a,u,c){u=_m(u),a.context===null?a.context=u:a.pendingContext=u,a=kn(t),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=zn(e,a,t),n!==null&&(vt(n,e,t),Ol(n,e,t))}function Dm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Cc(e,t){Dm(e,t),(e=e.alternate)&&Dm(e,t)}function km(e){if(e.tag===13||e.tag===31){var t=la(e,67108864);t!==null&&vt(t,e,67108864),Cc(e,67108864)}}function zm(e){if(e.tag===13||e.tag===31){var t=Tt();t=Sr(t);var n=la(e,t);n!==null&&vt(n,e,t),Cc(e,t)}}var ks=!0;function dv(e,t,n,a){var u=z.T;z.T=null;var c=G.p;try{G.p=2,Tc(e,t,n,a)}finally{G.p=c,z.T=u}}function hv(e,t,n,a){var u=z.T;z.T=null;var c=G.p;try{G.p=8,Tc(e,t,n,a)}finally{G.p=c,z.T=u}}function Tc(e,t,n,a){if(ks){var u=wc(a);if(u===null)mc(e,t,a,zs,n),Um(e,a);else if(pv(u,e,t,n,a))a.stopPropagation();else if(Um(e,a),t&4&&-1<mv.indexOf(e)){for(;u!==null;){var c=ja(u);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=Pn(c.pendingLanes);if(h!==0){var x=c;for(x.pendingLanes|=2,x.entangledLanes|=2;h;){var q=1<<31-At(h);x.entanglements[1]|=q,h&=~q}$t(c),(Ce&6)===0&&(vs=xt()+500,Fl(0))}}break;case 31:case 13:x=la(c,2),x!==null&&vt(x,c,2),bs(),Cc(c,2)}if(c=wc(a),c===null&&mc(e,t,a,zs,n),c===u)break;u=c}u!==null&&a.stopPropagation()}else mc(e,t,a,null,n)}}function wc(e){return e=Rr(e),Mc(e)}var zs=null;function Mc(e){if(zs=null,e=Ea(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zs=e,null}function Bm(e){switch(e){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(P0()){case Go:return 2;case Xo:return 8;case ji:case ey:return 32;case Ko:return 268435456;default:return 32}default:return 32}}var Rc=!1,Zn=null,Jn=null,Fn=null,ni=new Map,ai=new Map,$n=[],mv="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 Um(e,t){switch(e){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":Jn=null;break;case"mouseover":case"mouseout":Fn=null;break;case"pointerover":case"pointerout":ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(t.pointerId)}}function li(e,t,n,a,u,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:c,targetContainers:[u]},t!==null&&(t=ja(t),t!==null&&km(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function pv(e,t,n,a,u){switch(t){case"focusin":return Zn=li(Zn,e,t,n,a,u),!0;case"dragenter":return Jn=li(Jn,e,t,n,a,u),!0;case"mouseover":return Fn=li(Fn,e,t,n,a,u),!0;case"pointerover":var c=u.pointerId;return ni.set(c,li(ni.get(c)||null,e,t,n,a,u)),!0;case"gotpointercapture":return c=u.pointerId,ai.set(c,li(ai.get(c)||null,e,t,n,a,u)),!0}return!1}function Lm(e){var t=Ea(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Io(e.priority,function(){zm(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,Io(e.priority,function(){zm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Mr=a,n.target.dispatchEvent(a),Mr=null}else return t=ja(n),t!==null&&km(t),e.blockedOn=n,!1;t.shift()}return!0}function Hm(e,t,n){Bs(e)&&n.delete(t)}function yv(){Rc=!1,Zn!==null&&Bs(Zn)&&(Zn=null),Jn!==null&&Bs(Jn)&&(Jn=null),Fn!==null&&Bs(Fn)&&(Fn=null),ni.forEach(Hm),ai.forEach(Hm)}function Us(e,t){e.blockedOn===t&&(e.blockedOn=null,Rc||(Rc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,yv)))}var Ls=null;function Vm(e){Ls!==e&&(Ls=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Ls===e&&(Ls=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(Mc(a||n)===null)continue;break}var c=ja(n);c!==null&&(e.splice(t,3),t-=3,wu(c,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function sl(e){function t(q){return Us(q,e)}Zn!==null&&Us(Zn,e),Jn!==null&&Us(Jn,e),Fn!==null&&Us(Fn,e),ni.forEach(t),ai.forEach(t);for(var n=0;n<$n.length;n++){var a=$n[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<$n.length&&(n=$n[0],n.blockedOn===null);)Lm(n),n.blockedOn===null&&$n.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],c=n[a+1],h=u[dt]||null;if(typeof c=="function")h||Vm(n);else if(h){var x=null;if(c&&c.hasAttribute("formAction")){if(u=c,h=c[dt]||null)x=h.formAction;else if(Mc(u)!==null)continue}else x=h.action;typeof x=="function"?n[a+1]=x:(n.splice(a,3),a-=3),Vm(n)}}}function Ym(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return u=h})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function _c(e){this._internalRoot=e}Hs.prototype.render=_c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,a=Tt();Om(n,a,e,t,null,null)},Hs.prototype.unmount=_c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Om(e.current,2,null,e,null,null),bs(),t[qa]=null}};function Hs(e){this._internalRoot=e}Hs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$n.length&&t!==0&&t<$n[n].priority;n++);$n.splice(n,0,e),n===0&&Lm(e)}};var Qm=i.version;if(Qm!=="19.2.0")throw Error(r(527,Qm,"19.2.0"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var gv={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vs.isDisabled&&Vs.supportsFiber)try{hl=Vs.inject(gv),bt=Vs}catch{}}return si.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,a="",u=$d,c=Wd,h=Id;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Rm(e,1,!1,null,null,n,a,null,u,c,h,Ym),e[qa]=t.current,hc(e),new _c(t)},si.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var a=!1,u="",c=$d,h=Wd,x=Id,q=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(q=n.formState)),t=Rm(e,1,!0,t,n??null,a,u,q,c,h,x,Ym),t.context=_m(null),n=t.current,a=Tt(),a=Sr(a),u=kn(a),u.callback=null,zn(n,u,a),n=a,t.current.lanes=n,pl(t,n),$t(t),e[qa]=t.current,hc(e),new Hs(t)},si.version="19.2.0",si}var Pm;function Tv(){if(Pm)return kc.exports;Pm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),kc.exports=Cv(),kc.exports}var wv=Tv();var ep="popstate";function Mv(l={}){function i(r,f){let{pathname:d,search:m,hash:v}=r.location;return Pc("",{pathname:d,search:m,hash:v},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function s(r,f){return typeof f=="string"?f:mi(f)}return _v(i,s,null,l)}function He(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Kt(l,i){if(!l){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Rv(){return Math.random().toString(36).substring(2,10)}function tp(l,i){return{usr:l.state,key:l.key,idx:i}}function Pc(l,i,s=null,r){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof i=="string"?cl(i):i,state:s,key:i&&i.key||r||Rv()}}function mi({pathname:l="/",search:i="",hash:s=""}){return i&&i!=="?"&&(l+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(l+=s.charAt(0)==="#"?s:"#"+s),l}function cl(l){let i={};if(l){let s=l.indexOf("#");s>=0&&(i.hash=l.substring(s),l=l.substring(0,s));let r=l.indexOf("?");r>=0&&(i.search=l.substring(r),l=l.substring(0,r)),l&&(i.pathname=l)}return i}function _v(l,i,s,r={}){let{window:f=document.defaultView,v5Compat:d=!1}=r,m=f.history,v="POP",y=null,g=b();g==null&&(g=0,m.replaceState({...m.state,idx:g},""));function b(){return(m.state||{idx:null}).idx}function A(){v="POP";let j=b(),M=j==null?null:j-g;g=j,y&&y({action:v,location:E.location,delta:M})}function w(j,M){v="PUSH";let O=Pc(E.location,j,M);g=b()+1;let X=tp(O,g),I=E.createHref(O);try{m.pushState(X,"",I)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;f.location.assign(I)}d&&y&&y({action:v,location:E.location,delta:1})}function T(j,M){v="REPLACE";let O=Pc(E.location,j,M);g=b();let X=tp(O,g),I=E.createHref(O);m.replaceState(X,"",I),d&&y&&y({action:v,location:E.location,delta:0})}function N(j){return Ov(j)}let E={get action(){return v},get location(){return l(f,m)},listen(j){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(ep,A),y=j,()=>{f.removeEventListener(ep,A),y=null}},createHref(j){return i(f,j)},createURL:N,encodeLocation(j){let M=N(j);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:w,replace:T,go(j){return m.go(j)}};return E}function Ov(l,i=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),He(s,"No window.location.(origin|href) available to create URL");let r=typeof l=="string"?l:mi(l);return r=r.replace(/ $/,"%20"),!i&&r.startsWith("//")&&(r=s+r),new URL(r,s)}function Lp(l,i,s="/"){return Dv(l,i,s,!1)}function Dv(l,i,s,r){let f=typeof i=="string"?cl(i):i,d=jn(f.pathname||"/",s);if(d==null)return null;let m=Hp(l);kv(m);let v=null;for(let y=0;v==null&&y<m.length;++y){let g=Kv(d);v=Gv(m[y],g,r)}return v}function Hp(l,i=[],s=[],r="",f=!1){let d=(m,v,y=f,g)=>{let b={relativePath:g===void 0?m.path||"":g,caseSensitive:m.caseSensitive===!0,childrenIndex:v,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(r)&&y)return;He(b.relativePath.startsWith(r),`Absolute route path "${b.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(r.length)}let A=qn([r,b.relativePath]),w=s.concat(b);m.children&&m.children.length>0&&(He(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${A}".`),Hp(m.children,i,w,A,y)),!(m.path==null&&!m.index)&&i.push({path:A,score:Yv(A,m.index),routesMeta:w})};return l.forEach((m,v)=>{if(m.path===""||!m.path?.includes("?"))d(m,v);else for(let y of Vp(m.path))d(m,v,!0,y)}),i}function Vp(l){let i=l.split("/");if(i.length===0)return[];let[s,...r]=i,f=s.endsWith("?"),d=s.replace(/\?$/,"");if(r.length===0)return f?[d,""]:[d];let m=Vp(r.join("/")),v=[];return v.push(...m.map(y=>y===""?d:[d,y].join("/"))),f&&v.push(...m),v.map(y=>l.startsWith("/")&&y===""?"/":y)}function kv(l){l.sort((i,s)=>i.score!==s.score?s.score-i.score:Qv(i.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}var zv=/^:[\w-]+$/,Bv=3,Uv=2,Lv=1,Hv=10,Vv=-2,np=l=>l==="*";function Yv(l,i){let s=l.split("/"),r=s.length;return s.some(np)&&(r+=Vv),i&&(r+=Uv),s.filter(f=>!np(f)).reduce((f,d)=>f+(zv.test(d)?Bv:d===""?Lv:Hv),r)}function Qv(l,i){return l.length===i.length&&l.slice(0,-1).every((r,f)=>r===i[f])?l[l.length-1]-i[i.length-1]:0}function Gv(l,i,s=!1){let{routesMeta:r}=l,f={},d="/",m=[];for(let v=0;v<r.length;++v){let y=r[v],g=v===r.length-1,b=d==="/"?i:i.slice(d.length)||"/",A=sr({path:y.relativePath,caseSensitive:y.caseSensitive,end:g},b),w=y.route;if(!A&&g&&s&&!r[r.length-1].route.index&&(A=sr({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},b)),!A)return null;Object.assign(f,A.params),m.push({params:f,pathname:qn([d,A.pathname]),pathnameBase:Wv(qn([d,A.pathnameBase])),route:w}),A.pathnameBase!=="/"&&(d=qn([d,A.pathnameBase]))}return m}function sr(l,i){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[s,r]=Xv(l.path,l.caseSensitive,l.end),f=i.match(s);if(!f)return null;let d=f[0],m=d.replace(/(.)\/+$/,"$1"),v=f.slice(1);return{params:r.reduce((g,{paramName:b,isOptional:A},w)=>{if(b==="*"){let N=v[w]||"";m=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const T=v[w];return A&&!T?g[b]=void 0:g[b]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:m,pattern:l}}function Xv(l,i=!1,s=!0){Kt(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let r=[],f="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,y)=>(r.push({paramName:v,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(r.push({paramName:"*"}),f+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":l!==""&&l!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,i?void 0:"i"),r]}function Kv(l){try{return l.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Kt(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),l}}function jn(l,i){if(i==="/")return l;if(!l.toLowerCase().startsWith(i.toLowerCase()))return null;let s=i.endsWith("/")?i.length-1:i.length,r=l.charAt(s);return r&&r!=="/"?null:l.slice(s)||"/"}var Zv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jv=l=>Zv.test(l);function Fv(l,i="/"){let{pathname:s,search:r="",hash:f=""}=typeof l=="string"?cl(l):l,d;if(s)if(Jv(s))d=s;else{if(s.includes("//")){let m=s;s=s.replace(/\/\/+/g,"/"),Kt(!1,`Pathnames cannot have embedded double slashes - normalizing ${m} -> ${s}`)}s.startsWith("/")?d=ap(s.substring(1),"/"):d=ap(s,i)}else d=i;return{pathname:d,search:Iv(r),hash:Pv(f)}}function ap(l,i){let s=i.replace(/\/+$/,"").split("/");return l.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function Lc(l,i,s,r){return`Cannot include a '${l}' character in a manually specified \`to.${i}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $v(l){return l.filter((i,s)=>s===0||i.route.path&&i.route.path.length>0)}function Yp(l){let i=$v(l);return i.map((s,r)=>r===i.length-1?s.pathname:s.pathnameBase)}function Qp(l,i,s,r=!1){let f;typeof l=="string"?f=cl(l):(f={...l},He(!f.pathname||!f.pathname.includes("?"),Lc("?","pathname","search",f)),He(!f.pathname||!f.pathname.includes("#"),Lc("#","pathname","hash",f)),He(!f.search||!f.search.includes("#"),Lc("#","search","hash",f)));let d=l===""||f.pathname==="",m=d?"/":f.pathname,v;if(m==null)v=s;else{let A=i.length-1;if(!r&&m.startsWith("..")){let w=m.split("/");for(;w[0]==="..";)w.shift(),A-=1;f.pathname=w.join("/")}v=A>=0?i[A]:"/"}let y=Fv(f,v),g=m&&m!=="/"&&m.endsWith("/"),b=(d||m===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(g||b)&&(y.pathname+="/"),y}var qn=l=>l.join("/").replace(/\/\/+/g,"/"),Wv=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),Iv=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,Pv=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l;function ex(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Gp=["POST","PUT","PATCH","DELETE"];new Set(Gp);var tx=["GET",...Gp];new Set(tx);var ol=p.createContext(null);ol.displayName="DataRouter";var or=p.createContext(null);or.displayName="DataRouterState";p.createContext(!1);var Xp=p.createContext({isTransitioning:!1});Xp.displayName="ViewTransition";var nx=p.createContext(new Map);nx.displayName="Fetchers";var ax=p.createContext(null);ax.displayName="Await";var Pt=p.createContext(null);Pt.displayName="Navigation";var bi=p.createContext(null);bi.displayName="Location";var Nn=p.createContext({outlet:null,matches:[],isDataRoute:!1});Nn.displayName="Route";var yo=p.createContext(null);yo.displayName="RouteError";function lx(l,{relative:i}={}){He(Ai(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:r}=p.useContext(Pt),{hash:f,pathname:d,search:m}=Si(l,{relative:i}),v=d;return s!=="/"&&(v=d==="/"?s:qn([s,d])),r.createHref({pathname:v,search:m,hash:f})}function Ai(){return p.useContext(bi)!=null}function Aa(){return He(Ai(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(bi).location}var Kp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zp(l){p.useContext(Pt).static||p.useLayoutEffect(l)}function ix(){let{isDataRoute:l}=p.useContext(Nn);return l?vx():sx()}function sx(){He(Ai(),"useNavigate() may be used only in the context of a <Router> component.");let l=p.useContext(ol),{basename:i,navigator:s}=p.useContext(Pt),{matches:r}=p.useContext(Nn),{pathname:f}=Aa(),d=JSON.stringify(Yp(r)),m=p.useRef(!1);return Zp(()=>{m.current=!0}),p.useCallback((y,g={})=>{if(Kt(m.current,Kp),!m.current)return;if(typeof y=="number"){s.go(y);return}let b=Qp(y,JSON.parse(d),f,g.relative==="path");l==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:qn([i,b.pathname])),(g.replace?s.replace:s.push)(b,g.state,g)},[i,s,d,f,l])}p.createContext(null);function Si(l,{relative:i}={}){let{matches:s}=p.useContext(Nn),{pathname:r}=Aa(),f=JSON.stringify(Yp(s));return p.useMemo(()=>Qp(l,JSON.parse(f),r,i==="path"),[l,f,r,i])}function rx(l,i){return Jp(l,i)}function Jp(l,i,s,r,f){He(Ai(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=p.useContext(Pt),{matches:m}=p.useContext(Nn),v=m[m.length-1],y=v?v.params:{},g=v?v.pathname:"/",b=v?v.pathnameBase:"/",A=v&&v.route;{let O=A&&A.path||"";Fp(g,!A||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let w=Aa(),T;if(i){let O=typeof i=="string"?cl(i):i;He(b==="/"||O.pathname?.startsWith(b),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${b}" but pathname "${O.pathname}" was given in the \`location\` prop.`),T=O}else T=w;let N=T.pathname||"/",E=N;if(b!=="/"){let O=b.replace(/^\//,"").split("/");E="/"+N.replace(/^\//,"").split("/").slice(O.length).join("/")}let j=Lp(l,{pathname:E});Kt(A||j!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Kt(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let M=dx(j&&j.map(O=>Object.assign({},O,{params:Object.assign({},y,O.params),pathname:qn([b,d.encodeLocation?d.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?b:qn([b,d.encodeLocation?d.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),m,s,r,f);return i&&M?p.createElement(bi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},M):M}function ux(){let l=gx(),i=ex(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),s=l instanceof Error?l.stack:null,r="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},m=null;return console.error("Error handled by React Router default ErrorBoundary:",l),m=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:d},"ErrorBoundary")," or"," ",p.createElement("code",{style:d},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},i),s?p.createElement("pre",{style:f},s):null,m)}var cx=p.createElement(ux,null),ox=class extends p.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,i){return i.location!==l.location||i.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:i.error,location:i.location,revalidation:l.revalidation||i.revalidation}}componentDidCatch(l,i){this.props.onError?this.props.onError(l,i):console.error("React Router caught the following error during render",l)}render(){return this.state.error!==void 0?p.createElement(Nn.Provider,{value:this.props.routeContext},p.createElement(yo.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function fx({routeContext:l,match:i,children:s}){let r=p.useContext(ol);return r&&r.static&&r.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(Nn.Provider,{value:l},s)}function dx(l,i=[],s=null,r=null,f=null){if(l==null){if(!s)return null;if(s.errors)l=s.matches;else if(i.length===0&&!s.initialized&&s.matches.length>0)l=s.matches;else return null}let d=l,m=s?.errors;if(m!=null){let b=d.findIndex(A=>A.route.id&&m?.[A.route.id]!==void 0);He(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let v=!1,y=-1;if(s)for(let b=0;b<d.length;b++){let A=d[b];if((A.route.HydrateFallback||A.route.hydrateFallbackElement)&&(y=b),A.route.id){let{loaderData:w,errors:T}=s,N=A.route.loader&&!w.hasOwnProperty(A.route.id)&&(!T||T[A.route.id]===void 0);if(A.route.lazy||N){v=!0,y>=0?d=d.slice(0,y+1):d=[d[0]];break}}}let g=s&&r?(b,A)=>{r(b,{location:s.location,params:s.matches?.[0]?.params??{},errorInfo:A})}:void 0;return d.reduceRight((b,A,w)=>{let T,N=!1,E=null,j=null;s&&(T=m&&A.route.id?m[A.route.id]:void 0,E=A.route.errorElement||cx,v&&(y<0&&w===0?(Fp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,j=null):y===w&&(N=!0,j=A.route.hydrateFallbackElement||null)));let M=i.concat(d.slice(0,w+1)),O=()=>{let X;return T?X=E:N?X=j:A.route.Component?X=p.createElement(A.route.Component,null):A.route.element?X=A.route.element:X=b,p.createElement(fx,{match:A,routeContext:{outlet:b,matches:M,isDataRoute:s!=null},children:X})};return s&&(A.route.ErrorBoundary||A.route.errorElement||w===0)?p.createElement(ox,{location:s.location,revalidation:s.revalidation,component:E,error:T,children:O(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:g}):O()},null)}function go(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hx(l){let i=p.useContext(ol);return He(i,go(l)),i}function mx(l){let i=p.useContext(or);return He(i,go(l)),i}function px(l){let i=p.useContext(Nn);return He(i,go(l)),i}function vo(l){let i=px(l),s=i.matches[i.matches.length-1];return He(s.route.id,`${l} can only be used on routes that contain a unique "id"`),s.route.id}function yx(){return vo("useRouteId")}function gx(){let l=p.useContext(yo),i=mx("useRouteError"),s=vo("useRouteError");return l!==void 0?l:i.errors?.[s]}function vx(){let{router:l}=hx("useNavigate"),i=vo("useNavigate"),s=p.useRef(!1);return Zp(()=>{s.current=!0}),p.useCallback(async(f,d={})=>{Kt(s.current,Kp),s.current&&(typeof f=="number"?l.navigate(f):await l.navigate(f,{fromRouteId:i,...d}))},[l,i])}var lp={};function Fp(l,i,s){!i&&!lp[l]&&(lp[l]=!0,Kt(!1,s))}p.memo(xx);function xx({routes:l,future:i,state:s,unstable_onError:r}){return Jp(l,void 0,s,r,i)}function Ws(l){He(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function bx({basename:l="/",children:i=null,location:s,navigationType:r="POP",navigator:f,static:d=!1}){He(!Ai(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=l.replace(/^\/*/,"/"),v=p.useMemo(()=>({basename:m,navigator:f,static:d,future:{}}),[m,f,d]);typeof s=="string"&&(s=cl(s));let{pathname:y="/",search:g="",hash:b="",state:A=null,key:w="default"}=s,T=p.useMemo(()=>{let N=jn(y,m);return N==null?null:{location:{pathname:N,search:g,hash:b,state:A,key:w},navigationType:r}},[m,y,g,b,A,w,r]);return Kt(T!=null,`<Router basename="${m}"> is not able to match the URL "${y}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:p.createElement(Pt.Provider,{value:v},p.createElement(bi.Provider,{children:i,value:T}))}function Ax({children:l,location:i}){return rx(eo(l),i)}function eo(l,i=[]){let s=[];return p.Children.forEach(l,(r,f)=>{if(!p.isValidElement(r))return;let d=[...i,f];if(r.type===p.Fragment){s.push.apply(s,eo(r.props.children,d));return}He(r.type===Ws,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!r.props.index||!r.props.children,"An index route cannot have child routes.");let m={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(m.children=eo(r.props.children,d)),s.push(m)}),s}var Is="get",Ps="application/x-www-form-urlencoded";function fr(l){return l!=null&&typeof l.tagName=="string"}function Sx(l){return fr(l)&&l.tagName.toLowerCase()==="button"}function qx(l){return fr(l)&&l.tagName.toLowerCase()==="form"}function Ex(l){return fr(l)&&l.tagName.toLowerCase()==="input"}function jx(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Nx(l,i){return l.button===0&&(!i||i==="_self")&&!jx(l)}var Ys=null;function Cx(){if(Ys===null)try{new FormData(document.createElement("form"),0),Ys=!1}catch{Ys=!0}return Ys}var Tx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hc(l){return l!=null&&!Tx.has(l)?(Kt(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ps}"`),null):l}function wx(l,i){let s,r,f,d,m;if(qx(l)){let v=l.getAttribute("action");r=v?jn(v,i):null,s=l.getAttribute("method")||Is,f=Hc(l.getAttribute("enctype"))||Ps,d=new FormData(l)}else if(Sx(l)||Ex(l)&&(l.type==="submit"||l.type==="image")){let v=l.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=l.getAttribute("formaction")||v.getAttribute("action");if(r=y?jn(y,i):null,s=l.getAttribute("formmethod")||v.getAttribute("method")||Is,f=Hc(l.getAttribute("formenctype"))||Hc(v.getAttribute("enctype"))||Ps,d=new FormData(v,l),!Cx()){let{name:g,type:b,value:A}=l;if(b==="image"){let w=g?`${g}.`:"";d.append(`${w}x`,"0"),d.append(`${w}y`,"0")}else g&&d.append(g,A)}}else{if(fr(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Is,r=null,f=Ps,m=l}return d&&f==="text/plain"&&(m=d,d=void 0),{action:r,method:s.toLowerCase(),encType:f,formData:d,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xo(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Mx(l,i,s){let r=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return r.pathname==="/"?r.pathname=`_root.${s}`:i&&jn(r.pathname,i)==="/"?r.pathname=`${i.replace(/\/$/,"")}/_root.${s}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${s}`,r}async function Rx(l,i){if(l.id in i)return i[l.id];try{let s=await import(l.module);return i[l.id]=s,s}catch(s){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _x(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function Ox(l,i,s){let r=await Promise.all(l.map(async f=>{let d=i.routes[f.route.id];if(d){let m=await Rx(d,s);return m.links?m.links():[]}return[]}));return Bx(r.flat(1).filter(_x).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function ip(l,i,s,r,f,d){let m=(y,g)=>s[g]?y.route.id!==s[g].route.id:!0,v=(y,g)=>s[g].pathname!==y.pathname||s[g].route.path?.endsWith("*")&&s[g].params["*"]!==y.params["*"];return d==="assets"?i.filter((y,g)=>m(y,g)||v(y,g)):d==="data"?i.filter((y,g)=>{let b=r.routes[y.route.id];if(!b||!b.hasLoader)return!1;if(m(y,g)||v(y,g))return!0;if(y.route.shouldRevalidate){let A=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(l,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof A=="boolean")return A}return!0}):[]}function Dx(l,i,{includeHydrateFallback:s}={}){return kx(l.map(r=>{let f=i.routes[r.route.id];if(!f)return[];let d=[f.module];return f.clientActionModule&&(d=d.concat(f.clientActionModule)),f.clientLoaderModule&&(d=d.concat(f.clientLoaderModule)),s&&f.hydrateFallbackModule&&(d=d.concat(f.hydrateFallbackModule)),f.imports&&(d=d.concat(f.imports)),d}).flat(1))}function kx(l){return[...new Set(l)]}function zx(l){let i={},s=Object.keys(l).sort();for(let r of s)i[r]=l[r];return i}function Bx(l,i){let s=new Set;return new Set(i),l.reduce((r,f)=>{let d=JSON.stringify(zx(f));return s.has(d)||(s.add(d),r.push({key:d,link:f})),r},[])}function $p(){let l=p.useContext(ol);return xo(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function Ux(){let l=p.useContext(or);return xo(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var bo=p.createContext(void 0);bo.displayName="FrameworkContext";function Wp(){let l=p.useContext(bo);return xo(l,"You must render this element inside a <HydratedRouter> element"),l}function Lx(l,i){let s=p.useContext(bo),[r,f]=p.useState(!1),[d,m]=p.useState(!1),{onFocus:v,onBlur:y,onMouseEnter:g,onMouseLeave:b,onTouchStart:A}=i,w=p.useRef(null);p.useEffect(()=>{if(l==="render"&&m(!0),l==="viewport"){let E=M=>{M.forEach(O=>{m(O.isIntersecting)})},j=new IntersectionObserver(E,{threshold:.5});return w.current&&j.observe(w.current),()=>{j.disconnect()}}},[l]),p.useEffect(()=>{if(r){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[r]);let T=()=>{f(!0)},N=()=>{f(!1),m(!1)};return s?l!=="intent"?[d,w,{}]:[d,w,{onFocus:ri(v,T),onBlur:ri(y,N),onMouseEnter:ri(g,T),onMouseLeave:ri(b,N),onTouchStart:ri(A,T)}]:[!1,w,{}]}function ri(l,i){return s=>{l&&l(s),s.defaultPrevented||i(s)}}function Hx({page:l,...i}){let{router:s}=$p(),r=p.useMemo(()=>Lp(s.routes,l,s.basename),[s.routes,l,s.basename]);return r?p.createElement(Yx,{page:l,matches:r,...i}):null}function Vx(l){let{manifest:i,routeModules:s}=Wp(),[r,f]=p.useState([]);return p.useEffect(()=>{let d=!1;return Ox(l,i,s).then(m=>{d||f(m)}),()=>{d=!0}},[l,i,s]),r}function Yx({page:l,matches:i,...s}){let r=Aa(),{manifest:f,routeModules:d}=Wp(),{basename:m}=$p(),{loaderData:v,matches:y}=Ux(),g=p.useMemo(()=>ip(l,i,y,f,r,"data"),[l,i,y,f,r]),b=p.useMemo(()=>ip(l,i,y,f,r,"assets"),[l,i,y,f,r]),A=p.useMemo(()=>{if(l===r.pathname+r.search+r.hash)return[];let N=new Set,E=!1;if(i.forEach(M=>{let O=f.routes[M.route.id];!O||!O.hasLoader||(!g.some(X=>X.route.id===M.route.id)&&M.route.id in v&&d[M.route.id]?.shouldRevalidate||O.hasClientLoader?E=!0:N.add(M.route.id))}),N.size===0)return[];let j=Mx(l,m,"data");return E&&N.size>0&&j.searchParams.set("_routes",i.filter(M=>N.has(M.route.id)).map(M=>M.route.id).join(",")),[j.pathname+j.search]},[m,v,r,f,g,i,l,d]),w=p.useMemo(()=>Dx(b,f),[b,f]),T=Vx(b);return p.createElement(p.Fragment,null,A.map(N=>p.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...s})),w.map(N=>p.createElement("link",{key:N,rel:"modulepreload",href:N,...s})),T.map(({key:N,link:E})=>p.createElement("link",{key:N,nonce:s.nonce,...E})))}function Qx(...l){return i=>{l.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var Ip=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ip&&(window.__reactRouterVersion="7.9.6")}catch{}function Gx({basename:l,children:i,window:s}){let r=p.useRef();r.current==null&&(r.current=Mv({window:s,v5Compat:!0}));let f=r.current,[d,m]=p.useState({action:f.action,location:f.location}),v=p.useCallback(y=>{p.startTransition(()=>m(y))},[m]);return p.useLayoutEffect(()=>f.listen(v),[f,v]),p.createElement(bx,{basename:l,children:i,location:d.location,navigationType:d.action,navigator:f})}var Pp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,e0=p.forwardRef(function({onClick:i,discover:s="render",prefetch:r="none",relative:f,reloadDocument:d,replace:m,state:v,target:y,to:g,preventScrollReset:b,viewTransition:A,...w},T){let{basename:N}=p.useContext(Pt),E=typeof g=="string"&&Pp.test(g),j,M=!1;if(typeof g=="string"&&E&&(j=g,Ip))try{let te=new URL(window.location.href),oe=g.startsWith("//")?new URL(te.protocol+g):new URL(g),be=jn(oe.pathname,N);oe.origin===te.origin&&be!=null?g=be+oe.search+oe.hash:M=!0}catch{Kt(!1,`<Link to="${g}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=lx(g,{relative:f}),[X,I,F]=Lx(r,w),$=Jx(g,{replace:m,state:v,target:y,preventScrollReset:b,relative:f,viewTransition:A});function V(te){i&&i(te),te.defaultPrevented||$(te)}let W=p.createElement("a",{...w,...F,href:j||O,onClick:M||d?i:V,ref:Qx(T,I),target:y,"data-discover":!E&&s==="render"?"true":void 0});return X&&!E?p.createElement(p.Fragment,null,W,p.createElement(Hx,{page:O})):W});e0.displayName="Link";var Xx=p.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:r="",end:f=!1,style:d,to:m,viewTransition:v,children:y,...g},b){let A=Si(m,{relative:g.relative}),w=Aa(),T=p.useContext(or),{navigator:N,basename:E}=p.useContext(Pt),j=T!=null&&Px(A)&&v===!0,M=N.encodeLocation?N.encodeLocation(A).pathname:A.pathname,O=w.pathname,X=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;s||(O=O.toLowerCase(),X=X?X.toLowerCase():null,M=M.toLowerCase()),X&&E&&(X=jn(X,E)||X);const I=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let F=O===M||!f&&O.startsWith(M)&&O.charAt(I)==="/",$=X!=null&&(X===M||!f&&X.startsWith(M)&&X.charAt(M.length)==="/"),V={isActive:F,isPending:$,isTransitioning:j},W=F?i:void 0,te;typeof r=="function"?te=r(V):te=[r,F?"active":null,$?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let oe=typeof d=="function"?d(V):d;return p.createElement(e0,{...g,"aria-current":W,className:te,ref:b,style:oe,to:m,viewTransition:v},typeof y=="function"?y(V):y)});Xx.displayName="NavLink";var Kx=p.forwardRef(({discover:l="render",fetcherKey:i,navigate:s,reloadDocument:r,replace:f,state:d,method:m=Is,action:v,onSubmit:y,relative:g,preventScrollReset:b,viewTransition:A,...w},T)=>{let N=Wx(),E=Ix(v,{relative:g}),j=m.toLowerCase()==="get"?"get":"post",M=typeof v=="string"&&Pp.test(v),O=X=>{if(y&&y(X),X.defaultPrevented)return;X.preventDefault();let I=X.nativeEvent.submitter,F=I?.getAttribute("formmethod")||m;N(I||X.currentTarget,{fetcherKey:i,method:F,navigate:s,replace:f,state:d,relative:g,preventScrollReset:b,viewTransition:A})};return p.createElement("form",{ref:T,method:j,action:E,onSubmit:r?y:O,...w,"data-discover":!M&&l==="render"?"true":void 0})});Kx.displayName="Form";function Zx(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function t0(l){let i=p.useContext(ol);return He(i,Zx(l)),i}function Jx(l,{target:i,replace:s,state:r,preventScrollReset:f,relative:d,viewTransition:m}={}){let v=ix(),y=Aa(),g=Si(l,{relative:d});return p.useCallback(b=>{if(Nx(b,i)){b.preventDefault();let A=s!==void 0?s:mi(y)===mi(g);v(l,{replace:A,state:r,preventScrollReset:f,relative:d,viewTransition:m})}},[y,v,g,s,r,i,l,f,d,m])}var Fx=0,$x=()=>`__${String(++Fx)}__`;function Wx(){let{router:l}=t0("useSubmit"),{basename:i}=p.useContext(Pt),s=yx();return p.useCallback(async(r,f={})=>{let{action:d,method:m,encType:v,formData:y,body:g}=wx(r,i);if(f.navigate===!1){let b=f.fetcherKey||$x();await l.fetch(b,s,f.action||d,{preventScrollReset:f.preventScrollReset,formData:y,body:g,formMethod:f.method||m,formEncType:f.encType||v,flushSync:f.flushSync})}else await l.navigate(f.action||d,{preventScrollReset:f.preventScrollReset,formData:y,body:g,formMethod:f.method||m,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:s,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,i,s])}function Ix(l,{relative:i}={}){let{basename:s}=p.useContext(Pt),r=p.useContext(Nn);He(r,"useFormAction must be used inside a RouteContext");let[f]=r.matches.slice(-1),d={...Si(l||".",{relative:i})},m=Aa();if(l==null){d.search=m.search;let v=new URLSearchParams(d.search),y=v.getAll("index");if(y.some(b=>b==="")){v.delete("index"),y.filter(A=>A).forEach(A=>v.append("index",A));let b=v.toString();d.search=b?`?${b}`:""}}return(!l||l===".")&&f.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(d.pathname=d.pathname==="/"?s:qn([s,d.pathname])),mi(d)}function Px(l,{relative:i}={}){let s=p.useContext(Xp);He(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=t0("useViewTransitionState"),f=Si(l,{relative:i});if(!s.isTransitioning)return!1;let d=jn(s.currentLocation.pathname,r)||s.currentLocation.pathname,m=jn(s.nextLocation.pathname,r)||s.nextLocation.pathname;return sr(f.pathname,m)!=null||sr(f.pathname,d)!=null}const It=Object.create(null);It.open="0";It.close="1";It.ping="2";It.pong="3";It.message="4";It.upgrade="5";It.noop="6";const er=Object.create(null);Object.keys(It).forEach(l=>{er[It[l]]=l});const to={type:"error",data:"parser error"},n0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",a0=typeof ArrayBuffer=="function",l0=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l&&l.buffer instanceof ArrayBuffer,Ao=({type:l,data:i},s,r)=>n0&&i instanceof Blob?s?r(i):sp(i,r):a0&&(i instanceof ArrayBuffer||l0(i))?s?r(i):sp(new Blob([i]),r):r(It[l]+(i||"")),sp=(l,i)=>{const s=new FileReader;return s.onload=function(){const r=s.result.split(",")[1];i("b"+(r||""))},s.readAsDataURL(l)};function rp(l){return l instanceof Uint8Array?l:l instanceof ArrayBuffer?new Uint8Array(l):new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}let Vc;function eb(l,i){if(n0&&l.data instanceof Blob)return l.data.arrayBuffer().then(rp).then(i);if(a0&&(l.data instanceof ArrayBuffer||l0(l.data)))return i(rp(l.data));Ao(l,!1,s=>{Vc||(Vc=new TextEncoder),i(Vc.encode(s))})}const up="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",di=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<up.length;l++)di[up.charCodeAt(l)]=l;const tb=l=>{let i=l.length*.75,s=l.length,r,f=0,d,m,v,y;l[l.length-1]==="="&&(i--,l[l.length-2]==="="&&i--);const g=new ArrayBuffer(i),b=new Uint8Array(g);for(r=0;r<s;r+=4)d=di[l.charCodeAt(r)],m=di[l.charCodeAt(r+1)],v=di[l.charCodeAt(r+2)],y=di[l.charCodeAt(r+3)],b[f++]=d<<2|m>>4,b[f++]=(m&15)<<4|v>>2,b[f++]=(v&3)<<6|y&63;return g},nb=typeof ArrayBuffer=="function",So=(l,i)=>{if(typeof l!="string")return{type:"message",data:i0(l,i)};const s=l.charAt(0);return s==="b"?{type:"message",data:ab(l.substring(1),i)}:er[s]?l.length>1?{type:er[s],data:l.substring(1)}:{type:er[s]}:to},ab=(l,i)=>{if(nb){const s=tb(l);return i0(s,i)}else return{base64:!0,data:l}},i0=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}},s0="",lb=(l,i)=>{const s=l.length,r=new Array(s);let f=0;l.forEach((d,m)=>{Ao(d,!1,v=>{r[m]=v,++f===s&&i(r.join(s0))})})},ib=(l,i)=>{const s=l.split(s0),r=[];for(let f=0;f<s.length;f++){const d=So(s[f],i);if(r.push(d),d.type==="error")break}return r};function sb(){return new TransformStream({transform(l,i){eb(l,s=>{const r=s.length;let f;if(r<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,r);else if(r<65536){f=new Uint8Array(3);const d=new DataView(f.buffer);d.setUint8(0,126),d.setUint16(1,r)}else{f=new Uint8Array(9);const d=new DataView(f.buffer);d.setUint8(0,127),d.setBigUint64(1,BigInt(r))}l.data&&typeof l.data!="string"&&(f[0]|=128),i.enqueue(f),i.enqueue(s)})}})}let Yc;function Qs(l){return l.reduce((i,s)=>i+s.length,0)}function Gs(l,i){if(l[0].length===i)return l.shift();const s=new Uint8Array(i);let r=0;for(let f=0;f<i;f++)s[f]=l[0][r++],r===l[0].length&&(l.shift(),r=0);return l.length&&r<l[0].length&&(l[0]=l[0].slice(r)),s}function rb(l,i){Yc||(Yc=new TextDecoder);const s=[];let r=0,f=-1,d=!1;return new TransformStream({transform(m,v){for(s.push(m);;){if(r===0){if(Qs(s)<1)break;const y=Gs(s,1);d=(y[0]&128)===128,f=y[0]&127,f<126?r=3:f===126?r=1:r=2}else if(r===1){if(Qs(s)<2)break;const y=Gs(s,2);f=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),r=3}else if(r===2){if(Qs(s)<8)break;const y=Gs(s,8),g=new DataView(y.buffer,y.byteOffset,y.length),b=g.getUint32(0);if(b>Math.pow(2,21)-1){v.enqueue(to);break}f=b*Math.pow(2,32)+g.getUint32(4),r=3}else{if(Qs(s)<f)break;const y=Gs(s,f);v.enqueue(So(d?y:Yc.decode(y),i)),r=0}if(f===0||f>l){v.enqueue(to);break}}}})}const r0=4;function Pe(l){if(l)return ub(l)}function ub(l){for(var i in Pe.prototype)l[i]=Pe.prototype[i];return l}Pe.prototype.on=Pe.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};Pe.prototype.once=function(l,i){function s(){this.off(l,s),i.apply(this,arguments)}return s.fn=i,this.on(l,s),this};Pe.prototype.off=Pe.prototype.removeListener=Pe.prototype.removeAllListeners=Pe.prototype.removeEventListener=function(l,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+l];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+l],this;for(var r,f=0;f<s.length;f++)if(r=s[f],r===i||r.fn===i){s.splice(f,1);break}return s.length===0&&delete this._callbacks["$"+l],this};Pe.prototype.emit=function(l){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),s=this._callbacks["$"+l],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(s){s=s.slice(0);for(var r=0,f=s.length;r<f;++r)s[r].apply(this,i)}return this};Pe.prototype.emitReserved=Pe.prototype.emit;Pe.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};Pe.prototype.hasListeners=function(l){return!!this.listeners(l).length};const dr=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,s)=>s(i,0),Lt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),cb="arraybuffer";function u0(l,...i){return i.reduce((s,r)=>(l.hasOwnProperty(r)&&(s[r]=l[r]),s),{})}const ob=Lt.setTimeout,fb=Lt.clearTimeout;function hr(l,i){i.useNativeTimers?(l.setTimeoutFn=ob.bind(Lt),l.clearTimeoutFn=fb.bind(Lt)):(l.setTimeoutFn=Lt.setTimeout.bind(Lt),l.clearTimeoutFn=Lt.clearTimeout.bind(Lt))}const db=1.33;function hb(l){return typeof l=="string"?mb(l):Math.ceil((l.byteLength||l.size)*db)}function mb(l){let i=0,s=0;for(let r=0,f=l.length;r<f;r++)i=l.charCodeAt(r),i<128?s+=1:i<2048?s+=2:i<55296||i>=57344?s+=3:(r++,s+=4);return s}function c0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pb(l){let i="";for(let s in l)l.hasOwnProperty(s)&&(i.length&&(i+="&"),i+=encodeURIComponent(s)+"="+encodeURIComponent(l[s]));return i}function yb(l){let i={},s=l.split("&");for(let r=0,f=s.length;r<f;r++){let d=s[r].split("=");i[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return i}class gb extends Error{constructor(i,s,r){super(i),this.description=s,this.context=r,this.type="TransportError"}}class qo extends Pe{constructor(i){super(),this.writable=!1,hr(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,s,r){return super.emitReserved("error",new gb(i,s,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const s=So(i,this.socket.binaryType);this.onPacket(s)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,s={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const s=pb(i);return s.length?"?"+s:""}}class vb extends qo{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const s=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||s()})),this.writable||(r++,this.once("drain",function(){--r||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const s=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};ib(i,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,lb(i,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=c0()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(i,s)}}let o0=!1;try{o0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xb=o0;function bb(){}class Ab extends vb{constructor(i){if(super(i),typeof location<"u"){const s=location.protocol==="https:";let r=location.port;r||(r=s?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||r!==i.port}}doWrite(i,s){const r=this.request({method:"POST",data:i});r.on("success",s),r.on("error",(f,d)=>{this.onError("xhr post error",f,d)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(s,r)=>{this.onError("xhr poll error",s,r)}),this.pollXhr=i}}class Wt extends Pe{constructor(i,s,r){super(),this.createRequest=i,hr(this,r),this._opts=r,this._method=r.method||"GET",this._uri=s,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;const s=u0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(s);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let f in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(f)&&r.setRequestHeader(f,this._opts.extraHeaders[f])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var f;r.readyState===3&&((f=this._opts.cookieJar)===null||f===void 0||f.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(f){this.setTimeoutFn(()=>{this._onError(f)},0);return}typeof document<"u"&&(this._index=Wt.requestsCount++,Wt.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=bb,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wt.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wt.requestsCount=0;Wt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cp);else if(typeof addEventListener=="function"){const l="onpagehide"in Lt?"pagehide":"unload";addEventListener(l,cp,!1)}}function cp(){for(let l in Wt.requests)Wt.requests.hasOwnProperty(l)&&Wt.requests[l].abort()}const Sb=(function(){const l=f0({xdomain:!1});return l&&l.responseType!==null})();class qb extends Ab{constructor(i){super(i);const s=i&&i.forceBase64;this.supportsBinary=Sb&&!s}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Wt(f0,this.uri(),i)}}function f0(l){const i=l.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||xb))return new XMLHttpRequest}catch{}if(!i)try{return new Lt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const d0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Eb extends qo{get name(){return"websocket"}doOpen(){const i=this.uri(),s=this.opts.protocols,r=d0?{}:u0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,s,r)}catch(f){return this.emitReserved("error",f)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let s=0;s<i.length;s++){const r=i[s],f=s===i.length-1;Ao(r,this.supportsBinary,d=>{try{this.doWrite(r,d)}catch{}f&&dr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=c0()),this.supportsBinary||(s.b64=1),this.createUri(i,s)}}const Qc=Lt.WebSocket||Lt.MozWebSocket;class jb extends Eb{createSocket(i,s,r){return d0?new Qc(i,s,r):s?new Qc(i,s):new Qc(i)}doWrite(i,s){this.ws.send(s)}}class Nb extends qo{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const s=rb(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=i.readable.pipeThrough(s).getReader(),f=sb();f.readable.pipeTo(i.writable),this._writer=f.writable.getWriter();const d=()=>{r.read().then(({done:v,value:y})=>{v||(this.onPacket(y),d())}).catch(v=>{})};d();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this._writer.write(m).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let s=0;s<i.length;s++){const r=i[s],f=s===i.length-1;this._writer.write(r).then(()=>{f&&dr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const Cb={websocket:jb,webtransport:Nb,polling:qb},Tb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wb=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function no(l){if(l.length>8e3)throw"URI too long";const i=l,s=l.indexOf("["),r=l.indexOf("]");s!=-1&&r!=-1&&(l=l.substring(0,s)+l.substring(s,r).replace(/:/g,";")+l.substring(r,l.length));let f=Tb.exec(l||""),d={},m=14;for(;m--;)d[wb[m]]=f[m]||"";return s!=-1&&r!=-1&&(d.source=i,d.host=d.host.substring(1,d.host.length-1).replace(/;/g,":"),d.authority=d.authority.replace("[","").replace("]","").replace(/;/g,":"),d.ipv6uri=!0),d.pathNames=Mb(d,d.path),d.queryKey=Rb(d,d.query),d}function Mb(l,i){const s=/\/{2,9}/g,r=i.replace(s,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&r.splice(0,1),i.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Rb(l,i){const s={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,f,d){f&&(s[f]=d)}),s}const ao=typeof addEventListener=="function"&&typeof removeEventListener=="function",tr=[];ao&&addEventListener("offline",()=>{tr.forEach(l=>l())},!1);class In extends Pe{constructor(i,s){if(super(),this.binaryType=cb,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(s=i,i=null),i){const r=no(i);s.hostname=r.host,s.secure=r.protocol==="https"||r.protocol==="wss",s.port=r.port,r.query&&(s.query=r.query)}else s.host&&(s.hostname=no(s.host).host);hr(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(r=>{const f=r.prototype.name;this.transports.push(f),this._transportsByName[f]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yb(this.opts.query)),ao&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const s=Object.assign({},this.opts.query);s.EIO=r0,s.transport=i,this.id&&(s.sid=this.id);const r=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&In.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(i);s.open(),this.setTransport(s)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",In.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=i.data,this._onError(s);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let r=0;r<this.writeBuffer.length;r++){const f=this.writeBuffer[r].data;if(f&&(s+=hb(f)),r>0&&s>this._maxPayload)return this.writeBuffer.slice(0,r);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,dr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,s,r){return this._sendPacket("message",i,s,r),this}send(i,s,r){return this._sendPacket("message",i,s,r),this}_sendPacket(i,s,r,f){if(typeof s=="function"&&(f=s,s=void 0),typeof r=="function"&&(f=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const d={type:i,data:s,options:r};this.emitReserved("packetCreate",d),this.writeBuffer.push(d),f&&this.once("flush",f),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),i()},r=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(In.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ao&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=tr.indexOf(this._offlineEventListener);r!==-1&&tr.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,s),this.writeBuffer=[],this._prevBufferLen=0}}}In.protocol=r0;class _b extends In{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let s=this.createTransport(i),r=!1;In.priorWebsocketSuccess=!1;const f=()=>{r||(s.send([{type:"ping",data:"probe"}]),s.once("packet",A=>{if(!r)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;In.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(b(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=s.name,this.emitReserved("upgradeError",w)}}))};function d(){r||(r=!0,b(),s.close(),s=null)}const m=A=>{const w=new Error("probe error: "+A);w.transport=s.name,d(),this.emitReserved("upgradeError",w)};function v(){m("transport closed")}function y(){m("socket closed")}function g(A){s&&A.name!==s.name&&d()}const b=()=>{s.removeListener("open",f),s.removeListener("error",m),s.removeListener("close",v),this.off("close",y),this.off("upgrading",g)};s.once("open",f),s.once("error",m),s.once("close",v),this.once("close",y),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{r||s.open()},200):s.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const s=[];for(let r=0;r<i.length;r++)~this.transports.indexOf(i[r])&&s.push(i[r]);return s}}let Ob=class extends _b{constructor(i,s={}){const r=typeof i=="object"?i:s;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(f=>Cb[f]).filter(f=>!!f)),super(i,r)}};function Db(l,i="",s){let r=l;s=s||typeof location<"u"&&location,l==null&&(l=s.protocol+"//"+s.host),typeof l=="string"&&(l.charAt(0)==="/"&&(l.charAt(1)==="/"?l=s.protocol+l:l=s.host+l),/^(https?|wss?):\/\//.test(l)||(typeof s<"u"?l=s.protocol+"//"+l:l="https://"+l),r=no(l)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const d=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+d+":"+r.port+i,r.href=r.protocol+"://"+d+(s&&s.port===r.port?"":":"+r.port),r}const kb=typeof ArrayBuffer=="function",zb=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l.buffer instanceof ArrayBuffer,h0=Object.prototype.toString,Bb=typeof Blob=="function"||typeof Blob<"u"&&h0.call(Blob)==="[object BlobConstructor]",Ub=typeof File=="function"||typeof File<"u"&&h0.call(File)==="[object FileConstructor]";function Eo(l){return kb&&(l instanceof ArrayBuffer||zb(l))||Bb&&l instanceof Blob||Ub&&l instanceof File}function nr(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let s=0,r=l.length;s<r;s++)if(nr(l[s]))return!0;return!1}if(Eo(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return nr(l.toJSON(),!0);for(const s in l)if(Object.prototype.hasOwnProperty.call(l,s)&&nr(l[s]))return!0;return!1}function Lb(l){const i=[],s=l.data,r=l;return r.data=lo(s,i),r.attachments=i.length,{packet:r,buffers:i}}function lo(l,i){if(!l)return l;if(Eo(l)){const s={_placeholder:!0,num:i.length};return i.push(l),s}else if(Array.isArray(l)){const s=new Array(l.length);for(let r=0;r<l.length;r++)s[r]=lo(l[r],i);return s}else if(typeof l=="object"&&!(l instanceof Date)){const s={};for(const r in l)Object.prototype.hasOwnProperty.call(l,r)&&(s[r]=lo(l[r],i));return s}return l}function Hb(l,i){return l.data=io(l.data,i),delete l.attachments,l}function io(l,i){if(!l)return l;if(l&&l._placeholder===!0){if(typeof l.num=="number"&&l.num>=0&&l.num<i.length)return i[l.num];throw new Error("illegal attachments")}else if(Array.isArray(l))for(let s=0;s<l.length;s++)l[s]=io(l[s],i);else if(typeof l=="object")for(const s in l)Object.prototype.hasOwnProperty.call(l,s)&&(l[s]=io(l[s],i));return l}const Vb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Yb=5;var Se;(function(l){l[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK"})(Se||(Se={}));class Qb{constructor(i){this.replacer=i}encode(i){return(i.type===Se.EVENT||i.type===Se.ACK)&&nr(i)?this.encodeAsBinary({type:i.type===Se.EVENT?Se.BINARY_EVENT:Se.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let s=""+i.type;return(i.type===Se.BINARY_EVENT||i.type===Se.BINARY_ACK)&&(s+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(s+=i.nsp+","),i.id!=null&&(s+=i.id),i.data!=null&&(s+=JSON.stringify(i.data,this.replacer)),s}encodeAsBinary(i){const s=Lb(i),r=this.encodeAsString(s.packet),f=s.buffers;return f.unshift(r),f}}function op(l){return Object.prototype.toString.call(l)==="[object Object]"}class jo extends Pe{constructor(i){super(),this.reviver=i}add(i){let s;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(i);const r=s.type===Se.BINARY_EVENT;r||s.type===Se.BINARY_ACK?(s.type=r?Se.EVENT:Se.ACK,this.reconstructor=new Gb(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(Eo(i)||i.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(i),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let s=0;const r={type:Number(i.charAt(0))};if(Se[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Se.BINARY_EVENT||r.type===Se.BINARY_ACK){const d=s+1;for(;i.charAt(++s)!=="-"&&s!=i.length;);const m=i.substring(d,s);if(m!=Number(m)||i.charAt(s)!=="-")throw new Error("Illegal attachments");r.attachments=Number(m)}if(i.charAt(s+1)==="/"){const d=s+1;for(;++s&&!(i.charAt(s)===","||s===i.length););r.nsp=i.substring(d,s)}else r.nsp="/";const f=i.charAt(s+1);if(f!==""&&Number(f)==f){const d=s+1;for(;++s;){const m=i.charAt(s);if(m==null||Number(m)!=m){--s;break}if(s===i.length)break}r.id=Number(i.substring(d,s+1))}if(i.charAt(++s)){const d=this.tryParse(i.substr(s));if(jo.isPayloadValid(r.type,d))r.data=d;else throw new Error("invalid payload")}return r}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,s){switch(i){case Se.CONNECT:return op(s);case Se.DISCONNECT:return s===void 0;case Se.CONNECT_ERROR:return typeof s=="string"||op(s);case Se.EVENT:case Se.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&Vb.indexOf(s[0])===-1);case Se.ACK:case Se.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Gb{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const s=Hb(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Xb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:jo,Encoder:Qb,get PacketType(){return Se},protocol:Yb},Symbol.toStringTag,{value:"Module"}));function Xt(l,i,s){return l.on(i,s),function(){l.off(i,s)}}const Kb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class m0 extends Pe{constructor(i,s,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=s,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Xt(i,"open",this.onopen.bind(this)),Xt(i,"packet",this.onpacket.bind(this)),Xt(i,"error",this.onerror.bind(this)),Xt(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...s){var r,f,d;if(Kb.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(s.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const m={type:Se.EVENT,data:s};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const b=this.ids++,A=s.pop();this._registerAckCallback(b,A),m.id=b}const v=(f=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||f===void 0?void 0:f.writable,y=this.connected&&!(!((d=this.io.engine)===null||d===void 0)&&d._hasPingExpired());return this.flags.volatile&&!v||(y?(this.notifyOutgoingListeners(m),this.packet(m)):this.sendBuffer.push(m)),this.flags={},this}_registerAckCallback(i,s){var r;const f=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(f===void 0){this.acks[i]=s;return}const d=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let v=0;v<this.sendBuffer.length;v++)this.sendBuffer[v].id===i&&this.sendBuffer.splice(v,1);s.call(this,new Error("operation has timed out"))},f),m=(...v)=>{this.io.clearTimeoutFn(d),s.apply(this,v)};m.withError=!0,this.acks[i]=m}emitWithAck(i,...s){return new Promise((r,f)=>{const d=(m,v)=>m?f(m):r(v);d.withError=!0,s.push(d),this.emit(i,...s)})}_addToQueue(i){let s;typeof i[i.length-1]=="function"&&(s=i.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((f,...d)=>r!==this._queue[0]?void 0:(f!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(f)):(this._queue.shift(),s&&s(null,...d)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!i||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(r=>String(r.id)===i)){const r=this.acks[i];delete this.acks[i],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Se.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Se.EVENT:case Se.BINARY_EVENT:this.onevent(i);break;case Se.ACK:case Se.BINARY_ACK:this.onack(i);break;case Se.DISCONNECT:this.ondisconnect();break;case Se.CONNECT_ERROR:this.destroy();const r=new Error(i.data.message);r.data=i.data.data,this.emitReserved("connect_error",r);break}}onevent(i){const s=i.data||[];i.id!=null&&s.push(this.ack(i.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const r of s)r.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const s=this;let r=!1;return function(...f){r||(r=!0,s.packet({type:Se.ACK,id:i,data:f}))}}onack(i){const s=this.acks[i.id];typeof s=="function"&&(delete this.acks[i.id],s.withError&&i.data.unshift(null),s.apply(this,i.data))}onconnect(i,s){this.id=i,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const s=this._anyListeners;for(let r=0;r<s.length;r++)if(i===s[r])return s.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const s=this._anyOutgoingListeners;for(let r=0;r<s.length;r++)if(i===s[r])return s.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const s=this._anyOutgoingListeners.slice();for(const r of s)r.apply(this,i.data)}}}function fl(l){l=l||{},this.ms=l.min||100,this.max=l.max||1e4,this.factor=l.factor||2,this.jitter=l.jitter>0&&l.jitter<=1?l.jitter:0,this.attempts=0}fl.prototype.duration=function(){var l=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),s=Math.floor(i*this.jitter*l);l=(Math.floor(i*10)&1)==0?l-s:l+s}return Math.min(l,this.max)|0};fl.prototype.reset=function(){this.attempts=0};fl.prototype.setMin=function(l){this.ms=l};fl.prototype.setMax=function(l){this.max=l};fl.prototype.setJitter=function(l){this.jitter=l};class so extends Pe{constructor(i,s){var r;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(s=i,i=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,hr(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((r=s.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new fl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=i;const f=s.parser||Xb;this.encoder=new f.Encoder,this.decoder=new f.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var s;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(s=this.backoff)===null||s===void 0||s.setMin(i),this)}randomizationFactor(i){var s;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(s=this.backoff)===null||s===void 0||s.setJitter(i),this)}reconnectionDelayMax(i){var s;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(s=this.backoff)===null||s===void 0||s.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Ob(this.uri,this.opts);const s=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const f=Xt(s,"open",function(){r.onopen(),i&&i()}),d=v=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",v),i?i(v):this.maybeReconnectOnOpen()},m=Xt(s,"error",d);if(this._timeout!==!1){const v=this._timeout,y=this.setTimeoutFn(()=>{f(),d(new Error("timeout")),s.close()},v);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(f),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Xt(i,"ping",this.onping.bind(this)),Xt(i,"data",this.ondata.bind(this)),Xt(i,"error",this.onerror.bind(this)),Xt(i,"close",this.onclose.bind(this)),Xt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(s){this.onclose("parse error",s)}}ondecoded(i){dr(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,s){let r=this.nsps[i];return r?this._autoConnect&&!r.active&&r.connect():(r=new m0(this,i,s),this.nsps[i]=r),r}_destroy(i){const s=Object.keys(this.nsps);for(const r of s)if(this.nsps[r].active)return;this._close()}_packet(i){const s=this.encoder.encode(i);for(let r=0;r<s.length;r++)this.engine.write(s[r],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,s){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(f=>{f?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",f)):i.onreconnect()}))},s);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const ui={};function ar(l,i){typeof l=="object"&&(i=l,l=void 0),i=i||{};const s=Db(l,i.path||"/socket.io"),r=s.source,f=s.id,d=s.path,m=ui[f]&&d in ui[f].nsps,v=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let y;return v?y=new so(r,i):(ui[f]||(ui[f]=new so(r,i)),y=ui[f]),s.query&&!i.query&&(i.query=s.queryKey),y.socket(s.path,i)}Object.assign(ar,{Manager:so,Socket:m0,io:ar,connect:ar});const p0=window.location.origin;console.info("[socket] connecting to",p0);const No=ar(p0,{transports:["polling","websocket"],timeout:15e3});No.on("connect_error",l=>console.error("connect_error",l.code,l.message,l.data));const y0=p.createContext(No),Zb=({children:l})=>o.jsx(y0.Provider,{value:No,children:l}),Sa=()=>p.useContext(y0),g0=p.createContext({connected:!1,session:null,logs:[],login:async()=>{},setRole:async()=>{},requestControl:async()=>{},releaseControl:async()=>{},subscribeAll:async()=>{},homeAssistantToggle:async()=>{},homeAssistantSetState:async()=>{},setNickname:async()=>{}});function Jb(l){return p.useCallback((i,s={})=>new Promise((r,f)=>{l.emit(i,s,(d={})=>{d.error?f(new Error(d.error)):r(d)})}),[l])}function Fb({children:l}){const i=Sa(),s=Jb(i),[r,f]=p.useState(null),[d,m]=p.useState([]),[v,y]=p.useState([]),[g,b]=p.useState(i.connected);p.useEffect(()=>{const T=()=>b(!0),N=()=>b(!1);return i.on("connect",T),i.on("disconnect",N),()=>{i.off("connect",T),i.off("disconnect",N)}},[i]),p.useEffect(()=>{function T(j){f(j)}function N(j=[]){m(j)}function E(j){m(M=>[...M.slice(-199),j])}return i.on("session:sync",T),i.on("log:init",N),i.on("log:entry",E),i.on("alert:new",(j={})=>{y(M=>[...M.slice(-49),{...j,receivedAt:Date.now()}])}),()=>{i.off("session:sync",T),i.off("log:init",N),i.off("log:entry",E),i.off("alert:new")}},[i]);const A=p.useMemo(()=>({login:(T,N)=>s("auth:login",{username:T,password:N}),setRole:T=>s("session:setRole",{role:T}),requestControl:(T,N={})=>s("session:requestControl",{roverId:T,...N}),releaseControl:T=>s("session:releaseControl",{roverId:T}),subscribeAll:()=>s("session:subscribeAll"),lockRover:(T,N)=>s("session:lockRover",{roverId:T,locked:N}),setMode:T=>s("setMode",{mode:T}),homeAssistantToggle:T=>s("homeAssistant:toggle",{entityId:T}),homeAssistantSetState:(T,N)=>s("homeAssistant:setState",{entityId:T,state:N}),setNickname:T=>s("nickname:set",{nickname:T}),pushAlert:T=>y(N=>[...N.slice(-49),{...T,receivedAt:Date.now(),id:T.id||Math.random().toString(36).slice(2)}])}),[s]),w=p.useMemo(()=>({connected:g,session:r,logs:d,alerts:v,...A}),[A,v,g,d,r]);return o.jsx(g0.Provider,{value:w,children:l})}function Ge(){return p.useContext(g0)}const v0=p.createContext({frames:{}});function $b({children:l}){const i=Sa(),[s,r]=p.useState({});p.useEffect(()=>{function d({roverId:m,sensors:v={},frame:y={}}){m&&r(g=>({...g,[m]:{roverId:m,sensors:v,raw:y?.data||null,receivedAt:Date.now()}}))}return i.on("sensorFrame",d),()=>{i.off("sensorFrame",d)}},[i]);const f=p.useMemo(()=>({frames:s}),[s]);return o.jsx(v0.Provider,{value:f,children:l})}function Co(){return p.useContext(v0).frames}function mr(l){const i=Co();return l?i[l]??null:null}function To(){const{connected:l,session:i}=Ge(),s=i?.assignment?.roverId,r=mr(s),f=r?.sensors||{},d=f.voltageMv!=null?`${(f.voltageMv/1e3).toFixed(2)} V`:null,m=f.currentMa!=null?`${f.currentMa} mA`:null,v=f.batteryTemperatureC!=null?`${f.batteryTemperatureC} °C`:null,y=f.batteryChargeMah,g=f.batteryCapacityMah,b=r?.receivedAt?new Date(r.receivedAt).toLocaleTimeString():null,A=r?.raw?r.raw:null,w=s?i?.activeDrivers?.[s]:null,T=p.useMemo(()=>s?w?w===i?.socketId?"You":(i?.users||[]).find(E=>E.socketId===w)?.nickname||w.slice(0,6):"Available":"n/a",[w,s,i?.socketId,i?.users]);return o.jsxs("section",{className:"panel-section space-y-0.5 text-base text-slate-100",children:[o.jsxs("div",{className:"text-sm text-slate-400",children:[o.jsx("span",{children:l?"online":"offline"}),o.jsxs("span",{children:[" · role ",i?.role||"unknown"]}),o.jsxs("span",{children:[" · mode ",i?.mode||"--"]}),b&&o.jsxs("span",{children:[" · sensors ",b]}),o.jsxs("span",{children:[" · driver ",T]})]}),s?r?o.jsxs(o.Fragment,{children:[o.jsx(Wb,{sensors:f,voltage:d,current:m,batteryTemp:v,charge:y,capacity:g}),o.jsx(Ib,{sensors:f})]}):o.jsx("p",{className:"text-sm text-slate-500",children:"Waiting for sensor frames…"}):o.jsx("p",{className:"text-sm text-slate-500",children:"Assign a rover to view sensors."}),A&&o.jsx("pre",{className:"surface whitespace-pre-wrap break-words text-xs text-lime-300",children:A})]})}function Wb({sensors:l,voltage:i,current:s,batteryTemp:r,charge:f,capacity:d}){const m=f!=null&&d?`${Math.round(f/d*100)}%`:"--",v=l?.oiMode?.label||"--",y=l?.chargingSources?.homeBase?"Yes":"No",g=l?.chargingState?.label||"--";return o.jsxs("div",{className:"grid grid-cols-2 gap-0.5 md:grid-cols-3",children:[o.jsx(An,{label:"Voltage",value:i??"--"}),o.jsx(An,{label:"Current",value:s??"--"}),o.jsx(An,{label:"Battery temp",value:r??"--"}),o.jsx(An,{label:"Charge",value:f!=null?`${f} mAh`:"--"}),o.jsx(An,{label:"Capacity",value:d!=null?`${d} mAh`:"--"}),o.jsx(An,{label:"Charge %",value:m}),o.jsx(An,{label:"OI mode",value:v}),o.jsx(An,{label:"Docked",value:y}),o.jsx(An,{label:"Charging state",value:g})]})}function An({label:l,value:i}){return o.jsxs("div",{className:"surface flex items-center justify-between gap-0.5 px-1 py-0.5 text-sm",children:[o.jsx("span",{className:"text-slate-400",children:l}),o.jsx("span",{className:"text-slate-100",children:i})]})}function Ib({sensors:l}){const i=l?.bumpsAndWheelDrops||{},s=l?.wheelOvercurrents||{},r=[{label:"Left",value:l?.lightBumpLeftSignal},{label:"Front Left",value:l?.lightBumpFrontLeftSignal},{label:"Center Left",value:l?.lightBumpCenterLeftSignal},{label:"Center Right",value:l?.lightBumpCenterRightSignal},{label:"Front Right",value:l?.lightBumpFrontRightSignal},{label:"Right",value:l?.lightBumpRightSignal}],f=[{label:"Left",value:l?.cliffLeftSignal,active:l?.cliffLeft},{label:"Front Left",value:l?.cliffFrontLeftSignal,active:l?.cliffFrontLeft},{label:"Front Right",value:l?.cliffFrontRightSignal,active:l?.cliffFrontRight},{label:"Right",value:l?.cliffRightSignal,active:l?.cliffRight}],d=[{label:"Wheel L",value:l?.wheelLeftCurrentMa,over:s.leftWheel},{label:"Wheel R",value:l?.wheelRightCurrentMa,over:s.rightWheel},{label:"Side brush",value:l?.sideBrushCurrentMa,over:s.sideBrush},{label:"Main brush",value:l?.mainBrushCurrentMa,over:s.mainBrush}];return o.jsxs("div",{className:"grid gap-0.5 md:grid-cols-2",children:[o.jsxs(ci,{title:"Bumps & drops",children:[o.jsx(Sn,{label:"Bump L",value:o.jsx(oi,{active:i.bumpLeft})}),o.jsx(Sn,{label:"Bump R",value:o.jsx(oi,{active:i.bumpRight})}),o.jsx(Sn,{label:"Wheel drop L",value:o.jsx(oi,{active:i.wheelDropLeft,tone:"amber"})}),o.jsx(Sn,{label:"Wheel drop R",value:o.jsx(oi,{active:i.wheelDropRight,tone:"amber"})})]}),o.jsx(ci,{title:"Light bumps (raw)",children:r.map(m=>o.jsx(Sn,{label:m.label,value:fi(m.value)},m.label))}),o.jsx(ci,{title:"Cliff sensors",children:f.map(m=>o.jsx(Sn,{label:m.label,value:`${fi(m.value)} · ${m.active?"bool: true":"bool: false"}`},m.label))}),o.jsx(ci,{title:"Currents",children:d.map(m=>o.jsx(Sn,{label:m.label,value:o.jsxs("span",{className:"flex items-center gap-0.5",children:[o.jsx("span",{children:fi(m.value,"mA")}),m.over?o.jsx(oi,{active:!0,tone:"red",label:"over"}):null]})},m.label))}),o.jsxs(ci,{title:"Dirt detect",children:[o.jsx(Sn,{label:"Left",value:fi(l?.dirtDetectLeft)}),o.jsx(Sn,{label:"Right",value:fi(l?.dirtDetect)})]})]})}function ci({title:l,children:i}){return o.jsxs("div",{className:"surface space-y-0.5 p-1 text-sm",children:[o.jsx("div",{className:"text-[0.8rem] uppercase tracking-wide text-slate-400",children:l}),o.jsx("div",{className:"space-y-0.5",children:i})]})}function Sn({label:l,value:i}){return o.jsxs("div",{className:"flex items-center justify-between gap-1",children:[o.jsx("span",{className:"text-slate-300",children:l}),o.jsx("span",{className:"text-slate-100",children:i})]})}function oi({active:l,tone:i="green",label:s}){const r="rounded px-1.5 py-0.5 text-[0.7rem] font-semibold",f=i==="red"?l?"bg-red-600 text-white":"bg-slate-700 text-slate-300":i==="amber"?l?"bg-amber-500 text-slate-900":"bg-slate-700 text-slate-300":l?"bg-emerald-600 text-white":"bg-slate-700 text-slate-300";return o.jsx("span",{className:`${r} ${f}`,children:s||(l?"true":"false")})}function fi(l,i){return l==null||Number.isNaN(l)?"--":i?`${l} ${i}`:l}const Gc={main:[-127,127],side:[-127,127],vacuum:[0,127]},Xc={maxSpeed:500,baseSpeed:250,boostSpeed:400},ro=100,wo=[31,127],rl=60,uo=8,Pb=250,e1={start:[128],safe:[131],full:[132],passive:[128],dock:[143]},hi={driveForward:["w"],driveBackward:["s"],driveLeft:["a"],driveRight:["d"],boostModifier:["\\"],slowModifier:["shift"],auxMainForward:["i"],auxMainReverse:["k"],auxSideForward:["o"],auxSideReverse:["l"],auxVacuumFast:["p"],auxVacuumSlow:[";"],auxAllForward:[","],cameraUp:["u"],cameraDown:["j"],nightVisionToggle:["e"],driveMacro:["f"],dockMacro:["g"],chatFocus:["enter"],songNoteUp:["ArrowUp"],songNoteDown:["ArrowDown"]},x0=[{id:"drive-sequence",label:"Drive",description:"Start, dock, and full command sequence used by the drive button.",steps:[{type:"oi",command:"start"},{type:"pause",duration:ro},{type:"oi",command:"dock"},{type:"pause",duration:ro},{type:"oi",command:"full"}]},{id:"seek-dock",label:"Dock",description:"Send the seek dock command.",steps:[{type:"oi",command:"dock"}]}];function co(){return{vector:{x:0,y:0,boost:!1},speeds:{left:0,right:0},source:null,lastUpdatedAt:0}}function oo(){return{main:0,side:0,vacuum:0}}function t1(){return{enabled:!1,angle:null,config:null}}function lr(){return{note:rl}}const fp={roverId:null,mode:"drive",drive:co(),aux:oo(),camera:t1(),song:lr(),macros:x0,keymap:hi,inputs:{}};function n1(l,i){switch(i.type){case"control/set-rover":return{...l,roverId:i.payload??null,drive:i.payload?l.drive:co(),aux:i.payload?l.aux:oo(),song:i.payload?l.song:lr()};case"control/set-mode":return l.mode===i.payload?l:{...l,mode:i.payload==="dock"?"dock":"drive"};case"control/update-drive":{const{vector:s,speeds:r,source:f}=i.payload;return{...l,drive:{vector:s??l.drive.vector,speeds:r??l.drive.speeds,source:f??l.drive.source,lastUpdatedAt:Date.now()}}}case"control/set-aux-motors":return{...l,aux:{...l.aux,...i.payload}};case"control/set-camera-config":return{...l,camera:{...l.camera,enabled:!!i.payload?.config,config:i.payload?.config??null,angle:typeof i.payload?.angle=="number"?i.payload.angle:i.payload?.config?i.payload.config.homeAngle??l.camera.angle:null}};case"control/set-camera-angle":return{...l,camera:{...l.camera,angle:i.payload}};case"control/register-input-state":{const s=i.payload?.source||"unknown";return{...l,inputs:{...l.inputs,[s]:{...l.inputs[s]??{},...i.payload?.state,updatedAt:Date.now()}}}}case"control/set-keymap":return{...l,keymap:{...l.keymap,...i.payload??{}}};case"control/set-macros":return{...l,macros:Array.isArray(i.payload)?i.payload:l.macros};case"control/reset":return{...l,drive:co(),aux:oo(),song:lr()};case"control/set-song-note":return{...l,song:{...l.song||lr(),note:i.payload??rl}};default:return l}}function ul(l,i,s){return typeof l!="number"||Number.isNaN(l)?i:Math.max(i,Math.min(s,l))}function En(l){return typeof l!="number"||Number.isNaN(l)?0:Math.max(-1,Math.min(1,l))}function ga(l,i){return!Array.isArray(i)||i.length!==2?l:ul(l,i[0],i[1])}function a1(l={}){const i=En(l.x??0),s=En(l.y??0);return{x:i,y:s,boost:!!l.boost}}function l1(l={},i={}){const s=a1(l),r=typeof i.maxSpeed=="number"?i.maxSpeed:Xc.maxSpeed,f=typeof i.baseSpeed=="number"?i.baseSpeed:Xc.baseSpeed,d=typeof i.boostSpeed=="number"?i.boostSpeed:Xc.boostSpeed,m=s.boost?d:f,v=s.y*m,y=s.x*m;return{vector:s,speeds:{left:ul(Math.round(v+y),-r,r),right:ul(Math.round(v-y),-r,r)}}}function i1(l){const i=Array.isArray(l)?l:[],s=String.fromCharCode(...i);if(typeof btoa=="function")return btoa(s);if(typeof Buffer<"u")return Buffer.from(i).toString("base64");throw new Error("No base64 encoder available")}function dp(l){return new Promise(i=>setTimeout(i,l))}function s1(){const l=Sa(),{session:i}=Ge(),s=i?.assignment?.roverId,r=p.useMemo(()=>!s||!Array.isArray(i?.roster)?null:i.roster.find(E=>String(E.id)===String(s))||null,[s,i?.roster]),f=p.useMemo(()=>!r?.cameraServo||!r.cameraServo.enabled?null:r.cameraServo,[r]),d=p.useMemo(()=>!r?.nightVision||!r.nightVision.enabled?null:r.nightVision,[r]),m=p.useCallback((E,j)=>{s&&l.emit("command",{roverId:s,...E},j)},[l,s]),v=p.useCallback(()=>{s&&m({type:"sensorStream",data:{sensorStream:{enable:!0}}})},[m,s]),y=p.useCallback(E=>{if(!s)return null;const j={left:ga(E?.left??0,[-500,500]),right:ga(E?.right??0,[-500,500])};return m({type:"drive",data:{driveDirect:j}}),j},[m,s]),g=p.useCallback(({main:E=0,side:j=0,vacuum:M=0}={})=>{if(!s)return null;const O={main:ga(E,Gc.main),side:ga(j,Gc.side),vacuum:ga(M,Gc.vacuum)};return m({type:"motors",data:{motorPwm:O}}),O},[m,s]),b=p.useCallback(E=>!s||!f?null:(m({type:"servo",data:{servo:{angle:E}}}),E),[m,s,f]),A=p.useCallback(E=>{if(!s)return!1;const j=Array.isArray(E)?E:typeof E=="string"?e1[E]:null;return j?(m({type:"raw",data:{raw:i1(j)}}),v(),!0):!1},[m,v,s]),w=p.useCallback(async E=>{if(!(!E||!Array.isArray(E.steps)||!s))for(const j of E.steps){if(!s)break;switch(j.type){case"oi":A(j.command);break;case"drive":y(j.speeds??{left:0,right:0});break;case"motors":g(j.values??{});break;case"servo":b(j.angle);break;case"pause":await dp(j.duration??ro);break}if(j.delay||j.delayMs){const M=j.delayMs??j.delay;typeof M=="number"&&M>0&&await dp(M)}}},[s,A,y,g,b]),T=p.useCallback((E="toggle")=>!s||!d?null:(m({type:"nightVision",data:{nightVision:{action:E}}}),E),[m,d,s]),N=p.useCallback((E=[],j={})=>{if(!s)return null;const O=(Array.isArray(E)&&E.length>0?E:[{note:rl,duration:uo}]).slice(0,16).map(X=>({note:ga(Math.round(X?.note??rl),wo),duration:ga(Math.round(X?.duration??uo),[1,255])}));return m({type:"song",data:{song:{notes:O,slot:j.slot,loop:j.loop}}}),O},[m,s]);return p.useMemo(()=>({roverId:s,rosterEntry:r,servoConfig:f,nightVision:d,emitCommand:m,enableSensorStream:v,sendDriveDirect:y,sendAuxMotors:g,sendServoAngle:b,sendOiCommand:A,sendNightVision:T,sendSong:N,runMacroSteps:w}),[s,r,f,d,m,v,y,g,b,A,T,w])}const r1={"{":"[","}":"]",":":";",'"':"'","<":",",">":".","?":"/","|":"\\",_:"-","+":"="},hp={"[":"BracketLeft","]":"BracketRight","\\":"Backslash",";":"Semicolon","'":"Quote",",":"Comma",".":"Period","/":"Slash","-":"Minus","=":"Equal","`":"Backquote"};function qi(l){if(typeof l!="string")return"";const i=l.toLowerCase();return r1[i]??i}function u1(l){const i=qi(l);if(!i)return null;if(hp[i])return hp[i];if(i.length===1){if(/[a-z]/.test(i))return`Key${i.toUpperCase()}`;if(/[0-9]/.test(i))return`Digit${i}`}return null}function b0(l){const i=qi(l);return i?`key:${i}`:null}function c1(l){const i=u1(l);return i?`code:${i}`:null}function mp(l){const i=new Set,s=b0(l?.key??"");s&&i.add(s);const r=l?.code?`code:${l.code}`:null;return r&&i.add(r),Array.from(i)}function o1(l={}){return Object.fromEntries(Object.entries(l).map(([i,s])=>{const r=Array.isArray(s)?s:[s],f=new Set;return r.forEach(d=>{const m=b0(String(d));m&&f.add(m);const v=c1(String(d));v&&f.add(v)}),[i,f]}))}function pi(l){const i=qi(l);return i?i===" "?"Space":i==="\\"?"Backslash":i==="`"?"Backtick":i==="["?"[ or {":i==="]"?"] or }":i===";"?"; or :":i==="'"?`' or "`:i===","?", or <":i==="."?". or >":i==="/"?"/ or ?":i==="-"?"- or _":i==="="?"= or +":i==="arrowup"?"Arrow Up":i==="arrowdown"?"Arrow Down":i==="arrowleft"?"Arrow Left":i==="arrowright"?"Arrow Right":i.length===1?i.toUpperCase():i:"—"}const A0="roverSettings",f1=3600*24*365;function d1(l){try{const i=decodeURIComponent(l??"");return JSON.parse(i)}catch(i){return console.warn("Failed to parse settings cookie",i),null}}function pp(){if(typeof document>"u")return{};const l=`${A0}=`,i=document.cookie.split(";").map(r=>r.trim()).find(r=>r.startsWith(l));if(!i)return{};const s=i.substring(l.length);return d1(s)??{}}function yp(l){if(typeof document>"u")return!1;try{const i=encodeURIComponent(JSON.stringify(l??{})),s=`${A0}=${i}; path=/; max-age=${f1}; samesite=strict`;return document.cookie=s,!0}catch(i){return console.warn("Failed to write settings cookie",i),!1}}const S0=p.createContext(null);function Mo({children:l}){const[i,s]=p.useState(()=>({status:"loading",data:{}}));p.useEffect(()=>{const v=pp();s({status:"ready",data:v??{}})},[]);const r=p.useCallback(()=>{const v=pp();s({status:"ready",data:v??{}})},[]),f=p.useCallback(v=>{const y=yp(v??{});return s(y?{status:"ready",data:v??{}}:g=>({...g,status:"error"})),y},[]),d=p.useCallback((v,y)=>{s(g=>{const b=g.data[v]||{},A=typeof y=="function"?y(b):{...b,...y??{}},w={...g.data,[v]:A};return yp(w)?{status:"ready",data:w}:{...g,status:"error"}})},[]),m=p.useMemo(()=>({data:i.data,status:i.status,reload:r,saveAll:f,setNamespace:d}),[i,r,f,d]);return o.jsx(S0.Provider,{value:m,children:l})}function h1(){const l=p.useContext(S0);if(!l)throw new Error("useSettings must be used within SettingsProvider");return l}function Ht(l,i={}){const{data:s,status:r,setNamespace:f}=h1(),d=s[l]??i??{},m=p.useCallback(g=>{f(l,b=>{const A=b??{};return typeof g=="function"?g(A):{...A,...g??{}}})},[l,f]),v=p.useCallback(g=>{f(l,()=>g??{})},[l,f]),y=p.useCallback(()=>{const g=typeof i=="object"?{...i}:i;f(l,()=>g??{})},[i,l,f]);return{value:d,status:r,save:m,replace:v,reset:y}}const q0=p.createContext(null);function gp(l){return Object.fromEntries(Object.entries(l||{}).map(([i,s])=>[i,Array.isArray(s)?[...s]:[]]))}function m1(l,i){if(!l)return i;const s=typeof l.minAngle=="number"?l.minAngle:-45,r=typeof l.maxAngle=="number"?l.maxAngle:45;return ul(i,s,r)}function p1({children:l}){const i=s1(),[s,r]=p.useReducer(n1,fp),f=p.useRef(null),d=p.useRef(!1),m=p.useRef(fp.camera.angle),{value:v,save:y}=Ht("controls",{keymap:hi,macros:x0}),{session:g,homeAssistantSetState:b}=Ge(),A=p.useCallback(()=>{const ne=(g?.homeAssistant?.entities||[]).filter(J=>(J.type==="light"||J.type==="switch")&&J.available!==!1&&J.state!=="on");if(ne.length===0){d.current=!1;return}d.current=!0,ne.forEach(J=>{b(J.id,"on").catch(()=>{})}),d.current=!1},[g?.homeAssistant?.entities,b]);p.useEffect(()=>{r({type:"control/set-rover",payload:i.roverId})},[i.roverId]),p.useEffect(()=>{const Z=f.current;f.current=s.mode,Z!=="drive"&&s.mode==="drive"&&g?.homeAssistant?.entities?A():Z!=="drive"&&s.mode==="drive"&&(d.current=!0)},[s.mode,g?.homeAssistant?.entities,A]),p.useEffect(()=>{d.current&&g?.homeAssistant?.entities&&A()},[g?.homeAssistant?.entities,A]),p.useEffect(()=>{const Z={...hi,...v?.keymap||{}};r({type:"control/set-keymap",payload:Z}),v?.macros&&r({type:"control/set-macros",payload:v.macros})},[v?.keymap,v?.macros]),p.useEffect(()=>{const Z=i.servoConfig;if(!Z){r({type:"control/set-camera-config",payload:{config:null}}),m.current=null;return}const ne=typeof Z.minAngle=="number"?Z.minAngle:-45,J=typeof Z.maxAngle=="number"?Z.maxAngle:45,z=typeof Z.homeAngle=="number"?Z.homeAngle:(ne+J)/2,G=typeof m.current=="number"?ul(m.current,ne,J):null,ae=G??ul(z,ne,J);r({type:"control/set-camera-config",payload:{config:Z,angle:ae}}),m.current=ae},[i.servoConfig]),p.useEffect(()=>{m.current=typeof s.camera.angle=="number"?s.camera.angle:m.current},[s.camera.angle]),p.useEffect(()=>{i.roverId&&i.enableSensorStream()},[i.roverId,i.enableSensorStream]);const w=p.useCallback(Z=>{r({type:"control/set-mode",payload:Z})},[]),T=p.useCallback((Z,ne={})=>{const J=l1(Z,ne.speedOptions);r({type:"control/update-drive",payload:{...J,source:ne.source??null}}),i.sendDriveDirect(J.speeds)},[i]),N=p.useCallback((Z={})=>{const ne=i.sendAuxMotors(Z)??Z;r({type:"control/set-aux-motors",payload:ne})},[i]),E=p.useCallback((Z,ne)=>{if(!Z)return!1;const J=qi(ne);if(!J)return!1;const z=gp(s.keymap);return z[Z]=[J],r({type:"control/set-keymap",payload:z}),y(G=>({...G??{},keymap:z})),!0},[s.keymap,y]),j=p.useCallback(()=>{const Z=gp(hi);r({type:"control/set-keymap",payload:Z}),y(ne=>({...ne??{},keymap:Z}))},[y]),M=p.useCallback(Z=>{if(!i.servoConfig)return;const ne=m1(i.servoConfig,Z);r({type:"control/set-camera-angle",payload:ne}),i.sendServoAngle(ne),m.current=ne},[i]),O=p.useCallback((Z=0)=>{const ne=i.servoConfig;if(!ne)return;const J=typeof Z=="number"&&Z!==0?Z:ne.nudgeDegrees||1,z=typeof m.current=="number"?m.current:typeof ne.homeAngle=="number"?ne.homeAngle:0;M(z+J)},[i.servoConfig,M]),X=p.useCallback(()=>{const Z=i.servoConfig;if(!Z)return;const ne=typeof Z.homeAngle=="number"?Z.homeAngle:typeof Z.minAngle=="number"&&typeof Z.maxAngle=="number"?(Z.minAngle+Z.maxAngle)/2:0;M(ne)},[i.servoConfig,M]),I=p.useCallback(async Z=>{const ne=s.macros.find(J=>J.id===Z)||null;ne&&(Z==="drive-sequence"&&(A(),g?.homeAssistant?.entities||(d.current=!0)),await i.runMacroSteps(ne))},[i,s.macros,g?.homeAssistant?.entities,A]),F=p.useCallback(()=>{r({type:"control/update-drive",payload:{vector:{x:0,y:0,boost:!1},speeds:{left:0,right:0},source:"system-stop"}}),i.sendDriveDirect({left:0,right:0}),i.sendAuxMotors({main:0,side:0,vacuum:0})},[i]),$=p.useCallback(Z=>{i.sendOiCommand(Z)},[i]),V=p.useCallback(Z=>{i.roverId&&i.emitCommand({type:"sensorStream",data:{sensorStream:{enable:Z}}})},[i]),W=p.useCallback(()=>{i.sendNightVision("toggle")},[i]),te=p.useCallback(Z=>{const ne=typeof Z=="number"?Z:rl;return r({type:"control/set-song-note",payload:ne}),ne},[]),oe=p.useCallback((Z,ne)=>i.sendSong(Z,ne),[i]),be=p.useCallback((Z,ne)=>{r({type:"control/register-input-state",payload:{source:Z,state:ne}})},[]),qe=p.useMemo(()=>({state:s,dispatch:r,pipeline:i,actions:{setMode:w,setDriveVector:T,setAuxMotors:N,setServoAngle:M,nudgeServo:O,goServoHome:X,runMacro:I,stopAllMotion:F,sendOiCommand:$,setSensorStream:V,toggleNightVision:W,updateKeyBinding:E,resetKeyBindings:j,registerInputState:be,setSongNote:te,sendSong:oe}}),[s,i,w,T,N,M,O,X,I,F,$,V,W,E,j,be,te,oe]);return o.jsx(q0.Provider,{value:qe,children:l})}function Vt(){const l=p.useContext(q0);if(!l)throw new Error("useControlSystem must be used within ControlSystemProvider");return l}const y1="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAANAAAIpQBKSkpKSkpKXFxcXFxcXFxra2tra2tra3p6enp6enqJiYmJiYmJiZiYmJiYmJiYpqampqamprW1tbW1tbW1xMTExMTExMTT09PT09PT4uLi4uLi4uLx8fHx8fHx8f////////8AAABQTEFNRTMuMTAwBLkAAAAAAAAAABUgJAUYQQAB4AAACKVpqtMZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//ugxAAAwqQPR8CIwCh0BCj5jDwlIAAjW87wAACcOsAKPMk8ARj8w9OAWwNlV/gCgQMHEhAOVnFaNzWWAPI2zyjHjd8FAoKqyAa88AAAAABNjEd9CQOglIY9dtC+a51bGZrZgTewD3c+AAYx5hxIMheIcudKAyaykG1/h5EsPB0iTEFNRTMuMTAwqqqqqqrIBZqvAAAAAC9JXFIAHrCgAp0D0hUYOInIluqg1TNdKCzMeAAFQCKKsxUmVfireKILLBgSVgb4qBVtPWpMQU1FMy4xMDCqqqqqqqqqqqqqqqqpApm/AAAAAC7QYaHPHoCjkCysmc+QY9NNWRbKE+mqowNobwAAoSQQMLGChDlOrKMqVMC/6xy/CXbFaL7AZUxBTUUzLjEwMFVVVVVVVVVVVacDqZ8AAAAAMgzaYFBPNgIOnVCQfFfwmBBhLVNJQSdxdQRofwAGxF9xAAYs4AZDuE87li0YCASIBwaCiXUj+2BqTEFNRTMuMTAwqqqqqqqqlwOonwAAAAAtkABQSEZ1INNDgx8HeaaLCXiu5dqSciylQNXjv8GdmACQ5ogYKbnsmxkoChog+w9IhU6GsgzCIQBSxFpMQQAAMBiHjgAAAAv6FQQILmJmGLltnax9HszIVEAoEq1p8olpcPLlGpXFastuWosKNFlmlqADJbwAEFRI4iJJy0oDumUW//sgxOEAw5wfU8fnAGBvg6n5nDxUh7QuwcEzkK5Ztz7AZUxBTUUzLjEwMFVVVVVVVZUAhd8AAAAALZAAamQMWKtC7Avib0WLplt2IAp0SKV0pFFxCADLX6AIPFrWJIBQqPGW/x0QDTRLGaQYCRAZzKeoU6uqTEFN6AB3n/7wAAAxq//7EMT0AMPUHU/MawJgc4PpuYy8VQZjocBw2OgQQyQyECnbABEUC/ZoM0J56Jm0tqzNJaq8KospqUAQ5/QBghnCqQAhR4Mz1D1gJPstYsI1sYIg079I5cYjY6pMQU1FMy4xMDCqqqqq//sQxPUAw+AdT8zvAih6hCk5nWBFqqqWAFOf4AAAAEAIQZPkMcwUzFVE51cSBjIHpJRIEIjWgGar9VhgCUvwAFAUMk0RCpMkwXjPQDcoLBU+n5RuR4ZrPQLPckxBTUUzLjEwMKqqqqr/+xDE9oDEAB1NzG8CKIGEKPmd5EWqxgBWn9AAAAAKIiC5GcLJIczCEvNbWsF31jo4Bw0rXktvJF5YRyABlj+ABIQ2RGsHgdc0XsPntoEDUzaQOjTBqblFPUE1TEFNRckAt68AAAAALv/7EMT4AMQIHU3M7wIojwUo+Y2MZfAgKcwITAQIYN1TosJeLtDA0ubWNrFSADJoln4AC0hVaLiIIUChs+4HST4BgCpQHITPMBQkEnj73ORZfylh+sRLEGUiNIpMQU1FMy4xMDCqqqqq//sQxP6AxlgtK+13Yih3hCj5neBNqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqrIkT7UNAZ7NS7yMqcihSKLMn8DlKYq8ZdPCVEoJBuWqkxBTUUzLjEwMKqqqqr/+xDE+ADEXCVHzGjDIIQEqLm9PIWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EMT+AMWoL0XNcwJoiASoeY3gVaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq//sQxPgAxHAnRcxvAmiBBKj5jehEqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xDE+IDEmCVDzPMCKH6EqLmNYE2qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EMT9gEPgI0vMZwQgvYWlPY5gFaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq//sQxOYDw+gpIIfgwWgAADSAAAAEqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=",E0=p.createContext({messages:[],sendMessage:async()=>{},focusChat:()=>{},blurChat:()=>{},registerInputRef:()=>{},onInputFocus:()=>{},onInputBlur:()=>{},isChatFocused:!1});function g1({children:l}){const i=Sa(),{session:s}=Ge(),[r,f]=p.useState([]),[d,m]=p.useState(!1),v=p.useRef(null),y=p.useRef(null);p.useEffect(()=>{y.current=new Audio(y1),y.current.load()},[]);const g=p.useCallback(()=>{const M=y.current;M&&(M.currentTime=0,M.play().catch(()=>{}))},[]);p.useEffect(()=>{function M(O={}){f(X=>[...X.slice(-99),O]),!(O?.socketId&&s?.socketId&&O.socketId===s.socketId)&&g()}return i.on("chat:message",M),()=>{i.off("chat:message",M)}},[g,s?.socketId,i]);const b=p.useCallback((M,O=null)=>new Promise((X,I)=>{i.emit("chat:send",{text:M,tts:O},(F={})=>{F.error?I(new Error(F.error)):X(F)})}),[i]),A=p.useCallback(M=>{v.current=M},[]),w=p.useCallback(()=>{m(!0),v.current?.focus()},[]),T=p.useCallback(()=>{m(!1),v.current?.blur()},[]),N=p.useCallback(()=>m(!0),[]),E=p.useCallback(()=>m(!1),[]),j=p.useMemo(()=>({messages:r,sendMessage:b,focusChat:w,blurChat:T,registerInputRef:A,onInputFocus:N,onInputBlur:E,isChatFocused:d,selfSocketId:s?.socketId||null}),[T,w,d,r,E,N,A,b,s?.socketId]);return o.jsx(E0.Provider,{value:j,children:l})}function j0(){const l=p.useContext(E0);if(!l)throw new Error("useChat must be used inside ChatProvider");return l}const ct={keyboard:{baseSpeed:250,turboSpeed:400,precisionSpeed:125,tiltSpeed:80,tiltIntervalMs:110},gamepad:{driveDeadzone:.2,cameraDeadzone:.25,servoStep:2,auxReverseScale:.55}},rr={drive:{horizontal:null,vertical:null},camera:{vertical:null},brushes:{mainAxis:null,sideAxis:null},buttons:{allAux:null,vacuum:null,mainReverse:null,sideReverse:null,dock:null,drive:null}},Kc="keyboard",Zc={x:0,y:0,boost:!1},Jc={main:0,side:0,vacuum:0},vp=wo[0],xp=wo[1],Ro=5,yi=500,gi=1,_o=100;function Fc(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(0,Math.min(500,s)):i}function v1(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(Ro,Math.min(yi,s)):i}function N0(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(gi,Math.min(_o,s)):i}function x1(l){const s=(N0(l,l)-gi)/(_o-gi),r=yi-s*(yi-Ro);return Math.round(r)}function b1(l){const i=v1(l,l),s=(yi-i)/(yi-Ro),r=gi+s*(_o-gi);return Math.round(r)}function A1(l){const i=l.target;if(!i)return!1;const s=i.tagName;return s==="INPUT"||s==="TEXTAREA"||i.isContentEditable||s==="SELECT"}function Ie(l,i){if(!l||l.size===0)return!1;for(const s of i)if(l.has(s))return!0;return!1}function S1(l,i){const s=Ie(i.driveForward,l),r=Ie(i.driveBackward,l),f=Ie(i.driveLeft,l),d=Ie(i.driveRight,l),m=Ie(i.boostModifier,l),v=Ie(i.slowModifier,l);let y=0;s&&!r?y=1:r&&!s&&(y=-1);let g=0;f&&!d?g=-1:d&&!f&&(g=1);const b=v?.4:1;return{x:g*b,y:y*b,boost:m&&!v}}function q1(l,i){if(Ie(i.auxAllForward,l))return{main:127,side:127,vacuum:127};const r=Ie(i.auxMainForward,l)?127:Ie(i.auxMainReverse,l)?-127:0,f=Ie(i.auxSideForward,l)?127:Ie(i.auxSideReverse,l)?-70:0,d=Ie(i.auxVacuumFast,l)?127:Ie(i.auxVacuumSlow,l)?50:0;return{main:r,side:f,vacuum:d}}function E1(){const{state:l,actions:{setMode:i,setDriveVector:s,setAuxMotors:r,nudgeServo:f,runMacro:d,stopAllMotion:m,registerInputState:v,toggleNightVision:y,setSongNote:g,sendSong:b}}=Vt(),{focusChat:A,blurChat:w,isChatFocused:T}=j0(),{value:N}=Ht("inputs",ct),E=p.useMemo(()=>o1(l.keymap),[l.keymap]),j=p.useMemo(()=>{const ee=new Set;return Object.values(E).forEach(se=>{se&&se.forEach(S=>ee.add(S))}),ee},[E]),M=p.useMemo(()=>{const ee=ct.keyboard,se=N?.keyboard??{};return{baseSpeed:Fc(se.baseSpeed,ee.baseSpeed),turboSpeed:Fc(se.turboSpeed,ee.turboSpeed),precisionSpeed:Fc(se.precisionSpeed,ee.precisionSpeed)}},[N?.keyboard]),O=p.useMemo(()=>{const ee=ct.keyboard,se=N?.keyboard??{},S=N0(typeof se.tiltSpeed=="number"?se.tiltSpeed:typeof se.tiltIntervalMs=="number"?b1(se.tiltIntervalMs):ee.tiltSpeed,ee.tiltSpeed);return x1(S)},[N?.keyboard]),X=p.useMemo(()=>Math.abs(l.camera?.config?.nudgeDegrees||1),[l.camera?.config?.nudgeDegrees]),I=p.useRef(new Set),F=p.useRef(Zc),$=p.useRef(Jc),V=p.useRef(null),W=p.useRef(null),te=p.useCallback(()=>{const ee=new Set(I.current);Ie(E.boostModifier,ee);const S=Ie(E.slowModifier,ee)?{baseSpeed:M.precisionSpeed,boostSpeed:M.precisionSpeed}:{baseSpeed:M.baseSpeed,boostSpeed:M.turboSpeed},U=S1(ee,E),Q=q1(ee,E);(U.x!==F.current.x||U.y!==F.current.y||U.boost!==F.current.boost)&&(F.current=U,s(U,{source:Kc,speedOptions:S})),(Q.main!==$.current.main||Q.side!==$.current.side||Q.vacuum!==$.current.vacuum)&&($.current=Q,r(Q)),v(Kc,{keys:Array.from(ee),vector:U,aux:Q})},[E,M,v,r,s]),oe=p.useCallback(()=>{V.current&&(clearTimeout(V.current),V.current=null)},[]),be=p.useCallback(()=>{const ee=new Set(I.current),se=Ie(E.cameraUp,ee),S=Ie(E.cameraDown,ee);return(se?1:0)-(S?1:0)},[E]),qe=p.useCallback(()=>{if(be()===0){oe();return}if(V.current)return;const se=()=>{const S=be();if(S===0){oe();return}f(S*X),V.current=setTimeout(se,O)};V.current=setTimeout(se,0)},[be,f,O,X,oe]),Z=p.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=null)},[]),ne=p.useCallback(()=>{const ee=new Set(I.current),se=Ie(E.songNoteUp,ee),S=Ie(E.songNoteDown,ee);return(se?1:0)-(S?1:0)},[E]),J=p.useCallback(ee=>{if(ee===0)return;let S=(typeof l.song?.note=="number"?l.song.note:rl)+ee;S>xp?S=vp:S<vp&&(S=xp);const U=g(S);b([{note:U,duration:uo}],{slot:0})},[b,g,l.song?.note]),z=p.useCallback(()=>{if(ne()===0){Z();return}if(W.current)return;const se=()=>{const S=ne();if(S===0){Z();return}J(S),W.current=setTimeout(se,Pb)};W.current=setTimeout(se,0)},[ne,Z,J]),G=p.useCallback(()=>{I.current.clear(),F.current=Zc,$.current=Jc,oe(),Z(),m(),v(Kc,{keys:[],vector:Zc,aux:Jc})},[v,m,oe,Z]);p.useEffect(()=>{function ee(U){if(A1(U))return;const Q=mp(U);if(Q.length===0)return;const K=new Set(Q);if(Ie(E.chatFocus,K)){U.preventDefault(),G(),T?w():A();return}Q.some(re=>j.has(re))&&U.preventDefault();const P=Q.filter(re=>!I.current.has(re));P.forEach(re=>I.current.add(re)),P.length>0&&(P.some(re=>E.driveMacro?.has(re))?(i("drive"),d("drive-sequence")):P.some(re=>E.dockMacro?.has(re))?(i("dock"),d("seek-dock")):P.some(re=>E.nightVisionToggle?.has(re))&&y()),qe(),z(),te()}function se(U){mp(U).forEach(K=>I.current.delete(K)),qe(),z(),te()}function S(){G()}return window.addEventListener("keydown",ee),window.addEventListener("keyup",se),window.addEventListener("blur",S),()=>{window.removeEventListener("keydown",ee),window.removeEventListener("keyup",se),window.removeEventListener("blur",S)}},[j,w,te,qe,z,A,T,E.chatFocus,E.dockMacro,E.driveMacro,G,d,i,m,Z]);const ae=p.useRef(G);return p.useEffect(()=>{ae.current=G},[G]),p.useEffect(()=>{ae.current()},[l.roverId]),p.useEffect(()=>()=>{oe(),Z()},[oe,Z]),null}const Xs="gamepad";function $c(l,i){return Math.abs(l)<i?0:l}function bp(l,i){return l&&i&&l.x===i.x&&l.y===i.y&&l.boost===i.boost}function Ap(l,i){return l&&i&&l.main===i.main&&l.side===i.side&&l.vacuum===i.vacuum}function j1(){const{actions:{setMode:l,setDriveVector:i,setAuxMotors:s,nudgeServo:r,runMacro:f,registerInputState:d}}=Vt(),{value:m}=Ht("inputs",ct),{value:v}=Ht("gamepadMapping",rr),y=m.gamepad??ct.gamepad,g=Math.min(Math.max(y.driveDeadzone??.2,0),.8),b=Math.min(Math.max(y.cameraDeadzone??.25,0),.9),A=y.servoStep??ct.gamepad.servoStep,w=y.auxReverseScale??ct.gamepad.auxReverseScale,T=!!(v?.drive?.horizontal&&v?.drive?.vertical),N=!!v?.camera?.vertical,E=!!v?.brushes?.mainAxis,j=!!v?.brushes?.sideAxis,M=E||j,O=!!v?.buttons?.vacuum,X=!!v?.buttons?.allAux,I=O||X,F=!!v?.buttons?.mainReverse,$=!!v?.buttons?.sideReverse,V=F||$,W=!!v?.buttons?.drive,te=!!v?.buttons?.dock,be=T||N||M||I||V||(W||te),qe=p.useRef(null),Z=p.useRef({x:0,y:0,boost:!1}),ne=p.useRef({main:0,side:0,vacuum:0}),J=p.useRef(new Map),z=p.useRef(0),G=p.useRef({main:!1,side:!1}),ae=p.useCallback((Q,K)=>{const P=J.current.get(Q)||!1;return J.current.set(Q,K),K&&!P},[]),ee=p.useCallback((Q,K)=>{if(!K)return 0;const P=Q.axes?.[K.index]??0;return K.invert?-P:P},[]),se=p.useCallback((Q,K)=>{if(!K)return 0;const P=Q.buttons?.[K.index];return P?typeof P.value=="number"?P.value:P.pressed?1:0:0},[]),S=p.useCallback((Q,K)=>{if(!K)return!1;const P=Q.buttons?.[K.index];return P?P.pressed||P.value>.5:!1},[]),U=p.useCallback(()=>{if(typeof navigator>"u"||!navigator.getGamepads)return;const Q=navigator.getGamepads(),K=Q&&Array.from(Q).find(Boolean);if(!K){bp(Z.current,{x:0,y:0,boost:!1})||(Z.current={x:0,y:0,boost:!1},i({x:0,y:0,boost:!1},{source:Xs})),Ap(ne.current,{main:0,side:0,vacuum:0})||(ne.current={main:0,side:0,vacuum:0},s({main:0,side:0,vacuum:0})),d(Xs,{connected:!1,mappingReady:be});return}const P=T?En($c(ee(K,v.drive.horizontal),g)):0,re=T?En($c(-ee(K,v.drive.vertical),g)):0,me={x:P,y:re,boost:!1};bp(me,Z.current)||(Z.current=me,i(me,{source:Xs}));const Ze=E?ee(K,v.brushes.mainAxis):0,ke=Math.round(Math.min(Math.abs(Ze),1)*127),en=G.current.main?-ke:ke,tn=j?ee(K,v.brushes.sideAxis):0,pe=Math.round(Math.min(Math.abs(tn),1)*127),tt=G.current.side?-Math.round(pe*w):Math.round(pe*w),Ve=O&&S(K,v.buttons.vacuum)?127:0;let Ee={main:E?en:0,side:j?tt:0,vacuum:Ve};X&&S(K,v.buttons.allAux)&&(Ee={main:127,side:127,vacuum:127}),Ap(Ee,ne.current)||(ne.current=Ee,s(Ee));const ze=N?En($c(-ee(K,v.camera.vertical),b)):0,Me=performance.now();N&&Math.abs(ze)>.25&&Me-z.current>120&&(z.current=Me,r(ze>0?A:-A)),F&&ae("toggle-main",S(K,v.buttons.mainReverse))&&(G.current.main=!G.current.main),$&&ae("toggle-side",S(K,v.buttons.sideReverse))&&(G.current.side=!G.current.side),W&&ae(`macro-${v.buttons.drive.index}`,S(K,v.buttons.drive))&&(l("drive"),f("drive-sequence")),te&&ae(`macro-${v.buttons.dock.index}`,S(K,v.buttons.dock))&&(l("dock"),f("seek-dock")),d(Xs,{connected:!0,mappingReady:be,id:K.id,index:K.index,axes:[P,re,ze],reverse:{...G.current},bindings:{drive:T,camera:N,brushes:M,auxButtons:{vacuum:O,allAux:X},reverseButtons:{main:F,side:$},macros:{drive:W,dock:te}}})},[w,b,g,ee,se,ae,S,v.buttons?.allAux,v.buttons?.dock,v.buttons?.drive,v.buttons?.mainReverse,v.buttons?.sideReverse,v.buttons?.vacuum,v.camera?.vertical,v.drive?.horizontal,v.drive?.vertical,v.brushes?.mainAxis,v.brushes?.sideAxis,be,r,d,f,A,s,i,l]);return p.useEffect(()=>{function Q(){U(),qe.current=requestAnimationFrame(Q)}return qe.current=requestAnimationFrame(Q),()=>{qe.current&&cancelAnimationFrame(qe.current)}},[U]),null}function fo({sensors:l={},variant:i="full",size:s,overlay:r=!1}){const f=s||(i==="mini"?190:260),d=f/2,m=d*.8,v=m-4,y=m+4,g=m-14,b=m-6,A=m*.65,w=l?.bumpsAndWheelDrops||{},T=l?.wheelOvercurrents||{},N=l?.wheelLeftCurrentMa??0,E=l?.wheelRightCurrentMa??0,j=l?.sideBrushCurrentMa??0,M=l?.mainBrushCurrentMa??0,O=_1({count:6,totalSpan:140,gap:6,startAngle:-70}),X=["L","FL","CL","CR","FR","R"],I=[l?.lightBumpLeftSignal,l?.lightBumpFrontLeftSignal,l?.lightBumpCenterLeftSignal,l?.lightBumpCenterRightSignal,l?.lightBumpFrontRightSignal,l?.lightBumpRightSignal],F=O.map((te,oe)=>({label:X[oe],start:te.start,end:te.end,value:I[oe]})),$=[{label:"Cliff L",start:-60,end:-46,value:l?.cliffLeftSignal,active:l?.cliffLeft},{label:"Cliff FL",start:-32,end:-16,value:l?.cliffFrontLeftSignal,active:l?.cliffFrontLeft},{label:"Cliff FR",start:16,end:32,value:l?.cliffFrontRightSignal,active:l?.cliffFrontRight},{label:"Cliff R",start:46,end:60,value:l?.cliffRightSignal,active:l?.cliffRight}],V=I.filter(te=>te!=null),W=V.length?Math.max(...V,1200):1200;return o.jsxs("div",{className:`${r?"relative":"surface relative p-1"}`,style:r?{width:`${f}px`,height:`${f}px`}:{height:"100%",width:"100%",aspectRatio:"1 / 1"},children:[r?null:o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute left-1 top-1 text-xs text-slate-400",children:"Top-down"}),o.jsxs("div",{className:"absolute right-1 top-1 text-[0.65rem] text-slate-500",children:["0",W]})]}),o.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${f} ${f}`,preserveAspectRatio:"xMidYMid meet",className:"mx-auto block",children:[o.jsx("circle",{cx:d,cy:d,r:m,fill:"#0f172a",stroke:"#334155",strokeWidth:"2"}),o.jsx(qp,{cx:d-A,cy:d,current:N,drop:w.wheelDropLeft,overcurrent:T.leftWheel,label:"L"}),o.jsx(qp,{cx:d+A,cy:d,current:E,drop:w.wheelDropRight,overcurrent:T.rightWheel,label:"R"}),o.jsx(C1,{cx:d+m*.65,cy:d-m*.55,current:j,overcurrent:T.sideBrush}),o.jsx(T1,{cx:d,cy:d,current:M,overcurrent:T.mainBrush,variant:i,dirtLeft:l?.dirtDetectLeft,dirtRight:l?.dirtDetect}),F.map(te=>{const oe=M1(te.value);return o.jsx(Ks,{cx:d,cy:d,rInner:v,rOuter:y,startDeg:te.start,endDeg:te.end,color:oe,opacity:1,pulse:!1},te.label)}),$.map(te=>{const oe=R1(te.value,te.active);return o.jsx(Ks,{cx:d,cy:d,rInner:g,rOuter:b,startDeg:te.start,endDeg:te.end,color:oe,opacity:1,pulse:!!te.active},te.label)}),o.jsx(Ks,{cx:d,cy:d,rInner:y+2,rOuter:y+8,startDeg:-70,endDeg:-6,color:w.bumpLeft?"#ef4444":"#475569",opacity:1,pulse:!!w.bumpLeft}),o.jsx(Ks,{cx:d,cy:d,rInner:y+2,rOuter:y+8,startDeg:6,endDeg:70,color:w.bumpRight?"#ef4444":"#475569",opacity:1,pulse:!!w.bumpRight})]})]})}function Ks({cx:l,cy:i,rInner:s,rOuter:r,startDeg:f,endDeg:d,color:m,pulse:v=!1,opacity:y=1}){const g=(s+r)/2,b=r-s,A=N1(l,i,g,f,d);return o.jsxs(o.Fragment,{children:[o.jsx("path",{d:A,stroke:m,strokeWidth:b,strokeLinecap:"round",fill:"none",opacity:y}),v?o.jsx("path",{d:A,stroke:"#ef4444",strokeWidth:b,strokeLinecap:"round",fill:"none",className:"animate-pulse",opacity:1}):null]})}function N1(l,i,s,r,f){let d=r,m=f;m<=d&&(m+=360);const v=Sp(l,i,s,d),y=Sp(l,i,s,m);return["M",v.x,v.y,"A",s,s,0,0,1,y.x,y.y].join(" ")}function Sp(l,i,s,r){const f=C0(r);return{x:l+s*Math.cos(f),y:i+s*Math.sin(f)}}function C0(l){return(l-90)*Math.PI/180}function Oo(l,i){if(i)return"#ef4444";const s=Math.abs(l);return s>900?"#f59e0b":s>300?"#22c55e":"#64748b"}function T0(l){return Math.max(0,Math.min(1,l))}function qp({cx:l,cy:i,current:s,drop:r,overcurrent:f,label:d}){const m=Math.abs(s),v=T0(m/1200),y=Oo(s,f),g=56,b=14,A=9,w=3,T=g*v,N=d==="L"?-1:1,E=N*(-A/2-w/2),j=N*(b/2+w/2),M=b+A+w+2,O=g+4;return o.jsxs("g",{transform:`translate(${l},${i})`,children:[o.jsx("rect",{x:-M/2,y:-O/2,width:M,height:O,rx:"4",fill:"none",stroke:"#64748b",strokeWidth:"1"}),o.jsx("rect",{x:E-b/2,y:-g/2,width:b,height:g,fill:"#0f172a",stroke:"#0f172a",strokeWidth:"1",rx:"2"}),o.jsx("rect",{x:E-b/2,y:g/2-T,width:b,height:T,fill:y,className:f?"animate-pulse":""}),o.jsx("rect",{x:j-A/2,y:-g/2,width:A,height:g,fill:r?"#ef4444":"#475569",className:r?"animate-pulse":"",rx:"2"}),o.jsx("text",{x:0,y:g/2+10,textAnchor:"middle",className:"fill-slate-200 text-[0.7rem]",children:d})]})}function C1({cx:l,cy:i,current:s,overcurrent:r}){const f=Math.abs(s),d=Oo(s*3,r),m=42,v=f>0?.65:null;return o.jsxs("g",{style:{transformOrigin:`${l}px ${i}px`,animation:v?`spin ${v}s linear infinite`:"none"},children:[o.jsx("circle",{cx:l,cy:i,r:10,fill:"#64748b",stroke:"#64748b",strokeWidth:"1"}),[0,120,240].map(y=>{const g=C0(y),b=l+m*Math.cos(g),A=i+m*Math.sin(g);return o.jsx("line",{x1:l,y1:i,x2:b,y2:A,stroke:d,strokeWidth:"4",strokeLinecap:"round"},y)}),r?o.jsx("circle",{cx:l,cy:i,r:m+8,stroke:"#ef4444",strokeWidth:"3",fill:"none",className:"animate-pulse"}):null]})}function T1({cx:l,cy:i,current:s,overcurrent:r,variant:f,dirtLeft:d,dirtRight:m}){const v=Math.abs(s),y=Oo(s,r),g=1,b=96,A=12,w=`main-brush-pattern-a-${f}`,T=`main-brush-pattern-b-${f}`,N=v>0?.6:null,E=s>=0?1:-1;return o.jsxs("g",{children:[o.jsx("defs",{children:[w,T].map((j,M)=>o.jsxs("pattern",{id:j,patternUnits:"userSpaceOnUse",width:"6",height:"6",children:[o.jsx("rect",{width:"6",height:"6",fill:y,opacity:g}),o.jsx("path",{d:"M0 6 L6 0",stroke:"#0f172a",strokeWidth:"1"}),N?o.jsx("animateTransform",{attributeName:"patternTransform",type:"translate",from:"0 0",to:`0 ${E*(M===0?6:-6)}`,dur:`${N}s`,repeatCount:"indefinite"}):null]},j))}),o.jsx("rect",{x:l-b/2,y:i-14,width:b,height:A,rx:"3",fill:`url(#${w})`,stroke:"#64748b",strokeWidth:"1"}),o.jsx("rect",{x:l-b/2,y:i+4,width:b,height:A,rx:"3",fill:`url(#${T})`,stroke:"#64748b",strokeWidth:"1"}),o.jsx("circle",{cx:l-b/4,cy:i-8,r:3.5,fill:"#fbbf24"}),o.jsx("circle",{cx:l+b/4,cy:i+8,r:3.5,fill:"#fbbf24"}),r?o.jsx("rect",{x:l-b/2-4,y:i-16,width:b+8,height:A*2+16,rx:"6",stroke:"#ef4444",strokeWidth:"3",fill:"none",className:"animate-pulse"}):null]})}const w1=.18;function M1(l){return l==null||l<=0?"#000000":`hsl(${l*w1%360} 100% 60%)`}function R1(l,i){if(i)return"#ef4444";const s=T0(l==null?0:l/4095),r=[47,55,69],f=[245,158,11],[d,m,v]=r.map((y,g)=>Math.round(y+(f[g]-y)*s));return`rgb(${d}, ${m}, ${v})`}function _1({count:l,totalSpan:i,gap:s,startAngle:r}){const d=(i-s*(l-1))/l,m=[];let v=r;for(let y=0;y<l;y+=1){const g=v+d;m.push({start:v,end:g}),v=g+s}return m}function Ep(...l){return l.filter(Boolean).join(" ")}function O1(l){const i=l?.batteryState?.percentDisplay;return i==null?"--":`${i}%`}function D1(l){return l?.batteryState?l.batteryState.urgentActive?"text-red-400":l.batteryState.warnActive?"text-amber-300":"text-emerald-300":"text-slate-400"}function Do({title:l,roster:i=[],emptyText:s="No roster data.",renderActions:r=null}){return o.jsxs("div",{className:"space-y-0.5 text-sm",children:[l&&o.jsx("p",{className:"text-sm text-slate-400",children:l}),i.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:s}):o.jsx("ul",{className:"space-y-0.5 text-sm",children:i.map(f=>o.jsxs("li",{className:Ep("surface flex flex-wrap items-center justify-between gap-0.5",f.locked&&"bg-red-900/40"),children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-slate-200",children:f.name}),o.jsxs("p",{className:"text-xs text-slate-500 flex flex-wrap items-center gap-1",children:[o.jsx("span",{children:f.locked?"locked":"free"}),f.lockReason&&o.jsx("span",{className:"rounded bg-black/30 px-1",children:f.lockReason}),o.jsxs("span",{className:Ep("font-semibold",D1(f)),children:["Battery ",O1(f)]})]})]}),r?r(f):null]},f.id))})]})}function w0(){const{session:l,requestControl:i}=Ge(),{state:{roverId:s,keymap:r},actions:f}=Vt(),m=mr(s)?.sensors||{},v=l?.roster??[],[y,g]=p.useState({}),b=p.useMemo(()=>l?.role&&l.role!=="spectator",[l?.role]),A=p.useMemo(()=>(m.oiMode?.label||"").toLowerCase()==="full",[m.oiMode?.label]),w=!!m.chargingSources?.homeBase,T=!!(m.chargingState?.label&&m.chargingState.label.toLowerCase()!=="not charging"),N=()=>{s&&(f.setMode("drive"),f.runMacro("drive-sequence"))},E=()=>{s&&(f.setMode("dock"),f.runMacro("seek-dock"))};async function j(M){if(M){g(O=>({...O,[M]:!0}));try{await i(M)}catch(O){alert(O.message)}finally{g(O=>({...O,[M]:!1}))}}}return o.jsxs("section",{className:"panel-section",children:[o.jsxs("div",{className:"grid items-stretch gap-1 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)] md:min-h-[22rem]",children:[o.jsx("div",{className:"flex h-full w-full items-stretch justify-center",children:o.jsx("div",{className:"aspect-square h-full w-full",children:o.jsx(fo,{sensors:m})})}),o.jsxs("div",{className:"grid h-full grid-rows-[1fr_1fr_auto] gap-0.75",children:[o.jsx(jp,{title:"Start Driving",description:"Enable driving mode, then begin driving.",statuses:[{label:A?"Ready":"Press to enter driving mode",active:A}],tone:"emerald",onClick:N,disabled:!s,keyAction:"driveMacro",keymap:r}),o.jsx(jp,{title:"Dock and Charge",description:"Line up about a foot from the dock, then press to attempt auto-dock.",statuses:[{label:w?"Docked":"Not docked",active:w},{label:T?"Charging":"Not charging",active:T}],tone:"indigo",onClick:E,disabled:!s,keyAction:"dockMacro",keymap:r}),o.jsx(z1,{keymap:r})]})]}),o.jsx(Do,{title:"Rovers",roster:v,renderActions:M=>b?o.jsx("button",{type:"button",onClick:()=>j(M.id),disabled:y[M.id],className:"button-dark disabled:opacity-40",children:y[M.id]?"...":"request"}):null})]})}function jp({title:l,description:i,statuses:s,onClick:r,disabled:f,tone:d,keyAction:m,keymap:v}){const y=d==="indigo"?"bg-indigo-700 hover:bg-indigo-600 focus-visible:ring-indigo-400":"bg-emerald-700 hover:bg-emerald-600 focus-visible:ring-emerald-400",g=m?pi(v?.[m]?.[0]):"";return o.jsxs("button",{type:"button",onClick:r,disabled:f,className:`flex h-full w-full flex-col items-center justify-center gap-0.5 border border-slate-700 px-1 py-1 text-center text-white transition focus-visible:outline-none focus-visible:ring-1 ${y} disabled:cursor-not-allowed disabled:opacity-50`,children:[o.jsxs("div",{className:"flex items-center justify-center gap-1",children:[o.jsx("span",{className:"text-base font-semibold text-slate-100",children:l}),g?o.jsx(ho,{label:g}):null]}),o.jsx("p",{className:"text-sm text-slate-300 text-center",children:i}),o.jsx("div",{className:"flex flex-wrap items-center justify-center gap-0.5",children:s.map(b=>o.jsx(k1,{active:b.active,label:b.label},b.label))})]})}function ho({label:l}){return o.jsx("span",{className:"rounded border border-white/40 px-1 text-[0.7rem] text-white",children:l})}function k1({label:l,active:i}){return o.jsx("span",{className:`rounded px-1.5 py-0.5 text-[0.7rem] font-semibold ${i?"bg-emerald-600 text-white":"bg-red-500 text-white"}`,children:l})}function z1({keymap:l}){const{state:{roverId:i,camera:s},actions:{setServoAngle:r}}=Vt(),f=s?.config,d=!!(i&&s?.enabled&&f),m=typeof f?.minAngle=="number"?f.minAngle:-30,v=typeof f?.maxAngle=="number"?f.maxAngle:30,y=typeof s?.angle=="number"?s.angle:typeof f?.homeAngle=="number"?f.homeAngle:(m+v)/2,[g,b]=p.useState(y),A=p.useRef(!1);p.useEffect(()=>{A.current||b(y)},[y]);const w=j=>{const M=Number.parseFloat(j.target.value);Number.isNaN(M)||(A.current=!0,b(M),r(M))},T=()=>{A.current=!1};if(!d)return null;const N=pi(l?.cameraUp?.[0]),E=pi(l?.cameraDown?.[0]);return o.jsxs("div",{className:"surface space-y-0.5 px-1 py-1 text-sm text-slate-200",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-300",children:[o.jsx("span",{children:"Camera tilt"}),o.jsx("span",{className:"font-mono text-slate-100",children:Wc(y)})]}),o.jsxs("div",{children:[o.jsx("input",{type:"range",className:"w-full accent-emerald-400",min:m,max:v,step:.5,value:g,onChange:w,onMouseUp:T,onTouchEnd:T,onPointerUp:T}),o.jsxs("div",{className:"mt-0.25 flex items-center justify-between text-[0.7rem] text-slate-400",children:[o.jsxs("span",{className:"flex items-center gap-0.25",children:[E?o.jsx(ho,{label:E}):null,Wc(m)]}),o.jsxs("span",{className:"flex items-center gap-0.25",children:[Wc(v),N?o.jsx(ho,{label:N}):null]})]})]})]})}function Wc(l){return typeof l!="number"||Number.isNaN(l)?"—":`${l>0?"+":""}${l.toFixed(1)}°`}const B1=5e3;function U1(l){return l.id?l.id:l.timestamp?`${l.timestamp}-${l.message}`:`${l.title||"alert"}-${l.message}`}function L1(){const{alerts:l}=Ge(),[i,s]=p.useState(()=>Date.now()),r=p.useMemo(()=>l.slice(-5).map(d=>({alert:d,key:U1(d)})),[l]);p.useEffect(()=>{if(!r.length)return;const d=setInterval(()=>s(Date.now()),200);return()=>clearInterval(d)},[r.length]);const f=r.map(d=>({...d,age:i-(d.alert.receivedAt??d.alert.timestamp??0)})).filter(d=>d.age<=B1);return f.length?o.jsx("div",{className:"pointer-events-none fixed top-0.5 left-1/2 z-50 flex -translate-x-1/2 flex-col gap-0.5",children:f.map(d=>o.jsx(H1,{alert:d.alert},d.key))}):null}function H1({alert:l}){const i=l.color==="error"?"bg-red-500/30 text-red-100":l.color==="warn"?"bg-amber-500/30 text-amber-100":"bg-emerald-500/30 text-emerald-100";return o.jsxs("div",{className:`pointer-events-auto px-0.5 py-0.5 text-[0.85rem] ${i}`,children:[o.jsx("p",{className:"text-xs text-slate-200",children:l.title||"Alert"}),o.jsx("p",{className:"text-sm text-white",children:l.message})]})}const V1=[{key:"open",label:"Open"},{key:"turns",label:"Turns"},{key:"admin",label:"Admin"},{key:"lockdown",label:"Lockdown"}];function M0(){const{session:l,lockRover:i,setMode:s,requestControl:r}=Ge(),f=p.useMemo(()=>l?.roster??[],[l?.roster]),[d,m]=p.useState({}),v=l?.role==="admin"||l?.role==="lockdown"||l?.role==="lockdown-admin",y=l?.mode??"open",g=async(T,N)=>{try{await i(T,N),m(E=>({...E,[T]:N}))}catch(E){alert(E.message)}},b=async T=>{const N=T.target.value;try{await s(N)}catch(E){alert(E.message)}},A=async T=>{try{await r(T,{force:!0})}catch(N){alert(N.message)}},w=p.useMemo(()=>{const T={};return f.forEach(N=>{T[N.id]=d[N.id]??N.locked}),T},[f,d]);return v?o.jsxs("section",{className:"panel-section space-y-0.5 text-base",children:[o.jsxs("div",{className:"flex items-center justify-between gap-0.5 text-sm",children:[o.jsx("span",{children:"Admin controls"}),o.jsx("select",{value:y,onChange:b,className:"field-input text-sm",children:V1.map(T=>o.jsx("option",{value:T.key,children:T.label},T.key))})]}),o.jsx(Do,{roster:f,renderActions:T=>o.jsxs("div",{className:"flex flex-wrap gap-0.5 text-xs",children:[o.jsx("button",{type:"button",onClick:()=>g(T.id,!w[T.id]),className:"button-dark",children:w[T.id]?"Unlock":"Lock"}),o.jsx("button",{type:"button",onClick:()=>A(T.id),className:"button-dark",children:"Force"})]})})]}):null}function Y1({size:l="default"}){const{state:{roverId:i},actions:s}=Vt(),[r,f]=p.useState(null),d=!i||r!==null,v=mr(i)?.sensors?.oiMode?.label||"Unknown",g=v.toLowerCase()==="full",b=g?"Drive Ready":`OI Mode: ${v}`,A=async()=>{if(i){f("drive");try{s.setMode("drive"),await s.runMacro("drive-sequence")}finally{f(null)}}},w=async()=>{if(i){f("dock");try{s.setMode("dock"),await s.runMacro("seek-dock")}finally{f(null)}}},T=l==="compact"?"text-xs px-0.5 py-0.5":"text-sm px-0.5 py-0.5";return o.jsxs("div",{className:"bg-black/30 p-0.5 text-slate-100",children:[o.jsx("div",{className:"flex items-center",children:o.jsx("span",{className:`${g?"bg-emerald-700":"bg-indigo-700"} ${T}`,children:b})}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-2 gap-0.5 text-xs",children:[o.jsx("button",{type:"button",onClick:A,disabled:d,className:`bg-emerald-600 px-0.5 py-0.5 font-semibold text-emerald-50 transition-colors hover:bg-emerald-500 disabled:opacity-40 ${l==="compact"?"text-xs":"text-sm"}`,children:"Drive"}),o.jsx("button",{type:"button",onClick:w,disabled:d,className:`bg-indigo-600 px-0.5 py-0.5 font-semibold text-indigo-50 transition-colors hover:bg-indigo-500 disabled:opacity-40 ${l==="compact"?"text-xs":"text-sm"}`,children:"Dock"})]})]})}const Zs="mobile-joystick",Q1=80,G1=.15,X1=[{id:"main-forward",label:"Main Brush +",values:{main:127},hold:!0,color:"bg-emerald-600"},{id:"main-reverse",label:"Main Brush -",values:{main:-127},hold:!0,color:"bg-emerald-800"},{id:"all-forward",label:"All Motors +",values:{main:127,side:127,vacuum:127},hold:!0,color:"bg-fuchsia-600"},{id:"side-forward",label:"Side Brush +",values:{side:127},hold:!0,color:"bg-cyan-600"},{id:"side-reverse",label:"Side Brush -",values:{side:-70},hold:!0,color:"bg-cyan-800"},{id:"vacuum-fast",label:"Vacuum Max",values:{vacuum:127},hold:!0,color:"bg-amber-500 text-amber-950"},{id:"vacuum-slow",label:"Vacuum Low",values:{vacuum:50},hold:!0,color:"bg-amber-700"},{id:"stop-all",label:"Stop",values:{main:0,side:0,vacuum:0},hold:!1,color:"bg-slate-900"}];function K1({disabled:l,layout:i,radius:s,onMove:r,onStop:f}){const d=p.useRef(null),m=p.useRef(null),v=p.useRef({x:0,y:0}),[y,g]=p.useState({active:!1,base:{x:0,y:0},knob:{x:0,y:0}}),b=p.useCallback(()=>{m.current=null,g({active:!1,base:{x:0,y:0},knob:{x:0,y:0}}),f?.()},[f]),A=p.useCallback(E=>{if(l||m.current!==null)return;E.preventDefault();const j=d.current;if(!j)return;const M=j.getBoundingClientRect(),O=E.clientX-M.left,X=E.clientY-M.top;v.current={x:O,y:X},m.current=E.pointerId,j.setPointerCapture?.(E.pointerId),g({active:!0,base:{x:O,y:X},knob:{x:0,y:0}})},[l]),w=p.useCallback(E=>{if(l||m.current!==E.pointerId)return;E.preventDefault();const j=d.current;if(!j)return;const M=j.getBoundingClientRect(),O=E.clientX-M.left,X=E.clientY-M.top,I=O-v.current.x,F=X-v.current.y,$=Math.min(Math.hypot(I,F),s),V=Math.atan2(F,I),W=Math.cos(V)*$,te=Math.sin(V)*$,oe={x:En(W/s),y:En(-te/s),boost:!1};g(be=>({...be,knob:{x:W,y:te}})),r?.(oe)},[l,r]),T=p.useCallback(E=>{if(m.current!==E.pointerId)return;E.preventDefault(),d.current?.releasePointerCapture?.(E.pointerId),b()},[b]);p.useEffect(()=>{l&&b()},[l,b]);const N=i==="landscape"?"h-[260px]":"h-[220px]";return o.jsxs("div",{ref:d,role:"presentation",className:`relative w-full ${N} select-none overflow-hidden bg-zinc-950`,style:{touchAction:"none"},onPointerDown:A,onPointerMove:w,onPointerUp:T,onPointerLeave:T,onPointerCancel:T,onContextMenu:E=>E.preventDefault(),children:[!y.active&&o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center text-xs text-slate-400",children:[o.jsx("p",{children:"Touch and hold anywhere"}),o.jsx("p",{children:"Joystick will follow your thumb"})]}),y.active&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute h-28 w-28 -translate-x-1/2 -translate-y-1/2 bg-cyan-400/10 outline outline-2 outline-cyan-400/60 [clip-path:circle(50%)]",style:{left:y.base.x,top:y.base.y}}),o.jsx("div",{className:"pointer-events-none absolute h-12 w-12 -translate-x-1/2 -translate-y-1/2 bg-cyan-300/80 shadow-lg [clip-path:circle(50%)]",style:{left:y.base.x+y.knob.x,top:y.base.y+y.knob.y}})]})]})}function R0({layout:l}){const{state:{roverId:i,camera:s},pipeline:r,actions:{setDriveVector:f,registerInputState:d,stopAllMotion:m,setServoAngle:v,toggleNightVision:y}}=Vt(),g=!i,b=s?.config,A=!!(i&&s?.enabled&&b),w=!!(i&&r?.nightVision),T=typeof b?.minAngle=="number"?b.minAngle:-45,N=typeof b?.maxAngle=="number"?b.maxAngle:45,E=typeof s?.angle=="number"?s.angle:typeof b?.homeAngle=="number"?b.homeAngle:(T+N)/2,j=Q1,M=G1,O=p.useRef({x:0,y:0,boost:!1});p.useEffect(()=>{g&&(O.current={x:0,y:0,boost:!1})},[g]);const X=p.useCallback(($={})=>{if(g)return;const V={x:En($.x??0),y:En($.y??0),boost:!!$.boost},W={x:O.current.x+(V.x-O.current.x)*(1-M),y:O.current.y+(V.y-O.current.y)*(1-M),boost:V.boost};O.current=W,f(W,{source:Zs}),d(Zs,{vector:W,lastEvent:"move"})},[g,d,f,M]),I=p.useCallback(()=>{if(g)return;const $={x:0,y:0,boost:!1};O.current=$,f($,{source:Zs}),d(Zs,{vector:$,lastEvent:"stop"})},[g,d,f]),F=$=>{if(!A)return;const V=Number($.target.value);Number.isNaN(V)||v(V)};return o.jsxs("div",{className:"flex flex-col gap-0.5 text-slate-100",children:[o.jsx(Y1,{size:"compact"}),w&&o.jsx("button",{type:"button",onClick:()=>y(),disabled:g,className:"bg-amber-600 px-0.5 py-1 text-sm font-semibold text-amber-50 transition hover:bg-amber-500 disabled:opacity-40",children:"Toggle Night Vision"}),A&&o.jsxs("div",{className:"bg-zinc-950 p-0.5 text-xs",children:[o.jsxs("div",{className:"flex items-center justify-between text-[0.75rem] text-slate-400",children:[o.jsx("span",{children:"Camera Tilt"}),o.jsxs("span",{className:"font-mono text-slate-200",children:[E.toFixed(1),"°"]})]}),o.jsx("input",{type:"range",min:T,max:N,step:.5,value:E,onChange:F,className:"mt-0.5 w-full accent-cyan-400"})]}),o.jsx(K1,{disabled:g,layout:l,radius:j,onMove:X,onStop:I})]})}function _0({orientation:l}){const{state:{roverId:i},actions:{setAuxMotors:s}}=Vt(),r=p.useRef(null),f=!i,d=p.useCallback(y=>{if(!f){if(y.hold===!1){s(y.values),r.current=null;return}r.current=y.id,s(y.values)}},[f,s]),m=p.useCallback(y=>{f||y.hold===!1||r.current===y.id&&(r.current=null,s({main:0,side:0,vacuum:0}))},[f,s]),v=l==="landscape"?"grid-cols-1":"grid-cols-1 sm:grid-cols-2";return o.jsxs("div",{className:"flex flex-col gap-0.5 text-slate-100",children:[o.jsx("p",{className:"text-xs text-slate-400",children:"Aux controls"}),o.jsx("div",{className:`grid ${v} gap-0.5`,children:X1.map(y=>o.jsx("button",{type:"button",disabled:f,onPointerDown:g=>{g.preventDefault(),d(y)},onPointerUp:()=>m(y),onPointerLeave:()=>m(y),onPointerCancel:()=>m(y),onContextMenu:g=>g.preventDefault(),className:`px-0.5 py-0.5 text-left text-sm font-semibold text-white transition select-none no-touch-select ${y.color} hover:brightness-110 disabled:opacity-30 h-10`,children:y.label},y.id))})]})}function Z1(){return o.jsx("div",{className:"flex h-full flex-col gap-0.5",children:o.jsx(_0,{orientation:"landscape"})})}function J1(){return o.jsx("div",{className:"flex h-full flex-col gap-0.5",children:o.jsx(R0,{layout:"landscape"})})}function F1(){return o.jsx("section",{className:"panel",children:o.jsxs("div",{className:"grid grid-cols-2 gap-0.5",children:[o.jsx(_0,{orientation:"portrait"}),o.jsx(R0,{layout:"portrait"})]})})}function O0(l=[]){const i=Sa(),[s,r]=p.useState({}),f=p.useRef(new Map),d=p.useMemo(()=>l.map(g=>typeof g=="string"?g:g.id),[l]),m=p.useMemo(()=>d.join("|"),[d]),v=p.useRef([]),y=p.useRef(null);return p.useEffect(()=>{v.current=d},[m,d]),p.useEffect(()=>{f.current.forEach(g=>URL.revokeObjectURL(g)),f.current.clear(),r({}),y.current&&(clearTimeout(y.current),y.current=null)},[m]),p.useEffect(()=>{if(!v.current.length||!i)return;let g=!1;const b=v.current,A=(N={},E)=>{if(g||!N.id||!E)return;const j=new Blob([E],{type:"image/jpeg"}),M=URL.createObjectURL(j),O=f.current.get(N.id);O&&URL.revokeObjectURL(O),f.current.set(N.id,M),r(X=>({...X,[N.id]:{status:"playing",ts:N.ts||Date.now(),error:null,objectUrl:M}}))},w=(N={})=>{g||!N.id||(r(E=>({...E,[N.id]:{...E[N.id]||{},status:N.error?"error":E[N.id]?.status||"connecting",error:N.error||null,ts:N.ts||E[N.id]?.ts||null,objectUrl:E[N.id]?.objectUrl||null}})),N.error&&!g&&T())},T=(N=5e3)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{y.current=null,g||i.emit("roomCamera:subscribe",{ids:b},(E={})=>{E.error&&!y.current&&T()})},N)};return i.on("roomCamera:frame",A),i.on("roomCamera:status",w),i.emit("roomCamera:subscribe",{ids:b},(N={})=>{N.error&&T()}),()=>{g=!0,i.emit("roomCamera:unsubscribe",{ids:b}),i.off("roomCamera:frame",A),i.off("roomCamera:status",w),f.current.forEach(N=>URL.revokeObjectURL(N)),f.current.clear(),y.current&&(clearTimeout(y.current),y.current=null)}},[i,m]),s}function $1({feed:l,label:i}){const[s,r]=p.useState(!1);p.useEffect(()=>{l&&(!l.ts&&!l.objectUrl||r(d=>!d))},[l?.ts,l?.objectUrl]);const f=p.useMemo(()=>l?l.error?`Error: ${l.error}`:l.status||"Connecting…":"Connecting…",[l]);return o.jsxs("div",{className:"relative w-full overflow-hidden rounded bg-black",style:{aspectRatio:"4 / 3"},children:[l?.objectUrl?o.jsx("img",{src:l.objectUrl,alt:i,className:"h-full w-full object-cover"}):o.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-slate-300",children:"Waiting for frame…"}),o.jsx("div",{className:"pointer-events-none absolute left-0 top-0 bg-black/70 px-0.5 py-0.5 text-xs font-semibold text-white",children:i}),o.jsxs("div",{className:"pointer-events-none absolute bottom-0 left-0 m-0.5 flex items-center gap-1 rounded bg-black/70 px-0.5 py-0.25 text-[0.7rem] text-slate-100",children:[o.jsx("span",{className:`h-2 w-2 rounded-full ${s?"bg-emerald-400":"bg-slate-500"}`}),o.jsx("span",{children:f})]})]})}function W1(){return o.jsxs("div",{className:"panel-section space-y-0.5 text-sm",children:[o.jsx("p",{className:"text-center text-slate-400",children:"No room cameras configured."}),o.jsx("p",{className:"text-center text-slate-500",children:"Add entries to server config to populate this list."})]})}const D0=["horizontal","vertical"];function Ic(l,i){return D0.includes(l)?l:i}function pr({defaultOrientation:l="horizontal",orientation:i,hideLayoutToggle:s=!1,hideHeader:r=!1,panelId:f=null}){const{session:d}=Ge(),m=d?.roomCameras||[],v=O0(m.map(j=>({id:j.id}))),{value:y,save:g}=Ht("roomCameraPanels",{}),[b,A]=p.useState(()=>Ic(f?y?.[f]:l,"horizontal"));p.useEffect(()=>{if(!f)return;const j=y?.[f];j&&A(Ic(j,"horizontal"))},[f,y?.[f]]);const w=i?Ic(i,"horizontal"):b,T=w==="vertical"?"flex flex-col gap-0.5":"grid gap-0.5 md:grid-cols-2",N=!s&&!i&&m.length>0,E=j=>{A(j),f&&g(M=>({...M||{},[f]:j}))};return m.length===0?o.jsx(W1,{}):o.jsxs("section",{className:"panel-section space-y-0.5 text-base",children:[!r&&o.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-0.5 text-sm text-slate-400",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("p",{children:"Room cameras"}),o.jsx("span",{className:"text-xs text-slate-500",children:m.length})]}),N&&o.jsxs("div",{className:"flex items-center gap-0.5 text-xs",children:[o.jsx("span",{className:"text-slate-500",children:"Layout:"}),o.jsx("div",{className:"inline-flex overflow-hidden rounded border border-slate-700",children:D0.map(j=>o.jsx("button",{type:"button",className:`px-1 py-0.5 ${w===j?"bg-slate-600 text-white":"bg-transparent text-slate-400 hover:text-white"}`,onClick:()=>E(j),children:j==="vertical"?"Vertical":"Grid"},j))})]})]}),o.jsx("div",{className:T,children:m.map(j=>{const M=v[j.id]||null;return o.jsx("article",{className:"w-full space-y-0.5 rounded bg-zinc-950 p-0.5 shadow-inner shadow-black/40",children:o.jsx($1,{feed:M,label:j.name||j.id})},j.id)})})]})}function ko(){const{logs:l}=Ge();return o.jsxs("div",{className:"panel-section space-y-0.5 text-base",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-400",children:[o.jsx("span",{children:"Server logs"}),o.jsx("span",{children:l.length})]}),o.jsx("div",{className:"surface h-64 overflow-y-auto font-mono text-xs",children:l.length===0?o.jsx("p",{children:"No logs yet."}):l.slice().reverse().map(i=>o.jsxs("div",{className:"surface",children:[o.jsx("span",{className:"text-amber-400",children:i.timestamp})," ",o.jsxs("span",{className:"text-lime-400",children:["[",i.level,"]"]})," ",i.label&&o.jsxs("span",{className:"text-teal-400",children:["[",i.label,"]"]})," ",o.jsx("span",{children:i.message})]},i.id))})]})}function zo(){const{login:l,setRole:i}=Ge(),[s,r]=p.useState(""),[f,d]=p.useState(""),[m,v]=p.useState(!1);async function y(g){g.preventDefault(),v(!0);try{await l(s,f),r(""),d("")}catch(b){alert(b.message)}finally{v(!1)}}return o.jsxs("div",{className:"panel-section space-y-0.5 text-base",children:[o.jsx("p",{className:"text-sm text-slate-400",children:"Admin login"}),o.jsxs("form",{className:"flex flex-col gap-0.5",onSubmit:y,children:[o.jsx("input",{className:"field-input",placeholder:"Username",value:s,onChange:g=>r(g.target.value)}),o.jsx("input",{className:"field-input",placeholder:"Password",type:"password",value:f,onChange:g=>d(g.target.value)}),o.jsx("button",{type:"submit",disabled:m,className:"button-dark w-full disabled:opacity-50",children:m?"Logging in…":"Login"})]})]})}const I1=3e3;function P1(l){if(!l)return null;if(typeof l=="string"){const i=String(l).trim();return i?{type:"rover",id:i,key:i}:null}if(typeof l=="object"){if(l.type&&l.id){const i=String(l.id);let s=l.key;return s||(s=l.type==="room"?`room:${i}`:i),{type:l.type,id:i,key:s}}if(l.roverId){const i=String(l.roverId);return{type:"rover",id:i,key:l.key||i}}if(l.roomCameraId){const i=String(l.roomCameraId);return{type:"room",id:i,key:l.key||`room:${i}`}}}return null}function eA(l=[]){const i=new Set,s=[];return l.forEach(r=>{!r?.key||i.has(r.key)||(i.add(r.key),s.push(r))}),s.sort((r,f)=>r.key.localeCompare(f.key))}function Bo(l=[]){const i=Sa(),[s,r]=p.useState({}),f=p.useMemo(()=>Array.isArray(l)?eA(l.map(P1).filter(Boolean)):[],[l]),d=p.useMemo(()=>f.map(g=>`${g.type}:${g.id}:${g.key}`).join("|"),[f]),m=p.useRef([]),v=p.useRef(new Map);return p.useEffect(()=>{m.current=f},[f]),p.useEffect(()=>{if(!d)return;const g=m.current;let b=!1;const A=v.current;function w(E){const j=A.get(E);j&&(clearTimeout(j),A.delete(E))}function T(E){w(E.key);const j=setTimeout(()=>{A.delete(E.key),!b&&N(E)},I1);A.set(E.key,j)}function N(E){const j=E.type==="room"?{roomCameraId:E.id}:{roverId:E.id};i.emit("video:request",j,(M={})=>{if(!b){if(!M||M.error||!M.url||!M.token){T(E),r(O=>({...O,[E.key]:M}));return}w(E.key),r(O=>({...O,[E.key]:M}))}})}return g.forEach(E=>{w(E.key),N(E)}),()=>{b=!0,A.forEach(E=>clearTimeout(E)),A.clear()}},[i,d]),p.useMemo(()=>{if(!d)return{};const g={};return f.forEach(b=>{s[b.key]&&(g[b.key]=s[b.key])}),g},[d,s,f])}const tA={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"turn:your.turn.server:3478",username:"user",credential:"pass"}],bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"};function nA(l){if(typeof btoa=="function")return btoa(l);if(typeof Buffer<"u")return Buffer.from(l).toString("base64");throw new Error("No base64 encoder available")}function aA(l){if(!l)return{};const i=`${l}:${l}`;return{Authorization:`Basic ${nA(i)}`}}class Np{constructor({url:i,token:s,video:r,onStatus:f,audioOnly:d=!1}){this.url=i,this.token=s,this.video=r,this.audioOnly=d,this.pc=null,this.abortController=null,this.onStatus=f}notify(i,s){typeof this.onStatus=="function"&&this.onStatus(i,s)}configureVideoElement(){this.video&&(this.video.playsInline=!0,this.video.autoplay=!0,this.video.muted=!this.audioOnly,typeof this.video.disableRemotePlayback<"u"&&(this.video.disableRemotePlayback=!0),"latencyHint"in HTMLMediaElement.prototype&&(this.video.latencyHint="interactive"))}async start(){if(!this.url||!this.video)throw new Error("Media target missing");this.stop(),this.notify("connecting"),this.configureVideoElement(),this.abortController=new AbortController;const i=new RTCPeerConnection(tA);this.pc=i;const s=new MediaStream;i.ontrack=r=>{r.streams[0]?.getTracks().forEach(f=>s.addTrack(f)),this.video.srcObject=s,r.track?.kind==="video"&&"playoutDelayHint"in r.receiver&&(r.receiver.playoutDelayHint=0)},this.audioOnly?i.addTransceiver("audio",{direction:"recvonly"}):(i.addTransceiver("video",{direction:"recvonly"}),i.addTransceiver("audio",{direction:"recvonly"})),i.onconnectionstatechange=()=>{this.notify(i.connectionState)},i.oniceconnectionstatechange=()=>{const r=i.iceConnectionState;(r==="failed"||r==="disconnected")&&this.notify(r)};try{const r=await i.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!this.audioOnly});await i.setLocalDescription(r);const f=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/sdp",...aA(this.token)},body:r.sdp,signal:this.abortController.signal});if(!f.ok)throw new Error(`WHEP request failed: ${f.status}`);const d=await f.text();await i.setRemoteDescription({type:"answer",sdp:d}),i.getReceivers().forEach(m=>{"playoutDelayHint"in m&&(m.playoutDelayHint=0)}),await this.video.play().catch(()=>{}),this.notify("playing")}catch(r){throw this.notify("error",r.message),this.stop(),r}}stop(){this.abortController&&(this.abortController.abort(),this.abortController=null),this.pc&&(this.pc.getSenders().forEach(i=>i.track?.stop()),this.pc.getReceivers().forEach(i=>i.track?.stop()),this.pc.close(),this.pc=null),this.video&&(this.video.srcObject=null),this.notify("stopped")}}function k0(){const{value:l,save:i}=Ht("page",{hudMapDesktop:!1});return[!!l?.hudMapDesktop,f=>{i({hudMapDesktop:!!f})}]}const Cp=2e3,lA=3e3,iA=3e3,sA=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function Tp(l){if(typeof l!="number"||!Number.isFinite(l))return"--";const i=sA[l%12]||"?",s=Math.floor(l/12)-1;return`${i}${s}`}function rA(l,i){const s=i?.Full,r=i?.Warn,f=i?.Urgent??null;if(l==null||s==null||r==null)return{available:!1};const d=s-r;if(d<=0)return{available:!1};const m=(l-r)/d,v=Math.min(1,Math.max(0,m)),y=Math.round(v*100),g=m<=0,b=f!=null&&l<=f;return{available:!0,percentDisplay:y,depleted:g,warnTriggered:b,barClass:g?"bg-red-500 animate-pulse":b?"bg-amber-400":"bg-emerald-500"}}function Uo({sessionInfo:l,audioSessionInfo:i,label:s,forceMute:r=!1,telemetryFrame:f,batteryConfig:d,layoutFormat:m="desktop",hudVariant:v="default",driverLabel:y=null,songNote:g=null,hudForceMap:b=!1,hudMapPosition:A="top-right"}){const w=p.useRef(null),T=p.useRef(null),N=p.useRef(null),E=p.useRef(null),j=p.useRef(null),M=p.useRef(null),[O,X]=p.useState("idle"),[I,F]=p.useState(null),[$,V]=p.useState("idle"),[W,te]=p.useState(null),[oe,be]=p.useState(0),[qe,Z]=p.useState(0),[ne,J]=p.useState(!0),z=f?.sensors,G=z?.batteryChargeMah??null,ae=m==="desktop",ee=!ae,[se]=k0(),S=b||ee?!0:se,U=rA(G,d),Q=z?.wheelOvercurrents||null,K=Q==null?[]:Object.entries(Q).filter(([,pe])=>!!pe).map(([pe])=>pe),P=p.useCallback(()=>{clearTimeout(N.current),N.current=setTimeout(()=>be(Date.now()),Cp)},[]),re=p.useCallback(()=>{clearTimeout(E.current),E.current=setTimeout(()=>Z(Date.now()),Cp)},[]),me=p.useCallback(async()=>{const pe=w.current;if(pe)try{pe.muted=!0,await pe.play()}catch{}},[]),Ze=p.useCallback((pe=0)=>{if(r)return;clearTimeout(M.current);const tt=()=>{clearTimeout(M.current),M.current=setTimeout(()=>{r||Ve()},lA)},Ve=async()=>{const Ee=w.current;if(Ee)try{await me(),Ee.muted=!1,await Ee.play(),J(!1)}catch{Ee.muted=!0,J(!0),tt()}};M.current=setTimeout(Ve,pe)},[me,r]);p.useEffect(()=>()=>{clearTimeout(N.current),clearTimeout(E.current),clearTimeout(M.current),clearInterval(j.current)},[]),p.useEffect(()=>{O==="playing"&&Ze(0)},[O,Ze]),p.useEffect(()=>{if(!l?.url||!w.current)return;let pe=!0,tt;const Ve=setTimeout(()=>J(!0),0),Ee=(ze,Me)=>{pe&&(X(ze),F(Me||null),ze==="playing"&&me(),["error","failed","disconnected","closed"].includes(ze)&&P())};return tt=new Np({url:l.url,token:l.token,video:w.current,onStatus:Ee}),tt.start().catch(ze=>{pe&&(X("error"),F(ze.message),P())}),()=>{pe=!1,clearTimeout(Ve),tt?.stop()}},[l?.url,l?.token,oe,P,me]),p.useEffect(()=>{O==="stopped"&&l?.url&&P()},[O,l?.url,P]),p.useEffect(()=>{if(!i?.url||!T.current)return;let pe=!0,tt;const Ve=(Ee,ze)=>{pe&&(te(ze||(Ee==="connected"?"connected":null)),V(Me=>Ee==="connected"&&(Me==="playing"||Me==="connecting")||Ee==="new"?Me:Ee),Ee==="playing"&&T.current?.play().catch(()=>{}),["error","failed","disconnected","closed"].includes(Ee)&&re())};return tt=new Np({url:i.url,token:i.token,video:T.current,audioOnly:!0,onStatus:Ve}),tt.start().catch(Ee=>{pe&&(V("error"),te(Ee.message),re())}),()=>{pe=!1,tt?.stop()}},[i?.url,i?.token,qe,re]),p.useEffect(()=>{const pe=T.current;if(!i?.url||!pe){clearInterval(j.current);return}if(!["connecting","connected","playing","paused"].includes($)){clearInterval(j.current);return}const Ve=()=>{const Ee=T.current;Ee&&(!Ee.paused&&!Ee.ended||Ee.play().then(()=>{V(ze=>ze==="connected"?"playing":ze),te(ze=>ze==="paused"?null:ze)}).catch(ze=>{te(Me=>Me||ze?.message||"autoplay blocked")}))};return Ve(),j.current=setInterval(Ve,iA),()=>clearInterval(j.current)},[i?.url,$]),p.useEffect(()=>{const pe=T.current;if(!pe)return;const tt=()=>{V(Me=>Me==="error"?Me:"playing"),te(null)},Ve=()=>{V(Me=>["error","failed","disconnected","closed","stopped"].includes(Me)?Me:"paused"),te(Me=>Me||"paused")},Ee=()=>{V(Me=>Me==="error"?Me:"stopped"),te(Me=>Me||"ended")},ze=()=>{const{error:Me}=pe,Ei=Me?.message||"audio error";V("error"),te(Ei)};return pe.addEventListener("play",tt),pe.addEventListener("pause",Ve),pe.addEventListener("ended",Ee),pe.addEventListener("error",ze),()=>{pe.removeEventListener("play",tt),pe.removeEventListener("pause",Ve),pe.removeEventListener("ended",Ee),pe.removeEventListener("error",ze)}},[i?.url]);const ke=l?.url?O==="error"?`Error: ${I||"unknown"}`:I?`${O} (${I})`:O:"waiting",en=i?.error?`Error: ${i.error}`:i?.url?$==="error"?`Error: ${W||"unknown"}`:W?`${$} (${W})`:$:null,tn=v==="spectator";return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsxs("div",{className:"relative w-full overflow-hidden bg-black aspect-video",children:[o.jsx("video",{ref:w,muted:r||ne,playsInline:!0,autoPlay:!0,controls:!1,className:"h-full w-full object-contain"}),o.jsx("audio",{ref:T,autoPlay:!0,hidden:!0}),o.jsx(oA,{frame:f,sensors:z,label:s,status:ke,audioStatus:en,desktopLayout:ae,variant:v,driverLabel:y,battery:U,songNote:g,showTopDown:S,mobileHud:ee,mapPosition:A}),o.jsx(dA,{motors:K}),o.jsx(hA,{charge:G,config:d}),tn&&U.available?o.jsx(cA,{visual:U}):null]}),!tn&&o.jsx(uA,{visual:U})]})}function uA({visual:l}){if(!l?.available)return o.jsx("div",{className:"panel-section space-y-0.5 text-sm",children:o.jsx("p",{className:"text-xs text-slate-500",children:"Battery telemetry unavailable"})});const i=`${l.percentDisplay}%`,s=l.barClass;return o.jsx("div",{className:"panel-section space-y-0.5 text-sm",children:o.jsx("div",{className:"relative h-4 w-full bg-zinc-900 flex",children:o.jsx("div",{className:`h-full transition-[width] ${s}`,style:{width:`${l.percentDisplay}%`},children:o.jsxs("span",{className:"inset-0 flex items-center justify-center text-xs font-semibold text-black/80",children:["Battery ",i]})})})})}function cA({visual:l}){if(!l?.available)return null;const i=`${l.percentDisplay}%`;return o.jsxs("div",{className:"pointer-events-none absolute right-1 top-1/2 flex h-[70%] -translate-y-1/2 flex-col items-center justify-end rounded bg-black/60 px-0.5 pb-1 pt-1",children:[o.jsx("div",{className:"flex h-full w-4 items-end overflow-hidden rounded bg-zinc-900",children:o.jsx("div",{className:`${l.barClass} w-full transition-[height]`,style:{height:`${l.percentDisplay}%`}})}),o.jsx("span",{className:"mt-0.5 text-[0.65rem] font-semibold text-slate-100",children:i})]})}function oA({frame:l,sensors:i,label:s,status:r,audioStatus:f,desktopLayout:d=!0,variant:m="default",driverLabel:v=null,battery:y,songNote:g=null,showTopDown:b=!1,mobileHud:A=!1,mapPosition:w="top-right"}){i?.bumpsAndWheelDrops;const[T,N]=p.useState(()=>Date.now());p.useEffect(()=>{const j=setInterval(()=>N(Date.now()),150);return()=>clearInterval(j)},[]),l?.receivedAt&&T-l.receivedAt<200;const E={width:"240px",height:"240px",opacity:.7,transform:`scale(${A?.55:.7})`,transformOrigin:w==="bottom-left"?"bottom left":"top right",...w==="bottom-left"?{left:"0.25rem",bottom:"0.25rem"}:{right:"0.25rem",top:"0.25rem"}};if(m==="spectator"){const j=[["Voltage",i?.voltageMv!=null?`${(i.voltageMv/1e3).toFixed(2)} V`:"--"],["Current",i?.currentMa!=null?`${i.currentMa} mA`:"--"],["Charge",i?.batteryChargeMah!=null?`${i.batteryChargeMah}`:"--"],["OI",i?.oiMode?.label||"--"]];return o.jsxs("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:[o.jsxs("div",{className:"absolute left-1 top-1 bg-black/70 px-1 py-0.5 text-[0.65rem] font-medium text-slate-100",children:[o.jsxs("span",{children:["Status: ",r]}),f?o.jsxs("div",{children:["Audio: ",f]}):null]}),g!=null?o.jsxs("div",{className:"absolute right-1 top-1 rounded bg-black/70 px-1 py-0.25 text-[0.65rem] font-semibold text-emerald-200",children:["Song ",Tp(g)," ",o.jsxs("span",{className:"text-slate-400",children:["(",g,")"]})]}):null,o.jsxs("div",{className:"absolute left-1 top-1/2 flex -translate-y-1/2 flex-col gap-0.35 bg-black/70 px-1 py-0.35 text-[0.65rem] text-slate-100",children:[o.jsxs("div",{className:"space-y-0.1 leading-tight",children:[o.jsx("span",{className:"text-[0.6rem] uppercase tracking-wide text-slate-400",children:"Telemetry"}),j.map(([M,O])=>o.jsxs("span",{className:"flex items-center justify-between gap-0.5",children:[o.jsx("span",{className:"text-slate-400",children:M}),o.jsx("span",{className:"font-semibold text-white",children:O})]},M))]}),b?o.jsx("div",{className:"flex items-center justify-center pt-0.25",children:o.jsx("div",{className:"pointer-events-none rounded",style:{width:"130px",height:"130px",opacity:.9,transform:"scale(0.85)",transformOrigin:"top left"},children:o.jsx(fo,{sensors:i,size:160,overlay:!0})})}):null]}),o.jsxs("div",{className:"absolute bottom-0.5 left-1/2 flex -translate-x-1/2 items-center gap-1 bg-black/80 px-1 py-0.5 text-[0.8rem] text-slate-100",children:[o.jsx("span",{className:"font-semibold text-white",children:s||"Unnamed Rover"}),v?o.jsxs("span",{className:"text-slate-300",children:["• ",v]}):null]})]})}return o.jsxs("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:[o.jsxs("div",{className:"absolute left-1 top-1 bg-black/70 px-1 py-0.5 text-[0.65rem] font-medium text-slate-100",children:[o.jsxs("span",{children:["Status: ",r]}),f?o.jsxs("div",{children:["Audio: ",f]}):null]}),g!=null?o.jsxs("div",{className:"absolute bottom-1 right-1 rounded bg-black/70 px-1 py-0.25 text-[0.65rem] font-semibold text-emerald-200",children:["Song ",Tp(g)," ",o.jsxs("span",{className:"text-slate-400",children:["(",g,")"]})]}):null,o.jsx("div",{className:"absolute bottom-0.5 left-1/2 flex -translate-x-1/2 gap-0.5 bg-black/80 px-0.5 py-0.5 text-slate-100",children:o.jsxs("span",{children:['Rover: "',s||"Unnamed Rover",'"']})}),b&&m!=="spectator"?o.jsx("div",{className:"pointer-events-none absolute rounded",style:{...E,padding:"0.1rem",background:"rgba(0,0,0,0.6)"},children:o.jsx(fo,{sensors:i,size:240,overlay:!0})}):null]})}const fA={leftWheel:"Left wheel",rightWheel:"Right wheel",mainBrush:"Main brush",sideBrush:"Side brush"};function dA({motors:l}){if(!l?.length)return null;const i=l.map(s=>fA[s]||s);return o.jsx("div",{className:"pointer-events-none absolute flex items-center justify-center bg-red-900/60 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 p-4",children:o.jsxs("div",{className:"text-center text-4xl font-semibold text-white animate-pulse",children:[o.jsx("div",{children:"OVERCURRENT"}),o.jsx("div",{className:"mt-0.5 text-xl font-medium text-white",children:i.join(", ")})]})})}function hA({charge:l,config:i}){if(l==null||i==null)return null;const s=i.Full,r=i.Warn,f=i.Urgent??null,d=s-r;if(d<=0)return null;const v=(l-r)/d<=0;if(!(f!=null&&l<=f)&&!v)return null;const g=v?"Battery low! please dock and charge the rover soon.":"BATTERY VERY LOW, PLEASE DOCK THE ROVER AND CHARGE IMMEDIATELY!!";return o.jsx("div",{className:"pointer-events-none absolute flex items-center justify-center bg-amber-900/60 top-10 left-1/2 -translate-x-1/2 p-4",children:o.jsx("div",{className:"text-center text-2xl font-semibold text-white animate-pulse",children:o.jsx("div",{children:g})})})}function Lo({layoutFormat:l="desktop"}){const{session:i}=Ge(),{state:{song:s}}=Vt(),r=i?.assignment?.roverId,d=!!(r&&i?.roster?i.roster.find(N=>String(N.id)===String(r)):null)?.media?.audioPublishUrl,m=r?[{type:"rover",id:r,key:r},...d?[{type:"rover",id:`${r}-audio`,key:`${r}-audio`}]:[]]:[],v=Bo(m),y=r?v[r]:null,g=r&&d?v[`${r}-audio`]:null,b=mr(r),A=r&&i?.roster?i.roster.find(N=>String(N.id)===String(r)):null,w=A?.battery??null,T=A?.name||(r?`Rover ${r}`:"");return o.jsx("section",{className:"panel",children:r?o.jsx(Uo,{sessionInfo:y,audioSessionInfo:g,label:T,telemetryFrame:b,batteryConfig:w,layoutFormat:l,songNote:s?.note}):o.jsxs("div",{className:"panel-muted content-center text-center text-sm text-slate-400 aspect-video",children:[o.jsx("p",{children:"You are not assigned to a rover."}),o.jsx("p",{className:"mt-2",children:o.jsx("a",{href:"/spectate",className:"text-blue-400 underline hover:text-blue-500",children:"Click here to visit the spectator page."})})]})})}function mo({label:l,tone:i="muted"}){const s=i==="success"?"bg-emerald-900 text-emerald-100":i==="warn"?"bg-amber-900 text-amber-100":"bg-slate-800 text-slate-200";return o.jsx("span",{className:`rounded px-1 py-0.5 text-xs font-semibold leading-tight ${s}`,children:l})}function mA({entity:l,connected:i,onToggle:s}){const r=l.state==="unavailable"||!l.available,f=l.state==="on",d=r?"warn":f?"success":"muted",m=r?"Unavailable":f?"On":"Off",v=!i||r,y=r?"border-slate-800 bg-slate-900 text-slate-400 cursor-not-allowed":f?"border-emerald-700 bg-emerald-900/80 text-emerald-50 hover:bg-emerald-800":"border-rose-800 bg-rose-900/80 text-rose-50 hover:bg-rose-800";return o.jsxs("button",{type:"button",onClick:()=>s(l.id),disabled:v,className:`flex min-w-[12rem] flex-1 items-center justify-between gap-1 rounded px-1 py-0.5 text-left transition-colors ${y} disabled:opacity-60 disabled:hover:bg-inherit`,children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[o.jsx("span",{className:"truncate font-semibold text-white",children:l.name||l.id}),o.jsx(mo,{label:l.type==="light"?"Light":"Switch"})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-400",children:[o.jsx(mo,{label:m,tone:d}),!i&&o.jsx("span",{className:"text-amber-200",children:" · Offline"})]})]}),o.jsx("div",{className:"text-xs font-semibold text-white/90",children:f?"Turn off":"Turn on"})]})}function Ho(){const{session:l,homeAssistantToggle:i}=Ge(),s=l?.homeAssistant,r=p.useMemo(()=>s?.entities||[],[s?.entities]);if(!s?.enabled)return o.jsxs("section",{className:"panel-section space-y-0.5 text-sm text-slate-400",children:[o.jsx("p",{className:"text-slate-300",children:"Light Controls"}),o.jsx("p",{className:"text-slate-500",children:"Not configured on the server."})]});if(r.length===0)return o.jsxs("section",{className:"panel-section space-y-0.5 text-sm text-slate-400",children:[o.jsx("p",{className:"text-slate-300",children:"Light Controls"}),o.jsx("p",{className:"text-slate-500",children:"No lights or switches configured."})]});const f=!!s?.connected;return o.jsxs("section",{className:"panel-section space-y-0.5 text-base",children:[o.jsxs("header",{className:"flex items-center justify-between gap-0.5 text-sm text-slate-400",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("p",{children:"Light Controls"}),o.jsx("span",{className:"text-xs text-slate-500",children:r.length})]}),o.jsx(mo,{label:f?"Connected":"Offline",tone:f?"success":"warn"})]}),o.jsx("div",{className:"flex flex-wrap gap-0.5",children:r.map(d=>o.jsx(mA,{entity:d,connected:f,onToggle:i},d.id))})]})}const pA=[{id:"driveForward",label:"Drive Forward",group:"Driving"},{id:"driveBackward",label:"Drive Backward",group:"Driving"},{id:"driveLeft",label:"Turn Left",group:"Driving"},{id:"driveRight",label:"Turn Right",group:"Driving"},{id:"boostModifier",label:"Boost Modifier",group:"Driving"},{id:"slowModifier",label:"Slow Modifier",group:"Driving"},{id:"auxMainForward",label:"Main Brush Forward",group:"Aux Motors"},{id:"auxMainReverse",label:"Main Brush Reverse",group:"Aux Motors"},{id:"auxSideForward",label:"Side Brush Forward",group:"Aux Motors"},{id:"auxSideReverse",label:"Side Brush Reverse",group:"Aux Motors"},{id:"auxVacuumFast",label:"Vacuum Max",group:"Aux Motors"},{id:"auxVacuumSlow",label:"Vacuum Low",group:"Aux Motors"},{id:"auxAllForward",label:"All Aux Forward",group:"Aux Motors"},{id:"cameraUp",label:"Camera Up",group:"Camera"},{id:"cameraDown",label:"Camera Down",group:"Camera"},{id:"nightVisionToggle",label:"Toggle Night Vision",group:"Camera"},{id:"driveMacro",label:"Drive Macro",group:"Macros"},{id:"dockMacro",label:"Dock Macro",group:"Macros"},{id:"chatFocus",label:"Toggle Chat",group:"Chat"},{id:"songNoteUp",label:"Song Note Up",group:"Audio"},{id:"songNoteDown",label:"Song Note Down",group:"Audio"}];function yA(l){return l.reduce((i,s)=>((i[s.group]||(i[s.group]=[])).push(s),i),{})}function gA(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(0,Math.min(500,s)):i}const Vo=5,vi=500,xi=1,Yo=100;function vA(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(Vo,Math.min(vi,s)):i}function ir(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(xi,Math.min(Yo,s)):i}function xA(l){const s=(ir(l,l)-xi)/(Yo-xi),r=vi-s*(vi-Vo);return Math.round(r)}function bA(l){const i=vA(l,l),s=(vi-i)/(vi-Vo),r=xi+s*(Yo-xi);return Math.round(r)}function AA(l){const[i,s]=p.useState(null);return p.useEffect(()=>{if(!i)return;function r(f){if(f.preventDefault(),f.key==="Escape"){s(null);return}const d=qi(f.key??"");d&&(l(i,d,f),s(null))}return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[i,l]),{active:i,startCapture:s,cancel:()=>s(null)}}function Js({label:l,description:i,value:s,onChange:r,min:f=0,max:d=500,step:m=5}){return o.jsxs("label",{className:"surface-muted block p-0.5",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-300",children:[o.jsx("span",{className:"font-semibold text-slate-100",children:l}),o.jsx("input",{type:"number",min:f,max:d,value:s,onChange:v=>r(v.target.value),className:"w-16 rounded border border-slate-700 bg-slate-900 px-1 py-[2px] text-right text-[0.75rem] font-mono text-slate-100"})]}),i&&o.jsx("p",{className:"text-[0.65rem] text-slate-500",children:i}),o.jsxs("div",{className:"mt-0.5 flex items-center gap-0.5",children:[o.jsx("input",{type:"range",min:f,max:d,step:m,value:s,onChange:v=>r(v.target.value),className:"h-2 flex-1 accent-emerald-400"}),o.jsx("span",{className:"w-12 text-right text-[0.75rem] font-mono text-slate-400",children:s})]})]})}function SA(){const{state:{keymap:l},actions:{updateKeyBinding:i,resetKeyBindings:s}}=Vt(),{value:r,save:f}=Ht("inputs",ct),d={...ct.keyboard,...r.keyboard??{}},m=p.useMemo(()=>typeof d.tiltSpeed=="number"?ir(d.tiltSpeed,ct.keyboard.tiltSpeed):typeof d.tiltIntervalMs=="number"?ir(bA(d.tiltIntervalMs),ct.keyboard.tiltSpeed):ct.keyboard.tiltSpeed,[d.tiltIntervalMs,d.tiltSpeed]),v=p.useMemo(()=>yA(pA),[]),{active:y,startCapture:g,cancel:b}=AA((N,E)=>{i(N,E)}),A=p.useCallback(N=>l?.[N]?.[0]||hi[N]?.[0]||"",[l]),w=p.useCallback((N,E)=>{const j=ct.keyboard,M=gA(E,j[N]);f(O=>({...O??{},keyboard:{...O?.keyboard??j,[N]:M}}))},[f]),T=p.useCallback(N=>{const E=ct.keyboard,j=ir(N,E.tiltSpeed),M=xA(j);f(O=>({...O??{},keyboard:{...O?.keyboard??E,tiltSpeed:j,tiltIntervalMs:M}}))},[f]);return o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-slate-400",children:"Keyboard layout"}),o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:"Per-browser · click to change a binding"})]}),o.jsx("button",{type:"button",onClick:()=>s(),className:"button-dark text-xs",children:"Reset defaults"})]}),o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:"Keyboard speeds"}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Js,{label:"Base speed",description:"Normal driving speed",value:d.baseSpeed,onChange:N=>w("baseSpeed",N)}),o.jsx(Js,{label:"Turbo speed",description:"Used when holding the boost modifier",value:d.turboSpeed,onChange:N=>w("turboSpeed",N)}),o.jsx(Js,{label:"Precision speed",description:"Used when holding the precision modifier",value:d.precisionSpeed,onChange:N=>w("precisionSpeed",N)})]})]}),o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:"Camera tilt"}),o.jsx(Js,{label:"Tilt speed",description:"Higher = faster when holding tilt keys",value:m,onChange:T,min:1,max:100,step:1})]}),o.jsx("div",{className:"space-y-0.5",children:Object.entries(v).map(([N,E])=>o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.75rem] text-slate-400",children:N}),o.jsx("div",{className:"space-y-0.5",children:E.map(j=>{const M=A(j.id),O=y===j.id;return o.jsxs("div",{className:"surface-muted flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold text-slate-100",children:j.label}),o.jsx("p",{className:"text-[0.65rem] text-slate-400",children:pi(M)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[O&&o.jsx("button",{type:"button",onClick:()=>b(),className:"button-danger text-[0.7rem]",children:"Cancel"}),o.jsx("button",{type:"button",onClick:()=>g(j.id),className:`${O?"px-0.5 py-0.5 bg-emerald-500 text-emerald-950 hover:bg-emerald-400":"button-dark"} text-[0.7rem] font-medium transition-colors`,children:O?"Press a key…":"Change"})]})]},j.id)})})]},N))})]})}function qA(){const[l,i]=p.useState(!1);return p.useEffect(()=>{function s(){const f=navigator.getGamepads?.();i(!!(f&&Array.from(f).some(Boolean)))}s(),window.addEventListener("gamepadconnected",s),window.addEventListener("gamepaddisconnected",s);const r=setInterval(s,2e3);return()=>{window.removeEventListener("gamepadconnected",s),window.removeEventListener("gamepaddisconnected",s),clearInterval(r)}},[]),l}const EA=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),jA=[{id:"driveHorizontal",label:"Drive horizontal",type:"axis",section:"Drive joystick",path:["drive","horizontal"]},{id:"driveVertical",label:"Drive vertical",type:"axis",section:"Drive joystick",path:["drive","vertical"]},{id:"cameraVertical",label:"Camera vertical",type:"axis",section:"Camera joystick",path:["camera","vertical"]},{id:"mainAxis",label:"Main brush axis",type:"axis",section:"Brush analog",path:["brushes","mainAxis"]},{id:"sideAxis",label:"Side brush axis",type:"axis",section:"Brush analog",path:["brushes","sideAxis"]},{id:"mainReverse",label:"Toggle main reverse",type:"button",section:"Brush toggles",path:["buttons","mainReverse"]},{id:"sideReverse",label:"Toggle side reverse",type:"button",section:"Brush toggles",path:["buttons","sideReverse"]},{id:"vacuum",label:"Vacuum button",type:"button",section:"Auxiliary buttons",path:["buttons","vacuum"]},{id:"allAux",label:"All aux button",type:"button",section:"Auxiliary buttons",path:["buttons","allAux"]},{id:"drive",label:"Drive macro button",type:"button",section:"Mode buttons",path:["buttons","drive"]},{id:"dock",label:"Dock macro button",type:"button",section:"Mode buttons",path:["buttons","dock"]}];function Fs({label:l,description:i,min:s,max:r,step:f,value:d,onChange:m}){return o.jsxs("label",{className:"surface block",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-300",children:[o.jsx("span",{className:"font-semibold text-slate-100",children:l}),o.jsx("span",{className:"font-mono text-slate-400",children:EA.format(d)})]}),i&&o.jsx("p",{className:"text-[0.65rem] text-slate-500",children:i}),o.jsx("input",{type:"range",min:s,max:r,step:f,value:d,onChange:v=>m(Number(v.target.value)),className:"mt-0.5 w-full accent-emerald-400"})]})}function NA(l){return l?`Axis ${l.index}${l.invert?" (invert)":""}`:"Unassigned"}function CA(l){return l?`Button ${l.index}`:"Unassigned"}function $s(l,i,s){const[r,f]=i,d={...l??rr};return d[r]={...d[r]??rr[r]},d[r][f]=s(d[r][f]),d}function TA(){const l=qA(),{value:i,save:s,reset:r}=Ht("gamepadMapping",rr),{value:f,save:d}=Ht("inputs",ct),m=f.gamepad??ct.gamepad,[v,y]=p.useState(null),g=p.useRef(null),b=j=>{d(M=>({...M,gamepad:{...M.gamepad??ct.gamepad,...j}}))};p.useEffect(()=>{g.current=null},[v]),p.useEffect(()=>{if(!v)return;let j;const M=()=>{const O=navigator.getGamepads?.(),X=O&&Array.from(O).find(Boolean);if(X){if(v.type==="axis"){g.current||(g.current=Array.from(X.axes??[]).map(I=>I??0));for(let I=0;I<X.axes.length;I+=1){const F=X.axes[I],$=g.current?.[I]??0,V=Math.abs(F-$);if(Math.abs(F)>.65&&V>.5){s(W=>$s(W,v.path,()=>({index:I,invert:F<0}))),y(null);return}}}else if(v.type==="button")for(let I=0;I<X.buttons.length;I+=1){const F=X.buttons[I];if(F&&(F.pressed||F.value>.6)){s($=>$s($,v.path,()=>({index:I}))),y(null);return}}}j=requestAnimationFrame(M)};return j=requestAnimationFrame(M),()=>{j&&cancelAnimationFrame(j)}},[v,s]);const A=p.useMemo(()=>jA.reduce((j,M)=>((j[M.section]||(j[M.section]=[])).push(M),j),{}),[]),w=j=>{const[M,O]=j.path;return i?.[M]?.[O]??null},T=j=>{const M=w(j);return j.type==="axis"?NA(M):CA(M)},N=j=>{s(M=>$s(M,j.path,()=>null))},E=j=>{w(j)&&s(O=>$s(O,j.path,X=>({...X,invert:!X?.invert})))};return o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-slate-400",children:"Gamepad mapping"}),o.jsx("p",{className:"text-[0.65rem] text-slate-500",children:l?"Move sticks/axes with a big sweep or press buttons when capturing.":"Connect a controller to configure."}),v&&o.jsxs("p",{className:"mt-0.5 text-[0.7rem] text-emerald-400",children:["Capturing ",v.label,"…"]})]}),o.jsx("button",{type:"button",onClick:()=>r(),className:"button-dark text-xs",children:"Clear all"})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:"Sensitivity & feel"}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Fs,{label:"Drive deadzone",description:"Ignore small drive stick movement",min:0,max:.6,step:.01,value:m.driveDeadzone??.2,onChange:j=>b({driveDeadzone:j})}),o.jsx(Fs,{label:"Camera deadzone",description:"Tilt stick sensitivity",min:0,max:.6,step:.01,value:m.cameraDeadzone??.25,onChange:j=>b({cameraDeadzone:j})}),o.jsx(Fs,{label:"Servo step (deg)",description:"Degrees per camera tick",min:.5,max:6,step:.25,value:m.servoStep??2,onChange:j=>b({servoStep:j})}),o.jsx(Fs,{label:"Side reverse multiplier",description:"Scale when reversing the side brush",min:.3,max:1,step:.05,value:m.auxReverseScale??.55,onChange:j=>b({auxReverseScale:j})})]})]}),Object.entries(A).map(([j,M])=>o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:j}),o.jsx("div",{className:"space-y-0.5",children:M.map(O=>o.jsxs("div",{className:"surface-muted flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold text-slate-100",children:O.label}),o.jsx("p",{className:"text-[0.65rem] text-slate-400",children:T(O)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[O.type==="axis"&&o.jsx("button",{type:"button",disabled:!w(O),onClick:()=>E(O),className:`${w(O)?.invert?"px-0.5 py-0.5 bg-amber-400 text-amber-900 hover:bg-amber-300":"button-dark"} text-[0.7rem] font-medium disabled:opacity-50 disabled:cursor-not-allowed`,children:"Invert"}),o.jsx("button",{type:"button",onClick:()=>N(O),className:"button-dark text-[0.7rem]",children:"Clear"}),o.jsx("button",{type:"button",onClick:()=>y(O),className:`${v?.id===O.id?"px-0.5 py-0.5 bg-emerald-500 text-emerald-950 hover:bg-emerald-400":"button-dark"} text-[0.7rem] font-medium`,children:v?.id===O.id?"Waiting…":"Capture"})]})]},O.id))})]},j))]})]})}const z0=p.createContext(null);function B0(){const l=p.useContext(z0);if(!l)throw new Error("Tabs components must be used within a <Tabs> provider.");return l}const wp={primary:{base:"flex-1 px-0.5 py-0.5 text-sm font-medium transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-slate-500",active:"bg-sky-600 text-white",inactive:"bg-zinc-900 text-slate-300 hover:bg-sky-500 hover:text-white"}},U0="primary";function Qo(...l){return l.filter(Boolean).join(" ")}function L0({children:l,defaultTab:i,currentTab:s,onTabChange:r,variant:f=U0}){const[d,m]=p.useState(i??null),[v,y]=p.useState([]),g=p.useCallback(T=>T?(y(N=>N.includes(T)?N:[...N,T]),()=>y(N=>N.includes(T)?N.filter(E=>E!==T):N)):()=>{},[]),b=s??d??v[0]??null;p.useEffect(()=>{i&&s===void 0&&m(i)},[i,s]);const A=p.useCallback(T=>{T&&(s===void 0&&m(T),r&&r(T))},[s,r]),w=p.useMemo(()=>({activeTab:b,setActiveTab:A,registerTab:g,variant:f}),[b,A,g,f]);return o.jsx(z0.Provider,{value:w,children:l})}function H0({children:l,className:i=""}){return o.jsx("div",{className:Qo("flex gap-0.5",i),children:l})}function va({id:l,children:i,className:s="",disabled:r=!1}){const{activeTab:f,setActiveTab:d,registerTab:m,variant:v}=B0();p.useEffect(()=>m(l),[l,m]);const y=wp[v]??wp[U0],g=f===l,b=Qo(y.base,g?y.active:y.inactive,r?"cursor-not-allowed opacity-50":"",s);return o.jsx("button",{type:"button",className:b,onClick:()=>!r&&d(l),"aria-pressed":g,"aria-disabled":r,children:i})}function V0({children:l,className:i=""}){return o.jsx("div",{className:Qo("mt-0.5 space-y-0.5",i),children:l})}function xa({id:l,children:i,keepMounted:s=!1}){const{activeTab:r}=B0(),f=r===l;return!f&&!s?null:!f&&s?o.jsx("div",{hidden:!0,"aria-hidden":"true",children:i}):o.jsx(o.Fragment,{children:i})}function wA(){const{session:l}=Ge(),i=p.useMemo(()=>JSON.stringify(l??{},null,2),[l]);return o.jsxs("div",{className:"panel-section space-y-0.5 text-xs",children:[o.jsx("p",{className:"text-sm text-slate-400",children:"Session snapshot"}),o.jsx("pre",{className:"surface h-64 overflow-y-auto font-mono text-[0.7rem] text-lime-300",children:i})]})}const MA=[{key:"start",label:"Start OI"},{key:"safe",label:"Safe"},{key:"full",label:"Full"},{key:"passive",label:"Passive"},{key:"dock",label:"Dock"}];function RA(){const{state:{roverId:l},actions:{sendOiCommand:i,setSensorStream:s}}=Vt(),r=!!l,[f,d]=k0(),m=p.useMemo(()=>[{key:"start",label:"Enable stream",enable:!0},{key:"stop",label:"Disable stream",enable:!1}],[]),v=y=>{l&&s(y)};return o.jsxs(L0,{defaultTab:"keybindings",children:[o.jsxs(H0,{children:[o.jsx(va,{id:"keybindings",children:"Keybindings"}),o.jsx(va,{id:"controller",children:"Controller"}),o.jsx(va,{id:"page",children:"Page settings"}),o.jsx(va,{id:"admin",children:"Admin"})]}),o.jsxs(V0,{children:[o.jsx(xa,{id:"keybindings",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(SA,{})})}),o.jsx(xa,{id:"controller",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(TA,{})})}),o.jsx(xa,{id:"page",children:o.jsx("div",{className:"space-y-0.5",children:o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsx("p",{className:"text-slate-400",children:"HUD"}),o.jsxs("label",{className:"flex items-center gap-0.5 text-slate-200",children:[o.jsx("input",{type:"checkbox",className:"accent-emerald-500",checked:f,onChange:y=>d(y.target.checked)}),o.jsx("span",{children:"Show top-down map in HUD (desktop)"})]}),o.jsx("p",{className:"text-xs text-slate-500",children:"Mobile HUD keeps the map on by default."})]})})}),o.jsx(xa,{id:"admin",children:o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsx("p",{className:"text-slate-400",children:"Manual OI commands"}),o.jsx("div",{className:"surface flex flex-wrap gap-0.5",children:MA.map(y=>o.jsx("button",{type:"button",onClick:()=>i(y.key),disabled:!r,className:"button-dark text-xs disabled:opacity-30",children:y.label},y.key))})]}),o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsx("p",{className:"text-slate-400",children:"Sensor stream"}),o.jsx("div",{className:"surface flex gap-0.5",children:m.map(y=>o.jsx("button",{type:"button",onClick:()=>v(y.enable),disabled:!r,className:"flex-1 button-dark text-xs disabled:opacity-30",children:y.label},y.key))}),!r&&o.jsx("p",{className:"text-xs text-slate-500",children:"Assign a rover to toggle streams."})]}),o.jsx(zo,{}),o.jsx(M0,{}),o.jsx(wA,{})]})})]})]})}const Mp={desktop:{main:[{type:"list",title:"Chat and nicknames",items:["Set a nickname in the user list panel, on the bottom left of the page below the rover video.",{segments:["Toggle chat focus with ",{action:"chatFocus"},". Press ",{action:"chatFocus"}," again to send."]}]},{type:"list",title:"Driving the rover",items:[{segments:['Press the "Start Driving" button onscreen, or press ',{action:"driveMacro"}," on your keyboard to put the rover into driving mode."]},"Refer to the controls for the controls for the rover."]},{type:"list",title:"Docking the rover",items:["Line up the rover to the dock, about a foot away, then:",{segments:['Press the "Dock and Charge" button onscreen, or press ',{action:"dockMacro"}," on your keyboard to start docking."]},"Wait for the rover to confirm it is docked and charging before leaving it unattended."]}],aside:[{type:"keyboard",title:"Keyboard controls",footnote:"Per-browser; adjust bindings and speeds in Settings → Keybindings.",groups:[{id:"movement",title:"Movement",items:[{action:"driveForward",label:"Forward"},{action:"driveBackward",label:"Backward"},{action:"driveLeft",label:"Turn left"},{action:"driveRight",label:"Turn right"},{action:"boostModifier",label:"Boost speed"},{action:"slowModifier",label:"Precision speed"}]},{id:"macros",title:"Rover modes & chat",items:[{action:"driveMacro",label:"Drive macro"},{action:"dockMacro",label:"Dock macro"},{action:"chatFocus",label:"Chat focus"}]},{id:"camera",title:"Camera",items:[{action:"cameraUp",label:"Tilt up"},{action:"cameraDown",label:"Tilt down"},{action:"nightVisionToggle",label:"Toggle night vision"}]},{id:"motors",title:"Rover Aux Motors",items:[{action:"auxMainForward",label:"Main brush forward"},{action:"auxMainReverse",label:"Main brush reverse"},{action:"auxSideForward",label:"Side brush forward"},{action:"auxSideReverse",label:"Side brush reverse"},{action:"auxVacuumFast",label:"Vacuum max"},{action:"auxVacuumSlow",label:"Vacuum low"},{action:"auxAllForward",label:"All motors forward"}]},{id:"audio",title:"Audio / Song",items:[{action:"songNoteUp",label:"Song note up"},{action:"songNoteDown",label:"Song note down"}]}]},{type:"gamepad",title:"Gamepad / joystick",items:["Gamepad controls are not mapped by default, this is because of how terribly inconsistent gamepad implementations are across browsers and devices.","You can map gamepad controls in Settings → Controller.","Use at your own risk, it may not be perfect depending on your setup."]}]},"mobile-portrait":{main:[{type:"list",title:"Chat and nicknames",items:["Set a nickname in the user list panel below.","Tap in the chat box to send messages in the chat."]},{type:"list",title:"Driving the rover",items:[{segments:['Press the "Start Driving" button onscreen to put the rover into driving mode.']},"Look below the rover video. Use the joystick on the right to move the rover, and hold the buttons on the left to run the aux motors."]},{type:"list",title:"Docking the rover",items:["Line up the rover to the dock, about a foot away, then:",{segments:['Press the "Dock and Charge" button onscreen to start docking.']},"Wait for the rover to confirm it is docked and charging before leaving it unattended."]}]},"mobile-landscape":{main:[{type:"list",title:"Chat and nicknames",items:["Scroll down to see more of the page.","Set a nickname in the user list panel below.","Tap in the chat box to send messages in the chat."]},{type:"list",title:"Driving the rover",items:[{segments:['Press the "Start Driving" button, or the "Drive" button to put the rover into driving mode.']},"Use the joystick to the right of the video feed to move the rover, and hold the buttons on the left to run the aux motors."]},{type:"list",title:"Docking the rover",items:["Line up the rover to the dock, about a foot away, then:",{segments:['Press the "Dock and Charge" or the "Dock" button onscreen to start docking.']},"Wait for the rover to confirm it is docked and charging before leaving it unattended."]}]}};function _A(l){return Mp[l]||Mp.desktop}function Y0({actionId:l,keymap:i}){const s=i?.[l]?.[0]??"";return o.jsx("span",{className:"rounded border border-slate-600 bg-slate-900/40 px-1 text-[0.7rem] text-slate-200",children:pi(s)})}function Rp(l,i){return l.map((s,r)=>typeof s=="string"?o.jsx("span",{children:s},`text-${r}`):s?.action?o.jsx(Y0,{actionId:s.action,keymap:i},`pill-${s.action}-${r}`):s?.text?o.jsx("span",{children:s.text},`span-${r}`):null)}function yr(l,i,s){if(typeof l=="string")return l;if(Array.isArray(l?.segments))return Rp(l.segments,i);if(l&&typeof l=="object"){if(typeof l.text=="string")return l.text;if(Array.isArray(l))return Rp(l,i)}return String(l??"")}function OA({hero:l,keymap:i}){return l?o.jsxs("div",{className:"surface space-y-0.25 px-0.5 py-0.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-0.5",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-white",children:l.title}),l.subtitle&&o.jsx("p",{className:"text-xs text-slate-300",children:l.subtitle})]}),l.chips&&o.jsx("div",{className:"flex flex-wrap gap-0.25 text-[0.7rem] text-slate-200",children:l.chips.map(s=>o.jsx("span",{className:"rounded border border-slate-700 px-1 py-[2px]",children:s},s))})]}),l.bullets&&o.jsx("ul",{className:"space-y-0.25 text-[0.85rem] text-slate-200",children:l.bullets.map((s,r)=>{const f=Array.isArray(s?.segments)?`hero-${r}`:`hero-${r}`;return o.jsx("li",{className:"surface-muted px-0.5 py-0.25",children:yr(s,i)},f)})})]}):null}function DA({block:l,keymap:i}){return o.jsxs("div",{className:"space-y-0.25",children:[o.jsx("p",{className:"text-xs font-semibold text-slate-200",children:l.title}),o.jsx("ul",{className:"space-y-0.25 text-[0.8rem] text-slate-300",children:l.items.map((s,r)=>{const f=`item-${r}`;return o.jsx("li",{className:"surface-muted flex flex-wrap items-center gap-0.25 px-0.5 py-0.25",children:yr(s,i)},f)})})]})}function kA({block:l}){const i=l.tone==="info"?"border-cyan-500/40":"border-slate-700";return o.jsxs("div",{className:`surface space-y-0.25 border ${i} px-0.5 py-0.5`,children:[o.jsx("p",{className:"text-xs font-semibold text-slate-100",children:l.title}),l.body&&o.jsx("ul",{className:"space-y-0.25 text-[0.8rem] text-slate-300",children:l.body.map((s,r)=>o.jsx("li",{className:"surface-muted px-0.5 py-0.25",children:yr(s,{})},`callout-${r}`))})]})}function zA({group:l,keymap:i}){return o.jsxs("div",{className:"space-y-0.25 surface",children:[o.jsx("p",{className:"px-0.5 py-0.25 text-[0.75rem] font-semibold text-slate-200",children:l.title}),o.jsx("div",{className:"space-y-0.25 px-0.5 pb-0.25",children:l.items.map(s=>o.jsxs("div",{className:"surface-muted flex items-center justify-between gap-0.5 px-0.5 py-0.25 text-[0.8rem]",children:[o.jsx("span",{className:"text-slate-200",children:s.label}),o.jsx(Y0,{actionId:s.action,keymap:i})]},s.action))})]})}function BA({block:l,keymap:i}){return l?o.jsxs("div",{className:"space-y-0.25",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-200",children:[o.jsx("span",{className:"font-semibold",children:l.title}),l.footnote&&o.jsx("span",{className:"text-[0.7rem] text-slate-400",children:l.footnote})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-0.5",children:l.groups?.map(s=>o.jsx(zA,{group:s,keymap:i},s.id))})]}):null}function UA({block:l}){return l?o.jsxs("div",{className:"space-y-0.25",children:[o.jsx("p",{className:"text-xs font-semibold text-slate-200",children:l.title}),o.jsx("ul",{className:"space-y-0.25 text-[0.8rem] text-slate-300",children:l.items?.map((i,s)=>o.jsx("li",{className:"surface-muted px-0.5 py-0.25",children:yr(i,{})},`gamepad-${s}`))})]}):null}function _p({block:l,keymap:i}){if(!l)return null;switch(l.type){case"list":return o.jsx(DA,{block:l,keymap:i});case"callout":return o.jsx(kA,{block:l});case"keyboard":return o.jsx(BA,{block:l,keymap:i});case"gamepad":return o.jsx(UA,{block:l});default:return null}}function Q0({layout:l,keymap:i}){const s=p.useMemo(()=>_A(l),[l]),r=i||{},f=s.main||[],d=s.aside||[];return o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(OA,{hero:s.hero,keymap:r}),o.jsxs("div",{className:"grid gap-0.5",style:{gridTemplateColumns:"repeat(auto-fit, minmax(360px, 1fr))"},children:[o.jsx("div",{className:"space-y-0.5",children:f.map((m,v)=>o.jsx(_p,{block:m,keymap:r},m.title||v))}),o.jsx("div",{className:"space-y-0.5",children:d.map((m,v)=>o.jsx(_p,{block:m,keymap:r},m.title||v))})]})]})}function LA({layout:l,onOpenOverlay:i}){const{state:s}=Vt();return o.jsxs("section",{className:"panel-section space-y-0.5 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400",children:[o.jsx("span",{children:"Help"}),o.jsx("button",{type:"button",onClick:i,className:"button-dark px-1 py-0.25 text-[0.75rem]",children:"Open full help"})]}),o.jsx(Q0,{layout:l,keymap:s?.keymap||{}})]})}function HA({layout:l,onOpenHelpOverlay:i}){return o.jsx("section",{className:"panel text-base",children:o.jsxs(L0,{defaultTab:"telemetry",children:[o.jsxs(H0,{children:[o.jsx(va,{id:"telemetry",children:"Controls"}),o.jsx(va,{id:"help",children:"Help"}),o.jsx(va,{id:"settings",children:"Settings"})]}),o.jsxs(V0,{children:[o.jsx(xa,{id:"telemetry",children:o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(w0,{}),o.jsx(pr,{defaultOrientation:"horizontal",panelId:"rightpane-telemetry"}),o.jsx(Ho,{}),o.jsx(To,{})]})}),o.jsx(xa,{id:"help",children:o.jsx(LA,{layout:l,onOpenOverlay:i})}),o.jsx(xa,{id:"settings",children:o.jsx(RA,{})})]})]})})}var G0={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Op=ba.createContext&&ba.createContext(G0),VA=["attr","size","title"];function YA(l,i){if(l==null)return{};var s=QA(l,i),r,f;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);for(f=0;f<d.length;f++)r=d[f],!(i.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(l,r)&&(s[r]=l[r])}return s}function QA(l,i){if(l==null)return{};var s={};for(var r in l)if(Object.prototype.hasOwnProperty.call(l,r)){if(i.indexOf(r)>=0)continue;s[r]=l[r]}return s}function ur(){return ur=Object.assign?Object.assign.bind():function(l){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(l[r]=s[r])}return l},ur.apply(this,arguments)}function Dp(l,i){var s=Object.keys(l);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(l);i&&(r=r.filter(function(f){return Object.getOwnPropertyDescriptor(l,f).enumerable})),s.push.apply(s,r)}return s}function cr(l){for(var i=1;i<arguments.length;i++){var s=arguments[i]!=null?arguments[i]:{};i%2?Dp(Object(s),!0).forEach(function(r){GA(l,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(s)):Dp(Object(s)).forEach(function(r){Object.defineProperty(l,r,Object.getOwnPropertyDescriptor(s,r))})}return l}function GA(l,i,s){return i=XA(i),i in l?Object.defineProperty(l,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[i]=s,l}function XA(l){var i=KA(l,"string");return typeof i=="symbol"?i:i+""}function KA(l,i){if(typeof l!="object"||!l)return l;var s=l[Symbol.toPrimitive];if(s!==void 0){var r=s.call(l,i);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(l)}function X0(l){return l&&l.map((i,s)=>ba.createElement(i.tag,cr({key:s},i.attr),X0(i.child)))}function ZA(l){return i=>ba.createElement(JA,ur({attr:cr({},l.attr)},i),X0(l.child))}function JA(l){var i=s=>{var{attr:r,size:f,title:d}=l,m=YA(l,VA),v=f||s.size||"1em",y;return s.className&&(y=s.className),l.className&&(y=(y?y+" ":"")+l.className),ba.createElement("svg",ur({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,r,m,{className:y,style:cr(cr({color:l.color||s.color},s.style),l.style),height:v,width:v,xmlns:"http://www.w3.org/2000/svg"}),d&&ba.createElement("title",null,d),l.children)};return Op!==void 0?ba.createElement(Op.Consumer,null,s=>i(s)):i(G0)}function FA(l){return ZA({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"},child:[]}]})(l)}function K0({text:l="Join our Discord!"}){const{session:i}=Ge(),s=i?.discord?.invite||null;return s?o.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",npm:!0,className:"inline-flex items-center w-full h-full text-white rainbow-animate-bg transition justify-center",children:[o.jsx(FA,{className:"mr-2"}),l]}):null}function $A(l,i){if(i)return"text-indigo-200";switch(l){case"admin":case"lockdown":case"lockdown-admin":return"text-amber-300";case"spectator":return"text-slate-400";default:return"text-sky-300"}}function WA(l){const i=new Date(l);return`${i.getHours().toString().padStart(2,"0")}:${i.getMinutes().toString().padStart(2,"0")}`}function IA(l){return l.nickname||l.socketId?.slice(0,6)||"unknown"}const PA=["kal","rms","slt","ksp","bdl"],eS=Array.from({length:10},(l,i)=>i*10);function dl({hideInput:l=!1,hideSpectatorNotice:i=!1,fillHeight:s=!1}){const{session:r}=Ge(),{messages:f,sendMessage:d,registerInputRef:m,onInputFocus:v,onInputBlur:y,blurChat:g}=j0(),[b,A]=p.useState(""),[w,T]=p.useState(!1),[N,E]=p.useState(!1),[j,M]=p.useState("flite"),[O,X]=p.useState("rms"),[I,F]=p.useState(50),$=r?.role!=="spectator",V=p.useRef(null),W=r?.assignment?.roverId||null,oe=!!p.useMemo(()=>r?.roster?.find(J=>String(J.id)===String(W))||null,[W,r?.roster])?.audio?.ttsEnabled,be=p.useMemo(()=>f.slice(-200),[f]);p.useEffect(()=>{V.current&&(V.current.scrollTop=V.current.scrollHeight)},[be]),p.useEffect(()=>{E(!!oe)},[oe]);const qe=p.useMemo(()=>!oe||!N?null:j==="espeak"?{speak:!0,engine:j,pitch:I}:{speak:!0,engine:j,voice:O},[j,I,N,oe,O]);async function Z(J){if(J.preventDefault(),!$||l)return;const G=b.replace(/\\n/g,`
`).trim();if(G){T(!0);try{await d(G,qe),A(""),g()}catch(ae){alert(ae.message)}finally{T(!1)}}}const ne=s?"flex-1 min-h-0 overflow-y-auto":"h-48 overflow-y-auto";return o.jsxs("section",{className:`panel-section space-y-0.5 text-base ${s?"flex h-full flex-col overflow-hidden":""}`,children:[o.jsx("div",{className:`surface overflow-y-auto space-y-0.25 ${ne}`,ref:V,children:be.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"No messages yet."}):be.map(J=>{const z=J.role==="admin"||J.role==="lockdown"||J.role==="lockdown-admin";return o.jsxs("div",{className:`surface-muted text-sm flex items-start gap-1 ${z?"border border-amber-400/30":J.fromDiscord?"border border-indigo-400/30 bg-indigo-900/20":""}`,children:[o.jsx("span",{className:"text-[0.75rem] text-slate-400",children:WA(J.ts)}),o.jsx("span",{className:`font-semibold text-[0.85rem] ${$A(J.role,J.fromDiscord)}`,children:IA(J)}),J.fromDiscord&&o.jsx("span",{className:"rounded bg-indigo-500/30 px-1 text-[0.7rem] text-indigo-100",children:"Discord"}),J.roverId&&o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:["rover ",J.roverId]}),o.jsx("span",{className:"text-slate-100 break-words leading-tight whitespace-pre-wrap",children:J.text})]},J.id)})}),!l&&o.jsxs("form",{className:"flex flex-wrap items-start gap-0.5",onSubmit:Z,children:[o.jsx("input",{className:"field-input flex-1 min-w-[10rem]",value:b,onChange:J=>A(J.target.value),onFocus:v,onBlur:y,ref:J=>m(J),placeholder:$?"Type a message…":i?"":"Spectators cannot chat",disabled:!$}),oe&&o.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 basis-full sm:basis-auto",children:[o.jsxs("label",{className:"flex items-center gap-0.25 text-xs text-slate-300",children:[o.jsx("input",{type:"checkbox",checked:N,onChange:J=>E(J.target.checked),className:"accent-cyan-500"}),o.jsx("span",{children:"Speak"})]}),o.jsxs("select",{value:j,onChange:J=>M(J.target.value),className:"field-input text-xs",children:[o.jsx("option",{value:"flite",children:"flite"}),o.jsx("option",{value:"espeak",children:"espeak"})]}),j==="flite"?o.jsx("select",{value:O,onChange:J=>X(J.target.value),className:"field-input text-xs",children:PA.map(J=>o.jsx("option",{value:J,children:J},J))}):o.jsx("select",{value:I,onChange:J=>F(Number(J.target.value)),className:"field-input text-xs",children:eS.map(J=>o.jsxs("option",{value:J,children:["pitch ",J]},J))})]}),o.jsx("button",{type:"submit",disabled:!$||w,className:"button-dark disabled:opacity-50 self-start",children:w?"...":"Send"})]})]})}function Z0({compact:l=!1}){const{session:i,setNickname:s}=Ge(),{value:r,save:f}=Ht("profile",{nickname:""}),[d,m]=p.useState(r.nickname||""),[v,y]=p.useState(!1),g=i?.role!=="spectator";p.useEffect(()=>{m(r.nickname||"")},[r.nickname]);async function b(A){if(A.preventDefault(),!g)return;const w=(d||"").trim().slice(0,32);if(w){y(!0);try{await s(w),f({nickname:w})}catch(T){alert(T.message)}finally{y(!1)}}}return o.jsxs("form",{className:"flex gap-0.5",onSubmit:b,children:[o.jsx("input",{className:"field-input flex-1",value:d,onChange:A=>m(A.target.value),maxLength:32,placeholder:"Enter a nickname",disabled:!g}),o.jsx("button",{type:"submit",disabled:!g||v,className:"button-dark disabled:opacity-50",children:v?"Saving…":l?"Set":"Save"})]})}const tS=new Set(["admin","lockdown","lockdown-admin"]),nS=new Set(["admin","lockdown"]);function aS(l="admin"){return l==="lockdown"?{title:"Lockdown mode active",description:"Only the server owners can access the interface at this time."}:{title:"Admin mode active",description:"The server is currently in admin mode. Only admins can access the interface."}}function lS(){const{session:l}=Ge(),i=l?.mode,s=l?.role,r=nS.has(i),f=tS.has(s);if(!r||f)return null;const d=aS(i);return o.jsx("div",{className:"pointer-events-auto fixed inset-0 z-50 flex items-center justify-center bg-black/85 px-0.5 py-0.5",children:o.jsxs("div",{className:"surface w-full max-w-md space-y-0.5 text-slate-100 shadow-2xl",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx("p",{className:"text-lg font-semibold",children:d.title}),o.jsx("p",{className:"text-sm text-slate-300",children:d.description})]}),o.jsx("div",{className:"surface-muted",children:o.jsx(zo,{})}),o.jsx("div",{className:"w-full justify-center items-center",children:o.jsx(K0,{text:"Join our Discord server for updates!"})}),"You can use the chat from here though :3",o.jsxs("div",{className:"max-h-80 overflow-y-auto",children:[o.jsx(dl,{}),o.jsx(Z0,{})]})]})})}const iS="/assets/turn_alert-DVO8EZJa.mp3";function sS(l){const i=p.useRef(null);return p.useEffect(()=>{i.current=new Audio(l),i.current.load()},[l]),()=>{i.current&&(i.current.currentTime=0,i.current.play().catch(()=>{}))}}function rS(){const{session:l,pushAlert:i}=Ge(),s=sS(iS),r=p.useRef(new Set),f=p.useMemo(()=>l?.turnQueues||{},[l?.turnQueues]),d=l?.socketId||null;return p.useEffect(()=>{if(!d)return;const m=[];Object.entries(f).forEach(([v,y])=>{!y||!y.current||y.current!==d||r.current.has(v)||(m.push(v),r.current.add(v))}),Object.keys(f).forEach(v=>{(!f[v]||f[v].current!==d)&&r.current.delete(v)}),m.length!==0&&(m.forEach(v=>{const y=l?.roster?.find(g=>String(g.id)===String(v))?.name||v;i({title:"Your turn!",message:`You now control ${y}.`,color:"success"})}),s())},[f,s,i,l?.roster,d]),null}function kp(l){switch(l){case"admin":case"lockdown":case"lockdown-admin":return"text-amber-300";case"spectator":return"text-slate-400";default:return"text-sky-300"}}function zp(l,i){if(!l)return"";const s=l.nickname||l.socketId?.slice(0,6)||"unknown";return l.socketId&&l.socketId===i?`${s} (you)`:s}function gr({hideNicknameForm:l=!1,hideHeader:i=!1,className:s="",fillHeight:r=!1}){const{session:f,setNickname:d}=Ge(),{value:m}=Ht("profile",{nickname:""}),v=p.useRef(null),y=Sa(),g=f?.role!=="spectator",b=f?.users??[],A=f?.socketId||null,w=f?.mode==="turns",T=f?.turnQueues||{},N=f?.roster||[];p.useEffect(()=>{if(!g||!f?.socketId)return;const V=m.nickname||"";if(!V||f.socketId===v.current)return;const W=f.socketId;d(V).then(()=>{v.current=W}).catch(()=>{})},[g,f?.socketId,d,m.nickname]),p.useEffect(()=>{if(!y)return;const V=()=>{if(!g)return;const W=(m.nickname||"").trim();W&&d(W).then(()=>{v.current=f?.socketId||null}).catch(()=>{})};return y.on("connect",V),()=>y.off("connect",V)},[g,d,y,m.nickname,f?.socketId]);const E=p.useMemo(()=>[...b].sort((V,W)=>V.socketId===A?-1:W.socketId===A?1:(V.nickname||"").localeCompare(W.nickname||"")),[A,b]),j=p.useCallback(V=>N.find(W=>String(W.id)===String(V))?.name||V,[N]),M=p.useCallback(V=>b.find(W=>W.socketId===V)||{socketId:V,nickname:null,role:null},[b]),O=p.useCallback(V=>{if(!V)return null;const W=V-Date.now();return W<=0?0:Math.ceil(W/1e3)},[]),X=r?"flex-1 min-h-0 overflow-y-auto":"h-48 overflow-y-auto",I=w&&r?"max-h-40 overflow-y-auto":X,F=w&&r?"flex-1 min-h-0 overflow-y-auto":X,$=()=>E.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"Waiting for users…"}):E.map(V=>{const W=V.role==="admin"||V.role==="lockdown"||V.role==="lockdown-admin";return o.jsxs("div",{className:"surface-muted flex items-center gap-1 text-sm",children:[o.jsx("p",{className:`font-semibold ${kp(V.role)}`,children:zp(V,A)}),V.roverId?o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:["rover ",V.roverId]}):o.jsx("span",{className:"text-[0.7rem] text-slate-500",children:"no rover"}),W&&o.jsx("span",{className:"rounded bg-amber-500/30 px-1 text-[0.7rem] text-amber-200",children:"Admin"})]},V.socketId)});return o.jsxs("section",{className:`panel-section space-y-0.5 text-base ${r?"flex h-full min-h-0 flex-col overflow-hidden":""} ${s}`,children:[!l&&o.jsxs("div",{className:"space-y-0.5 flex",children:[o.jsx("div",{className:"w-1/2",children:o.jsx(Z0,{})}),o.jsx("div",{className:"w-1/2",children:o.jsx(K0,{})}),!g&&o.jsx("p",{className:"text-xs text-slate-500",children:"Spectators cannot set nicknames."})]}),o.jsxs("div",{className:`space-y-0.5 ${r?"flex flex-1 min-h-0 flex-col":""}`,children:[!i&&o.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-400",children:[o.jsx("span",{children:w?"Turn queues":"Users"}),o.jsx("span",{className:"text-xs text-slate-500",children:w?Object.keys(T||{}).length:E.length})]}),o.jsx("div",{className:`surface space-y-0.25 ${w?I:X}`,children:w?Object.keys(T||{}).length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"No turn queues yet."}):Object.entries(T).map(([V,W])=>{const te=W?.queue||[],oe=W?.idleDeadline||W?.deadline||null,be=O(oe);return o.jsxs("div",{className:"surface-muted flex flex-col gap-0.25 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("p",{className:"font-semibold text-slate-200",children:j(V)}),be!=null&&o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:[be,"s left"]})]}),te.length===0?o.jsx("p",{className:"text-[0.75rem] text-slate-500",children:"No drivers queued."}):o.jsx("div",{className:"flex flex-wrap items-center gap-1",children:te.map((qe,Z)=>{const ne=M(qe),J=qe===W?.current,z=ne.role==="admin"||ne.role==="lockdown"||ne.role==="lockdown-admin";return o.jsxs("span",{className:`flex items-center gap-0.5 rounded px-1 text-[0.8rem] ${J?"bg-sky-700 text-white":"bg-slate-800 text-slate-200"}`,children:[o.jsx("span",{className:`${kp(ne.role)} font-semibold`,children:zp(ne,A)}),z&&o.jsx("span",{className:"text-[0.7rem] text-amber-200",children:"★"}),J&&o.jsx("span",{className:"text-[0.7rem] text-slate-200",children:"now"})]},`${V}-${qe}-${Z}`)})})]},V)}):$()}),w?o.jsxs("div",{className:`space-y-0.25 ${r?"flex min-h-0 flex-1 flex-col":""}`,children:[o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400",children:[o.jsx("span",{children:"Users"}),o.jsx("span",{className:"text-[0.7rem] text-slate-500",children:E.length})]}),o.jsx("div",{className:`surface space-y-0.25 ${F}`,children:$()})]}):null]})]})}function uS({visible:l,mode:i,onEnterFullscreen:s,onDismiss:r}){if(!l)return null;const f=i==="pwa-hint";return o.jsx("div",{className:"fixed inset-0 z-40 flex items-end justify-center p-2 pointer-events-none sm:items-center",children:o.jsx("div",{className:"pointer-events-auto w-full max-w-sm rounded-lg border border-cyan-500/40 bg-zinc-950/95 shadow-xl",children:o.jsxs("div",{className:"space-y-2 p-4 text-sm text-slate-100",children:[o.jsx("h2",{className:"text-base font-semibold text-white",children:"Better in fullscreen"}),f?o.jsxs("p",{className:"text-slate-300",children:["For fullscreen on iOS, open Safari's share menu and pick ",o.jsx("strong",{children:"Add to Home Screen"}),". Launching from the home screen removes the browser chrome."]}):o.jsx("p",{className:"text-slate-300",children:"Enable fullscreen to free up more space for the video feed and controls. You can exit fullscreen at any time via the system back or home gesture."}),o.jsxs("div",{className:"flex justify-end gap-2 pt-1 text-sm",children:[o.jsx("button",{type:"button",className:"rounded border border-slate-600 px-3 py-1 text-slate-200",onClick:r,children:f?"Got it":"Not now"}),!f&&o.jsx("button",{type:"button",className:"rounded bg-cyan-500 px-3 py-1 font-semibold text-black hover:bg-cyan-400",onClick:s,children:"Enter fullscreen"})]})]})})})}const J0="fullscreenPromptDismissed",cS=new Set(["mobile-portrait","mobile-landscape"]),F0=()=>{if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}},oS=()=>{const l=F0();if(!l)return!1;try{return l.getItem(J0)==="1"}catch{return!1}},Bp=()=>{const l=F0();if(l)try{l.setItem(J0,"1")}catch{}},fS=()=>{if(typeof navigator>"u")return!1;const l=navigator.userAgent||navigator.platform||"";return/iphone|ipad|ipod/i.test(l)},dS=()=>{if(typeof document>"u")return!1;const l=document;return!!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled)};function hS(l){const i=cS.has(l),[s,r]=p.useState(!1),[f,d]=p.useState("native"),m=p.useMemo(()=>fS(),[]),v=p.useCallback(()=>{if(!i){r(!1);return}if(oS()){r(!1);return}if(m){d("pwa-hint"),r(!0);return}if(!dS()){r(!1);return}if(typeof document<"u"&&document.fullscreenElement){r(!1);return}d("native"),r(!0)},[m,i]);p.useEffect(()=>{v()},[v]),p.useEffect(()=>{if(typeof document>"u")return;const b=()=>{if(document.fullscreenElement){r(!1);return}v()};return document.addEventListener("fullscreenchange",b),document.addEventListener("webkitfullscreenchange",b),()=>{document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b)}},[v]);const y=p.useCallback(()=>{Bp(),r(!1)},[]),g=p.useCallback(async()=>{if(!i||m||typeof document>"u")return!1;const b=document.documentElement;if(!b)return!1;const A=b.requestFullscreen||b.webkitRequestFullscreen||b.mozRequestFullScreen||b.msRequestFullscreen;if(!A)return!1;try{const w=A.call(b);return w&&typeof w.then=="function"&&await w,Bp(),r(!1),!0}catch(w){return console.warn("Failed to enter fullscreen",w),!1}},[m,i]);return p.useEffect(()=>{i||r(!1)},[i]),{visible:s,mode:f,enterFullscreen:g,dismiss:y}}function mS({visible:l,layout:i,onClose:s,showOnLoad:r,onToggleShowOnLoad:f}){if(!l)return null;const{state:d}=Vt(),m=v=>{const y=!v.target.checked;f?.(y)};return o.jsx("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-black/80 px-0.5 py-0.5",children:o.jsxs("div",{className:"pointer-events-auto surface w-full max-w-4xl max-h-[90vh] overflow-hidden shadow-2xl",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-slate-700 px-0.5 py-0.25 text-sm text-slate-200",children:[o.jsx("span",{className:"font-semibold",children:"Help & controls"}),o.jsxs("div",{className:"flex items-center gap-0.5 text-[0.8rem] text-slate-300",children:[o.jsxs("label",{className:"flex items-center gap-0.25",children:[o.jsx("input",{type:"checkbox",checked:!r,onChange:m,className:"accent-cyan-500"}),o.jsx("span",{children:"Don't show again"})]}),o.jsx("button",{type:"button",onClick:s,className:"button-dark px-2 py-0.25 text-[0.8rem]",children:"Close"})]})]}),o.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-0.5",children:o.jsx(Q0,{layout:i,keymap:d?.keymap||{}})})]})})}function pS(){const[l,i]=p.useState(()=>typeof window>"u"||window.innerWidth>=1024?"desktop":window.innerWidth>window.innerHeight?"mobile-landscape":"mobile-portrait");return p.useEffect(()=>{function s(){if(typeof window>"u")return;const{innerWidth:r,innerHeight:f}=window;r>=1024?i("desktop"):r>f?i("mobile-landscape"):i("mobile-portrait")}return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),l}function yS({layout:l,onOpenHelpOverlay:i}){return o.jsxs("div",{className:"flex h-full gap-0.5 overflow-hidden",children:[o.jsxs("div",{className:"flex min-w-0 flex-[1.8] flex-col gap-0.5 overflow-y-auto pr-0.5",children:[o.jsx(Lo,{}),o.jsxs("div",{className:"grid h-52 grid-cols-2 gap-0.5",children:[o.jsx("div",{className:"h-full min-h-0",children:o.jsx(gr,{fillHeight:!0})}),o.jsx("div",{className:"h-full min-h-0",children:o.jsx(dl,{fillHeight:!0})})]}),o.jsx(ko,{})]}),o.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-y-auto",children:o.jsx(HA,{layout:l,onOpenHelpOverlay:i})})]})}function gS(){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx(Lo,{layoutFormat:"mobile"}),o.jsx(F1,{}),o.jsx(w0,{}),o.jsx(dl,{}),o.jsx(gr,{}),o.jsx(To,{}),o.jsx(zo,{}),o.jsx(M0,{}),o.jsx(pr,{panelId:"mobile-portrait-room"}),o.jsx(Ho,{}),o.jsx(ko,{})]})}function vS(){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsxs("section",{className:"grid min-h-screen grid-cols-[minmax(0,0.7fr)_minmax(0,2.1fr)_minmax(0,0.7fr)] gap-0.5",children:[o.jsx(Z1,{}),o.jsxs("div",{children:[o.jsx(Lo,{layoutFormat:"mobile"}),o.jsx(To,{})]}),o.jsx(J1,{})]}),o.jsxs("div",{className:"flex flex-col gap-0.5 pb-0.5",children:[o.jsxs("section",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-0.5",children:[o.jsx("div",{className:"flex flex-col gap-0.5",children:o.jsx(gr,{})}),o.jsx("div",{className:"flex flex-col gap-0.5",children:o.jsx(dl,{})})]}),o.jsx(pr,{panelId:"mobile-landscape-room"}),o.jsx(Ho,{})]})]})}function xS(){const l=pS(),i=l==="desktop",s=hS(l);return o.jsx("div",{className:`bg-black text-slate-100 ${i?"h-screen overflow-hidden":"min-h-screen"}`,children:o.jsx(Mo,{children:o.jsx(bS,{layout:l,isDesktop:i,fullscreen:s})})})}function bS({layout:l,isDesktop:i,fullscreen:s}){const{visible:r,mode:f,enterFullscreen:d,dismiss:m}=s,{value:v,status:y,save:g}=Ht("help",{showOnLoad:!0}),[b,A]=p.useState(!1);p.useEffect(()=>{y==="ready"&&A(v?.showOnLoad!==!1)},[y,v?.showOnLoad]);const w=p.useCallback(()=>A(!0),[]),T=p.useCallback(()=>A(!1),[]),N=p.useCallback(j=>{const M=!!j;g(O=>({...O??{},showOnLoad:M})),M||A(!1)},[g]),E=p.useMemo(()=>i?o.jsx(yS,{layout:l,onOpenHelpOverlay:w}):l==="mobile-landscape"?o.jsx(vS,{}):o.jsx(gS,{}),[i,l,w]);return o.jsxs(p1,{children:[o.jsx(E1,{}),o.jsx(j1,{}),o.jsx("main",{className:`flex w-full flex-col gap-0.5 text-base ${i?"h-full overflow-hidden":""}`,children:E}),o.jsx(L1,{}),o.jsx(rS,{}),o.jsx(lS,{}),o.jsx(mS,{visible:b,layout:l,onClose:T,showOnLoad:v?.showOnLoad!==!1,onToggleShowOnLoad:N}),o.jsx(uS,{visible:r,mode:f,onEnterFullscreen:d,onDismiss:m})]})}function $0(){const{session:l,setRole:i,subscribeAll:s,connected:r}=Ge(),[f,d]=p.useState(!1);return p.useEffect(()=>{let m=!1;async function v(){if(l?.mode==="lockdown"){d(!1);return}try{l?.role!=="spectator"&&await i("spectator"),await s(),m||d(!0)}catch(y){console.error("Failed to enter spectator mode",y),m||d(!1)}}return v(),()=>{m=!0}},[r,l?.mode,l?.role,i,s]),f}function AS({roverId:l,session:i}){const s=i?.activeDrivers?.[l]||null,f=(i?.users||[]).find(y=>y.socketId===s)?.nickname||(s?s.slice(0,6):"No driver"),d=i?.mode,m=i?.turnQueues?.[l];return d==="turns"&&m?.current?`${f} (turns)`:f}function SS({rover:l,frame:i,videoInfo:s,audioInfo:r,session:f}){const d=AS({roverId:l.id,session:f});return o.jsx("article",{className:"min-h-[16rem] rounded bg-zinc-900 p-0.5 sm:min-h-[18rem]",children:o.jsx("div",{className:"min-h-0 overflow-hidden rounded bg-black/20",children:o.jsx(Uo,{sessionInfo:s,audioSessionInfo:r,label:l.name,telemetryFrame:i,batteryConfig:l.battery,hudVariant:"spectator",driverLabel:d,hudForceMap:!0,hudMapPosition:"bottom-left"})})})}function qS({roster:l,frames:i,videoSources:s,session:r}){return l.length===0?o.jsx("p",{className:"col-span-full text-slate-400",children:"No rovers registered."}):o.jsx("section",{className:"grid grid-cols-1 gap-0.5 md:grid-cols-2",children:l.map(f=>o.jsx(SS,{rover:f,frame:i[f.id],videoInfo:s[f.id],audioInfo:s[`${f.id}-audio`],session:r,showHudMap:!0,hudMapPosition:"bottom-left"},f.id))})}function ES(){return o.jsx("section",{className:"min-h-0",children:o.jsx("div",{className:"surface min-h-[14rem] overflow-hidden",children:o.jsx(pr,{defaultOrientation:"horizontal",hideLayoutToggle:!0,hideHeader:!0,panelId:"spectator-secondary"})})})}function jS({className:l=""}){return o.jsx("div",{className:`panel ${l}`,children:o.jsx(ko,{})})}function NS(){const{session:l}=Ge();$0();const i=Co(),s=l?.roster??[],r=s.flatMap(d=>{const m={type:"rover",id:d.id,key:d.id};return d.media?.audioPublishUrl?[m,{type:"rover",id:`${d.id}-audio`,key:`${d.id}-audio`}]:[m]}),f=Bo(r);return o.jsx(Mo,{children:o.jsx("div",{className:"min-h-screen bg-black text-slate-100 md:h-screen md:overflow-hidden",children:o.jsxs("main",{className:"grid min-h-screen grid-cols-1 gap-0.5 p-0.5 md:h-full md:min-h-0 md:grid-cols-[minmax(0,1fr)_18rem] lg:grid-cols-[minmax(0,1fr)_20rem]",children:[o.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col gap-0.5 md:overflow-y-auto",children:[o.jsx(qS,{roster:s,frames:i,videoSources:f,session:l}),o.jsx(ES,{})]}),o.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col gap-0.5 md:h-full",children:[o.jsx("div",{className:"panel",children:o.jsx(Do,{roster:s,title:"Rovers",emptyText:"No rovers registered."})}),o.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:o.jsx(gr,{hideNicknameForm:!0,hideHeader:!0,fillHeight:!0,className:"h-full"})}),o.jsx("div",{className:"min-h-0 min-w-0 flex-[1.1] overflow-hidden",children:o.jsx(dl,{hideInput:!0,hideSpectatorNotice:!0,fillHeight:!0})}),o.jsx("div",{className:"min-h-0 min-w-0",children:o.jsx(jS,{className:"h-40 overflow-hidden"})})]})]})})})}const CS=2e4;function TS({roverId:l,session:i}){const s=i?.activeDrivers?.[l]||null,f=(i?.users||[]).find(v=>v.socketId===s)?.nickname||(s?s.slice(0,6):"No driver"),d=i?.mode,m=i?.turnQueues?.[l];return d==="turns"&&m?.current?`${f} (turns)`:f}function wS(){const{session:l}=Ge(),i=$0(),s=Co(),r=l?.roster??[],f=l?.roomCameras||[],d=O0(f.map(F=>({id:F.id}))),[m,v]=p.useState(0),y=p.useMemo(()=>r.flatMap(F=>{if(!F?.id)return[];const $=String(F.id),V=[{type:"rover",id:$,key:$}];return F.media?.audioPublishUrl&&V.push({type:"rover",id:`${$}-audio`,key:`${$}-audio`}),V}),[r]),g=Bo(y),b=p.useMemo(()=>{if(!r.length)return[];const F=r.filter($=>g[$.id]?.url);return F.length?F:r},[r,g]),A=p.useMemo(()=>{const F=[];return b.forEach($=>F.push({type:"rover",rover:$})),f.forEach($=>F.push({type:"room",camera:$})),F},[b,f]),w=p.useMemo(()=>A.map(F=>F.type==="rover"?`r:${F.rover.id}`:`room:${F.camera.id}`).join("|"),[A]);p.useEffect(()=>{v(0)},[w]),p.useEffect(()=>{if(!A.length)return;const F=setInterval(()=>{v($=>($+1)%A.length)},CS);return()=>clearInterval(F)},[A.length,w]);const T=A.length?A[m%A.length]:null,N=T?.type==="rover"?T.rover:null,E=T?.type==="room"?T.camera:null,j=N&&g[N.id]||null,M=N&&g[`${N.id}-audio`]||null,O=N&&s[N.id]||null,X=N?TS({roverId:N.id,session:l}):null,I=E&&d[E.id]||null;return o.jsxs("div",{className:"relative h-screen w-screen overflow-hidden bg-black p-0.5 text-slate-100 flex flex-col gap-0.5",children:[o.jsx(_S,{}),o.jsx("section",{className:"panel relative flex min-h-0 flex-1 overflow-hidden",children:i?N?o.jsx(Up,{children:o.jsx(Uo,{sessionInfo:j,audioSessionInfo:M,label:N.name||N.id,telemetryFrame:O,batteryConfig:N.battery,layoutFormat:"mobile",hudVariant:"spectator",driverLabel:X,hudForceMap:!0,hudMapPosition:"bottom-left"})}):E?o.jsx(Up,{children:o.jsx(RS,{camera:E,feed:I})}):o.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-slate-500",children:"No sources available."}):o.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-slate-500",children:"Switching to spectator…"})})]})}function MS(){return o.jsx(Mo,{children:o.jsx(wS,{})})}function RS({camera:l,feed:i}){const s=i?.objectUrl,r=i&&i.status==="connecting";return o.jsxs("div",{className:"relative h-full w-full bg-zinc-950",children:[s?o.jsx("img",{src:i.objectUrl,alt:l.name||l.id,className:"h-full w-full object-cover",draggable:!1}):o.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-slate-500",children:r?`Connecting to ${l.name||l.id}…`:"No frame yet"}),o.jsx("div",{className:"absolute left-1 top-1 rounded bg-black/60 px-1 py-0.25 text-xs text-slate-200",children:l.name||l.id})]})}function _S(){return o.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1 z-30",style:{transform:"translate(-50%, 0) scale(0.7)",transformOrigin:"top center"},children:o.jsx("div",{className:"pointer-events-none overflow-hidden rounded-md",style:{width:"50vw",minWidth:"16rem",maxWidth:"24rem",opacity:.55,maxHeight:"12rem"},children:o.jsx(dl,{hideInput:!0,hideSpectatorNotice:!0})})})}function Up({children:l}){return o.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-hidden bg-black",children:o.jsx("div",{className:"relative flex items-center justify-center overflow-hidden bg-black",style:{width:"min(100%, calc(100vh * 16 / 9))",height:"min(100%, calc(100vw * 9 / 16))",maxWidth:"100%",maxHeight:"100%",aspectRatio:"16 / 9"},children:o.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-hidden",children:l})})})}wv.createRoot(document.getElementById("root")).render(o.jsx(p.StrictMode,{children:o.jsx(Zb,{children:o.jsx(Fb,{children:o.jsx($b,{children:o.jsx(g1,{children:o.jsx(Gx,{children:o.jsxs(Ax,{children:[o.jsx(Ws,{path:"/",element:o.jsx(xS,{})}),o.jsx(Ws,{path:"/spectate",element:o.jsx(NS,{})}),o.jsx(Ws,{path:"/mini",element:o.jsx(MS,{})})]})})})})})})}));