mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -04:00
13 lines
406 KiB
JavaScript
13 lines
406 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 _v(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Uc={exports:{}},mi={};var Wm;function Ov(){if(Wm)return mi;Wm=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 y in f)y!=="key"&&(d[y]=f[y])}else d=f;return f=d.ref,{$$typeof:l,type:r,key:m,ref:f!==void 0?f:null,props:d}}return mi.Fragment=i,mi.jsx=s,mi.jsxs=s,mi}var Im;function Dv(){return Im||(Im=1,Uc.exports=Ov()),Uc.exports}var o=Dv(),Hc={exports:{}},fe={};var Pm;function kv(){if(Pm)return fe;Pm=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"),y=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),M=Symbol.iterator;function E(q){return q===null||typeof q!="object"?null:(q=M&&q[M]||q["@@iterator"],typeof q=="function"?q:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function T(q,U,X){this.props=q,this.context=U,this.refs=S,this.updater=X||C}T.prototype.isReactComponent={},T.prototype.setState=function(q,U){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,U,"setState")},T.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function _(){}_.prototype=T.prototype;function G(q,U,X){this.props=q,this.context=U,this.refs=S,this.updater=X||C}var F=G.prototype=new _;F.constructor=G,N(F,T.prototype),F.isPureReactComponent=!0;var ee=Array.isArray;function I(){}var V={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function P(q,U,X){var K=X.ref;return{$$typeof:l,type:q,key:U,ref:K!==void 0?K:null,props:X}}function ue(q,U){return P(q.type,U,q.props)}function be(q){return typeof q=="object"&&q!==null&&q.$$typeof===l}function me(q){var U={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(X){return U[X]})}var $=/\/+/g;function te(q,U){return typeof q=="object"&&q!==null&&q.key!=null?me(""+q.key):U.toString(36)}function oe(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(I,I):(q.status="pending",q.then(function(U){q.status==="pending"&&(q.status="fulfilled",q.value=U)},function(U){q.status==="pending"&&(q.status="rejected",q.reason=U)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function z(q,U,X,K,ne){var se=typeof q;(se==="undefined"||se==="boolean")&&(q=null);var pe=!1;if(q===null)pe=!0;else switch(se){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(q.$$typeof){case l:case i:pe=!0;break;case b:return pe=q._init,z(pe(q._payload),U,X,K,ne)}}if(pe)return ne=ne(q),pe=K===""?"."+te(q,0):K,ee(ne)?(X="",pe!=null&&(X=pe.replace($,"$&/")+"/"),z(ne,U,X,"",function(an){return an})):ne!=null&&(be(ne)&&(ne=ue(ne,X+(ne.key==null||q&&q.key===ne.key?"":(""+ne.key).replace($,"$&/")+"/")+pe)),U.push(ne)),1;pe=0;var Ye=K===""?".":K+":";if(ee(q))for(var Oe=0;Oe<q.length;Oe++)K=q[Oe],se=Ye+te(K,Oe),pe+=z(K,U,X,se,ne);else if(Oe=E(q),typeof Oe=="function")for(q=Oe.call(q),Oe=0;!(K=q.next()).done;)K=K.value,se=Ye+te(K,Oe++),pe+=z(K,U,X,se,ne);else if(se==="object"){if(typeof q.then=="function")return z(oe(q),U,X,K,ne);throw U=String(q),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return pe}function B(q,U,X){if(q==null)return q;var K=[],ne=0;return z(q,K,"","",function(se){return U.call(X,se,ne++)}),K}function J(q){if(q._status===-1){var U=q._result;U=U(),U.then(function(X){(q._status===0||q._status===-1)&&(q._status=1,q._result=X)},function(X){(q._status===0||q._status===-1)&&(q._status=2,q._result=X)}),q._status===-1&&(q._status=0,q._result=U)}if(q._status===1)return q._result.default;throw q._result}var W=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},le={map:B,forEach:function(q,U,X){B(q,function(){U.apply(this,arguments)},X)},count:function(q){var U=0;return B(q,function(){U++}),U},toArray:function(q){return B(q,function(U){return U})||[]},only:function(q){if(!be(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return fe.Activity=A,fe.Children=le,fe.Component=T,fe.Fragment=s,fe.Profiler=f,fe.PureComponent=G,fe.StrictMode=r,fe.Suspense=g,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,fe.__COMPILER_RUNTIME={__proto__:null,c:function(q){return V.H.useMemoCache(q)}},fe.cache=function(q){return function(){return q.apply(null,arguments)}},fe.cacheSignal=function(){return null},fe.cloneElement=function(q,U,X){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var K=N({},q.props),ne=q.key;if(U!=null)for(se in U.key!==void 0&&(ne=""+U.key),U)!Z.call(U,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&U.ref===void 0||(K[se]=U[se]);var se=arguments.length-2;if(se===1)K.children=X;else if(1<se){for(var pe=Array(se),Ye=0;Ye<se;Ye++)pe[Ye]=arguments[Ye+2];K.children=pe}return P(q.type,ne,K)},fe.createContext=function(q){return q={$$typeof:m,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:d,_context:q},q},fe.createElement=function(q,U,X){var K,ne={},se=null;if(U!=null)for(K in U.key!==void 0&&(se=""+U.key),U)Z.call(U,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ne[K]=U[K]);var pe=arguments.length-2;if(pe===1)ne.children=X;else if(1<pe){for(var Ye=Array(pe),Oe=0;Oe<pe;Oe++)Ye[Oe]=arguments[Oe+2];ne.children=Ye}if(q&&q.defaultProps)for(K in pe=q.defaultProps,pe)ne[K]===void 0&&(ne[K]=pe[K]);return P(q,se,ne)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(q){return{$$typeof:y,render:q}},fe.isValidElement=be,fe.lazy=function(q){return{$$typeof:b,_payload:{_status:-1,_result:q},_init:J}},fe.memo=function(q,U){return{$$typeof:v,type:q,compare:U===void 0?null:U}},fe.startTransition=function(q){var U=V.T,X={};V.T=X;try{var K=q(),ne=V.S;ne!==null&&ne(X,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(I,W)}catch(se){W(se)}finally{U!==null&&X.types!==null&&(U.types=X.types),V.T=U}},fe.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},fe.use=function(q){return V.H.use(q)},fe.useActionState=function(q,U,X){return V.H.useActionState(q,U,X)},fe.useCallback=function(q,U){return V.H.useCallback(q,U)},fe.useContext=function(q){return V.H.useContext(q)},fe.useDebugValue=function(){},fe.useDeferredValue=function(q,U){return V.H.useDeferredValue(q,U)},fe.useEffect=function(q,U){return V.H.useEffect(q,U)},fe.useEffectEvent=function(q){return V.H.useEffectEvent(q)},fe.useId=function(){return V.H.useId()},fe.useImperativeHandle=function(q,U,X){return V.H.useImperativeHandle(q,U,X)},fe.useInsertionEffect=function(q,U){return V.H.useInsertionEffect(q,U)},fe.useLayoutEffect=function(q,U){return V.H.useLayoutEffect(q,U)},fe.useMemo=function(q,U){return V.H.useMemo(q,U)},fe.useOptimistic=function(q,U){return V.H.useOptimistic(q,U)},fe.useReducer=function(q,U,X){return V.H.useReducer(q,U,X)},fe.useRef=function(q){return V.H.useRef(q)},fe.useState=function(q){return V.H.useState(q)},fe.useSyncExternalStore=function(q,U,X){return V.H.useSyncExternalStore(q,U,X)},fe.useTransition=function(){return V.H.useTransition()},fe.version="19.2.0",fe}var ep;function qo(){return ep||(ep=1,Hc.exports=kv()),Hc.exports}var p=qo();const Na=_v(p);var Vc={exports:{}},pi={},Yc={exports:{}},Gc={};var tp;function zv(){return tp||(tp=1,(function(l){function i(z,B){var J=z.length;z.push(B);e:for(;0<J;){var W=J-1>>>1,le=z[W];if(0<f(le,B))z[W]=B,z[J]=le,J=W;else break e}}function s(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var B=z[0],J=z.pop();if(J!==B){z[0]=J;e:for(var W=0,le=z.length,q=le>>>1;W<q;){var U=2*(W+1)-1,X=z[U],K=U+1,ne=z[K];if(0>f(X,J))K<le&&0>f(ne,X)?(z[W]=ne,z[K]=J,W=K):(z[W]=X,z[U]=J,W=U);else if(K<le&&0>f(ne,J))z[W]=ne,z[K]=J,W=K;else break e}}return B}function f(z,B){var J=z.sortIndex-B.sortIndex;return J!==0?J:z.id-B.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,y=m.now();l.unstable_now=function(){return m.now()-y}}var g=[],v=[],b=1,A=null,M=3,E=!1,C=!1,N=!1,S=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function F(z){for(var B=s(v);B!==null;){if(B.callback===null)r(v);else if(B.startTime<=z)r(v),B.sortIndex=B.expirationTime,i(g,B);else break;B=s(v)}}function ee(z){if(N=!1,F(z),!C)if(s(g)!==null)C=!0,I||(I=!0,me());else{var B=s(v);B!==null&&oe(ee,B.startTime-z)}}var I=!1,V=-1,Z=5,P=-1;function ue(){return S?!0:!(l.unstable_now()-P<Z)}function be(){if(S=!1,I){var z=l.unstable_now();P=z;var B=!0;try{e:{C=!1,N&&(N=!1,_(V),V=-1),E=!0;var J=M;try{t:{for(F(z),A=s(g);A!==null&&!(A.expirationTime>z&&ue());){var W=A.callback;if(typeof W=="function"){A.callback=null,M=A.priorityLevel;var le=W(A.expirationTime<=z);if(z=l.unstable_now(),typeof le=="function"){A.callback=le,F(z),B=!0;break t}A===s(g)&&r(g),F(z)}else r(g);A=s(g)}if(A!==null)B=!0;else{var q=s(v);q!==null&&oe(ee,q.startTime-z),B=!1}}break e}finally{A=null,M=J,E=!1}B=void 0}}finally{B?me():I=!1}}}var me;if(typeof G=="function")me=function(){G(be)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,te=$.port2;$.port1.onmessage=be,me=function(){te.postMessage(null)}}else me=function(){T(be,0)};function oe(z,B){V=T(function(){z(l.unstable_now())},B)}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"):Z=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return M},l.unstable_next=function(z){switch(M){case 1:case 2:case 3:var B=3;break;default:B=M}var J=M;M=B;try{return z()}finally{M=J}},l.unstable_requestPaint=function(){S=!0},l.unstable_runWithPriority=function(z,B){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var J=M;M=z;try{return B()}finally{M=J}},l.unstable_scheduleCallback=function(z,B,J){var W=l.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?W+J:W):J=W,z){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=J+le,z={id:b++,callback:B,priorityLevel:z,startTime:J,expirationTime:le,sortIndex:-1},J>W?(z.sortIndex=J,i(v,z),s(g)===null&&z===s(v)&&(N?(_(V),V=-1):N=!0,oe(ee,J-W))):(z.sortIndex=le,i(g,z),C||E||(C=!0,I||(I=!0,me()))),z},l.unstable_shouldYield=ue,l.unstable_wrapCallback=function(z){var B=M;return function(){var J=M;M=B;try{return z.apply(this,arguments)}finally{M=J}}}})(Gc)),Gc}var np;function Bv(){return np||(np=1,Yc.exports=zv()),Yc.exports}var Qc={exports:{}},ft={};var ap;function Lv(){if(ap)return ft;ap=1;var l=qo();function i(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)v+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+v+" 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(g,v,b){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:A==null?null:""+A,children:g,containerInfo:v,implementation:b}}var m=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ft.createPortal=function(g,v){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(i(299));return d(g,v,null,b)},ft.flushSync=function(g){var v=m.T,b=r.p;try{if(m.T=null,r.p=2,g)return g()}finally{m.T=v,r.p=b,r.d.f()}},ft.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,r.d.C(g,v))},ft.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},ft.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var b=v.as,A=y(b,v.crossOrigin),M=typeof v.integrity=="string"?v.integrity:void 0,E=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;b==="style"?r.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:A,integrity:M,fetchPriority:E}):b==="script"&&r.d.X(g,{crossOrigin:A,integrity:M,fetchPriority:E,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},ft.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var b=y(v.as,v.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&r.d.M(g)},ft.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var b=v.as,A=y(b,v.crossOrigin);r.d.L(g,b,{crossOrigin:A,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},ft.preloadModule=function(g,v){if(typeof g=="string")if(v){var b=y(v.as,v.crossOrigin);r.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else r.d.m(g)},ft.requestFormReset=function(g){r.d.r(g)},ft.unstable_batchedUpdates=function(g,v){return g(v)},ft.useFormState=function(g,v,b){return m.H.useFormState(g,v,b)},ft.useFormStatus=function(){return m.H.useHostTransitionStatus()},ft.version="19.2.0",ft}var lp;function Uv(){if(lp)return Qc.exports;lp=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(),Qc.exports=Lv(),Qc.exports}var ip;function Hv(){if(ip)return pi;ip=1;var l=Bv(),i=qo(),s=Uv();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 y(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 g(e){if(d(e)!==e)throw Error(r(188))}function v(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 g(u),e;if(c===a)return g(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,M=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),G=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case T:return"Profiler";case S:return"StrictMode";case ee:return"Suspense";case I:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case G:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var oe=Array.isArray,z=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},W=[],le=-1;function q(e){return{current:e}}function U(e){0>le||(e.current=W[le],W[le]=null,le--)}function X(e,t){le++,W[le]=e.current,e.current=t}var K=q(null),ne=q(null),se=q(null),pe=q(null);function Ye(e,t){switch(X(se,t),X(ne,e),X(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bm(t),e=Am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(K),X(K,e)}function Oe(){U(K),U(ne),U(se)}function an(e){e.memoizedState!==null&&X(pe,e);var t=K.current,n=Am(t,e.type);t!==n&&(X(ne,e),X(K,n))}function Tn(e){ne.current===e&&(U(K),U(ne)),pe.current===e&&(U(pe),oi._currentValue=J)}var ln,Ae;function Ue(e){if(ln===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ln=t&&t[1]||"",Ae=-1<n.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+ln+e+Ae}var Ke=!1;function Ne(e,t){if(!e||Ke)return"";Ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(L){var k=L}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(L){k=L}e.call(Q.prototype)}}else{try{throw Error()}catch(L){k=L}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(L){if(L&&k&&typeof L.stack=="string")return[L.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 j=h.split(`
|
||
`),D=x.split(`
|
||
`);for(u=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;if(a===j.length||u===D.length)for(a=j.length-1,u=D.length-1;1<=a&&0<=u&&j[a]!==D[u];)u--;for(;1<=a&&0<=u;a--,u--)if(j[a]!==D[u]){if(a!==1||u!==1)do if(a--,u--,0>u||j[a]!==D[u]){var H=`
|
||
`+j[a].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=a&&0<=u);break}}}finally{Ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ue(n):""}function He(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 Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return Ue("Activity");default:return""}}function ke(e){try{var t="",n=null;do t+=He(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
||
Error generating stack: `+a.message+`
|
||
`+a.stack}}var Al=Object.prototype.hasOwnProperty,Er=l.unstable_scheduleCallback,Nr=l.unstable_cancelCallback,og=l.unstable_shouldYield,fg=l.unstable_requestPaint,bt=l.unstable_now,dg=l.unstable_getCurrentPriorityLevel,Wo=l.unstable_ImmediatePriority,Io=l.unstable_UserBlockingPriority,Ri=l.unstable_NormalPriority,hg=l.unstable_LowPriority,Po=l.unstable_IdlePriority,mg=l.log,pg=l.unstable_setDisableYieldValue,Sl=null,At=null;function Mn(e){if(typeof mg=="function"&&pg(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Sl,e)}catch{}}var St=Math.clz32?Math.clz32:vg,gg=Math.log,yg=Math.LN2;function vg(e){return e>>>=0,e===0?32:31-(gg(e)/yg|0)|0}var _i=256,Oi=262144,Di=4194304;function ia(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 ki(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=ia(a):(h&=x,h!==0?u=ia(h):n||(n=x&~e,n!==0&&(u=ia(n))))):(x=a&~c,x!==0?u=ia(x):h!==0?u=ia(h):n||(n=a&~e,n!==0&&(u=ia(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 ql(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xg(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 ef(){var e=Di;return Di<<=1,(Di&62914560)===0&&(Di=4194304),e}function Cr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bg(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,j=e.expirationTimes,D=e.hiddenUpdates;for(n=h&~n;0<n;){var H=31-St(n),Q=1<<H;x[H]=0,j[H]=-1;var k=D[H];if(k!==null)for(D[H]=null,H=0;H<k.length;H++){var L=k[H];L!==null&&(L.lane&=-536870913)}n&=~Q}a!==0&&tf(e,a,0),c!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function tf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-St(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function nf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-St(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function af(e,t){var n=t&-t;return n=(n&42)!==0?1:wr(n),(n&(e.suspendedLanes|t))!==0?0:n}function wr(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 Tr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function lf(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:Qm(e.type))}function sf(e,t){var n=B.p;try{return B.p=e,t()}finally{B.p=n}}var Rn=Math.random().toString(36).slice(2),it="__reactFiber$"+Rn,ht="__reactProps$"+Rn,Ta="__reactContainer$"+Rn,Mr="__reactEvents$"+Rn,Ag="__reactListeners$"+Rn,Sg="__reactHandles$"+Rn,rf="__reactResources$"+Rn,El="__reactMarker$"+Rn;function Rr(e){delete e[it],delete e[ht],delete e[Mr],delete e[Ag],delete e[Sg]}function Ma(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ta]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wm(e);e!==null;){if(n=e[it])return n;e=wm(e)}return t}e=n,n=e.parentNode}return null}function Ra(e){if(e=e[it]||e[Ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Nl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function _a(e){var t=e[rf];return t||(t=e[rf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[El]=!0}var uf=new Set,cf={};function sa(e,t){Oa(e,t),Oa(e+"Capture",t)}function Oa(e,t){for(cf[e]=t,e=0;e<t.length;e++)uf.add(t[e])}var qg=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]*$"),of={},ff={};function jg(e){return Al.call(ff,e)?!0:Al.call(of,e)?!1:qg.test(e)?ff[e]=!0:(of[e]=!0,!1)}function zi(e,t,n){if(jg(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 Bi(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 sn(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 _t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function df(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Eg(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 _r(e){if(!e._valueTracker){var t=df(e)?"checked":"value";e._valueTracker=Eg(e,t,""+e[t])}}function hf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=df(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Li(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 Ng=/[\n"\\]/g;function Ot(e){return e.replace(Ng,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Or(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=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Dr(e,h,_t(t)):n!=null?Dr(e,h,_t(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=""+_t(x):e.removeAttribute("name")}function mf(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)){_r(e);return}n=n!=null?""+_t(n):"",t=t!=null?""+_t(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),_r(e)}function Dr(e,t,n){t==="number"&&Li(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Da(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=""+_t(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 pf(e,t,n){if(t!=null&&(t=""+_t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+_t(n):""}function gf(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(r(92));if(oe(a)){if(1<a.length)throw Error(r(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=_t(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),_r(e)}function ka(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cg=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 yf(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||Cg.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function vf(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&&yf(e,u,a)}else for(var c in t)t.hasOwnProperty(c)&&yf(e,c,t[c])}function kr(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 wg=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"]]),Tg=/^[\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 Ui(e){return Tg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rn(){}var zr=null;function Br(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,Ba=null;function xf(e){var t=Ra(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Or(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[ht]||null;if(!u)throw Error(r(90));Or(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&&hf(a)}break e;case"textarea":pf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Da(e,!!n.multiple,t,!1)}}}var Lr=!1;function bf(e,t,n){if(Lr)return e(t,n);Lr=!0;try{var a=e(t);return a}finally{if(Lr=!1,(za!==null||Ba!==null)&&(Ns(),za&&(t=za,e=Ba,Ba=za=null,xf(t),e)))for(t=0;t<e.length;t++)xf(e[t])}}function Cl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[ht]||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 un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ur=!1;if(un)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){Ur=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{Ur=!1}var _n=null,Hr=null,Hi=null;function Af(){if(Hi)return Hi;var e,t=Hr,n=t.length,a,u="value"in _n?_n.value:_n.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 Hi=u.slice(e,1<a?1-a:void 0)}function Vi(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 Yi(){return!0}function Sf(){return!1}function mt(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)?Yi:Sf,this.isPropagationStopped=Sf,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=Yi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yi)},persist:function(){},isPersistent:Yi}),t}var ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gi=mt(ra),Tl=A({},ra,{view:0,detail:0}),Mg=mt(Tl),Vr,Yr,Ml,Qi=A({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qr,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!==Ml&&(Ml&&e.type==="mousemove"?(Vr=e.screenX-Ml.screenX,Yr=e.screenY-Ml.screenY):Yr=Vr=0,Ml=e),Vr)},movementY:function(e){return"movementY"in e?e.movementY:Yr}}),qf=mt(Qi),Rg=A({},Qi,{dataTransfer:0}),_g=mt(Rg),Og=A({},Tl,{relatedTarget:0}),Gr=mt(Og),Dg=A({},ra,{animationName:0,elapsedTime:0,pseudoElement:0}),kg=mt(Dg),zg=A({},ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bg=mt(zg),Lg=A({},ra,{data:0}),jf=mt(Lg),Ug={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hg={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"},Vg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vg[e])?!!t[e]:!1}function Qr(){return Yg}var Gg=A({},Tl,{key:function(e){if(e.key){var t=Ug[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qr,charCode:function(e){return e.type==="keypress"?Vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qg=mt(Gg),Xg=A({},Qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ef=mt(Xg),Kg=A({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qr}),Zg=mt(Kg),$g=A({},ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jg=mt($g),Fg=A({},Qi,{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}),Wg=mt(Fg),Ig=A({},ra,{newState:0,oldState:0}),Pg=mt(Ig),ey=[9,13,27,32],Xr=un&&"CompositionEvent"in window,Rl=null;un&&"documentMode"in document&&(Rl=document.documentMode);var ty=un&&"TextEvent"in window&&!Rl,Nf=un&&(!Xr||Rl&&8<Rl&&11>=Rl),Cf=" ",wf=!1;function Tf(e,t){switch(e){case"keyup":return ey.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var La=!1;function ny(e,t){switch(e){case"compositionend":return Mf(t);case"keypress":return t.which!==32?null:(wf=!0,Cf);case"textInput":return e=t.data,e===Cf&&wf?null:e;default:return null}}function ay(e,t){if(La)return e==="compositionend"||!Xr&&Tf(e,t)?(e=Af(),Hi=Hr=_n=null,La=!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 Nf&&t.locale!=="ko"?null:t.data;default:return null}}var ly={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 Rf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ly[e.type]:t==="textarea"}function _f(e,t,n,a){za?Ba?Ba.push(a):Ba=[a]:za=a,t=Os(t,"onChange"),0<t.length&&(n=new Gi("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var _l=null,Ol=null;function iy(e){mm(e,0)}function Xi(e){var t=Nl(e);if(hf(t))return e}function Of(e,t){if(e==="change")return t}var Df=!1;if(un){var Kr;if(un){var Zr="oninput"in document;if(!Zr){var kf=document.createElement("div");kf.setAttribute("oninput","return;"),Zr=typeof kf.oninput=="function"}Kr=Zr}else Kr=!1;Df=Kr&&(!document.documentMode||9<document.documentMode)}function zf(){_l&&(_l.detachEvent("onpropertychange",Bf),Ol=_l=null)}function Bf(e){if(e.propertyName==="value"&&Xi(Ol)){var t=[];_f(t,Ol,e,Br(e)),bf(iy,t)}}function sy(e,t,n){e==="focusin"?(zf(),_l=t,Ol=n,_l.attachEvent("onpropertychange",Bf)):e==="focusout"&&zf()}function ry(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xi(Ol)}function uy(e,t){if(e==="click")return Xi(t)}function cy(e,t){if(e==="input"||e==="change")return Xi(t)}function oy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:oy;function Dl(e,t){if(qt(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(!Al.call(t,u)||!qt(e[u],t[u]))return!1}return!0}function Lf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uf(e,t){var n=Lf(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=Lf(n)}}function Hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Li(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=Li(e.document)}return t}function $r(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 fy=un&&"documentMode"in document&&11>=document.documentMode,Ua=null,Jr=null,kl=null,Fr=!1;function Yf(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Ua==null||Ua!==Li(a)||(a=Ua,"selectionStart"in a&&$r(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}),kl&&Dl(kl,a)||(kl=a,a=Os(Jr,"onSelect"),0<a.length&&(t=new Gi("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ua)))}function ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ha={animationend:ua("Animation","AnimationEnd"),animationiteration:ua("Animation","AnimationIteration"),animationstart:ua("Animation","AnimationStart"),transitionrun:ua("Transition","TransitionRun"),transitionstart:ua("Transition","TransitionStart"),transitioncancel:ua("Transition","TransitionCancel"),transitionend:ua("Transition","TransitionEnd")},Wr={},Gf={};un&&(Gf=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function ca(e){if(Wr[e])return Wr[e];if(!Ha[e])return e;var t=Ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gf)return Wr[e]=t[n];return e}var Qf=ca("animationend"),Xf=ca("animationiteration"),Kf=ca("animationstart"),dy=ca("transitionrun"),hy=ca("transitionstart"),my=ca("transitioncancel"),Zf=ca("transitionend"),$f=new Map,Ir="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(" ");Ir.push("scrollEnd");function Xt(e,t){$f.set(e,t),sa(t,[e])}var Ki=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)},Dt=[],Va=0,Pr=0;function Zi(){for(var e=Va,t=Pr=Va=0;t<e;){var n=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var u=Dt[t];Dt[t++]=null;var c=Dt[t];if(Dt[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&&Jf(n,u,c)}}function $i(e,t,n,a){Dt[Va++]=e,Dt[Va++]=t,Dt[Va++]=n,Dt[Va++]=a,Pr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function eu(e,t,n,a){return $i(e,t,n,a),Ji(e)}function oa(e,t){return $i(e,null,null,t),Ji(e)}function Jf(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-St(n),e=c.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),c):null}function Ji(e){if(50<ai)throw ai=0,cc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ya={};function py(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 jt(e,t,n,a){return new py(e,t,n,a)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cn(e,t){var n=e.alternate;return n===null?(n=jt(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 Ff(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 Fi(e,t,n,a,u,c){var h=0;if(a=e,typeof e=="function")tu(e)&&(h=1);else if(typeof e=="string")h=bv(e,n,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=jt(31,n,t,u),e.elementType=P,e.lanes=c,e;case N:return fa(n.children,u,c,t);case S:h=8,u|=24;break;case T:return e=jt(12,n,t,u|2),e.elementType=T,e.lanes=c,e;case ee:return e=jt(13,n,t,u),e.elementType=ee,e.lanes=c,e;case I:return e=jt(19,n,t,u),e.elementType=I,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:h=10;break e;case _:h=9;break e;case F:h=11;break e;case V:h=14;break e;case Z:h=16,a=null;break e}h=29,n=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=jt(h,n,t,u),t.elementType=e,t.type=a,t.lanes=c,t}function fa(e,t,n,a){return e=jt(7,e,a,t),e.lanes=n,e}function nu(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function Wf(e){var t=jt(18,null,null,0);return t.stateNode=e,t}function au(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var If=new WeakMap;function kt(e,t){if(typeof e=="object"&&e!==null){var n=If.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ke(t)},If.set(e,t),t)}return{value:e,source:t,stack:ke(t)}}var Ga=[],Qa=0,Wi=null,zl=0,zt=[],Bt=0,On=null,Ft=1,Wt="";function on(e,t){Ga[Qa++]=zl,Ga[Qa++]=Wi,Wi=e,zl=t}function Pf(e,t,n){zt[Bt++]=Ft,zt[Bt++]=Wt,zt[Bt++]=On,On=e;var a=Ft;e=Wt;var u=32-St(a)-1;a&=~(1<<u),n+=1;var c=32-St(t)+u;if(30<c){var h=u-u%5;c=(a&(1<<h)-1).toString(32),a>>=h,u-=h,Ft=1<<32-St(t)+u|n<<u|a,Wt=c+e}else Ft=1<<c|n<<u|a,Wt=e}function lu(e){e.return!==null&&(on(e,1),Pf(e,1,0))}function iu(e){for(;e===Wi;)Wi=Ga[--Qa],Ga[Qa]=null,zl=Ga[--Qa],Ga[Qa]=null;for(;e===On;)On=zt[--Bt],zt[Bt]=null,Wt=zt[--Bt],zt[Bt]=null,Ft=zt[--Bt],zt[Bt]=null}function ed(e,t){zt[Bt++]=Ft,zt[Bt++]=Wt,zt[Bt++]=On,Ft=t.id,Wt=t.overflow,On=e}var st=null,ze=null,Se=!1,Dn=null,Lt=!1,su=Error(r(519));function kn(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bl(kt(t,e)),su}function td(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[it]=e,t[ht]=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<ii.length;n++)ye(ii[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),mf(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),gf(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||vm(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=rn),t=!0):t=!1,t||kn(e,!0)}function nd(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Lt=!1;return;case 27:case 3:Lt=!0;return;default:st=st.return}}function Xa(e){if(e!==st)return!1;if(!Se)return nd(e),Se=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||jc(e.type,e.memoizedProps)),n=!n),n&&ze&&kn(e),nd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ze=Cm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ze=Cm(e)}else t===27?(t=ze,Jn(e.type)?(e=Tc,Tc=null,ze=e):ze=t):ze=st?Ht(e.stateNode.nextSibling):null;return!0}function da(){ze=st=null,Se=!1}function ru(){var e=Dn;return e!==null&&(vt===null?vt=e:vt.push.apply(vt,e),Dn=null),e}function Bl(e){Dn===null?Dn=[e]:Dn.push(e)}var uu=q(null),ha=null,fn=null;function zn(e,t,n){X(uu,t._currentValue),t._currentValue=n}function dn(e){e._currentValue=uu.current,U(uu)}function cu(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 ou(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 j=0;j<t.length;j++)if(x.context===t[j]){c.lanes|=n,x=c.alternate,x!==null&&(x.lanes|=n),cu(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),cu(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 Ka(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;qt(u.pendingProps.value,h.value)||(e!==null?e.push(x):e=[x])}}else if(u===pe.current){if(h=u.alternate,h===null)throw Error(r(387));h.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(oi):e=[oi])}u=u.return}e!==null&&ou(t,e,n,a),t.flags|=262144}function Ii(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ma(e){ha=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rt(e){return ad(ha,e)}function Pi(e,t){return ha===null&&ma(e),ad(e,t)}function ad(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fn===null){if(e===null)throw Error(r(308));fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fn=fn.next=t;return n}var gy=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()})}},yy=l.unstable_scheduleCallback,vy=l.unstable_NormalPriority,Fe={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fu(){return{controller:new gy,data:new Map,refCount:0}}function Ll(e){e.refCount--,e.refCount===0&&yy(vy,function(){e.controller.abort()})}var Ul=null,du=0,Za=0,$a=null;function xy(e,t){if(Ul===null){var n=Ul=[];du=0,Za=pc(),$a={status:"pending",value:void 0,then:function(a){n.push(a)}}}return du++,t.then(ld,ld),t}function ld(){if(--du===0&&Ul!==null){$a!==null&&($a.status="fulfilled");var e=Ul;Ul=null,Za=0,$a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function by(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 id=z.S;z.S=function(e,t){Yh=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xy(e,t),id!==null&&id(e,t)};var pa=q(null);function hu(){var e=pa.current;return e!==null?e:De.pooledCache}function es(e,t){t===null?X(pa,pa.current):X(pa,t.pool)}function sd(){var e=hu();return e===null?null:{parent:Fe._currentValue,pool:e}}var Ja=Error(r(460)),mu=Error(r(474)),ts=Error(r(542)),ns={then:function(){}};function rd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ud(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(rn,rn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,od(e),e;default:if(typeof t.status=="string")t.then(rn,rn);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,od(e),e}throw ya=t,Ja}}function ga(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ya=n,Ja):n}}var ya=null;function cd(){if(ya===null)throw Error(r(459));var e=ya;return ya=null,e}function od(e){if(e===Ja||e===ts)throw Error(r(483))}var Fa=null,Hl=0;function as(e){var t=Hl;return Hl+=1,Fa===null&&(Fa=[]),ud(Fa,e,t)}function Vl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ls(e,t){throw t.$$typeof===M?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function fd(e){function t(R,w){if(e){var O=R.deletions;O===null?(R.deletions=[w],R.flags|=16):O.push(w)}}function n(R,w){if(!e)return null;for(;w!==null;)t(R,w),w=w.sibling;return null}function a(R){for(var w=new Map;R!==null;)R.key!==null?w.set(R.key,R):w.set(R.index,R),R=R.sibling;return w}function u(R,w){return R=cn(R,w),R.index=0,R.sibling=null,R}function c(R,w,O){return R.index=O,e?(O=R.alternate,O!==null?(O=O.index,O<w?(R.flags|=67108866,w):O):(R.flags|=67108866,w)):(R.flags|=1048576,w)}function h(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function x(R,w,O,Y){return w===null||w.tag!==6?(w=nu(O,R.mode,Y),w.return=R,w):(w=u(w,O),w.return=R,w)}function j(R,w,O,Y){var re=O.type;return re===N?H(R,w,O.props.children,Y,O.key):w!==null&&(w.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Z&&ga(re)===w.type)?(w=u(w,O.props),Vl(w,O),w.return=R,w):(w=Fi(O.type,O.key,O.props,null,R.mode,Y),Vl(w,O),w.return=R,w)}function D(R,w,O,Y){return w===null||w.tag!==4||w.stateNode.containerInfo!==O.containerInfo||w.stateNode.implementation!==O.implementation?(w=au(O,R.mode,Y),w.return=R,w):(w=u(w,O.children||[]),w.return=R,w)}function H(R,w,O,Y,re){return w===null||w.tag!==7?(w=fa(O,R.mode,Y,re),w.return=R,w):(w=u(w,O),w.return=R,w)}function Q(R,w,O){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=nu(""+w,R.mode,O),w.return=R,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case E:return O=Fi(w.type,w.key,w.props,null,R.mode,O),Vl(O,w),O.return=R,O;case C:return w=au(w,R.mode,O),w.return=R,w;case Z:return w=ga(w),Q(R,w,O)}if(oe(w)||me(w))return w=fa(w,R.mode,O,null),w.return=R,w;if(typeof w.then=="function")return Q(R,as(w),O);if(w.$$typeof===G)return Q(R,Pi(R,w),O);ls(R,w)}return null}function k(R,w,O,Y){var re=w!==null?w.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return re!==null?null:x(R,w,""+O,Y);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case E:return O.key===re?j(R,w,O,Y):null;case C:return O.key===re?D(R,w,O,Y):null;case Z:return O=ga(O),k(R,w,O,Y)}if(oe(O)||me(O))return re!==null?null:H(R,w,O,Y,null);if(typeof O.then=="function")return k(R,w,as(O),Y);if(O.$$typeof===G)return k(R,w,Pi(R,O),Y);ls(R,O)}return null}function L(R,w,O,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return R=R.get(O)||null,x(w,R,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:return R=R.get(Y.key===null?O:Y.key)||null,j(w,R,Y,re);case C:return R=R.get(Y.key===null?O:Y.key)||null,D(w,R,Y,re);case Z:return Y=ga(Y),L(R,w,O,Y,re)}if(oe(Y)||me(Y))return R=R.get(O)||null,H(w,R,Y,re,null);if(typeof Y.then=="function")return L(R,w,O,as(Y),re);if(Y.$$typeof===G)return L(R,w,O,Pi(w,Y),re);ls(w,Y)}return null}function ae(R,w,O,Y){for(var re=null,je=null,ie=w,he=w=0,xe=null;ie!==null&&he<O.length;he++){ie.index>he?(xe=ie,ie=null):xe=ie.sibling;var Ee=k(R,ie,O[he],Y);if(Ee===null){ie===null&&(ie=xe);break}e&&ie&&Ee.alternate===null&&t(R,ie),w=c(Ee,w,he),je===null?re=Ee:je.sibling=Ee,je=Ee,ie=xe}if(he===O.length)return n(R,ie),Se&&on(R,he),re;if(ie===null){for(;he<O.length;he++)ie=Q(R,O[he],Y),ie!==null&&(w=c(ie,w,he),je===null?re=ie:je.sibling=ie,je=ie);return Se&&on(R,he),re}for(ie=a(ie);he<O.length;he++)xe=L(ie,R,he,O[he],Y),xe!==null&&(e&&xe.alternate!==null&&ie.delete(xe.key===null?he:xe.key),w=c(xe,w,he),je===null?re=xe:je.sibling=xe,je=xe);return e&&ie.forEach(function(ea){return t(R,ea)}),Se&&on(R,he),re}function ce(R,w,O,Y){if(O==null)throw Error(r(151));for(var re=null,je=null,ie=w,he=w=0,xe=null,Ee=O.next();ie!==null&&!Ee.done;he++,Ee=O.next()){ie.index>he?(xe=ie,ie=null):xe=ie.sibling;var ea=k(R,ie,Ee.value,Y);if(ea===null){ie===null&&(ie=xe);break}e&&ie&&ea.alternate===null&&t(R,ie),w=c(ea,w,he),je===null?re=ea:je.sibling=ea,je=ea,ie=xe}if(Ee.done)return n(R,ie),Se&&on(R,he),re;if(ie===null){for(;!Ee.done;he++,Ee=O.next())Ee=Q(R,Ee.value,Y),Ee!==null&&(w=c(Ee,w,he),je===null?re=Ee:je.sibling=Ee,je=Ee);return Se&&on(R,he),re}for(ie=a(ie);!Ee.done;he++,Ee=O.next())Ee=L(ie,R,he,Ee.value,Y),Ee!==null&&(e&&Ee.alternate!==null&&ie.delete(Ee.key===null?he:Ee.key),w=c(Ee,w,he),je===null?re=Ee:je.sibling=Ee,je=Ee);return e&&ie.forEach(function(Rv){return t(R,Rv)}),Se&&on(R,he),re}function _e(R,w,O,Y){if(typeof O=="object"&&O!==null&&O.type===N&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case E:e:{for(var re=O.key;w!==null;){if(w.key===re){if(re=O.type,re===N){if(w.tag===7){n(R,w.sibling),Y=u(w,O.props.children),Y.return=R,R=Y;break e}}else if(w.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Z&&ga(re)===w.type){n(R,w.sibling),Y=u(w,O.props),Vl(Y,O),Y.return=R,R=Y;break e}n(R,w);break}else t(R,w);w=w.sibling}O.type===N?(Y=fa(O.props.children,R.mode,Y,O.key),Y.return=R,R=Y):(Y=Fi(O.type,O.key,O.props,null,R.mode,Y),Vl(Y,O),Y.return=R,R=Y)}return h(R);case C:e:{for(re=O.key;w!==null;){if(w.key===re)if(w.tag===4&&w.stateNode.containerInfo===O.containerInfo&&w.stateNode.implementation===O.implementation){n(R,w.sibling),Y=u(w,O.children||[]),Y.return=R,R=Y;break e}else{n(R,w);break}else t(R,w);w=w.sibling}Y=au(O,R.mode,Y),Y.return=R,R=Y}return h(R);case Z:return O=ga(O),_e(R,w,O,Y)}if(oe(O))return ae(R,w,O,Y);if(me(O)){if(re=me(O),typeof re!="function")throw Error(r(150));return O=re.call(O),ce(R,w,O,Y)}if(typeof O.then=="function")return _e(R,w,as(O),Y);if(O.$$typeof===G)return _e(R,w,Pi(R,O),Y);ls(R,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,w!==null&&w.tag===6?(n(R,w.sibling),Y=u(w,O),Y.return=R,R=Y):(n(R,w),Y=nu(O,R.mode,Y),Y.return=R,R=Y),h(R)):n(R,w)}return function(R,w,O,Y){try{Hl=0;var re=_e(R,w,O,Y);return Fa=null,re}catch(ie){if(ie===Ja||ie===ts)throw ie;var je=jt(29,ie,null,R.mode);return je.lanes=Y,je.return=R,je}finally{}}}var va=fd(!0),dd=fd(!1),Bn=!1;function pu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gu(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 Ln(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Un(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ce&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Ji(e),Jf(e,null,n),t}return $i(e,a,t,n),Ji(e)}function Yl(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,nf(e,n)}}function yu(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 vu=!1;function Gl(){if(vu){var e=$a;if(e!==null)throw e}}function Ql(e,t,n,a){vu=!1;var u=e.updateQueue;Bn=!1;var c=u.firstBaseUpdate,h=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var j=x,D=j.next;j.next=null,h===null?c=D:h.next=D,h=j;var H=e.alternate;H!==null&&(H=H.updateQueue,x=H.lastBaseUpdate,x!==h&&(x===null?H.firstBaseUpdate=D:x.next=D,H.lastBaseUpdate=j))}if(c!==null){var Q=u.baseState;h=0,H=D=j=null,x=c;do{var k=x.lane&-536870913,L=k!==x.lane;if(L?(ve&k)===k:(a&k)===k){k!==0&&k===Za&&(vu=!0),H!==null&&(H=H.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ae=e,ce=x;k=t;var _e=n;switch(ce.tag){case 1:if(ae=ce.payload,typeof ae=="function"){Q=ae.call(_e,Q,k);break e}Q=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ce.payload,k=typeof ae=="function"?ae.call(_e,Q,k):ae,k==null)break e;Q=A({},Q,k);break e;case 2:Bn=!0}}k=x.callback,k!==null&&(e.flags|=64,L&&(e.flags|=8192),L=u.callbacks,L===null?u.callbacks=[k]:L.push(k))}else L={lane:k,tag:x.tag,payload:x.payload,callback:x.callback,next:null},H===null?(D=H=L,j=Q):H=H.next=L,h|=k;if(x=x.next,x===null){if(x=u.shared.pending,x===null)break;L=x,x=L.next,L.next=null,u.lastBaseUpdate=L,u.shared.pending=null}}while(!0);H===null&&(j=Q),u.baseState=j,u.firstBaseUpdate=D,u.lastBaseUpdate=H,c===null&&(u.shared.lanes=0),Qn|=h,e.lanes=h,e.memoizedState=Q}}function hd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function md(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)hd(n[e],t)}var Wa=q(null),is=q(0);function pd(e,t){e=An,X(is,e),X(Wa,t),An=e|t.baseLanes}function xu(){X(is,An),X(Wa,Wa.current)}function bu(){An=is.current,U(Wa),U(is)}var Et=q(null),Ut=null;function Hn(e){var t=e.alternate;X(Ze,Ze.current&1),X(Et,e),Ut===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Ut=e)}function Au(e){X(Ze,Ze.current),X(Et,e),Ut===null&&(Ut=e)}function gd(e){e.tag===22?(X(Ze,Ze.current),X(Et,e),Ut===null&&(Ut=e)):Vn()}function Vn(){X(Ze,Ze.current),X(Et,Et.current)}function Nt(e){U(Et),Ut===e&&(Ut=null),U(Ze)}var Ze=q(0);function ss(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Cc(n)||wc(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 hn=0,de=null,Me=null,We=null,rs=!1,Ia=!1,xa=!1,us=0,Xl=0,Pa=null,Ay=0;function Ge(){throw Error(r(321))}function Su(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qt(e[n],t[n]))return!1;return!0}function qu(e,t,n,a,u,c){return hn=c,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Pd:Lu,xa=!1,c=n(a,u),xa=!1,Ia&&(c=vd(t,n,a,u)),yd(e),c}function yd(e){z.H=$l;var t=Me!==null&&Me.next!==null;if(hn=0,We=Me=de=null,rs=!1,Xl=0,Pa=null,t)throw Error(r(300));e===null||Ie||(e=e.dependencies,e!==null&&Ii(e)&&(Ie=!0))}function vd(e,t,n,a){de=e;var u=0;do{if(Ia&&(Pa=null),Xl=0,Ia=!1,25<=u)throw Error(r(301));if(u+=1,We=Me=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=eh,c=t(n,a)}while(Ia);return c}function Sy(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?Kl(t):t,e=e.useState()[0],(Me!==null?Me.memoizedState:null)!==e&&(de.flags|=1024),t}function ju(){var e=us!==0;return us=0,e}function Eu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nu(e){if(rs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}rs=!1}hn=0,We=Me=de=null,Ia=!1,Xl=us=0,Pa=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?de.memoizedState=We=e:We=We.next=e,We}function $e(){if(Me===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=We===null?de.memoizedState:We.next;if(t!==null)We=t,Me=e;else{if(e===null)throw de.alternate===null?Error(r(467)):Error(r(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},We===null?de.memoizedState=We=e:We=We.next=e}return We}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Kl(e){var t=Xl;return Xl+=1,Pa===null&&(Pa=[]),e=ud(Pa,e,t),t=de,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Pd:Lu),e}function os(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Kl(e);if(e.$$typeof===G)return rt(e)}throw Error(r(438,String(e)))}function Cu(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=cs(),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]=ue;return t.index++,n}function mn(e,t){return typeof t=="function"?t(e):t}function fs(e){var t=$e();return wu(t,Me,e)}function wu(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,j=null,D=t,H=!1;do{var Q=D.lane&-536870913;if(Q!==D.lane?(ve&Q)===Q:(hn&Q)===Q){var k=D.revertLane;if(k===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),Q===Za&&(H=!0);else if((hn&k)===k){D=D.next,k===Za&&(H=!0);continue}else Q={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(x=j=Q,h=c):j=j.next=Q,de.lanes|=k,Qn|=k;Q=D.action,xa&&n(c,Q),c=D.hasEagerState?D.eagerState:n(c,Q)}else k={lane:Q,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(x=j=k,h=c):j=j.next=k,de.lanes|=Q,Qn|=Q;D=D.next}while(D!==null&&D!==t);if(j===null?h=c:j.next=x,!qt(c,e.memoizedState)&&(Ie=!0,H&&(n=$a,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=j,a.lastRenderedState=c}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Tu(e){var t=$e(),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);qt(c,t.memoizedState)||(Ie=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,a]}function xd(e,t,n){var a=de,u=$e(),c=Se;if(c){if(n===void 0)throw Error(r(407));n=n()}else n=t();var h=!qt((Me||u).memoizedState,n);if(h&&(u.memoizedState=n,Ie=!0),u=u.queue,_u(Sd.bind(null,a,u,e),[e]),u.getSnapshot!==t||h||We!==null&&We.memoizedState.tag&1){if(a.flags|=2048,el(9,{destroy:void 0},Ad.bind(null,a,u,n,t),null),De===null)throw Error(r(349));c||(hn&127)!==0||bd(a,t,n)}return n}function bd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=de.updateQueue,t===null?(t=cs(),de.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ad(e,t,n,a){t.value=n,t.getSnapshot=a,qd(t)&&jd(e)}function Sd(e,t,n){return n(function(){qd(t)&&jd(e)})}function qd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qt(e,n)}catch{return!0}}function jd(e){var t=oa(e,2);t!==null&&xt(t,e,2)}function Mu(e){var t=dt();if(typeof e=="function"){var n=e;if(e=n(),xa){Mn(!0);try{n()}finally{Mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:e},t}function Ed(e,t,n,a){return e.baseState=n,wu(e,Me,typeof a=="function"?a:mn)}function qy(e,t,n,a,u){if(ms(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,Nd(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Nd(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),j=z.S;j!==null&&j(h,x),Cd(e,t,x)}catch(D){Ru(e,t,D)}finally{c!==null&&h.types!==null&&(c.types=h.types),z.T=c}}else try{c=n(u,a),Cd(e,t,c)}catch(D){Ru(e,t,D)}}function Cd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){wd(e,t,a)},function(a){return Ru(e,t,a)}):wd(e,t,n)}function wd(e,t,n){t.status="fulfilled",t.value=n,Td(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Nd(e,n)))}function Ru(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Td(t),t=t.next;while(t!==a)}e.action=null}function Td(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Md(e,t){return t}function Rd(e,t){if(Se){var n=De.formState;if(n!==null){e:{var a=de;if(Se){if(ze){t:{for(var u=ze,c=Lt;u.nodeType!==8;){if(!c){u=null;break t}if(u=Ht(u.nextSibling),u===null){u=null;break t}}c=u.data,u=c==="F!"||c==="F"?u:null}if(u){ze=Ht(u.nextSibling),a=u.data==="F!";break e}}kn(a)}a=!1}a&&(t=n[0])}}return n=dt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Md,lastRenderedState:t},n.queue=a,n=Fd.bind(null,de,a),a.dispatch=n,a=Mu(!1),c=Bu.bind(null,de,!1,a.queue),a=dt(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=qy.bind(null,de,u,c,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function _d(e){var t=$e();return Od(t,Me,e)}function Od(e,t,n){if(t=wu(e,t,Md)[0],e=fs(mn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Kl(t)}catch(h){throw h===Ja?ts:h}else a=t;t=$e();var u=t.queue,c=u.dispatch;return n!==t.memoizedState&&(de.flags|=2048,el(9,{destroy:void 0},jy.bind(null,u,n),null)),[a,c,e]}function jy(e,t){e.action=t}function Dd(e){var t=$e(),n=Me;if(n!==null)return Od(t,n,e);$e(),t=t.memoizedState,n=$e();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function el(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=de.updateQueue,t===null&&(t=cs(),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 kd(){return $e().memoizedState}function ds(e,t,n,a){var u=dt();de.flags|=e,u.memoizedState=el(1|t,{destroy:void 0},n,a===void 0?null:a)}function hs(e,t,n,a){var u=$e();a=a===void 0?null:a;var c=u.memoizedState.inst;Me!==null&&a!==null&&Su(a,Me.memoizedState.deps)?u.memoizedState=el(t,c,n,a):(de.flags|=e,u.memoizedState=el(1|t,c,n,a))}function zd(e,t){ds(8390656,8,e,t)}function _u(e,t){hs(2048,8,e,t)}function Ey(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=cs(),de.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bd(e){var t=$e().memoizedState;return Ey({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Ld(e,t){return hs(4,2,e,t)}function Ud(e,t){return hs(4,4,e,t)}function Hd(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 Vd(e,t,n){n=n!=null?n.concat([e]):null,hs(4,4,Hd.bind(null,t,e),n)}function Ou(){}function Yd(e,t){var n=$e();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Su(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Gd(e,t){var n=$e();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Su(t,a[1]))return a[0];if(a=e(),xa){Mn(!0);try{e()}finally{Mn(!1)}}return n.memoizedState=[a,t],a}function Du(e,t,n){return n===void 0||(hn&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Qh(),de.lanes|=e,Qn|=e,n)}function Qd(e,t,n,a){return qt(n,t)?n:Wa.current!==null?(e=Du(e,n,a),qt(e,t)||(Ie=!0),e):(hn&42)===0||(hn&1073741824)!==0&&(ve&261930)===0?(Ie=!0,e.memoizedState=n):(e=Qh(),de.lanes|=e,Qn|=e,t)}function Xd(e,t,n,a,u){var c=B.p;B.p=c!==0&&8>c?c:8;var h=z.T,x={};z.T=x,Bu(e,!1,t,n);try{var j=u(),D=z.S;if(D!==null&&D(x,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var H=by(j,a);Zl(e,t,H,Tt(e))}else Zl(e,t,a,Tt(e))}catch(Q){Zl(e,t,{then:function(){},status:"rejected",reason:Q},Tt())}finally{B.p=c,h!==null&&x.types!==null&&(h.types=x.types),z.T=h}}function Ny(){}function ku(e,t,n,a){if(e.tag!==5)throw Error(r(476));var u=Kd(e).queue;Xd(e,u,t,J,n===null?Ny:function(){return Zd(e),n(a)})}function Kd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:J},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zd(e){var t=Kd(e);t.next===null&&(t=e.alternate.memoizedState),Zl(e,t.next.queue,{},Tt())}function zu(){return rt(oi)}function $d(){return $e().memoizedState}function Jd(){return $e().memoizedState}function Cy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Ln(n);var a=Un(t,e,n);a!==null&&(xt(a,t,n),Yl(a,t,n)),t={cache:fu()},e.payload=t;return}t=t.return}}function wy(e,t,n){var a=Tt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e)?Wd(t,n):(n=eu(e,t,n,a),n!==null&&(xt(n,e,a),Id(n,t,a)))}function Fd(e,t,n){var a=Tt();Zl(e,t,n,a)}function Zl(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))Wd(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,qt(x,h))return $i(e,t,u,0),De===null&&Zi(),!1}catch{}finally{}if(n=eu(e,t,u,a),n!==null)return xt(n,e,a),Id(n,t,a),!0}return!1}function Bu(e,t,n,a){if(a={lane:2,revertLane:pc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(t)throw Error(r(479))}else t=eu(e,n,a,2),t!==null&&xt(t,e,2)}function ms(e){var t=e.alternate;return e===de||t!==null&&t===de}function Wd(e,t){Ia=rs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Id(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,nf(e,n)}}var $l={readContext:rt,use:os,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};$l.useEffectEvent=Ge;var Pd={readContext:rt,use:os,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:zd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ds(4194308,4,Hd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=dt();t=t===void 0?null:t;var a=e();if(xa){Mn(!0);try{e()}finally{Mn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=dt();if(n!==void 0){var u=n(t);if(xa){Mn(!0);try{n(t)}finally{Mn(!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=wy.bind(null,de,e),[a.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Mu(e);var t=e.queue,n=Fd.bind(null,de,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ou,useDeferredValue:function(e,t){var n=dt();return Du(n,e,t)},useTransition:function(){var e=Mu(!1);return e=Xd.bind(null,de,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=de,u=dt();if(Se){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),De===null)throw Error(r(349));(ve&127)!==0||bd(a,t,n)}u.memoizedState=n;var c={value:n,getSnapshot:t};return u.queue=c,zd(Sd.bind(null,a,c,e),[e]),a.flags|=2048,el(9,{destroy:void 0},Ad.bind(null,a,c,n,t),null),n},useId:function(){var e=dt(),t=De.identifierPrefix;if(Se){var n=Wt,a=Ft;n=(a&~(1<<32-St(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=us++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ay++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zu,useFormState:Rd,useActionState:Rd,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bu.bind(null,de,!0,n),n.dispatch=t,[e,t]},useMemoCache:Cu,useCacheRefresh:function(){return dt().memoizedState=Cy.bind(null,de)},useEffectEvent:function(e){var t=dt(),n={impl:e};return t.memoizedState=n,function(){if((Ce&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Lu={readContext:rt,use:os,useCallback:Yd,useContext:rt,useEffect:_u,useImperativeHandle:Vd,useInsertionEffect:Ld,useLayoutEffect:Ud,useMemo:Gd,useReducer:fs,useRef:kd,useState:function(){return fs(mn)},useDebugValue:Ou,useDeferredValue:function(e,t){var n=$e();return Qd(n,Me.memoizedState,e,t)},useTransition:function(){var e=fs(mn)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Kl(e),t]},useSyncExternalStore:xd,useId:$d,useHostTransitionStatus:zu,useFormState:_d,useActionState:_d,useOptimistic:function(e,t){var n=$e();return Ed(n,Me,e,t)},useMemoCache:Cu,useCacheRefresh:Jd};Lu.useEffectEvent=Bd;var eh={readContext:rt,use:os,useCallback:Yd,useContext:rt,useEffect:_u,useImperativeHandle:Vd,useInsertionEffect:Ld,useLayoutEffect:Ud,useMemo:Gd,useReducer:Tu,useRef:kd,useState:function(){return Tu(mn)},useDebugValue:Ou,useDeferredValue:function(e,t){var n=$e();return Me===null?Du(n,e,t):Qd(n,Me.memoizedState,e,t)},useTransition:function(){var e=Tu(mn)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Kl(e),t]},useSyncExternalStore:xd,useId:$d,useHostTransitionStatus:zu,useFormState:Dd,useActionState:Dd,useOptimistic:function(e,t){var n=$e();return Me!==null?Ed(n,Me,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Cu,useCacheRefresh:Jd};eh.useEffectEvent=Bd;function Uu(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 Hu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Tt(),u=Ln(a);u.payload=t,n!=null&&(u.callback=n),t=Un(e,u,a),t!==null&&(xt(t,e,a),Yl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Tt(),u=Ln(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Un(e,u,a),t!==null&&(xt(t,e,a),Yl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),a=Ln(n);a.tag=2,t!=null&&(a.callback=t),t=Un(e,a,n),t!==null&&(xt(t,e,n),Yl(t,e,n))}};function th(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?!Dl(n,a)||!Dl(u,c):!0}function nh(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&&Hu.enqueueReplaceState(t,t.state,null)}function ba(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 ah(e){Ki(e)}function lh(e){console.error(e)}function ih(e){Ki(e)}function ps(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function sh(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 Vu(e,t,n){return n=Ln(n),n.tag=3,n.payload={element:null},n.callback=function(){ps(e,t)},n}function rh(e){return e=Ln(e),e.tag=3,e}function uh(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(){sh(t,n,a)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){sh(t,n,a),typeof u!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function Ty(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ka(t,n,u,!0),n=Et.current,n!==null){switch(n.tag){case 31:case 13:return Ut===null?Cs():n.alternate===null&&Qe===0&&(Qe=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===ns?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),dc(e,a,u)),!1;case 22:return n.flags|=65536,a===ns?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)),dc(e,a,u)),!1}throw Error(r(435,n.tag))}return dc(e,a,u),Cs(),!1}if(Se)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==su&&(e=Error(r(422),{cause:a}),Bl(kt(e,n)))):(a!==su&&(t=Error(r(423),{cause:a}),Bl(kt(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=kt(a,n),u=Vu(e.stateNode,a,u),yu(e,u),Qe!==4&&(Qe=2)),!1;var c=Error(r(520),{cause:a});if(c=kt(c,n),ni===null?ni=[c]:ni.push(c),Qe!==4&&(Qe=2),t===null)return!0;a=kt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Vu(n.stateNode,a,e),yu(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"&&(Xn===null||!Xn.has(c))))return n.flags|=65536,u&=-u,n.lanes|=u,u=rh(u),uh(u,e,n,a),yu(n,u),!1}n=n.return}while(n!==null);return!1}var Yu=Error(r(461)),Ie=!1;function ut(e,t,n,a){t.child=e===null?dd(t,null,n,a):va(t,e.child,n,a)}function ch(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 ma(t),a=qu(e,t,n,h,c,u),x=ju(),e!==null&&!Ie?(Eu(e,t,u),pn(e,t,u)):(Se&&x&&lu(t),t.flags|=1,ut(e,t,a,u),t.child)}function oh(e,t,n,a,u){if(e===null){var c=n.type;return typeof c=="function"&&!tu(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,fh(e,t,c,a,u)):(e=Fi(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Fu(e,u)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Dl,n(h,a)&&e.ref===t.ref)return pn(e,t,u)}return t.flags|=1,e=cn(c,a),e.ref=t.ref,e.return=t,t.child=e}function fh(e,t,n,a,u){if(e!==null){var c=e.memoizedProps;if(Dl(c,a)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=a=c,Fu(e,u))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,pn(e,t,u)}return Gu(e,t,n,a,u)}function dh(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 hh(e,t,c,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&es(t,c!==null?c.cachePool:null),c!==null?pd(t,c):xu(),gd(t);else return a=t.lanes=536870912,hh(e,t,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(es(t,c.cachePool),pd(t,c),Vn(),t.memoizedState=null):(e!==null&&es(t,null),xu(),Vn());return ut(e,t,u,n),t.child}function Jl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hh(e,t,n,a,u){var c=hu();return c=c===null?null:{parent:Fe._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&es(t,null),xu(),gd(t),e!==null&&Ka(e,t,a,!0),t.childLanes=u,null}function gs(e,t){return t=vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mh(e,t,n){return va(t,e.child,null,n),e=gs(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function My(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(a.mode==="hidden")return e=gs(t,a),t.lanes=536870912,Jl(null,e);if(Au(t),(e=ze)?(e=Nm(e,Lt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:Ft,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},n=Wf(e),n.return=t,t.child=n,st=t,ze=null)):e=null,e===null)throw kn(t);return t.lanes=536870912,null}return gs(t,a)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(Au(t),u)if(t.flags&256)t.flags&=-257,t=mh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Ie||Ka(e,t,n,!1),u=(n&e.childLanes)!==0,Ie||u){if(a=De,a!==null&&(h=af(a,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,oa(e,h),xt(a,e,h),Yu;Cs(),t=mh(e,t,n)}else e=c.treeContext,ze=Ht(h.nextSibling),st=t,Se=!0,Dn=null,Lt=!1,e!==null&&ed(t,e),t=gs(t,a),t.flags|=4096;return t}return e=cn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ys(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 Gu(e,t,n,a,u){return ma(t),n=qu(e,t,n,a,void 0,u),a=ju(),e!==null&&!Ie?(Eu(e,t,u),pn(e,t,u)):(Se&&a&&lu(t),t.flags|=1,ut(e,t,n,u),t.child)}function ph(e,t,n,a,u,c){return ma(t),t.updateQueue=null,n=vd(t,a,n,u),yd(e),a=ju(),e!==null&&!Ie?(Eu(e,t,c),pn(e,t,c)):(Se&&a&&lu(t),t.flags|=1,ut(e,t,n,c),t.child)}function gh(e,t,n,a,u){if(ma(t),t.stateNode===null){var c=Ya,h=n.contextType;typeof h=="object"&&h!==null&&(c=rt(h)),c=new n(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Hu,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},pu(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?rt(h):Ya,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Uu(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&&Hu.enqueueReplaceState(c,c.state,null),Ql(t,a,c,u),Gl(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var x=t.memoizedProps,j=ba(n,x);c.props=j;var D=c.context,H=n.contextType;h=Ya,typeof H=="object"&&H!==null&&(h=rt(H));var Q=n.getDerivedStateFromProps;H=typeof Q=="function"||typeof c.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,H||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x||D!==h)&&nh(t,c,a,h),Bn=!1;var k=t.memoizedState;c.state=k,Ql(t,a,c,u),Gl(),D=t.memoizedState,x||k!==D||Bn?(typeof Q=="function"&&(Uu(t,n,Q,a),D=t.memoizedState),(j=Bn||th(t,n,j,a,k,D,h))?(H||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=D),c.props=a,c.state=D,c.context=h,a=j):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,gu(e,t),h=t.memoizedProps,H=ba(n,h),c.props=H,Q=t.pendingProps,k=c.context,D=n.contextType,j=Ya,typeof D=="object"&&D!==null&&(j=rt(D)),x=n.getDerivedStateFromProps,(D=typeof x=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==Q||k!==j)&&nh(t,c,a,j),Bn=!1,k=t.memoizedState,c.state=k,Ql(t,a,c,u),Gl();var L=t.memoizedState;h!==Q||k!==L||Bn||e!==null&&e.dependencies!==null&&Ii(e.dependencies)?(typeof x=="function"&&(Uu(t,n,x,a),L=t.memoizedState),(H=Bn||th(t,n,H,a,k,L,j)||e!==null&&e.dependencies!==null&&Ii(e.dependencies))?(D||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,L,j),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,L,j)),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=L),c.props=a,c.state=L,c.context=j,a=H):(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,ys(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=va(t,e.child,null,u),t.child=va(t,null,n,u)):ut(e,t,n,u),t.memoizedState=c.state,e=t.child):e=pn(e,t,u),e}function yh(e,t,n,a){return da(),t.flags|=256,ut(e,t,n,a),t.child}var Qu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xu(e){return{baseLanes:e,cachePool:sd()}}function Ku(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=wt),e}function vh(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:(Ze.current&2)!==0),h&&(u=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(u?Hn(t):Vn(),(e=ze)?(e=Nm(e,Lt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:Ft,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},n=Wf(e),n.return=t,t.child=n,st=t,ze=null)):e=null,e===null)throw kn(t);return wc(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,u?(Vn(),u=t.mode,x=vs({mode:"hidden",children:x},u),a=fa(a,u,n,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Xu(n),a.childLanes=Ku(e,h,n),t.memoizedState=Qu,Jl(null,a)):(Hn(t),Zu(t,x))}var j=e.memoizedState;if(j!==null&&(x=j.dehydrated,x!==null)){if(c)t.flags&256?(Hn(t),t.flags&=-257,t=$u(e,t,n)):t.memoizedState!==null?(Vn(),t.child=e.child,t.flags|=128,t=null):(Vn(),x=a.fallback,u=t.mode,a=vs({mode:"visible",children:a.children},u),x=fa(x,u,n,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,va(t,e.child,null,n),a=t.child,a.memoizedState=Xu(n),a.childLanes=Ku(e,h,n),t.memoizedState=Qu,t=Jl(null,a));else if(Hn(t),wc(x)){if(h=x.nextSibling&&x.nextSibling.dataset,h)var D=h.dgst;h=D,a=Error(r(419)),a.stack="",a.digest=h,Bl({value:a,source:null,stack:null}),t=$u(e,t,n)}else if(Ie||Ka(e,t,n,!1),h=(n&e.childLanes)!==0,Ie||h){if(h=De,h!==null&&(a=af(h,n),a!==0&&a!==j.retryLane))throw j.retryLane=a,oa(e,a),xt(h,e,a),Yu;Cc(x)||Cs(),t=$u(e,t,n)}else Cc(x)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,ze=Ht(x.nextSibling),st=t,Se=!0,Dn=null,Lt=!1,e!==null&&ed(t,e),t=Zu(t,a.children),t.flags|=4096);return t}return u?(Vn(),x=a.fallback,u=t.mode,j=e.child,D=j.sibling,a=cn(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,D!==null?x=cn(D,x):(x=fa(x,u,n,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Jl(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Xu(n):(u=x.cachePool,u!==null?(j=Fe._currentValue,u=u.parent!==j?{parent:j,pool:j}:u):u=sd(),x={baseLanes:x.baseLanes|n,cachePool:u}),a.memoizedState=x,a.childLanes=Ku(e,h,n),t.memoizedState=Qu,Jl(e.child,a)):(Hn(t),n=e.child,e=n.sibling,n=cn(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 Zu(e,t){return t=vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vs(e,t){return e=jt(22,e,null,t),e.lanes=0,e}function $u(e,t,n){return va(t,e.child,null,n),e=Zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xh(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),cu(e.return,t,n)}function Ju(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 bh(e,t,n){var a=t.pendingProps,u=a.revealOrder,c=a.tail;a=a.children;var h=Ze.current,x=(h&2)!==0;if(x?(h=h&1|2,t.flags|=128):h&=1,X(Ze,h),ut(e,t,a,n),a=Se?zl:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xh(e,n,t);else if(e.tag===19)xh(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&&ss(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Ju(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&&ss(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Ju(t,!0,n,null,c,a);break;case"together":Ju(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ka(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=cn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ii(e)))}function Ry(e,t,n){switch(t.tag){case 3:Ye(t,t.stateNode.containerInfo),zn(t,Fe,e.memoizedState.cache),da();break;case 27:case 5:an(t);break;case 4:Ye(t,t.stateNode.containerInfo);break;case 10:zn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Au(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Hn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?vh(e,t,n):(Hn(t),e=pn(e,t,n),e!==null?e.sibling:null);Hn(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ka(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return bh(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),X(Ze,Ze.current),a)break;return null;case 22:return t.lanes=0,dh(e,t,n,t.pendingProps);case 24:zn(t,Fe,e.memoizedState.cache)}return pn(e,t,n)}function Ah(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!Fu(e,n)&&(t.flags&128)===0)return Ie=!1,Ry(e,t,n);Ie=(e.flags&131072)!==0}else Ie=!1,Se&&(t.flags&1048576)!==0&&Pf(t,zl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e=="function")tu(e)?(a=ba(e,a),t.tag=1,t=gh(null,t,e,a,n)):(t.tag=0,t=Gu(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===F){t.tag=11,t=ch(null,t,e,a,n);break e}else if(u===V){t.tag=14,t=oh(null,t,e,a,n);break e}}throw t=te(e)||e,Error(r(306,t,""))}}return t;case 0:return Gu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=ba(a,t.pendingProps),gh(e,t,a,u,n);case 3:e:{if(Ye(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var c=t.memoizedState;u=c.element,gu(e,t),Ql(t,a,null,n);var h=t.memoizedState;if(a=h.cache,zn(t,Fe,a),a!==c.cache&&ou(t,[Fe],n,!0),Gl(),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=yh(e,t,a,n);break e}else if(a!==u){u=kt(Error(r(424)),t),Bl(u),t=yh(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(ze=Ht(e.firstChild),st=t,Se=!0,Dn=null,Lt=!0,n=dd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(da(),a===u){t=pn(e,t,n);break e}ut(e,t,a,n)}t=t.child}return t;case 26:return ys(e,t),e===null?(n=_m(t.type,null,t.pendingProps,null))?t.memoizedState=n:Se||(n=t.type,e=t.pendingProps,a=Ds(se.current).createElement(n),a[it]=t,a[ht]=e,ct(a,n,e),at(a),t.stateNode=a):t.memoizedState=_m(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return an(t),e===null&&Se&&(a=t.stateNode=Tm(t.type,t.pendingProps,se.current),st=t,Lt=!0,u=ze,Jn(t.type)?(Tc=u,ze=Ht(a.firstChild)):ze=u),ut(e,t,t.pendingProps.children,n),ys(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((u=a=ze)&&(a=rv(a,t.type,t.pendingProps,Lt),a!==null?(t.stateNode=a,st=t,ze=Ht(a.firstChild),Lt=!1,u=!0):u=!1),u||kn(t)),an(t),u=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,a=c.children,jc(u,c)?a=null:h!==null&&jc(u,h)&&(t.flags|=32),t.memoizedState!==null&&(u=qu(e,t,Sy,null,null,n),oi._currentValue=u),ys(e,t),ut(e,t,a,n),t.child;case 6:return e===null&&Se&&((e=n=ze)&&(n=uv(n,t.pendingProps,Lt),n!==null?(t.stateNode=n,st=t,ze=null,e=!0):e=!1),e||kn(t)),null;case 13:return vh(e,t,n);case 4:return Ye(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=va(t,null,a,n):ut(e,t,a,n),t.child;case 11:return ch(e,t,t.type,t.pendingProps,n);case 7:return ut(e,t,t.pendingProps,n),t.child;case 8:return ut(e,t,t.pendingProps.children,n),t.child;case 12:return ut(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,zn(t,t.type,a.value),ut(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,ma(t),u=rt(u),a=a(u),t.flags|=1,ut(e,t,a,n),t.child;case 14:return oh(e,t,t.type,t.pendingProps,n);case 15:return fh(e,t,t.type,t.pendingProps,n);case 19:return bh(e,t,n);case 31:return My(e,t,n);case 22:return dh(e,t,n,t.pendingProps);case 24:return ma(t),a=rt(Fe),e===null?(u=hu(),u===null&&(u=De,c=fu(),u.pooledCache=c,c.refCount++,c!==null&&(u.pooledCacheLanes|=n),u=c),t.memoizedState={parent:a,cache:u},pu(t),zn(t,Fe,u)):((e.lanes&n)!==0&&(gu(e,t),Ql(t,null,null,n),Gl()),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),zn(t,Fe,a)):(a=c.cache,zn(t,Fe,a),a!==u.cache&&ou(t,[Fe],n,!0))),ut(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function gn(e){e.flags|=4}function Wu(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($h())e.flags|=8192;else throw ya=ns,mu}else e.flags&=-16777217}function Sh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bm(t))if($h())e.flags|=8192;else throw ya=ns,mu}function xs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ef():536870912,e.lanes|=t,ll|=t)}function Fl(e,t){if(!Se)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 Be(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 _y(e,t,n){var a=t.pendingProps;switch(iu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),dn(Fe),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Xa(t)?gn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ru())),Be(t),null;case 26:var u=t.type,c=t.memoizedState;return e===null?(gn(t),c!==null?(Be(t),Sh(t,c)):(Be(t),Wu(t,u,null,a,n))):c?c!==e.memoizedState?(gn(t),Be(t),Sh(t,c)):(Be(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&gn(t),Be(t),Wu(t,u,e,a,n)),null;case 27:if(Tn(t),n=se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&gn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Be(t),null}e=K.current,Xa(t)?td(t):(e=Tm(u,a,n),t.stateNode=e,gn(t))}return Be(t),null;case 5:if(Tn(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&gn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Be(t),null}if(c=K.current,Xa(t))td(t);else{var h=Ds(se.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[it]=t,c[ht]=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(ct(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&&gn(t)}}return Be(t),Wu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&gn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=se.current,Xa(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=st,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||vm(e.nodeValue,n)),e||kn(t,!0)}else e=Ds(e).createTextNode(a),e[it]=t,t.stateNode=e}return Be(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Xa(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[it]=t}else da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),e=!1}else n=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Be(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Xa(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[it]=t}else da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),u=!1}else u=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(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),xs(t,t.updateQueue),Be(t),null);case 4:return Oe(),e===null&&xc(t.stateNode.containerInfo),Be(t),null;case 10:return dn(t.type),Be(t),null;case 19:if(U(Ze),a=t.memoizedState,a===null)return Be(t),null;if(u=(t.flags&128)!==0,c=a.rendering,c===null)if(u)Fl(a,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ss(e),c!==null){for(t.flags|=128,Fl(a,!1),e=c.updateQueue,t.updateQueue=e,xs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ff(n,e),n=n.sibling;return X(Ze,Ze.current&1|2),Se&&on(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&bt()>js&&(t.flags|=128,u=!0,Fl(a,!1),t.lanes=4194304)}else{if(!u)if(e=ss(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,xs(t,e),Fl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!Se)return Be(t),null}else 2*bt()-a.renderingStartTime>js&&n!==536870912&&(t.flags|=128,u=!0,Fl(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=bt(),e.sibling=null,n=Ze.current,X(Ze,u?n&1|2:n&1),Se&&on(t,a.treeForkCount),e):(Be(t),null);case 22:case 23:return Nt(t),bu(),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&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),n=t.updateQueue,n!==null&&xs(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(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),dn(Fe),Be(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Oy(e,t){switch(iu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dn(Fe),Oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Tn(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(r(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Ze),null;case 4:return Oe(),null;case 10:return dn(t.type),null;case 22:case 23:return Nt(t),bu(),e!==null&&U(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return dn(Fe),null;case 25:return null;default:return null}}function qh(e,t){switch(iu(t),t.tag){case 3:dn(Fe),Oe();break;case 26:case 27:case 5:Tn(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:U(Ze);break;case 10:dn(t.type);break;case 22:case 23:Nt(t),bu(),e!==null&&U(pa);break;case 24:dn(Fe)}}function Wl(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){Te(t,t.return,x)}}function Yn(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 j=n,D=x;try{D()}catch(H){Te(u,j,H)}}}a=a.next}while(a!==c)}}catch(H){Te(t,t.return,H)}}function jh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{md(t,n)}catch(a){Te(e,e.return,a)}}}function Eh(e,t,n){n.props=ba(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Te(e,t,a)}}function Il(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){Te(e,t,u)}}function It(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){Te(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){Te(e,t,u)}else n.current=null}function Nh(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){Te(e,e.return,u)}}function Iu(e,t,n){try{var a=e.stateNode;tv(a,e.type,n,t),a[ht]=t}catch(u){Te(e,e.return,u)}}function Ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Jn(e.type)||e.tag===4}function Pu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ch(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&&Jn(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 ec(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=rn));else if(a!==4&&(a===27&&Jn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ec(e,t,n),e=e.sibling;e!==null;)ec(e,t,n),e=e.sibling}function bs(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&&Jn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(bs(e,t,n),e=e.sibling;e!==null;)bs(e,t,n),e=e.sibling}function wh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);ct(t,a,n),t[it]=e,t[ht]=n}catch(c){Te(e,e.return,c)}}var yn=!1,Pe=!1,tc=!1,Th=typeof WeakSet=="function"?WeakSet:Set,lt=null;function Dy(e,t){if(e=e.containerInfo,Sc=Vs,e=Vf(e),$r(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,j=-1,D=0,H=0,Q=e,k=null;t:for(;;){for(var L;Q!==n||u!==0&&Q.nodeType!==3||(x=h+u),Q!==c||a!==0&&Q.nodeType!==3||(j=h+a),Q.nodeType===3&&(h+=Q.nodeValue.length),(L=Q.firstChild)!==null;)k=Q,Q=L;for(;;){if(Q===e)break t;if(k===n&&++D===u&&(x=h),k===c&&++H===a&&(j=h),(L=Q.nextSibling)!==null)break;Q=k,k=Q.parentNode}Q=L}n=x===-1||j===-1?null:{start:x,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(qc={focusedElem:e,selectionRange:n},Vs=!1,lt=t;lt!==null;)if(t=lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,lt=e;else for(;lt!==null;){switch(t=lt,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=ba(n.type,u);e=a.getSnapshotBeforeUpdate(ae,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(ce){Te(n,n.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(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,lt=e;break}lt=t.return}}function Mh(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:xn(e,n),a&4&&Wl(5,n);break;case 1:if(xn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Te(n,n.return,h)}else{var u=ba(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Te(n,n.return,h)}}a&64&&jh(n),a&512&&Il(n,n.return);break;case 3:if(xn(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{md(e,t)}catch(h){Te(n,n.return,h)}}break;case 27:t===null&&a&4&&wh(n);case 26:case 5:xn(e,n),t===null&&a&4&&Nh(n),a&512&&Il(n,n.return);break;case 12:xn(e,n);break;case 31:xn(e,n),a&4&&Oh(e,n);break;case 13:xn(e,n),a&4&&Dh(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Gy.bind(null,n),cv(e,n))));break;case 22:if(a=n.memoizedState!==null||yn,!a){t=t!==null&&t.memoizedState!==null||Pe,u=yn;var c=Pe;yn=a,(Pe=t)&&!c?bn(e,n,(n.subtreeFlags&8772)!==0):xn(e,n),yn=u,Pe=c}break;case 30:break;default:xn(e,n)}}function Rh(e){var t=e.alternate;t!==null&&(e.alternate=null,Rh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Le=null,pt=!1;function vn(e,t,n){for(n=n.child;n!==null;)_h(e,t,n),n=n.sibling}function _h(e,t,n){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 26:Pe||It(n,t),vn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Pe||It(n,t);var a=Le,u=pt;Jn(n.type)&&(Le=n.stateNode,pt=!1),vn(e,t,n),ri(n.stateNode),Le=a,pt=u;break;case 5:Pe||It(n,t);case 6:if(a=Le,u=pt,Le=null,vn(e,t,n),Le=a,pt=u,Le!==null)if(pt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(c){Te(n,t,c)}else try{Le.removeChild(n.stateNode)}catch(c){Te(n,t,c)}break;case 18:Le!==null&&(pt?(e=Le,jm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),dl(e)):jm(Le,n.stateNode));break;case 4:a=Le,u=pt,Le=n.stateNode.containerInfo,pt=!0,vn(e,t,n),Le=a,pt=u;break;case 0:case 11:case 14:case 15:Yn(2,n,t),Pe||Yn(4,n,t),vn(e,t,n);break;case 1:Pe||(It(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Eh(n,t,a)),vn(e,t,n);break;case 21:vn(e,t,n);break;case 22:Pe=(a=Pe)||n.memoizedState!==null,vn(e,t,n),Pe=a;break;default:vn(e,t,n)}}function Oh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{dl(e)}catch(n){Te(t,t.return,n)}}}function Dh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{dl(e)}catch(n){Te(t,t.return,n)}}function ky(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Th),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Th),t;default:throw Error(r(435,e.tag))}}function As(e,t){var n=ky(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=Qy.bind(null,e,a);a.then(u,u)}})}function gt(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(Jn(x.type)){Le=x.stateNode,pt=!1;break e}break;case 5:Le=x.stateNode,pt=!1;break e;case 3:case 4:Le=x.stateNode.containerInfo,pt=!0;break e}x=x.return}if(Le===null)throw Error(r(160));_h(c,h,u),Le=null,pt=!1,c=u.alternate,c!==null&&(c.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kh(t,e),t=t.sibling}var Kt=null;function kh(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),yt(e),a&4&&(Yn(3,e,e.return),Wl(3,e),Yn(5,e,e.return));break;case 1:gt(t,e),yt(e),a&512&&(Pe||n===null||It(n,n.return)),a&64&&yn&&(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=Kt;if(gt(t,e),yt(e),a&512&&(Pe||n===null||It(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[El]||c[it]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=u.createElement(a),u.head.insertBefore(c,u.querySelector("head > title"))),ct(c,a,n),c[it]=e,at(c),a=c;break e;case"link":var h=km("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),ct(c,a,n),u.head.appendChild(c);break;case"meta":if(h=km("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),ct(c,a,n),u.head.appendChild(c);break;default:throw Error(r(468,a))}c[it]=e,at(c),a=c}e.stateNode=a}else zm(u,e.type,e.stateNode);else e.stateNode=Dm(u,a,e.memoizedProps);else c!==a?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,a===null?zm(u,e.type,e.stateNode):Dm(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Iu(e,e.memoizedProps,n.memoizedProps)}break;case 27:gt(t,e),yt(e),a&512&&(Pe||n===null||It(n,n.return)),n!==null&&a&4&&Iu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gt(t,e),yt(e),a&512&&(Pe||n===null||It(n,n.return)),e.flags&32){u=e.stateNode;try{ka(u,"")}catch(ae){Te(e,e.return,ae)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Iu(e,u,n!==null?n.memoizedProps:u)),a&1024&&(tc=!0);break;case 6:if(gt(t,e),yt(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(ae){Te(e,e.return,ae)}}break;case 3:if(Bs=null,u=Kt,Kt=ks(t.containerInfo),gt(t,e),Kt=u,yt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{dl(t.containerInfo)}catch(ae){Te(e,e.return,ae)}tc&&(tc=!1,zh(e));break;case 4:a=Kt,Kt=ks(e.stateNode.containerInfo),gt(t,e),yt(e),Kt=a;break;case 12:gt(t,e),yt(e);break;case 31:gt(t,e),yt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,As(e,a)));break;case 13:gt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qs=bt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,As(e,a)));break;case 22:u=e.memoizedState!==null;var j=n!==null&&n.memoizedState!==null,D=yn,H=Pe;if(yn=D||u,Pe=H||j,gt(t,e),Pe=H,yn=D,yt(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||j||yn||Pe||Aa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(c=j.stateNode,u)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{x=j.stateNode;var Q=j.memoizedProps.style,k=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;x.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(ae){Te(j,j.return,ae)}}}else if(t.tag===6){if(n===null){j=t;try{j.stateNode.nodeValue=u?"":j.memoizedProps}catch(ae){Te(j,j.return,ae)}}}else if(t.tag===18){if(n===null){j=t;try{var L=j.stateNode;u?Em(L,!0):Em(j.stateNode,!1)}catch(ae){Te(j,j.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,As(e,n))));break;case 19:gt(t,e),yt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,As(e,a)));break;case 30:break;case 21:break;default:gt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Ch(a)){n=a;break}a=a.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var u=n.stateNode,c=Pu(e);bs(e,c,u);break;case 5:var h=n.stateNode;n.flags&32&&(ka(h,""),n.flags&=-33);var x=Pu(e);bs(e,x,h);break;case 3:case 4:var j=n.stateNode.containerInfo,D=Pu(e);ec(e,D,j);break;default:throw Error(r(161))}}catch(H){Te(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mh(e,t.alternate,t),t=t.sibling}function Aa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yn(4,t,t.return),Aa(t);break;case 1:It(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Eh(t,t.return,n),Aa(t);break;case 27:ri(t.stateNode);case 26:case 5:It(t,t.return),Aa(t);break;case 22:t.memoizedState===null&&Aa(t);break;case 30:Aa(t);break;default:Aa(t)}e=e.sibling}}function bn(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:bn(u,c,n),Wl(4,c);break;case 1:if(bn(u,c,n),a=c,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(D){Te(a,a.return,D)}if(a=c,u=a.updateQueue,u!==null){var x=a.stateNode;try{var j=u.shared.hiddenCallbacks;if(j!==null)for(u.shared.hiddenCallbacks=null,u=0;u<j.length;u++)hd(j[u],x)}catch(D){Te(a,a.return,D)}}n&&h&64&&jh(c),Il(c,c.return);break;case 27:wh(c);case 26:case 5:bn(u,c,n),n&&a===null&&h&4&&Nh(c),Il(c,c.return);break;case 12:bn(u,c,n);break;case 31:bn(u,c,n),n&&h&4&&Oh(u,c);break;case 13:bn(u,c,n),n&&h&4&&Dh(u,c);break;case 22:c.memoizedState===null&&bn(u,c,n),Il(c,c.return);break;case 30:break;default:bn(u,c,n)}t=t.sibling}}function nc(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&&Ll(n))}function ac(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ll(e))}function Zt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Bh(e,t,n,a),t=t.sibling}function Bh(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Zt(e,t,n,a),u&2048&&Wl(9,t);break;case 1:Zt(e,t,n,a);break;case 3:Zt(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&&Ll(e)));break;case 12:if(u&2048){Zt(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(j){Te(t,t.return,j)}}else Zt(e,t,n,a);break;case 31:Zt(e,t,n,a);break;case 13:Zt(e,t,n,a);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Zt(e,t,n,a):Pl(e,t):c._visibility&2?Zt(e,t,n,a):(c._visibility|=2,tl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&nc(h,t);break;case 24:Zt(e,t,n,a),u&2048&&ac(t.alternate,t);break;default:Zt(e,t,n,a)}}function tl(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,j=a,D=h.flags;switch(h.tag){case 0:case 11:case 15:tl(c,h,x,j,u),Wl(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?tl(c,h,x,j,u):Pl(c,h):(H._visibility|=2,tl(c,h,x,j,u)),u&&D&2048&&nc(h.alternate,h);break;case 24:tl(c,h,x,j,u),u&&D&2048&&ac(h.alternate,h);break;default:tl(c,h,x,j,u)}t=t.sibling}}function Pl(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:Pl(n,a),u&2048&&nc(a.alternate,a);break;case 24:Pl(n,a),u&2048&&ac(a.alternate,a);break;default:Pl(n,a)}t=t.sibling}}var ei=8192;function nl(e,t,n){if(e.subtreeFlags&ei)for(e=e.child;e!==null;)Lh(e,t,n),e=e.sibling}function Lh(e,t,n){switch(e.tag){case 26:nl(e,t,n),e.flags&ei&&e.memoizedState!==null&&Av(n,Kt,e.memoizedState,e.memoizedProps);break;case 5:nl(e,t,n);break;case 3:case 4:var a=Kt;Kt=ks(e.stateNode.containerInfo),nl(e,t,n),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ei,ei=16777216,nl(e,t,n),ei=a):nl(e,t,n));break;default:nl(e,t,n)}}function Uh(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 ti(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];lt=a,Vh(a,e)}Uh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hh(e),e=e.sibling}function Hh(e){switch(e.tag){case 0:case 11:case 15:ti(e),e.flags&2048&&Yn(9,e,e.return);break;case 3:ti(e);break;case 12:ti(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ss(e)):ti(e);break;default:ti(e)}}function Ss(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];lt=a,Vh(a,e)}Uh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yn(8,t,t.return),Ss(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ss(t));break;default:Ss(t)}e=e.sibling}}function Vh(e,t){for(;lt!==null;){var n=lt;switch(n.tag){case 0:case 11:case 15:Yn(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:Ll(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,lt=a;else e:for(n=e;lt!==null;){a=lt;var u=a.sibling,c=a.return;if(Rh(a),a===n){lt=null;break e}if(u!==null){u.return=c,lt=u;break e}lt=c}}}var zy={getCacheForType:function(e){var t=rt(Fe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return rt(Fe).controller.signal}},By=typeof WeakMap=="function"?WeakMap:Map,Ce=0,De=null,ge=null,ve=0,we=0,Ct=null,Gn=!1,al=!1,lc=!1,An=0,Qe=0,Qn=0,Sa=0,ic=0,wt=0,ll=0,ni=null,vt=null,sc=!1,qs=0,Yh=0,js=1/0,Es=null,Xn=null,nt=0,Kn=null,il=null,Sn=0,rc=0,uc=null,Gh=null,ai=0,cc=null;function Tt(){return(Ce&2)!==0&&ve!==0?ve&-ve:z.T!==null?pc():lf()}function Qh(){if(wt===0)if((ve&536870912)===0||Se){var e=Oi;Oi<<=1,(Oi&3932160)===0&&(Oi=262144),wt=e}else wt=536870912;return e=Et.current,e!==null&&(e.flags|=32),wt}function xt(e,t,n){(e===De&&(we===2||we===9)||e.cancelPendingCommit!==null)&&(sl(e,0),Zn(e,ve,wt,!1)),jl(e,n),((Ce&2)===0||e!==De)&&(e===De&&((Ce&2)===0&&(Sa|=n),Qe===4&&Zn(e,ve,wt,!1)),Pt(e))}function Xh(e,t,n){if((Ce&6)!==0)throw Error(r(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ql(e,t),u=a?Hy(e,t):fc(e,t,!0),c=a;do{if(u===0){al&&!a&&Zn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Ly(n)){u=fc(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=ni;var j=x.current.memoizedState.isDehydrated;if(j&&(sl(x,h).flags|=256),h=fc(x,h,!1),h!==2){if(lc&&!j){x.errorRecoveryDisabledLanes|=c,Sa|=c,u=4;break e}c=vt,vt=u,c!==null&&(vt===null?vt=c:vt.push.apply(vt,c))}u=h}if(c=!1,u!==2)continue}}if(u===1){sl(e,0),Zn(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:Zn(a,t,wt,!Gn);break e;case 2:vt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(u=qs+300-bt(),10<u)){if(Zn(a,t,wt,!Gn),ki(a,0,!0)!==0)break e;Sn=t,a.timeoutHandle=Sm(Kh.bind(null,a,n,vt,Es,sc,t,wt,Sa,ll,Gn,c,"Throttled",-0,0),u);break e}Kh(a,n,vt,Es,sc,t,wt,Sa,ll,Gn,c,null,-0,0)}}break}while(!0);Pt(e)}function Kh(e,t,n,a,u,c,h,x,j,D,H,Q,k,L){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rn},Lh(t,c,Q);var ae=(c&62914560)===c?qs-bt():(c&4194048)===c?Yh-bt():0;if(ae=Sv(Q,ae),ae!==null){Sn=c,e.cancelPendingCommit=ae(em.bind(null,e,t,c,n,a,u,h,x,j,H,Q,null,k,L)),Zn(e,c,h,!D);return}}em(e,t,c,n,a,u,h,x,j)}function Ly(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(!qt(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 Zn(e,t,n,a){t&=~ic,t&=~Sa,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var c=31-St(u),h=1<<c;a[c]=-1,u&=~h}n!==0&&tf(e,n,t)}function Ns(){return(Ce&6)===0?(li(0),!1):!0}function oc(){if(ge!==null){if(we===0)var e=ge.return;else e=ge,fn=ha=null,Nu(e),Fa=null,Hl=0,e=ge;for(;e!==null;)qh(e.alternate,e),e=e.return;ge=null}}function sl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,lv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sn=0,oc(),De=e,ge=n=cn(e.current,null),ve=t,we=0,Ct=null,Gn=!1,al=ql(e,t),lc=!1,ll=wt=ic=Sa=Qn=Qe=0,vt=ni=null,sc=!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-St(a),c=1<<u;t|=e[u],a&=~c}return An=t,Zi(),n}function Zh(e,t){de=null,z.H=$l,t===Ja||t===ts?(t=cd(),we=3):t===mu?(t=cd(),we=4):we=t===Yu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ct=t,ge===null&&(Qe=1,ps(e,kt(t,e.current)))}function $h(){var e=Et.current;return e===null?!0:(ve&4194048)===ve?Ut===null:(ve&62914560)===ve||(ve&536870912)!==0?e===Ut:!1}function Jh(){var e=z.H;return z.H=$l,e===null?$l:e}function Fh(){var e=z.A;return z.A=zy,e}function Cs(){Qe=4,Gn||(ve&4194048)!==ve&&Et.current!==null||(al=!0),(Qn&134217727)===0&&(Sa&134217727)===0||De===null||Zn(De,ve,wt,!1)}function fc(e,t,n){var a=Ce;Ce|=2;var u=Jh(),c=Fh();(De!==e||ve!==t)&&(Es=null,sl(e,t)),t=!1;var h=Qe;e:do try{if(we!==0&&ge!==null){var x=ge,j=Ct;switch(we){case 8:oc(),h=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var D=we;if(we=0,Ct=null,rl(e,x,j,D),n&&al){h=0;break e}break;default:D=we,we=0,Ct=null,rl(e,x,j,D)}}Uy(),h=Qe;break}catch(H){Zh(e,H)}while(!0);return t&&e.shellSuspendCounter++,fn=ha=null,Ce=a,z.H=u,z.A=c,ge===null&&(De=null,ve=0,Zi()),h}function Uy(){for(;ge!==null;)Wh(ge)}function Hy(e,t){var n=Ce;Ce|=2;var a=Jh(),u=Fh();De!==e||ve!==t?(Es=null,js=bt()+500,sl(e,t)):al=ql(e,t);e:do try{if(we!==0&&ge!==null){t=ge;var c=Ct;t:switch(we){case 1:we=0,Ct=null,rl(e,t,c,1);break;case 2:case 9:if(rd(c)){we=0,Ct=null,Ih(t);break}t=function(){we!==2&&we!==9||De!==e||(we=7),Pt(e)},c.then(t,t);break e;case 3:we=7;break e;case 4:we=5;break e;case 7:rd(c)?(we=0,Ct=null,Ih(t)):(we=0,Ct=null,rl(e,t,c,7));break;case 5:var h=null;switch(ge.tag){case 26:h=ge.memoizedState;case 5:case 27:var x=ge;if(h?Bm(h):x.stateNode.complete){we=0,Ct=null;var j=x.sibling;if(j!==null)ge=j;else{var D=x.return;D!==null?(ge=D,ws(D)):ge=null}break t}}we=0,Ct=null,rl(e,t,c,5);break;case 6:we=0,Ct=null,rl(e,t,c,6);break;case 8:oc(),Qe=6;break e;default:throw Error(r(462))}}Vy();break}catch(H){Zh(e,H)}while(!0);return fn=ha=null,z.H=a,z.A=u,Ce=n,ge!==null?0:(De=null,ve=0,Zi(),Qe)}function Vy(){for(;ge!==null&&!og();)Wh(ge)}function Wh(e){var t=Ah(e.alternate,e,An);e.memoizedProps=e.pendingProps,t===null?ws(e):ge=t}function Ih(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ph(n,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=ph(n,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:Nu(t);default:qh(n,t),t=ge=Ff(t,An),t=Ah(n,t,An)}e.memoizedProps=e.pendingProps,t===null?ws(e):ge=t}function rl(e,t,n,a){fn=ha=null,Nu(t),Fa=null,Hl=0;var u=t.return;try{if(Ty(e,u,t,n,ve)){Qe=1,ps(e,kt(n,e.current)),ge=null;return}}catch(c){if(u!==null)throw ge=u,c;Qe=1,ps(e,kt(n,e.current)),ge=null;return}t.flags&32768?(Se||a===1?e=!0:al||(ve&536870912)!==0?e=!1:(Gn=e=!0,(a===2||a===9||a===3||a===6)&&(a=Et.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ph(t,e)):ws(t)}function ws(e){var t=e;do{if((t.flags&32768)!==0){Ph(t,Gn);return}e=t.return;var n=_y(t.alternate,t,An);if(n!==null){ge=n;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);Qe===0&&(Qe=5)}function Ph(e,t){do{var n=Oy(e.alternate,e);if(n!==null){n.flags&=32767,ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=n}while(e!==null);Qe=6,ge=null}function em(e,t,n,a,u,c,h,x,j){e.cancelPendingCommit=null;do Ts();while(nt!==0);if((Ce&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(c=t.lanes|t.childLanes,c|=Pr,bg(e,n,c,h,x,j),e===De&&(ge=De=null,ve=0),il=t,Kn=e,Sn=n,rc=c,uc=u,Gh=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xy(Ri,function(){return im(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=z.T,z.T=null,u=B.p,B.p=2,h=Ce,Ce|=4;try{Dy(e,t,n)}finally{Ce=h,B.p=u,z.T=a}}nt=1,tm(),nm(),am()}}function tm(){if(nt===1){nt=0;var e=Kn,t=il,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var a=B.p;B.p=2;var u=Ce;Ce|=4;try{kh(t,e);var c=qc,h=Vf(e.containerInfo),x=c.focusedElem,j=c.selectionRange;if(h!==x&&x&&x.ownerDocument&&Hf(x.ownerDocument.documentElement,x)){if(j!==null&&$r(x)){var D=j.start,H=j.end;if(H===void 0&&(H=D),"selectionStart"in x)x.selectionStart=D,x.selectionEnd=Math.min(H,x.value.length);else{var Q=x.ownerDocument||document,k=Q&&Q.defaultView||window;if(k.getSelection){var L=k.getSelection(),ae=x.textContent.length,ce=Math.min(j.start,ae),_e=j.end===void 0?ce:Math.min(j.end,ae);!L.extend&&ce>_e&&(h=_e,_e=ce,ce=h);var R=Uf(x,ce),w=Uf(x,_e);if(R&&w&&(L.rangeCount!==1||L.anchorNode!==R.node||L.anchorOffset!==R.offset||L.focusNode!==w.node||L.focusOffset!==w.offset)){var O=Q.createRange();O.setStart(R.node,R.offset),L.removeAllRanges(),ce>_e?(L.addRange(O),L.extend(w.node,w.offset)):(O.setEnd(w.node,w.offset),L.addRange(O))}}}}for(Q=[],L=x;L=L.parentNode;)L.nodeType===1&&Q.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Q.length;x++){var Y=Q[x];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Vs=!!Sc,qc=Sc=null}finally{Ce=u,B.p=a,z.T=n}}e.current=t,nt=2}}function nm(){if(nt===2){nt=0;var e=Kn,t=il,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var a=B.p;B.p=2;var u=Ce;Ce|=4;try{Mh(e,t.alternate,t)}finally{Ce=u,B.p=a,z.T=n}}nt=3}}function am(){if(nt===4||nt===3){nt=0,fg();var e=Kn,t=il,n=Sn,a=Gh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?nt=5:(nt=0,il=Kn=null,lm(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Xn=null),Tr(n),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Sl,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=z.T,u=B.p,B.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,B.p=u}}(Sn&3)!==0&&Ts(),Pt(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===cc?ai++:(ai=0,cc=e):ai=0,li(0)}}function lm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ll(t)))}function Ts(){return tm(),nm(),am(),im()}function im(){if(nt!==5)return!1;var e=Kn,t=rc;rc=0;var n=Tr(Sn),a=z.T,u=B.p;try{B.p=32>n?32:n,z.T=null,n=uc,uc=null;var c=Kn,h=Sn;if(nt=0,il=Kn=null,Sn=0,(Ce&6)!==0)throw Error(r(331));var x=Ce;if(Ce|=4,Hh(c.current),Bh(c,c.current,h,n),Ce=x,li(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Sl,c)}catch{}return!0}finally{B.p=u,z.T=a,lm(e,t)}}function sm(e,t,n){t=kt(n,t),t=Vu(e.stateNode,t,2),e=Un(e,t,2),e!==null&&(jl(e,2),Pt(e))}function Te(e,t,n){if(e.tag===3)sm(e,e,n);else for(;t!==null;){if(t.tag===3){sm(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Xn===null||!Xn.has(a))){e=kt(n,e),n=rh(2),a=Un(t,n,2),a!==null&&(uh(n,a,t,e),jl(a,2),Pt(a));break}}t=t.return}}function dc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new By;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)||(lc=!0,u.add(n),e=Yy.bind(null,e,t,n),t.then(e,e))}function Yy(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,De===e&&(ve&n)===n&&(Qe===4||Qe===3&&(ve&62914560)===ve&&300>bt()-qs?(Ce&2)===0&&sl(e,0):ic|=n,ll===ve&&(ll=0)),Pt(e)}function rm(e,t){t===0&&(t=ef()),e=oa(e,t),e!==null&&(jl(e,t),Pt(e))}function Gy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rm(e,n)}function Qy(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),rm(e,n)}function Xy(e,t){return Er(e,t)}var Ms=null,ul=null,hc=!1,Rs=!1,mc=!1,$n=0;function Pt(e){e!==ul&&e.next===null&&(ul===null?Ms=ul=e:ul=ul.next=e),Rs=!0,hc||(hc=!0,Zy())}function li(e,t){if(!mc&&Rs){mc=!0;do for(var n=!1,a=Ms;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-St(42|e)+1)-1,c&=u&~(h&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,fm(a,c))}else c=ve,c=ki(a,a===De?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||ql(a,c)||(n=!0,fm(a,c));a=a.next}while(n);mc=!1}}function Ky(){um()}function um(){Rs=hc=!1;var e=0;$n!==0&&av()&&(e=$n);for(var t=bt(),n=null,a=Ms;a!==null;){var u=a.next,c=cm(a,t);c===0?(a.next=null,n===null?Ms=u:n.next=u,u===null&&(ul=n)):(n=a,(e!==0||(c&3)!==0)&&(Rs=!0)),a=u}nt!==0&&nt!==5||li(e),$n!==0&&($n=0)}function cm(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-St(c),x=1<<h,j=u[h];j===-1?((x&n)===0||(x&a)!==0)&&(u[h]=xg(x,t)):j<=t&&(e.expiredLanes|=x),c&=~x}if(t=De,n=ve,n=ki(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(we===2||we===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Nr(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ql(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Nr(a),Tr(n)){case 2:case 8:n=Io;break;case 32:n=Ri;break;case 268435456:n=Po;break;default:n=Ri}return a=om.bind(null,e),n=Er(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Nr(a),e.callbackPriority=2,e.callbackNode=null,2}function om(e,t){if(nt!==0&&nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ts()&&e.callbackNode!==n)return null;var a=ve;return a=ki(e,e===De?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Xh(e,a,t),cm(e,bt()),e.callbackNode!=null&&e.callbackNode===n?om.bind(null,e):null)}function fm(e,t){if(Ts())return null;Xh(e,t,!0)}function Zy(){iv(function(){(Ce&6)!==0?Er(Wo,Ky):um()})}function pc(){if($n===0){var e=Za;e===0&&(e=_i,_i<<=1,(_i&261888)===0&&(_i=256)),$n=e}return $n}function dm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ui(""+e)}function hm(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 $y(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var c=dm((u[ht]||null).action),h=a.submitter;h&&(t=(t=h[ht]||null)?dm(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var x=new Gi("action","action",null,a,u);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if($n!==0){var j=h?hm(u,h):new FormData(u);ku(n,{pending:!0,data:j,method:u.method,action:c},null,j)}}else typeof c=="function"&&(x.preventDefault(),j=h?hm(u,h):new FormData(u),ku(n,{pending:!0,data:j,method:u.method,action:c},c,j))},currentTarget:u}]})}}for(var gc=0;gc<Ir.length;gc++){var yc=Ir[gc],Jy=yc.toLowerCase(),Fy=yc[0].toUpperCase()+yc.slice(1);Xt(Jy,"on"+Fy)}Xt(Qf,"onAnimationEnd"),Xt(Xf,"onAnimationIteration"),Xt(Kf,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(dy,"onTransitionRun"),Xt(hy,"onTransitionStart"),Xt(my,"onTransitionCancel"),Xt(Zf,"onTransitionEnd"),Oa("onMouseEnter",["mouseout","mouseover"]),Oa("onMouseLeave",["mouseout","mouseover"]),Oa("onPointerEnter",["pointerout","pointerover"]),Oa("onPointerLeave",["pointerout","pointerover"]),sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ii="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(" "),Wy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ii));function mm(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],j=x.instance,D=x.currentTarget;if(x=x.listener,j!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=D;try{c(u)}catch(H){Ki(H)}u.currentTarget=null,c=j}else for(h=0;h<a.length;h++){if(x=a[h],j=x.instance,D=x.currentTarget,x=x.listener,j!==c&&u.isPropagationStopped())break e;c=x,u.currentTarget=D;try{c(u)}catch(H){Ki(H)}u.currentTarget=null,c=j}}}}function ye(e,t){var n=t[Mr];n===void 0&&(n=t[Mr]=new Set);var a=e+"__bubble";n.has(a)||(pm(t,e,2,!1),n.add(a))}function vc(e,t,n){var a=0;t&&(a|=4),pm(n,e,a,t)}var _s="_reactListening"+Math.random().toString(36).slice(2);function xc(e){if(!e[_s]){e[_s]=!0,uf.forEach(function(n){n!=="selectionchange"&&(Wy.has(n)||vc(n,!1,e),vc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_s]||(t[_s]=!0,vc("selectionchange",!1,t))}}function pm(e,t,n,a){switch(Qm(t)){case 2:var u=Ev;break;case 8:u=Nv;break;default:u=Dc}n=u.bind(null,t,n,e),u=void 0,!Ur||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 bc(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 j=h.tag;if((j===3||j===4)&&h.stateNode.containerInfo===u)return;h=h.return}for(;x!==null;){if(h=Ma(x),h===null)return;if(j=h.tag,j===5||j===6||j===26||j===27){a=c=h;continue e}x=x.parentNode}}a=a.return}bf(function(){var D=c,H=Br(n),Q=[];e:{var k=$f.get(e);if(k!==void 0){var L=Gi,ae=e;switch(e){case"keypress":if(Vi(n)===0)break e;case"keydown":case"keyup":L=Qg;break;case"focusin":ae="focus",L=Gr;break;case"focusout":ae="blur",L=Gr;break;case"beforeblur":case"afterblur":L=Gr;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":L=qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=_g;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Zg;break;case Qf:case Xf:case Kf:L=kg;break;case Zf:L=Jg;break;case"scroll":case"scrollend":L=Mg;break;case"wheel":L=Wg;break;case"copy":case"cut":case"paste":L=Bg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Ef;break;case"toggle":case"beforetoggle":L=Pg}var ce=(t&4)!==0,_e=!ce&&(e==="scroll"||e==="scrollend"),R=ce?k!==null?k+"Capture":null:k;ce=[];for(var w=D,O;w!==null;){var Y=w;if(O=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||O===null||R===null||(Y=Cl(w,R),Y!=null&&ce.push(si(w,Y,O))),_e)break;w=w.return}0<ce.length&&(k=new L(k,ae,null,n,H),Q.push({event:k,listeners:ce}))}}if((t&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",k&&n!==zr&&(ae=n.relatedTarget||n.fromElement)&&(Ma(ae)||ae[Ta]))break e;if((L||k)&&(k=H.window===H?H:(k=H.ownerDocument)?k.defaultView||k.parentWindow:window,L?(ae=n.relatedTarget||n.toElement,L=D,ae=ae?Ma(ae):null,ae!==null&&(_e=d(ae),ce=ae.tag,ae!==_e||ce!==5&&ce!==27&&ce!==6)&&(ae=null)):(L=null,ae=D),L!==ae)){if(ce=qf,Y="onMouseLeave",R="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ce=Ef,Y="onPointerLeave",R="onPointerEnter",w="pointer"),_e=L==null?k:Nl(L),O=ae==null?k:Nl(ae),k=new ce(Y,w+"leave",L,n,H),k.target=_e,k.relatedTarget=O,Y=null,Ma(H)===D&&(ce=new ce(R,w+"enter",ae,n,H),ce.target=O,ce.relatedTarget=_e,Y=ce),_e=Y,L&&ae)t:{for(ce=Iy,R=L,w=ae,O=0,Y=R;Y;Y=ce(Y))O++;Y=0;for(var re=w;re;re=ce(re))Y++;for(;0<O-Y;)R=ce(R),O--;for(;0<Y-O;)w=ce(w),Y--;for(;O--;){if(R===w||w!==null&&R===w.alternate){ce=R;break t}R=ce(R),w=ce(w)}ce=null}else ce=null;L!==null&&gm(Q,k,L,ce,!1),ae!==null&&_e!==null&&gm(Q,_e,ae,ce,!0)}}e:{if(k=D?Nl(D):window,L=k.nodeName&&k.nodeName.toLowerCase(),L==="select"||L==="input"&&k.type==="file")var je=Of;else if(Rf(k))if(Df)je=cy;else{je=ry;var ie=sy}else L=k.nodeName,!L||L.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?D&&kr(D.elementType)&&(je=Of):je=uy;if(je&&(je=je(e,D))){_f(Q,je,n,H);break e}ie&&ie(e,k,D),e==="focusout"&&D&&k.type==="number"&&D.memoizedProps.value!=null&&Dr(k,"number",k.value)}switch(ie=D?Nl(D):window,e){case"focusin":(Rf(ie)||ie.contentEditable==="true")&&(Ua=ie,Jr=D,kl=null);break;case"focusout":kl=Jr=Ua=null;break;case"mousedown":Fr=!0;break;case"contextmenu":case"mouseup":case"dragend":Fr=!1,Yf(Q,n,H);break;case"selectionchange":if(fy)break;case"keydown":case"keyup":Yf(Q,n,H)}var he;if(Xr)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else La?Tf(e,n)&&(xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(xe="onCompositionStart");xe&&(Nf&&n.locale!=="ko"&&(La||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&La&&(he=Af()):(_n=H,Hr="value"in _n?_n.value:_n.textContent,La=!0)),ie=Os(D,xe),0<ie.length&&(xe=new jf(xe,e,null,n,H),Q.push({event:xe,listeners:ie}),he?xe.data=he:(he=Mf(n),he!==null&&(xe.data=he)))),(he=ty?ny(e,n):ay(e,n))&&(xe=Os(D,"onBeforeInput"),0<xe.length&&(ie=new jf("onBeforeInput","beforeinput",null,n,H),Q.push({event:ie,listeners:xe}),ie.data=he)),$y(Q,e,D,n,H)}mm(Q,t)})}function si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Os(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=Cl(e,n),u!=null&&a.unshift(si(e,u,c)),u=Cl(e,t),u!=null&&a.push(si(e,u,c))),e.tag===3)return a;e=e.return}return[]}function Iy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gm(e,t,n,a,u){for(var c=t._reactName,h=[];n!==null&&n!==a;){var x=n,j=x.alternate,D=x.stateNode;if(x=x.tag,j!==null&&j===a)break;x!==5&&x!==26&&x!==27||D===null||(j=D,u?(D=Cl(n,c),D!=null&&h.unshift(si(n,D,j))):u||(D=Cl(n,c),D!=null&&h.push(si(n,D,j)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Py=/\r\n?/g,ev=/\u0000|\uFFFD/g;function ym(e){return(typeof e=="string"?e:""+e).replace(Py,`
|
||
`).replace(ev,"")}function vm(e,t){return t=ym(t),ym(e)===t}function Re(e,t,n,a,u,c){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||ka(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&ka(e,""+a);break;case"className":Bi(e,"class",a);break;case"tabIndex":Bi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Bi(e,n,a);break;case"style":vf(e,a,c);break;case"data":if(t!=="object"){Bi(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=Ui(""+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"&&Re(e,t,"name",u.name,u,null),Re(e,t,"formEncType",u.formEncType,u,null),Re(e,t,"formMethod",u.formMethod,u,null),Re(e,t,"formTarget",u.formTarget,u,null)):(Re(e,t,"encType",u.encType,u,null),Re(e,t,"method",u.method,u,null),Re(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ui(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=rn);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=Ui(""+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),zi(e,"popover",a);break;case"xlinkActuate":sn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":sn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":sn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":sn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":sn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":sn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":sn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":sn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":sn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":zi(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=wg.get(n)||n,zi(e,n,a))}}function Ac(e,t,n,a,u,c){switch(n){case"style":vf(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"?ka(e,a):(typeof a=="number"||typeof a=="bigint")&&ka(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=rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cf.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[ht]||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,""):zi(e,n,a)}}}function ct(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:Re(e,t,c,h,n,null)}}u&&Re(e,t,"srcSet",n.srcSet,n,null),a&&Re(e,t,"src",n.src,n,null);return;case"input":ye("invalid",e);var x=c=h=u=null,j=null,D=null;for(a in n)if(n.hasOwnProperty(a)){var H=n[a];if(H!=null)switch(a){case"name":u=H;break;case"type":h=H;break;case"checked":j=H;break;case"defaultChecked":D=H;break;case"value":c=H;break;case"defaultValue":x=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,t));break;default:Re(e,t,a,H,n,null)}}mf(e,c,x,j,D,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:Re(e,t,u,x,n,null)}t=c,n=h,e.multiple=!!a,t!=null?Da(e,!!a,t,!1):n!=null&&Da(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:Re(e,t,h,x,n,null)}gf(e,a,u,c);return;case"option":for(j in n)if(n.hasOwnProperty(j)&&(a=n[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Re(e,t,j,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<ii.length;a++)ye(ii[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(D in n)if(n.hasOwnProperty(D)&&(a=n[D],a!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Re(e,t,D,a,n,null)}return;default:if(kr(t)){for(H in n)n.hasOwnProperty(H)&&(a=n[H],a!==void 0&&Ac(e,t,H,a,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(a=n[x],a!=null&&Re(e,t,x,a,n,null))}function tv(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,j=null,D=null,H=null;for(L in n){var Q=n[L];if(n.hasOwnProperty(L)&&Q!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":j=Q;default:a.hasOwnProperty(L)||Re(e,t,L,null,a,Q)}}for(var k in a){var L=a[k];if(Q=n[k],a.hasOwnProperty(k)&&(L!=null||Q!=null))switch(k){case"type":c=L;break;case"name":u=L;break;case"checked":D=L;break;case"defaultChecked":H=L;break;case"value":h=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,t));break;default:L!==Q&&Re(e,t,k,L,a,Q)}}Or(e,h,x,j,D,H,c,u);return;case"select":L=h=x=k=null;for(c in n)if(j=n[c],n.hasOwnProperty(c)&&j!=null)switch(c){case"value":break;case"multiple":L=j;default:a.hasOwnProperty(c)||Re(e,t,c,null,a,j)}for(u in a)if(c=a[u],j=n[u],a.hasOwnProperty(u)&&(c!=null||j!=null))switch(u){case"value":k=c;break;case"defaultValue":x=c;break;case"multiple":h=c;default:c!==j&&Re(e,t,u,c,a,j)}t=x,n=h,a=L,k!=null?Da(e,!!n,k,!1):!!a!=!!n&&(t!=null?Da(e,!!n,t,!0):Da(e,!!n,n?[]:"",!1));return;case"textarea":L=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:Re(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":L=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==c&&Re(e,t,h,u,a,c)}pf(e,k,L);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:Re(e,t,ae,null,a,k)}for(j in a)if(k=a[j],L=n[j],a.hasOwnProperty(j)&&k!==L&&(k!=null||L!=null))switch(j){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:Re(e,t,j,k,a,L)}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)&&Re(e,t,ce,null,a,k);for(D in a)if(k=a[D],L=n[D],a.hasOwnProperty(D)&&k!==L&&(k!=null||L!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(137,t));break;default:Re(e,t,D,k,a,L)}return;default:if(kr(t)){for(var _e in n)k=n[_e],n.hasOwnProperty(_e)&&k!==void 0&&!a.hasOwnProperty(_e)&&Ac(e,t,_e,void 0,a,k);for(H in a)k=a[H],L=n[H],!a.hasOwnProperty(H)||k===L||k===void 0&&L===void 0||Ac(e,t,H,k,a,L);return}}for(var R in n)k=n[R],n.hasOwnProperty(R)&&k!=null&&!a.hasOwnProperty(R)&&Re(e,t,R,null,a,k);for(Q in a)k=a[Q],L=n[Q],!a.hasOwnProperty(Q)||k===L||k==null&&L==null||Re(e,t,Q,k,a,L)}function xm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nv(){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&&xm(h)){for(h=0,x=u.responseEnd,a+=1;a<n.length;a++){var j=n[a],D=j.startTime;if(D>x)break;var H=j.transferSize,Q=j.initiatorType;H&&xm(Q)&&(j=j.responseEnd,h+=H*(j<x?1:(x-D)/(j-D)))}if(--a,t+=8*(c+h)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Sc=null,qc=null;function Ds(e){return e.nodeType===9?e:e.ownerDocument}function bm(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 Am(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 jc(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 Ec=null;function av(){var e=window.event;return e&&e.type==="popstate"?e===Ec?!1:(Ec=e,!0):(Ec=null,!1)}var Sm=typeof setTimeout=="function"?setTimeout:void 0,lv=typeof clearTimeout=="function"?clearTimeout:void 0,qm=typeof Promise=="function"?Promise:void 0,iv=typeof queueMicrotask=="function"?queueMicrotask:typeof qm<"u"?function(e){return qm.resolve(null).then(e).catch(sv)}:Sm;function sv(e){setTimeout(function(){throw e})}function Jn(e){return e==="head"}function jm(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),dl(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")ri(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ri(n);for(var c=n.firstChild;c;){var h=c.nextSibling,x=c.nodeName;c[El]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&ri(e.ownerDocument.body);n=u}while(n);dl(t)}function Em(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 Nc(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":Nc(n),Rr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function rv(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[El])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=Ht(e.nextSibling),e===null)break}return null}function uv(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ht(e.nextSibling),e===null))return null;return e}function Nm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function Cc(e){return e.data==="$?"||e.data==="$~"}function wc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cv(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 Ht(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 Tc=null;function Cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ht(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function wm(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 Tm(e,t,n){switch(t=Ds(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 ri(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rr(e)}var Vt=new Map,Mm=new Set;function ks(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qn=B.d;B.d={f:ov,r:fv,D:dv,C:hv,L:mv,m:pv,X:yv,S:gv,M:vv};function ov(){var e=qn.f(),t=Ns();return e||t}function fv(e){var t=Ra(e);t!==null&&t.tag===5&&t.type==="form"?Zd(t):qn.r(e)}var cl=typeof document>"u"?null:document;function Rm(e,t,n){var a=cl;if(a&&typeof t=="string"&&t){var u=Ot(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Mm.has(u)||(Mm.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),ct(t,"link",e),at(t),a.head.appendChild(t)))}}function dv(e){qn.D(e),Rm("dns-prefetch",e,null)}function hv(e,t){qn.C(e,t),Rm("preconnect",e,t)}function mv(e,t,n){qn.L(e,t,n);var a=cl;if(a&&e&&t){var u='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Ot(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Ot(n.imageSizes)+'"]')):u+='[href="'+Ot(e)+'"]';var c=u;switch(t){case"style":c=ol(e);break;case"script":c=fl(e)}Vt.has(c)||(e=A({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Vt.set(c,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(ui(c))||t==="script"&&a.querySelector(ci(c))||(t=a.createElement("link"),ct(t,"link",e),at(t),a.head.appendChild(t)))}}function pv(e,t){qn.m(e,t);var n=cl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',c=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=fl(e)}if(!Vt.has(c)&&(e=A({rel:"modulepreload",href:e},t),Vt.set(c,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ci(c)))return}a=n.createElement("link"),ct(a,"link",e),at(a),n.head.appendChild(a)}}}function gv(e,t,n){qn.S(e,t,n);var a=cl;if(a&&e){var u=_a(a).hoistableStyles,c=ol(e);t=t||"default";var h=u.get(c);if(!h){var x={loading:0,preload:null};if(h=a.querySelector(ui(c)))x.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vt.get(c))&&Mc(e,n);var j=h=a.createElement("link");at(j),ct(j,"link",e),j._p=new Promise(function(D,H){j.onload=D,j.onerror=H}),j.addEventListener("load",function(){x.loading|=1}),j.addEventListener("error",function(){x.loading|=2}),x.loading|=4,zs(h,t,a)}h={type:"stylesheet",instance:h,count:1,state:x},u.set(c,h)}}}function yv(e,t){qn.X(e,t);var n=cl;if(n&&e){var a=_a(n).hoistableScripts,u=fl(e),c=a.get(u);c||(c=n.querySelector(ci(u)),c||(e=A({src:e,async:!0},t),(t=Vt.get(u))&&Rc(e,t),c=n.createElement("script"),at(c),ct(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(u,c))}}function vv(e,t){qn.M(e,t);var n=cl;if(n&&e){var a=_a(n).hoistableScripts,u=fl(e),c=a.get(u);c||(c=n.querySelector(ci(u)),c||(e=A({src:e,async:!0,type:"module"},t),(t=Vt.get(u))&&Rc(e,t),c=n.createElement("script"),at(c),ct(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(u,c))}}function _m(e,t,n,a){var u=(u=se.current)?ks(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=ol(n.href),n=_a(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=ol(n.href);var c=_a(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(ui(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Vt.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},Vt.set(e,n),c||xv(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=fl(n),n=_a(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 ol(e){return'href="'+Ot(e)+'"'}function ui(e){return'link[rel="stylesheet"]['+e+"]"}function Om(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function xv(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}),ct(t,"link",n),at(t),e.head.appendChild(t))}function fl(e){return'[src="'+Ot(e)+'"]'}function ci(e){return"script[async]"+e}function Dm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(n.href)+'"]');if(a)return t.instance=a,at(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"),at(a),ct(a,"style",u),zs(a,n.precedence,e),t.instance=a;case"stylesheet":u=ol(n.href);var c=e.querySelector(ui(u));if(c)return t.state.loading|=4,t.instance=c,at(c),c;a=Om(n),(u=Vt.get(u))&&Mc(a,u),c=(e.ownerDocument||e).createElement("link"),at(c);var h=c;return h._p=new Promise(function(x,j){h.onload=x,h.onerror=j}),ct(c,"link",a),t.state.loading|=4,zs(c,n.precedence,e),t.instance=c;case"script":return c=fl(n.src),(u=e.querySelector(ci(c)))?(t.instance=u,at(u),u):(a=n,(u=Vt.get(c))&&(a=A({},n),Rc(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),at(u),ct(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,zs(a,n.precedence,e));return t.instance}function zs(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 Mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Bs=null;function km(e,t,n){if(Bs===null){var a=new Map,u=Bs=new Map;u.set(n,a)}else u=Bs,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[El]||c[it]||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 zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function bv(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 Bm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Av(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=ol(a.href),c=t.querySelector(ui(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ls.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,at(c);return}c=t.ownerDocument||t,a=Om(a),(u=Vt.get(u))&&Mc(a,u),c=c.createElement("link"),at(c);var h=c;h._p=new Promise(function(x,j){h.onload=x,h.onerror=j}),ct(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=Ls.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var _c=0;function Sv(e,t){return e.stylesheets&&e.count===0&&Hs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Hs(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*nv());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Hs(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Ls(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Us=null;function Hs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Us=new Map,t.forEach(qv,e),Us=null,Ls.call(e))}function qv(e,t){if(!(t.state.loading&4)){var n=Us.get(e);if(n)var a=n.get(null);else{n=new Map,Us.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=Ls.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 oi={$$typeof:G,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function jv(e,t,n,a,u,c,h,x,j){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=Cr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cr(0),this.hiddenUpdates=Cr(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Lm(e,t,n,a,u,c,h,x,j,D,H,Q){return e=new jv(e,t,n,h,j,D,H,Q,x),t=1,c===!0&&(t|=24),c=jt(3,null,null,t),e.current=c,c.stateNode=e,t=fu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:t},pu(c),e}function Um(e){return e?(e=Ya,e):Ya}function Hm(e,t,n,a,u,c){u=Um(u),a.context===null?a.context=u:a.pendingContext=u,a=Ln(t),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=Un(e,a,t),n!==null&&(xt(n,e,t),Yl(n,e,t))}function Vm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Oc(e,t){Vm(e,t),(e=e.alternate)&&Vm(e,t)}function Ym(e){if(e.tag===13||e.tag===31){var t=oa(e,67108864);t!==null&&xt(t,e,67108864),Oc(e,67108864)}}function Gm(e){if(e.tag===13||e.tag===31){var t=Tt();t=wr(t);var n=oa(e,t);n!==null&&xt(n,e,t),Oc(e,t)}}var Vs=!0;function Ev(e,t,n,a){var u=z.T;z.T=null;var c=B.p;try{B.p=2,Dc(e,t,n,a)}finally{B.p=c,z.T=u}}function Nv(e,t,n,a){var u=z.T;z.T=null;var c=B.p;try{B.p=8,Dc(e,t,n,a)}finally{B.p=c,z.T=u}}function Dc(e,t,n,a){if(Vs){var u=kc(a);if(u===null)bc(e,t,a,Ys,n),Xm(e,a);else if(wv(u,e,t,n,a))a.stopPropagation();else if(Xm(e,a),t&4&&-1<Cv.indexOf(e)){for(;u!==null;){var c=Ra(u);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=ia(c.pendingLanes);if(h!==0){var x=c;for(x.pendingLanes|=2,x.entangledLanes|=2;h;){var j=1<<31-St(h);x.entanglements[1]|=j,h&=~j}Pt(c),(Ce&6)===0&&(js=bt()+500,li(0))}}break;case 31:case 13:x=oa(c,2),x!==null&&xt(x,c,2),Ns(),Oc(c,2)}if(c=kc(a),c===null&&bc(e,t,a,Ys,n),c===u)break;u=c}u!==null&&a.stopPropagation()}else bc(e,t,a,null,n)}}function kc(e){return e=Br(e),zc(e)}var Ys=null;function zc(e){if(Ys=null,e=Ma(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=y(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 Ys=e,null}function Qm(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(dg()){case Wo:return 2;case Io:return 8;case Ri:case hg:return 32;case Po:return 268435456;default:return 32}default:return 32}}var Bc=!1,Fn=null,Wn=null,In=null,fi=new Map,di=new Map,Pn=[],Cv="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 Xm(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Wn=null;break;case"mouseover":case"mouseout":In=null;break;case"pointerover":case"pointerout":fi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":di.delete(t.pointerId)}}function hi(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=Ra(t),t!==null&&Ym(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function wv(e,t,n,a,u){switch(t){case"focusin":return Fn=hi(Fn,e,t,n,a,u),!0;case"dragenter":return Wn=hi(Wn,e,t,n,a,u),!0;case"mouseover":return In=hi(In,e,t,n,a,u),!0;case"pointerover":var c=u.pointerId;return fi.set(c,hi(fi.get(c)||null,e,t,n,a,u)),!0;case"gotpointercapture":return c=u.pointerId,di.set(c,hi(di.get(c)||null,e,t,n,a,u)),!0}return!1}function Km(e){var t=Ma(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,sf(e.priority,function(){Gm(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,sf(e.priority,function(){Gm(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 Gs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);zr=a,n.target.dispatchEvent(a),zr=null}else return t=Ra(n),t!==null&&Ym(t),e.blockedOn=n,!1;t.shift()}return!0}function Zm(e,t,n){Gs(e)&&n.delete(t)}function Tv(){Bc=!1,Fn!==null&&Gs(Fn)&&(Fn=null),Wn!==null&&Gs(Wn)&&(Wn=null),In!==null&&Gs(In)&&(In=null),fi.forEach(Zm),di.forEach(Zm)}function Qs(e,t){e.blockedOn===t&&(e.blockedOn=null,Bc||(Bc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Tv)))}var Xs=null;function $m(e){Xs!==e&&(Xs=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Xs===e&&(Xs=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(zc(a||n)===null)continue;break}var c=Ra(n);c!==null&&(e.splice(t,3),t-=3,ku(c,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function dl(e){function t(j){return Qs(j,e)}Fn!==null&&Qs(Fn,e),Wn!==null&&Qs(Wn,e),In!==null&&Qs(In,e),fi.forEach(t),di.forEach(t);for(var n=0;n<Pn.length;n++){var a=Pn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Pn.length&&(n=Pn[0],n.blockedOn===null);)Km(n),n.blockedOn===null&&Pn.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[ht]||null;if(typeof c=="function")h||$m(n);else if(h){var x=null;if(c&&c.hasAttribute("formAction")){if(u=c,h=c[ht]||null)x=h.formAction;else if(zc(u)!==null)continue}else x=h.action;typeof x=="function"?n[a+1]=x:(n.splice(a,3),a-=3),$m(n)}}}function Jm(){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 Lc(e){this._internalRoot=e}Ks.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,a=Tt();Hm(n,a,e,t,null,null)},Ks.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hm(e.current,2,null,e,null,null),Ns(),t[Ta]=null}};function Ks(e){this._internalRoot=e}Ks.prototype.unstable_scheduleHydration=function(e){if(e){var t=lf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pn.length&&t!==0&&t<Pn[n].priority;n++);Pn.splice(n,0,e),n===0&&Km(e)}};var Fm=i.version;if(Fm!=="19.2.0")throw Error(r(527,Fm,"19.2.0"));B.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=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Mv={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zs.isDisabled&&Zs.supportsFiber)try{Sl=Zs.inject(Mv),At=Zs}catch{}}return pi.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,a="",u=ah,c=lh,h=ih;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=Lm(e,1,!1,null,null,n,a,null,u,c,h,Jm),e[Ta]=t.current,xc(e),new Lc(t)},pi.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var a=!1,u="",c=ah,h=lh,x=ih,j=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&&(j=n.formState)),t=Lm(e,1,!0,t,n??null,a,u,j,c,h,x,Jm),t.context=Um(null),n=t.current,a=Tt(),a=wr(a),u=Ln(a),u.callback=null,Un(n,u,a),n=a,t.current.lanes=n,jl(t,n),Pt(t),e[Ta]=t.current,xc(e),new Ks(t)},pi.version="19.2.0",pi}var sp;function Vv(){if(sp)return Vc.exports;sp=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(),Vc.exports=Hv(),Vc.exports}var Yv=Vv();var rp="popstate";function Gv(l={}){function i(r,f){let{pathname:d,search:m,hash:y}=r.location;return so("",{pathname:d,search:m,hash:y},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function s(r,f){return typeof f=="string"?f:Ai(f)}return Xv(i,s,null,l)}function Ve(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Jt(l,i){if(!l){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Qv(){return Math.random().toString(36).substring(2,10)}function up(l,i){return{usr:l.state,key:l.key,idx:i}}function so(l,i,s=null,r){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof i=="string"?yl(i):i,state:s,key:i&&i.key||r||Qv()}}function Ai({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 yl(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 Xv(l,i,s,r={}){let{window:f=document.defaultView,v5Compat:d=!1}=r,m=f.history,y="POP",g=null,v=b();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function b(){return(m.state||{idx:null}).idx}function A(){y="POP";let S=b(),T=S==null?null:S-v;v=S,g&&g({action:y,location:N.location,delta:T})}function M(S,T){y="PUSH";let _=so(N.location,S,T);v=b()+1;let G=up(_,v),F=N.createHref(_);try{m.pushState(G,"",F)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;f.location.assign(F)}d&&g&&g({action:y,location:N.location,delta:1})}function E(S,T){y="REPLACE";let _=so(N.location,S,T);v=b();let G=up(_,v),F=N.createHref(_);m.replaceState(G,"",F),d&&g&&g({action:y,location:N.location,delta:0})}function C(S){return Kv(S)}let N={get action(){return y},get location(){return l(f,m)},listen(S){if(g)throw new Error("A history only accepts one active listener");return f.addEventListener(rp,A),g=S,()=>{f.removeEventListener(rp,A),g=null}},createHref(S){return i(f,S)},createURL:C,encodeLocation(S){let T=C(S);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:M,replace:E,go(S){return m.go(S)}};return N}function Kv(l,i=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Ve(s,"No window.location.(origin|href) available to create URL");let r=typeof l=="string"?l:Ai(l);return r=r.replace(/ $/,"%20"),!i&&r.startsWith("//")&&(r=s+r),new URL(r,s)}function Jp(l,i,s="/"){return Zv(l,i,s,!1)}function Zv(l,i,s,r){let f=typeof i=="string"?yl(i):i,d=Cn(f.pathname||"/",s);if(d==null)return null;let m=Fp(l);$v(m);let y=null;for(let g=0;y==null&&g<m.length;++g){let v=ix(d);y=ax(m[g],v,r)}return y}function Fp(l,i=[],s=[],r="",f=!1){let d=(m,y,g=f,v)=>{let b={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:y,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(r)&&g)return;Ve(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=En([r,b.relativePath]),M=s.concat(b);m.children&&m.children.length>0&&(Ve(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${A}".`),Fp(m.children,i,M,A,g)),!(m.path==null&&!m.index)&&i.push({path:A,score:tx(A,m.index),routesMeta:M})};return l.forEach((m,y)=>{if(m.path===""||!m.path?.includes("?"))d(m,y);else for(let g of Wp(m.path))d(m,y,!0,g)}),i}function Wp(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=Wp(r.join("/")),y=[];return y.push(...m.map(g=>g===""?d:[d,g].join("/"))),f&&y.push(...m),y.map(g=>l.startsWith("/")&&g===""?"/":g)}function $v(l){l.sort((i,s)=>i.score!==s.score?s.score-i.score:nx(i.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}var Jv=/^:[\w-]+$/,Fv=3,Wv=2,Iv=1,Pv=10,ex=-2,cp=l=>l==="*";function tx(l,i){let s=l.split("/"),r=s.length;return s.some(cp)&&(r+=ex),i&&(r+=Wv),s.filter(f=>!cp(f)).reduce((f,d)=>f+(Jv.test(d)?Fv:d===""?Iv:Pv),r)}function nx(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 ax(l,i,s=!1){let{routesMeta:r}=l,f={},d="/",m=[];for(let y=0;y<r.length;++y){let g=r[y],v=y===r.length-1,b=d==="/"?i:i.slice(d.length)||"/",A=hr({path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b),M=g.route;if(!A&&v&&s&&!r[r.length-1].route.index&&(A=hr({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!A)return null;Object.assign(f,A.params),m.push({params:f,pathname:En([d,A.pathname]),pathnameBase:ox(En([d,A.pathnameBase])),route:M}),A.pathnameBase!=="/"&&(d=En([d,A.pathnameBase]))}return m}function hr(l,i){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[s,r]=lx(l.path,l.caseSensitive,l.end),f=i.match(s);if(!f)return null;let d=f[0],m=d.replace(/(.)\/+$/,"$1"),y=f.slice(1);return{params:r.reduce((v,{paramName:b,isOptional:A},M)=>{if(b==="*"){let C=y[M]||"";m=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const E=y[M];return A&&!E?v[b]=void 0:v[b]=(E||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:m,pattern:l}}function lx(l,i=!1,s=!0){Jt(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,y,g)=>(r.push({paramName:y,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).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 ix(l){try{return l.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Jt(!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 Cn(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 sx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rx=l=>sx.test(l);function ux(l,i="/"){let{pathname:s,search:r="",hash:f=""}=typeof l=="string"?yl(l):l,d;if(s)if(rx(s))d=s;else{if(s.includes("//")){let m=s;s=s.replace(/\/\/+/g,"/"),Jt(!1,`Pathnames cannot have embedded double slashes - normalizing ${m} -> ${s}`)}s.startsWith("/")?d=op(s.substring(1),"/"):d=op(s,i)}else d=i;return{pathname:d,search:fx(r),hash:dx(f)}}function op(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 Xc(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 cx(l){return l.filter((i,s)=>s===0||i.route.path&&i.route.path.length>0)}function Ip(l){let i=cx(l);return i.map((s,r)=>r===i.length-1?s.pathname:s.pathnameBase)}function Pp(l,i,s,r=!1){let f;typeof l=="string"?f=yl(l):(f={...l},Ve(!f.pathname||!f.pathname.includes("?"),Xc("?","pathname","search",f)),Ve(!f.pathname||!f.pathname.includes("#"),Xc("#","pathname","hash",f)),Ve(!f.search||!f.search.includes("#"),Xc("#","search","hash",f)));let d=l===""||f.pathname==="",m=d?"/":f.pathname,y;if(m==null)y=s;else{let A=i.length-1;if(!r&&m.startsWith("..")){let M=m.split("/");for(;M[0]==="..";)M.shift(),A-=1;f.pathname=M.join("/")}y=A>=0?i[A]:"/"}let g=ux(f,y),v=m&&m!=="/"&&m.endsWith("/"),b=(d||m===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var En=l=>l.join("/").replace(/\/\/+/g,"/"),ox=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),fx=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,dx=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l;function hx(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 e0=["POST","PUT","PATCH","DELETE"];new Set(e0);var mx=["GET",...e0];new Set(mx);var vl=p.createContext(null);vl.displayName="DataRouter";var vr=p.createContext(null);vr.displayName="DataRouterState";p.createContext(!1);var t0=p.createContext({isTransitioning:!1});t0.displayName="ViewTransition";var px=p.createContext(new Map);px.displayName="Fetchers";var gx=p.createContext(null);gx.displayName="Await";var nn=p.createContext(null);nn.displayName="Navigation";var Ni=p.createContext(null);Ni.displayName="Location";var wn=p.createContext({outlet:null,matches:[],isDataRoute:!1});wn.displayName="Route";var jo=p.createContext(null);jo.displayName="RouteError";function yx(l,{relative:i}={}){Ve(Ci(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:r}=p.useContext(nn),{hash:f,pathname:d,search:m}=wi(l,{relative:i}),y=d;return s!=="/"&&(y=d==="/"?s:En([s,d])),r.createHref({pathname:y,search:m,hash:f})}function Ci(){return p.useContext(Ni)!=null}function Ca(){return Ve(Ci(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Ni).location}var n0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function a0(l){p.useContext(nn).static||p.useLayoutEffect(l)}function vx(){let{isDataRoute:l}=p.useContext(wn);return l?Rx():xx()}function xx(){Ve(Ci(),"useNavigate() may be used only in the context of a <Router> component.");let l=p.useContext(vl),{basename:i,navigator:s}=p.useContext(nn),{matches:r}=p.useContext(wn),{pathname:f}=Ca(),d=JSON.stringify(Ip(r)),m=p.useRef(!1);return a0(()=>{m.current=!0}),p.useCallback((g,v={})=>{if(Jt(m.current,n0),!m.current)return;if(typeof g=="number"){s.go(g);return}let b=Pp(g,JSON.parse(d),f,v.relative==="path");l==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:En([i,b.pathname])),(v.replace?s.replace:s.push)(b,v.state,v)},[i,s,d,f,l])}p.createContext(null);function wi(l,{relative:i}={}){let{matches:s}=p.useContext(wn),{pathname:r}=Ca(),f=JSON.stringify(Ip(s));return p.useMemo(()=>Pp(l,JSON.parse(f),r,i==="path"),[l,f,r,i])}function bx(l,i){return l0(l,i)}function l0(l,i,s,r,f){Ve(Ci(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=p.useContext(nn),{matches:m}=p.useContext(wn),y=m[m.length-1],g=y?y.params:{},v=y?y.pathname:"/",b=y?y.pathnameBase:"/",A=y&&y.route;{let _=A&&A.path||"";i0(v,!A||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${_}">) 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="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let M=Ca(),E;if(i){let _=typeof i=="string"?yl(i):i;Ve(b==="/"||_.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 "${_.pathname}" was given in the \`location\` prop.`),E=_}else E=M;let C=E.pathname||"/",N=C;if(b!=="/"){let _=b.replace(/^\//,"").split("/");N="/"+C.replace(/^\//,"").split("/").slice(_.length).join("/")}let S=Jp(l,{pathname:N});Jt(A||S!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),Jt(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.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 T=Ex(S&&S.map(_=>Object.assign({},_,{params:Object.assign({},g,_.params),pathname:En([b,d.encodeLocation?d.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:En([b,d.encodeLocation?d.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),m,s,r,f);return i&&T?p.createElement(Ni.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...E},navigationType:"POP"}},T):T}function Ax(){let l=Mx(),i=hx(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 Sx=p.createElement(Ax,null),qx=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(wn.Provider,{value:this.props.routeContext},p.createElement(jo.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function jx({routeContext:l,match:i,children:s}){let r=p.useContext(vl);return r&&r.static&&r.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(wn.Provider,{value:l},s)}function Ex(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);Ve(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 y=!1,g=-1;if(s)for(let b=0;b<d.length;b++){let A=d[b];if((A.route.HydrateFallback||A.route.hydrateFallbackElement)&&(g=b),A.route.id){let{loaderData:M,errors:E}=s,C=A.route.loader&&!M.hasOwnProperty(A.route.id)&&(!E||E[A.route.id]===void 0);if(A.route.lazy||C){y=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}let v=s&&r?(b,A)=>{r(b,{location:s.location,params:s.matches?.[0]?.params??{},errorInfo:A})}:void 0;return d.reduceRight((b,A,M)=>{let E,C=!1,N=null,S=null;s&&(E=m&&A.route.id?m[A.route.id]:void 0,N=A.route.errorElement||Sx,y&&(g<0&&M===0?(i0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,S=null):g===M&&(C=!0,S=A.route.hydrateFallbackElement||null)));let T=i.concat(d.slice(0,M+1)),_=()=>{let G;return E?G=N:C?G=S:A.route.Component?G=p.createElement(A.route.Component,null):A.route.element?G=A.route.element:G=b,p.createElement(jx,{match:A,routeContext:{outlet:b,matches:T,isDataRoute:s!=null},children:G})};return s&&(A.route.ErrorBoundary||A.route.errorElement||M===0)?p.createElement(qx,{location:s.location,revalidation:s.revalidation,component:N,error:E,children:_(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:v}):_()},null)}function Eo(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nx(l){let i=p.useContext(vl);return Ve(i,Eo(l)),i}function Cx(l){let i=p.useContext(vr);return Ve(i,Eo(l)),i}function wx(l){let i=p.useContext(wn);return Ve(i,Eo(l)),i}function No(l){let i=wx(l),s=i.matches[i.matches.length-1];return Ve(s.route.id,`${l} can only be used on routes that contain a unique "id"`),s.route.id}function Tx(){return No("useRouteId")}function Mx(){let l=p.useContext(jo),i=Cx("useRouteError"),s=No("useRouteError");return l!==void 0?l:i.errors?.[s]}function Rx(){let{router:l}=Nx("useNavigate"),i=No("useNavigate"),s=p.useRef(!1);return a0(()=>{s.current=!0}),p.useCallback(async(f,d={})=>{Jt(s.current,n0),s.current&&(typeof f=="number"?l.navigate(f):await l.navigate(f,{fromRouteId:i,...d}))},[l,i])}var fp={};function i0(l,i,s){!i&&!fp[l]&&(fp[l]=!0,Jt(!1,s))}p.memo(_x);function _x({routes:l,future:i,state:s,unstable_onError:r}){return l0(l,void 0,s,r,i)}function lr(l){Ve(!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 Ox({basename:l="/",children:i=null,location:s,navigationType:r="POP",navigator:f,static:d=!1}){Ve(!Ci(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=l.replace(/^\/*/,"/"),y=p.useMemo(()=>({basename:m,navigator:f,static:d,future:{}}),[m,f,d]);typeof s=="string"&&(s=yl(s));let{pathname:g="/",search:v="",hash:b="",state:A=null,key:M="default"}=s,E=p.useMemo(()=>{let C=Cn(g,m);return C==null?null:{location:{pathname:C,search:v,hash:b,state:A,key:M},navigationType:r}},[m,g,v,b,A,M,r]);return Jt(E!=null,`<Router basename="${m}"> is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:p.createElement(nn.Provider,{value:y},p.createElement(Ni.Provider,{children:i,value:E}))}function Dx({children:l,location:i}){return bx(ro(l),i)}function ro(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,ro(r.props.children,d));return}Ve(r.type===lr,`[${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>`),Ve(!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=ro(r.props.children,d)),s.push(m)}),s}var ir="get",sr="application/x-www-form-urlencoded";function xr(l){return l!=null&&typeof l.tagName=="string"}function kx(l){return xr(l)&&l.tagName.toLowerCase()==="button"}function zx(l){return xr(l)&&l.tagName.toLowerCase()==="form"}function Bx(l){return xr(l)&&l.tagName.toLowerCase()==="input"}function Lx(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Ux(l,i){return l.button===0&&(!i||i==="_self")&&!Lx(l)}var $s=null;function Hx(){if($s===null)try{new FormData(document.createElement("form"),0),$s=!1}catch{$s=!0}return $s}var Vx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kc(l){return l!=null&&!Vx.has(l)?(Jt(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${sr}"`),null):l}function Yx(l,i){let s,r,f,d,m;if(zx(l)){let y=l.getAttribute("action");r=y?Cn(y,i):null,s=l.getAttribute("method")||ir,f=Kc(l.getAttribute("enctype"))||sr,d=new FormData(l)}else if(kx(l)||Bx(l)&&(l.type==="submit"||l.type==="image")){let y=l.form;if(y==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=l.getAttribute("formaction")||y.getAttribute("action");if(r=g?Cn(g,i):null,s=l.getAttribute("formmethod")||y.getAttribute("method")||ir,f=Kc(l.getAttribute("formenctype"))||Kc(y.getAttribute("enctype"))||sr,d=new FormData(y,l),!Hx()){let{name:v,type:b,value:A}=l;if(b==="image"){let M=v?`${v}.`:"";d.append(`${M}x`,"0"),d.append(`${M}y`,"0")}else v&&d.append(v,A)}}else{if(xr(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=ir,r=null,f=sr,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 Co(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Gx(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&&Cn(r.pathname,i)==="/"?r.pathname=`${i.replace(/\/$/,"")}/_root.${s}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${s}`,r}async function Qx(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 Xx(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 Kx(l,i,s){let r=await Promise.all(l.map(async f=>{let d=i.routes[f.route.id];if(d){let m=await Qx(d,s);return m.links?m.links():[]}return[]}));return Fx(r.flat(1).filter(Xx).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function dp(l,i,s,r,f,d){let m=(g,v)=>s[v]?g.route.id!==s[v].route.id:!0,y=(g,v)=>s[v].pathname!==g.pathname||s[v].route.path?.endsWith("*")&&s[v].params["*"]!==g.params["*"];return d==="assets"?i.filter((g,v)=>m(g,v)||y(g,v)):d==="data"?i.filter((g,v)=>{let b=r.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,v)||y(g,v))return!0;if(g.route.shouldRevalidate){let A=g.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(l,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof A=="boolean")return A}return!0}):[]}function Zx(l,i,{includeHydrateFallback:s}={}){return $x(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 $x(l){return[...new Set(l)]}function Jx(l){let i={},s=Object.keys(l).sort();for(let r of s)i[r]=l[r];return i}function Fx(l,i){let s=new Set;return new Set(i),l.reduce((r,f)=>{let d=JSON.stringify(Jx(f));return s.has(d)||(s.add(d),r.push({key:d,link:f})),r},[])}function s0(){let l=p.useContext(vl);return Co(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function Wx(){let l=p.useContext(vr);return Co(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var wo=p.createContext(void 0);wo.displayName="FrameworkContext";function r0(){let l=p.useContext(wo);return Co(l,"You must render this element inside a <HydratedRouter> element"),l}function Ix(l,i){let s=p.useContext(wo),[r,f]=p.useState(!1),[d,m]=p.useState(!1),{onFocus:y,onBlur:g,onMouseEnter:v,onMouseLeave:b,onTouchStart:A}=i,M=p.useRef(null);p.useEffect(()=>{if(l==="render"&&m(!0),l==="viewport"){let N=T=>{T.forEach(_=>{m(_.isIntersecting)})},S=new IntersectionObserver(N,{threshold:.5});return M.current&&S.observe(M.current),()=>{S.disconnect()}}},[l]),p.useEffect(()=>{if(r){let N=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(N)}}},[r]);let E=()=>{f(!0)},C=()=>{f(!1),m(!1)};return s?l!=="intent"?[d,M,{}]:[d,M,{onFocus:gi(y,E),onBlur:gi(g,C),onMouseEnter:gi(v,E),onMouseLeave:gi(b,C),onTouchStart:gi(A,E)}]:[!1,M,{}]}function gi(l,i){return s=>{l&&l(s),s.defaultPrevented||i(s)}}function Px({page:l,...i}){let{router:s}=s0(),r=p.useMemo(()=>Jp(s.routes,l,s.basename),[s.routes,l,s.basename]);return r?p.createElement(tb,{page:l,matches:r,...i}):null}function eb(l){let{manifest:i,routeModules:s}=r0(),[r,f]=p.useState([]);return p.useEffect(()=>{let d=!1;return Kx(l,i,s).then(m=>{d||f(m)}),()=>{d=!0}},[l,i,s]),r}function tb({page:l,matches:i,...s}){let r=Ca(),{manifest:f,routeModules:d}=r0(),{basename:m}=s0(),{loaderData:y,matches:g}=Wx(),v=p.useMemo(()=>dp(l,i,g,f,r,"data"),[l,i,g,f,r]),b=p.useMemo(()=>dp(l,i,g,f,r,"assets"),[l,i,g,f,r]),A=p.useMemo(()=>{if(l===r.pathname+r.search+r.hash)return[];let C=new Set,N=!1;if(i.forEach(T=>{let _=f.routes[T.route.id];!_||!_.hasLoader||(!v.some(G=>G.route.id===T.route.id)&&T.route.id in y&&d[T.route.id]?.shouldRevalidate||_.hasClientLoader?N=!0:C.add(T.route.id))}),C.size===0)return[];let S=Gx(l,m,"data");return N&&C.size>0&&S.searchParams.set("_routes",i.filter(T=>C.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[m,y,r,f,v,i,l,d]),M=p.useMemo(()=>Zx(b,f),[b,f]),E=eb(b);return p.createElement(p.Fragment,null,A.map(C=>p.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...s})),M.map(C=>p.createElement("link",{key:C,rel:"modulepreload",href:C,...s})),E.map(({key:C,link:N})=>p.createElement("link",{key:C,nonce:s.nonce,...N})))}function nb(...l){return i=>{l.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var u0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{u0&&(window.__reactRouterVersion="7.9.6")}catch{}function ab({basename:l,children:i,window:s}){let r=p.useRef();r.current==null&&(r.current=Gv({window:s,v5Compat:!0}));let f=r.current,[d,m]=p.useState({action:f.action,location:f.location}),y=p.useCallback(g=>{p.startTransition(()=>m(g))},[m]);return p.useLayoutEffect(()=>f.listen(y),[f,y]),p.createElement(Ox,{basename:l,children:i,location:d.location,navigationType:d.action,navigator:f})}var c0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,o0=p.forwardRef(function({onClick:i,discover:s="render",prefetch:r="none",relative:f,reloadDocument:d,replace:m,state:y,target:g,to:v,preventScrollReset:b,viewTransition:A,...M},E){let{basename:C}=p.useContext(nn),N=typeof v=="string"&&c0.test(v),S,T=!1;if(typeof v=="string"&&N&&(S=v,u0))try{let P=new URL(window.location.href),ue=v.startsWith("//")?new URL(P.protocol+v):new URL(v),be=Cn(ue.pathname,C);ue.origin===P.origin&&be!=null?v=be+ue.search+ue.hash:T=!0}catch{Jt(!1,`<Link to="${v}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=yx(v,{relative:f}),[G,F,ee]=Ix(r,M),I=rb(v,{replace:m,state:y,target:g,preventScrollReset:b,relative:f,viewTransition:A});function V(P){i&&i(P),P.defaultPrevented||I(P)}let Z=p.createElement("a",{...M,...ee,href:S||_,onClick:T||d?i:V,ref:nb(E,F),target:g,"data-discover":!N&&s==="render"?"true":void 0});return G&&!N?p.createElement(p.Fragment,null,Z,p.createElement(Px,{page:_})):Z});o0.displayName="Link";var lb=p.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:r="",end:f=!1,style:d,to:m,viewTransition:y,children:g,...v},b){let A=wi(m,{relative:v.relative}),M=Ca(),E=p.useContext(vr),{navigator:C,basename:N}=p.useContext(nn),S=E!=null&&db(A)&&y===!0,T=C.encodeLocation?C.encodeLocation(A).pathname:A.pathname,_=M.pathname,G=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;s||(_=_.toLowerCase(),G=G?G.toLowerCase():null,T=T.toLowerCase()),G&&N&&(G=Cn(G,N)||G);const F=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let ee=_===T||!f&&_.startsWith(T)&&_.charAt(F)==="/",I=G!=null&&(G===T||!f&&G.startsWith(T)&&G.charAt(T.length)==="/"),V={isActive:ee,isPending:I,isTransitioning:S},Z=ee?i:void 0,P;typeof r=="function"?P=r(V):P=[r,ee?"active":null,I?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let ue=typeof d=="function"?d(V):d;return p.createElement(o0,{...v,"aria-current":Z,className:P,ref:b,style:ue,to:m,viewTransition:y},typeof g=="function"?g(V):g)});lb.displayName="NavLink";var ib=p.forwardRef(({discover:l="render",fetcherKey:i,navigate:s,reloadDocument:r,replace:f,state:d,method:m=ir,action:y,onSubmit:g,relative:v,preventScrollReset:b,viewTransition:A,...M},E)=>{let C=ob(),N=fb(y,{relative:v}),S=m.toLowerCase()==="get"?"get":"post",T=typeof y=="string"&&c0.test(y),_=G=>{if(g&&g(G),G.defaultPrevented)return;G.preventDefault();let F=G.nativeEvent.submitter,ee=F?.getAttribute("formmethod")||m;C(F||G.currentTarget,{fetcherKey:i,method:ee,navigate:s,replace:f,state:d,relative:v,preventScrollReset:b,viewTransition:A})};return p.createElement("form",{ref:E,method:S,action:N,onSubmit:r?g:_,...M,"data-discover":!T&&l==="render"?"true":void 0})});ib.displayName="Form";function sb(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f0(l){let i=p.useContext(vl);return Ve(i,sb(l)),i}function rb(l,{target:i,replace:s,state:r,preventScrollReset:f,relative:d,viewTransition:m}={}){let y=vx(),g=Ca(),v=wi(l,{relative:d});return p.useCallback(b=>{if(Ux(b,i)){b.preventDefault();let A=s!==void 0?s:Ai(g)===Ai(v);y(l,{replace:A,state:r,preventScrollReset:f,relative:d,viewTransition:m})}},[g,y,v,s,r,i,l,f,d,m])}var ub=0,cb=()=>`__${String(++ub)}__`;function ob(){let{router:l}=f0("useSubmit"),{basename:i}=p.useContext(nn),s=Tx();return p.useCallback(async(r,f={})=>{let{action:d,method:m,encType:y,formData:g,body:v}=Yx(r,i);if(f.navigate===!1){let b=f.fetcherKey||cb();await l.fetch(b,s,f.action||d,{preventScrollReset:f.preventScrollReset,formData:g,body:v,formMethod:f.method||m,formEncType:f.encType||y,flushSync:f.flushSync})}else await l.navigate(f.action||d,{preventScrollReset:f.preventScrollReset,formData:g,body:v,formMethod:f.method||m,formEncType:f.encType||y,replace:f.replace,state:f.state,fromRouteId:s,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,i,s])}function fb(l,{relative:i}={}){let{basename:s}=p.useContext(nn),r=p.useContext(wn);Ve(r,"useFormAction must be used inside a RouteContext");let[f]=r.matches.slice(-1),d={...wi(l||".",{relative:i})},m=Ca();if(l==null){d.search=m.search;let y=new URLSearchParams(d.search),g=y.getAll("index");if(g.some(b=>b==="")){y.delete("index"),g.filter(A=>A).forEach(A=>y.append("index",A));let b=y.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:En([s,d.pathname])),Ai(d)}function db(l,{relative:i}={}){let s=p.useContext(t0);Ve(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=f0("useViewTransitionState"),f=wi(l,{relative:i});if(!s.isTransitioning)return!1;let d=Cn(s.currentLocation.pathname,r)||s.currentLocation.pathname,m=Cn(s.nextLocation.pathname,r)||s.nextLocation.pathname;return hr(f.pathname,m)!=null||hr(f.pathname,d)!=null}const tn=Object.create(null);tn.open="0";tn.close="1";tn.ping="2";tn.pong="3";tn.message="4";tn.upgrade="5";tn.noop="6";const rr=Object.create(null);Object.keys(tn).forEach(l=>{rr[tn[l]]=l});const uo={type:"error",data:"parser error"},d0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",h0=typeof ArrayBuffer=="function",m0=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l&&l.buffer instanceof ArrayBuffer,To=({type:l,data:i},s,r)=>d0&&i instanceof Blob?s?r(i):hp(i,r):h0&&(i instanceof ArrayBuffer||m0(i))?s?r(i):hp(new Blob([i]),r):r(tn[l]+(i||"")),hp=(l,i)=>{const s=new FileReader;return s.onload=function(){const r=s.result.split(",")[1];i("b"+(r||""))},s.readAsDataURL(l)};function mp(l){return l instanceof Uint8Array?l:l instanceof ArrayBuffer?new Uint8Array(l):new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}let Zc;function hb(l,i){if(d0&&l.data instanceof Blob)return l.data.arrayBuffer().then(mp).then(i);if(h0&&(l.data instanceof ArrayBuffer||m0(l.data)))return i(mp(l.data));To(l,!1,s=>{Zc||(Zc=new TextEncoder),i(Zc.encode(s))})}const pp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<pp.length;l++)xi[pp.charCodeAt(l)]=l;const mb=l=>{let i=l.length*.75,s=l.length,r,f=0,d,m,y,g;l[l.length-1]==="="&&(i--,l[l.length-2]==="="&&i--);const v=new ArrayBuffer(i),b=new Uint8Array(v);for(r=0;r<s;r+=4)d=xi[l.charCodeAt(r)],m=xi[l.charCodeAt(r+1)],y=xi[l.charCodeAt(r+2)],g=xi[l.charCodeAt(r+3)],b[f++]=d<<2|m>>4,b[f++]=(m&15)<<4|y>>2,b[f++]=(y&3)<<6|g&63;return v},pb=typeof ArrayBuffer=="function",Mo=(l,i)=>{if(typeof l!="string")return{type:"message",data:p0(l,i)};const s=l.charAt(0);return s==="b"?{type:"message",data:gb(l.substring(1),i)}:rr[s]?l.length>1?{type:rr[s],data:l.substring(1)}:{type:rr[s]}:uo},gb=(l,i)=>{if(pb){const s=mb(l);return p0(s,i)}else return{base64:!0,data:l}},p0=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}},g0="",yb=(l,i)=>{const s=l.length,r=new Array(s);let f=0;l.forEach((d,m)=>{To(d,!1,y=>{r[m]=y,++f===s&&i(r.join(g0))})})},vb=(l,i)=>{const s=l.split(g0),r=[];for(let f=0;f<s.length;f++){const d=Mo(s[f],i);if(r.push(d),d.type==="error")break}return r};function xb(){return new TransformStream({transform(l,i){hb(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 $c;function Js(l){return l.reduce((i,s)=>i+s.length,0)}function Fs(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 bb(l,i){$c||($c=new TextDecoder);const s=[];let r=0,f=-1,d=!1;return new TransformStream({transform(m,y){for(s.push(m);;){if(r===0){if(Js(s)<1)break;const g=Fs(s,1);d=(g[0]&128)===128,f=g[0]&127,f<126?r=3:f===126?r=1:r=2}else if(r===1){if(Js(s)<2)break;const g=Fs(s,2);f=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),r=3}else if(r===2){if(Js(s)<8)break;const g=Fs(s,8),v=new DataView(g.buffer,g.byteOffset,g.length),b=v.getUint32(0);if(b>Math.pow(2,21)-1){y.enqueue(uo);break}f=b*Math.pow(2,32)+v.getUint32(4),r=3}else{if(Js(s)<f)break;const g=Fs(s,f);y.enqueue(Mo(d?g:$c.decode(g),i)),r=0}if(f===0||f>l){y.enqueue(uo);break}}}})}const y0=4;function tt(l){if(l)return Ab(l)}function Ab(l){for(var i in tt.prototype)l[i]=tt.prototype[i];return l}tt.prototype.on=tt.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};tt.prototype.once=function(l,i){function s(){this.off(l,s),i.apply(this,arguments)}return s.fn=i,this.on(l,s),this};tt.prototype.off=tt.prototype.removeListener=tt.prototype.removeAllListeners=tt.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};tt.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};tt.prototype.emitReserved=tt.prototype.emit;tt.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};tt.prototype.hasListeners=function(l){return!!this.listeners(l).length};const br=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,s)=>s(i,0),Gt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Sb="arraybuffer";function v0(l,...i){return i.reduce((s,r)=>(l.hasOwnProperty(r)&&(s[r]=l[r]),s),{})}const qb=Gt.setTimeout,jb=Gt.clearTimeout;function Ar(l,i){i.useNativeTimers?(l.setTimeoutFn=qb.bind(Gt),l.clearTimeoutFn=jb.bind(Gt)):(l.setTimeoutFn=Gt.setTimeout.bind(Gt),l.clearTimeoutFn=Gt.clearTimeout.bind(Gt))}const Eb=1.33;function Nb(l){return typeof l=="string"?Cb(l):Math.ceil((l.byteLength||l.size)*Eb)}function Cb(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 x0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function wb(l){let i="";for(let s in l)l.hasOwnProperty(s)&&(i.length&&(i+="&"),i+=encodeURIComponent(s)+"="+encodeURIComponent(l[s]));return i}function Tb(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 Mb extends Error{constructor(i,s,r){super(i),this.description=s,this.context=r,this.type="TransportError"}}class Ro extends tt{constructor(i){super(),this.writable=!1,Ar(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 Mb(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=Mo(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=wb(i);return s.length?"?"+s:""}}class Rb extends Ro{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)};vb(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,yb(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]=x0()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(i,s)}}let b0=!1;try{b0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const _b=b0;function Ob(){}class Db extends Rb{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 en extends tt{constructor(i,s,r){super(),this.createRequest=i,Ar(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=v0(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=en.requestsCount++,en.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=Ob,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete en.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()}}en.requestsCount=0;en.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",gp);else if(typeof addEventListener=="function"){const l="onpagehide"in Gt?"pagehide":"unload";addEventListener(l,gp,!1)}}function gp(){for(let l in en.requests)en.requests.hasOwnProperty(l)&&en.requests[l].abort()}const kb=(function(){const l=A0({xdomain:!1});return l&&l.responseType!==null})();class zb extends Db{constructor(i){super(i);const s=i&&i.forceBase64;this.supportsBinary=kb&&!s}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new en(A0,this.uri(),i)}}function A0(l){const i=l.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||_b))return new XMLHttpRequest}catch{}if(!i)try{return new Gt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const S0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Bb extends Ro{get name(){return"websocket"}doOpen(){const i=this.uri(),s=this.opts.protocols,r=S0?{}:v0(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;To(r,this.supportsBinary,d=>{try{this.doWrite(r,d)}catch{}f&&br(()=>{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]=x0()),this.supportsBinary||(s.b64=1),this.createUri(i,s)}}const Jc=Gt.WebSocket||Gt.MozWebSocket;class Lb extends Bb{createSocket(i,s,r){return S0?new Jc(i,s,r):s?new Jc(i,s):new Jc(i)}doWrite(i,s){this.ws.send(s)}}class Ub extends Ro{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=bb(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=i.readable.pipeThrough(s).getReader(),f=xb();f.readable.pipeTo(i.writable),this._writer=f.writable.getWriter();const d=()=>{r.read().then(({done:y,value:g})=>{y||(this.onPacket(g),d())}).catch(y=>{})};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&&br(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const Hb={websocket:Lb,webtransport:Ub,polling:zb},Vb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yb=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function co(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=Vb.exec(l||""),d={},m=14;for(;m--;)d[Yb[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=Gb(d,d.path),d.queryKey=Qb(d,d.query),d}function Gb(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 Qb(l,i){const s={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,f,d){f&&(s[f]=d)}),s}const oo=typeof addEventListener=="function"&&typeof removeEventListener=="function",ur=[];oo&&addEventListener("offline",()=>{ur.forEach(l=>l())},!1);class la extends tt{constructor(i,s){if(super(),this.binaryType=Sb,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=co(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=co(s.host).host);Ar(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=Tb(this.opts.query)),oo&&(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"})},ur.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const s=Object.assign({},this.opts.query);s.EIO=y0,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&&la.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",la.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+=Nb(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,br(()=>{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(la.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(),oo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ur.indexOf(this._offlineEventListener);r!==-1&&ur.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,s),this.writeBuffer=[],this._prevBufferLen=0}}}la.protocol=y0;class Xb extends la{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;la.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;la.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 M=new Error("probe error");M.transport=s.name,this.emitReserved("upgradeError",M)}}))};function d(){r||(r=!0,b(),s.close(),s=null)}const m=A=>{const M=new Error("probe error: "+A);M.transport=s.name,d(),this.emitReserved("upgradeError",M)};function y(){m("transport closed")}function g(){m("socket closed")}function v(A){s&&A.name!==s.name&&d()}const b=()=>{s.removeListener("open",f),s.removeListener("error",m),s.removeListener("close",y),this.off("close",g),this.off("upgrading",v)};s.once("open",f),s.once("error",m),s.once("close",y),this.once("close",g),this.once("upgrading",v),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 Kb=class extends Xb{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=>Hb[f]).filter(f=>!!f)),super(i,r)}};function Zb(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=co(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 $b=typeof ArrayBuffer=="function",Jb=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l.buffer instanceof ArrayBuffer,q0=Object.prototype.toString,Fb=typeof Blob=="function"||typeof Blob<"u"&&q0.call(Blob)==="[object BlobConstructor]",Wb=typeof File=="function"||typeof File<"u"&&q0.call(File)==="[object FileConstructor]";function _o(l){return $b&&(l instanceof ArrayBuffer||Jb(l))||Fb&&l instanceof Blob||Wb&&l instanceof File}function cr(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let s=0,r=l.length;s<r;s++)if(cr(l[s]))return!0;return!1}if(_o(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return cr(l.toJSON(),!0);for(const s in l)if(Object.prototype.hasOwnProperty.call(l,s)&&cr(l[s]))return!0;return!1}function Ib(l){const i=[],s=l.data,r=l;return r.data=fo(s,i),r.attachments=i.length,{packet:r,buffers:i}}function fo(l,i){if(!l)return l;if(_o(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]=fo(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]=fo(l[r],i));return s}return l}function Pb(l,i){return l.data=ho(l.data,i),delete l.attachments,l}function ho(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]=ho(l[s],i);else if(typeof l=="object")for(const s in l)Object.prototype.hasOwnProperty.call(l,s)&&(l[s]=ho(l[s],i));return l}const e1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],t1=5;var qe;(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"})(qe||(qe={}));class n1{constructor(i){this.replacer=i}encode(i){return(i.type===qe.EVENT||i.type===qe.ACK)&&cr(i)?this.encodeAsBinary({type:i.type===qe.EVENT?qe.BINARY_EVENT:qe.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let s=""+i.type;return(i.type===qe.BINARY_EVENT||i.type===qe.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=Ib(i),r=this.encodeAsString(s.packet),f=s.buffers;return f.unshift(r),f}}function yp(l){return Object.prototype.toString.call(l)==="[object Object]"}class Oo extends tt{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===qe.BINARY_EVENT;r||s.type===qe.BINARY_ACK?(s.type=r?qe.EVENT:qe.ACK,this.reconstructor=new a1(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(_o(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(qe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===qe.BINARY_EVENT||r.type===qe.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(Oo.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 qe.CONNECT:return yp(s);case qe.DISCONNECT:return s===void 0;case qe.CONNECT_ERROR:return typeof s=="string"||yp(s);case qe.EVENT:case qe.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&e1.indexOf(s[0])===-1);case qe.ACK:case qe.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class a1{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=Pb(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const l1=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Oo,Encoder:n1,get PacketType(){return qe},protocol:t1},Symbol.toStringTag,{value:"Module"}));function $t(l,i,s){return l.on(i,s),function(){l.off(i,s)}}const i1=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class j0 extends tt{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=[$t(i,"open",this.onopen.bind(this)),$t(i,"packet",this.onpacket.bind(this)),$t(i,"error",this.onerror.bind(this)),$t(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(i1.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:qe.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 y=(f=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||f===void 0?void 0:f.writable,g=this.connected&&!(!((d=this.io.engine)===null||d===void 0)&&d._hasPingExpired());return this.flags.volatile&&!y||(g?(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 y=0;y<this.sendBuffer.length;y++)this.sendBuffer[y].id===i&&this.sendBuffer.splice(y,1);s.call(this,new Error("operation has timed out"))},f),m=(...y)=>{this.io.clearTimeoutFn(d),s.apply(this,y)};m.withError=!0,this.acks[i]=m}emitWithAck(i,...s){return new Promise((r,f)=>{const d=(m,y)=>m?f(m):r(y);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:qe.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 qe.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 qe.EVENT:case qe.BINARY_EVENT:this.onevent(i);break;case qe.ACK:case qe.BINARY_ACK:this.onack(i);break;case qe.DISCONNECT:this.ondisconnect();break;case qe.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:qe.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:qe.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 xl(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}xl.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};xl.prototype.reset=function(){this.attempts=0};xl.prototype.setMin=function(l){this.ms=l};xl.prototype.setMax=function(l){this.max=l};xl.prototype.setJitter=function(l){this.jitter=l};class mo extends tt{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,Ar(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 xl({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||l1;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 Kb(this.uri,this.opts);const s=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const f=$t(s,"open",function(){r.onopen(),i&&i()}),d=y=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",y),i?i(y):this.maybeReconnectOnOpen()},m=$t(s,"error",d);if(this._timeout!==!1){const y=this._timeout,g=this.setTimeoutFn(()=>{f(),d(new Error("timeout")),s.close()},y);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}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($t(i,"ping",this.onping.bind(this)),$t(i,"data",this.ondata.bind(this)),$t(i,"error",this.onerror.bind(this)),$t(i,"close",this.onclose.bind(this)),$t(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){br(()=>{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 j0(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 yi={};function or(l,i){typeof l=="object"&&(i=l,l=void 0),i=i||{};const s=Zb(l,i.path||"/socket.io"),r=s.source,f=s.id,d=s.path,m=yi[f]&&d in yi[f].nsps,y=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let g;return y?g=new mo(r,i):(yi[f]||(yi[f]=new mo(r,i)),g=yi[f]),s.query&&!i.query&&(i.query=s.queryKey),g.socket(s.path,i)}Object.assign(or,{Manager:mo,Socket:j0,io:or,connect:or});const E0=window.location.origin;console.info("[socket] connecting to",E0);const Do=or(E0,{transports:["polling","websocket"],timeout:15e3});Do.on("connect_error",l=>console.error("connect_error",l.code,l.message,l.data));const N0=p.createContext(Do),s1=({children:l})=>o.jsx(N0.Provider,{value:Do,children:l}),wa=()=>p.useContext(N0),C0=p.createContext({connected:!1,session:null,logs:[],login:async()=>{},setRole:async()=>{},requestControl:async()=>{},releaseControl:async()=>{},subscribeAll:async()=>{},homeAssistantToggle:async()=>{},homeAssistantSetState:async()=>{},setNickname:async()=>{}});function r1(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 u1({children:l}){const i=wa(),s=r1(i),[r,f]=p.useState(null),[d,m]=p.useState([]),[y,g]=p.useState([]),[v,b]=p.useState(i.connected);p.useEffect(()=>{const E=()=>b(!0),C=()=>b(!1);return i.on("connect",E),i.on("disconnect",C),()=>{i.off("connect",E),i.off("disconnect",C)}},[i]),p.useEffect(()=>{function E(S){f(S)}function C(S=[]){m(S)}function N(S){m(T=>[...T.slice(-199),S])}return i.on("session:sync",E),i.on("log:init",C),i.on("log:entry",N),i.on("alert:new",(S={})=>{g(T=>[...T.slice(-49),{...S,receivedAt:Date.now()}])}),()=>{i.off("session:sync",E),i.off("log:init",C),i.off("log:entry",N),i.off("alert:new")}},[i]);const A=p.useMemo(()=>({login:(E,C)=>s("auth:login",{username:E,password:C}),setRole:E=>s("session:setRole",{role:E}),requestControl:(E,C={})=>s("session:requestControl",{roverId:E,...C}),releaseControl:E=>s("session:releaseControl",{roverId:E}),subscribeAll:()=>s("session:subscribeAll"),lockRover:(E,C)=>s("session:lockRover",{roverId:E,locked:C}),setMode:E=>s("setMode",{mode:E}),homeAssistantToggle:E=>s("homeAssistant:toggle",{entityId:E}),homeAssistantSetState:(E,C)=>s("homeAssistant:setState",{entityId:E,state:C}),setNickname:E=>s("nickname:set",{nickname:E}),pushAlert:E=>g(C=>[...C.slice(-49),{...E,receivedAt:Date.now(),id:E.id||Math.random().toString(36).slice(2)}])}),[s]),M=p.useMemo(()=>({connected:v,session:r,logs:d,alerts:y,...A}),[A,y,v,d,r]);return o.jsx(C0.Provider,{value:M,children:l})}function Xe(){return p.useContext(C0)}const w0=p.createContext({frames:{}});function c1({children:l}){const i=wa(),[s,r]=p.useState({});p.useEffect(()=>{function d({roverId:m,sensors:y={},frame:g={}}){m&&r(v=>({...v,[m]:{roverId:m,sensors:y,raw:g?.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(w0.Provider,{value:f,children:l})}function ko(){return p.useContext(w0).frames}function Ti(l){const i=ko();return l?i[l]??null:null}function zo(){const{connected:l,session:i}=Xe(),s=i?.assignment?.roverId,r=Ti(s),f=r?.sensors||{},d=f.voltageMv!=null?`${(f.voltageMv/1e3).toFixed(2)} V`:null,m=f.currentMa!=null?`${f.currentMa} mA`:null,y=f.batteryTemperatureC!=null?`${f.batteryTemperatureC} °C`:null,g=f.batteryChargeMah,v=f.batteryCapacityMah,b=r?.receivedAt?new Date(r.receivedAt).toLocaleTimeString():null,A=r?.raw?r.raw:null,M=s?i?.activeDrivers?.[s]:null,E=p.useMemo(()=>s?M?M===i?.socketId?"You":(i?.users||[]).find(N=>N.socketId===M)?.nickname||M.slice(0,6):"Available":"n/a",[M,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 ",E]})]}),s?r?o.jsxs(o.Fragment,{children:[o.jsx(o1,{sensors:f,voltage:d,current:m,batteryTemp:y,charge:g,capacity:v}),o.jsx(f1,{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 o1({sensors:l,voltage:i,current:s,batteryTemp:r,charge:f,capacity:d}){const m=f!=null&&d?`${Math.round(f/d*100)}%`:"--",y=l?.oiMode?.label||"--",g=l?.chargingSources?.homeBase?"Yes":"No",v=l?.chargingState?.label||"--";return o.jsxs("div",{className:"grid grid-cols-2 gap-0.5 md:grid-cols-3",children:[o.jsx(jn,{label:"Voltage",value:i??"--"}),o.jsx(jn,{label:"Current",value:s??"--"}),o.jsx(jn,{label:"Battery temp",value:r??"--"}),o.jsx(jn,{label:"Charge",value:f!=null?`${f} mAh`:"--"}),o.jsx(jn,{label:"Capacity",value:d!=null?`${d} mAh`:"--"}),o.jsx(jn,{label:"Charge %",value:m}),o.jsx(jn,{label:"OI mode",value:y}),o.jsx(jn,{label:"Docked",value:g}),o.jsx(jn,{label:"Charging state",value:v})]})}function jn({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 f1({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(hl,{title:"Dock IR (raw)",children:[o.jsx(Yt,{label:"Left",value:ta(l?.infraredCharacterLeft)}),o.jsx(Yt,{label:"Omni",value:ta(l?.infraredCharacterOmni)}),o.jsx(Yt,{label:"Right",value:ta(l?.infraredCharacterRight)})]}),o.jsxs(hl,{title:"Bumps & drops",children:[o.jsx(Yt,{label:"Bump L",value:o.jsx(vi,{active:i.bumpLeft})}),o.jsx(Yt,{label:"Bump R",value:o.jsx(vi,{active:i.bumpRight})}),o.jsx(Yt,{label:"Wheel drop L",value:o.jsx(vi,{active:i.wheelDropLeft,tone:"amber"})}),o.jsx(Yt,{label:"Wheel drop R",value:o.jsx(vi,{active:i.wheelDropRight,tone:"amber"})})]}),o.jsx(hl,{title:"Light bumps (raw)",children:r.map(m=>o.jsx(Yt,{label:m.label,value:ta(m.value)},m.label))}),o.jsx(hl,{title:"Cliff sensors",children:f.map(m=>o.jsx(Yt,{label:m.label,value:`${ta(m.value)} · ${m.active?"bool: true":"bool: false"}`},m.label))}),o.jsx(hl,{title:"Currents",children:d.map(m=>o.jsx(Yt,{label:m.label,value:o.jsxs("span",{className:"flex items-center gap-0.5",children:[o.jsx("span",{children:ta(m.value,"mA")}),m.over?o.jsx(vi,{active:!0,tone:"red",label:"over"}):null]})},m.label))}),o.jsxs(hl,{title:"Dirt detect",children:[o.jsx(Yt,{label:"Left",value:ta(l?.dirtDetectLeft)}),o.jsx(Yt,{label:"Right",value:ta(l?.dirtDetect)})]})]})}function hl({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 Yt({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 vi({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 ta(l,i){return l==null||Number.isNaN(l)?"--":i?`${l} ${i}`:l}const Fc={main:[-127,127],side:[-127,127],vacuum:[0,127]},Wc={maxSpeed:500,baseSpeed:250,boostSpeed:400},po=100,Bo=[31,127],ml=60,go=8,d1=250,h1={start:[128],safe:[131],full:[132],passive:[128],dock:[143]},bi={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"]},T0=[{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:po},{type:"oi",command:"dock"},{type:"pause",duration:po},{type:"oi",command:"full"}]},{id:"seek-dock",label:"Dock",description:"Send the seek dock command.",steps:[{type:"oi",command:"dock"}]}];function yo(){return{vector:{x:0,y:0,boost:!1},speeds:{left:0,right:0},source:null,lastUpdatedAt:0}}function vo(){return{main:0,side:0,vacuum:0}}function m1(){return{enabled:!1,angle:null,config:null}}function fr(){return{note:ml}}const vp={roverId:null,mode:"drive",drive:yo(),aux:vo(),camera:m1(),song:fr(),macros:T0,keymap:bi,inputs:{}};function p1(l,i){switch(i.type){case"control/set-rover":return{...l,roverId:i.payload??null,drive:i.payload?l.drive:yo(),aux:i.payload?l.aux:vo(),song:i.payload?l.song:fr()};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:yo(),aux:vo(),song:fr()};case"control/set-song-note":return{...l,song:{...l.song||fr(),note:i.payload??ml}};default:return l}}function pl(l,i,s){return typeof l!="number"||Number.isNaN(l)?i:Math.max(i,Math.min(s,l))}function Nn(l){return typeof l!="number"||Number.isNaN(l)?0:Math.max(-1,Math.min(1,l))}function qa(l,i){return!Array.isArray(i)||i.length!==2?l:pl(l,i[0],i[1])}function g1(l={}){const i=Nn(l.x??0),s=Nn(l.y??0);return{x:i,y:s,boost:!!l.boost}}function y1(l={},i={}){const s=g1(l),r=typeof i.maxSpeed=="number"?i.maxSpeed:Wc.maxSpeed,f=typeof i.baseSpeed=="number"?i.baseSpeed:Wc.baseSpeed,d=typeof i.boostSpeed=="number"?i.boostSpeed:Wc.boostSpeed,m=s.boost?d:f,y=s.y*m,g=s.x*m;return{vector:s,speeds:{left:pl(Math.round(y+g),-r,r),right:pl(Math.round(y-g),-r,r)}}}function v1(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 xp(l){return new Promise(i=>setTimeout(i,l))}function x1(){const l=wa(),{session:i}=Xe(),s=i?.assignment?.roverId,r=p.useMemo(()=>!s||!Array.isArray(i?.roster)?null:i.roster.find(N=>String(N.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((N,S)=>{s&&l.emit("command",{roverId:s,...N},S)},[l,s]),y=p.useCallback(()=>{s&&m({type:"sensorStream",data:{sensorStream:{enable:!0}}})},[m,s]),g=p.useCallback(N=>{if(!s)return null;const S={left:qa(N?.left??0,[-500,500]),right:qa(N?.right??0,[-500,500])};return m({type:"drive",data:{driveDirect:S}}),S},[m,s]),v=p.useCallback(({main:N=0,side:S=0,vacuum:T=0}={})=>{if(!s)return null;const _={main:qa(N,Fc.main),side:qa(S,Fc.side),vacuum:qa(T,Fc.vacuum)};return m({type:"motors",data:{motorPwm:_}}),_},[m,s]),b=p.useCallback(N=>!s||!f?null:(m({type:"servo",data:{servo:{angle:N}}}),N),[m,s,f]),A=p.useCallback(N=>{if(!s)return!1;const S=Array.isArray(N)?N:typeof N=="string"?h1[N]:null;return S?(m({type:"raw",data:{raw:v1(S)}}),y(),!0):!1},[m,y,s]),M=p.useCallback(async N=>{if(!(!N||!Array.isArray(N.steps)||!s))for(const S of N.steps){if(!s)break;switch(S.type){case"oi":A(S.command);break;case"drive":g(S.speeds??{left:0,right:0});break;case"motors":v(S.values??{});break;case"servo":b(S.angle);break;case"pause":await xp(S.duration??po);break}if(S.delay||S.delayMs){const T=S.delayMs??S.delay;typeof T=="number"&&T>0&&await xp(T)}}},[s,A,g,v,b]),E=p.useCallback((N="toggle")=>!s||!d?null:(m({type:"nightVision",data:{nightVision:{action:N}}}),N),[m,d,s]),C=p.useCallback((N=[],S={})=>{if(!s)return null;const _=(Array.isArray(N)&&N.length>0?N:[{note:ml,duration:go}]).slice(0,16).map(G=>({note:qa(Math.round(G?.note??ml),Bo),duration:qa(Math.round(G?.duration??go),[1,255])}));return m({type:"song",data:{song:{notes:_,slot:S.slot,loop:S.loop}}}),_},[m,s]);return p.useMemo(()=>({roverId:s,rosterEntry:r,servoConfig:f,nightVision:d,emitCommand:m,enableSensorStream:y,sendDriveDirect:g,sendAuxMotors:v,sendServoAngle:b,sendOiCommand:A,sendNightVision:E,sendSong:C,runMacroSteps:M}),[s,r,f,d,m,y,g,v,b,A,E,M])}const b1={"{":"[","}":"]",":":";",'"':"'","<":",",">":".","?":"/","|":"\\",_:"-","+":"="},bp={"[":"BracketLeft","]":"BracketRight","\\":"Backslash",";":"Semicolon","'":"Quote",",":"Comma",".":"Period","/":"Slash","-":"Minus","=":"Equal","`":"Backquote"};function Mi(l){if(typeof l!="string")return"";const i=l.toLowerCase();return b1[i]??i}function A1(l){const i=Mi(l);if(!i)return null;if(bp[i])return bp[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 M0(l){const i=Mi(l);return i?`key:${i}`:null}function S1(l){const i=A1(l);return i?`code:${i}`:null}function Ap(l){const i=new Set,s=M0(l?.key??"");s&&i.add(s);const r=l?.code?`code:${l.code}`:null;return r&&i.add(r),Array.from(i)}function q1(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=M0(String(d));m&&f.add(m);const y=S1(String(d));y&&f.add(y)}),[i,f]}))}function gl(l){const i=Mi(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 R0="roverSettings",j1=3600*24*365;function E1(l){try{const i=decodeURIComponent(l??"");return JSON.parse(i)}catch(i){return console.warn("Failed to parse settings cookie",i),null}}function Sp(){if(typeof document>"u")return{};const l=`${R0}=`,i=document.cookie.split(";").map(r=>r.trim()).find(r=>r.startsWith(l));if(!i)return{};const s=i.substring(l.length);return E1(s)??{}}function qp(l){if(typeof document>"u")return!1;try{const i=encodeURIComponent(JSON.stringify(l??{})),s=`${R0}=${i}; path=/; max-age=${j1}; samesite=strict`;return document.cookie=s,!0}catch(i){return console.warn("Failed to write settings cookie",i),!1}}const _0=p.createContext(null);function mr({children:l}){const[i,s]=p.useState(()=>({status:"loading",data:{}}));p.useEffect(()=>{const y=Sp();s({status:"ready",data:y??{}})},[]);const r=p.useCallback(()=>{const y=Sp();s({status:"ready",data:y??{}})},[]),f=p.useCallback(y=>{const g=qp(y??{});return s(g?{status:"ready",data:y??{}}:v=>({...v,status:"error"})),g},[]),d=p.useCallback((y,g)=>{s(v=>{const b=v.data[y]||{},A=typeof g=="function"?g(b):{...b,...g??{}},M={...v.data,[y]:A};return qp(M)?{status:"ready",data:M}:{...v,status:"error"}})},[]),m=p.useMemo(()=>({data:i.data,status:i.status,reload:r,saveAll:f,setNamespace:d}),[i,r,f,d]);return o.jsx(_0.Provider,{value:m,children:l})}function N1(){const l=p.useContext(_0);if(!l)throw new Error("useSettings must be used within SettingsProvider");return l}function Rt(l,i={}){const{data:s,status:r,setNamespace:f}=N1(),d=s[l]??i??{},m=p.useCallback(v=>{f(l,b=>{const A=b??{};return typeof v=="function"?v(A):{...A,...v??{}}})},[l,f]),y=p.useCallback(v=>{f(l,()=>v??{})},[l,f]),g=p.useCallback(()=>{const v=typeof i=="object"?{...i}:i;f(l,()=>v??{})},[i,l,f]);return{value:d,status:r,save:m,replace:y,reset:g}}const O0=p.createContext(null);function jp(l){return Object.fromEntries(Object.entries(l||{}).map(([i,s])=>[i,Array.isArray(s)?[...s]:[]]))}function C1(l,i){if(!l)return i;const s=typeof l.minAngle=="number"?l.minAngle:-45,r=typeof l.maxAngle=="number"?l.maxAngle:45;return pl(i,s,r)}function w1({children:l}){const i=x1(),[s,r]=p.useReducer(p1,vp),f=p.useRef(null),d=p.useRef(!1),m=p.useRef(vp.camera.angle),{value:y,save:g}=Rt("controls",{keymap:bi,macros:T0}),{session:v,homeAssistantSetState:b}=Xe(),A=p.useCallback(()=>{const te=(v?.homeAssistant?.entities||[]).filter(oe=>(oe.type==="light"||oe.type==="switch")&&oe.available!==!1&&oe.state!=="on");if(te.length===0){d.current=!1;return}d.current=!0,te.forEach(oe=>{b(oe.id,"on").catch(()=>{})}),d.current=!1},[v?.homeAssistant?.entities,b]);p.useEffect(()=>{r({type:"control/set-rover",payload:i.roverId})},[i.roverId]),p.useEffect(()=>{const $=f.current;f.current=s.mode,$!=="drive"&&s.mode==="drive"&&v?.homeAssistant?.entities?A():$!=="drive"&&s.mode==="drive"&&(d.current=!0)},[s.mode,v?.homeAssistant?.entities,A]),p.useEffect(()=>{d.current&&v?.homeAssistant?.entities&&A()},[v?.homeAssistant?.entities,A]),p.useEffect(()=>{const $={...bi,...y?.keymap||{}};r({type:"control/set-keymap",payload:$}),y?.macros&&r({type:"control/set-macros",payload:y.macros})},[y?.keymap,y?.macros]),p.useEffect(()=>{const $=i.servoConfig;if(!$){r({type:"control/set-camera-config",payload:{config:null}}),m.current=null;return}const te=typeof $.minAngle=="number"?$.minAngle:-45,oe=typeof $.maxAngle=="number"?$.maxAngle:45,z=typeof $.homeAngle=="number"?$.homeAngle:(te+oe)/2,B=typeof m.current=="number"?pl(m.current,te,oe):null,J=B??pl(z,te,oe);r({type:"control/set-camera-config",payload:{config:$,angle:J}}),m.current=J},[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 M=p.useCallback($=>{r({type:"control/set-mode",payload:$})},[]),E=p.useCallback(($,te={})=>{const oe=y1($,te.speedOptions);r({type:"control/update-drive",payload:{...oe,source:te.source??null}}),i.sendDriveDirect(oe.speeds)},[i]),C=p.useCallback(($={})=>{const te=i.sendAuxMotors($)??$;r({type:"control/set-aux-motors",payload:te})},[i]),N=p.useCallback(($,te)=>{if(!$)return!1;const oe=Mi(te);if(!oe)return!1;const z=jp(s.keymap);return z[$]=[oe],r({type:"control/set-keymap",payload:z}),g(B=>({...B??{},keymap:z})),!0},[s.keymap,g]),S=p.useCallback(()=>{const $=jp(bi);r({type:"control/set-keymap",payload:$}),g(te=>({...te??{},keymap:$}))},[g]),T=p.useCallback($=>{if(!i.servoConfig)return;const te=C1(i.servoConfig,$);r({type:"control/set-camera-angle",payload:te}),i.sendServoAngle(te),m.current=te},[i]),_=p.useCallback(($=0)=>{const te=i.servoConfig;if(!te)return;const oe=typeof $=="number"&&$!==0?$:te.nudgeDegrees||1,z=typeof m.current=="number"?m.current:typeof te.homeAngle=="number"?te.homeAngle:0;T(z+oe)},[i.servoConfig,T]),G=p.useCallback(()=>{const $=i.servoConfig;if(!$)return;const te=typeof $.homeAngle=="number"?$.homeAngle:typeof $.minAngle=="number"&&typeof $.maxAngle=="number"?($.minAngle+$.maxAngle)/2:0;T(te)},[i.servoConfig,T]),F=p.useCallback(async $=>{const te=s.macros.find(oe=>oe.id===$)||null;te&&($==="drive-sequence"&&(A(),v?.homeAssistant?.entities||(d.current=!0)),await i.runMacroSteps(te))},[i,s.macros,v?.homeAssistant?.entities,A]),ee=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]),I=p.useCallback($=>{i.sendOiCommand($)},[i]),V=p.useCallback($=>{i.roverId&&i.emitCommand({type:"sensorStream",data:{sensorStream:{enable:$}}})},[i]),Z=p.useCallback(()=>{i.sendNightVision("toggle")},[i]),P=p.useCallback($=>{const te=typeof $=="number"?$:ml;return r({type:"control/set-song-note",payload:te}),te},[]),ue=p.useCallback(($,te)=>i.sendSong($,te),[i]),be=p.useCallback(($,te)=>{r({type:"control/register-input-state",payload:{source:$,state:te}})},[]),me=p.useMemo(()=>({state:s,dispatch:r,pipeline:i,actions:{setMode:M,setDriveVector:E,setAuxMotors:C,setServoAngle:T,nudgeServo:_,goServoHome:G,runMacro:F,stopAllMotion:ee,sendOiCommand:I,setSensorStream:V,toggleNightVision:Z,updateKeyBinding:N,resetKeyBindings:S,registerInputState:be,setSongNote:P,sendSong:ue}}),[s,i,M,E,C,T,_,G,F,ee,I,V,Z,N,S,be,P,ue]);return o.jsx(O0.Provider,{value:me,children:l})}function Qt(){const l=p.useContext(O0);if(!l)throw new Error("useControlSystem must be used within ControlSystemProvider");return l}const T1="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=",D0=p.createContext({messages:[],sendMessage:async()=>{},focusChat:()=>{},blurChat:()=>{},registerInputRef:()=>{},onInputFocus:()=>{},onInputBlur:()=>{},isChatFocused:!1});function M1({children:l}){const i=wa(),{session:s}=Xe(),[r,f]=p.useState([]),[d,m]=p.useState(!1),y=p.useRef(null),g=p.useRef(null);p.useEffect(()=>{g.current=new Audio(T1),g.current.load()},[]);const v=p.useCallback(()=>{const T=g.current;T&&(T.currentTime=0,T.play().catch(()=>{}))},[]);p.useEffect(()=>{function T(_={}){f(G=>[...G.slice(-99),_]),!(_?.socketId&&s?.socketId&&_.socketId===s.socketId)&&v()}return i.on("chat:message",T),()=>{i.off("chat:message",T)}},[v,s?.socketId,i]);const b=p.useCallback((T,_=null)=>new Promise((G,F)=>{i.emit("chat:send",{text:T,tts:_},(ee={})=>{ee.error?F(new Error(ee.error)):G(ee)})}),[i]),A=p.useCallback(T=>{y.current=T},[]),M=p.useCallback(()=>{m(!0),y.current?.focus()},[]),E=p.useCallback(()=>{m(!1),y.current?.blur()},[]),C=p.useCallback(()=>m(!0),[]),N=p.useCallback(()=>m(!1),[]),S=p.useMemo(()=>({messages:r,sendMessage:b,focusChat:M,blurChat:E,registerInputRef:A,onInputFocus:C,onInputBlur:N,isChatFocused:d,selfSocketId:s?.socketId||null}),[E,M,d,r,N,C,A,b,s?.socketId]);return o.jsx(D0.Provider,{value:S,children:l})}function k0(){const l=p.useContext(D0);if(!l)throw new Error("useChat must be used inside ChatProvider");return l}const ot={keyboard:{baseSpeed:250,turboSpeed:400,precisionSpeed:125,tiltSpeed:80,tiltIntervalMs:110},gamepad:{driveDeadzone:.2,cameraDeadzone:.25,servoStep:2,auxReverseScale:.55}},pr={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}},Ic="keyboard",Pc={x:0,y:0,boost:!1},eo={main:0,side:0,vacuum:0},Ep=Bo[0],Np=Bo[1],Lo=5,Si=500,qi=1,Uo=100;function to(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(0,Math.min(500,s)):i}function R1(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(Lo,Math.min(Si,s)):i}function z0(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(qi,Math.min(Uo,s)):i}function _1(l){const s=(z0(l,l)-qi)/(Uo-qi),r=Si-s*(Si-Lo);return Math.round(r)}function O1(l){const i=R1(l,l),s=(Si-i)/(Si-Lo),r=qi+s*(Uo-qi);return Math.round(r)}function D1(l){const i=l.target;if(!i)return!1;const s=i.tagName;return s==="INPUT"||s==="TEXTAREA"||i.isContentEditable||s==="SELECT"}function et(l,i){if(!l||l.size===0)return!1;for(const s of i)if(l.has(s))return!0;return!1}function k1(l,i){const s=et(i.driveForward,l),r=et(i.driveBackward,l),f=et(i.driveLeft,l),d=et(i.driveRight,l),m=et(i.boostModifier,l),y=et(i.slowModifier,l);let g=0;s&&!r?g=1:r&&!s&&(g=-1);let v=0;f&&!d?v=-1:d&&!f&&(v=1);const b=y?.4:1;return{x:v*b,y:g*b,boost:m&&!y}}function z1(l,i){if(et(i.auxAllForward,l))return{main:127,side:127,vacuum:127};const r=et(i.auxMainForward,l)?127:et(i.auxMainReverse,l)?-127:0,f=et(i.auxSideForward,l)?127:et(i.auxSideReverse,l)?-70:0,d=et(i.auxVacuumFast,l)?127:et(i.auxVacuumSlow,l)?50:0;return{main:r,side:f,vacuum:d}}function B1(){const{state:l,actions:{setMode:i,setDriveVector:s,setAuxMotors:r,nudgeServo:f,runMacro:d,stopAllMotion:m,registerInputState:y,toggleNightVision:g,setSongNote:v,sendSong:b}}=Qt(),{focusChat:A,blurChat:M,isChatFocused:E}=k0(),{value:C}=Rt("inputs",ot),N=p.useMemo(()=>q1(l.keymap),[l.keymap]),S=p.useMemo(()=>{const W=new Set;return Object.values(N).forEach(le=>{le&&le.forEach(q=>W.add(q))}),W},[N]),T=p.useMemo(()=>{const W=ot.keyboard,le=C?.keyboard??{};return{baseSpeed:to(le.baseSpeed,W.baseSpeed),turboSpeed:to(le.turboSpeed,W.turboSpeed),precisionSpeed:to(le.precisionSpeed,W.precisionSpeed)}},[C?.keyboard]),_=p.useMemo(()=>{const W=ot.keyboard,le=C?.keyboard??{},q=z0(typeof le.tiltSpeed=="number"?le.tiltSpeed:typeof le.tiltIntervalMs=="number"?O1(le.tiltIntervalMs):W.tiltSpeed,W.tiltSpeed);return _1(q)},[C?.keyboard]),G=p.useMemo(()=>Math.abs(l.camera?.config?.nudgeDegrees||1),[l.camera?.config?.nudgeDegrees]),F=p.useRef(new Set),ee=p.useRef(Pc),I=p.useRef(eo),V=p.useRef(null),Z=p.useRef(null),P=p.useCallback(()=>{const W=new Set(F.current);et(N.boostModifier,W);const q=et(N.slowModifier,W)?{baseSpeed:T.precisionSpeed,boostSpeed:T.precisionSpeed}:{baseSpeed:T.baseSpeed,boostSpeed:T.turboSpeed},U=k1(W,N),X=z1(W,N);(U.x!==ee.current.x||U.y!==ee.current.y||U.boost!==ee.current.boost)&&(ee.current=U,s(U,{source:Ic,speedOptions:q})),(X.main!==I.current.main||X.side!==I.current.side||X.vacuum!==I.current.vacuum)&&(I.current=X,r(X)),y(Ic,{keys:Array.from(W),vector:U,aux:X})},[N,T,y,r,s]),ue=p.useCallback(()=>{V.current&&(clearTimeout(V.current),V.current=null)},[]),be=p.useCallback(()=>{const W=new Set(F.current),le=et(N.cameraUp,W),q=et(N.cameraDown,W);return(le?1:0)-(q?1:0)},[N]),me=p.useCallback(()=>{if(be()===0){ue();return}if(V.current)return;const le=()=>{const q=be();if(q===0){ue();return}f(q*G),V.current=setTimeout(le,_)};V.current=setTimeout(le,0)},[be,f,_,G,ue]),$=p.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),te=p.useCallback(()=>{const W=new Set(F.current),le=et(N.songNoteUp,W),q=et(N.songNoteDown,W);return(le?1:0)-(q?1:0)},[N]),oe=p.useCallback(W=>{if(W===0)return;let q=(typeof l.song?.note=="number"?l.song.note:ml)+W;q>Np?q=Ep:q<Ep&&(q=Np);const U=v(q);b([{note:U,duration:go}],{slot:0})},[b,v,l.song?.note]),z=p.useCallback(()=>{if(te()===0){$();return}if(Z.current)return;const le=()=>{const q=te();if(q===0){$();return}oe(q),Z.current=setTimeout(le,d1)};Z.current=setTimeout(le,0)},[te,$,oe]),B=p.useCallback(()=>{F.current.clear(),ee.current=Pc,I.current=eo,ue(),$(),m(),y(Ic,{keys:[],vector:Pc,aux:eo})},[y,m,ue,$]);p.useEffect(()=>{function W(U){if(D1(U))return;const X=Ap(U);if(X.length===0)return;const K=new Set(X);if(et(N.chatFocus,K)){U.preventDefault(),B(),E?M():A();return}X.some(se=>S.has(se))&&U.preventDefault();const ne=X.filter(se=>!F.current.has(se));ne.forEach(se=>F.current.add(se)),ne.length>0&&(ne.some(se=>N.driveMacro?.has(se))?(i("drive"),d("drive-sequence")):ne.some(se=>N.dockMacro?.has(se))?(i("dock"),d("seek-dock")):ne.some(se=>N.nightVisionToggle?.has(se))&&g()),me(),z(),P()}function le(U){Ap(U).forEach(K=>F.current.delete(K)),me(),z(),P()}function q(){B()}return window.addEventListener("keydown",W),window.addEventListener("keyup",le),window.addEventListener("blur",q),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",le),window.removeEventListener("blur",q)}},[S,M,P,me,z,A,E,N.chatFocus,N.dockMacro,N.driveMacro,B,d,i,m,$]);const J=p.useRef(B);return p.useEffect(()=>{J.current=B},[B]),p.useEffect(()=>{J.current()},[l.roverId]),p.useEffect(()=>()=>{ue(),$()},[ue,$]),null}const Ws="gamepad";function no(l,i){return Math.abs(l)<i?0:l}function Cp(l,i){return l&&i&&l.x===i.x&&l.y===i.y&&l.boost===i.boost}function wp(l,i){return l&&i&&l.main===i.main&&l.side===i.side&&l.vacuum===i.vacuum}function L1(){const{actions:{setMode:l,setDriveVector:i,setAuxMotors:s,nudgeServo:r,runMacro:f,registerInputState:d}}=Qt(),{value:m}=Rt("inputs",ot),{value:y}=Rt("gamepadMapping",pr),g=m.gamepad??ot.gamepad,v=Math.min(Math.max(g.driveDeadzone??.2,0),.8),b=Math.min(Math.max(g.cameraDeadzone??.25,0),.9),A=g.servoStep??ot.gamepad.servoStep,M=g.auxReverseScale??ot.gamepad.auxReverseScale,E=!!(y?.drive?.horizontal&&y?.drive?.vertical),C=!!y?.camera?.vertical,N=!!y?.brushes?.mainAxis,S=!!y?.brushes?.sideAxis,T=N||S,_=!!y?.buttons?.vacuum,G=!!y?.buttons?.allAux,F=_||G,ee=!!y?.buttons?.mainReverse,I=!!y?.buttons?.sideReverse,V=ee||I,Z=!!y?.buttons?.drive,P=!!y?.buttons?.dock,be=E||C||T||F||V||(Z||P),me=p.useRef(null),$=p.useRef({x:0,y:0,boost:!1}),te=p.useRef({main:0,side:0,vacuum:0}),oe=p.useRef(new Map),z=p.useRef(0),B=p.useRef({main:!1,side:!1}),J=p.useCallback((X,K)=>{const ne=oe.current.get(X)||!1;return oe.current.set(X,K),K&&!ne},[]),W=p.useCallback((X,K)=>{if(!K)return 0;const ne=X.axes?.[K.index]??0;return K.invert?-ne:ne},[]),le=p.useCallback((X,K)=>{if(!K)return 0;const ne=X.buttons?.[K.index];return ne?typeof ne.value=="number"?ne.value:ne.pressed?1:0:0},[]),q=p.useCallback((X,K)=>{if(!K)return!1;const ne=X.buttons?.[K.index];return ne?ne.pressed||ne.value>.5:!1},[]),U=p.useCallback(()=>{if(typeof navigator>"u"||!navigator.getGamepads)return;const X=navigator.getGamepads(),K=X&&Array.from(X).find(Boolean);if(!K){Cp($.current,{x:0,y:0,boost:!1})||($.current={x:0,y:0,boost:!1},i({x:0,y:0,boost:!1},{source:Ws})),wp(te.current,{main:0,side:0,vacuum:0})||(te.current={main:0,side:0,vacuum:0},s({main:0,side:0,vacuum:0})),d(Ws,{connected:!1,mappingReady:be});return}const ne=E?Nn(no(W(K,y.drive.horizontal),v)):0,se=E?Nn(no(-W(K,y.drive.vertical),v)):0,pe={x:ne,y:se,boost:!1};Cp(pe,$.current)||($.current=pe,i(pe,{source:Ws}));const Ye=N?W(K,y.brushes.mainAxis):0,Oe=Math.round(Math.min(Math.abs(Ye),1)*127),an=B.current.main?-Oe:Oe,Tn=S?W(K,y.brushes.sideAxis):0,ln=Math.round(Math.min(Math.abs(Tn),1)*127),Ae=B.current.side?-Math.round(ln*M):Math.round(ln*M),Ue=_&&q(K,y.buttons.vacuum)?127:0;let Ke={main:N?an:0,side:S?Ae:0,vacuum:Ue};G&&q(K,y.buttons.allAux)&&(Ke={main:127,side:127,vacuum:127}),wp(Ke,te.current)||(te.current=Ke,s(Ke));const Ne=C?Nn(no(-W(K,y.camera.vertical),b)):0,He=performance.now();C&&Math.abs(Ne)>.25&&He-z.current>120&&(z.current=He,r(Ne>0?A:-A)),ee&&J("toggle-main",q(K,y.buttons.mainReverse))&&(B.current.main=!B.current.main),I&&J("toggle-side",q(K,y.buttons.sideReverse))&&(B.current.side=!B.current.side),Z&&J(`macro-${y.buttons.drive.index}`,q(K,y.buttons.drive))&&(l("drive"),f("drive-sequence")),P&&J(`macro-${y.buttons.dock.index}`,q(K,y.buttons.dock))&&(l("dock"),f("seek-dock")),d(Ws,{connected:!0,mappingReady:be,id:K.id,index:K.index,axes:[ne,se,Ne],reverse:{...B.current},bindings:{drive:E,camera:C,brushes:T,auxButtons:{vacuum:_,allAux:G},reverseButtons:{main:ee,side:I},macros:{drive:Z,dock:P}}})},[M,b,v,W,le,J,q,y.buttons?.allAux,y.buttons?.dock,y.buttons?.drive,y.buttons?.mainReverse,y.buttons?.sideReverse,y.buttons?.vacuum,y.camera?.vertical,y.drive?.horizontal,y.drive?.vertical,y.brushes?.mainAxis,y.brushes?.sideAxis,be,r,d,f,A,s,i,l]);return p.useEffect(()=>{function X(){U(),me.current=requestAnimationFrame(X)}return me.current=requestAnimationFrame(X),()=>{me.current&&cancelAnimationFrame(me.current)}},[U]),null}function xo({sensors:l={},variant:i="full",size:s,overlay:r=!1}){const f=s||(i==="mini"?190:260),d=f/2,m=d*.8,y=m-4,g=m+4,v=m-14,b=m-6,A=m*.65,M=l?.bumpsAndWheelDrops||{},E=l?.wheelOvercurrents||{},C=l?.wheelLeftCurrentMa??0,N=l?.wheelRightCurrentMa??0,S=l?.sideBrushCurrentMa??0,T=l?.mainBrushCurrentMa??0,_=X1({count:6,totalSpan:140,gap:6,startAngle:-70}),G=["L","FL","CL","CR","FR","R"],F=[l?.lightBumpLeftSignal,l?.lightBumpFrontLeftSignal,l?.lightBumpCenterLeftSignal,l?.lightBumpCenterRightSignal,l?.lightBumpFrontRightSignal,l?.lightBumpRightSignal],ee=_.map((P,ue)=>({label:G[ue],start:P.start,end:P.end,value:F[ue]})),I=[{label:"Cliff L",start:-60,end:-46,value:l?.cliffLeftSignal,active:l?.cliffLeft},{label:"Cliff FL",start:-32,end:-16,value:l?.cliffFrontLeftSignal,active:l?.cliffFrontLeft},{label:"Cliff FR",start:16,end:32,value:l?.cliffFrontRightSignal,active:l?.cliffFrontRight},{label:"Cliff R",start:46,end:60,value:l?.cliffRightSignal,active:l?.cliffRight}],V=F.filter(P=>P!=null),Z=V.length?Math.max(...V,1200):1200;return o.jsxs("div",{className:`${r?"relative":"surface relative p-1"}`,style:r?{width:`${f}px`,height:`${f}px`}:{height:"100%",width:"100%",aspectRatio:"1 / 1"},children:[r?null:o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute left-1 top-1 text-xs text-slate-400",children:"Top-down"}),o.jsxs("div",{className:"absolute right-1 top-1 text-[0.65rem] text-slate-500",children:["0–",Z]})]}),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(Mp,{cx:d-A,cy:d,current:C,drop:M.wheelDropLeft,overcurrent:E.leftWheel,label:"L"}),o.jsx(Mp,{cx:d+A,cy:d,current:N,drop:M.wheelDropRight,overcurrent:E.rightWheel,label:"R"}),o.jsx(H1,{cx:d+m*.65,cy:d-m*.55,current:S,overcurrent:E.sideBrush}),o.jsx(V1,{cx:d,cy:d,current:T,overcurrent:E.mainBrush,variant:i,dirtLeft:l?.dirtDetectLeft,dirtRight:l?.dirtDetect}),ee.map(P=>{const ue=G1(P.value);return o.jsx(Is,{cx:d,cy:d,rInner:y,rOuter:g,startDeg:P.start,endDeg:P.end,color:ue,opacity:1,pulse:!1},P.label)}),I.map(P=>{const ue=Q1(P.value,P.active);return o.jsx(Is,{cx:d,cy:d,rInner:v,rOuter:b,startDeg:P.start,endDeg:P.end,color:ue,opacity:1,pulse:!!P.active},P.label)}),o.jsx(Is,{cx:d,cy:d,rInner:g+2,rOuter:g+8,startDeg:-70,endDeg:-6,color:M.bumpLeft?"#ef4444":"#475569",opacity:1,pulse:!!M.bumpLeft}),o.jsx(Is,{cx:d,cy:d,rInner:g+2,rOuter:g+8,startDeg:6,endDeg:70,color:M.bumpRight?"#ef4444":"#475569",opacity:1,pulse:!!M.bumpRight})]})]})}function Is({cx:l,cy:i,rInner:s,rOuter:r,startDeg:f,endDeg:d,color:m,pulse:y=!1,opacity:g=1}){const v=(s+r)/2,b=r-s,A=U1(l,i,v,f,d);return o.jsxs(o.Fragment,{children:[o.jsx("path",{d:A,stroke:m,strokeWidth:b,strokeLinecap:"round",fill:"none",opacity:g}),y?o.jsx("path",{d:A,stroke:"#ef4444",strokeWidth:b,strokeLinecap:"round",fill:"none",className:"animate-pulse",opacity:1}):null]})}function U1(l,i,s,r,f){let d=r,m=f;m<=d&&(m+=360);const y=Tp(l,i,s,d),g=Tp(l,i,s,m);return["M",y.x,y.y,"A",s,s,0,0,1,g.x,g.y].join(" ")}function Tp(l,i,s,r){const f=B0(r);return{x:l+s*Math.cos(f),y:i+s*Math.sin(f)}}function B0(l){return(l-90)*Math.PI/180}function Ho(l,i){if(i)return"#ef4444";const s=Math.abs(l);return s>900?"#f59e0b":s>300?"#22c55e":"#64748b"}function L0(l){return Math.max(0,Math.min(1,l))}function Mp({cx:l,cy:i,current:s,drop:r,overcurrent:f,label:d}){const m=Math.abs(s),y=L0(m/1200),g=Ho(s,f),v=56,b=14,A=9,M=3,E=v*y,C=d==="L"?-1:1,N=C*(-A/2-M/2),S=C*(b/2+M/2),T=b+A+M+2,_=v+4;return o.jsxs("g",{transform:`translate(${l},${i})`,children:[o.jsx("rect",{x:-T/2,y:-_/2,width:T,height:_,rx:"4",fill:"none",stroke:"#64748b",strokeWidth:"1"}),o.jsx("rect",{x:N-b/2,y:-v/2,width:b,height:v,fill:"#0f172a",stroke:"#0f172a",strokeWidth:"1",rx:"2"}),o.jsx("rect",{x:N-b/2,y:v/2-E,width:b,height:E,fill:g,className:f?"animate-pulse":""}),o.jsx("rect",{x:S-A/2,y:-v/2,width:A,height:v,fill:r?"#ef4444":"#475569",className:r?"animate-pulse":"",rx:"2"}),o.jsx("text",{x:0,y:v/2+10,textAnchor:"middle",className:"fill-slate-200 text-[0.7rem]",children:d})]})}function H1({cx:l,cy:i,current:s,overcurrent:r}){const f=Math.abs(s),d=Ho(s*3,r),m=42,y=f>0?.65:null;return o.jsxs("g",{style:{transformOrigin:`${l}px ${i}px`,animation:y?`spin ${y}s linear infinite`:"none"},children:[o.jsx("circle",{cx:l,cy:i,r:10,fill:"#64748b",stroke:"#64748b",strokeWidth:"1"}),[0,120,240].map(g=>{const v=B0(g),b=l+m*Math.cos(v),A=i+m*Math.sin(v);return o.jsx("line",{x1:l,y1:i,x2:b,y2:A,stroke:d,strokeWidth:"4",strokeLinecap:"round"},g)}),r?o.jsx("circle",{cx:l,cy:i,r:m+8,stroke:"#ef4444",strokeWidth:"3",fill:"none",className:"animate-pulse"}):null]})}function V1({cx:l,cy:i,current:s,overcurrent:r,variant:f,dirtLeft:d,dirtRight:m}){const y=Math.abs(s),g=Ho(s,r),v=1,b=96,A=12,M=`main-brush-pattern-a-${f}`,E=`main-brush-pattern-b-${f}`,C=y>0?.6:null,N=s>=0?1:-1;return o.jsxs("g",{children:[o.jsx("defs",{children:[M,E].map((S,T)=>o.jsxs("pattern",{id:S,patternUnits:"userSpaceOnUse",width:"6",height:"6",children:[o.jsx("rect",{width:"6",height:"6",fill:g,opacity:v}),o.jsx("path",{d:"M0 6 L6 0",stroke:"#0f172a",strokeWidth:"1"}),C?o.jsx("animateTransform",{attributeName:"patternTransform",type:"translate",from:"0 0",to:`0 ${N*(T===0?6:-6)}`,dur:`${C}s`,repeatCount:"indefinite"}):null]},S))}),o.jsx("rect",{x:l-b/2,y:i-14,width:b,height:A,rx:"3",fill:`url(#${M})`,stroke:"#64748b",strokeWidth:"1"}),o.jsx("rect",{x:l-b/2,y:i+4,width:b,height:A,rx:"3",fill:`url(#${E})`,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 Y1=.18;function G1(l){return l==null||l<=0?"#000000":`hsl(${l*Y1%360} 100% 60%)`}function Q1(l,i){if(i)return"#ef4444";const s=L0(l==null?0:l/4095),r=[47,55,69],f=[245,158,11],[d,m,y]=r.map((g,v)=>Math.round(g+(f[v]-g)*s));return`rgb(${d}, ${m}, ${y})`}function X1({count:l,totalSpan:i,gap:s,startAngle:r}){const d=(i-s*(l-1))/l,m=[];let y=r;for(let g=0;g<l;g+=1){const v=y+d;m.push({start:y,end:v}),y=v+s}return m}function Rp(...l){return l.filter(Boolean).join(" ")}function K1(l){const i=l?.batteryState?.percentDisplay;return i==null?"--":`${i}%`}function Z1(l){return l?.batteryState?l.batteryState.urgentActive?"text-red-400":l.batteryState.warnActive?"text-amber-300":"text-emerald-300":"text-slate-400"}function Vo({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:Rp("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:Rp("font-semibold",Z1(f)),children:["Battery ",K1(f)]})]})]}),r?r(f):null]},f.id))})]})}function U0(l){const i=l?.sensors||{},s=i.oiMode?.label||"Unknown",r=s.toLowerCase(),f=i.chargingState?.label||"",d=!!i.chargingSources?.homeBase,m=d&&f.toLowerCase()!=="not charging"&&f!=="";return{driving:r==="full",docked:d,charging:m,dockedNotCharging:d&&!m,dockingInProgress:!d&&!m&&r==="passive",oiLabel:s,chargingLabel:f}}function H0(l){const i=Ti(l);return p.useMemo(()=>U0(i),[i])}function na({label:l,active:i}){return o.jsx("span",{className:`rounded px-1.5 py-0.5 text-[0.75rem] font-semibold ${i?"bg-emerald-600 text-white":"bg-red-600 text-white"}`,children:l})}function _p({label:l}){return l?o.jsx("span",{className:"rounded border border-white/40 px-1 text-[0.7rem] text-white",children:l}):null}function $1({instructions:l,onConfirm:i,onCancel:s,pending:r}){return o.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-black/70 p-1",children:o.jsxs("div",{className:"surface w-full max-w-md space-y-0.5 border border-indigo-700 bg-indigo-950/90 p-1 text-slate-100 shadow-2xl",children:[o.jsxs("div",{className:"space-y-0.25",children:[o.jsx("p",{className:"text-lg font-semibold text-indigo-50",children:"Dock Rover"}),o.jsx("p",{className:"text-sm text-slate-200",children:l.summary}),o.jsx(bo,{steps:l.steps,tone:"indigo"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-0.5 text-sm",children:[o.jsx("button",{type:"button",onClick:s,className:"bg-slate-700 px-0.5 py-1 font-semibold text-slate-100 transition hover:bg-slate-600",children:"Cancel"}),o.jsx("button",{type:"button",disabled:r,onClick:i,className:"bg-indigo-600 px-0.5 py-1 font-semibold text-indigo-50 transition hover:bg-indigo-500 disabled:opacity-50",children:r?"Docking…":"Confirm Dock"})]})]})})}function V0({layout:l="desktop",expand:i=!1,driveDockState:s}){const r=l==="mobile",{state:{roverId:f,keymap:d},actions:m}=Qt(),y=Ti(f),g=s??U0(y),{driving:v,docked:b,charging:A,dockedNotCharging:M,dockingInProgress:E,oiLabel:C}=g,[N,S]=p.useState(null),[T,_]=p.useState(!1),[G,F]=p.useState(!1),ee=!f||N!==null,I=!f||N!==null,V=gl(d?.driveMacro?.[0]),Z=gl(d?.dockMacro?.[0]),P={summary:"You are about to trigger an automatic docking attempt! To have a successful dock:",steps:["Line up the rover straight in front of the dock","Make sure the rover is about one foot or half a meter away from the dock","Press Confirm Dock to begin the docking process"]},ue="Click this button to initate auto-dock.",be={summary:"You must enable driving mode before you can move the rover.",steps:["Press the keybind or tap this button to enable driving mode","Once ready (should be instant), this dialog will change, and you will be able to move"]},me=async()=>{if(!(!f||N)){S("drive");try{m.setMode("drive"),await m.runMacro("drive-sequence")}catch(J){alert(J.message)}finally{S(null)}}},$=async()=>{if(!(!f||N)){_(!1),F(!1),S("drive");try{m.setMode("drive"),await m.runMacro("drive-sequence")}catch(J){alert(J.message)}finally{S(null)}}},te=async()=>{if(!(!f||N)){S("dock");try{m.setMode("dock"),await m.runMacro("seek-dock")}catch(J){alert(J.message)}finally{S(null),_(!1),F(!1)}}},oe=()=>{I||(F(!0),_(!0))},z="flex w-full flex-col gap-0.5 border border-slate-700 px-0.75 py-0.75 text-slate-100 shadow",B=i?"h-full flex-1":"";if(!v&&!E)return o.jsxs("button",{type:"button",onClick:$,disabled:ee,className:`${z} ${B} items-center justify-between bg-emerald-800 hover:bg-emerald-700 text-center transition disabled:cursor-not-allowed disabled:opacity-60`,children:[o.jsxs("div",{className:"space-y-0.25 w-full",children:[o.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[o.jsx("span",{className:"text-base font-semibold text-emerald-50",children:"Start Driving"}),!r&&V?o.jsx(_p,{label:V}):null]}),o.jsx("p",{className:"text-sm text-emerald-50/90",children:be.summary}),o.jsx(bo,{steps:be.steps,tone:"emerald"})]}),o.jsxs("div",{className:"flex w-full flex-col gap-0.5",children:[o.jsx(na,{label:`OI: ${C}`,active:C.toLowerCase()==="full"}),o.jsx(na,{label:b?"Docked!":"Not docked",active:b}),o.jsx(na,{label:A?"Charging!":"Not charging",active:A})]})]});if(E){const J={summary:"Docking attempt in progress.",steps:["The rover should be slowly wiggling towards the dock","If it is obviously not working, press this button to enter driving mode and try again"]};return o.jsxs("button",{type:"button",disabled:ee,onClick:me,className:`${z} ${B} items-center bg-amber-900 text-center transition hover:bg-amber-800 disabled:cursor-not-allowed disabled:opacity-50`,children:[o.jsxs("div",{className:"space-y-0.25 w-full",children:[o.jsx("div",{className:"flex items-center justify-center gap-0.5",children:o.jsx("span",{className:"text-base font-semibold text-amber-50",children:"Docking in Progress"})}),o.jsx("p",{className:"text-sm text-amber-50/90",children:J.summary})]}),o.jsxs("div",{className:"flex w-full flex-col gap-0.5",children:[o.jsx(na,{label:b?"Docked":"Not docked",active:b}),o.jsx(na,{label:A?"Charging":"Not charging",active:A})]}),o.jsx(bo,{steps:J.steps,tone:"amber"})]})}return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",disabled:I,onClick:oe,className:r?"flex w-full items-center justify-center border border-slate-700 bg-indigo-900 px-0.75 py-0.75 text-sm font-semibold text-indigo-50 shadow transition hover:bg-indigo-800 disabled:cursor-not-allowed disabled:opacity-50":`${z} ${B} items-center bg-indigo-900 text-center transition hover:bg-indigo-800 disabled:cursor-not-allowed disabled:opacity-50`,children:[o.jsxs("div",{className:"flex items-center justify-center gap-0.5 w-full",children:[o.jsx("span",{className:"text-base font-semibold text-indigo-50",children:"Dock and Charge"}),!r&&Z?o.jsx(_p,{label:Z}):null]}),!r&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-sm text-indigo-50/90",children:ue}),o.jsxs("div",{className:"flex w-full flex-col gap-0.5",children:[o.jsx(na,{label:b?"Docked":"Not docked",active:b}),o.jsx(na,{label:A?"Charging":"Not charging",active:A}),M?o.jsx(na,{label:"Not charging yet",active:!1}):null]}),o.jsx("div",{className:"text-xs text-indigo-100/80",children:"Line up straight, about 1 foot away, before docking."})]})]}),G||!r&&T?o.jsx($1,{instructions:P,pending:N==="dock",onCancel:()=>{F(!1),_(!1)},onConfirm:te}):null]})}function bo({steps:l,tone:i="emerald"}){const s=i==="emerald"?"bg-emerald-900/60 text-emerald-50/90 border-emerald-700/60":i==="amber"?"bg-amber-900/60 text-amber-50/90 border-amber-700/60":"bg-indigo-900/60 text-indigo-50/90 border-indigo-700/60",r=i==="emerald"?"text-emerald-200":i==="amber"?"text-amber-200":"text-indigo-200";return o.jsx("div",{className:`space-y-0.5 rounded border px-0.5 py-0.35 text-left ${s}`,children:l.map((f,d)=>o.jsxs("div",{className:"text-[0.85rem] leading-snug break-words",children:[o.jsxs("div",{className:"flex items-start",children:[o.jsxs("span",{className:`mr-0.35 align-top text-[0.75rem] font-semibold ${r}`,children:[d+1,"."]}),o.jsx("span",{className:"align-top",children:f})]}),d<l.length-1?o.jsx("div",{className:"mt-0.35 h-px bg-white/10"}):null]},f))})}function Y0(){const{session:l,requestControl:i}=Xe(),{state:{roverId:s,keymap:r}}=Qt(),d=Ti(s)?.sensors||{},m=H0(s),y=l?.roster??[],[g,v]=p.useState({}),b=p.useMemo(()=>l?.role&&l.role!=="spectator",[l?.role]),A=m.docked&&!m.driving;async function M(E){if(E){v(C=>({...C,[E]:!0}));try{await i(E)}catch(C){alert(C.message)}finally{v(C=>({...C,[E]:!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(xo,{sensors:d})})}),o.jsxs("div",{className:"grid h-full grid-rows-[1fr_1fr_auto] gap-0.75",children:[o.jsx("div",{className:"row-span-2",children:o.jsx(V0,{layout:"desktop",expand:!0,driveDockState:m})}),A?null:o.jsx(J1,{keymap:r})]})]}),o.jsx(Vo,{title:"Rovers",roster:y,renderActions:E=>b?o.jsx("button",{type:"button",onClick:()=>M(E.id),disabled:g[E.id],className:"button-dark disabled:opacity-40",children:g[E.id]?"...":"request"}):null})]})}function J1({keymap:l}){const{state:{roverId:i,camera:s},actions:{setServoAngle:r}}=Qt(),f=s?.config,d=!!(i&&s?.enabled&&f),m=typeof f?.minAngle=="number"?f.minAngle:-30,y=typeof f?.maxAngle=="number"?f.maxAngle:30,g=typeof s?.angle=="number"?s.angle:typeof f?.homeAngle=="number"?f.homeAngle:(m+y)/2,[v,b]=p.useState(g),A=p.useRef(!1);p.useEffect(()=>{A.current||b(g)},[g]);const M=S=>{const T=Number.parseFloat(S.target.value);Number.isNaN(T)||(A.current=!0,b(T),r(T))},E=()=>{A.current=!1};if(!d)return null;const C=gl(l?.cameraUp?.[0]),N=gl(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:ao(g)})]}),o.jsxs("div",{children:[o.jsx("input",{type:"range",className:"w-full accent-emerald-400",min:m,max:y,step:.5,value:v,onChange:M,onMouseUp:E,onTouchEnd:E,onPointerUp:E}),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:[N?o.jsx(Op,{label:N}):null,ao(m)]}),o.jsxs("span",{className:"flex items-center gap-0.25",children:[ao(y),C?o.jsx(Op,{label:C}):null]})]})]})]})}function Op({label:l}){return o.jsx("span",{className:"rounded border border-white/40 px-1 text-[0.7rem] text-white",children:l})}function ao(l){return typeof l!="number"||Number.isNaN(l)?"—":`${l>0?"+":""}${l.toFixed(1)}°`}const F1=5e3;function W1(l){return l.id?l.id:l.timestamp?`${l.timestamp}-${l.message}`:`${l.title||"alert"}-${l.message}`}function I1(){const{alerts:l}=Xe(),[i,s]=p.useState(()=>Date.now()),r=p.useMemo(()=>l.slice(-5).map(d=>({alert:d,key:W1(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<=F1);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(P1,{alert:d.alert},d.key))}):null}function P1({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 eA=[{key:"open",label:"Open"},{key:"turns",label:"Turns"},{key:"admin",label:"Admin"},{key:"lockdown",label:"Lockdown"}];function G0(){const{session:l,lockRover:i,setMode:s,requestControl:r}=Xe(),f=p.useMemo(()=>l?.roster??[],[l?.roster]),[d,m]=p.useState({}),y=l?.role==="admin"||l?.role==="lockdown"||l?.role==="lockdown-admin",g=l?.mode??"open",v=async(E,C)=>{try{await i(E,C),m(N=>({...N,[E]:C}))}catch(N){alert(N.message)}},b=async E=>{const C=E.target.value;try{await s(C)}catch(N){alert(N.message)}},A=async E=>{try{await r(E,{force:!0})}catch(C){alert(C.message)}},M=p.useMemo(()=>{const E={};return f.forEach(C=>{E[C.id]=d[C.id]??C.locked}),E},[f,d]);return y?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:g,onChange:b,className:"field-input text-sm",children:eA.map(E=>o.jsx("option",{value:E.key,children:E.label},E.key))})]}),o.jsx(Vo,{roster:f,renderActions:E=>o.jsxs("div",{className:"flex flex-wrap gap-0.5 text-xs",children:[o.jsx("button",{type:"button",onClick:()=>v(E.id,!M[E.id]),className:"button-dark",children:M[E.id]?"Unlock":"Lock"}),o.jsx("button",{type:"button",onClick:()=>A(E.id),className:"button-dark",children:"Force"})]})})]}):null}const Ps="mobile-joystick",tA=80,nA=.15,aA=[{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 lA({disabled:l,layout:i,radius:s,onMove:r,onStop:f}){const d=p.useRef(null),m=p.useRef(null),y=p.useRef({x:0,y:0}),[g,v]=p.useState({active:!1,base:{x:0,y:0},knob:{x:0,y:0}}),b=p.useCallback(()=>{m.current=null,v({active:!1,base:{x:0,y:0},knob:{x:0,y:0}}),f?.()},[f]),A=p.useCallback(N=>{if(l||m.current!==null)return;N.preventDefault();const S=d.current;if(!S)return;const T=S.getBoundingClientRect(),_=N.clientX-T.left,G=N.clientY-T.top;y.current={x:_,y:G},m.current=N.pointerId,S.setPointerCapture?.(N.pointerId),v({active:!0,base:{x:_,y:G},knob:{x:0,y:0}})},[l]),M=p.useCallback(N=>{if(l||m.current!==N.pointerId)return;N.preventDefault();const S=d.current;if(!S)return;const T=S.getBoundingClientRect(),_=N.clientX-T.left,G=N.clientY-T.top,F=_-y.current.x,ee=G-y.current.y,I=Math.min(Math.hypot(F,ee),s),V=Math.atan2(ee,F),Z=Math.cos(V)*I,P=Math.sin(V)*I,ue={x:Nn(Z/s),y:Nn(-P/s),boost:!1};v(be=>({...be,knob:{x:Z,y:P}})),r?.(ue)},[l,r]),E=p.useCallback(N=>{if(m.current!==N.pointerId)return;N.preventDefault(),d.current?.releasePointerCapture?.(N.pointerId),b()},[b]);p.useEffect(()=>{l&&b()},[l,b]);const C=i==="landscape"?"h-[260px]":"h-[220px]";return o.jsxs("div",{ref:d,role:"presentation",className:`relative w-full ${C} select-none overflow-hidden bg-zinc-950`,style:{touchAction:"none"},onPointerDown:A,onPointerMove:M,onPointerUp:E,onPointerLeave:E,onPointerCancel:E,onContextMenu:N=>N.preventDefault(),children:[!g.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"})]}),g.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:g.base.x,top:g.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:g.base.x+g.knob.x,top:g.base.y+g.knob.y}})]})]})}function Q0({layout:l}){const{state:{roverId:i,camera:s},pipeline:r,actions:{setDriveVector:f,registerInputState:d,setServoAngle:m,toggleNightVision:y}}=Qt(),g=H0(i),v=g.docked&&!g.driving,b=!i,A=s?.config,M=!!(i&&s?.enabled&&A),E=!!(i&&r?.nightVision),C=typeof A?.minAngle=="number"?A.minAngle:-45,N=typeof A?.maxAngle=="number"?A.maxAngle:45,S=typeof s?.angle=="number"?s.angle:typeof A?.homeAngle=="number"?A.homeAngle:(C+N)/2,T=tA,_=nA,G=p.useRef({x:0,y:0,boost:!1});p.useEffect(()=>{b&&(G.current={x:0,y:0,boost:!1})},[b]);const F=p.useCallback((Z={})=>{if(b)return;const P={x:Nn(Z.x??0),y:Nn(Z.y??0),boost:!!Z.boost},ue={x:G.current.x+(P.x-G.current.x)*(1-_),y:G.current.y+(P.y-G.current.y)*(1-_),boost:P.boost};G.current=ue,f(ue,{source:Ps}),d(Ps,{vector:ue,lastEvent:"move"})},[b,d,f,_]),ee=p.useCallback(()=>{if(b)return;const Z={x:0,y:0,boost:!1};G.current=Z,f(Z,{source:Ps}),d(Ps,{vector:Z,lastEvent:"stop"})},[b,d,f]),I=Z=>{if(!M)return;const P=Number(Z.target.value);Number.isNaN(P)||m(P)},V=`flex flex-col gap-0.5 text-slate-100 ${v?"h-screen max-h-screen":""}`;return o.jsxs("div",{className:V,children:[o.jsx(V0,{layout:"mobile",expand:v,driveDockState:g}),v?null:o.jsxs(o.Fragment,{children:[E&&o.jsx("button",{type:"button",onClick:()=>y(),disabled:b,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"}),M&&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:[S.toFixed(1),"°"]})]}),o.jsx("input",{type:"range",min:C,max:N,step:.5,value:S,onChange:I,className:"mt-0.5 w-full accent-cyan-400"})]}),o.jsx(lA,{disabled:b,layout:l,radius:T,onMove:F,onStop:ee})]})]})}function X0({orientation:l}){const{state:{roverId:i},actions:{setAuxMotors:s}}=Qt(),r=p.useRef(null),f=!i,d=p.useCallback(g=>{if(!f){if(g.hold===!1){s(g.values),r.current=null;return}r.current=g.id,s(g.values)}},[f,s]),m=p.useCallback(g=>{f||g.hold===!1||r.current===g.id&&(r.current=null,s({main:0,side:0,vacuum:0}))},[f,s]),y=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 ${y} gap-0.5`,children:aA.map(g=>o.jsx("button",{type:"button",disabled:f,onPointerDown:v=>{v.preventDefault(),d(g)},onPointerUp:()=>m(g),onPointerLeave:()=>m(g),onPointerCancel:()=>m(g),onContextMenu:v=>v.preventDefault(),className:`px-0.5 py-0.5 text-left text-sm font-semibold text-white transition select-none no-touch-select ${g.color} hover:brightness-110 disabled:opacity-30 h-10`,children:g.label},g.id))})]})}function iA(){return o.jsx("div",{className:"flex h-full flex-col gap-0.5",children:o.jsx(X0,{orientation:"landscape"})})}function sA(){return o.jsx("div",{className:"flex h-full flex-col gap-0.5",children:o.jsx(Q0,{layout:"landscape"})})}function rA(){return o.jsx("section",{className:"panel",children:o.jsxs("div",{className:"grid grid-cols-2 gap-0.5",children:[o.jsx(X0,{orientation:"portrait"}),o.jsx(Q0,{layout:"portrait"})]})})}function K0(l=[],i={}){const s=wa(),{enabled:r=!0,version:f=null}=i,[d,m]=p.useState({}),y=p.useRef(new Map),g=p.useMemo(()=>l.map(E=>typeof E=="string"?E:E.id),[l]),v=p.useMemo(()=>{const E=g.join("|");return f?`${E}|v:${f}`:E},[g,f]),b=p.useRef([]),[A,M]=p.useState(0);return p.useEffect(()=>{if(!s)return;const E=()=>M(C=>C+1);return s.on("connect",E),()=>s.off("connect",E)},[s]),p.useEffect(()=>{b.current=g},[v,g]),p.useEffect(()=>{y.current.forEach(E=>URL.revokeObjectURL(E)),y.current.clear(),m({})},[v]),p.useEffect(()=>{if(!r){y.current.forEach(T=>URL.revokeObjectURL(T)),y.current.clear(),m({});return}if(!b.current.length||!s)return;let E=!1;const C=b.current,N=(T={},_)=>{if(E||!T.id||!_)return;const G=new Blob([_],{type:"image/jpeg"}),F=URL.createObjectURL(G),ee=y.current.get(T.id);ee&&URL.revokeObjectURL(ee),y.current.set(T.id,F),m(I=>({...I,[T.id]:{status:"playing",ts:T.ts||Date.now(),error:null,objectUrl:F}}))},S=(T={})=>{E||!T.id||m(_=>({..._,[T.id]:{..._[T.id]||{},status:T.error?"error":_[T.id]?.status||"connecting",error:T.error||null,ts:T.ts||_[T.id]?.ts||null,objectUrl:_[T.id]?.objectUrl||null}}))};return s.on("roomCamera:frame",N),s.on("roomCamera:status",S),s.emit("roomCamera:subscribe",{ids:C},(T={})=>{T.error}),()=>{E=!0,s.emit("roomCamera:unsubscribe",{ids:C}),s.off("roomCamera:frame",N),s.off("roomCamera:status",S),y.current.forEach(T=>URL.revokeObjectURL(T)),y.current.clear()}},[s,v,r,A]),d}function uA({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 cA(){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 Z0=["horizontal","vertical"];function lo(l,i){return Z0.includes(l)?l:i}function Sr({defaultOrientation:l="horizontal",orientation:i,hideLayoutToggle:s=!1,hideHeader:r=!1,panelId:f=null}){const{session:d}=Xe(),m=d?.roomCameras||[],y=K0(m.map(S=>({id:S.id}))),{value:g,save:v}=Rt("roomCameraPanels",{}),[b,A]=p.useState(()=>lo(f?g?.[f]:l,"horizontal"));p.useEffect(()=>{if(!f)return;const S=g?.[f];S&&A(lo(S,"horizontal"))},[f,g?.[f]]);const M=i?lo(i,"horizontal"):b,E=M==="vertical"?"flex flex-col gap-0.5":"grid gap-0.5 md:grid-cols-2",C=!s&&!i&&m.length>0,N=S=>{A(S),f&&v(T=>({...T||{},[f]:S}))};return m.length===0?o.jsx(cA,{}):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})]}),C&&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:Z0.map(S=>o.jsx("button",{type:"button",className:`px-1 py-0.5 ${M===S?"bg-slate-600 text-white":"bg-transparent text-slate-400 hover:text-white"}`,onClick:()=>N(S),children:S==="vertical"?"Vertical":"Grid"},S))})]})]}),o.jsx("div",{className:E,children:m.map(S=>{const T=y[S.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(uA,{feed:T,label:S.name||S.id})},S.id)})})]})}function Yo(){const{logs:l}=Xe();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 Go(){const{login:l,setRole:i}=Xe(),[s,r]=p.useState(""),[f,d]=p.useState(""),[m,y]=p.useState(!1);async function g(v){v.preventDefault(),y(!0);try{await l(s,f),r(""),d("")}catch(b){alert(b.message)}finally{y(!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:g,children:[o.jsx("input",{className:"field-input",placeholder:"Username",value:s,onChange:v=>r(v.target.value)}),o.jsx("input",{className:"field-input",placeholder:"Password",type:"password",value:f,onChange:v=>d(v.target.value)}),o.jsx("button",{type:"submit",disabled:m,className:"button-dark w-full disabled:opacity-50",children:m?"Logging in…":"Login"})]})]})}function oA(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 fA(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 Qo(l=[],i={}){const s=wa(),{enabled:r=!0,version:f=null}=i,[d,m]=p.useState({}),y=p.useMemo(()=>Array.isArray(l)?fA(l.map(oA).filter(Boolean)):[],[l]),g=p.useMemo(()=>{const E=y.map(C=>`${C.type}:${C.id}:${C.key}`).join("|");return f?`${E}|v:${f}`:E},[y,f]),v=p.useRef([]),[b,A]=p.useState(0);return p.useEffect(()=>{if(!s)return;const E=()=>A(C=>C+1);return s.on("connect",E),()=>{s.off("connect",E)}},[s]),p.useEffect(()=>{v.current=y},[y]),p.useEffect(()=>{if(!g||!r){m({});return}const E=v.current;let C=!1;function N(S){const T=S.type==="room"?{roomCameraId:S.id}:{roverId:S.id};s.emit("video:request",T,(_={})=>{C||m(G=>({...G,[S.key]:_}))})}return E.forEach(S=>{N(S)}),()=>{C=!0}},[s,g,r,b]),p.useMemo(()=>{if(!g||!r)return{};const E={};return y.forEach(C=>{d[C.key]&&(E[C.key]=d[C.key])}),E},[g,d,y])}const dA={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"turn:your.turn.server:3478",username:"user",credential:"pass"}],bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"};function hA(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 mA(l){if(!l)return{};const i=`${l}:${l}`;return{Authorization:`Basic ${hA(i)}`}}class Dp{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(dA);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",...mA(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")}}const pA=650,gA={161:{red:!0},164:{green:!0},165:{force:!0},168:{red:!0,green:!0},169:{red:!0,force:!0},172:{green:!0,force:!0},173:{red:!0,green:!0,force:!0}};function io(l){if(typeof l!="number"||l<=0)return null;const i=gA[l];return i?{code:l,...i}:null}function yA(l,i={}){const s=i.holdMs||pA,[r,f]=p.useState({left:null,right:null,omni:null}),[d,m]=p.useState(0);return p.useEffect(()=>{const y=setInterval(()=>m(Date.now()),Math.max(s/2,100));return()=>clearInterval(y)},[s]),p.useEffect(()=>{const y=Date.now(),g=io(l?.infraredCharacterLeft),v=io(l?.infraredCharacterRight),b=io(l?.infraredCharacterOmni);!g&&!v&&!b||f(A=>({left:g?{...g,ts:y}:A.left,right:v?{...v,ts:y}:A.right,omni:b?{...b,ts:y}:A.omni}))},[l?.infraredCharacterLeft,l?.infraredCharacterRight,l?.infraredCharacterOmni]),p.useEffect(()=>{const{left:y,right:g,omni:v}=r;if(!(y?.ts||g?.ts||v?.ts))return;const A=new Date().toISOString();console.debug("[DockIR]",A,{left:y?.code??0,omni:v?.code??0,right:g?.code??0})},[r.left?.code,r.right?.code,r.omni?.code]),p.useMemo(()=>{const y=Date.now(),g=S=>{if(!S)return{active:!1,red:!1,green:!1,force:!1,age:null,code:null};const T=y-S.ts,_=T<=s;return{active:_,age:T,code:S.code,red:!!(S.red&&_),green:!!(S.green&&_),force:!!(S.force&&_)}},v=g(r.left),b=g(r.right),A=g(r.omni),M=v.force||b.force||A.force,E=v.active||b.active||A.active,C=v.active&&!b.active?"right":b.active&&!v.active?"left":"center",N=(b.active?1:0)-(v.active?1:0);return{visible:E,forceDetected:M,left:v,right:b,omni:A,bias:C,balance:Math.max(-1,Math.min(1,N))}},[r.left,r.right,r.omni,s,d])}const Ao=120,kp=120,Je=Ao/2,aa=18,Mt=90;function er(l="left"){return l==="left"?`M ${Je} ${aa} C ${Je-22} ${aa+18} ${Je-28} ${Mt-16} ${Je-8} ${Mt} L ${Je} ${Mt} Z`:`M ${Je} ${aa} C ${Je+22} ${aa+18} ${Je+28} ${Mt-16} ${Je+8} ${Mt} L ${Je} ${Mt} Z`}function zp({sensors:l}){const i=yA(l),s=p.useMemo(()=>({left:{base:"rgba(16, 185, 129, 0.15)",active:"rgba(16, 185, 129, 0.55)",outline:"rgba(52, 211, 153, 0.9)"},right:{base:"rgba(239, 68, 68, 0.15)",active:"rgba(239, 68, 68, 0.55)",outline:"rgba(248, 113, 113, 0.9)"},force:{halo:"rgba(59, 130, 246, 0.15)",haloStrong:"rgba(59, 130, 246, 0.35)",outline:"rgba(191, 219, 254, 0.8)"},rover:{body:"#111827",fill:"#e5e7eb"}}),[]);if(!i.visible)return null;const r=i.balance*6,f=i.left.red||i.left.green||i.left.force,d=i.right.red||i.right.green||i.right.force,m=i.left.red&&i.left.green&&i.right.red&&i.right.green&&i.forceDetected;return o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-0.25",children:o.jsx("div",{className:"rounded bg-black/70 px-0.5 py-0.25 shadow-md shadow-black/40 ring-1 ring-white/5",children:o.jsxs("svg",{width:Ao,height:kp,viewBox:`0 0 ${Ao} ${kp}`,role:"img","aria-label":"Docking assist",children:[o.jsx("circle",{cx:Je,cy:aa+6,r:20,fill:i.forceDetected?s.force.haloStrong:s.force.halo,stroke:i.forceDetected?s.force.outline:"none",strokeWidth:i.forceDetected?2:0}),o.jsx("path",{d:er("left"),fill:f?s.left.active:s.left.base}),m&&o.jsx("path",{d:er("left"),fill:"none",stroke:s.left.outline,strokeWidth:1.5}),o.jsx("path",{d:er("right"),fill:d?s.right.active:s.right.base}),m&&o.jsx("path",{d:er("right"),fill:"none",stroke:s.right.outline,strokeWidth:1.5}),o.jsx("rect",{x:Je-12,y:aa-8,width:"24",height:"10",rx:"2",fill:"#1f2937",stroke:"#6b7280",strokeWidth:"0.8"}),o.jsx("circle",{cx:Je-5,cy:aa-3.5,r:"1.5",fill:"#9ca3af"}),o.jsx("circle",{cx:Je+5,cy:aa-3.5,r:"1.5",fill:"#9ca3af"}),o.jsxs("g",{transform:`translate(${Je+r}, ${Mt})`,children:[o.jsx("circle",{r:"7",fill:s.rover.body,stroke:"#6b7280",strokeWidth:"1.2"}),o.jsx("path",{d:"M 0 -5 L 4 4 L -4 4 Z",fill:s.rover.fill})]}),i.bias!=="center"&&o.jsx("path",{d:i.bias==="left"?`M ${Je-14} ${Mt-6} L ${Je-22} ${Mt} L ${Je-14} ${Mt+6}`:`M ${Je+14} ${Mt-6} L ${Je+22} ${Mt} L ${Je+14} ${Mt+6}`,fill:"none",stroke:"#e5e7eb",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})})})}function $0(){const{value:l,save:i}=Rt("page",{hudMapDesktop:!1});return[!!l?.hudMapDesktop,f=>{i({hudMapDesktop:!!f})}]}const Bp=2e3,vA=3e3,xA=3e3,bA=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function Lp(l){if(typeof l!="number"||!Number.isFinite(l))return"--";const i=bA[l%12]||"?",s=Math.floor(l/12)-1;return`${i}${s}`}function AA(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,y=Math.min(1,Math.max(0,m)),g=Math.round(y*100),v=m<=0,b=f!=null&&l<=f;return{available:!0,percentDisplay:g,depleted:v,warnTriggered:b,barClass:v?"bg-red-500 animate-pulse":b?"bg-amber-400":"bg-emerald-500"}}function Xo({sessionInfo:l,audioSessionInfo:i,label:s,forceMute:r=!1,telemetryFrame:f,batteryConfig:d,layoutFormat:m="desktop",hudVariant:y="default",driverLabel:g=null,songNote:v=null,hudForceMap:b=!1,hudMapPosition:A="top-right",fitParent:M=!1}){const E=p.useRef(null),C=p.useRef(null),N=p.useRef(null),S=p.useRef(null),T=p.useRef(null),_=p.useRef(null),[G,F]=p.useState("idle"),[ee,I]=p.useState(null),[V,Z]=p.useState("idle"),[P,ue]=p.useState(null),[be,me]=p.useState(0),[$,te]=p.useState(0),[oe,z]=p.useState(!0),B=f?.sensors,J=B?.batteryChargeMah??null,W=m==="desktop",le=!W,[q]=$0(),U=b||le?!0:q,X=AA(J,d),K=B?.wheelOvercurrents||null,ne=K==null?[]:Object.entries(K).filter(([,Ae])=>!!Ae).map(([Ae])=>Ae),se=p.useCallback(()=>{clearTimeout(N.current),N.current=setTimeout(()=>me(Date.now()),Bp)},[]),pe=p.useCallback(()=>{clearTimeout(S.current),S.current=setTimeout(()=>te(Date.now()),Bp)},[]),Ye=p.useCallback(async()=>{const Ae=E.current;if(Ae)try{Ae.muted=!0,await Ae.play()}catch{}},[]),Oe=p.useCallback((Ae=0)=>{if(r)return;clearTimeout(_.current);const Ue=()=>{clearTimeout(_.current),_.current=setTimeout(()=>{r||Ke()},vA)},Ke=async()=>{const Ne=E.current;if(Ne)try{await Ye(),Ne.muted=!1,await Ne.play(),z(!1)}catch{Ne.muted=!0,z(!0),Ue()}};_.current=setTimeout(Ke,Ae)},[Ye,r]);p.useEffect(()=>()=>{clearTimeout(N.current),clearTimeout(S.current),clearTimeout(_.current),clearInterval(T.current)},[]),p.useEffect(()=>{G==="playing"&&Oe(0)},[G,Oe]),p.useEffect(()=>{if(!l?.url||!E.current)return;let Ae=!0,Ue;const Ke=setTimeout(()=>z(!0),0),Ne=(He,ke)=>{Ae&&(F(He),I(ke||null),He==="playing"&&Ye(),["error","failed","disconnected","closed"].includes(He)&&se())};return Ue=new Dp({url:l.url,token:l.token,video:E.current,onStatus:Ne}),Ue.start().catch(He=>{Ae&&(F("error"),I(He.message),se())}),()=>{Ae=!1,clearTimeout(Ke),Ue?.stop()}},[l?.url,l?.token,be,se,Ye]),p.useEffect(()=>{G==="stopped"&&l?.url&&se()},[G,l?.url,se]),p.useEffect(()=>{if(!i?.url||!C.current)return;let Ae=!0,Ue;const Ke=(Ne,He)=>{Ae&&(ue(He||(Ne==="connected"?"connected":null)),Z(ke=>Ne==="connected"&&(ke==="playing"||ke==="connecting")||Ne==="new"?ke:Ne),Ne==="playing"&&C.current?.play().catch(()=>{}),["error","failed","disconnected","closed"].includes(Ne)&&pe())};return Ue=new Dp({url:i.url,token:i.token,video:C.current,audioOnly:!0,onStatus:Ke}),Ue.start().catch(Ne=>{Ae&&(Z("error"),ue(Ne.message),pe())}),()=>{Ae=!1,Ue?.stop()}},[i?.url,i?.token,$,pe]),p.useEffect(()=>{const Ae=C.current;if(!i?.url||!Ae){clearInterval(T.current);return}if(!["connecting","connected","playing","paused"].includes(V)){clearInterval(T.current);return}const Ke=()=>{const Ne=C.current;Ne&&(!Ne.paused&&!Ne.ended||Ne.play().then(()=>{Z(He=>He==="connected"?"playing":He),ue(He=>He==="paused"?null:He)}).catch(He=>{ue(ke=>ke||He?.message||"autoplay blocked")}))};return Ke(),T.current=setInterval(Ke,xA),()=>clearInterval(T.current)},[i?.url,V]),p.useEffect(()=>{const Ae=C.current;if(!Ae)return;const Ue=()=>{Z(ke=>ke==="error"?ke:"playing"),ue(null)},Ke=()=>{Z(ke=>["error","failed","disconnected","closed","stopped"].includes(ke)?ke:"paused"),ue(ke=>ke||"paused")},Ne=()=>{Z(ke=>ke==="error"?ke:"stopped"),ue(ke=>ke||"ended")},He=()=>{const{error:ke}=Ae,Al=ke?.message||"audio error";Z("error"),ue(Al)};return Ae.addEventListener("play",Ue),Ae.addEventListener("pause",Ke),Ae.addEventListener("ended",Ne),Ae.addEventListener("error",He),()=>{Ae.removeEventListener("play",Ue),Ae.removeEventListener("pause",Ke),Ae.removeEventListener("ended",Ne),Ae.removeEventListener("error",He)}},[i?.url]);const an=l?.url?G==="error"?`Error: ${ee||"unknown"}`:ee?`${G} (${ee})`:G:"waiting",Tn=i?.error?`Error: ${i.error}`:i?.url?V==="error"?`Error: ${P||"unknown"}`:P?`${V} (${P})`:V:null,ln=y==="spectator";return o.jsxs("div",{className:`flex flex-col gap-0.5 ${M?"h-full":""}`,children:[o.jsxs("div",{className:`relative w-full overflow-hidden bg-black ${M?"h-full flex-1":"aspect-video"}`,children:[o.jsx("video",{ref:E,muted:r||oe,playsInline:!0,autoPlay:!0,controls:!1,className:"h-full w-full object-contain"}),o.jsx("audio",{ref:C,autoPlay:!0,hidden:!0}),o.jsx(jA,{frame:f,sensors:B,label:s,status:an,audioStatus:Tn,desktopLayout:W,variant:y,driverLabel:g,battery:X,songNote:v,showTopDown:U,mobileHud:le,mapPosition:A}),o.jsx(NA,{motors:ne}),o.jsx(CA,{charge:J,config:d}),ln&&X.available?o.jsx(qA,{visual:X}):null]}),!ln&&o.jsx(SA,{visual:X})]})}function SA({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 qA({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 jA({frame:l,sensors:i,label:s,status:r,audioStatus:f,desktopLayout:d=!0,variant:m="default",driverLabel:y=null,battery:g,songNote:v=null,showTopDown:b=!1,mobileHud:A=!1,mapPosition:M="top-right"}){i?.bumpsAndWheelDrops;const[E,C]=p.useState(()=>Date.now());p.useEffect(()=>{const S=setInterval(()=>C(Date.now()),150);return()=>clearInterval(S)},[]),l?.receivedAt&&E-l.receivedAt<200;const N={width:"240px",height:"240px",opacity:.7,transform:`scale(${A?.55:.7})`,transformOrigin:M==="bottom-left"?"bottom left":"top right",...M==="bottom-left"?{left:"0.25rem",bottom:"0.25rem"}:{right:"0.25rem",top:"0.25rem"}};if(m==="spectator"){const S=[["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]}),v!=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 ",Lp(v)," ",o.jsxs("span",{className:"text-slate-400",children:["(",v,")"]})]}):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"}),S.map(([T,_])=>o.jsxs("span",{className:"flex items-center justify-between gap-0.5",children:[o.jsx("span",{className:"text-slate-400",children:T}),o.jsx("span",{className:"font-semibold text-white",children:_})]},T))]}),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(xo,{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"}),y?o.jsxs("span",{className:"text-slate-300",children:["• ",y]}):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]}),v!=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 ",Lp(v)," ",o.jsxs("span",{className:"text-slate-400",children:["(",v,")"]})]}):null,o.jsx("div",{className:"absolute inset-0 flex items-start justify-center",children:o.jsx(zp,{sensors:i})}),o.jsx("div",{className:"absolute inset-0 flex items-start justify-center",children:o.jsx(zp,{sensors:i})}),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:{...N,padding:"0.1rem",background:"rgba(0,0,0,0.6)"},children:o.jsx(xo,{sensors:i,size:240,overlay:!0})}):null]})}const EA={leftWheel:"Left wheel",rightWheel:"Right wheel",mainBrush:"Main brush",sideBrush:"Side brush"};function NA({motors:l}){if(!l?.length)return null;const i=l.map(s=>EA[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 CA({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 y=(l-r)/d<=0;if(!(f!=null&&l<=f)&&!y)return null;const v=y?"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:v})})})}function Ko({layoutFormat:l="desktop"}){const{session:i}=Xe(),{state:{song:s}}=Qt(),r=i?.assignment?.roverId,d=!!(r&&i?.roster?i.roster.find(C=>String(C.id)===String(r)):null)?.media?.audioPublishUrl,m=r?[{type:"rover",id:r,key:r},...d?[{type:"rover",id:`${r}-audio`,key:`${r}-audio`}]:[]]:[],y=Qo(m),g=r?y[r]:null,v=r&&d?y[`${r}-audio`]:null,b=Ti(r),A=r&&i?.roster?i.roster.find(C=>String(C.id)===String(r)):null,M=A?.battery??null,E=A?.name||(r?`Rover ${r}`:"");return o.jsx("section",{className:"panel",children:r?o.jsx(Xo,{sessionInfo:g,audioSessionInfo:v,label:E,telemetryFrame:b,batteryConfig:M,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 So({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 wA({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",y=!i||r,g=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:y,className:`flex min-w-[12rem] flex-1 items-center justify-between gap-1 rounded px-1 py-0.5 text-left transition-colors ${g} 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(So,{label:l.type==="light"?"Light":"Switch"})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-400",children:[o.jsx(So,{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 Zo(){const{session:l,homeAssistantToggle:i}=Xe(),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(So,{label:f?"Connected":"Offline",tone:f?"success":"warn"})]}),o.jsx("div",{className:"flex flex-wrap gap-0.5",children:r.map(d=>o.jsx(wA,{entity:d,connected:f,onToggle:i},d.id))})]})}const TA=[{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 MA(l){return l.reduce((i,s)=>((i[s.group]||(i[s.group]=[])).push(s),i),{})}function RA(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(0,Math.min(500,s)):i}const $o=5,ji=500,Ei=1,Jo=100;function _A(l,i){const s=Number(l);return Number.isFinite(s)?Math.max($o,Math.min(ji,s)):i}function dr(l,i){const s=Number(l);return Number.isFinite(s)?Math.max(Ei,Math.min(Jo,s)):i}function OA(l){const s=(dr(l,l)-Ei)/(Jo-Ei),r=ji-s*(ji-$o);return Math.round(r)}function DA(l){const i=_A(l,l),s=(ji-i)/(ji-$o),r=Ei+s*(Jo-Ei);return Math.round(r)}function kA(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=Mi(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 tr({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:y=>r(y.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:y=>r(y.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 zA(){const{state:{keymap:l},actions:{updateKeyBinding:i,resetKeyBindings:s}}=Qt(),{value:r,save:f}=Rt("inputs",ot),d={...ot.keyboard,...r.keyboard??{}},m=p.useMemo(()=>typeof d.tiltSpeed=="number"?dr(d.tiltSpeed,ot.keyboard.tiltSpeed):typeof d.tiltIntervalMs=="number"?dr(DA(d.tiltIntervalMs),ot.keyboard.tiltSpeed):ot.keyboard.tiltSpeed,[d.tiltIntervalMs,d.tiltSpeed]),y=p.useMemo(()=>MA(TA),[]),{active:g,startCapture:v,cancel:b}=kA((C,N)=>{i(C,N)}),A=p.useCallback(C=>l?.[C]?.[0]||bi[C]?.[0]||"",[l]),M=p.useCallback((C,N)=>{const S=ot.keyboard,T=RA(N,S[C]);f(_=>({..._??{},keyboard:{..._?.keyboard??S,[C]:T}}))},[f]),E=p.useCallback(C=>{const N=ot.keyboard,S=dr(C,N.tiltSpeed),T=OA(S);f(_=>({..._??{},keyboard:{..._?.keyboard??N,tiltSpeed:S,tiltIntervalMs:T}}))},[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(tr,{label:"Base speed",description:"Normal driving speed",value:d.baseSpeed,onChange:C=>M("baseSpeed",C)}),o.jsx(tr,{label:"Turbo speed",description:"Used when holding the boost modifier",value:d.turboSpeed,onChange:C=>M("turboSpeed",C)}),o.jsx(tr,{label:"Precision speed",description:"Used when holding the precision modifier",value:d.precisionSpeed,onChange:C=>M("precisionSpeed",C)})]})]}),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(tr,{label:"Tilt speed",description:"Higher = faster when holding tilt keys",value:m,onChange:E,min:1,max:100,step:1})]}),o.jsx("div",{className:"space-y-0.5",children:Object.entries(y).map(([C,N])=>o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.75rem] text-slate-400",children:C}),o.jsx("div",{className:"space-y-0.5",children:N.map(S=>{const T=A(S.id),_=g===S.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:S.label}),o.jsx("p",{className:"text-[0.65rem] text-slate-400",children:gl(T)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[_&&o.jsx("button",{type:"button",onClick:()=>b(),className:"button-danger text-[0.7rem]",children:"Cancel"}),o.jsx("button",{type:"button",onClick:()=>v(S.id),className:`${_?"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:_?"Press a key…":"Change"})]})]},S.id)})})]},C))})]})}function BA(){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 LA=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),UA=[{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 nr({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:LA.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:y=>m(Number(y.target.value)),className:"mt-0.5 w-full accent-emerald-400"})]})}function HA(l){return l?`Axis ${l.index}${l.invert?" (invert)":""}`:"Unassigned"}function VA(l){return l?`Button ${l.index}`:"Unassigned"}function ar(l,i,s){const[r,f]=i,d={...l??pr};return d[r]={...d[r]??pr[r]},d[r][f]=s(d[r][f]),d}function YA(){const l=BA(),{value:i,save:s,reset:r}=Rt("gamepadMapping",pr),{value:f,save:d}=Rt("inputs",ot),m=f.gamepad??ot.gamepad,[y,g]=p.useState(null),v=p.useRef(null),b=S=>{d(T=>({...T,gamepad:{...T.gamepad??ot.gamepad,...S}}))};p.useEffect(()=>{v.current=null},[y]),p.useEffect(()=>{if(!y)return;let S;const T=()=>{const _=navigator.getGamepads?.(),G=_&&Array.from(_).find(Boolean);if(G){if(y.type==="axis"){v.current||(v.current=Array.from(G.axes??[]).map(F=>F??0));for(let F=0;F<G.axes.length;F+=1){const ee=G.axes[F],I=v.current?.[F]??0,V=Math.abs(ee-I);if(Math.abs(ee)>.65&&V>.5){s(Z=>ar(Z,y.path,()=>({index:F,invert:ee<0}))),g(null);return}}}else if(y.type==="button")for(let F=0;F<G.buttons.length;F+=1){const ee=G.buttons[F];if(ee&&(ee.pressed||ee.value>.6)){s(I=>ar(I,y.path,()=>({index:F}))),g(null);return}}}S=requestAnimationFrame(T)};return S=requestAnimationFrame(T),()=>{S&&cancelAnimationFrame(S)}},[y,s]);const A=p.useMemo(()=>UA.reduce((S,T)=>((S[T.section]||(S[T.section]=[])).push(T),S),{}),[]),M=S=>{const[T,_]=S.path;return i?.[T]?.[_]??null},E=S=>{const T=M(S);return S.type==="axis"?HA(T):VA(T)},C=S=>{s(T=>ar(T,S.path,()=>null))},N=S=>{M(S)&&s(_=>ar(_,S.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."}),y&&o.jsxs("p",{className:"mt-0.5 text-[0.7rem] text-emerald-400",children:["Capturing ",y.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(nr,{label:"Drive deadzone",description:"Ignore small drive stick movement",min:0,max:.6,step:.01,value:m.driveDeadzone??.2,onChange:S=>b({driveDeadzone:S})}),o.jsx(nr,{label:"Camera deadzone",description:"Tilt stick sensitivity",min:0,max:.6,step:.01,value:m.cameraDeadzone??.25,onChange:S=>b({cameraDeadzone:S})}),o.jsx(nr,{label:"Servo step (deg)",description:"Degrees per camera tick",min:.5,max:6,step:.25,value:m.servoStep??2,onChange:S=>b({servoStep:S})}),o.jsx(nr,{label:"Side reverse multiplier",description:"Scale when reversing the side brush",min:.3,max:1,step:.05,value:m.auxReverseScale??.55,onChange:S=>b({auxReverseScale:S})})]})]}),Object.entries(A).map(([S,T])=>o.jsxs("div",{className:"space-y-0.5 surface",children:[o.jsx("p",{className:"text-[0.7rem] text-slate-500",children:S}),o.jsx("div",{className:"space-y-0.5",children:T.map(_=>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:_.label}),o.jsx("p",{className:"text-[0.65rem] text-slate-400",children:E(_)})]}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[_.type==="axis"&&o.jsx("button",{type:"button",disabled:!M(_),onClick:()=>N(_),className:`${M(_)?.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:()=>C(_),className:"button-dark text-[0.7rem]",children:"Clear"}),o.jsx("button",{type:"button",onClick:()=>g(_),className:`${y?.id===_.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:y?.id===_.id?"Waiting…":"Capture"})]})]},_.id))})]},S))]})]})}const J0=p.createContext(null);function F0(){const l=p.useContext(J0);if(!l)throw new Error("Tabs components must be used within a <Tabs> provider.");return l}const Up={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"}},W0="primary";function Fo(...l){return l.filter(Boolean).join(" ")}function I0({children:l,defaultTab:i,currentTab:s,onTabChange:r,variant:f=W0}){const[d,m]=p.useState(i??null),[y,g]=p.useState([]),v=p.useCallback(E=>E?(g(C=>C.includes(E)?C:[...C,E]),()=>g(C=>C.includes(E)?C.filter(N=>N!==E):C)):()=>{},[]),b=s??d??y[0]??null;p.useEffect(()=>{i&&s===void 0&&m(i)},[i,s]);const A=p.useCallback(E=>{E&&(s===void 0&&m(E),r&&r(E))},[s,r]),M=p.useMemo(()=>({activeTab:b,setActiveTab:A,registerTab:v,variant:f}),[b,A,v,f]);return o.jsx(J0.Provider,{value:M,children:l})}function P0({children:l,className:i=""}){return o.jsx("div",{className:Fo("flex gap-0.5",i),children:l})}function ja({id:l,children:i,className:s="",disabled:r=!1}){const{activeTab:f,setActiveTab:d,registerTab:m,variant:y}=F0();p.useEffect(()=>m(l),[l,m]);const g=Up[y]??Up[W0],v=f===l,b=Fo(g.base,v?g.active:g.inactive,r?"cursor-not-allowed opacity-50":"",s);return o.jsx("button",{type:"button",className:b,onClick:()=>!r&&d(l),"aria-pressed":v,"aria-disabled":r,children:i})}function eg({children:l,className:i=""}){return o.jsx("div",{className:Fo("mt-0.5 space-y-0.5",i),children:l})}function Ea({id:l,children:i,keepMounted:s=!1}){const{activeTab:r}=F0(),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 GA(){const{session:l}=Xe(),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 QA=[{key:"start",label:"Start OI"},{key:"safe",label:"Safe"},{key:"full",label:"Full"},{key:"passive",label:"Passive"},{key:"dock",label:"Dock"}];function XA(){const{state:{roverId:l},actions:{sendOiCommand:i,setSensorStream:s}}=Qt(),r=!!l,[f,d]=$0(),m=p.useMemo(()=>[{key:"start",label:"Enable stream",enable:!0},{key:"stop",label:"Disable stream",enable:!1}],[]),y=g=>{l&&s(g)};return o.jsxs(I0,{defaultTab:"keybindings",children:[o.jsxs(P0,{children:[o.jsx(ja,{id:"keybindings",children:"Keybindings"}),o.jsx(ja,{id:"controller",children:"Controller"}),o.jsx(ja,{id:"page",children:"Page settings"}),o.jsx(ja,{id:"admin",children:"Admin"})]}),o.jsxs(eg,{children:[o.jsx(Ea,{id:"keybindings",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(zA,{})})}),o.jsx(Ea,{id:"controller",children:o.jsx("div",{className:"space-y-0.5",children:o.jsx(YA,{})})}),o.jsx(Ea,{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:g=>d(g.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(Ea,{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:QA.map(g=>o.jsx("button",{type:"button",onClick:()=>i(g.key),disabled:!r,className:"button-dark text-xs disabled:opacity-30",children:g.label},g.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(g=>o.jsx("button",{type:"button",onClick:()=>y(g.enable),disabled:!r,className:"flex-1 button-dark text-xs disabled:opacity-30",children:g.label},g.key))}),!r&&o.jsx("p",{className:"text-xs text-slate-500",children:"Assign a rover to toggle streams."})]}),o.jsx(Go,{}),o.jsx(G0,{}),o.jsx(GA,{})]})})]})]})}const Hp={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 KA(l){return Hp[l]||Hp.desktop}function tg({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:gl(s)})}function Vp(l,i){return l.map((s,r)=>typeof s=="string"?o.jsx("span",{children:s},`text-${r}`):s?.action?o.jsx(tg,{actionId:s.action,keymap:i},`pill-${s.action}-${r}`):s?.text?o.jsx("span",{children:s.text},`span-${r}`):null)}function qr(l,i,s){if(typeof l=="string")return l;if(Array.isArray(l?.segments))return Vp(l.segments,i);if(l&&typeof l=="object"){if(typeof l.text=="string")return l.text;if(Array.isArray(l))return Vp(l,i)}return String(l??"")}function ZA({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:qr(s,i)},f)})})]}):null}function $A({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:qr(s,i)},f)})})]})}function JA({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:qr(s,{})},`callout-${r}`))})]})}function FA({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(tg,{actionId:s.action,keymap:i})]},s.action))})]})}function WA({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(FA,{group:s,keymap:i},s.id))})]}):null}function IA({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:qr(i,{})},`gamepad-${s}`))})]}):null}function Yp({block:l,keymap:i}){if(!l)return null;switch(l.type){case"list":return o.jsx($A,{block:l,keymap:i});case"callout":return o.jsx(JA,{block:l});case"keyboard":return o.jsx(WA,{block:l,keymap:i});case"gamepad":return o.jsx(IA,{block:l});default:return null}}function ng({layout:l,keymap:i}){const s=p.useMemo(()=>KA(l),[l]),r=i||{},f=s.main||[],d=s.aside||[];return o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(ZA,{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,y)=>o.jsx(Yp,{block:m,keymap:r},m.title||y))}),o.jsx("div",{className:"space-y-0.5",children:d.map((m,y)=>o.jsx(Yp,{block:m,keymap:r},m.title||y))})]})]})}function PA({layout:l,onOpenOverlay:i}){const{state:s}=Qt();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(ng,{layout:l,keymap:s?.keymap||{}})]})}function eS({layout:l,onOpenHelpOverlay:i}){return o.jsx("section",{className:"panel text-base",children:o.jsxs(I0,{defaultTab:"telemetry",children:[o.jsxs(P0,{children:[o.jsx(ja,{id:"telemetry",children:"Controls"}),o.jsx(ja,{id:"help",children:"Help"}),o.jsx(ja,{id:"settings",children:"Settings"})]}),o.jsxs(eg,{children:[o.jsx(Ea,{id:"telemetry",children:o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Y0,{}),o.jsx(Sr,{defaultOrientation:"horizontal",panelId:"rightpane-telemetry"}),o.jsx(Zo,{}),o.jsx(zo,{})]})}),o.jsx(Ea,{id:"help",children:o.jsx(PA,{layout:l,onOpenOverlay:i})}),o.jsx(Ea,{id:"settings",children:o.jsx(XA,{})})]})]})})}var ag={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Gp=Na.createContext&&Na.createContext(ag),tS=["attr","size","title"];function nS(l,i){if(l==null)return{};var s=aS(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 aS(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 gr(){return gr=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},gr.apply(this,arguments)}function Qp(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 yr(l){for(var i=1;i<arguments.length;i++){var s=arguments[i]!=null?arguments[i]:{};i%2?Qp(Object(s),!0).forEach(function(r){lS(l,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(s)):Qp(Object(s)).forEach(function(r){Object.defineProperty(l,r,Object.getOwnPropertyDescriptor(s,r))})}return l}function lS(l,i,s){return i=iS(i),i in l?Object.defineProperty(l,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[i]=s,l}function iS(l){var i=sS(l,"string");return typeof i=="symbol"?i:i+""}function sS(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 lg(l){return l&&l.map((i,s)=>Na.createElement(i.tag,yr({key:s},i.attr),lg(i.child)))}function rS(l){return i=>Na.createElement(uS,gr({attr:yr({},l.attr)},i),lg(l.child))}function uS(l){var i=s=>{var{attr:r,size:f,title:d}=l,m=nS(l,tS),y=f||s.size||"1em",g;return s.className&&(g=s.className),l.className&&(g=(g?g+" ":"")+l.className),Na.createElement("svg",gr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,r,m,{className:g,style:yr(yr({color:l.color||s.color},s.style),l.style),height:y,width:y,xmlns:"http://www.w3.org/2000/svg"}),d&&Na.createElement("title",null,d),l.children)};return Gp!==void 0?Na.createElement(Gp.Consumer,null,s=>i(s)):i(ag)}function cS(l){return rS({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 ig({text:l="Join our Discord!"}){const{session:i}=Xe(),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(cS,{className:"mr-2"}),l]}):null}function oS(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 fS(l){const i=new Date(l);return`${i.getHours().toString().padStart(2,"0")}:${i.getMinutes().toString().padStart(2,"0")}`}function dS(l){return l.nickname||l.socketId?.slice(0,6)||"unknown"}const hS=["kal","rms","slt","ksp","bdl"],mS=Array.from({length:10},(l,i)=>i*10);function bl({hideInput:l=!1,hideSpectatorNotice:i=!1,fillHeight:s=!1}){const{session:r}=Xe(),{messages:f,sendMessage:d,registerInputRef:m,onInputFocus:y,onInputBlur:g,blurChat:v}=k0(),{value:b,save:A}=Rt("tts",{engine:"flite",voice:"rms",pitch:50}),[M,E]=p.useState(""),[C,N]=p.useState(!1),[S,T]=p.useState(!1),[_,G]=p.useState(()=>b?.engine||"flite"),[F,ee]=p.useState(()=>b?.voice||"rms"),[I,V]=p.useState(()=>Number.isFinite(b?.pitch)?b.pitch:50),Z=r?.role!=="spectator",P=p.useRef(null),ue=r?.assignment?.roverId||null,me=!!p.useMemo(()=>r?.roster?.find(B=>String(B.id)===String(ue))||null,[ue,r?.roster])?.audio?.ttsEnabled,$=p.useMemo(()=>f.slice(-200),[f]);p.useEffect(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)},[$]),p.useEffect(()=>{const B=b?.engine||"flite",J=b?.voice||"rms",W=Number.isFinite(b?.pitch)?b.pitch:50;_!==B&&G(B),F!==J&&ee(J),I!==W&&V(W)},[_,I,b?.engine,b?.pitch,b?.voice,F]),p.useEffect(()=>{T(!!me)},[me]);const te=p.useMemo(()=>!me||!S?null:_==="espeak"?{speak:!0,engine:_,pitch:I}:{speak:!0,engine:_,voice:F},[_,I,S,me,F]);async function oe(B){if(B.preventDefault(),!Z||l)return;const W=M.replace(/\\n/g,`
|
||
`).trim();if(W){N(!0);try{await d(W,te),E(""),v()}catch(le){alert(le.message)}finally{N(!1)}}}const z=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 ${z}`,ref:P,children:$.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"No messages yet."}):$.map(B=>{const J=B.role==="admin"||B.role==="lockdown"||B.role==="lockdown-admin";return o.jsxs("div",{className:`surface-muted text-sm flex items-start gap-1 ${J?"border border-amber-400/30":B.fromDiscord?"border border-indigo-400/30 bg-indigo-900/20":""}`,children:[o.jsx("span",{className:"text-[0.75rem] text-slate-400",children:fS(B.ts)}),o.jsx("span",{className:`font-semibold text-[0.85rem] ${oS(B.role,B.fromDiscord)}`,children:dS(B)}),B.fromDiscord&&o.jsx("span",{className:"rounded bg-indigo-500/30 px-1 text-[0.7rem] text-indigo-100",children:"Discord"}),B.roverId&&o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:["rover ",B.roverId]}),o.jsx("span",{className:"text-slate-100 break-words leading-tight whitespace-pre-wrap",children:B.text})]},B.id)})}),!l&&o.jsxs("form",{className:"flex flex-wrap items-start gap-0.5",onSubmit:oe,children:[o.jsx("input",{className:"field-input flex-1 min-w-[10rem]",value:M,onChange:B=>E(B.target.value),onFocus:y,onBlur:g,ref:B=>m(B),placeholder:Z?"Type a message…":i?"":"Spectators cannot chat",disabled:!Z}),me&&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:S,onChange:B=>T(B.target.checked),className:"accent-cyan-500"}),o.jsx("span",{children:"Speak"})]}),o.jsxs("select",{value:_,onChange:B=>{const J=B.target.value;G(J),A(W=>({...W||{},engine:J}))},className:"field-input text-xs",children:[o.jsx("option",{value:"flite",children:"flite"}),o.jsx("option",{value:"espeak",children:"espeak"})]}),_==="flite"?o.jsx("select",{value:F,onChange:B=>{const J=B.target.value;ee(J),A(W=>({...W||{},voice:J}))},className:"field-input text-xs",children:hS.map(B=>o.jsx("option",{value:B,children:B},B))}):o.jsx("select",{value:I,onChange:B=>{const J=Number(B.target.value);V(J),A(W=>({...W||{},pitch:J}))},className:"field-input text-xs",children:mS.map(B=>o.jsxs("option",{value:B,children:["pitch ",B]},B))})]}),o.jsx("button",{type:"submit",disabled:!Z||C,className:"button-dark disabled:opacity-50 self-start",children:C?"...":"Send"})]})]})}function sg({compact:l=!1}){const{session:i,setNickname:s}=Xe(),{value:r,save:f}=Rt("profile",{nickname:""}),[d,m]=p.useState(r.nickname||""),[y,g]=p.useState(!1),v=i?.role!=="spectator";p.useEffect(()=>{m(r.nickname||"")},[r.nickname]);async function b(A){if(A.preventDefault(),!v)return;const M=(d||"").trim().slice(0,32);if(M){g(!0);try{await s(M),f({nickname:M})}catch(E){alert(E.message)}finally{g(!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:!v}),o.jsx("button",{type:"submit",disabled:!v||y,className:"button-dark disabled:opacity-50",children:y?"Saving…":l?"Set":"Save"})]})}const pS=new Set(["admin","lockdown","lockdown-admin"]),gS=new Set(["admin","lockdown"]);function yS(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 vS(){const{session:l}=Xe(),i=l?.mode,s=l?.role,r=gS.has(i),f=pS.has(s);if(!r||f)return null;const d=yS(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(Go,{})}),o.jsx("div",{className:"w-full justify-center items-center",children:o.jsx(ig,{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(bl,{}),o.jsx(sg,{})]})]})})}const xS="/assets/turn_alert-DVO8EZJa.mp3";function bS(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 AS(){const{session:l,pushAlert:i}=Xe(),s=bS(xS),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(([y,g])=>{!g||!g.current||g.current!==d||r.current.has(y)||(m.push(y),r.current.add(y))}),Object.keys(f).forEach(y=>{(!f[y]||f[y].current!==d)&&r.current.delete(y)}),m.length!==0&&(m.forEach(y=>{const g=l?.roster?.find(v=>String(v.id)===String(y))?.name||y;i({title:"Your turn!",message:`You now control ${g}.`,color:"success"})}),s())},[f,s,i,l?.roster,d]),null}function Xp(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 Kp(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 jr({hideNicknameForm:l=!1,hideHeader:i=!1,className:s="",fillHeight:r=!1}){const{session:f,setNickname:d}=Xe(),{value:m}=Rt("profile",{nickname:""}),y=p.useRef(null),g=wa(),v=f?.role!=="spectator",b=f?.users??[],A=f?.socketId||null,M=f?.mode==="turns",E=f?.turnQueues||{},C=f?.roster||[];p.useEffect(()=>{if(!v||!f?.socketId)return;const V=m.nickname||"";if(!V||f.socketId===y.current)return;const Z=f.socketId;d(V).then(()=>{y.current=Z}).catch(()=>{})},[v,f?.socketId,d,m.nickname]),p.useEffect(()=>{if(!g)return;const V=()=>{if(!v)return;const Z=(m.nickname||"").trim();Z&&d(Z).then(()=>{y.current=f?.socketId||null}).catch(()=>{})};return g.on("connect",V),()=>g.off("connect",V)},[v,d,g,m.nickname,f?.socketId]);const N=p.useMemo(()=>[...b].sort((V,Z)=>V.socketId===A?-1:Z.socketId===A?1:(V.nickname||"").localeCompare(Z.nickname||"")),[A,b]),S=p.useCallback(V=>C.find(Z=>String(Z.id)===String(V))?.name||V,[C]),T=p.useCallback(V=>b.find(Z=>Z.socketId===V)||{socketId:V,nickname:null,role:null},[b]),_=p.useCallback(V=>{if(!V)return null;const Z=V-Date.now();return Z<=0?0:Math.ceil(Z/1e3)},[]),G=r?"flex-1 min-h-0 overflow-y-auto":"h-48 overflow-y-auto",F=M&&r?"max-h-40 overflow-y-auto":G,ee=M&&r?"flex-1 min-h-0 overflow-y-auto":G,I=()=>N.length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"Waiting for users…"}):N.map(V=>{const Z=V.role==="admin"||V.role==="lockdown"||V.role==="lockdown-admin";return o.jsxs("div",{className:"surface-muted flex items-center gap-1 text-sm",children:[o.jsx("p",{className:`font-semibold ${Xp(V.role)}`,children:Kp(V,A)}),V.roverId?o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:["rover ",V.roverId]}):o.jsx("span",{className:"text-[0.7rem] text-slate-500",children:"no rover"}),Z&&o.jsx("span",{className:"rounded bg-amber-500/30 px-1 text-[0.7rem] text-amber-200",children:"Admin"})]},V.socketId)});return o.jsxs("section",{className:`panel-section space-y-0.5 text-base ${r?"flex h-full min-h-0 flex-col overflow-hidden":""} ${s}`,children:[!l&&o.jsxs("div",{className:"space-y-0.5 flex",children:[o.jsx("div",{className:"w-1/2",children:o.jsx(sg,{})}),o.jsx("div",{className:"w-1/2",children:o.jsx(ig,{})}),!v&&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:M?"Turn queues":"Users"}),o.jsx("span",{className:"text-xs text-slate-500",children:M?Object.keys(E||{}).length:N.length})]}),o.jsx("div",{className:`surface space-y-0.25 ${M?F:G}`,children:M?Object.keys(E||{}).length===0?o.jsx("p",{className:"text-sm text-slate-500",children:"No turn queues yet."}):Object.entries(E).map(([V,Z])=>{const P=Z?.queue||[],ue=Z?.idleDeadline||Z?.deadline||null,be=_(ue);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:S(V)}),be!=null&&o.jsxs("span",{className:"rounded bg-slate-800 px-1 text-[0.7rem]",children:[be,"s left"]})]}),P.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:P.map((me,$)=>{const te=T(me),oe=me===Z?.current,z=te.role==="admin"||te.role==="lockdown"||te.role==="lockdown-admin";return o.jsxs("span",{className:`flex items-center gap-0.5 rounded px-1 text-[0.8rem] ${oe?"bg-sky-700 text-white":"bg-slate-800 text-slate-200"}`,children:[o.jsx("span",{className:`${Xp(te.role)} font-semibold`,children:Kp(te,A)}),z&&o.jsx("span",{className:"text-[0.7rem] text-amber-200",children:"★"}),oe&&o.jsx("span",{className:"text-[0.7rem] text-slate-200",children:"now"})]},`${V}-${me}-${$}`)})})]},V)}):I()}),M?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:N.length})]}),o.jsx("div",{className:`surface space-y-0.25 ${ee}`,children:I()})]}):null]})]})}function SS({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 rg="fullscreenPromptDismissed",qS=new Set(["mobile-portrait","mobile-landscape"]),ug=()=>{if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}},jS=()=>{const l=ug();if(!l)return!1;try{return l.getItem(rg)==="1"}catch{return!1}},Zp=()=>{const l=ug();if(l)try{l.setItem(rg,"1")}catch{}},ES=()=>{if(typeof navigator>"u")return!1;const l=navigator.userAgent||navigator.platform||"";return/iphone|ipad|ipod/i.test(l)},NS=()=>{if(typeof document>"u")return!1;const l=document;return!!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled)};function CS(l){const i=qS.has(l),[s,r]=p.useState(!1),[f,d]=p.useState("native"),m=p.useMemo(()=>ES(),[]),y=p.useCallback(()=>{if(!i){r(!1);return}if(jS()){r(!1);return}if(m){d("pwa-hint"),r(!0);return}if(!NS()){r(!1);return}if(typeof document<"u"&&document.fullscreenElement){r(!1);return}d("native"),r(!0)},[m,i]);p.useEffect(()=>{y()},[y]),p.useEffect(()=>{if(typeof document>"u")return;const b=()=>{if(document.fullscreenElement){r(!1);return}y()};return document.addEventListener("fullscreenchange",b),document.addEventListener("webkitfullscreenchange",b),()=>{document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b)}},[y]);const g=p.useCallback(()=>{Zp(),r(!1)},[]),v=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 M=A.call(b);return M&&typeof M.then=="function"&&await M,Zp(),r(!1),!0}catch(M){return console.warn("Failed to enter fullscreen",M),!1}},[m,i]);return p.useEffect(()=>{i||r(!1)},[i]),{visible:s,mode:f,enterFullscreen:v,dismiss:g}}function wS({visible:l,layout:i,onClose:s,showOnLoad:r,onToggleShowOnLoad:f}){if(!l)return null;const{state:d}=Qt(),m=y=>{const g=!y.target.checked;f?.(g)};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(ng,{layout:i,keymap:d?.keymap||{}})})]})})}function TS(){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 MS({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(Ko,{}),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(jr,{fillHeight:!0})}),o.jsx("div",{className:"h-full min-h-0",children:o.jsx(bl,{fillHeight:!0})})]}),o.jsx(Yo,{})]}),o.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-y-auto",children:o.jsx(eS,{layout:l,onOpenHelpOverlay:i})})]})}function RS(){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx(Ko,{layoutFormat:"mobile"}),o.jsx(rA,{}),o.jsx(Y0,{}),o.jsx(bl,{}),o.jsx(jr,{}),o.jsx(zo,{}),o.jsx(Go,{}),o.jsx(G0,{}),o.jsx(Sr,{panelId:"mobile-portrait-room"}),o.jsx(Zo,{}),o.jsx(Yo,{})]})}function _S(){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(iA,{}),o.jsxs("div",{children:[o.jsx(Ko,{layoutFormat:"mobile"}),o.jsx(zo,{})]}),o.jsx(sA,{})]}),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(jr,{})}),o.jsx("div",{className:"flex flex-col gap-0.5",children:o.jsx(bl,{})})]}),o.jsx(Sr,{panelId:"mobile-landscape-room"}),o.jsx(Zo,{})]})]})}function OS(){const l=TS(),i=l==="desktop",s=CS(l);return o.jsx("div",{className:`bg-black text-slate-100 ${i?"h-screen overflow-hidden":"min-h-screen"}`,children:o.jsx(mr,{children:o.jsx(DS,{layout:l,isDesktop:i,fullscreen:s})})})}function DS({layout:l,isDesktop:i,fullscreen:s}){const{visible:r,mode:f,enterFullscreen:d,dismiss:m}=s,{value:y,status:g,save:v}=Rt("help",{showOnLoad:!0}),[b,A]=p.useState(!1);p.useEffect(()=>{g==="ready"&&A(y?.showOnLoad!==!1)},[g,y?.showOnLoad]);const M=p.useCallback(()=>A(!0),[]),E=p.useCallback(()=>A(!1),[]),C=p.useCallback(S=>{const T=!!S;v(_=>({..._??{},showOnLoad:T})),T||A(!1)},[v]),N=p.useMemo(()=>i?o.jsx(MS,{layout:l,onOpenHelpOverlay:M}):l==="mobile-landscape"?o.jsx(_S,{}):o.jsx(RS,{}),[i,l,M]);return o.jsxs(w1,{children:[o.jsx(B1,{}),o.jsx(L1,{}),o.jsx("main",{className:`flex w-full flex-col gap-0.5 text-base ${i?"h-full overflow-hidden":""}`,children:N}),o.jsx(I1,{}),o.jsx(AS,{}),o.jsx(vS,{}),o.jsx(wS,{visible:b,layout:l,onClose:E,showOnLoad:y?.showOnLoad!==!1,onToggleShowOnLoad:C}),o.jsx(SS,{visible:r,mode:f,onEnterFullscreen:d,onDismiss:m})]})}function cg(){const{session:l,setRole:i,subscribeAll:s,connected:r}=Xe(),[f,d]=p.useState(!1);return p.useEffect(()=>{let m=!1;async function y(){if(l?.mode==="lockdown"){d(!1);return}try{l?.role!=="spectator"&&await i("spectator"),await s(),m||d(!0)}catch(g){console.error("Failed to enter spectator mode",g),m||d(!1)}}return y(),()=>{m=!0}},[r,l?.mode,l?.role,i,s]),f}function kS({roverId:l,session:i}){const s=i?.activeDrivers?.[l]||null,f=(i?.users||[]).find(g=>g.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 zS({rover:l,frame:i,videoInfo:s,audioInfo:r,session:f}){const d=kS({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(Xo,{sessionInfo:s,audioSessionInfo:r,label:l.name,telemetryFrame:i,batteryConfig:l.battery,hudVariant:"spectator",driverLabel:d,hudForceMap:!0,hudMapPosition:"bottom-left"})})})}function BS({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(zS,{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 LS(){return o.jsx("section",{className:"min-h-0",children:o.jsx("div",{className:"surface min-h-[14rem] overflow-hidden",children:o.jsx(Sr,{defaultOrientation:"horizontal",hideLayoutToggle:!0,hideHeader:!0,panelId:"spectator-secondary"})})})}function US({className:l=""}){return o.jsx("div",{className:`panel ${l}`,children:o.jsx(Yo,{})})}function HS(){const{session:l}=Xe(),i=l?.mode==="lockdown";cg();const s=ko(),r=l?.roster??[],f=r.flatMap(m=>{const y={type:"rover",id:m.id,key:m.id};return m.media?.audioPublishUrl?[y,{type:"rover",id:`${m.id}-audio`,key:`${m.id}-audio`}]:[y]}),d=Qo(f,{enabled:!i,version:l?.mode});return i?o.jsx(mr,{children:o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-black text-slate-200",children:o.jsxs("div",{className:"surface max-w-md space-y-0.5 p-1 text-center text-sm",children:[o.jsx("p",{className:"text-lg font-semibold text-white",children:"Spectate disabled during lockdown."}),o.jsx("p",{className:"text-slate-300",children:"Please wait until the server leaves lockdown to view streams."})]})})}):o.jsx(mr,{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(BS,{roster:r,frames:s,videoSources:d,session:l}),o.jsx(LS,{})]}),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(Vo,{roster:r,title:"Rovers",emptyText:"No rovers registered."})}),o.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:o.jsx(jr,{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(bl,{hideInput:!0,hideSpectatorNotice:!0,fillHeight:!0})}),o.jsx("div",{className:"min-h-0 min-w-0",children:o.jsx(US,{className:"h-40 overflow-hidden"})})]})]})})})}const VS=2e4;function YS({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 GS(){const{session:l}=Xe(),i=cg(),s=l?.mode==="lockdown",r=ko(),f=l?.roster??[],d=l?.roomCameras||[],m=K0(d.map(I=>({id:I.id})),{enabled:!s,version:l?.mode}),[y,g]=p.useState(0),v=p.useMemo(()=>f.flatMap(I=>{if(!I?.id)return[];const V=String(I.id),Z=[{type:"rover",id:V,key:V}];return I.media?.audioPublishUrl&&Z.push({type:"rover",id:`${V}-audio`,key:`${V}-audio`}),Z}),[f]),b=Qo(v,{enabled:!s,version:l?.mode}),A=p.useMemo(()=>{if(!f.length)return[];const I=f.filter(V=>b[V.id]?.url);return I.length?I:f},[f,b]),M=p.useMemo(()=>{const I=[];return A.forEach(V=>I.push({type:"rover",rover:V})),d.forEach(V=>I.push({type:"room",camera:V})),I},[A,d]),E=p.useMemo(()=>M.map(I=>I.type==="rover"?`r:${I.rover.id}`:`room:${I.camera.id}`).join("|"),[M]);p.useEffect(()=>{g(0)},[E]),p.useEffect(()=>{if(!M.length)return;const I=setInterval(()=>{g(V=>(V+1)%M.length)},VS);return()=>clearInterval(I)},[M.length,E]);const C=M.length?M[y%M.length]:null,N=C?.type==="rover"?C.rover:null,S=C?.type==="room"?C.camera:null,T=N&&b[N.id]||null,_=N&&b[`${N.id}-audio`]||null,G=N&&r[N.id]||null,F=N?YS({roverId:N.id,session:l}):null,ee=S&&m[S.id]||null;return s?o.jsx("div",{className:"relative flex h-screen w-screen items-center justify-center bg-black text-slate-200",children:o.jsxs("div",{className:"surface max-w-sm space-y-0.5 p-1 text-center text-sm",children:[o.jsx("p",{className:"text-lg font-semibold text-white",children:"Mini spectator is disabled in lockdown."}),o.jsx("p",{className:"text-slate-300",children:"It will automatically resume once lockdown ends."})]})}):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(KS,{}),o.jsx("section",{className:"panel relative flex min-h-0 flex-1 overflow-hidden",children:i?N?o.jsx($p,{children:o.jsx(Xo,{sessionInfo:T,audioSessionInfo:_,label:N.name||N.id,telemetryFrame:G,batteryConfig:N.battery,layoutFormat:"mobile",hudVariant:"spectator",driverLabel:F,hudForceMap:!0,hudMapPosition:"bottom-left",fitParent:!0})}):S?o.jsx($p,{children:o.jsx(XS,{camera:S,feed:ee})}):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 QS(){return o.jsx(mr,{children:o.jsx(GS,{})})}function XS({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 KS(){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(bl,{hideInput:!0,hideSpectatorNotice:!0})})})}function $p({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})})})}Yv.createRoot(document.getElementById("root")).render(o.jsx(p.StrictMode,{children:o.jsx(s1,{children:o.jsx(u1,{children:o.jsx(c1,{children:o.jsx(M1,{children:o.jsx(ab,{children:o.jsxs(Dx,{children:[o.jsx(lr,{path:"/",element:o.jsx(OS,{})}),o.jsx(lr,{path:"/spectate",element:o.jsx(HS,{})}),o.jsx(lr,{path:"/mini",element:o.jsx(QS,{})})]})})})})})})}));
|