mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
13 lines
395 KiB
JavaScript
13 lines
395 KiB
JavaScript
(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 _c={exports:{}},li={};var Gm;function bv(){if(Gm)return li;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 li.Fragment=i,li.jsx=s,li.jsxs=s,li}var Xm;function Av(){return Xm||(Xm=1,_c.exports=bv()),_c.exports}var o=Av(),Oc={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 D(){}D.prototype=M.prototype;function G(S,U,Q){this.props=S,this.context=U,this.refs=j,this.updater=Q||N}var I=G.prototype=new D;I.constructor=G,E(I,M.prototype),I.isPureReactComponent=!0;var F=Array.isArray;function $(){}var Y={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function ie(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 ie(S.type,U,S.props)}function xe(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function Se(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return U[Q]})}var Z=/\/+/g;function ee(S,U){return typeof S=="object"&&S!==null&&S.key!=null?Se(""+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===""?"."+ee(S,0):K,F(P)?(Q="",me!=null&&(Q=me.replace(Z,"$&/")+"/"),z(P,U,Q,"",function(Kt){return Kt})):P!=null&&(xe(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 $e=K===""?".":K+":";if(F(S))for(var _e=0;_e<S.length;_e++)K=S[_e],re=$e+ee(K,_e),me+=z(K,U,Q,re,P);else if(_e=T(S),typeof _e=="function")for(S=_e.call(S),_e=0;!(K=S.next()).done;)K=K.value,re=$e+ee(K,_e++),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 X(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 ne(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 te=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:X,forEach:function(S,U,Q){X(S,function(){U.apply(this,arguments)},Q)},count:function(S){var U=0;return X(S,function(){U++}),U},toArray:function(S){return X(S,function(U){return U})||[]},only:function(S){if(!xe(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=G,fe.StrictMode=r,fe.Suspense=y,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,fe.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Y.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),$e=0;$e<re;$e++)me[$e]=arguments[$e+2];K.children=me}return ie(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 $e=Array(me),_e=0;_e<me;_e++)$e[_e]=arguments[_e+2];P.children=$e}if(S&&S.defaultProps)for(K in me=S.defaultProps,me)P[K]===void 0&&(P[K]=me[K]);return ie(S,re,P)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(S){return{$$typeof:v,render:S}},fe.isValidElement=xe,fe.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:ne}},fe.memo=function(S,U){return{$$typeof:g,type:S,compare:U===void 0?null:U}},fe.startTransition=function(S){var U=Y.T,Q={};Y.T=Q;try{var K=S(),P=Y.S;P!==null&&P(Q,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then($,te)}catch(re){te(re)}finally{U!==null&&Q.types!==null&&(U.types=Q.types),Y.T=U}},fe.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},fe.use=function(S){return Y.H.use(S)},fe.useActionState=function(S,U,Q){return Y.H.useActionState(S,U,Q)},fe.useCallback=function(S,U){return Y.H.useCallback(S,U)},fe.useContext=function(S){return Y.H.useContext(S)},fe.useDebugValue=function(){},fe.useDeferredValue=function(S,U){return Y.H.useDeferredValue(S,U)},fe.useEffect=function(S,U){return Y.H.useEffect(S,U)},fe.useEffectEvent=function(S){return Y.H.useEffectEvent(S)},fe.useId=function(){return Y.H.useId()},fe.useImperativeHandle=function(S,U,Q){return Y.H.useImperativeHandle(S,U,Q)},fe.useInsertionEffect=function(S,U){return Y.H.useInsertionEffect(S,U)},fe.useLayoutEffect=function(S,U){return Y.H.useLayoutEffect(S,U)},fe.useMemo=function(S,U){return Y.H.useMemo(S,U)},fe.useOptimistic=function(S,U){return Y.H.useOptimistic(S,U)},fe.useReducer=function(S,U,Q){return Y.H.useReducer(S,U,Q)},fe.useRef=function(S){return Y.H.useRef(S)},fe.useState=function(S){return Y.H.useState(S)},fe.useSyncExternalStore=function(S,U,Q){return Y.H.useSyncExternalStore(S,U,Q)},fe.useTransition=function(){return Y.H.useTransition()},fe.version="19.2.0",fe}var Zm;function mo(){return Zm||(Zm=1,Oc.exports=Sv()),Oc.exports}var p=mo();const xa=xv(p);var Dc={exports:{}},ii={},kc={exports:{}},zc={};var Jm;function qv(){return Jm||(Jm=1,(function(l){function i(z,X){var ne=z.length;z.push(X);e:for(;0<ne;){var te=ne-1>>>1,se=z[te];if(0<f(se,X))z[te]=X,z[ne]=se,ne=te;else break e}}function s(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var X=z[0],ne=z.pop();if(ne!==X){z[0]=ne;e:for(var te=0,se=z.length,S=se>>>1;te<S;){var U=2*(te+1)-1,Q=z[U],K=U+1,P=z[K];if(0>f(Q,ne))K<se&&0>f(P,Q)?(z[te]=P,z[K]=ne,te=K):(z[te]=Q,z[U]=ne,te=U);else if(K<se&&0>f(P,ne))z[te]=P,z[K]=ne,te=K;else break e}}return X}function f(z,X){var ne=z.sortIndex-X.sortIndex;return ne!==0?ne:z.id-X.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,D=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function I(z){for(var X=s(g);X!==null;){if(X.callback===null)r(g);else if(X.startTime<=z)r(g),X.sortIndex=X.expirationTime,i(y,X);else break;X=s(g)}}function F(z){if(E=!1,I(z),!N)if(s(y)!==null)N=!0,$||($=!0,Se());else{var X=s(g);X!==null&&J(F,X.startTime-z)}}var $=!1,Y=-1,W=5,ie=-1;function oe(){return j?!0:!(l.unstable_now()-ie<W)}function xe(){if(j=!1,$){var z=l.unstable_now();ie=z;var X=!0;try{e:{N=!1,E&&(E=!1,D(Y),Y=-1),T=!0;var ne=w;try{t:{for(I(z),A=s(y);A!==null&&!(A.expirationTime>z&&oe());){var te=A.callback;if(typeof te=="function"){A.callback=null,w=A.priorityLevel;var se=te(A.expirationTime<=z);if(z=l.unstable_now(),typeof se=="function"){A.callback=se,I(z),X=!0;break t}A===s(y)&&r(y),I(z)}else r(y);A=s(y)}if(A!==null)X=!0;else{var S=s(g);S!==null&&J(F,S.startTime-z),X=!1}}break e}finally{A=null,w=ne,T=!1}X=void 0}}finally{X?Se():$=!1}}}var Se;if(typeof G=="function")Se=function(){G(xe)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=xe,Se=function(){ee.postMessage(null)}}else Se=function(){M(xe,0)};function J(z,X){Y=M(function(){z(l.unstable_now())},X)}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 X=3;break;default:X=w}var ne=w;w=X;try{return z()}finally{w=ne}},l.unstable_requestPaint=function(){j=!0},l.unstable_runWithPriority=function(z,X){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ne=w;w=z;try{return X()}finally{w=ne}},l.unstable_scheduleCallback=function(z,X,ne){var te=l.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?te+ne:te):ne=te,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=ne+se,z={id:b++,callback:X,priorityLevel:z,startTime:ne,expirationTime:se,sortIndex:-1},ne>te?(z.sortIndex=ne,i(g,z),s(y)===null&&z===s(g)&&(E?(D(Y),Y=-1):E=!0,J(F,ne-te))):(z.sortIndex=se,i(y,z),N||T||(N=!0,$||($=!0,Se()))),z},l.unstable_shouldYield=oe,l.unstable_wrapCallback=function(z){var X=w;return function(){var ne=w;w=X;try{return z.apply(this,arguments)}finally{w=ne}}}})(zc)),zc}var Fm;function Ev(){return Fm||(Fm=1,kc.exports=qv()),kc.exports}var Bc={exports:{}},ut={};var $m;function jv(){if($m)return ut;$m=1;var l=mo();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 ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ut.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)},ut.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()}},ut.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))},ut.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},ut.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})}},ut.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)},ut.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})}},ut.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)},ut.requestFormReset=function(y){r.d.r(y)},ut.unstable_batchedUpdates=function(y,g){return y(g)},ut.useFormState=function(y,g,b){return m.H.useFormState(y,g,b)},ut.useFormStatus=function(){return m.H.useHostTransitionStatus()},ut.version="19.2.0",ut}var Wm;function Nv(){if(Wm)return Bc.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(),Bc.exports=jv(),Bc.exports}var Im;function Cv(){if(Im)return ii;Im=1;var l=Ev(),i=mo(),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"),D=Symbol.for("react.consumer"),G=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function Se(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function ee(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 ie:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case G:return e.displayName||"Context";case D: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 Y:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var J=Array.isArray,z=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},te=[],se=-1;function S(e){return{current:e}}function U(e){0>se||(e.current=te[se],te[se]=null,se--)}function Q(e,t){se++,te[se]=e.current,e.current=t}var K=S(null),P=S(null),re=S(null),me=S(null);function $e(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 _e(){U(K),U(P),U(re)}function Kt(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 ke(e){P.current===e&&(U(K),U(P)),me.current===e&&(U(me),ei._currentValue=ne)}var st,Ht;function Ue(e){if(st===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);st=t&&t[1]||"",Ht=-1<n.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+st+e+Ht}var rt=!1;function en(e,t){if(!e||rt)return"";rt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(B){var k=B}Reflect.construct(e,[],V)}else{try{V.call()}catch(B){k=B}e.call(V.prototype)}}else{try{throw Error()}catch(B){k=B}(V=e())&&typeof V.catch=="function"&&V.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(`
|
||
`),O=x.split(`
|
||
`);for(u=a=0;a<q.length&&!q[a].includes("DetermineComponentFrameRoot");)a++;for(;u<O.length&&!O[u].includes("DetermineComponentFrameRoot");)u++;if(a===q.length||u===O.length)for(a=q.length-1,u=O.length-1;1<=a&&0<=u&&q[a]!==O[u];)u--;for(;1<=a&&0<=u;a--,u--)if(q[a]!==O[u]){if(a!==1||u!==1)do if(a--,u--,0>u||q[a]!==O[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{rt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ue(n):""}function qi(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue("Lazy");case 13:return e.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return en(e.type,!1);case 11:return en(e.type.render,!1);case 1:return en(e.type,!0);case 31:return Ue("Activity");default:return""}}function Qo(e){try{var t="",n=null;do t+=qi(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
||
Error generating stack: `+a.message+`
|
||
`+a.stack}}var gr=Object.prototype.hasOwnProperty,vr=l.unstable_scheduleCallback,xr=l.unstable_cancelCallback,W0=l.unstable_shouldYield,I0=l.unstable_requestPaint,gt=l.unstable_now,P0=l.unstable_getCurrentPriorityLevel,Go=l.unstable_ImmediatePriority,Xo=l.unstable_UserBlockingPriority,Ei=l.unstable_NormalPriority,ey=l.unstable_LowPriority,Ko=l.unstable_IdlePriority,ty=l.log,ny=l.unstable_setDisableYieldValue,dl=null,vt=null;function Nn(e){if(typeof ty=="function"&&ny(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(dl,e)}catch{}}var xt=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 ji=256,Ni=262144,Ci=4194304;function In(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 Ti(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=In(a):(h&=x,h!==0?u=In(h):n||(n=x&~e,n!==0&&(u=In(n))))):(x=a&~c,x!==0?u=In(x):h!==0?u=In(h):n||(n=a&~e,n!==0&&(u=In(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 hl(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=Ci;return Ci<<=1,(Ci&62914560)===0&&(Ci=4194304),e}function br(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ml(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,O=e.hiddenUpdates;for(n=h&~n;0<n;){var L=31-xt(n),V=1<<L;x[L]=0,q[L]=-1;var k=O[L];if(k!==null)for(O[L]=null,L=0;L<k.length;L++){var B=k[L];B!==null&&(B.lane&=-536870913)}n&=~V}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-xt(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-xt(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:Ar(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ar(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 Sr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wo(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Bm(e.type))}function Io(e,t){var n=X.p;try{return X.p=e,t()}finally{X.p=n}}var Cn=Math.random().toString(36).slice(2),et="__reactFiber$"+Cn,ot="__reactProps$"+Cn,Sa="__reactContainer$"+Cn,qr="__reactEvents$"+Cn,uy="__reactListeners$"+Cn,cy="__reactHandles$"+Cn,Po="__reactResources$"+Cn,pl="__reactMarker$"+Cn;function Er(e){delete e[et],delete e[ot],delete e[qr],delete e[uy],delete e[cy]}function qa(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sa]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Am(e);e!==null;){if(n=e[et])return n;e=Am(e)}return t}e=n,n=e.parentNode}return null}function Ea(e){if(e=e[et]||e[Sa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function ja(e){var t=e[Po];return t||(t=e[Po]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[pl]=!0}var ef=new Set,tf={};function Pn(e,t){Na(e,t),Na(e+"Capture",t)}function Na(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 gr.call(af,e)?!0:gr.call(nf,e)?!1:oy.test(e)?af[e]=!0:(nf[e]=!0,!1)}function wi(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 Mi(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 tn(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 Ct(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 jr(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 Ri(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 Tt(e){return e.replace(hy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Nr(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=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Cr(e,h,Ct(t)):n!=null?Cr(e,h,Ct(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=""+Ct(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)){jr(e);return}n=n!=null?""+Ct(n):"",t=t!=null?""+Ct(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),jr(e)}function Cr(e,t,n){t==="number"&&Ri(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ca(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=""+Ct(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=""+Ct(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ct(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=Ct(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),jr(e)}function Ta(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 Tr(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 _i(e){return yy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nn(){}var wr=null;function Mr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wa=null,Ma=null;function df(e){var t=Ea(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Nr(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="'+Tt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[ot]||null;if(!u)throw Error(r(90));Nr(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&&Ca(e,!!n.multiple,t,!1)}}}var Rr=!1;function hf(e,t,n){if(Rr)return e(t,n);Rr=!0;try{var a=e(t);return a}finally{if(Rr=!1,(wa!==null||Ma!==null)&&(xs(),wa&&(t=wa,e=Ma,Ma=wa=null,df(t),e)))for(t=0;t<e.length;t++)df(e[t])}}function gl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[ot]||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 an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_r=!1;if(an)try{var vl={};Object.defineProperty(vl,"passive",{get:function(){_r=!0}}),window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{_r=!1}var Tn=null,Or=null,Oi=null;function mf(){if(Oi)return Oi;var e,t=Or,n=t.length,a,u="value"in Tn?Tn.value:Tn.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 Oi=u.slice(e,1<a?1-a:void 0)}function Di(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 ki(){return!0}function pf(){return!1}function ft(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)?ki: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=ki)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ki)},persist:function(){},isPersistent:ki}),t}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zi=ft(ea),xl=A({},ea,{view:0,detail:0}),gy=ft(xl),Dr,kr,bl,Bi=A({},xl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Br,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!==bl&&(bl&&e.type==="mousemove"?(Dr=e.screenX-bl.screenX,kr=e.screenY-bl.screenY):kr=Dr=0,bl=e),Dr)},movementY:function(e){return"movementY"in e?e.movementY:kr}}),yf=ft(Bi),vy=A({},Bi,{dataTransfer:0}),xy=ft(vy),by=A({},xl,{relatedTarget:0}),zr=ft(by),Ay=A({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Sy=ft(Ay),qy=A({},ea,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ey=ft(qy),jy=A({},ea,{data:0}),gf=ft(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 Br(){return wy}var My=A({},xl,{key:function(e){if(e.key){var t=Ny[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Di(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:Br,charCode:function(e){return e.type==="keypress"?Di(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Di(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=ft(My),_y=A({},Bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vf=ft(_y),Oy=A({},xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Br}),Dy=ft(Oy),ky=A({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),zy=ft(ky),By=A({},Bi,{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=ft(By),Ly=A({},ea,{newState:0,oldState:0}),Hy=ft(Ly),Vy=[9,13,27,32],Ur=an&&"CompositionEvent"in window,Al=null;an&&"documentMode"in document&&(Al=document.documentMode);var Yy=an&&"TextEvent"in window&&!Al,xf=an&&(!Ur||Al&&8<Al&&11>=Al),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 Ra=!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(Ra)return e==="compositionend"||!Ur&&Sf(e,t)?(e=mf(),Oi=Or=Tn=null,Ra=!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){wa?Ma?Ma.push(a):Ma=[a]:wa=a,t=Ns(t,"onChange"),0<t.length&&(n=new zi("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Sl=null,ql=null;function Ky(e){rm(e,0)}function Ui(e){var t=yl(e);if(sf(t))return e}function Nf(e,t){if(e==="change")return t}var Cf=!1;if(an){var Lr;if(an){var Hr="oninput"in document;if(!Hr){var Tf=document.createElement("div");Tf.setAttribute("oninput","return;"),Hr=typeof Tf.oninput=="function"}Lr=Hr}else Lr=!1;Cf=Lr&&(!document.documentMode||9<document.documentMode)}function wf(){Sl&&(Sl.detachEvent("onpropertychange",Mf),ql=Sl=null)}function Mf(e){if(e.propertyName==="value"&&Ui(ql)){var t=[];jf(t,ql,e,Mr(e)),hf(Ky,t)}}function Zy(e,t,n){e==="focusin"?(wf(),Sl=t,ql=n,Sl.attachEvent("onpropertychange",Mf)):e==="focusout"&&wf()}function Jy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ui(ql)}function Fy(e,t){if(e==="click")return Ui(t)}function $y(e,t){if(e==="input"||e==="change")return Ui(t)}function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Wy;function El(e,t){if(bt(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(!gr.call(t,u)||!bt(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=Ri(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=Ri(e.document)}return t}function Vr(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=an&&"documentMode"in document&&11>=document.documentMode,_a=null,Yr=null,jl=null,Qr=!1;function kf(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||_a==null||_a!==Ri(a)||(a=_a,"selectionStart"in a&&Vr(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}),jl&&El(jl,a)||(jl=a,a=Ns(Yr,"onSelect"),0<a.length&&(t=new zi("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=_a)))}function ta(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Oa={animationend:ta("Animation","AnimationEnd"),animationiteration:ta("Animation","AnimationIteration"),animationstart:ta("Animation","AnimationStart"),transitionrun:ta("Transition","TransitionRun"),transitionstart:ta("Transition","TransitionStart"),transitioncancel:ta("Transition","TransitionCancel"),transitionend:ta("Transition","TransitionEnd")},Gr={},zf={};an&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function na(e){if(Gr[e])return Gr[e];if(!Oa[e])return e;var t=Oa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zf)return Gr[e]=t[n];return e}var Bf=na("animationend"),Uf=na("animationiteration"),Lf=na("animationstart"),Py=na("transitionrun"),eg=na("transitionstart"),tg=na("transitioncancel"),Hf=na("transitionend"),Vf=new Map,Xr="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(" ");Xr.push("scrollEnd");function Vt(e,t){Vf.set(e,t),Pn(t,[e])}var Li=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)},wt=[],Da=0,Kr=0;function Hi(){for(var e=Da,t=Kr=Da=0;t<e;){var n=wt[t];wt[t++]=null;var a=wt[t];wt[t++]=null;var u=wt[t];wt[t++]=null;var c=wt[t];if(wt[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 Vi(e,t,n,a){wt[Da++]=e,wt[Da++]=t,wt[Da++]=n,wt[Da++]=a,Kr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Zr(e,t,n,a){return Vi(e,t,n,a),Yi(e)}function aa(e,t){return Vi(e,null,null,t),Yi(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-xt(n),e=c.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),c):null}function Yi(e){if(50<Zl)throw Zl=0,nc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ka={};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 At(e,t,n,a){return new ng(e,t,n,a)}function Jr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ln(e,t){var n=e.alternate;return n===null?(n=At(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 Qi(e,t,n,a,u,c){var h=0;if(a=e,typeof e=="function")Jr(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 ie:return e=At(31,n,t,u),e.elementType=ie,e.lanes=c,e;case E:return la(n.children,u,c,t);case j:h=8,u|=24;break;case M:return e=At(12,n,t,u|2),e.elementType=M,e.lanes=c,e;case F:return e=At(13,n,t,u),e.elementType=F,e.lanes=c,e;case $:return e=At(19,n,t,u),e.elementType=$,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:h=10;break e;case D:h=9;break e;case I:h=11;break e;case Y: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=At(h,n,t,u),t.elementType=e,t.type=a,t.lanes=c,t}function la(e,t,n,a){return e=At(7,e,a,t),e.lanes=n,e}function Fr(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function Gf(e){var t=At(18,null,null,0);return t.stateNode=e,t}function $r(e,t,n){return t=At(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 Mt(e,t){if(typeof e=="object"&&e!==null){var n=Xf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Qo(t)},Xf.set(e,t),t)}return{value:e,source:t,stack:Qo(t)}}var za=[],Ba=0,Gi=null,Nl=0,Rt=[],_t=0,wn=null,Zt=1,Jt="";function sn(e,t){za[Ba++]=Nl,za[Ba++]=Gi,Gi=e,Nl=t}function Kf(e,t,n){Rt[_t++]=Zt,Rt[_t++]=Jt,Rt[_t++]=wn,wn=e;var a=Zt;e=Jt;var u=32-xt(a)-1;a&=~(1<<u),n+=1;var c=32-xt(t)+u;if(30<c){var h=u-u%5;c=(a&(1<<h)-1).toString(32),a>>=h,u-=h,Zt=1<<32-xt(t)+u|n<<u|a,Jt=c+e}else Zt=1<<c|n<<u|a,Jt=e}function Wr(e){e.return!==null&&(sn(e,1),Kf(e,1,0))}function Ir(e){for(;e===Gi;)Gi=za[--Ba],za[Ba]=null,Nl=za[--Ba],za[Ba]=null;for(;e===wn;)wn=Rt[--_t],Rt[_t]=null,Jt=Rt[--_t],Rt[_t]=null,Zt=Rt[--_t],Rt[_t]=null}function Zf(e,t){Rt[_t++]=Zt,Rt[_t++]=Jt,Rt[_t++]=wn,Zt=t.id,Jt=t.overflow,wn=e}var tt=null,Oe=null,be=!1,Mn=null,Ot=!1,Pr=Error(r(519));function Rn(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cl(Mt(t,e)),Pr}function Jf(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[et]=e,t[ot]=a,n){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(n=0;n<Fl.length;n++)ye(Fl[n],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),rf(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("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&&(ye("beforetoggle",t),ye("toggle",t)),a.onScroll!=null&&ye("scroll",t),a.onScrollEnd!=null&&ye("scrollend",t),a.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Rn(e,!0)}function Ff(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:Ot=!1;return;case 27:case 3:Ot=!0;return;default:tt=tt.return}}function Ua(e){if(e!==tt)return!1;if(!be)return Ff(e),be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||gc(e.type,e.memoizedProps)),n=!n),n&&Oe&&Rn(e),Ff(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Oe=bm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Oe=bm(e)}else t===27?(t=Oe,Xn(e.type)?(e=Sc,Sc=null,Oe=e):Oe=t):Oe=tt?kt(e.stateNode.nextSibling):null;return!0}function ia(){Oe=tt=null,be=!1}function eu(){var e=Mn;return e!==null&&(pt===null?pt=e:pt.push.apply(pt,e),Mn=null),e}function Cl(e){Mn===null?Mn=[e]:Mn.push(e)}var tu=S(null),sa=null,rn=null;function _n(e,t,n){Q(tu,t._currentValue),t._currentValue=n}function un(e){e._currentValue=tu.current,U(tu)}function nu(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 au(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),nu(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),nu(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 La(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;bt(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(ei):e=[ei])}u=u.return}e!==null&&au(t,e,n,a),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){sa=e,rn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nt(e){return $f(sa,e)}function Ki(e,t){return sa===null&&ra(e),$f(e,t)}function $f(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},rn===null){if(e===null)throw Error(r(308));rn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rn=rn.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,Ge={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lu(){return{controller:new ag,data:new Map,refCount:0}}function Tl(e){e.refCount--,e.refCount===0&&lg(ig,function(){e.controller.abort()})}var wl=null,iu=0,Ha=0,Va=null;function sg(e,t){if(wl===null){var n=wl=[];iu=0,Ha=uc(),Va={status:"pending",value:void 0,then:function(a){n.push(a)}}}return iu++,t.then(Wf,Wf),t}function Wf(){if(--iu===0&&wl!==null){Va!==null&&(Va.status="fulfilled");var e=wl;wl=null,Ha=0,Va=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=gt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&sg(e,t),If!==null&&If(e,t)};var ua=S(null);function su(){var e=ua.current;return e!==null?e:Re.pooledCache}function Zi(e,t){t===null?Q(ua,ua.current):Q(ua,t.pool)}function Pf(){var e=su();return e===null?null:{parent:Ge._currentValue,pool:e}}var Ya=Error(r(460)),ru=Error(r(474)),Ji=Error(r(542)),Fi={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(nn,nn),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(nn,nn);else{if(e=Re,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 oa=t,Ya}}function ca(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(oa=n,Ya):n}}var oa=null;function nd(){if(oa===null)throw Error(r(459));var e=oa;return oa=null,e}function ad(e){if(e===Ya||e===Ji)throw Error(r(483))}var Qa=null,Ml=0;function $i(e){var t=Ml;return Ml+=1,Qa===null&&(Qa=[]),td(Qa,e,t)}function Rl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wi(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=ln(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=Fr(_,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&&ca(ue)===C.type)?(C=u(C,_.props),Rl(C,_),C.return=R,C):(C=Qi(_.type,_.key,_.props,null,R.mode,H),Rl(C,_),C.return=R,C)}function O(R,C,_,H){return C===null||C.tag!==4||C.stateNode.containerInfo!==_.containerInfo||C.stateNode.implementation!==_.implementation?(C=$r(_,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=la(_,R.mode,H,ue),C.return=R,C):(C=u(C,_),C.return=R,C)}function V(R,C,_){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Fr(""+C,R.mode,_),C.return=R,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case T:return _=Qi(C.type,C.key,C.props,null,R.mode,_),Rl(_,C),_.return=R,_;case N:return C=$r(C,R.mode,_),C.return=R,C;case W:return C=ca(C),V(R,C,_)}if(J(C)||Se(C))return C=la(C,R.mode,_,null),C.return=R,C;if(typeof C.then=="function")return V(R,$i(C),_);if(C.$$typeof===G)return V(R,Ki(R,C),_);Wi(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?O(R,C,_,H):null;case W:return _=ca(_),k(R,C,_,H)}if(J(_)||Se(_))return ue!==null?null:L(R,C,_,H,null);if(typeof _.then=="function")return k(R,C,$i(_),H);if(_.$$typeof===G)return k(R,C,Ki(R,_),H);Wi(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,O(C,R,H,ue);case W:return H=ca(H),B(R,C,_,H,ue)}if(J(H)||Se(H))return R=R.get(_)||null,L(C,R,H,ue,null);if(typeof H.then=="function")return B(R,C,_,$i(H),ue);if(H.$$typeof===G)return B(R,C,_,Ki(C,H),ue);Wi(C,H)}return null}function ae(R,C,_,H){for(var ue=null,qe=null,le=C,he=C=0,ve=null;le!==null&&he<_.length;he++){le.index>he?(ve=le,le=null):ve=le.sibling;var Ee=k(R,le,_[he],H);if(Ee===null){le===null&&(le=ve);break}e&&le&&Ee.alternate===null&&t(R,le),C=c(Ee,C,he),qe===null?ue=Ee:qe.sibling=Ee,qe=Ee,le=ve}if(he===_.length)return n(R,le),be&&sn(R,he),ue;if(le===null){for(;he<_.length;he++)le=V(R,_[he],H),le!==null&&(C=c(le,C,he),qe===null?ue=le:qe.sibling=le,qe=le);return be&&sn(R,he),ue}for(le=a(le);he<_.length;he++)ve=B(le,R,he,_[he],H),ve!==null&&(e&&ve.alternate!==null&&le.delete(ve.key===null?he:ve.key),C=c(ve,C,he),qe===null?ue=ve:qe.sibling=ve,qe=ve);return e&&le.forEach(function($n){return t(R,$n)}),be&&sn(R,he),ue}function ce(R,C,_,H){if(_==null)throw Error(r(151));for(var ue=null,qe=null,le=C,he=C=0,ve=null,Ee=_.next();le!==null&&!Ee.done;he++,Ee=_.next()){le.index>he?(ve=le,le=null):ve=le.sibling;var $n=k(R,le,Ee.value,H);if($n===null){le===null&&(le=ve);break}e&&le&&$n.alternate===null&&t(R,le),C=c($n,C,he),qe===null?ue=$n:qe.sibling=$n,qe=$n,le=ve}if(Ee.done)return n(R,le),be&&sn(R,he),ue;if(le===null){for(;!Ee.done;he++,Ee=_.next())Ee=V(R,Ee.value,H),Ee!==null&&(C=c(Ee,C,he),qe===null?ue=Ee:qe.sibling=Ee,qe=Ee);return be&&sn(R,he),ue}for(le=a(le);!Ee.done;he++,Ee=_.next())Ee=B(le,R,he,Ee.value,H),Ee!==null&&(e&&Ee.alternate!==null&&le.delete(Ee.key===null?he:Ee.key),C=c(Ee,C,he),qe===null?ue=Ee:qe.sibling=Ee,qe=Ee);return e&&le.forEach(function(vv){return t(R,vv)}),be&&sn(R,he),ue}function Me(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&&ca(ue)===C.type){n(R,C.sibling),H=u(C,_.props),Rl(H,_),H.return=R,R=H;break e}n(R,C);break}else t(R,C);C=C.sibling}_.type===E?(H=la(_.props.children,R.mode,H,_.key),H.return=R,R=H):(H=Qi(_.type,_.key,_.props,null,R.mode,H),Rl(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=$r(_,R.mode,H),H.return=R,R=H}return h(R);case W:return _=ca(_),Me(R,C,_,H)}if(J(_))return ae(R,C,_,H);if(Se(_)){if(ue=Se(_),typeof ue!="function")throw Error(r(150));return _=ue.call(_),ce(R,C,_,H)}if(typeof _.then=="function")return Me(R,C,$i(_),H);if(_.$$typeof===G)return Me(R,C,Ki(R,_),H);Wi(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=Fr(_,R.mode,H),H.return=R,R=H),h(R)):n(R,C)}return function(R,C,_,H){try{Ml=0;var ue=Me(R,C,_,H);return Qa=null,ue}catch(le){if(le===Ya||le===Ji)throw le;var qe=At(29,le,null,R.mode);return qe.lanes=H,qe.return=R,qe}finally{}}}var fa=ld(!0),id=ld(!1),On=!1;function uu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cu(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 Dn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(je&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Yi(e),Yf(e,null,n),t}return Vi(e,a,t,n),Yi(e)}function _l(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 ou(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 fu=!1;function Ol(){if(fu){var e=Va;if(e!==null)throw e}}function Dl(e,t,n,a){fu=!1;var u=e.updateQueue;On=!1;var c=u.firstBaseUpdate,h=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var q=x,O=q.next;q.next=null,h===null?c=O:h.next=O,h=q;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==h&&(x===null?L.firstBaseUpdate=O:x.next=O,L.lastBaseUpdate=q))}if(c!==null){var V=u.baseState;h=0,L=O=q=null,x=c;do{var k=x.lane&-536870913,B=k!==x.lane;if(B?(ge&k)===k:(a&k)===k){k!==0&&k===Ha&&(fu=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ae=e,ce=x;k=t;var Me=n;switch(ce.tag){case 1:if(ae=ce.payload,typeof ae=="function"){V=ae.call(Me,V,k);break e}V=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ce.payload,k=typeof ae=="function"?ae.call(Me,V,k):ae,k==null)break e;V=A({},V,k);break e;case 2:On=!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?(O=L=B,q=V):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=V),u.baseState=q,u.firstBaseUpdate=O,u.lastBaseUpdate=L,c===null&&(u.shared.lanes=0),Hn|=h,e.lanes=h,e.memoizedState=V}}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 Ga=S(null),Ii=S(0);function ud(e,t){e=gn,Q(Ii,e),Q(Ga,t),gn=e|t.baseLanes}function du(){Q(Ii,gn),Q(Ga,Ga.current)}function hu(){gn=Ii.current,U(Ga),U(Ii)}var St=S(null),Dt=null;function zn(e){var t=e.alternate;Q(Ye,Ye.current&1),Q(St,e),Dt===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Dt=e)}function mu(e){Q(Ye,Ye.current),Q(St,e),Dt===null&&(Dt=e)}function cd(e){e.tag===22?(Q(Ye,Ye.current),Q(St,e),Dt===null&&(Dt=e)):Bn()}function Bn(){Q(Ye,Ye.current),Q(St,St.current)}function qt(e){U(St),Dt===e&&(Dt=null),U(Ye)}var Ye=S(0);function Pi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||bc(n)||Ac(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 cn=0,de=null,Te=null,Xe=null,es=!1,Xa=!1,da=!1,ts=0,kl=0,Ka=null,ug=0;function Le(){throw Error(r(321))}function pu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function yu(e,t,n,a,u,c){return cn=c,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Kd:Ru,da=!1,c=n(a,u),da=!1,Xa&&(c=fd(t,n,a,u)),od(e),c}function od(e){z.H=Ul;var t=Te!==null&&Te.next!==null;if(cn=0,Xe=Te=de=null,es=!1,kl=0,Ka=null,t)throw Error(r(300));e===null||Ke||(e=e.dependencies,e!==null&&Xi(e)&&(Ke=!0))}function fd(e,t,n,a){de=e;var u=0;do{if(Xa&&(Ka=null),kl=0,Xa=!1,25<=u)throw Error(r(301));if(u+=1,Xe=Te=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(Xa);return c}function cg(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?zl(t):t,e=e.useState()[0],(Te!==null?Te.memoizedState:null)!==e&&(de.flags|=1024),t}function gu(){var e=ts!==0;return ts=0,e}function vu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xu(e){if(es){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}es=!1}cn=0,Xe=Te=de=null,Xa=!1,kl=ts=0,Ka=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Qe(){if(Te===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Xe===null?de.memoizedState:Xe.next;if(t!==null)Xe=t,Te=e;else{if(e===null)throw de.alternate===null?Error(r(467)):Error(r(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zl(e){var t=kl;return kl+=1,Ka===null&&(Ka=[]),e=td(Ka,e,t),t=de,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Kd:Ru),e}function as(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zl(e);if(e.$$typeof===G)return nt(e)}throw Error(r(438,String(e)))}function bu(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=ns(),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 on(e,t){return typeof t=="function"?t(e):t}function ls(e){var t=Qe();return Au(t,Te,e)}function Au(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,O=t,L=!1;do{var V=O.lane&-536870913;if(V!==O.lane?(ge&V)===V:(cn&V)===V){var k=O.revertLane;if(k===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),V===Ha&&(L=!0);else if((cn&k)===k){O=O.next,k===Ha&&(L=!0);continue}else V={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},q===null?(x=q=V,h=c):q=q.next=V,de.lanes|=k,Hn|=k;V=O.action,da&&n(c,V),c=O.hasEagerState?O.eagerState:n(c,V)}else k={lane:V,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},q===null?(x=q=k,h=c):q=q.next=k,de.lanes|=V,Hn|=V;O=O.next}while(O!==null&&O!==t);if(q===null?h=c:q.next=x,!bt(c,e.memoizedState)&&(Ke=!0,L&&(n=Va,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 Su(e){var t=Qe(),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);bt(c,t.memoizedState)||(Ke=!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=Qe(),c=be;if(c){if(n===void 0)throw Error(r(407));n=n()}else n=t();var h=!bt((Te||u).memoizedState,n);if(h&&(u.memoizedState=n,Ke=!0),u=u.queue,ju(pd.bind(null,a,u,e),[e]),u.getSnapshot!==t||h||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,Za(9,{destroy:void 0},md.bind(null,a,u,n,t),null),Re===null)throw Error(r(349));c||(cn&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=ns(),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!bt(e,n)}catch{return!0}}function gd(e){var t=aa(e,2);t!==null&&yt(t,e,2)}function qu(e){var t=ct();if(typeof e=="function"){var n=e;if(e=n(),da){Nn(!0);try{n()}finally{Nn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t}function vd(e,t,n,a){return e.baseState=n,Au(e,Te,typeof a=="function"?a:on)}function og(e,t,n,a,u){if(rs(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(O){Eu(e,t,O)}finally{c!==null&&h.types!==null&&(c.types=h.types),z.T=c}}else try{c=n(u,a),bd(e,t,c)}catch(O){Eu(e,t,O)}}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 Eu(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 Eu(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(be){var n=Re.formState;if(n!==null){e:{var a=de;if(be){if(Oe){t:{for(var u=Oe,c=Ot;u.nodeType!==8;){if(!c){u=null;break t}if(u=kt(u.nextSibling),u===null){u=null;break t}}c=u.data,u=c==="F!"||c==="F"?u:null}if(u){Oe=kt(u.nextSibling),a=u.data==="F!";break e}}Rn(a)}a=!1}a&&(t=n[0])}}return n=ct(),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=qu(!1),c=Mu.bind(null,de,!1,a.queue),a=ct(),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=Qe();return Nd(t,Te,e)}function Nd(e,t,n){if(t=Au(e,t,qd)[0],e=ls(on)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=zl(t)}catch(h){throw h===Ya?Ji:h}else a=t;t=Qe();var u=t.queue,c=u.dispatch;return n!==t.memoizedState&&(de.flags|=2048,Za(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=Qe(),n=Te;if(n!==null)return Nd(t,n,e);Qe(),t=t.memoizedState,n=Qe();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Za(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=de.updateQueue,t===null&&(t=ns(),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 Qe().memoizedState}function is(e,t,n,a){var u=ct();de.flags|=e,u.memoizedState=Za(1|t,{destroy:void 0},n,a===void 0?null:a)}function ss(e,t,n,a){var u=Qe();a=a===void 0?null:a;var c=u.memoizedState.inst;Te!==null&&a!==null&&pu(a,Te.memoizedState.deps)?u.memoizedState=Za(t,c,n,a):(de.flags|=e,u.memoizedState=Za(1|t,c,n,a))}function wd(e,t){is(8390656,8,e,t)}function ju(e,t){ss(2048,8,e,t)}function dg(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=ns(),de.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Md(e){var t=Qe().memoizedState;return dg({ref:t,nextImpl:e}),function(){if((je&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Rd(e,t){return ss(4,2,e,t)}function _d(e,t){return ss(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,ss(4,4,Od.bind(null,t,e),n)}function Nu(){}function kd(e,t){var n=Qe();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&pu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function zd(e,t){var n=Qe();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&pu(t,a[1]))return a[0];if(a=e(),da){Nn(!0);try{e()}finally{Nn(!1)}}return n.memoizedState=[a,t],a}function Cu(e,t,n){return n===void 0||(cn&1073741824)!==0&&(ge&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Bh(),de.lanes|=e,Hn|=e,n)}function Bd(e,t,n,a){return bt(n,t)?n:Ga.current!==null?(e=Cu(e,n,a),bt(e,t)||(Ke=!0),e):(cn&42)===0||(cn&1073741824)!==0&&(ge&261930)===0?(Ke=!0,e.memoizedState=n):(e=Bh(),de.lanes|=e,Hn|=e,t)}function Ud(e,t,n,a,u){var c=X.p;X.p=c!==0&&8>c?c:8;var h=z.T,x={};z.T=x,Mu(e,!1,t,n);try{var q=u(),O=z.S;if(O!==null&&O(x,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var L=rg(q,a);Bl(e,t,L,Nt(e))}else Bl(e,t,a,Nt(e))}catch(V){Bl(e,t,{then:function(){},status:"rejected",reason:V},Nt())}finally{X.p=c,h!==null&&x.types!==null&&(h.types=x.types),z.T=h}}function hg(){}function Tu(e,t,n,a){if(e.tag!==5)throw Error(r(476));var u=Ld(e).queue;Ud(e,u,t,ne,n===null?hg:function(){return Hd(e),n(a)})}function Ld(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,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),Bl(e,t.next.queue,{},Nt())}function wu(){return nt(ei)}function Vd(){return Qe().memoizedState}function Yd(){return Qe().memoizedState}function mg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nt();e=Dn(n);var a=kn(t,e,n);a!==null&&(yt(a,t,n),_l(a,t,n)),t={cache:lu()},e.payload=t;return}t=t.return}}function pg(e,t,n){var a=Nt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e)?Gd(t,n):(n=Zr(e,t,n,a),n!==null&&(yt(n,e,a),Xd(n,t,a)))}function Qd(e,t,n){var a=Nt();Bl(e,t,n,a)}function Bl(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(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,bt(x,h))return Vi(e,t,u,0),Re===null&&Hi(),!1}catch{}finally{}if(n=Zr(e,t,u,a),n!==null)return yt(n,e,a),Xd(n,t,a),!0}return!1}function Mu(e,t,n,a){if(a={lane:2,revertLane:uc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},rs(e)){if(t)throw Error(r(479))}else t=Zr(e,n,a,2),t!==null&&yt(t,e,2)}function rs(e){var t=e.alternate;return e===de||t!==null&&t===de}function Gd(e,t){Xa=es=!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 Ul={readContext:nt,use:as,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ul.useEffectEvent=Le;var Kd={readContext:nt,use:as,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:wd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,is(4194308,4,Od.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=ct();t=t===void 0?null:t;var a=e();if(da){Nn(!0);try{e()}finally{Nn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=ct();if(n!==void 0){var u=n(t);if(da){Nn(!0);try{n(t)}finally{Nn(!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=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=qu(e);var t=e.queue,n=Qd.bind(null,de,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Nu,useDeferredValue:function(e,t){var n=ct();return Cu(n,e,t)},useTransition:function(){var e=qu(!1);return e=Ud.bind(null,de,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=de,u=ct();if(be){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Re===null)throw Error(r(349));(ge&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,Za(9,{destroy:void 0},md.bind(null,a,c,n,t),null),n},useId:function(){var e=ct(),t=Re.identifierPrefix;if(be){var n=Jt,a=Zt;n=(a&~(1<<32-xt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ts++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ug++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wu,useFormState:Ed,useActionState:Ed,useOptimistic:function(e){var t=ct();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Mu.bind(null,de,!0,n),n.dispatch=t,[e,t]},useMemoCache:bu,useCacheRefresh:function(){return ct().memoizedState=mg.bind(null,de)},useEffectEvent:function(e){var t=ct(),n={impl:e};return t.memoizedState=n,function(){if((je&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Ru={readContext:nt,use:as,useCallback:kd,useContext:nt,useEffect:ju,useImperativeHandle:Dd,useInsertionEffect:Rd,useLayoutEffect:_d,useMemo:zd,useReducer:ls,useRef:Td,useState:function(){return ls(on)},useDebugValue:Nu,useDeferredValue:function(e,t){var n=Qe();return Bd(n,Te.memoizedState,e,t)},useTransition:function(){var e=ls(on)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:zl(e),t]},useSyncExternalStore:dd,useId:Vd,useHostTransitionStatus:wu,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var n=Qe();return vd(n,Te,e,t)},useMemoCache:bu,useCacheRefresh:Yd};Ru.useEffectEvent=Md;var Zd={readContext:nt,use:as,useCallback:kd,useContext:nt,useEffect:ju,useImperativeHandle:Dd,useInsertionEffect:Rd,useLayoutEffect:_d,useMemo:zd,useReducer:Su,useRef:Td,useState:function(){return Su(on)},useDebugValue:Nu,useDeferredValue:function(e,t){var n=Qe();return Te===null?Cu(n,e,t):Bd(n,Te.memoizedState,e,t)},useTransition:function(){var e=Su(on)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:zl(e),t]},useSyncExternalStore:dd,useId:Vd,useHostTransitionStatus:wu,useFormState:Cd,useActionState:Cd,useOptimistic:function(e,t){var n=Qe();return Te!==null?vd(n,Te,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:bu,useCacheRefresh:Yd};Zd.useEffectEvent=Md;function _u(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 Ou={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Nt(),u=Dn(a);u.payload=t,n!=null&&(u.callback=n),t=kn(e,u,a),t!==null&&(yt(t,e,a),_l(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Nt(),u=Dn(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=kn(e,u,a),t!==null&&(yt(t,e,a),_l(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nt(),a=Dn(n);a.tag=2,t!=null&&(a.callback=t),t=kn(e,a,n),t!==null&&(yt(t,e,n),_l(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?!El(n,a)||!El(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&&Ou.enqueueReplaceState(t,t.state,null)}function ha(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){Li(e)}function Wd(e){console.error(e)}function Id(e){Li(e)}function us(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 Du(e,t,n){return n=Dn(n),n.tag=3,n.payload={element:null},n.callback=function(){us(e,t)},n}function eh(e){return e=Dn(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"&&(Vn===null?Vn=new Set([this]):Vn.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&&La(t,n,u,!0),n=St.current,n!==null){switch(n.tag){case 31:case 13:return Dt===null?bs():n.alternate===null&&He===0&&(He=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===Fi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),ic(e,a,u)),!1;case 22:return n.flags|=65536,a===Fi?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)),ic(e,a,u)),!1}throw Error(r(435,n.tag))}return ic(e,a,u),bs(),!1}if(be)return t=St.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Pr&&(e=Error(r(422),{cause:a}),Cl(Mt(e,n)))):(a!==Pr&&(t=Error(r(423),{cause:a}),Cl(Mt(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Mt(a,n),u=Du(e.stateNode,a,u),ou(e,u),He!==4&&(He=2)),!1;var c=Error(r(520),{cause:a});if(c=Mt(c,n),Kl===null?Kl=[c]:Kl.push(c),He!==4&&(He=2),t===null)return!0;a=Mt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Du(n.stateNode,a,e),ou(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"&&(Vn===null||!Vn.has(c))))return n.flags|=65536,u&=-u,n.lanes|=u,u=eh(u),th(u,e,n,a),ou(n,u),!1}n=n.return}while(n!==null);return!1}var ku=Error(r(461)),Ke=!1;function at(e,t,n,a){t.child=e===null?id(t,null,n,a):fa(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 ra(t),a=yu(e,t,n,h,c,u),x=gu(),e!==null&&!Ke?(vu(e,t,u),fn(e,t,u)):(be&&x&&Wr(t),t.flags|=1,at(e,t,a,u),t.child)}function ah(e,t,n,a,u){if(e===null){var c=n.type;return typeof c=="function"&&!Jr(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,lh(e,t,c,a,u)):(e=Qi(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Qu(e,u)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:El,n(h,a)&&e.ref===t.ref)return fn(e,t,u)}return t.flags|=1,e=ln(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(El(c,a)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=a=c,Qu(e,u))(e.flags&131072)!==0&&(Ke=!0);else return t.lanes=e.lanes,fn(e,t,u)}return zu(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&&Zi(t,c!==null?c.cachePool:null),c!==null?ud(t,c):du(),cd(t);else return a=t.lanes=536870912,sh(e,t,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(Zi(t,c.cachePool),ud(t,c),Bn(),t.memoizedState=null):(e!==null&&Zi(t,null),du(),Bn());return at(e,t,u,n),t.child}function Ll(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=su();return c=c===null?null:{parent:Ge._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Zi(t,null),du(),cd(t),e!==null&&La(e,t,a,!0),t.childLanes=u,null}function cs(e,t){return t=fs({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 fa(t,e.child,null,n),e=cs(t,t.pendingProps),e.flags|=2,qt(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(be){if(a.mode==="hidden")return e=cs(t,a),t.lanes=536870912,Ll(null,e);if(mu(t),(e=Oe)?(e=xm(e,Ot),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,tt=t,Oe=null)):e=null,e===null)throw Rn(t);return t.lanes=536870912,null}return cs(t,a)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(mu(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(Ke||La(e,t,n,!1),u=(n&e.childLanes)!==0,Ke||u){if(a=Re,a!==null&&(h=$o(a,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,aa(e,h),yt(a,e,h),ku;bs(),t=rh(e,t,n)}else e=c.treeContext,Oe=kt(h.nextSibling),tt=t,be=!0,Mn=null,Ot=!1,e!==null&&Zf(t,e),t=cs(t,a),t.flags|=4096;return t}return e=ln(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function os(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 zu(e,t,n,a,u){return ra(t),n=yu(e,t,n,a,void 0,u),a=gu(),e!==null&&!Ke?(vu(e,t,u),fn(e,t,u)):(be&&a&&Wr(t),t.flags|=1,at(e,t,n,u),t.child)}function uh(e,t,n,a,u,c){return ra(t),t.updateQueue=null,n=fd(t,a,n,u),od(e),a=gu(),e!==null&&!Ke?(vu(e,t,c),fn(e,t,c)):(be&&a&&Wr(t),t.flags|=1,at(e,t,n,c),t.child)}function ch(e,t,n,a,u){if(ra(t),t.stateNode===null){var c=ka,h=n.contextType;typeof h=="object"&&h!==null&&(c=nt(h)),c=new n(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ou,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},uu(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?nt(h):ka,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(_u(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&&Ou.enqueueReplaceState(c,c.state,null),Dl(t,a,c,u),Ol(),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=ha(n,x);c.props=q;var O=c.context,L=n.contextType;h=ka,typeof L=="object"&&L!==null&&(h=nt(L));var V=n.getDerivedStateFromProps;L=typeof V=="function"||typeof c.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x||O!==h)&&Fd(t,c,a,h),On=!1;var k=t.memoizedState;c.state=k,Dl(t,a,c,u),Ol(),O=t.memoizedState,x||k!==O||On?(typeof V=="function"&&(_u(t,n,V,a),O=t.memoizedState),(q=On||Jd(t,n,q,a,k,O,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=O),c.props=a,c.state=O,c.context=h,a=q):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,cu(e,t),h=t.memoizedProps,L=ha(n,h),c.props=L,V=t.pendingProps,k=c.context,O=n.contextType,q=ka,typeof O=="object"&&O!==null&&(q=nt(O)),x=n.getDerivedStateFromProps,(O=typeof x=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==V||k!==q)&&Fd(t,c,a,q),On=!1,k=t.memoizedState,c.state=k,Dl(t,a,c,u),Ol();var B=t.memoizedState;h!==V||k!==B||On||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof x=="function"&&(_u(t,n,x,a),B=t.memoizedState),(L=On||Jd(t,n,L,a,k,B,q)||e!==null&&e.dependencies!==null&&Xi(e.dependencies))?(O||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,os(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=fa(t,e.child,null,u),t.child=fa(t,null,n,u)):at(e,t,n,u),t.memoizedState=c.state,e=t.child):e=fn(e,t,u),e}function oh(e,t,n,a){return ia(),t.flags|=256,at(e,t,n,a),t.child}var Bu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uu(e){return{baseLanes:e,cachePool:Pf()}}function Lu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=jt),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:(Ye.current&2)!==0),h&&(u=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(be){if(u?zn(t):Bn(),(e=Oe)?(e=xm(e,Ot),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,tt=t,Oe=null)):e=null,e===null)throw Rn(t);return Ac(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,u?(Bn(),u=t.mode,x=fs({mode:"hidden",children:x},u),a=la(a,u,n,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Uu(n),a.childLanes=Lu(e,h,n),t.memoizedState=Bu,Ll(null,a)):(zn(t),Hu(t,x))}var q=e.memoizedState;if(q!==null&&(x=q.dehydrated,x!==null)){if(c)t.flags&256?(zn(t),t.flags&=-257,t=Vu(e,t,n)):t.memoizedState!==null?(Bn(),t.child=e.child,t.flags|=128,t=null):(Bn(),x=a.fallback,u=t.mode,a=fs({mode:"visible",children:a.children},u),x=la(x,u,n,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,fa(t,e.child,null,n),a=t.child,a.memoizedState=Uu(n),a.childLanes=Lu(e,h,n),t.memoizedState=Bu,t=Ll(null,a));else if(zn(t),Ac(x)){if(h=x.nextSibling&&x.nextSibling.dataset,h)var O=h.dgst;h=O,a=Error(r(419)),a.stack="",a.digest=h,Cl({value:a,source:null,stack:null}),t=Vu(e,t,n)}else if(Ke||La(e,t,n,!1),h=(n&e.childLanes)!==0,Ke||h){if(h=Re,h!==null&&(a=$o(h,n),a!==0&&a!==q.retryLane))throw q.retryLane=a,aa(e,a),yt(h,e,a),ku;bc(x)||bs(),t=Vu(e,t,n)}else bc(x)?(t.flags|=192,t.child=e.child,t=null):(e=q.treeContext,Oe=kt(x.nextSibling),tt=t,be=!0,Mn=null,Ot=!1,e!==null&&Zf(t,e),t=Hu(t,a.children),t.flags|=4096);return t}return u?(Bn(),x=a.fallback,u=t.mode,q=e.child,O=q.sibling,a=ln(q,{mode:"hidden",children:a.children}),a.subtreeFlags=q.subtreeFlags&65011712,O!==null?x=ln(O,x):(x=la(x,u,n,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Ll(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Uu(n):(u=x.cachePool,u!==null?(q=Ge._currentValue,u=u.parent!==q?{parent:q,pool:q}:u):u=Pf(),x={baseLanes:x.baseLanes|n,cachePool:u}),a.memoizedState=x,a.childLanes=Lu(e,h,n),t.memoizedState=Bu,Ll(e.child,a)):(zn(t),n=e.child,e=n.sibling,n=ln(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 Hu(e,t){return t=fs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fs(e,t){return e=At(22,e,null,t),e.lanes=0,e}function Vu(e,t,n){return fa(t,e.child,null,n),e=Hu(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),nu(e.return,t,n)}function Yu(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=Ye.current,x=(h&2)!==0;if(x?(h=h&1|2,t.flags|=128):h&=1,Q(Ye,h),at(e,t,a,n),a=be?Nl: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&&Pi(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Yu(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&&Pi(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Yu(t,!0,n,null,c,a);break;case"together":Yu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(La(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=ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xi(e)))}function vg(e,t,n){switch(t.tag){case 3:$e(t,t.stateNode.containerInfo),_n(t,Ge,e.memoizedState.cache),ia();break;case 27:case 5:Kt(t);break;case 4:$e(t,t.stateNode.containerInfo);break;case 10:_n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mu(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(zn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?fh(e,t,n):(zn(t),e=fn(e,t,n),e!==null?e.sibling:null);zn(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(La(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(Ye,Ye.current),a)break;return null;case 22:return t.lanes=0,ih(e,t,n,t.pendingProps);case 24:_n(t,Ge,e.memoizedState.cache)}return fn(e,t,n)}function mh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ke=!0;else{if(!Qu(e,n)&&(t.flags&128)===0)return Ke=!1,vg(e,t,n);Ke=(e.flags&131072)!==0}else Ke=!1,be&&(t.flags&1048576)!==0&&Kf(t,Nl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ca(t.elementType),t.type=e,typeof e=="function")Jr(e)?(a=ha(e,a),t.tag=1,t=ch(null,t,e,a,n)):(t.tag=0,t=zu(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===Y){t.tag=14,t=ah(null,t,e,a,n);break e}}throw t=ee(e)||e,Error(r(306,t,""))}}return t;case 0:return zu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=ha(a,t.pendingProps),ch(e,t,a,u,n);case 3:e:{if($e(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var c=t.memoizedState;u=c.element,cu(e,t),Dl(t,a,null,n);var h=t.memoizedState;if(a=h.cache,_n(t,Ge,a),a!==c.cache&&au(t,[Ge],n,!0),Ol(),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=Mt(Error(r(424)),t),Cl(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(Oe=kt(e.firstChild),tt=t,be=!0,Mn=null,Ot=!0,n=id(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ia(),a===u){t=fn(e,t,n);break e}at(e,t,a,n)}t=t.child}return t;case 26:return os(e,t),e===null?(n=jm(t.type,null,t.pendingProps,null))?t.memoizedState=n:be||(n=t.type,e=t.pendingProps,a=Cs(re.current).createElement(n),a[et]=t,a[ot]=e,lt(a,n,e),Ie(a),t.stateNode=a):t.memoizedState=jm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Kt(t),e===null&&be&&(a=t.stateNode=Sm(t.type,t.pendingProps,re.current),tt=t,Ot=!0,u=Oe,Xn(t.type)?(Sc=u,Oe=kt(a.firstChild)):Oe=u),at(e,t,t.pendingProps.children,n),os(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&be&&((u=a=Oe)&&(a=Jg(a,t.type,t.pendingProps,Ot),a!==null?(t.stateNode=a,tt=t,Oe=kt(a.firstChild),Ot=!1,u=!0):u=!1),u||Rn(t)),Kt(t),u=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,a=c.children,gc(u,c)?a=null:h!==null&&gc(u,h)&&(t.flags|=32),t.memoizedState!==null&&(u=yu(e,t,cg,null,null,n),ei._currentValue=u),os(e,t),at(e,t,a,n),t.child;case 6:return e===null&&be&&((e=n=Oe)&&(n=Fg(n,t.pendingProps,Ot),n!==null?(t.stateNode=n,tt=t,Oe=null,e=!0):e=!1),e||Rn(t)),null;case 13:return fh(e,t,n);case 4:return $e(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=fa(t,null,a,n):at(e,t,a,n),t.child;case 11:return nh(e,t,t.type,t.pendingProps,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,_n(t,t.type,a.value),at(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,ra(t),u=nt(u),a=a(u),t.flags|=1,at(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 ra(t),a=nt(Ge),e===null?(u=su(),u===null&&(u=Re,c=lu(),u.pooledCache=c,c.refCount++,c!==null&&(u.pooledCacheLanes|=n),u=c),t.memoizedState={parent:a,cache:u},uu(t),_n(t,Ge,u)):((e.lanes&n)!==0&&(cu(e,t),Dl(t,null,null,n),Ol()),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),_n(t,Ge,a)):(a=c.cache,_n(t,Ge,a),a!==u.cache&&au(t,[Ge],n,!0))),at(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function dn(e){e.flags|=4}function Gu(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 oa=Fi,ru}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 oa=Fi,ru}function ds(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zo():536870912,e.lanes|=t,Wa|=t)}function Hl(e,t){if(!be)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 De(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(Ir(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return De(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),un(Ge),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ua(t)?dn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,eu())),De(t),null;case 26:var u=t.type,c=t.memoizedState;return e===null?(dn(t),c!==null?(De(t),ph(t,c)):(De(t),Gu(t,u,null,a,n))):c?c!==e.memoizedState?(dn(t),De(t),ph(t,c)):(De(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&dn(t),De(t),Gu(t,u,e,a,n)),null;case 27:if(ke(t),n=re.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return De(t),null}e=K.current,Ua(t)?Jf(t):(e=Sm(u,a,n),t.stateNode=e,dn(t))}return De(t),null;case 5:if(ke(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return De(t),null}if(c=K.current,Ua(t))Jf(t);else{var h=Cs(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[et]=t,c[ot]=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(lt(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&&dn(t)}}return De(t),Gu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=re.current,Ua(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=tt,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||fm(e.nodeValue,n)),e||Rn(t,!0)}else e=Cs(e).createTextNode(a),e[et]=t,t.stateNode=e}return De(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ua(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[et]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else n=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return De(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ua(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[et]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),u=!1}else u=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(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),ds(t,t.updateQueue),De(t),null);case 4:return _e(),e===null&&dc(t.stateNode.containerInfo),De(t),null;case 10:return un(t.type),De(t),null;case 19:if(U(Ye),a=t.memoizedState,a===null)return De(t),null;if(u=(t.flags&128)!==0,c=a.rendering,c===null)if(u)Hl(a,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Pi(e),c!==null){for(t.flags|=128,Hl(a,!1),e=c.updateQueue,t.updateQueue=e,ds(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qf(n,e),n=n.sibling;return Q(Ye,Ye.current&1|2),be&&sn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&>()>gs&&(t.flags|=128,u=!0,Hl(a,!1),t.lanes=4194304)}else{if(!u)if(e=Pi(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,ds(t,e),Hl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!be)return De(t),null}else 2*gt()-a.renderingStartTime>gs&&n!==536870912&&(t.flags|=128,u=!0,Hl(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=gt(),e.sibling=null,n=Ye.current,Q(Ye,u?n&1|2:n&1),be&&sn(t,a.treeForkCount),e):(De(t),null);case 22:case 23:return qt(t),hu(),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&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),n=t.updateQueue,n!==null&&ds(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(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),un(Ge),De(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function bg(e,t){switch(Ir(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(Ge),_e(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(r(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Ye),null;case 4:return _e(),null;case 10:return un(t.type),null;case 22:case 23:return qt(t),hu(),e!==null&&U(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return un(Ge),null;case 25:return null;default:return null}}function yh(e,t){switch(Ir(t),t.tag){case 3:un(Ge),_e();break;case 26:case 27:case 5:ke(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:U(Ye);break;case 10:un(t.type);break;case 22:case 23:qt(t),hu(),e!==null&&U(ua);break;case 24:un(Ge)}}function Vl(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){Ce(t,t.return,x)}}function Un(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,O=x;try{O()}catch(L){Ce(u,q,L)}}}a=a.next}while(a!==c)}}catch(L){Ce(t,t.return,L)}}function gh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{rd(t,n)}catch(a){Ce(e,e.return,a)}}}function vh(e,t,n){n.props=ha(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ce(e,t,a)}}function Yl(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){Ce(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){Ce(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){Ce(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){Ce(e,e.return,u)}}function Xu(e,t,n){try{var a=e.stateNode;Yg(a,e.type,n,t),a[ot]=t}catch(u){Ce(e,e.return,u)}}function bh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xn(e.type)||e.tag===4}function Ku(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&&Xn(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 Zu(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=nn));else if(a!==4&&(a===27&&Xn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zu(e,t,n),e=e.sibling;e!==null;)Zu(e,t,n),e=e.sibling}function hs(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&&Xn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(hs(e,t,n),e=e.sibling;e!==null;)hs(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]);lt(t,a,n),t[et]=e,t[ot]=n}catch(c){Ce(e,e.return,c)}}var hn=!1,Ze=!1,Ju=!1,Sh=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Ag(e,t){if(e=e.containerInfo,pc=Ds,e=Df(e),Vr(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,O=0,L=0,V=e,k=null;t:for(;;){for(var B;V!==n||u!==0&&V.nodeType!==3||(x=h+u),V!==c||a!==0&&V.nodeType!==3||(q=h+a),V.nodeType===3&&(h+=V.nodeValue.length),(B=V.firstChild)!==null;)k=V,V=B;for(;;){if(V===e)break t;if(k===n&&++O===u&&(x=h),k===c&&++L===a&&(q=h),(B=V.nextSibling)!==null)break;V=k,k=V.parentNode}V=B}n=x===-1||q===-1?null:{start:x,end:q}}else n=null}n=n||{start:0,end:0}}else n=null;for(yc={focusedElem:e,selectionRange:n},Ds=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,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 ae=ha(n.type,u);e=a.getSnapshotBeforeUpdate(ae,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(ce){Ce(n,n.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)xc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xc(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,Pe=e;break}Pe=t.return}}function qh(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:pn(e,n),a&4&&Vl(5,n);break;case 1:if(pn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Ce(n,n.return,h)}else{var u=ha(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ce(n,n.return,h)}}a&64&&gh(n),a&512&&Yl(n,n.return);break;case 3:if(pn(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){Ce(n,n.return,h)}}break;case 27:t===null&&a&4&&Ah(n);case 26:case 5:pn(e,n),t===null&&a&4&&xh(n),a&512&&Yl(n,n.return);break;case 12:pn(e,n);break;case 31:pn(e,n),a&4&&Nh(e,n);break;case 13:pn(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||hn,!a){t=t!==null&&t.memoizedState!==null||Ze,u=hn;var c=Ze;hn=a,(Ze=t)&&!c?yn(e,n,(n.subtreeFlags&8772)!==0):pn(e,n),hn=u,Ze=c}break;case 30:break;default:pn(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&&Er(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 ze=null,dt=!1;function mn(e,t,n){for(n=n.child;n!==null;)jh(e,t,n),n=n.sibling}function jh(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 26:Ze||Ft(n,t),mn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ze||Ft(n,t);var a=ze,u=dt;Xn(n.type)&&(ze=n.stateNode,dt=!1),mn(e,t,n),Wl(n.stateNode),ze=a,dt=u;break;case 5:Ze||Ft(n,t);case 6:if(a=ze,u=dt,ze=null,mn(e,t,n),ze=a,dt=u,ze!==null)if(dt)try{(ze.nodeType===9?ze.body:ze.nodeName==="HTML"?ze.ownerDocument.body:ze).removeChild(n.stateNode)}catch(c){Ce(n,t,c)}else try{ze.removeChild(n.stateNode)}catch(c){Ce(n,t,c)}break;case 18:ze!==null&&(dt?(e=ze,gm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),il(e)):gm(ze,n.stateNode));break;case 4:a=ze,u=dt,ze=n.stateNode.containerInfo,dt=!0,mn(e,t,n),ze=a,dt=u;break;case 0:case 11:case 14:case 15:Un(2,n,t),Ze||Un(4,n,t),mn(e,t,n);break;case 1:Ze||(Ft(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&vh(n,t,a)),mn(e,t,n);break;case 21:mn(e,t,n);break;case 22:Ze=(a=Ze)||n.memoizedState!==null,mn(e,t,n),Ze=a;break;default:mn(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{il(e)}catch(n){Ce(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{il(e)}catch(n){Ce(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 ms(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 ht(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(Xn(x.type)){ze=x.stateNode,dt=!1;break e}break;case 5:ze=x.stateNode,dt=!1;break e;case 3:case 4:ze=x.stateNode.containerInfo,dt=!0;break e}x=x.return}if(ze===null)throw Error(r(160));jh(c,h,u),ze=null,dt=!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 Yt=null;function Th(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ht(t,e),mt(e),a&4&&(Un(3,e,e.return),Vl(3,e),Un(5,e,e.return));break;case 1:ht(t,e),mt(e),a&512&&(Ze||n===null||Ft(n,n.return)),a&64&&hn&&(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=Yt;if(ht(t,e),mt(e),a&512&&(Ze||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[pl]||c[et]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=u.createElement(a),u.head.insertBefore(c,u.querySelector("head > title"))),lt(c,a,n),c[et]=e,Ie(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),lt(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),lt(c,a,n),u.head.appendChild(c);break;default:throw Error(r(468,a))}c[et]=e,Ie(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&&Xu(e,e.memoizedProps,n.memoizedProps)}break;case 27:ht(t,e),mt(e),a&512&&(Ze||n===null||Ft(n,n.return)),n!==null&&a&4&&Xu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ht(t,e),mt(e),a&512&&(Ze||n===null||Ft(n,n.return)),e.flags&32){u=e.stateNode;try{Ta(u,"")}catch(ae){Ce(e,e.return,ae)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Xu(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Ju=!0);break;case 6:if(ht(t,e),mt(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(ae){Ce(e,e.return,ae)}}break;case 3:if(Ms=null,u=Yt,Yt=Ts(t.containerInfo),ht(t,e),Yt=u,mt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{il(t.containerInfo)}catch(ae){Ce(e,e.return,ae)}Ju&&(Ju=!1,wh(e));break;case 4:a=Yt,Yt=Ts(e.stateNode.containerInfo),ht(t,e),mt(e),Yt=a;break;case 12:ht(t,e),mt(e);break;case 31:ht(t,e),mt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ms(e,a)));break;case 13:ht(t,e),mt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ys=gt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ms(e,a)));break;case 22:u=e.memoizedState!==null;var q=n!==null&&n.memoizedState!==null,O=hn,L=Ze;if(hn=O||u,Ze=L||q,ht(t,e),Ze=L,hn=O,mt(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||q||hn||Ze||ma(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 V=q.memoizedProps.style,k=V!=null&&V.hasOwnProperty("display")?V.display:null;x.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(ae){Ce(q,q.return,ae)}}}else if(t.tag===6){if(n===null){q=t;try{q.stateNode.nodeValue=u?"":q.memoizedProps}catch(ae){Ce(q,q.return,ae)}}}else if(t.tag===18){if(n===null){q=t;try{var B=q.stateNode;u?vm(B,!0):vm(q.stateNode,!1)}catch(ae){Ce(q,q.return,ae)}}}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,ms(e,n))));break;case 19:ht(t,e),mt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ms(e,a)));break;case 30:break;case 21:break;default:ht(t,e),mt(e)}}function mt(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=Ku(e);hs(e,c,u);break;case 5:var h=n.stateNode;n.flags&32&&(Ta(h,""),n.flags&=-33);var x=Ku(e);hs(e,x,h);break;case 3:case 4:var q=n.stateNode.containerInfo,O=Ku(e);Zu(e,O,q);break;default:throw Error(r(161))}}catch(L){Ce(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 pn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qh(e,t.alternate,t),t=t.sibling}function ma(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Un(4,t,t.return),ma(t);break;case 1:Ft(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vh(t,t.return,n),ma(t);break;case 27:Wl(t.stateNode);case 26:case 5:Ft(t,t.return),ma(t);break;case 22:t.memoizedState===null&&ma(t);break;case 30:ma(t);break;default:ma(t)}e=e.sibling}}function yn(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:yn(u,c,n),Vl(4,c);break;case 1:if(yn(u,c,n),a=c,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(O){Ce(a,a.return,O)}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(O){Ce(a,a.return,O)}}n&&h&64&&gh(c),Yl(c,c.return);break;case 27:Ah(c);case 26:case 5:yn(u,c,n),n&&a===null&&h&4&&xh(c),Yl(c,c.return);break;case 12:yn(u,c,n);break;case 31:yn(u,c,n),n&&h&4&&Nh(u,c);break;case 13:yn(u,c,n),n&&h&4&&Ch(u,c);break;case 22:c.memoizedState===null&&yn(u,c,n),Yl(c,c.return);break;case 30:break;default:yn(u,c,n)}t=t.sibling}}function Fu(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&&Tl(n))}function $u(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tl(e))}function Qt(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:Qt(e,t,n,a),u&2048&&Vl(9,t);break;case 1:Qt(e,t,n,a);break;case 3:Qt(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&&Tl(e)));break;case 12:if(u&2048){Qt(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){Ce(t,t.return,q)}}else Qt(e,t,n,a);break;case 31:Qt(e,t,n,a);break;case 13:Qt(e,t,n,a);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Qt(e,t,n,a):Ql(e,t):c._visibility&2?Qt(e,t,n,a):(c._visibility|=2,Ja(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Fu(h,t);break;case 24:Qt(e,t,n,a),u&2048&&$u(t.alternate,t);break;default:Qt(e,t,n,a)}}function Ja(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,O=h.flags;switch(h.tag){case 0:case 11:case 15:Ja(c,h,x,q,u),Vl(8,h);break;case 23:break;case 22:var L=h.stateNode;h.memoizedState!==null?L._visibility&2?Ja(c,h,x,q,u):Ql(c,h):(L._visibility|=2,Ja(c,h,x,q,u)),u&&O&2048&&Fu(h.alternate,h);break;case 24:Ja(c,h,x,q,u),u&&O&2048&&$u(h.alternate,h);break;default:Ja(c,h,x,q,u)}t=t.sibling}}function Ql(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:Ql(n,a),u&2048&&Fu(a.alternate,a);break;case 24:Ql(n,a),u&2048&&$u(a.alternate,a);break;default:Ql(n,a)}t=t.sibling}}var Gl=8192;function Fa(e,t,n){if(e.subtreeFlags&Gl)for(e=e.child;e!==null;)Rh(e,t,n),e=e.sibling}function Rh(e,t,n){switch(e.tag){case 26:Fa(e,t,n),e.flags&Gl&&e.memoizedState!==null&&uv(n,Yt,e.memoizedState,e.memoizedProps);break;case 5:Fa(e,t,n);break;case 3:case 4:var a=Yt;Yt=Ts(e.stateNode.containerInfo),Fa(e,t,n),Yt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Gl,Gl=16777216,Fa(e,t,n),Gl=a):Fa(e,t,n));break;default:Fa(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 Xl(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];Pe=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:Xl(e),e.flags&2048&&Un(9,e,e.return);break;case 3:Xl(e);break;case 12:Xl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ps(e)):Xl(e);break;default:Xl(e)}}function ps(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];Pe=a,Dh(a,e)}_h(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Un(8,t,t.return),ps(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ps(t));break;default:ps(t)}e=e.sibling}}function Dh(e,t){for(;Pe!==null;){var n=Pe;switch(n.tag){case 0:case 11:case 15:Un(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:Tl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Pe=a;else e:for(n=e;Pe!==null;){a=Pe;var u=a.sibling,c=a.return;if(Eh(a),a===n){Pe=null;break e}if(u!==null){u.return=c,Pe=u;break e}Pe=c}}}var qg={getCacheForType:function(e){var t=nt(Ge),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return nt(Ge).controller.signal}},Eg=typeof WeakMap=="function"?WeakMap:Map,je=0,Re=null,pe=null,ge=0,Ne=0,Et=null,Ln=!1,$a=!1,Wu=!1,gn=0,He=0,Hn=0,pa=0,Iu=0,jt=0,Wa=0,Kl=null,pt=null,Pu=!1,ys=0,kh=0,gs=1/0,vs=null,Vn=null,We=0,Yn=null,Ia=null,vn=0,ec=0,tc=null,zh=null,Zl=0,nc=null;function Nt(){return(je&2)!==0&&ge!==0?ge&-ge:z.T!==null?uc():Wo()}function Bh(){if(jt===0)if((ge&536870912)===0||be){var e=Ni;Ni<<=1,(Ni&3932160)===0&&(Ni=262144),jt=e}else jt=536870912;return e=St.current,e!==null&&(e.flags|=32),jt}function yt(e,t,n){(e===Re&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)&&(Pa(e,0),Qn(e,ge,jt,!1)),ml(e,n),((je&2)===0||e!==Re)&&(e===Re&&((je&2)===0&&(pa|=n),He===4&&Qn(e,ge,jt,!1)),$t(e))}function Uh(e,t,n){if((je&6)!==0)throw Error(r(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||hl(e,t),u=a?Cg(e,t):lc(e,t,!0),c=a;do{if(u===0){$a&&!a&&Qn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!jg(n)){u=lc(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=Kl;var q=x.current.memoizedState.isDehydrated;if(q&&(Pa(x,h).flags|=256),h=lc(x,h,!1),h!==2){if(Wu&&!q){x.errorRecoveryDisabledLanes|=c,pa|=c,u=4;break e}c=pt,pt=u,c!==null&&(pt===null?pt=c:pt.push.apply(pt,c))}u=h}if(c=!1,u!==2)continue}}if(u===1){Pa(e,0),Qn(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:Qn(a,t,jt,!Ln);break e;case 2:pt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(u=ys+300-gt(),10<u)){if(Qn(a,t,jt,!Ln),Ti(a,0,!0)!==0)break e;vn=t,a.timeoutHandle=pm(Lh.bind(null,a,n,pt,vs,Pu,t,jt,pa,Wa,Ln,c,"Throttled",-0,0),u);break e}Lh(a,n,pt,vs,Pu,t,jt,pa,Wa,Ln,c,null,-0,0)}}break}while(!0);$t(e)}function Lh(e,t,n,a,u,c,h,x,q,O,L,V,k,B){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Rh(t,c,V);var ae=(c&62914560)===c?ys-gt():(c&4194048)===c?kh-gt():0;if(ae=cv(V,ae),ae!==null){vn=c,e.cancelPendingCommit=ae(Zh.bind(null,e,t,c,n,a,u,h,x,q,L,V,null,k,B)),Qn(e,c,h,!O);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(!bt(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 Qn(e,t,n,a){t&=~Iu,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var c=31-xt(u),h=1<<c;a[c]=-1,u&=~h}n!==0&&Jo(e,n,t)}function xs(){return(je&6)===0?(Jl(0),!1):!0}function ac(){if(pe!==null){if(Ne===0)var e=pe.return;else e=pe,rn=sa=null,xu(e),Qa=null,Ml=0,e=pe;for(;e!==null;)yh(e.alternate,e),e=e.return;pe=null}}function Pa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vn=0,ac(),Re=e,pe=n=ln(e.current,null),ge=t,Ne=0,Et=null,Ln=!1,$a=hl(e,t),Wu=!1,Wa=jt=Iu=pa=Hn=He=0,pt=Kl=null,Pu=!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-xt(a),c=1<<u;t|=e[u],a&=~c}return gn=t,Hi(),n}function Hh(e,t){de=null,z.H=Ul,t===Ya||t===Ji?(t=nd(),Ne=3):t===ru?(t=nd(),Ne=4):Ne=t===ku?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Et=t,pe===null&&(He=1,us(e,Mt(t,e.current)))}function Vh(){var e=St.current;return e===null?!0:(ge&4194048)===ge?Dt===null:(ge&62914560)===ge||(ge&536870912)!==0?e===Dt:!1}function Yh(){var e=z.H;return z.H=Ul,e===null?Ul:e}function Qh(){var e=z.A;return z.A=qg,e}function bs(){He=4,Ln||(ge&4194048)!==ge&&St.current!==null||($a=!0),(Hn&134217727)===0&&(pa&134217727)===0||Re===null||Qn(Re,ge,jt,!1)}function lc(e,t,n){var a=je;je|=2;var u=Yh(),c=Qh();(Re!==e||ge!==t)&&(vs=null,Pa(e,t)),t=!1;var h=He;e:do try{if(Ne!==0&&pe!==null){var x=pe,q=Et;switch(Ne){case 8:ac(),h=6;break e;case 3:case 2:case 9:case 6:St.current===null&&(t=!0);var O=Ne;if(Ne=0,Et=null,el(e,x,q,O),n&&$a){h=0;break e}break;default:O=Ne,Ne=0,Et=null,el(e,x,q,O)}}Ng(),h=He;break}catch(L){Hh(e,L)}while(!0);return t&&e.shellSuspendCounter++,rn=sa=null,je=a,z.H=u,z.A=c,pe===null&&(Re=null,ge=0,Hi()),h}function Ng(){for(;pe!==null;)Gh(pe)}function Cg(e,t){var n=je;je|=2;var a=Yh(),u=Qh();Re!==e||ge!==t?(vs=null,gs=gt()+500,Pa(e,t)):$a=hl(e,t);e:do try{if(Ne!==0&&pe!==null){t=pe;var c=Et;t:switch(Ne){case 1:Ne=0,Et=null,el(e,t,c,1);break;case 2:case 9:if(ed(c)){Ne=0,Et=null,Xh(t);break}t=function(){Ne!==2&&Ne!==9||Re!==e||(Ne=7),$t(e)},c.then(t,t);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:ed(c)?(Ne=0,Et=null,Xh(t)):(Ne=0,Et=null,el(e,t,c,7));break;case 5:var h=null;switch(pe.tag){case 26:h=pe.memoizedState;case 5:case 27:var x=pe;if(h?Mm(h):x.stateNode.complete){Ne=0,Et=null;var q=x.sibling;if(q!==null)pe=q;else{var O=x.return;O!==null?(pe=O,As(O)):pe=null}break t}}Ne=0,Et=null,el(e,t,c,5);break;case 6:Ne=0,Et=null,el(e,t,c,6);break;case 8:ac(),He=6;break e;default:throw Error(r(462))}}Tg();break}catch(L){Hh(e,L)}while(!0);return rn=sa=null,z.H=a,z.A=u,je=n,pe!==null?0:(Re=null,ge=0,Hi(),He)}function Tg(){for(;pe!==null&&!W0();)Gh(pe)}function Gh(e){var t=mh(e.alternate,e,gn);e.memoizedProps=e.pendingProps,t===null?As(e):pe=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,ge);break;case 11:t=uh(n,t,t.pendingProps,t.type.render,t.ref,ge);break;case 5:xu(t);default:yh(n,t),t=pe=Qf(t,gn),t=mh(n,t,gn)}e.memoizedProps=e.pendingProps,t===null?As(e):pe=t}function el(e,t,n,a){rn=sa=null,xu(t),Qa=null,Ml=0;var u=t.return;try{if(yg(e,u,t,n,ge)){He=1,us(e,Mt(n,e.current)),pe=null;return}}catch(c){if(u!==null)throw pe=u,c;He=1,us(e,Mt(n,e.current)),pe=null;return}t.flags&32768?(be||a===1?e=!0:$a||(ge&536870912)!==0?e=!1:(Ln=e=!0,(a===2||a===9||a===3||a===6)&&(a=St.current,a!==null&&a.tag===13&&(a.flags|=16384))),Kh(t,e)):As(t)}function As(e){var t=e;do{if((t.flags&32768)!==0){Kh(t,Ln);return}e=t.return;var n=xg(t.alternate,t,gn);if(n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);He===0&&(He=5)}function Kh(e,t){do{var n=bg(e.alternate,e);if(n!==null){n.flags&=32767,pe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=n}while(e!==null);He=6,pe=null}function Zh(e,t,n,a,u,c,h,x,q){e.cancelPendingCommit=null;do Ss();while(We!==0);if((je&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(c=t.lanes|t.childLanes,c|=Kr,ry(e,n,c,h,x,q),e===Re&&(pe=Re=null,ge=0),Ia=t,Yn=e,vn=n,ec=c,tc=u,zh=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_g(Ei,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=X.p,X.p=2,h=je,je|=4;try{Ag(e,t,n)}finally{je=h,X.p=u,z.T=a}}We=1,Jh(),Fh(),$h()}}function Jh(){if(We===1){We=0;var e=Yn,t=Ia,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var a=X.p;X.p=2;var u=je;je|=4;try{Th(t,e);var c=yc,h=Df(e.containerInfo),x=c.focusedElem,q=c.selectionRange;if(h!==x&&x&&x.ownerDocument&&Of(x.ownerDocument.documentElement,x)){if(q!==null&&Vr(x)){var O=q.start,L=q.end;if(L===void 0&&(L=O),"selectionStart"in x)x.selectionStart=O,x.selectionEnd=Math.min(L,x.value.length);else{var V=x.ownerDocument||document,k=V&&V.defaultView||window;if(k.getSelection){var B=k.getSelection(),ae=x.textContent.length,ce=Math.min(q.start,ae),Me=q.end===void 0?ce:Math.min(q.end,ae);!B.extend&&ce>Me&&(h=Me,Me=ce,ce=h);var R=_f(x,ce),C=_f(x,Me);if(R&&C&&(B.rangeCount!==1||B.anchorNode!==R.node||B.anchorOffset!==R.offset||B.focusNode!==C.node||B.focusOffset!==C.offset)){var _=V.createRange();_.setStart(R.node,R.offset),B.removeAllRanges(),ce>Me?(B.addRange(_),B.extend(C.node,C.offset)):(_.setEnd(C.node,C.offset),B.addRange(_))}}}}for(V=[],B=x;B=B.parentNode;)B.nodeType===1&&V.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<V.length;x++){var H=V[x];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}Ds=!!pc,yc=pc=null}finally{je=u,X.p=a,z.T=n}}e.current=t,We=2}}function Fh(){if(We===2){We=0;var e=Yn,t=Ia,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var a=X.p;X.p=2;var u=je;je|=4;try{qh(e,t.alternate,t)}finally{je=u,X.p=a,z.T=n}}We=3}}function $h(){if(We===4||We===3){We=0,I0();var e=Yn,t=Ia,n=vn,a=zh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?We=5:(We=0,Ia=Yn=null,Wh(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Vn=null),Sr(n),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(dl,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=z.T,u=X.p,X.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,X.p=u}}(vn&3)!==0&&Ss(),$t(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===nc?Zl++:(Zl=0,nc=e):Zl=0,Jl(0)}}function Wh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Tl(t)))}function Ss(){return Jh(),Fh(),$h(),Ih()}function Ih(){if(We!==5)return!1;var e=Yn,t=ec;ec=0;var n=Sr(vn),a=z.T,u=X.p;try{X.p=32>n?32:n,z.T=null,n=tc,tc=null;var c=Yn,h=vn;if(We=0,Ia=Yn=null,vn=0,(je&6)!==0)throw Error(r(331));var x=je;if(je|=4,Oh(c.current),Mh(c,c.current,h,n),je=x,Jl(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(dl,c)}catch{}return!0}finally{X.p=u,z.T=a,Wh(e,t)}}function Ph(e,t,n){t=Mt(n,t),t=Du(e.stateNode,t,2),e=kn(e,t,2),e!==null&&(ml(e,2),$t(e))}function Ce(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"&&(Vn===null||!Vn.has(a))){e=Mt(n,e),n=eh(2),a=kn(t,n,2),a!==null&&(th(n,a,t,e),ml(a,2),$t(a));break}}t=t.return}}function ic(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)||(Wu=!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,Re===e&&(ge&n)===n&&(He===4||He===3&&(ge&62914560)===ge&&300>gt()-ys?(je&2)===0&&Pa(e,0):Iu|=n,Wa===ge&&(Wa=0)),$t(e)}function em(e,t){t===0&&(t=Zo()),e=aa(e,t),e!==null&&(ml(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 vr(e,t)}var qs=null,tl=null,sc=!1,Es=!1,rc=!1,Gn=0;function $t(e){e!==tl&&e.next===null&&(tl===null?qs=tl=e:tl=tl.next=e),Es=!0,sc||(sc=!0,Dg())}function Jl(e,t){if(!rc&&Es){rc=!0;do for(var n=!1,a=qs;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-xt(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=ge,c=Ti(a,a===Re?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||hl(a,c)||(n=!0,lm(a,c));a=a.next}while(n);rc=!1}}function Og(){tm()}function tm(){Es=sc=!1;var e=0;Gn!==0&&Gg()&&(e=Gn);for(var t=gt(),n=null,a=qs;a!==null;){var u=a.next,c=nm(a,t);c===0?(a.next=null,n===null?qs=u:n.next=u,u===null&&(tl=n)):(n=a,(e!==0||(c&3)!==0)&&(Es=!0)),a=u}We!==0&&We!==5||Jl(e),Gn!==0&&(Gn=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-xt(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=Re,n=ge,n=Ti(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&xr(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||hl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&xr(a),Sr(n)){case 2:case 8:n=Xo;break;case 32:n=Ei;break;case 268435456:n=Ko;break;default:n=Ei}return a=am.bind(null,e),n=vr(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&xr(a),e.callbackPriority=2,e.callbackNode=null,2}function am(e,t){if(We!==0&&We!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ss()&&e.callbackNode!==n)return null;var a=ge;return a=Ti(e,e===Re?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Uh(e,a,t),nm(e,gt()),e.callbackNode!=null&&e.callbackNode===n?am.bind(null,e):null)}function lm(e,t){if(Ss())return null;Uh(e,t,!0)}function Dg(){Kg(function(){(je&6)!==0?vr(Go,Og):tm()})}function uc(){if(Gn===0){var e=Ha;e===0&&(e=ji,ji<<=1,(ji&261888)===0&&(ji=256)),Gn=e}return Gn}function im(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_i(""+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[ot]||null).action),h=a.submitter;h&&(t=(t=h[ot]||null)?im(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var x=new zi("action","action",null,a,u);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Gn!==0){var q=h?sm(u,h):new FormData(u);Tu(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),Tu(n,{pending:!0,data:q,method:u.method,action:c},c,q))},currentTarget:u}]})}}for(var cc=0;cc<Xr.length;cc++){var oc=Xr[cc],zg=oc.toLowerCase(),Bg=oc[0].toUpperCase()+oc.slice(1);Vt(zg,"on"+Bg)}Vt(Bf,"onAnimationEnd"),Vt(Uf,"onAnimationIteration"),Vt(Lf,"onAnimationStart"),Vt("dblclick","onDoubleClick"),Vt("focusin","onFocus"),Vt("focusout","onBlur"),Vt(Py,"onTransitionRun"),Vt(eg,"onTransitionStart"),Vt(tg,"onTransitionCancel"),Vt(Hf,"onTransitionEnd"),Na("onMouseEnter",["mouseout","mouseover"]),Na("onMouseLeave",["mouseout","mouseover"]),Na("onPointerEnter",["pointerout","pointerover"]),Na("onPointerLeave",["pointerout","pointerover"]),Pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fl="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(Fl));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,O=x.currentTarget;if(x=x.listener,q!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=O;try{c(u)}catch(L){Li(L)}u.currentTarget=null,c=q}else for(h=0;h<a.length;h++){if(x=a[h],q=x.instance,O=x.currentTarget,x=x.listener,q!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=O;try{c(u)}catch(L){Li(L)}u.currentTarget=null,c=q}}}}function ye(e,t){var n=t[qr];n===void 0&&(n=t[qr]=new Set);var a=e+"__bubble";n.has(a)||(um(t,e,2,!1),n.add(a))}function fc(e,t,n){var a=0;t&&(a|=4),um(n,e,a,t)}var js="_reactListening"+Math.random().toString(36).slice(2);function dc(e){if(!e[js]){e[js]=!0,ef.forEach(function(n){n!=="selectionchange"&&(Ug.has(n)||fc(n,!1,e),fc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[js]||(t[js]=!0,fc("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=Cc}n=u.bind(null,t,n,e),u=void 0,!_r||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 hc(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=qa(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 O=c,L=Mr(n),V=[];e:{var k=Vf.get(e);if(k!==void 0){var B=zi,ae=e;switch(e){case"keypress":if(Di(n)===0)break e;case"keydown":case"keyup":B=Ry;break;case"focusin":ae="focus",B=zr;break;case"focusout":ae="blur",B=zr;break;case"beforeblur":case"afterblur":B=zr;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,Me=!ce&&(e==="scroll"||e==="scrollend"),R=ce?k!==null?k+"Capture":null:k;ce=[];for(var C=O,_;C!==null;){var H=C;if(_=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||_===null||R===null||(H=gl(C,R),H!=null&&ce.push($l(C,H,_))),Me)break;C=C.return}0<ce.length&&(k=new B(k,ae,null,n,L),V.push({event:k,listeners:ce}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",k&&n!==wr&&(ae=n.relatedTarget||n.fromElement)&&(qa(ae)||ae[Sa]))break e;if((B||k)&&(k=L.window===L?L:(k=L.ownerDocument)?k.defaultView||k.parentWindow:window,B?(ae=n.relatedTarget||n.toElement,B=O,ae=ae?qa(ae):null,ae!==null&&(Me=d(ae),ce=ae.tag,ae!==Me||ce!==5&&ce!==27&&ce!==6)&&(ae=null)):(B=null,ae=O),B!==ae)){if(ce=yf,H="onMouseLeave",R="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ce=vf,H="onPointerLeave",R="onPointerEnter",C="pointer"),Me=B==null?k:yl(B),_=ae==null?k:yl(ae),k=new ce(H,C+"leave",B,n,L),k.target=Me,k.relatedTarget=_,H=null,qa(L)===O&&(ce=new ce(R,C+"enter",ae,n,L),ce.target=_,ce.relatedTarget=Me,H=ce),Me=H,B&&ae)t:{for(ce=Lg,R=B,C=ae,_=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(V,k,B,ce,!1),ae!==null&&Me!==null&&cm(V,Me,ae,ce,!0)}}e:{if(k=O?yl(O):window,B=k.nodeName&&k.nodeName.toLowerCase(),B==="select"||B==="input"&&k.type==="file")var qe=Nf;else if(Ef(k))if(Cf)qe=$y;else{qe=Jy;var le=Zy}else B=k.nodeName,!B||B.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?O&&Tr(O.elementType)&&(qe=Nf):qe=Fy;if(qe&&(qe=qe(e,O))){jf(V,qe,n,L);break e}le&&le(e,k,O),e==="focusout"&&O&&k.type==="number"&&O.memoizedProps.value!=null&&Cr(k,"number",k.value)}switch(le=O?yl(O):window,e){case"focusin":(Ef(le)||le.contentEditable==="true")&&(_a=le,Yr=O,jl=null);break;case"focusout":jl=Yr=_a=null;break;case"mousedown":Qr=!0;break;case"contextmenu":case"mouseup":case"dragend":Qr=!1,kf(V,n,L);break;case"selectionchange":if(Iy)break;case"keydown":case"keyup":kf(V,n,L)}var he;if(Ur)e:{switch(e){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else Ra?Sf(e,n)&&(ve="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ve="onCompositionStart");ve&&(xf&&n.locale!=="ko"&&(Ra||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&Ra&&(he=mf()):(Tn=L,Or="value"in Tn?Tn.value:Tn.textContent,Ra=!0)),le=Ns(O,ve),0<le.length&&(ve=new gf(ve,e,null,n,L),V.push({event:ve,listeners:le}),he?ve.data=he:(he=qf(n),he!==null&&(ve.data=he)))),(he=Yy?Qy(e,n):Gy(e,n))&&(ve=Ns(O,"onBeforeInput"),0<ve.length&&(le=new gf("onBeforeInput","beforeinput",null,n,L),V.push({event:le,listeners:ve}),le.data=he)),kg(V,e,O,n,L)}rm(V,t)})}function $l(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ns(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=gl(e,n),u!=null&&a.unshift($l(e,u,c)),u=gl(e,t),u!=null&&a.push($l(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,O=x.stateNode;if(x=x.tag,q!==null&&q===a)break;x!==5&&x!==26&&x!==27||O===null||(q=O,u?(O=gl(n,c),O!=null&&h.unshift($l(n,O,q))):u||(O=gl(n,c),O!=null&&h.push($l(n,O,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 we(e,t,n,a,u,c){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ta(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ta(e,""+a);break;case"className":Mi(e,"class",a);break;case"tabIndex":Mi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(e,n,a);break;case"style":ff(e,a,c);break;case"data":if(t!=="object"){Mi(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=_i(""+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"&&we(e,t,"name",u.name,u,null),we(e,t,"formEncType",u.formEncType,u,null),we(e,t,"formMethod",u.formMethod,u,null),we(e,t,"formTarget",u.formTarget,u,null)):(we(e,t,"encType",u.encType,u,null),we(e,t,"method",u.method,u,null),we(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=_i(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=nn);break;case"onScroll":a!=null&&ye("scroll",e);break;case"onScrollEnd":a!=null&&ye("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=_i(""+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":ye("beforetoggle",e),ye("toggle",e),wi(e,"popover",a);break;case"xlinkActuate":tn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":tn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":tn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":tn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":tn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":tn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":tn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":tn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":tn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":wi(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,wi(e,n,a))}}function mc(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"?Ta(e,a):(typeof a=="number"||typeof a=="bigint")&&Ta(e,""+a);break;case"onScroll":a!=null&&ye("scroll",e);break;case"onScrollEnd":a!=null&&ye("scrollend",e);break;case"onClick":a!=null&&(e.onclick=nn);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[ot]||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,""):wi(e,n,a)}}}function lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("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:we(e,t,c,h,n,null)}}u&&we(e,t,"srcSet",n.srcSet,n,null),a&&we(e,t,"src",n.src,n,null);return;case"input":ye("invalid",e);var x=c=h=u=null,q=null,O=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":O=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:we(e,t,a,L,n,null)}}rf(e,c,x,q,O,h,u,!1);return;case"select":ye("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:we(e,t,u,x,n,null)}t=c,n=h,e.multiple=!!a,t!=null?Ca(e,!!a,t,!1):n!=null&&Ca(e,!!a,n,!0);return;case"textarea":ye("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:we(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:we(e,t,q,a,n,null)}return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(a=0;a<Fl.length;a++)ye(Fl[a],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("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(O in n)if(n.hasOwnProperty(O)&&(a=n[O],a!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:we(e,t,O,a,n,null)}return;default:if(Tr(t)){for(L in n)n.hasOwnProperty(L)&&(a=n[L],a!==void 0&&mc(e,t,L,a,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(a=n[x],a!=null&&we(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,O=null,L=null;for(B in n){var V=n[B];if(n.hasOwnProperty(B)&&V!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":q=V;default:a.hasOwnProperty(B)||we(e,t,B,null,a,V)}}for(var k in a){var B=a[k];if(V=n[k],a.hasOwnProperty(k)&&(B!=null||V!=null))switch(k){case"type":c=B;break;case"name":u=B;break;case"checked":O=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!==V&&we(e,t,k,B,a,V)}}Nr(e,h,x,q,O,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)||we(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&&we(e,t,u,c,a,q)}t=x,n=h,a=B,k!=null?Ca(e,!!n,k,!1):!!a!=!!n&&(t!=null?Ca(e,!!n,t,!0):Ca(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:we(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&&we(e,t,h,u,a,c)}uf(e,k,B);return;case"option":for(var ae in n)if(k=n[ae],n.hasOwnProperty(ae)&&k!=null&&!a.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:we(e,t,ae,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:we(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)&&we(e,t,ce,null,a,k);for(O in a)if(k=a[O],B=n[O],a.hasOwnProperty(O)&&k!==B&&(k!=null||B!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(137,t));break;default:we(e,t,O,k,a,B)}return;default:if(Tr(t)){for(var Me in n)k=n[Me],n.hasOwnProperty(Me)&&k!==void 0&&!a.hasOwnProperty(Me)&&mc(e,t,Me,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||mc(e,t,L,k,a,B);return}}for(var R in n)k=n[R],n.hasOwnProperty(R)&&k!=null&&!a.hasOwnProperty(R)&&we(e,t,R,null,a,k);for(V in a)k=a[V],B=n[V],!a.hasOwnProperty(V)||k===B||k==null&&B==null||we(e,t,V,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],O=q.startTime;if(O>x)break;var L=q.transferSize,V=q.initiatorType;L&&dm(V)&&(q=q.responseEnd,h+=L*(q<x?1:(x-O)/(q-O)))}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 pc=null,yc=null;function Cs(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 gc(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 vc=null;function Gg(){var e=window.event;return e&&e.type==="popstate"?e===vc?!1:(vc=e,!0):(vc=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 Xn(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),il(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Wl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Wl(n);for(var c=n.firstChild;c;){var h=c.nextSibling,x=c.nodeName;c[pl]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&Wl(e.ownerDocument.body);n=u}while(n);il(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 xc(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":xc(n),Er(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[pl])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=kt(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=kt(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=kt(e.nextSibling),e===null))return null;return e}function bc(e){return e.data==="$?"||e.data==="$~"}function Ac(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 kt(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 Sc=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 kt(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=Cs(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 Wl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Er(e)}var zt=new Map,qm=new Set;function Ts(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xn=X.d;X.d={f:Wg,r:Ig,D:Pg,C:ev,L:tv,m:nv,X:lv,S:av,M:iv};function Wg(){var e=xn.f(),t=xs();return e||t}function Ig(e){var t=Ea(e);t!==null&&t.tag===5&&t.type==="form"?Hd(t):xn.r(e)}var nl=typeof document>"u"?null:document;function Em(e,t,n){var a=nl;if(a&&typeof t=="string"&&t){var u=Tt(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"),lt(t,"link",e),Ie(t),a.head.appendChild(t)))}}function Pg(e){xn.D(e),Em("dns-prefetch",e,null)}function ev(e,t){xn.C(e,t),Em("preconnect",e,t)}function tv(e,t,n){xn.L(e,t,n);var a=nl;if(a&&e&&t){var u='link[rel="preload"][as="'+Tt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Tt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Tt(n.imageSizes)+'"]')):u+='[href="'+Tt(e)+'"]';var c=u;switch(t){case"style":c=al(e);break;case"script":c=ll(e)}zt.has(c)||(e=A({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zt.set(c,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(Il(c))||t==="script"&&a.querySelector(Pl(c))||(t=a.createElement("link"),lt(t,"link",e),Ie(t),a.head.appendChild(t)))}}function nv(e,t){xn.m(e,t);var n=nl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Tt(a)+'"][href="'+Tt(e)+'"]',c=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ll(e)}if(!zt.has(c)&&(e=A({rel:"modulepreload",href:e},t),zt.set(c,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Pl(c)))return}a=n.createElement("link"),lt(a,"link",e),Ie(a),n.head.appendChild(a)}}}function av(e,t,n){xn.S(e,t,n);var a=nl;if(a&&e){var u=ja(a).hoistableStyles,c=al(e);t=t||"default";var h=u.get(c);if(!h){var x={loading:0,preload:null};if(h=a.querySelector(Il(c)))x.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zt.get(c))&&qc(e,n);var q=h=a.createElement("link");Ie(q),lt(q,"link",e),q._p=new Promise(function(O,L){q.onload=O,q.onerror=L}),q.addEventListener("load",function(){x.loading|=1}),q.addEventListener("error",function(){x.loading|=2}),x.loading|=4,ws(h,t,a)}h={type:"stylesheet",instance:h,count:1,state:x},u.set(c,h)}}}function lv(e,t){xn.X(e,t);var n=nl;if(n&&e){var a=ja(n).hoistableScripts,u=ll(e),c=a.get(u);c||(c=n.querySelector(Pl(u)),c||(e=A({src:e,async:!0},t),(t=zt.get(u))&&Ec(e,t),c=n.createElement("script"),Ie(c),lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(u,c))}}function iv(e,t){xn.M(e,t);var n=nl;if(n&&e){var a=ja(n).hoistableScripts,u=ll(e),c=a.get(u);c||(c=n.querySelector(Pl(u)),c||(e=A({src:e,async:!0,type:"module"},t),(t=zt.get(u))&&Ec(e,t),c=n.createElement("script"),Ie(c),lt(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)?Ts(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=al(n.href),n=ja(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=al(n.href);var c=ja(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(Il(e)))&&!c._p&&(h.instance=c,h.state.loading=5),zt.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},zt.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=ll(n),n=ja(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 al(e){return'href="'+Tt(e)+'"'}function Il(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}),lt(t,"link",n),Ie(t),e.head.appendChild(t))}function ll(e){return'[src="'+Tt(e)+'"]'}function Pl(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~="'+Tt(n.href)+'"]');if(a)return t.instance=a,Ie(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"),Ie(a),lt(a,"style",u),ws(a,n.precedence,e),t.instance=a;case"stylesheet":u=al(n.href);var c=e.querySelector(Il(u));if(c)return t.state.loading|=4,t.instance=c,Ie(c),c;a=Nm(n),(u=zt.get(u))&&qc(a,u),c=(e.ownerDocument||e).createElement("link"),Ie(c);var h=c;return h._p=new Promise(function(x,q){h.onload=x,h.onerror=q}),lt(c,"link",a),t.state.loading|=4,ws(c,n.precedence,e),t.instance=c;case"script":return c=ll(n.src),(u=e.querySelector(Pl(c)))?(t.instance=u,Ie(u),u):(a=n,(u=zt.get(c))&&(a=A({},n),Ec(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ie(u),lt(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,ws(a,n.precedence,e));return t.instance}function ws(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 qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ec(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ms=null;function Tm(e,t,n){if(Ms===null){var a=new Map,u=Ms=new Map;u.set(n,a)}else u=Ms,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[pl]||c[et]||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=al(a.href),c=t.querySelector(Il(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Rs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Ie(c);return}c=t.ownerDocument||t,a=Nm(a),(u=zt.get(u))&&qc(a,u),c=c.createElement("link"),Ie(c);var h=c;h._p=new Promise(function(x,q){h.onload=x,h.onerror=q}),lt(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=Rs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var jc=0;function cv(e,t){return e.stylesheets&&e.count===0&&Os(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Os(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&jc===0&&(jc=62500*Qg());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Os(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>jc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Rs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Os(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _s=null;function Os(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_s=new Map,t.forEach(ov,e),_s=null,Rs.call(e))}function ov(e,t){if(!(t.state.loading&4)){var n=_s.get(e);if(n)var a=n.get(null);else{n=new Map,_s.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=Rs.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 ei={$$typeof:G,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_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=br(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=br(0),this.hiddenUpdates=br(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,O,L,V){return e=new fv(e,t,n,h,q,O,L,V,x),t=1,c===!0&&(t|=24),c=At(3,null,null,t),e.current=c,c.stateNode=e,t=lu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:t},uu(c),e}function _m(e){return e?(e=ka,e):ka}function Om(e,t,n,a,u,c){u=_m(u),a.context===null?a.context=u:a.pendingContext=u,a=Dn(t),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=kn(e,a,t),n!==null&&(yt(n,e,t),_l(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 Nc(e,t){Dm(e,t),(e=e.alternate)&&Dm(e,t)}function km(e){if(e.tag===13||e.tag===31){var t=aa(e,67108864);t!==null&&yt(t,e,67108864),Nc(e,67108864)}}function zm(e){if(e.tag===13||e.tag===31){var t=Nt();t=Ar(t);var n=aa(e,t);n!==null&&yt(n,e,t),Nc(e,t)}}var Ds=!0;function dv(e,t,n,a){var u=z.T;z.T=null;var c=X.p;try{X.p=2,Cc(e,t,n,a)}finally{X.p=c,z.T=u}}function hv(e,t,n,a){var u=z.T;z.T=null;var c=X.p;try{X.p=8,Cc(e,t,n,a)}finally{X.p=c,z.T=u}}function Cc(e,t,n,a){if(Ds){var u=Tc(a);if(u===null)hc(e,t,a,ks,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=Ea(u);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=In(c.pendingLanes);if(h!==0){var x=c;for(x.pendingLanes|=2,x.entangledLanes|=2;h;){var q=1<<31-xt(h);x.entanglements[1]|=q,h&=~q}$t(c),(je&6)===0&&(gs=gt()+500,Jl(0))}}break;case 31:case 13:x=aa(c,2),x!==null&&yt(x,c,2),xs(),Nc(c,2)}if(c=Tc(a),c===null&&hc(e,t,a,ks,n),c===u)break;u=c}u!==null&&a.stopPropagation()}else hc(e,t,a,null,n)}}function Tc(e){return e=Mr(e),wc(e)}var ks=null;function wc(e){if(ks=null,e=qa(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 ks=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 Ei:case ey:return 32;case Ko:return 268435456;default:return 32}default:return 32}}var Mc=!1,Kn=null,Zn=null,Jn=null,ti=new Map,ni=new Map,Fn=[],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":Kn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":ti.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ni.delete(t.pointerId)}}function ai(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=Ea(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 Kn=ai(Kn,e,t,n,a,u),!0;case"dragenter":return Zn=ai(Zn,e,t,n,a,u),!0;case"mouseover":return Jn=ai(Jn,e,t,n,a,u),!0;case"pointerover":var c=u.pointerId;return ti.set(c,ai(ti.get(c)||null,e,t,n,a,u)),!0;case"gotpointercapture":return c=u.pointerId,ni.set(c,ai(ni.get(c)||null,e,t,n,a,u)),!0}return!1}function Lm(e){var t=qa(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 zs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);wr=a,n.target.dispatchEvent(a),wr=null}else return t=Ea(n),t!==null&&km(t),e.blockedOn=n,!1;t.shift()}return!0}function Hm(e,t,n){zs(e)&&n.delete(t)}function yv(){Mc=!1,Kn!==null&&zs(Kn)&&(Kn=null),Zn!==null&&zs(Zn)&&(Zn=null),Jn!==null&&zs(Jn)&&(Jn=null),ti.forEach(Hm),ni.forEach(Hm)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,Mc||(Mc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,yv)))}var Us=null;function Vm(e){Us!==e&&(Us=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Us===e&&(Us=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(wc(a||n)===null)continue;break}var c=Ea(n);c!==null&&(e.splice(t,3),t-=3,Tu(c,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function il(e){function t(q){return Bs(q,e)}Kn!==null&&Bs(Kn,e),Zn!==null&&Bs(Zn,e),Jn!==null&&Bs(Jn,e),ti.forEach(t),ni.forEach(t);for(var n=0;n<Fn.length;n++){var a=Fn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Fn.length&&(n=Fn[0],n.blockedOn===null);)Lm(n),n.blockedOn===null&&Fn.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[ot]||null;if(typeof c=="function")h||Vm(n);else if(h){var x=null;if(c&&c.hasAttribute("formAction")){if(u=c,h=c[ot]||null)x=h.formAction;else if(wc(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 Rc(e){this._internalRoot=e}Ls.prototype.render=Rc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,a=Nt();Om(n,a,e,t,null,null)},Ls.prototype.unmount=Rc.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),xs(),t[Sa]=null}};function Ls(e){this._internalRoot=e}Ls.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fn.length&&t!==0&&t<Fn[n].priority;n++);Fn.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"));X.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 Hs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hs.isDisabled&&Hs.supportsFiber)try{dl=Hs.inject(gv),vt=Hs}catch{}}return ii.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[Sa]=t.current,dc(e),new Rc(t)},ii.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=Nt(),a=Ar(a),u=Dn(a),u.callback=null,kn(n,u,a),n=a,t.current.lanes=n,ml(t,n),$t(t),e[Sa]=t.current,dc(e),new Ls(t)},ii.version="19.2.0",ii}var Pm;function Tv(){if(Pm)return Dc.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(),Dc.exports=Cv(),Dc.exports}var wv=Tv();var ep="popstate";function Mv(l={}){function i(r,f){let{pathname:d,search:m,hash:v}=r.location;return Ic("",{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:hi(f)}return _v(i,s,null,l)}function Be(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Xt(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 Ic(l,i,s=null,r){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof i=="string"?ul(i):i,state:s,key:i&&i.key||r||Rv()}}function hi({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 ul(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 D=Ic(E.location,j,M);g=b()+1;let G=tp(D,g),I=E.createHref(D);try{m.pushState(G,"",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 D=Ic(E.location,j,M);g=b();let G=tp(D,g),I=E.createHref(D);m.replaceState(G,"",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),Be(s,"No window.location.(origin|href) available to create URL");let r=typeof l=="string"?l:hi(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"?ul(i):i,d=En(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;Be(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=Sn([r,b.relativePath]),w=s.concat(b);m.children&&m.children.length>0&&(Be(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=ir({path:y.relativePath,caseSensitive:y.caseSensitive,end:g},b),w=y.route;if(!A&&g&&s&&!r[r.length-1].route.index&&(A=ir({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},b)),!A)return null;Object.assign(f,A.params),m.push({params:f,pathname:Sn([d,A.pathname]),pathnameBase:Wv(Sn([d,A.pathnameBase])),route:w}),A.pathnameBase!=="/"&&(d=Sn([d,A.pathnameBase]))}return m}function ir(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){Xt(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 Xt(!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 En(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"?ul(l):l,d;if(s)if(Jv(s))d=s;else{if(s.includes("//")){let m=s;s=s.replace(/\/\/+/g,"/"),Xt(!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 Uc(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=ul(l):(f={...l},Be(!f.pathname||!f.pathname.includes("?"),Uc("?","pathname","search",f)),Be(!f.pathname||!f.pathname.includes("#"),Uc("#","pathname","hash",f)),Be(!f.search||!f.search.includes("#"),Uc("#","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 Sn=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 cl=p.createContext(null);cl.displayName="DataRouter";var cr=p.createContext(null);cr.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 xi=p.createContext(null);xi.displayName="Location";var jn=p.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName="Route";var po=p.createContext(null);po.displayName="RouteError";function lx(l,{relative:i}={}){Be(bi(),"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}=Ai(l,{relative:i}),v=d;return s!=="/"&&(v=d==="/"?s:Sn([s,d])),r.createHref({pathname:v,search:m,hash:f})}function bi(){return p.useContext(xi)!=null}function ba(){return Be(bi(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(xi).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(jn);return l?vx():sx()}function sx(){Be(bi(),"useNavigate() may be used only in the context of a <Router> component.");let l=p.useContext(cl),{basename:i,navigator:s}=p.useContext(Pt),{matches:r}=p.useContext(jn),{pathname:f}=ba(),d=JSON.stringify(Yp(r)),m=p.useRef(!1);return Zp(()=>{m.current=!0}),p.useCallback((y,g={})=>{if(Xt(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:Sn([i,b.pathname])),(g.replace?s.replace:s.push)(b,g.state,g)},[i,s,d,f,l])}p.createContext(null);function Ai(l,{relative:i}={}){let{matches:s}=p.useContext(jn),{pathname:r}=ba(),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){Be(bi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=p.useContext(Pt),{matches:m}=p.useContext(jn),v=m[m.length-1],y=v?v.params:{},g=v?v.pathname:"/",b=v?v.pathnameBase:"/",A=v&&v.route;{let D=A&&A.path||"";Fp(g,!A||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${D}">) 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="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let w=ba(),T;if(i){let D=typeof i=="string"?ul(i):i;Be(b==="/"||D.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 "${D.pathname}" was given in the \`location\` prop.`),T=D}else T=w;let N=T.pathname||"/",E=N;if(b!=="/"){let D=b.replace(/^\//,"").split("/");E="/"+N.replace(/^\//,"").split("/").slice(D.length).join("/")}let j=Lp(l,{pathname:E});Xt(A||j!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Xt(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(D=>Object.assign({},D,{params:Object.assign({},y,D.params),pathname:Sn([b,d.encodeLocation?d.encodeLocation(D.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?b:Sn([b,d.encodeLocation?d.encodeLocation(D.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),m,s,r,f);return i&&M?p.createElement(xi.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(jn.Provider,{value:this.props.routeContext},p.createElement(po.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function fx({routeContext:l,match:i,children:s}){let r=p.useContext(cl);return r&&r.static&&r.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(jn.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);Be(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)),D=()=>{let G;return T?G=E:N?G=j:A.route.Component?G=p.createElement(A.route.Component,null):A.route.element?G=A.route.element:G=b,p.createElement(fx,{match:A,routeContext:{outlet:b,matches:M,isDataRoute:s!=null},children:G})};return s&&(A.route.ErrorBoundary||A.route.errorElement||w===0)?p.createElement(ox,{location:s.location,revalidation:s.revalidation,component:E,error:T,children:D(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:g}):D()},null)}function yo(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(cl);return Be(i,yo(l)),i}function mx(l){let i=p.useContext(cr);return Be(i,yo(l)),i}function px(l){let i=p.useContext(jn);return Be(i,yo(l)),i}function go(l){let i=px(l),s=i.matches[i.matches.length-1];return Be(s.route.id,`${l} can only be used on routes that contain a unique "id"`),s.route.id}function yx(){return go("useRouteId")}function gx(){let l=p.useContext(po),i=mx("useRouteError"),s=go("useRouteError");return l!==void 0?l:i.errors?.[s]}function vx(){let{router:l}=hx("useNavigate"),i=go("useNavigate"),s=p.useRef(!1);return Zp(()=>{s.current=!0}),p.useCallback(async(f,d={})=>{Xt(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,Xt(!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 $s(l){Be(!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}){Be(!bi(),"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=ul(s));let{pathname:y="/",search:g="",hash:b="",state:A=null,key:w="default"}=s,T=p.useMemo(()=>{let N=En(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 Xt(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(xi.Provider,{children:i,value:T}))}function Ax({children:l,location:i}){return rx(Pc(l),i)}function Pc(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,Pc(r.props.children,d));return}Be(r.type===$s,`[${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>`),Be(!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=Pc(r.props.children,d)),s.push(m)}),s}var Ws="get",Is="application/x-www-form-urlencoded";function or(l){return l!=null&&typeof l.tagName=="string"}function Sx(l){return or(l)&&l.tagName.toLowerCase()==="button"}function qx(l){return or(l)&&l.tagName.toLowerCase()==="form"}function Ex(l){return or(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 Vs=null;function Cx(){if(Vs===null)try{new FormData(document.createElement("form"),0),Vs=!1}catch{Vs=!0}return Vs}var Tx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lc(l){return l!=null&&!Tx.has(l)?(Xt(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Is}"`),null):l}function wx(l,i){let s,r,f,d,m;if(qx(l)){let v=l.getAttribute("action");r=v?En(v,i):null,s=l.getAttribute("method")||Ws,f=Lc(l.getAttribute("enctype"))||Is,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?En(y,i):null,s=l.getAttribute("formmethod")||v.getAttribute("method")||Ws,f=Lc(l.getAttribute("formenctype"))||Lc(v.getAttribute("enctype"))||Is,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(or(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Ws,r=null,f=Is,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 vo(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&&En(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(cl);return vo(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function Ux(){let l=p.useContext(cr);return vo(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var xo=p.createContext(void 0);xo.displayName="FrameworkContext";function Wp(){let l=p.useContext(xo);return vo(l,"You must render this element inside a <HydratedRouter> element"),l}function Lx(l,i){let s=p.useContext(xo),[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(D=>{m(D.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:si(v,T),onBlur:si(y,N),onMouseEnter:si(g,T),onMouseLeave:si(b,N),onTouchStart:si(A,T)}]:[!1,w,{}]}function si(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=ba(),{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 D=f.routes[M.route.id];!D||!D.hasLoader||(!g.some(G=>G.route.id===M.route.id)&&M.route.id in v&&d[M.route.id]?.shouldRevalidate||D.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 ie=new URL(window.location.href),oe=g.startsWith("//")?new URL(ie.protocol+g):new URL(g),xe=En(oe.pathname,N);oe.origin===ie.origin&&xe!=null?g=xe+oe.search+oe.hash:M=!0}catch{Xt(!1,`<Link to="${g}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=lx(g,{relative:f}),[G,I,F]=Lx(r,w),$=Jx(g,{replace:m,state:v,target:y,preventScrollReset:b,relative:f,viewTransition:A});function Y(ie){i&&i(ie),ie.defaultPrevented||$(ie)}let W=p.createElement("a",{...w,...F,href:j||D,onClick:M||d?i:Y,ref:Qx(T,I),target:y,"data-discover":!E&&s==="render"?"true":void 0});return G&&!E?p.createElement(p.Fragment,null,W,p.createElement(Hx,{page:D})):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=Ai(m,{relative:g.relative}),w=ba(),T=p.useContext(cr),{navigator:N,basename:E}=p.useContext(Pt),j=T!=null&&Px(A)&&v===!0,M=N.encodeLocation?N.encodeLocation(A).pathname:A.pathname,D=w.pathname,G=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;s||(D=D.toLowerCase(),G=G?G.toLowerCase():null,M=M.toLowerCase()),G&&E&&(G=En(G,E)||G);const I=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let F=D===M||!f&&D.startsWith(M)&&D.charAt(I)==="/",$=G!=null&&(G===M||!f&&G.startsWith(M)&&G.charAt(M.length)==="/"),Y={isActive:F,isPending:$,isTransitioning:j},W=F?i:void 0,ie;typeof r=="function"?ie=r(Y):ie=[r,F?"active":null,$?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let oe=typeof d=="function"?d(Y):d;return p.createElement(e0,{...g,"aria-current":W,className:ie,ref:b,style:oe,to:m,viewTransition:v},typeof y=="function"?y(Y):y)});Xx.displayName="NavLink";var Kx=p.forwardRef(({discover:l="render",fetcherKey:i,navigate:s,reloadDocument:r,replace:f,state:d,method:m=Ws,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),D=G=>{if(y&&y(G),G.defaultPrevented)return;G.preventDefault();let I=G.nativeEvent.submitter,F=I?.getAttribute("formmethod")||m;N(I||G.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:D,...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(cl);return Be(i,Zx(l)),i}function Jx(l,{target:i,replace:s,state:r,preventScrollReset:f,relative:d,viewTransition:m}={}){let v=ix(),y=ba(),g=Ai(l,{relative:d});return p.useCallback(b=>{if(Nx(b,i)){b.preventDefault();let A=s!==void 0?s:hi(y)===hi(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(jn);Be(r,"useFormAction must be used inside a RouteContext");let[f]=r.matches.slice(-1),d={...Ai(l||".",{relative:i})},m=ba();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:Sn([s,d.pathname])),hi(d)}function Px(l,{relative:i}={}){let s=p.useContext(Xp);Be(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=Ai(l,{relative:i});if(!s.isTransitioning)return!1;let d=En(s.currentLocation.pathname,r)||s.currentLocation.pathname,m=En(s.nextLocation.pathname,r)||s.nextLocation.pathname;return ir(f.pathname,m)!=null||ir(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 Ps=Object.create(null);Object.keys(It).forEach(l=>{Ps[It[l]]=l});const eo={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,bo=({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 Hc;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));bo(l,!1,s=>{Hc||(Hc=new TextEncoder),i(Hc.encode(s))})}const up="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<up.length;l++)fi[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=fi[l.charCodeAt(r)],m=fi[l.charCodeAt(r+1)],v=fi[l.charCodeAt(r+2)],y=fi[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",Ao=(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)}:Ps[s]?l.length>1?{type:Ps[s],data:l.substring(1)}:{type:Ps[s]}:eo},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)=>{bo(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=Ao(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 Vc;function Ys(l){return l.reduce((i,s)=>i+s.length,0)}function Qs(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){Vc||(Vc=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(Ys(s)<1)break;const y=Qs(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(Ys(s)<2)break;const y=Qs(s,2);f=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),r=3}else if(r===2){if(Ys(s)<8)break;const y=Qs(s,8),g=new DataView(y.buffer,y.byteOffset,y.length),b=g.getUint32(0);if(b>Math.pow(2,21)-1){v.enqueue(eo);break}f=b*Math.pow(2,32)+g.getUint32(4),r=3}else{if(Ys(s)<f)break;const y=Qs(s,f);v.enqueue(Ao(d?y:Vc.decode(y),i)),r=0}if(f===0||f>l){v.enqueue(eo);break}}}})}const r0=4;function Fe(l){if(l)return ub(l)}function ub(l){for(var i in Fe.prototype)l[i]=Fe.prototype[i];return l}Fe.prototype.on=Fe.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};Fe.prototype.once=function(l,i){function s(){this.off(l,s),i.apply(this,arguments)}return s.fn=i,this.on(l,s),this};Fe.prototype.off=Fe.prototype.removeListener=Fe.prototype.removeAllListeners=Fe.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};Fe.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};Fe.prototype.emitReserved=Fe.prototype.emit;Fe.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};Fe.prototype.hasListeners=function(l){return!!this.listeners(l).length};const fr=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,s)=>s(i,0),Bt=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=Bt.setTimeout,fb=Bt.clearTimeout;function dr(l,i){i.useNativeTimers?(l.setTimeoutFn=ob.bind(Bt),l.clearTimeoutFn=fb.bind(Bt)):(l.setTimeoutFn=Bt.setTimeout.bind(Bt),l.clearTimeoutFn=Bt.clearTimeout.bind(Bt))}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 So extends Fe{constructor(i){super(),this.writable=!1,dr(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=Ao(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 So{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 Fe{constructor(i,s,r){super(),this.createRequest=i,dr(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 Bt?"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 Bt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const d0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Eb extends So{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;bo(r,this.supportsBinary,d=>{try{this.doWrite(r,d)}catch{}f&&fr(()=>{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 Yc=Bt.WebSocket||Bt.MozWebSocket;class jb extends Eb{createSocket(i,s,r){return d0?new Yc(i,s,r):s?new Yc(i,s):new Yc(i)}doWrite(i,s){this.ws.send(s)}}class Nb extends So{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&&fr(()=>{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 to(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 no=typeof addEventListener=="function"&&typeof removeEventListener=="function",er=[];no&&addEventListener("offline",()=>{er.forEach(l=>l())},!1);class Wn extends Fe{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=to(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=to(s.host).host);dr(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)),no&&(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"})},er.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&&Wn.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",Wn.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,fr(()=>{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(Wn.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(),no&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=er.indexOf(this._offlineEventListener);r!==-1&&er.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,s),this.writeBuffer=[],this._prevBufferLen=0}}}Wn.protocol=r0;class _b extends Wn{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;Wn.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;Wn.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=to(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 qo(l){return kb&&(l instanceof ArrayBuffer||zb(l))||Bb&&l instanceof Blob||Ub&&l instanceof File}function tr(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let s=0,r=l.length;s<r;s++)if(tr(l[s]))return!0;return!1}if(qo(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return tr(l.toJSON(),!0);for(const s in l)if(Object.prototype.hasOwnProperty.call(l,s)&&tr(l[s]))return!0;return!1}function Lb(l){const i=[],s=l.data,r=l;return r.data=ao(s,i),r.attachments=i.length,{packet:r,buffers:i}}function ao(l,i){if(!l)return l;if(qo(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]=ao(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]=ao(l[r],i));return s}return l}function Hb(l,i){return l.data=lo(l.data,i),delete l.attachments,l}function lo(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]=lo(l[s],i);else if(typeof l=="object")for(const s in l)Object.prototype.hasOwnProperty.call(l,s)&&(l[s]=lo(l[s],i));return l}const Vb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Yb=5;var Ae;(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"})(Ae||(Ae={}));class Qb{constructor(i){this.replacer=i}encode(i){return(i.type===Ae.EVENT||i.type===Ae.ACK)&&tr(i)?this.encodeAsBinary({type:i.type===Ae.EVENT?Ae.BINARY_EVENT:Ae.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let s=""+i.type;return(i.type===Ae.BINARY_EVENT||i.type===Ae.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 Eo extends Fe{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===Ae.BINARY_EVENT;r||s.type===Ae.BINARY_ACK?(s.type=r?Ae.EVENT:Ae.ACK,this.reconstructor=new Gb(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(qo(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(Ae[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ae.BINARY_EVENT||r.type===Ae.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(Eo.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 Ae.CONNECT:return op(s);case Ae.DISCONNECT:return s===void 0;case Ae.CONNECT_ERROR:return typeof s=="string"||op(s);case Ae.EVENT:case Ae.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&Vb.indexOf(s[0])===-1);case Ae.ACK:case Ae.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:Eo,Encoder:Qb,get PacketType(){return Ae},protocol:Yb},Symbol.toStringTag,{value:"Module"}));function Gt(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 Fe{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=[Gt(i,"open",this.onopen.bind(this)),Gt(i,"packet",this.onpacket.bind(this)),Gt(i,"error",this.onerror.bind(this)),Gt(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:Ae.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:Ae.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 Ae.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 Ae.EVENT:case Ae.BINARY_EVENT:this.onevent(i);break;case Ae.ACK:case Ae.BINARY_ACK:this.onack(i);break;case Ae.DISCONNECT:this.ondisconnect();break;case Ae.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:Ae.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:Ae.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 ol(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}ol.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};ol.prototype.reset=function(){this.attempts=0};ol.prototype.setMin=function(l){this.ms=l};ol.prototype.setMax=function(l){this.max=l};ol.prototype.setJitter=function(l){this.jitter=l};class io extends Fe{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,dr(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 ol({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=Gt(s,"open",function(){r.onopen(),i&&i()}),d=v=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",v),i?i(v):this.maybeReconnectOnOpen()},m=Gt(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(Gt(i,"ping",this.onping.bind(this)),Gt(i,"data",this.ondata.bind(this)),Gt(i,"error",this.onerror.bind(this)),Gt(i,"close",this.onclose.bind(this)),Gt(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){fr(()=>{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 ri={};function nr(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=ri[f]&&d in ri[f].nsps,v=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let y;return v?y=new io(r,i):(ri[f]||(ri[f]=new io(r,i)),y=ri[f]),s.query&&!i.query&&(i.query=s.queryKey),y.socket(s.path,i)}Object.assign(nr,{Manager:io,Socket:m0,io:nr,connect:nr});const p0=window.location.origin;console.info("[socket] connecting to",p0);const jo=nr(p0,{transports:["polling","websocket"],timeout:15e3});jo.on("connect_error",l=>console.error("connect_error",l.code,l.message,l.data));const y0=p.createContext(jo),Zb=({children:l})=>o.jsx(y0.Provider,{value:jo,children:l}),Aa=()=>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=Aa(),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 Ve(){return p.useContext(g0)}const v0=p.createContext({frames:{}});function $b({children:l}){const i=Aa(),[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 No(){return p.useContext(v0).frames}function hr(l){const i=No();return l?i[l]??null:null}function Co(){const{connected:l,session:i}=Ve(),s=i?.assignment?.roverId,r=hr(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(bn,{label:"Voltage",value:i??"--"}),o.jsx(bn,{label:"Current",value:s??"--"}),o.jsx(bn,{label:"Battery temp",value:r??"--"}),o.jsx(bn,{label:"Charge",value:f!=null?`${f} mAh`:"--"}),o.jsx(bn,{label:"Capacity",value:d!=null?`${d} mAh`:"--"}),o.jsx(bn,{label:"Charge %",value:m}),o.jsx(bn,{label:"OI mode",value:v}),o.jsx(bn,{label:"Docked",value:y}),o.jsx(bn,{label:"Charging state",value:g})]})}function bn({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(ui,{title:"Bumps & drops",children:[o.jsx(An,{label:"Bump L",value:o.jsx(ci,{active:i.bumpLeft})}),o.jsx(An,{label:"Bump R",value:o.jsx(ci,{active:i.bumpRight})}),o.jsx(An,{label:"Wheel drop L",value:o.jsx(ci,{active:i.wheelDropLeft,tone:"amber"})}),o.jsx(An,{label:"Wheel drop R",value:o.jsx(ci,{active:i.wheelDropRight,tone:"amber"})})]}),o.jsx(ui,{title:"Light bumps (raw)",children:r.map(m=>o.jsx(An,{label:m.label,value:oi(m.value)},m.label))}),o.jsx(ui,{title:"Cliff sensors",children:f.map(m=>o.jsx(An,{label:m.label,value:`${oi(m.value)} · ${m.active?"bool: true":"bool: false"}`},m.label))}),o.jsx(ui,{title:"Currents",children:d.map(m=>o.jsx(An,{label:m.label,value:o.jsxs("span",{className:"flex items-center gap-0.5",children:[o.jsx("span",{children:oi(m.value,"mA")}),m.over?o.jsx(ci,{active:!0,tone:"red",label:"over"}):null]})},m.label))}),o.jsxs(ui,{title:"Dirt detect",children:[o.jsx(An,{label:"Left",value:oi(l?.dirtDetectLeft)}),o.jsx(An,{label:"Right",value:oi(l?.dirtDetect)})]})]})}function ui({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 An({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 ci({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 oi(l,i){return l==null||Number.isNaN(l)?"--":i?`${l} ${i}`:l}const Qc={main:[-127,127],side:[-127,127],vacuum:[0,127]},Gc={maxSpeed:500,baseSpeed:250,boostSpeed:400},so=100,To=[31,127],sl=60,ro=8,Pb=250,e1={start:[128],safe:[131],full:[132],passive:[128],dock:[143]},di={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:so},{type:"oi",command:"dock"},{type:"pause",duration:so},{type:"oi",command:"full"}]},{id:"seek-dock",label:"Dock",description:"Send the seek dock command.",steps:[{type:"oi",command:"dock"}]}];function uo(){return{vector:{x:0,y:0,boost:!1},speeds:{left:0,right:0},source:null,lastUpdatedAt:0}}function co(){return{main:0,side:0,vacuum:0}}function t1(){return{enabled:!1,angle:null,config:null}}function ar(){return{note:sl}}const fp={roverId:null,mode:"drive",drive:uo(),aux:co(),camera:t1(),song:ar(),macros:x0,keymap:di,inputs:{}};function n1(l,i){switch(i.type){case"control/set-rover":return{...l,roverId:i.payload??null,drive:i.payload?l.drive:uo(),aux:i.payload?l.aux:co(),song:i.payload?l.song:ar()};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:uo(),aux:co(),song:ar()};case"control/set-song-note":return{...l,song:{...l.song||ar(),note:i.payload??sl}};default:return l}}function rl(l,i,s){return typeof l!="number"||Number.isNaN(l)?i:Math.max(i,Math.min(s,l))}function qn(l){return typeof l!="number"||Number.isNaN(l)?0:Math.max(-1,Math.min(1,l))}function ya(l,i){return!Array.isArray(i)||i.length!==2?l:rl(l,i[0],i[1])}function a1(l={}){const i=qn(l.x??0),s=qn(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:Gc.maxSpeed,f=typeof i.baseSpeed=="number"?i.baseSpeed:Gc.baseSpeed,d=typeof i.boostSpeed=="number"?i.boostSpeed:Gc.boostSpeed,m=s.boost?d:f,v=s.y*m,y=s.x*m;return{vector:s,speeds:{left:rl(Math.round(v+y),-r,r),right:rl(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=Aa(),{session:i}=Ve(),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:ya(E?.left??0,[-500,500]),right:ya(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 D={main:ya(E,Qc.main),side:ya(j,Qc.side),vacuum:ya(M,Qc.vacuum)};return m({type:"motors",data:{motorPwm:D}}),D},[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??so);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 D=(Array.isArray(E)&&E.length>0?E:[{note:sl,duration:ro}]).slice(0,16).map(G=>({note:ya(Math.round(G?.note??sl),To),duration:ya(Math.round(G?.duration??ro),[1,255])}));return m({type:"song",data:{song:{notes:D,slot:j.slot,loop:j.loop}}}),D},[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 Si(l){if(typeof l!="string")return"";const i=l.toLowerCase();return r1[i]??i}function u1(l){const i=Si(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=Si(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 mi(l){const i=Si(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 wo({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 Ut(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 rl(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}=Ut("controls",{keymap:di,macros:x0}),{session:g,homeAssistantSetState:b}=Ve(),A=p.useCallback(()=>{const ee=(g?.homeAssistant?.entities||[]).filter(J=>(J.type==="light"||J.type==="switch")&&J.available!==!1&&J.state!=="on");if(ee.length===0){d.current=!1;return}d.current=!0,ee.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={...di,...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 ee=typeof Z.minAngle=="number"?Z.minAngle:-45,J=typeof Z.maxAngle=="number"?Z.maxAngle:45,z=typeof Z.homeAngle=="number"?Z.homeAngle:(ee+J)/2,X=typeof m.current=="number"?rl(m.current,ee,J):null,ne=X??rl(z,ee,J);r({type:"control/set-camera-config",payload:{config:Z,angle:ne}}),m.current=ne},[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,ee={})=>{const J=l1(Z,ee.speedOptions);r({type:"control/update-drive",payload:{...J,source:ee.source??null}}),i.sendDriveDirect(J.speeds)},[i]),N=p.useCallback((Z={})=>{const ee=i.sendAuxMotors(Z)??Z;r({type:"control/set-aux-motors",payload:ee})},[i]),E=p.useCallback((Z,ee)=>{if(!Z)return!1;const J=Si(ee);if(!J)return!1;const z=gp(s.keymap);return z[Z]=[J],r({type:"control/set-keymap",payload:z}),y(X=>({...X??{},keymap:z})),!0},[s.keymap,y]),j=p.useCallback(()=>{const Z=gp(di);r({type:"control/set-keymap",payload:Z}),y(ee=>({...ee??{},keymap:Z}))},[y]),M=p.useCallback(Z=>{if(!i.servoConfig)return;const ee=m1(i.servoConfig,Z);r({type:"control/set-camera-angle",payload:ee}),i.sendServoAngle(ee),m.current=ee},[i]),D=p.useCallback((Z=0)=>{const ee=i.servoConfig;if(!ee)return;const J=typeof Z=="number"&&Z!==0?Z:ee.nudgeDegrees||1,z=typeof m.current=="number"?m.current:typeof ee.homeAngle=="number"?ee.homeAngle:0;M(z+J)},[i.servoConfig,M]),G=p.useCallback(()=>{const Z=i.servoConfig;if(!Z)return;const ee=typeof Z.homeAngle=="number"?Z.homeAngle:typeof Z.minAngle=="number"&&typeof Z.maxAngle=="number"?(Z.minAngle+Z.maxAngle)/2:0;M(ee)},[i.servoConfig,M]),I=p.useCallback(async Z=>{const ee=s.macros.find(J=>J.id===Z)||null;ee&&(Z==="drive-sequence"&&(A(),g?.homeAssistant?.entities||(d.current=!0)),await i.runMacroSteps(ee))},[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]),Y=p.useCallback(Z=>{i.roverId&&i.emitCommand({type:"sensorStream",data:{sensorStream:{enable:Z}}})},[i]),W=p.useCallback(()=>{i.sendNightVision("toggle")},[i]),ie=p.useCallback(Z=>{const ee=typeof Z=="number"?Z:sl;return r({type:"control/set-song-note",payload:ee}),ee},[]),oe=p.useCallback((Z,ee)=>i.sendSong(Z,ee),[i]),xe=p.useCallback((Z,ee)=>{r({type:"control/register-input-state",payload:{source:Z,state:ee}})},[]),Se=p.useMemo(()=>({state:s,dispatch:r,pipeline:i,actions:{setMode:w,setDriveVector:T,setAuxMotors:N,setServoAngle:M,nudgeServo:D,goServoHome:G,runMacro:I,stopAllMotion:F,sendOiCommand:$,setSensorStream:Y,toggleNightVision:W,updateKeyBinding:E,resetKeyBindings:j,registerInputState:xe,setSongNote:ie,sendSong:oe}}),[s,i,w,T,N,M,D,G,I,F,$,Y,W,E,j,xe,ie,oe]);return o.jsx(q0.Provider,{value:Se,children:l})}function Lt(){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=Aa(),{session:s}=Ve(),[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(D={}){f(G=>[...G.slice(-99),D]),!(D?.socketId&&s?.socketId&&D.socketId===s.socketId)&&g()}return i.on("chat:message",M),()=>{i.off("chat:message",M)}},[g,s?.socketId,i]);const b=p.useCallback((M,D=null)=>new Promise((G,I)=>{i.emit("chat:send",{text:M,tts:D},(F={})=>{F.error?I(new Error(F.error)):G(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 it={keyboard:{baseSpeed:250,turboSpeed:400,precisionSpeed:125,tiltSpeed:80,tiltIntervalMs:110},gamepad:{driveDeadzone:.2,cameraDeadzone:.25,servoStep:2,auxReverseScale:.55}},sr={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}},Xc="keyboard",Kc={x:0,y:0,boost:!1},Zc={main:0,side:0,vacuum:0},vp=To[0],xp=To[1],Mo=5,pi=500,yi=1,Ro=100;function Jc(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(Mo,Math.min(pi,s)):i}function N0(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(yi,Math.min(Ro,s)):i}function x1(l){const s=(N0(l,l)-yi)/(Ro-yi),r=pi-s*(pi-Mo);return Math.round(r)}function b1(l){const i=v1(l,l),s=(pi-i)/(pi-Mo),r=yi+s*(Ro-yi);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 Je(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=Je(i.driveForward,l),r=Je(i.driveBackward,l),f=Je(i.driveLeft,l),d=Je(i.driveRight,l),m=Je(i.boostModifier,l),v=Je(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(Je(i.auxAllForward,l))return{main:127,side:127,vacuum:127};const r=Je(i.auxMainForward,l)?127:Je(i.auxMainReverse,l)?-127:0,f=Je(i.auxSideForward,l)?127:Je(i.auxSideReverse,l)?-70:0,d=Je(i.auxVacuumFast,l)?127:Je(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}}=Lt(),{focusChat:A,blurChat:w,isChatFocused:T}=j0(),{value:N}=Ut("inputs",it),E=p.useMemo(()=>o1(l.keymap),[l.keymap]),j=p.useMemo(()=>{const te=new Set;return Object.values(E).forEach(se=>{se&&se.forEach(S=>te.add(S))}),te},[E]),M=p.useMemo(()=>{const te=it.keyboard,se=N?.keyboard??{};return{baseSpeed:Jc(se.baseSpeed,te.baseSpeed),turboSpeed:Jc(se.turboSpeed,te.turboSpeed),precisionSpeed:Jc(se.precisionSpeed,te.precisionSpeed)}},[N?.keyboard]),D=p.useMemo(()=>{const te=it.keyboard,se=N?.keyboard??{},S=N0(typeof se.tiltSpeed=="number"?se.tiltSpeed:typeof se.tiltIntervalMs=="number"?b1(se.tiltIntervalMs):te.tiltSpeed,te.tiltSpeed);return x1(S)},[N?.keyboard]),G=p.useMemo(()=>Math.abs(l.camera?.config?.nudgeDegrees||1),[l.camera?.config?.nudgeDegrees]),I=p.useRef(new Set),F=p.useRef(Kc),$=p.useRef(Zc),Y=p.useRef(null),W=p.useRef(null),ie=p.useCallback(()=>{const te=new Set(I.current);Je(E.boostModifier,te);const S=Je(E.slowModifier,te)?{baseSpeed:M.precisionSpeed,boostSpeed:M.precisionSpeed}:{baseSpeed:M.baseSpeed,boostSpeed:M.turboSpeed},U=S1(te,E),Q=q1(te,E);(U.x!==F.current.x||U.y!==F.current.y||U.boost!==F.current.boost)&&(F.current=U,s(U,{source:Xc,speedOptions:S})),(Q.main!==$.current.main||Q.side!==$.current.side||Q.vacuum!==$.current.vacuum)&&($.current=Q,r(Q)),v(Xc,{keys:Array.from(te),vector:U,aux:Q})},[E,M,v,r,s]),oe=p.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),xe=p.useCallback(()=>{const te=new Set(I.current),se=Je(E.cameraUp,te),S=Je(E.cameraDown,te);return(se?1:0)-(S?1:0)},[E]),Se=p.useCallback(()=>{if(xe()===0){oe();return}if(Y.current)return;const se=()=>{const S=xe();if(S===0){oe();return}f(S*G),Y.current=setTimeout(se,D)};Y.current=setTimeout(se,0)},[xe,f,D,G,oe]),Z=p.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=null)},[]),ee=p.useCallback(()=>{const te=new Set(I.current),se=Je(E.songNoteUp,te),S=Je(E.songNoteDown,te);return(se?1:0)-(S?1:0)},[E]),J=p.useCallback(te=>{if(te===0)return;let S=(typeof l.song?.note=="number"?l.song.note:sl)+te;S>xp?S=vp:S<vp&&(S=xp);const U=g(S);b([{note:U,duration:ro}],{slot:0})},[b,g,l.song?.note]),z=p.useCallback(()=>{if(ee()===0){Z();return}if(W.current)return;const se=()=>{const S=ee();if(S===0){Z();return}J(S),W.current=setTimeout(se,Pb)};W.current=setTimeout(se,0)},[ee,Z,J]),X=p.useCallback(()=>{I.current.clear(),F.current=Kc,$.current=Zc,oe(),Z(),m(),v(Xc,{keys:[],vector:Kc,aux:Zc})},[v,m,oe,Z]);p.useEffect(()=>{function te(U){if(A1(U))return;const Q=mp(U);if(Q.length===0)return;const K=new Set(Q);if(Je(E.chatFocus,K)){U.preventDefault(),X(),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()),Se(),z(),ie()}function se(U){mp(U).forEach(K=>I.current.delete(K)),Se(),z(),ie()}function S(){X()}return window.addEventListener("keydown",te),window.addEventListener("keyup",se),window.addEventListener("blur",S),()=>{window.removeEventListener("keydown",te),window.removeEventListener("keyup",se),window.removeEventListener("blur",S)}},[j,w,ie,Se,z,A,T,E.chatFocus,E.dockMacro,E.driveMacro,X,d,i,m,Z]);const ne=p.useRef(X);return p.useEffect(()=>{ne.current=X},[X]),p.useEffect(()=>{ne.current()},[l.roverId]),p.useEffect(()=>()=>{oe(),Z()},[oe,Z]),null}const Gs="gamepad";function Fc(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}}=Lt(),{value:m}=Ut("inputs",it),{value:v}=Ut("gamepadMapping",sr),y=m.gamepad??it.gamepad,g=Math.min(Math.max(y.driveDeadzone??.2,0),.8),b=Math.min(Math.max(y.cameraDeadzone??.25,0),.9),A=y.servoStep??it.gamepad.servoStep,w=y.auxReverseScale??it.gamepad.auxReverseScale,T=!!(v?.drive?.horizontal&&v?.drive?.vertical),N=!!v?.camera?.vertical,E=!!v?.brushes?.mainAxis,j=!!v?.brushes?.sideAxis,M=E||j,D=!!v?.buttons?.vacuum,G=!!v?.buttons?.allAux,I=D||G,F=!!v?.buttons?.mainReverse,$=!!v?.buttons?.sideReverse,Y=F||$,W=!!v?.buttons?.drive,ie=!!v?.buttons?.dock,xe=T||N||M||I||Y||(W||ie),Se=p.useRef(null),Z=p.useRef({x:0,y:0,boost:!1}),ee=p.useRef({main:0,side:0,vacuum:0}),J=p.useRef(new Map),z=p.useRef(0),X=p.useRef({main:!1,side:!1}),ne=p.useCallback((Q,K)=>{const P=J.current.get(Q)||!1;return J.current.set(Q,K),K&&!P},[]),te=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:Gs})),Ap(ee.current,{main:0,side:0,vacuum:0})||(ee.current={main:0,side:0,vacuum:0},s({main:0,side:0,vacuum:0})),d(Gs,{connected:!1,mappingReady:xe});return}const P=T?qn(Fc(te(K,v.drive.horizontal),g)):0,re=T?qn(Fc(-te(K,v.drive.vertical),g)):0,me={x:P,y:re,boost:!1};bp(me,Z.current)||(Z.current=me,i(me,{source:Gs}));const $e=E?te(K,v.brushes.mainAxis):0,_e=Math.round(Math.min(Math.abs($e),1)*127),Kt=X.current.main?-_e:_e,ke=j?te(K,v.brushes.sideAxis):0,st=Math.round(Math.min(Math.abs(ke),1)*127),Ht=X.current.side?-Math.round(st*w):Math.round(st*w),Ue=D&&S(K,v.buttons.vacuum)?127:0;let rt={main:E?Kt:0,side:j?Ht:0,vacuum:Ue};G&&S(K,v.buttons.allAux)&&(rt={main:127,side:127,vacuum:127}),Ap(rt,ee.current)||(ee.current=rt,s(rt));const en=N?qn(Fc(-te(K,v.camera.vertical),b)):0,qi=performance.now();N&&Math.abs(en)>.25&&qi-z.current>120&&(z.current=qi,r(en>0?A:-A)),F&&ne("toggle-main",S(K,v.buttons.mainReverse))&&(X.current.main=!X.current.main),$&&ne("toggle-side",S(K,v.buttons.sideReverse))&&(X.current.side=!X.current.side),W&&ne(`macro-${v.buttons.drive.index}`,S(K,v.buttons.drive))&&(l("drive"),f("drive-sequence")),ie&&ne(`macro-${v.buttons.dock.index}`,S(K,v.buttons.dock))&&(l("dock"),f("seek-dock")),d(Gs,{connected:!0,mappingReady:xe,id:K.id,index:K.index,axes:[P,re,en],reverse:{...X.current},bindings:{drive:T,camera:N,brushes:M,auxButtons:{vacuum:D,allAux:G},reverseButtons:{main:F,side:$},macros:{drive:W,dock:ie}}})},[w,b,g,te,se,ne,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,xe,r,d,f,A,s,i,l]);return p.useEffect(()=>{function Q(){U(),Se.current=requestAnimationFrame(Q)}return Se.current=requestAnimationFrame(Q),()=>{Se.current&&cancelAnimationFrame(Se.current)}},[U]),null}function oo({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,D=_1({count:6,totalSpan:140,gap:6,startAngle:-70}),G=["L","FL","CL","CR","FR","R"],I=[l?.lightBumpLeftSignal,l?.lightBumpFrontLeftSignal,l?.lightBumpCenterLeftSignal,l?.lightBumpCenterRightSignal,l?.lightBumpFrontRightSignal,l?.lightBumpRightSignal],F=D.map((ie,oe)=>({label:G[oe],start:ie.start,end:ie.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}],Y=I.filter(ie=>ie!=null),W=Y.length?Math.max(...Y,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(ie=>{const oe=M1(ie.value);return o.jsx(Xs,{cx:d,cy:d,rInner:v,rOuter:y,startDeg:ie.start,endDeg:ie.end,color:oe,opacity:1,pulse:!1},ie.label)}),$.map(ie=>{const oe=R1(ie.value,ie.active);return o.jsx(Xs,{cx:d,cy:d,rInner:g,rOuter:b,startDeg:ie.start,endDeg:ie.end,color:oe,opacity:1,pulse:!!ie.active},ie.label)}),o.jsx(Xs,{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(Xs,{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 Xs({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 _o(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=_o(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,D=g+4;return o.jsxs("g",{transform:`translate(${l},${i})`,children:[o.jsx("rect",{x:-M/2,y:-D/2,width:M,height:D,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=_o(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=_o(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 Oo({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}=Ve(),{state:{roverId:s,keymap:r},actions:f}=Lt(),m=hr(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(D=>({...D,[M]:!0}));try{await i(M)}catch(D){alert(D.message)}finally{g(D=>({...D,[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(oo,{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(Oo,{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?mi(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(fo,{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 fo({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}}=Lt(),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=mi(l?.cameraUp?.[0]),E=mi(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:$c(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(fo,{label:E}):null,$c(m)]}),o.jsxs("span",{className:"flex items-center gap-0.25",children:[$c(v),N?o.jsx(fo,{label:N}):null]})]})]})]})}function $c(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}=Ve(),[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}=Ve(),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(Oo,{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}=Lt(),[r,f]=p.useState(null),d=!i||r!==null,v=hr(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 Ks="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(),D=E.clientX-M.left,G=E.clientY-M.top;v.current={x:D,y:G},m.current=E.pointerId,j.setPointerCapture?.(E.pointerId),g({active:!0,base:{x:D,y:G},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(),D=E.clientX-M.left,G=E.clientY-M.top,I=D-v.current.x,F=G-v.current.y,$=Math.min(Math.hypot(I,F),s),Y=Math.atan2(F,I),W=Math.cos(Y)*$,ie=Math.sin(Y)*$,oe={x:qn(W/s),y:qn(-ie/s),boost:!1};g(xe=>({...xe,knob:{x:W,y:ie}})),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}}=Lt(),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,D=p.useRef({x:0,y:0,boost:!1});p.useEffect(()=>{g&&(D.current={x:0,y:0,boost:!1})},[g]);const G=p.useCallback(($={})=>{if(g)return;const Y={x:qn($.x??0),y:qn($.y??0),boost:!!$.boost},W={x:D.current.x+(Y.x-D.current.x)*(1-M),y:D.current.y+(Y.y-D.current.y)*(1-M),boost:Y.boost};D.current=W,f(W,{source:Ks}),d(Ks,{vector:W,lastEvent:"move"})},[g,d,f,M]),I=p.useCallback(()=>{if(g)return;const $={x:0,y:0,boost:!1};D.current=$,f($,{source:Ks}),d(Ks,{vector:$,lastEvent:"stop"})},[g,d,f]),F=$=>{if(!A)return;const Y=Number($.target.value);Number.isNaN(Y)||v(Y)};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:G,onStop:I})]})}function _0({orientation:l}){const{state:{roverId:i},actions:{setAuxMotors:s}}=Lt(),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=Aa(),[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),D=f.current.get(N.id);D&&URL.revokeObjectURL(D),f.current.set(N.id,M),r(G=>({...G,[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 Wc(l,i){return D0.includes(l)?l:i}function mr({defaultOrientation:l="horizontal",orientation:i,hideLayoutToggle:s=!1,hideHeader:r=!1,panelId:f=null}){const{session:d}=Ve(),m=d?.roomCameras||[],v=O0(m.map(j=>({id:j.id}))),{value:y,save:g}=Ut("roomCameraPanels",{}),[b,A]=p.useState(()=>Wc(f?y?.[f]:l,"horizontal"));p.useEffect(()=>{if(!f)return;const j=y?.[f];j&&A(Wc(j,"horizontal"))},[f,y?.[f]]);const w=i?Wc(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 Do(){const{logs:l}=Ve();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 ko(){const{login:l,setRole:i}=Ve(),[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 zo(l=[]){const i=Aa(),[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(D=>({...D,[E.key]:M}));return}w(E.key),r(D=>({...D,[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}=Ut("page",{hudMapDesktop:!1});return[!!l?.hudMapDesktop,f=>{i({hudMapDesktop:!!f})}]}const Cp=2e3,lA=3e3,iA=["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=iA[l%12]||"?",s=Math.floor(l/12)-1;return`${i}${s}`}function sA(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 Bo({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,D]=p.useState("idle"),[G,I]=p.useState(null),[F,$]=p.useState("idle"),[Y,W]=p.useState(null),[ie,oe]=p.useState(0),[xe,Se]=p.useState(0),[Z,ee]=p.useState(!0),J=f?.sensors,z=J?.batteryChargeMah??null,X=m==="desktop",ne=!X,[te]=k0(),se=b||ne?!0:te,S=sA(z,d),U=J?.wheelOvercurrents||null,Q=U==null?[]:Object.entries(U).filter(([,ke])=>!!ke).map(([ke])=>ke),K=p.useCallback(()=>{clearTimeout(N.current),N.current=setTimeout(()=>oe(Date.now()),Cp)},[]),P=p.useCallback(()=>{clearTimeout(E.current),E.current=setTimeout(()=>Se(Date.now()),Cp)},[]),re=p.useCallback(async()=>{const ke=w.current;if(ke)try{ke.muted=!0,await ke.play()}catch{}},[]),me=p.useCallback((ke=0)=>{if(r)return;clearTimeout(j.current);const st=()=>{clearTimeout(j.current),j.current=setTimeout(()=>{r||Ht()},lA)},Ht=async()=>{const Ue=w.current;if(Ue)try{await re(),Ue.muted=!1,await Ue.play(),ee(!1)}catch{Ue.muted=!0,ee(!0),st()}};j.current=setTimeout(Ht,ke)},[re,r]);p.useEffect(()=>()=>{clearTimeout(N.current),clearTimeout(E.current),clearTimeout(j.current)},[]),p.useEffect(()=>{M==="playing"&&me(0)},[M,me]),p.useEffect(()=>{if(!l?.url||!w.current)return;let ke=!0,st;const Ht=setTimeout(()=>ee(!0),0),Ue=(rt,en)=>{ke&&(D(rt),I(en||null),rt==="playing"&&re(),["error","failed","disconnected","closed"].includes(rt)&&K())};return st=new Np({url:l.url,token:l.token,video:w.current,onStatus:Ue}),st.start().catch(rt=>{ke&&(D("error"),I(rt.message),K())}),()=>{ke=!1,clearTimeout(Ht),st?.stop()}},[l?.url,l?.token,ie,K,re]),p.useEffect(()=>{M==="stopped"&&l?.url&&K()},[M,l?.url,K]),p.useEffect(()=>{if(!i?.url||!T.current)return;let ke=!0,st;const Ht=(Ue,rt)=>{ke&&($(Ue),W(rt||null),Ue==="playing"&&T.current?.play().catch(()=>{}),["error","failed","disconnected","closed"].includes(Ue)&&P())};return st=new Np({url:i.url,token:i.token,video:T.current,audioOnly:!0,onStatus:Ht}),st.start().catch(Ue=>{ke&&($("error"),W(Ue.message),P())}),()=>{ke=!1,st?.stop()}},[i?.url,i?.token,xe,P]);const $e=l?.url?M==="error"?`Error: ${G||"unknown"}`:G?`${M} (${G})`:M:"waiting",_e=i?.error?`Error: ${i.error}`:i?.url?F==="error"?`Error: ${Y||"unknown"}`:Y?`${F} (${Y})`:F:null,Kt=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||Z,playsInline:!0,autoPlay:!0,controls:!1,className:"h-full w-full object-contain"}),o.jsx("audio",{ref:T,autoPlay:!0,hidden:!0}),o.jsx(cA,{frame:f,sensors:J,label:s,status:$e,audioStatus:_e,desktopLayout:X,variant:v,driverLabel:y,battery:S,songNote:g,showTopDown:se,mobileHud:ne,mapPosition:A}),o.jsx(fA,{motors:Q}),o.jsx(dA,{charge:z,config:d}),Kt&&S.available?o.jsx(uA,{visual:S}):null]}),!Kt&&o.jsx(rA,{visual:S})]})}function rA({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 uA({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 cA({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,D])=>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:D})]},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(oo,{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(oo,{sensors:i,size:240,overlay:!0})}):null]})}const oA={leftWheel:"Left wheel",rightWheel:"Right wheel",mainBrush:"Main brush",sideBrush:"Side brush"};function fA({motors:l}){if(!l?.length)return null;const i=l.map(s=>oA[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 dA({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 Uo({layoutFormat:l="desktop"}){const{session:i}=Ve(),{state:{song:s}}=Lt(),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=zo(m),y=r?v[r]:null,g=r&&d?v[`${r}-audio`]:null,b=hr(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(Bo,{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 ho({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 hA({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(ho,{label:l.type==="light"?"Light":"Switch"})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-400",children:[o.jsx(ho,{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 Lo(){const{session:l,homeAssistantToggle:i}=Ve(),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(ho,{label:f?"Connected":"Offline",tone:f?"success":"warn"})]}),o.jsx("div",{className:"flex flex-wrap gap-0.5",children:r.map(d=>o.jsx(hA,{entity:d,connected:f,onToggle:i},d.id))})]})}const mA=[{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 pA(l){return l.reduce((i,s)=>((i[s.group]||(i[s.group]=[])).push(s),i),{})}function yA(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(0,Math.min(500,s)):i}const Ho=5,gi=500,vi=1,Vo=100;function gA(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(Ho,Math.min(gi,s)):i}function lr(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(vi,Math.min(Vo,s)):i}function vA(l){const s=(lr(l,l)-vi)/(Vo-vi),r=gi-s*(gi-Ho);return Math.round(r)}function xA(l){const i=gA(l,l),s=(gi-i)/(gi-Ho),r=vi+s*(Vo-vi);return Math.round(r)}function bA(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=Si(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 Zs({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 AA(){const{state:{keymap:l},actions:{updateKeyBinding:i,resetKeyBindings:s}}=Lt(),{value:r,save:f}=Ut("inputs",it),d={...it.keyboard,...r.keyboard??{}},m=p.useMemo(()=>typeof d.tiltSpeed=="number"?lr(d.tiltSpeed,it.keyboard.tiltSpeed):typeof d.tiltIntervalMs=="number"?lr(xA(d.tiltIntervalMs),it.keyboard.tiltSpeed):it.keyboard.tiltSpeed,[d.tiltIntervalMs,d.tiltSpeed]),v=p.useMemo(()=>pA(mA),[]),{active:y,startCapture:g,cancel:b}=bA((N,E)=>{i(N,E)}),A=p.useCallback(N=>l?.[N]?.[0]||di[N]?.[0]||"",[l]),w=p.useCallback((N,E)=>{const j=it.keyboard,M=yA(E,j[N]);f(D=>({...D??{},keyboard:{...D?.keyboard??j,[N]:M}}))},[f]),T=p.useCallback(N=>{const E=it.keyboard,j=lr(N,E.tiltSpeed),M=vA(j);f(D=>({...D??{},keyboard:{...D?.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(Zs,{label:"Base speed",description:"Normal driving speed",value:d.baseSpeed,onChange:N=>w("baseSpeed",N)}),o.jsx(Zs,{label:"Turbo speed",description:"Used when holding the boost modifier",value:d.turboSpeed,onChange:N=>w("turboSpeed",N)}),o.jsx(Zs,{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(Zs,{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),D=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:mi(M)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[D&&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:`${D?"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:D?"Press a key…":"Change"})]})]},j.id)})})]},N))})]})}function SA(){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 qA=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),EA=[{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 Js({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:qA.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 jA(l){return l?`Axis ${l.index}${l.invert?" (invert)":""}`:"Unassigned"}function NA(l){return l?`Button ${l.index}`:"Unassigned"}function Fs(l,i,s){const[r,f]=i,d={...l??sr};return d[r]={...d[r]??sr[r]},d[r][f]=s(d[r][f]),d}function CA(){const l=SA(),{value:i,save:s,reset:r}=Ut("gamepadMapping",sr),{value:f,save:d}=Ut("inputs",it),m=f.gamepad??it.gamepad,[v,y]=p.useState(null),g=p.useRef(null),b=j=>{d(M=>({...M,gamepad:{...M.gamepad??it.gamepad,...j}}))};p.useEffect(()=>{g.current=null},[v]),p.useEffect(()=>{if(!v)return;let j;const M=()=>{const D=navigator.getGamepads?.(),G=D&&Array.from(D).find(Boolean);if(G){if(v.type==="axis"){g.current||(g.current=Array.from(G.axes??[]).map(I=>I??0));for(let I=0;I<G.axes.length;I+=1){const F=G.axes[I],$=g.current?.[I]??0,Y=Math.abs(F-$);if(Math.abs(F)>.65&&Y>.5){s(W=>Fs(W,v.path,()=>({index:I,invert:F<0}))),y(null);return}}}else if(v.type==="button")for(let I=0;I<G.buttons.length;I+=1){const F=G.buttons[I];if(F&&(F.pressed||F.value>.6)){s($=>Fs($,v.path,()=>({index:I}))),y(null);return}}}j=requestAnimationFrame(M)};return j=requestAnimationFrame(M),()=>{j&&cancelAnimationFrame(j)}},[v,s]);const A=p.useMemo(()=>EA.reduce((j,M)=>((j[M.section]||(j[M.section]=[])).push(M),j),{}),[]),w=j=>{const[M,D]=j.path;return i?.[M]?.[D]??null},T=j=>{const M=w(j);return j.type==="axis"?jA(M):NA(M)},N=j=>{s(M=>Fs(M,j.path,()=>null))},E=j=>{w(j)&&s(D=>Fs(D,j.path,G=>({...G,invert:!G?.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(Js,{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(Js,{label:"Camera deadzone",description:"Tilt stick sensitivity",min:0,max:.6,step:.01,value:m.cameraDeadzone??.25,onChange:j=>b({cameraDeadzone:j})}),o.jsx(Js,{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(Js,{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(D=>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:D.label}),o.jsx("p",{className:"text-[0.65rem] text-slate-400",children:T(D)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[D.type==="axis"&&o.jsx("button",{type:"button",disabled:!w(D),onClick:()=>E(D),className:`${w(D)?.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(D),className:"button-dark text-[0.7rem]",children:"Clear"}),o.jsx("button",{type:"button",onClick:()=>y(D),className:`${v?.id===D.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===D.id?"Waiting…":"Capture"})]})]},D.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 Yo(...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:Yo("flex gap-0.5",i),children:l})}function ga({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=Yo(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:Yo("mt-0.5 space-y-0.5",i),children:l})}function va({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 TA(){const{session:l}=Ve(),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 wA=[{key:"start",label:"Start OI"},{key:"safe",label:"Safe"},{key:"full",label:"Full"},{key:"passive",label:"Passive"},{key:"dock",label:"Dock"}];function MA(){const{state:{roverId:l},actions:{sendOiCommand:i,setSensorStream:s}}=Lt(),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(ga,{id:"keybindings",children:"Keybindings"}),o.jsx(ga,{id:"controller",children:"Controller"}),o.jsx(ga,{id:"page",children:"Page settings"}),o.jsx(ga,{id:"admin",children:"Admin"})]}),o.jsxs(V0,{children:[o.jsx(va,{id:"keybindings",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(AA,{})})}),o.jsx(va,{id:"controller",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(CA,{})})}),o.jsx(va,{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(va,{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:wA.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(ko,{}),o.jsx(M0,{}),o.jsx(TA,{})]})})]})]})}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 RA(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:mi(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 pr(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 _A({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:pr(s,i)},f)})})]}):null}function OA({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:pr(s,i)},f)})})]})}function DA({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:pr(s,{})},`callout-${r}`))})]})}function kA({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 zA({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(kA,{group:s,keymap:i},s.id))})]}):null}function BA({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:pr(i,{})},`gamepad-${s}`))})]}):null}function _p({block:l,keymap:i}){if(!l)return null;switch(l.type){case"list":return o.jsx(OA,{block:l,keymap:i});case"callout":return o.jsx(DA,{block:l});case"keyboard":return o.jsx(zA,{block:l,keymap:i});case"gamepad":return o.jsx(BA,{block:l});default:return null}}function Q0({layout:l,keymap:i}){const s=p.useMemo(()=>RA(l),[l]),r=i||{},f=s.main||[],d=s.aside||[];return o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(_A,{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 UA({layout:l,onOpenOverlay:i}){const{state:s}=Lt();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 LA({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(ga,{id:"telemetry",children:"Controls"}),o.jsx(ga,{id:"help",children:"Help"}),o.jsx(ga,{id:"settings",children:"Settings"})]}),o.jsxs(V0,{children:[o.jsx(va,{id:"telemetry",children:o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(w0,{}),o.jsx(mr,{defaultOrientation:"horizontal",panelId:"rightpane-telemetry"}),o.jsx(Lo,{}),o.jsx(Co,{})]})}),o.jsx(va,{id:"help",children:o.jsx(UA,{layout:l,onOpenOverlay:i})}),o.jsx(va,{id:"settings",children:o.jsx(MA,{})})]})]})})}var G0={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Op=xa.createContext&&xa.createContext(G0),HA=["attr","size","title"];function VA(l,i){if(l==null)return{};var s=YA(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 YA(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 rr(){return rr=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},rr.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 ur(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){QA(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 QA(l,i,s){return i=GA(i),i in l?Object.defineProperty(l,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[i]=s,l}function GA(l){var i=XA(l,"string");return typeof i=="symbol"?i:i+""}function XA(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)=>xa.createElement(i.tag,ur({key:s},i.attr),X0(i.child)))}function KA(l){return i=>xa.createElement(ZA,rr({attr:ur({},l.attr)},i),X0(l.child))}function ZA(l){var i=s=>{var{attr:r,size:f,title:d}=l,m=VA(l,HA),v=f||s.size||"1em",y;return s.className&&(y=s.className),l.className&&(y=(y?y+" ":"")+l.className),xa.createElement("svg",rr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,r,m,{className:y,style:ur(ur({color:l.color||s.color},s.style),l.style),height:v,width:v,xmlns:"http://www.w3.org/2000/svg"}),d&&xa.createElement("title",null,d),l.children)};return Op!==void 0?xa.createElement(Op.Consumer,null,s=>i(s)):i(G0)}function JA(l){return KA({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}=Ve(),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(JA,{className:"mr-2"}),l]}):null}function FA(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 $A(l){const i=new Date(l);return`${i.getHours().toString().padStart(2,"0")}:${i.getMinutes().toString().padStart(2,"0")}`}function WA(l){return l.nickname||l.socketId?.slice(0,6)||"unknown"}const IA=["kal","rms","slt","ksp","bdl"],PA=Array.from({length:10},(l,i)=>i*10);function fl({hideInput:l=!1,hideSpectatorNotice:i=!1,fillHeight:s=!1}){const{session:r}=Ve(),{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"),[D,G]=p.useState("rms"),[I,F]=p.useState(50),$=r?.role!=="spectator",Y=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,xe=p.useMemo(()=>f.slice(-200),[f]);p.useEffect(()=>{Y.current&&(Y.current.scrollTop=Y.current.scrollHeight)},[xe]),p.useEffect(()=>{E(!!oe)},[oe]);const Se=p.useMemo(()=>!oe||!N?null:j==="espeak"?{speak:!0,engine:j,pitch:I}:{speak:!0,engine:j,voice:D},[j,I,N,oe,D]);async function Z(J){if(J.preventDefault(),!$||l)return;const X=b.replace(/\\n/g,`
|
||
`).trim();if(X){T(!0);try{await d(X,Se),A(""),g()}catch(ne){alert(ne.message)}finally{T(!1)}}}const ee=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 ${ee}`,ref:Y,children:xe.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"No messages yet."}):xe.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:$A(J.ts)}),o.jsx("span",{className:`font-semibold text-[0.85rem] ${FA(J.role,J.fromDiscord)}`,children:WA(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:D,onChange:J=>G(J.target.value),className:"field-input text-xs",children:IA.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:PA.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}=Ve(),{value:r,save:f}=Ut("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 eS=new Set(["admin","lockdown","lockdown-admin"]),tS=new Set(["admin","lockdown"]);function nS(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 aS(){const{session:l}=Ve(),i=l?.mode,s=l?.role,r=tS.has(i),f=eS.has(s);if(!r||f)return null;const d=nS(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(ko,{})}),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(fl,{}),o.jsx(Z0,{})]})]})})}const lS="/assets/turn_alert-DVO8EZJa.mp3";function iS(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 sS(){const{session:l,pushAlert:i}=Ve(),s=iS(lS),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 yr({hideNicknameForm:l=!1,hideHeader:i=!1,className:s="",fillHeight:r=!1}){const{session:f,setNickname:d}=Ve(),{value:m}=Ut("profile",{nickname:""}),v=p.useRef(null),y=Aa(),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 Y=m.nickname||"";if(!Y||f.socketId===v.current)return;const W=f.socketId;d(Y).then(()=>{v.current=W}).catch(()=>{})},[g,f?.socketId,d,m.nickname]),p.useEffect(()=>{if(!y)return;const Y=()=>{if(!g)return;const W=(m.nickname||"").trim();W&&d(W).then(()=>{v.current=f?.socketId||null}).catch(()=>{})};return y.on("connect",Y),()=>y.off("connect",Y)},[g,d,y,m.nickname,f?.socketId]);const E=p.useMemo(()=>[...b].sort((Y,W)=>Y.socketId===A?-1:W.socketId===A?1:(Y.nickname||"").localeCompare(W.nickname||"")),[A,b]),j=p.useCallback(Y=>N.find(W=>String(W.id)===String(Y))?.name||Y,[N]),M=p.useCallback(Y=>b.find(W=>W.socketId===Y)||{socketId:Y,nickname:null,role:null},[b]),D=p.useCallback(Y=>{if(!Y)return null;const W=Y-Date.now();return W<=0?0:Math.ceil(W/1e3)},[]),G=r?"flex-1 min-h-0 overflow-y-auto":"h-48 overflow-y-auto",I=w&&r?"max-h-40 overflow-y-auto":G,F=w&&r?"flex-1 min-h-0 overflow-y-auto":G,$=()=>E.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"Waiting for users…"}):E.map(Y=>{const W=Y.role==="admin"||Y.role==="lockdown"||Y.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(Y.role)}`,children:zp(Y,A)}),Y.roverId?o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:["rover ",Y.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"})]},Y.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:G}`,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(([Y,W])=>{const ie=W?.queue||[],oe=W?.idleDeadline||W?.deadline||null,xe=D(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(Y)}),xe!=null&&o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:[xe,"s left"]})]}),ie.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:ie.map((Se,Z)=>{const ee=M(Se),J=Se===W?.current,z=ee.role==="admin"||ee.role==="lockdown"||ee.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(ee.role)} font-semibold`,children:zp(ee,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"})]},`${Y}-${Se}-${Z}`)})})]},Y)}):$()}),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 rS({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",uS=new Set(["mobile-portrait","mobile-landscape"]),F0=()=>{if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}},cS=()=>{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{}},oS=()=>{if(typeof navigator>"u")return!1;const l=navigator.userAgent||navigator.platform||"";return/iphone|ipad|ipod/i.test(l)},fS=()=>{if(typeof document>"u")return!1;const l=document;return!!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled)};function dS(l){const i=uS.has(l),[s,r]=p.useState(!1),[f,d]=p.useState("native"),m=p.useMemo(()=>oS(),[]),v=p.useCallback(()=>{if(!i){r(!1);return}if(cS()){r(!1);return}if(m){d("pwa-hint"),r(!0);return}if(!fS()){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 hS({visible:l,layout:i,onClose:s,showOnLoad:r,onToggleShowOnLoad:f}){if(!l)return null;const{state:d}=Lt(),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 mS(){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 pS({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(Uo,{}),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(yr,{fillHeight:!0})}),o.jsx("div",{className:"h-full min-h-0",children:o.jsx(fl,{fillHeight:!0})})]}),o.jsx(Do,{})]}),o.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-y-auto",children:o.jsx(LA,{layout:l,onOpenHelpOverlay:i})})]})}function yS(){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx(Uo,{layoutFormat:"mobile"}),o.jsx(F1,{}),o.jsx(w0,{}),o.jsx(fl,{}),o.jsx(yr,{}),o.jsx(Co,{}),o.jsx(ko,{}),o.jsx(M0,{}),o.jsx(mr,{panelId:"mobile-portrait-room"}),o.jsx(Lo,{}),o.jsx(Do,{})]})}function gS(){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(Uo,{layoutFormat:"mobile"}),o.jsx(Co,{})]}),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(yr,{})}),o.jsx("div",{className:"flex flex-col gap-0.5",children:o.jsx(fl,{})})]}),o.jsx(mr,{panelId:"mobile-landscape-room"}),o.jsx(Lo,{})]})]})}function vS(){const l=mS(),i=l==="desktop",s=dS(l);return o.jsx("div",{className:`bg-black text-slate-100 ${i?"h-screen overflow-hidden":"min-h-screen"}`,children:o.jsx(wo,{children:o.jsx(xS,{layout:l,isDesktop:i,fullscreen:s})})})}function xS({layout:l,isDesktop:i,fullscreen:s}){const{visible:r,mode:f,enterFullscreen:d,dismiss:m}=s,{value:v,status:y,save:g}=Ut("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(D=>({...D??{},showOnLoad:M})),M||A(!1)},[g]),E=p.useMemo(()=>i?o.jsx(pS,{layout:l,onOpenHelpOverlay:w}):l==="mobile-landscape"?o.jsx(gS,{}):o.jsx(yS,{}),[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(sS,{}),o.jsx(aS,{}),o.jsx(hS,{visible:b,layout:l,onClose:T,showOnLoad:v?.showOnLoad!==!1,onToggleShowOnLoad:N}),o.jsx(rS,{visible:r,mode:f,onEnterFullscreen:d,onDismiss:m})]})}function $0(){const{session:l,setRole:i,subscribeAll:s,connected:r}=Ve(),[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 bS({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 AS({rover:l,frame:i,videoInfo:s,audioInfo:r,session:f}){const d=bS({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(Bo,{sessionInfo:s,audioSessionInfo:r,label:l.name,telemetryFrame:i,batteryConfig:l.battery,hudVariant:"spectator",driverLabel:d,hudForceMap:!0,hudMapPosition:"bottom-left"})})})}function SS({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(AS,{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 qS(){return o.jsx("section",{className:"min-h-0",children:o.jsx("div",{className:"surface min-h-[14rem] overflow-hidden",children:o.jsx(mr,{defaultOrientation:"horizontal",hideLayoutToggle:!0,hideHeader:!0,panelId:"spectator-secondary"})})})}function ES({className:l=""}){return o.jsx("div",{className:`panel ${l}`,children:o.jsx(Do,{})})}function jS(){const{session:l}=Ve();$0();const i=No(),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=zo(r);return o.jsx(wo,{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(SS,{roster:s,frames:i,videoSources:f,session:l}),o.jsx(qS,{})]}),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(Oo,{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(yr,{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(fl,{hideInput:!0,hideSpectatorNotice:!0,fillHeight:!0})}),o.jsx("div",{className:"min-h-0 min-w-0",children:o.jsx(ES,{className:"h-40 overflow-hidden"})})]})]})})})}const NS=2e4;function CS({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 TS(){const{session:l}=Ve(),i=$0(),s=No(),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),Y=[{type:"rover",id:$,key:$}];return F.media?.audioPublishUrl&&Y.push({type:"rover",id:`${$}-audio`,key:`${$}-audio`}),Y}),[r]),g=zo(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)},NS);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,D=N&&s[N.id]||null,G=N?CS({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(RS,{}),o.jsx("section",{className:"panel relative flex min-h-0 flex-1 overflow-hidden",children:i?N?o.jsx(Up,{children:o.jsx(Bo,{sessionInfo:j,audioSessionInfo:M,label:N.name||N.id,telemetryFrame:D,batteryConfig:N.battery,layoutFormat:"mobile",hudVariant:"spectator",driverLabel:G,hudForceMap:!0,hudMapPosition:"bottom-left"})}):E?o.jsx(Up,{children:o.jsx(MS,{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 wS(){return o.jsx(wo,{children:o.jsx(TS,{})})}function MS({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 RS(){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(fl,{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($s,{path:"/",element:o.jsx(vS,{})}),o.jsx($s,{path:"/spectate",element:o.jsx(jS,{})}),o.jsx($s,{path:"/mini",element:o.jsx(wS,{})})]})})})})})})}));
|