From d984951b206a8cf9afc20fe5a4c00fff2e2262ea Mon Sep 17 00:00:00 2001 From: legop3 Date: Sat, 15 Nov 2025 04:25:33 -0500 Subject: [PATCH] f --- server/public/assets/{index-DA6EAiU9.js => index-BED_cmF2.js} | 2 +- server/public/index.html | 2 +- webui/src/lib/socket.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) rename server/public/assets/{index-DA6EAiU9.js => index-BED_cmF2.js} (96%) diff --git a/server/public/assets/index-DA6EAiU9.js b/server/public/assets/index-BED_cmF2.js similarity index 96% rename from server/public/assets/index-DA6EAiU9.js rename to server/public/assets/index-BED_cmF2.js index d7a72f8d..7268d877 100644 --- a/server/public/assets/index-DA6EAiU9.js +++ b/server/public/assets/index-BED_cmF2.js @@ -6,4 +6,4 @@ `+h[n].replace(" at new "," at ");return t.displayName&&_.includes("")&&(_=_.replace("",t.displayName)),_}while(1<=n&&0<=a);break}}}finally{ii=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Rl(l):""}function Ad(t,e){switch(t.tag){case 26:case 27:case 5:return Rl(t.type);case 16:return Rl("Lazy");case 13:return t.child!==e&&e!==null?Rl("Suspense Fallback"):Rl("Suspense");case 19:return Rl("SuspenseList");case 0:case 15:return ci(t.type,!1);case 11:return ci(t.type.render,!1);case 1:return ci(t.type,!0);case 31:return Rl("Activity");default:return""}}function Jf(t){try{var e="",l=null;do e+=Ad(t,l),l=t,t=t.return;while(t);return e}catch(n){return` Error generating stack: `+n.message+` `+n.stack}}var fi=Object.prototype.hasOwnProperty,si=o.unstable_scheduleCallback,oi=o.unstable_cancelCallback,zd=o.unstable_shouldYield,Od=o.unstable_requestPaint,Pt=o.unstable_now,Nd=o.unstable_getCurrentPriorityLevel,kf=o.unstable_ImmediatePriority,Wf=o.unstable_UserBlockingPriority,Ba=o.unstable_NormalPriority,Md=o.unstable_LowPriority,$f=o.unstable_IdlePriority,Rd=o.log,Dd=o.unstable_setDisableYieldValue,Yn=null,te=null;function ll(t){if(typeof Rd=="function"&&Dd(t),te&&typeof te.setStrictMode=="function")try{te.setStrictMode(Yn,t)}catch{}}var ee=Math.clz32?Math.clz32:Cd,Ud=Math.log,xd=Math.LN2;function Cd(t){return t>>>=0,t===0?32:31-(Ud(t)/xd|0)|0}var qa=256,Ha=262144,Ya=4194304;function Dl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ja(t,e,l){var n=t.pendingLanes;if(n===0)return 0;var a=0,u=t.suspendedLanes,c=t.pingedLanes;t=t.warmLanes;var r=n&134217727;return r!==0?(n=r&~u,n!==0?a=Dl(n):(c&=r,c!==0?a=Dl(c):l||(l=r&~t,l!==0&&(a=Dl(l))))):(r=n&~u,r!==0?a=Dl(r):c!==0?a=Dl(c):l||(l=n&~t,l!==0&&(a=Dl(l)))),a===0?0:e!==0&&e!==a&&(e&u)===0&&(u=a&-a,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:a}function jn(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Bd(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 Ff(){var t=Ya;return Ya<<=1,(Ya&62914560)===0&&(Ya=4194304),t}function ri(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function Ln(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function qd(t,e,l,n,a,u){var c=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var r=t.entanglements,h=t.expirationTimes,p=t.hiddenUpdates;for(l=c&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Qd=/[\n"\\]/g;function re(t){return t.replace(Qd,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gi(t,e,l,n,a,u,c,r){t.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.type=c:t.removeAttribute("type"),e!=null?c==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+oe(e)):t.value!==""+oe(e)&&(t.value=""+oe(e)):c!=="submit"&&c!=="reset"||t.removeAttribute("value"),e!=null?pi(t,c,oe(e)):l!=null?pi(t,c,oe(l)):n!=null&&t.removeAttribute("value"),a==null&&u!=null&&(t.defaultChecked=!!u),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.name=""+oe(r):t.removeAttribute("name")}function os(t,e,l,n,a,u,c,r){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){vi(t);return}l=l!=null?""+oe(l):"",e=e!=null?""+oe(e):l,r||e===t.value||(t.value=e),t.defaultValue=e}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=r?t.checked:!!n,t.defaultChecked=!!n,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.name=c),vi(t)}function pi(t,e,l){e==="number"&&Qa(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function tn(t,e,l,n){if(t=t.options,e){e={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ti=!1;if(Le)try{var Vn={};Object.defineProperty(Vn,"passive",{get:function(){Ti=!0}}),window.addEventListener("test",Vn,Vn),window.removeEventListener("test",Vn,Vn)}catch{Ti=!1}var al=null,Ai=null,Va=null;function gs(){if(Va)return Va;var t,e=Ai,l=e.length,n,a="value"in al?al.value:al.textContent,u=a.length;for(t=0;t=Kn),Ts=" ",As=!1;function zs(t,e){switch(t){case"keyup":return my.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Os(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var an=!1;function gy(t,e){switch(t){case"compositionend":return Os(e);case"keypress":return e.which!==32?null:(As=!0,Ts);case"textInput":return t=e.data,t===Ts&&As?null:t;default:return null}}function py(t,e){if(an)return t==="compositionend"||!Ri&&zs(t,e)?(t=gs(),Va=Ai=al=null,an=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=n}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=Bs(l)}}function Hs(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Hs(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ys(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Qa(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=Qa(t.document)}return e}function xi(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Oy=Le&&"documentMode"in document&&11>=document.documentMode,un=null,Ci=null,$n=null,Bi=!1;function js(t,e,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Bi||un==null||un!==Qa(n)||(n=un,"selectionStart"in n&&xi(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),$n&&Wn($n,n)||($n=n,n=Hu(Ci,"onSelect"),0>=c,a-=c,Re=1<<32-ee(e)+a|l<w?(F=H,H=null):F=H.sibling;var lt=S(v,H,g[w],z);if(lt===null){H===null&&(H=F);break}t&&H&<.alternate===null&&e(v,H),d=u(lt,d,w),et===null?j=lt:et.sibling=lt,et=lt,H=F}if(w===g.length)return l(v,H),P&&Qe(v,w),j;if(H===null){for(;ww?(F=H,H=null):F=H.sibling;var Ol=S(v,H,lt.value,z);if(Ol===null){H===null&&(H=F);break}t&&H&&Ol.alternate===null&&e(v,H),d=u(Ol,d,w),et===null?j=Ol:et.sibling=Ol,et=Ol,H=F}if(lt.done)return l(v,H),P&&Qe(v,w),j;if(H===null){for(;!lt.done;w++,lt=g.next())lt=O(v,lt.value,z),lt!==null&&(d=u(lt,d,w),et===null?j=lt:et.sibling=lt,et=lt);return P&&Qe(v,w),j}for(H=n(H);!lt.done;w++,lt=g.next())lt=b(H,v,w,lt.value,z),lt!==null&&(t&<.alternate!==null&&H.delete(lt.key===null?w:lt.key),d=u(lt,d,w),et===null?j=lt:et.sibling=lt,et=lt);return t&&H.forEach(function(Km){return e(v,Km)}),P&&Qe(v,w),j}function ot(v,d,g,z){if(typeof g=="object"&&g!==null&&g.type===Ut&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Yt:t:{for(var j=g.key;d!==null;){if(d.key===j){if(j=g.type,j===Ut){if(d.tag===7){l(v,d.sibling),z=a(d,g.props.children),z.return=v,v=z;break t}}else if(d.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Vt&&Ql(j)===d.type){l(v,d.sibling),z=a(d,g.props),la(z,g),z.return=v,v=z;break t}l(v,d);break}else e(v,d);d=d.sibling}g.type===Ut?(z=Hl(g.props.children,v.mode,z,g.key),z.return=v,v=z):(z=Pa(g.type,g.key,g.props,null,v.mode,z),la(z,g),z.return=v,v=z)}return c(v);case _t:t:{for(j=g.key;d!==null;){if(d.key===j)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){l(v,d.sibling),z=a(d,g.children||[]),z.return=v,v=z;break t}else{l(v,d);break}else e(v,d);d=d.sibling}z=Qi(g,v.mode,z),z.return=v,v=z}return c(v);case Vt:return g=Ql(g),ot(v,d,g,z)}if(_e(g))return C(v,d,g,z);if(Zt(g)){if(j=Zt(g),typeof j!="function")throw Error(s(150));return g=j.call(g),L(v,d,g,z)}if(typeof g.then=="function")return ot(v,d,iu(g),z);if(g.$$typeof===jt)return ot(v,d,lu(v,g),z);cu(v,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,d!==null&&d.tag===6?(l(v,d.sibling),z=a(d,g),z.return=v,v=z):(l(v,d),z=Xi(g,v.mode,z),z.return=v,v=z),c(v)):l(v,d)}return function(v,d,g,z){try{ea=0;var j=ot(v,d,g,z);return gn=null,j}catch(H){if(H===vn||H===au)throw H;var et=ne(29,H,null,v.mode);return et.lanes=z,et.return=v,et}finally{}}}var Vl=co(!0),fo=co(!1),sl=!1;function Pi(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ol(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function rl(t,e,l){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(nt&2)!==0){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,e=Ia(t),ws(t,null,l),e}return Fa(t,n,e,l),Ia(t)}function na(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,Pf(t,l)}}function ec(t,e){var l=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?a=u=c:u=u.next=c,l=l.next}while(l!==null);u===null?a=u=e:u=u.next=e}else a=u=e;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var lc=!1;function aa(){if(lc){var t=mn;if(t!==null)throw t}}function ua(t,e,l,n){lc=!1;var a=t.updateQueue;sl=!1;var u=a.firstBaseUpdate,c=a.lastBaseUpdate,r=a.shared.pending;if(r!==null){a.shared.pending=null;var h=r,p=h.next;h.next=null,c===null?u=p:c.next=p,c=h;var _=t.alternate;_!==null&&(_=_.updateQueue,r=_.lastBaseUpdate,r!==c&&(r===null?_.firstBaseUpdate=p:r.next=p,_.lastBaseUpdate=h))}if(u!==null){var O=a.baseState;c=0,_=p=h=null,r=u;do{var S=r.lane&-536870913,b=S!==r.lane;if(b?($&S)===S:(n&S)===S){S!==0&&S===yn&&(lc=!0),_!==null&&(_=_.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});t:{var C=t,L=r;S=e;var ot=l;switch(L.tag){case 1:if(C=L.payload,typeof C=="function"){O=C.call(ot,O,S);break t}O=C;break t;case 3:C.flags=C.flags&-65537|128;case 0:if(C=L.payload,S=typeof C=="function"?C.call(ot,O,S):C,S==null)break t;O=x({},O,S);break t;case 2:sl=!0}}S=r.callback,S!==null&&(t.flags|=64,b&&(t.flags|=8192),b=a.callbacks,b===null?a.callbacks=[S]:b.push(S))}else b={lane:S,tag:r.tag,payload:r.payload,callback:r.callback,next:null},_===null?(p=_=b,h=O):_=_.next=b,c|=S;if(r=r.next,r===null){if(r=a.shared.pending,r===null)break;b=r,r=b.next,b.next=null,a.lastBaseUpdate=b,a.shared.pending=null}}while(!0);_===null&&(h=O),a.baseState=h,a.firstBaseUpdate=p,a.lastBaseUpdate=_,u===null&&(a.shared.lanes=0),vl|=c,t.lanes=c,t.memoizedState=O}}function so(t,e){if(typeof t!="function")throw Error(s(191,t));t.call(e)}function oo(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;tu?u:8;var c=T.T,r={};T.T=r,_c(t,!1,e,l);try{var h=a(),p=T.S;if(p!==null&&p(r,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var _=qy(h,n);fa(t,e,_,fe(t))}else fa(t,e,n,fe(t))}catch(O){fa(t,e,{then:function(){},status:"rejected",reason:O},fe())}finally{D.p=u,c!==null&&r.types!==null&&(c.types=r.types),T.T=c}}function Qy(){}function Sc(t,e,l,n){if(t.tag!==5)throw Error(s(476));var a=Vo(t).queue;Go(t,a,e,X,l===null?Qy:function(){return Zo(t),l(n)})}function Vo(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:we,lastRenderedState:X},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:we,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Zo(t){var e=Vo(t);e.next===null&&(e=t.alternate.memoizedState),fa(t,e.next.queue,{},fe())}function bc(){return Bt(za)}function wo(){return bt().memoizedState}function Ko(){return bt().memoizedState}function Gy(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=fe();t=ol(l);var n=rl(e,t,l);n!==null&&(Ft(n,e,l),na(n,e,l)),e={cache:Wi()},t.payload=e;return}e=e.return}}function Vy(t,e,l){var n=fe();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},gu(t)?ko(e,l):(l=ji(t,e,l,n),l!==null&&(Ft(l,t,n),Wo(l,e,n)))}function Jo(t,e,l){var n=fe();fa(t,e,l,n)}function fa(t,e,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(gu(t))ko(e,a);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var c=e.lastRenderedState,r=u(c,l);if(a.hasEagerState=!0,a.eagerState=r,le(r,c))return Fa(t,e,a,0),ht===null&&$a(),!1}catch{}finally{}if(l=ji(t,e,a,n),l!==null)return Ft(l,t,n),Wo(l,e,n),!0}return!1}function _c(t,e,l,n){if(n={lane:2,revertLane:Pc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gu(t)){if(e)throw Error(s(479))}else e=ji(t,l,n,2),e!==null&&Ft(e,t,2)}function gu(t){var e=t.alternate;return t===Z||e!==null&&e===Z}function ko(t,e){Sn=ou=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function Wo(t,e,l){if((l&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,Pf(t,l)}}var sa={readContext:Bt,use:du,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};sa.useEffectEvent=vt;var $o={readContext:Bt,use:du,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:Bt,useEffect:Co,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,mu(4194308,4,Yo.bind(null,e,t),l)},useLayoutEffect:function(t,e){return mu(4194308,4,t,e)},useInsertionEffect:function(t,e){mu(4,2,t,e)},useMemo:function(t,e){var l=Qt();e=e===void 0?null:e;var n=t();if(Zl){ll(!0);try{t()}finally{ll(!1)}}return l.memoizedState=[n,e],n},useReducer:function(t,e,l){var n=Qt();if(l!==void 0){var a=l(e);if(Zl){ll(!0);try{l(e)}finally{ll(!1)}}}else a=e;return n.memoizedState=n.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},n.queue=t,t=t.dispatch=Vy.bind(null,Z,t),[n.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:function(t){t=yc(t);var e=t.queue,l=Jo.bind(null,Z,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:gc,useDeferredValue:function(t,e){var l=Qt();return pc(l,t,e)},useTransition:function(){var t=yc(!1);return t=Go.bind(null,Z,t.queue,!0,!1),Qt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var n=Z,a=Qt();if(P){if(l===void 0)throw Error(s(407));l=l()}else{if(l=e(),ht===null)throw Error(s(349));($&127)!==0||go(n,e,l)}a.memoizedState=l;var u={value:l,getSnapshot:e};return a.queue=u,Co(So.bind(null,n,u,t),[t]),n.flags|=2048,_n(9,{destroy:void 0},po.bind(null,n,u,l,e),null),l},useId:function(){var t=Qt(),e=ht.identifierPrefix;if(P){var l=De,n=Re;l=(n&~(1<<32-ee(n)-1)).toString(32)+l,e="_"+e+"R_"+l,l=ru++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?u.multiple=!0:n.size&&(u.size=n.size);break;default:u=typeof n.is=="string"?c.createElement(a,{is:n.is}):c.createElement(a)}}u[xt]=e,u[wt]=n;t:for(c=e.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break t;for(;c.sibling===null;){if(c.return===null||c.return===e)break t;c=c.return}c.sibling.return=c.return,c=c.sibling}e.stateNode=u;t:switch(Ht(u,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break t;case"img":n=!0;break t;default:n=!1}n&&Je(e)}}return yt(e),qc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&Je(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(s(166));if(t=J.current,hn(e)){if(t=e.stateNode,l=e.memoizedProps,n=null,a=Ct,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}t[xt]=e,t=!!(t.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||mh(t.nodeValue,l)),t||cl(e,!0)}else t=Yu(t).createTextNode(n),t[xt]=e,e.stateNode=t}return yt(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(n=hn(e),l!==null){if(t===null){if(!n)throw Error(s(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[xt]=e}else Yl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;yt(e),t=!1}else l=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(ue(e),e):(ue(e),null);if((e.flags&128)!==0)throw Error(s(558))}return yt(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=hn(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(s(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));a[xt]=e}else Yl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;yt(e),a=!1}else a=wi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(ue(e),e):(ue(e),null)}return ue(e),(e.flags&128)!==0?(e.lanes=l,e):(l=n!==null,t=t!==null&&t.memoizedState!==null,l&&(n=e.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==a&&(n.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),Eu(e,e.updateQueue),yt(e),null);case 4:return pt(),t===null&&nf(e.stateNode.containerInfo),yt(e),null;case 10:return Ve(e.type),yt(e),null;case 19:if(N(St),n=e.memoizedState,n===null)return yt(e),null;if(a=(e.flags&128)!==0,u=n.rendering,u===null)if(a)ra(n,!1);else{if(gt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=su(t),u!==null){for(e.flags|=128,ra(n,!1),t=u.updateQueue,e.updateQueue=t,Eu(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)Ks(l,t),l=l.sibling;return U(St,St.current&1|2),P&&Qe(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&Pt()>Nu&&(e.flags|=128,a=!0,ra(n,!1),e.lanes=4194304)}else{if(!a)if(t=su(u),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,Eu(e,t),ra(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!P)return yt(e),null}else 2*Pt()-n.renderingStartTime>Nu&&l!==536870912&&(e.flags|=128,a=!0,ra(n,!1),e.lanes=4194304);n.isBackwards?(u.sibling=e.child,e.child=u):(t=n.last,t!==null?t.sibling=u:e.child=u,n.last=u)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Pt(),t.sibling=null,l=St.current,U(St,a?l&1|2:l&1),P&&Qe(e,n.treeForkCount),t):(yt(e),null);case 22:case 23:return ue(e),ac(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(l&536870912)!==0&&(e.flags&128)===0&&(yt(e),e.subtreeFlags&6&&(e.flags|=8192)):yt(e),l=e.updateQueue,l!==null&&Eu(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==l&&(e.flags|=2048),t!==null&&N(Xl),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),Ve(Et),yt(e),null;case 25:return null;case 30:return null}throw Error(s(156,e.tag))}function ky(t,e){switch(Vi(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ve(Et),pt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ca(e),null;case 31:if(e.memoizedState!==null){if(ue(e),e.alternate===null)throw Error(s(340));Yl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ue(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(s(340));Yl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return N(St),null;case 4:return pt(),null;case 10:return Ve(e.type),null;case 22:case 23:return ue(e),ac(),t!==null&&N(Xl),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ve(Et),null;case 25:return null;default:return null}}function br(t,e){switch(Vi(e),e.tag){case 3:Ve(Et),pt();break;case 26:case 27:case 5:Ca(e);break;case 4:pt();break;case 31:e.memoizedState!==null&&ue(e);break;case 13:ue(e);break;case 19:N(St);break;case 10:Ve(e.type);break;case 22:case 23:ue(e),ac(),t!==null&&N(Xl);break;case 24:Ve(Et)}}function ha(t,e){try{var l=e.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&t)===t){n=void 0;var u=l.create,c=l.inst;n=u(),c.destroy=n}l=l.next}while(l!==a)}}catch(r){it(e,e.return,r)}}function yl(t,e,l){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&t)===t){var c=n.inst,r=c.destroy;if(r!==void 0){c.destroy=void 0,a=e;var h=l,p=r;try{p()}catch(_){it(a,h,_)}}}n=n.next}while(n!==u)}}catch(_){it(e,e.return,_)}}function _r(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{oo(e,l)}catch(n){it(t,t.return,n)}}}function Er(t,e,l){l.props=wl(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(n){it(t,e,n)}}function da(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof l=="function"?t.refCleanup=l(n):l.current=n}}catch(a){it(t,e,a)}}function Ue(t,e){var l=t.ref,n=t.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){it(t,e,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){it(t,e,a)}else l.current=null}function Tr(t){var e=t.type,l=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break t;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){it(t,t.return,a)}}function Hc(t,e,l){try{var n=t.stateNode;vm(n,t.type,l,e),n[wt]=e}catch(a){it(t,t.return,a)}}function Ar(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_l(t.type)||t.tag===4}function Yc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Ar(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&_l(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function jc(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=je));else if(n!==4&&(n===27&&_l(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(jc(t,e,l),t=t.sibling;t!==null;)jc(t,e,l),t=t.sibling}function Tu(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(n!==4&&(n===27&&_l(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Tu(t,e,l),t=t.sibling;t!==null;)Tu(t,e,l),t=t.sibling}function zr(t){var e=t.stateNode,l=t.memoizedProps;try{for(var n=t.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);Ht(e,n,l),e[xt]=t,e[wt]=l}catch(u){it(t,t.return,u)}}var ke=!1,zt=!1,Lc=!1,Or=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function Wy(t,e){if(t=t.containerInfo,cf=Zu,t=Ys(t),xi(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break t}var c=0,r=-1,h=-1,p=0,_=0,O=t,S=null;e:for(;;){for(var b;O!==l||a!==0&&O.nodeType!==3||(r=c+a),O!==u||n!==0&&O.nodeType!==3||(h=c+n),O.nodeType===3&&(c+=O.nodeValue.length),(b=O.firstChild)!==null;)S=O,O=b;for(;;){if(O===t)break e;if(S===l&&++p===a&&(r=c),S===u&&++_===n&&(h=c),(b=O.nextSibling)!==null)break;O=S,S=O.parentNode}O=b}l=r===-1||h===-1?null:{start:r,end:h}}else l=null}l=l||{start:0,end:0}}else l=null;for(ff={focusedElem:t,selectionRange:l},Zu=!1,Dt=e;Dt!==null;)if(e=Dt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Dt=t;else for(;Dt!==null;){switch(e=Dt,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),Ht(u,n,l),u[xt]=t,Rt(u),n=u;break t;case"link":var c=xh("link","href",a).get(n+(l.href||""));if(c){for(var r=0;rot&&(c=ot,ot=L,L=c);var v=qs(r,L),d=qs(r,ot);if(v&&d&&(b.rangeCount!==1||b.anchorNode!==v.node||b.anchorOffset!==v.offset||b.focusNode!==d.node||b.focusOffset!==d.offset)){var g=O.createRange();g.setStart(v.node,v.offset),b.removeAllRanges(),L>ot?(b.addRange(g),b.extend(d.node,d.offset)):(g.setEnd(d.node,d.offset),b.addRange(g))}}}}for(O=[],b=r;b=b.parentNode;)b.nodeType===1&&O.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;rl?32:l,T.T=null,l=Kc,Kc=null;var u=pl,c=Pe;if(Nt=0,On=pl=null,Pe=0,(nt&6)!==0)throw Error(s(331));var r=nt;if(nt|=4,Yr(u.current),Br(u,u.current,c,l),nt=r,Sa(0,!1),te&&typeof te.onPostCommitFiberRoot=="function")try{te.onPostCommitFiberRoot(Yn,u)}catch{}return!0}finally{D.p=a,T.T=n,eh(t,e)}}function nh(t,e,l){e=de(l,e),e=zc(t.stateNode,e,2),t=rl(t,e,2),t!==null&&(Ln(t,2),xe(t))}function it(t,e,l){if(t.tag===3)nh(t,t,l);else for(;e!==null;){if(e.tag===3){nh(e,t,l);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(gl===null||!gl.has(n))){t=de(l,t),l=ar(2),n=rl(e,l,2),n!==null&&(ur(l,n,e,t),Ln(n,2),xe(n));break}}e=e.return}}function $c(t,e,l){var n=t.pingCache;if(n===null){n=t.pingCache=new Iy;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(l)||(Gc=!0,a.add(l),t=nm.bind(null,t,e,l),e.then(t,t))}function nm(t,e,l){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ht===t&&($&l)===l&&(gt===4||gt===3&&($&62914560)===$&&300>Pt()-Ou?(nt&2)===0&&Nn(t,0):Vc|=l,zn===$&&(zn=0)),xe(t)}function ah(t,e){e===0&&(e=Ff()),t=ql(t,e),t!==null&&(Ln(t,e),xe(t))}function am(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),ah(t,l)}function um(t,e){var l=0;switch(t.tag){case 31:case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(s(314))}n!==null&&n.delete(e),ah(t,l)}function im(t,e){return si(t,e)}var Cu=null,Rn=null,Fc=!1,Bu=!1,Ic=!1,bl=0;function xe(t){t!==Rn&&t.next===null&&(Rn===null?Cu=Rn=t:Rn=Rn.next=t),Bu=!0,Fc||(Fc=!0,fm())}function Sa(t,e){if(!Ic&&Bu){Ic=!0;do for(var l=!1,n=Cu;n!==null;){if(t!==0){var a=n.pendingLanes;if(a===0)var u=0;else{var c=n.suspendedLanes,r=n.pingedLanes;u=(1<<31-ee(42|t)+1)-1,u&=a&~(c&~r),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,fh(n,u))}else u=$,u=ja(n,n===ht?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||jn(n,u)||(l=!0,fh(n,u));n=n.next}while(l);Ic=!1}}function cm(){uh()}function uh(){Bu=Fc=!1;var t=0;bl!==0&&pm()&&(t=bl);for(var e=Pt(),l=null,n=Cu;n!==null;){var a=n.next,u=ih(n,e);u===0?(n.next=null,l===null?Cu=a:l.next=a,a===null&&(Rn=l)):(l=n,(t!==0||(u&3)!==0)&&(Bu=!0)),n=a}Nt!==0&&Nt!==5||Sa(t),bl!==0&&(bl=0)}function ih(t,e){for(var l=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,u=t.pendingLanes&-62914561;0r)break;var _=h.transferSize,O=h.initiatorType;_&&vh(O)&&(h=h.responseEnd,c+=_*(h"u"?null:document;function Mh(t,e,l){var n=Dn;if(n&&typeof e=="string"&&e){var a=re(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),Nh.has(a)||(Nh.add(a),t={rel:t,crossOrigin:l,href:e},n.querySelector(a)===null&&(e=n.createElement("link"),Ht(e,"link",t),Rt(e),n.head.appendChild(e)))}}function Nm(t){tl.D(t),Mh("dns-prefetch",t,null)}function Mm(t,e){tl.C(t,e),Mh("preconnect",t,e)}function Rm(t,e,l){tl.L(t,e,l);var n=Dn;if(n&&t&&e){var a='link[rel="preload"][as="'+re(e)+'"]';e==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+re(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+re(l.imageSizes)+'"]')):a+='[href="'+re(t)+'"]';var u=a;switch(e){case"style":u=Un(t);break;case"script":u=xn(t)}Se.has(u)||(t=x({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Se.set(u,t),n.querySelector(a)!==null||e==="style"&&n.querySelector(Ta(u))||e==="script"&&n.querySelector(Aa(u))||(e=n.createElement("link"),Ht(e,"link",t),Rt(e),n.head.appendChild(e)))}}function Dm(t,e){tl.m(t,e);var l=Dn;if(l&&t){var n=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+re(n)+'"][href="'+re(t)+'"]',u=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xn(t)}if(!Se.has(u)&&(t=x({rel:"modulepreload",href:t},e),Se.set(u,t),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Aa(u)))return}n=l.createElement("link"),Ht(n,"link",t),Rt(n),l.head.appendChild(n)}}}function Um(t,e,l){tl.S(t,e,l);var n=Dn;if(n&&t){var a=Il(n).hoistableStyles,u=Un(t);e=e||"default";var c=a.get(u);if(!c){var r={loading:0,preload:null};if(c=n.querySelector(Ta(u)))r.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Se.get(u))&&mf(t,l);var h=c=n.createElement("link");Rt(h),Ht(h,"link",t),h._p=new Promise(function(p,_){h.onload=p,h.onerror=_}),h.addEventListener("load",function(){r.loading|=1}),h.addEventListener("error",function(){r.loading|=2}),r.loading|=4,Lu(c,e,n)}c={type:"stylesheet",instance:c,count:1,state:r},a.set(u,c)}}}function xm(t,e){tl.X(t,e);var l=Dn;if(l&&t){var n=Il(l).hoistableScripts,a=xn(t),u=n.get(a);u||(u=l.querySelector(Aa(a)),u||(t=x({src:t,async:!0},e),(e=Se.get(a))&&vf(t,e),u=l.createElement("script"),Rt(u),Ht(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function Cm(t,e){tl.M(t,e);var l=Dn;if(l&&t){var n=Il(l).hoistableScripts,a=xn(t),u=n.get(a);u||(u=l.querySelector(Aa(a)),u||(t=x({src:t,async:!0,type:"module"},e),(e=Se.get(a))&&vf(t,e),u=l.createElement("script"),Rt(u),Ht(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function Rh(t,e,l,n){var a=(a=J.current)?ju(a):null;if(!a)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=Un(l.href),l=Il(a).hoistableStyles,n=l.get(e),n||(n={type:"style",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Un(l.href);var u=Il(a).hoistableStyles,c=u.get(t);if(c||(a=a.ownerDocument||a,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,c),(u=a.querySelector(Ta(t)))&&!u._p&&(c.instance=u,c.state.loading=5),Se.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Se.set(t,l),u||Bm(a,t,l,c.state))),e&&n===null)throw Error(s(528,""));return c}if(e&&n!==null)throw Error(s(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xn(l),l=Il(a).hoistableScripts,n=l.get(e),n||(n={type:"script",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Un(t){return'href="'+re(t)+'"'}function Ta(t){return'link[rel="stylesheet"]['+t+"]"}function Dh(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Bm(t,e,l,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),Ht(e,"link",l),Rt(e),t.head.appendChild(e))}function xn(t){return'[src="'+re(t)+'"]'}function Aa(t){return"script[async]"+t}function Uh(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+re(l.href)+'"]');if(n)return e.instance=n,Rt(n),n;var a=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Rt(n),Ht(n,"style",a),Lu(n,l.precedence,t),e.instance=n;case"stylesheet":a=Un(l.href);var u=t.querySelector(Ta(a));if(u)return e.state.loading|=4,e.instance=u,Rt(u),u;n=Dh(l),(a=Se.get(a))&&mf(n,a),u=(t.ownerDocument||t).createElement("link"),Rt(u);var c=u;return c._p=new Promise(function(r,h){c.onload=r,c.onerror=h}),Ht(u,"link",n),e.state.loading|=4,Lu(u,l.precedence,t),e.instance=u;case"script":return u=xn(l.src),(a=t.querySelector(Aa(u)))?(e.instance=a,Rt(a),a):(n=l,(a=Se.get(u))&&(n=x({},l),vf(n,a)),t=t.ownerDocument||t,a=t.createElement("script"),Rt(a),Ht(a,"link",n),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(s(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,Lu(n,l.precedence,t));return e.instance}function Lu(t,e,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,u=a,c=0;c title"):null)}function qm(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Bh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Hm(t,e,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=Un(n.href),u=e.querySelector(Ta(a));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Qu.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=u,Rt(u);return}u=e.ownerDocument||e,n=Dh(n),(a=Se.get(a))&&mf(n,a),u=u.createElement("link"),Rt(u);var c=u;c._p=new Promise(function(r,h){c.onload=r,c.onerror=h}),Ht(u,"link",n),l.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Qu.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var gf=0;function Ym(t,e){return t.stylesheets&&t.count===0&&Vu(t,t.stylesheets),0gf?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gu=null;function Vu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gu=new Map,e.forEach(jm,t),Gu=null,Qu.call(t))}function jm(t,e){if(!(e.state.loading&4)){var l=Gu.get(t);if(l)var n=l.get(null);else{l=new Map,Gu.set(t,l);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}}return o(),Of.exports=t0(),Of.exports}var l0=e0();const Be=Object.create(null);Be.open="0";Be.close="1";Be.ping="2";Be.pong="3";Be.message="4";Be.upgrade="5";Be.noop="6";const Pu=Object.create(null);Object.keys(Be).forEach(o=>{Pu[Be[o]]=o});const Cf={type:"error",data:"parser error"},sd=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",od=typeof ArrayBuffer=="function",rd=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o&&o.buffer instanceof ArrayBuffer,Xf=({type:o,data:i},f,s)=>sd&&i instanceof Blob?f?s(i):ad(i,s):od&&(i instanceof ArrayBuffer||rd(i))?f?s(i):ad(new Blob([i]),s):s(Be[o]+(i||"")),ad=(o,i)=>{const f=new FileReader;return f.onload=function(){const s=f.result.split(",")[1];i("b"+(s||""))},f.readAsDataURL(o)};function ud(o){return o instanceof Uint8Array?o:o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let Df;function n0(o,i){if(sd&&o.data instanceof Blob)return o.data.arrayBuffer().then(ud).then(i);if(od&&(o.data instanceof ArrayBuffer||rd(o.data)))return i(ud(o.data));Xf(o,!1,f=>{Df||(Df=new TextEncoder),i(Df.encode(f))})}const id="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let o=0;o{let i=o.length*.75,f=o.length,s,m=0,E,R,B,M;o[o.length-1]==="="&&(i--,o[o.length-2]==="="&&i--);const A=new ArrayBuffer(i),Q=new Uint8Array(A);for(s=0;s>4,Q[m++]=(R&15)<<4|B>>2,Q[m++]=(B&3)<<6|M&63;return A},u0=typeof ArrayBuffer=="function",Qf=(o,i)=>{if(typeof o!="string")return{type:"message",data:hd(o,i)};const f=o.charAt(0);return f==="b"?{type:"message",data:i0(o.substring(1),i)}:Pu[f]?o.length>1?{type:Pu[f],data:o.substring(1)}:{type:Pu[f]}:Cf},i0=(o,i)=>{if(u0){const f=a0(o);return hd(f,i)}else return{base64:!0,data:o}},hd=(o,i)=>{switch(i){case"blob":return o instanceof Blob?o:new Blob([o]);case"arraybuffer":default:return o instanceof ArrayBuffer?o:o.buffer}},dd="",c0=(o,i)=>{const f=o.length,s=new Array(f);let m=0;o.forEach((E,R)=>{Xf(E,!1,B=>{s[R]=B,++m===f&&i(s.join(dd))})})},f0=(o,i)=>{const f=o.split(dd),s=[];for(let m=0;m{const s=f.length;let m;if(s<126)m=new Uint8Array(1),new DataView(m.buffer).setUint8(0,s);else if(s<65536){m=new Uint8Array(3);const E=new DataView(m.buffer);E.setUint8(0,126),E.setUint16(1,s)}else{m=new Uint8Array(9);const E=new DataView(m.buffer);E.setUint8(0,127),E.setBigUint64(1,BigInt(s))}o.data&&typeof o.data!="string"&&(m[0]|=128),i.enqueue(m),i.enqueue(f)})}})}let Uf;function Fu(o){return o.reduce((i,f)=>i+f.length,0)}function Iu(o,i){if(o[0].length===i)return o.shift();const f=new Uint8Array(i);let s=0;for(let m=0;mMath.pow(2,21)-1){B.enqueue(Cf);break}m=Q*Math.pow(2,32)+A.getUint32(4),s=3}else{if(Fu(f)o){B.enqueue(Cf);break}}}})}const yd=4;function Ot(o){if(o)return r0(o)}function r0(o){for(var i in Ot.prototype)o[i]=Ot.prototype[i];return o}Ot.prototype.on=Ot.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(i),this};Ot.prototype.once=function(o,i){function f(){this.off(o,f),i.apply(this,arguments)}return f.fn=i,this.on(o,f),this};Ot.prototype.off=Ot.prototype.removeListener=Ot.prototype.removeAllListeners=Ot.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+o];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var s,m=0;mPromise.resolve().then(i):(i,f)=>f(i,0),be=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),h0="arraybuffer";function md(o,...i){return i.reduce((f,s)=>(o.hasOwnProperty(s)&&(f[s]=o[s]),f),{})}const d0=be.setTimeout,y0=be.clearTimeout;function ai(o,i){i.useNativeTimers?(o.setTimeoutFn=d0.bind(be),o.clearTimeoutFn=y0.bind(be)):(o.setTimeoutFn=be.setTimeout.bind(be),o.clearTimeoutFn=be.clearTimeout.bind(be))}const m0=1.33;function v0(o){return typeof o=="string"?g0(o):Math.ceil((o.byteLength||o.size)*m0)}function g0(o){let i=0,f=0;for(let s=0,m=o.length;s=57344?f+=3:(s++,f+=4);return f}function vd(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function p0(o){let i="";for(let f in o)o.hasOwnProperty(f)&&(i.length&&(i+="&"),i+=encodeURIComponent(f)+"="+encodeURIComponent(o[f]));return i}function S0(o){let i={},f=o.split("&");for(let s=0,m=f.length;s{this.readyState="paused",i()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||f()})),this.writable||(s++,this.once("drain",function(){--s||f()}))}else f()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const f=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};f0(i,this.socket.binaryType).forEach(f),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,c0(i,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=vd()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(i,f)}}let gd=!1;try{gd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const E0=gd;function T0(){}class A0 extends _0{constructor(i){if(super(i),typeof location<"u"){const f=location.protocol==="https:";let s=location.port;s||(s=f?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||s!==i.port}}doWrite(i,f){const s=this.request({method:"POST",data:i});s.on("success",f),s.on("error",(m,E)=>{this.onError("xhr post error",m,E)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(f,s)=>{this.onError("xhr poll error",f,s)}),this.pollXhr=i}}class Ce extends Ot{constructor(i,f,s){super(),this.createRequest=i,ai(this,s),this._opts=s,this._method=s.method||"GET",this._uri=f,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var i;const f=md(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(f);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let m in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(m)&&s.setRequestHeader(m,this._opts.extraHeaders[m])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var m;s.readyState===3&&((m=this._opts.cookieJar)===null||m===void 0||m.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(m){this.setTimeoutFn(()=>{this._onError(m)},0);return}typeof document<"u"&&(this._index=Ce.requestsCount++,Ce.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=T0,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ce.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()}}Ce.requestsCount=0;Ce.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cd);else if(typeof addEventListener=="function"){const o="onpagehide"in be?"pagehide":"unload";addEventListener(o,cd,!1)}}function cd(){for(let o in Ce.requests)Ce.requests.hasOwnProperty(o)&&Ce.requests[o].abort()}const z0=(function(){const o=pd({xdomain:!1});return o&&o.responseType!==null})();class O0 extends A0{constructor(i){super(i);const f=i&&i.forceBase64;this.supportsBinary=z0&&!f}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Ce(pd,this.uri(),i)}}function pd(o){const i=o.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||E0))return new XMLHttpRequest}catch{}if(!i)try{return new be[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Sd=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class N0 extends Gf{get name(){return"websocket"}doOpen(){const i=this.uri(),f=this.opts.protocols,s=Sd?{}:md(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,f,s)}catch(m){return this.emitReserved("error",m)}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 f=0;f{try{this.doWrite(s,E)}catch{}m&&ni(()=>{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",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=vd()),this.supportsBinary||(f.b64=1),this.createUri(i,f)}}const xf=be.WebSocket||be.MozWebSocket;class M0 extends N0{createSocket(i,f,s){return Sd?new xf(i,f,s):f?new xf(i,f):new xf(i)}doWrite(i,f){this.ws.send(f)}}class R0 extends Gf{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 f=o0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=i.readable.pipeThrough(f).getReader(),m=s0();m.readable.pipeTo(i.writable),this._writer=m.writable.getWriter();const E=()=>{s.read().then(({done:B,value:M})=>{B||(this.onPacket(M),E())}).catch(B=>{})};E();const R={type:"open"};this.query.sid&&(R.data=`{"sid":"${this.query.sid}"}`),this._writer.write(R).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let f=0;f{m&&ni(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const D0={websocket:M0,webtransport:R0,polling:O0},U0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,x0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Bf(o){if(o.length>8e3)throw"URI too long";const i=o,f=o.indexOf("["),s=o.indexOf("]");f!=-1&&s!=-1&&(o=o.substring(0,f)+o.substring(f,s).replace(/:/g,";")+o.substring(s,o.length));let m=U0.exec(o||""),E={},R=14;for(;R--;)E[x0[R]]=m[R]||"";return f!=-1&&s!=-1&&(E.source=i,E.host=E.host.substring(1,E.host.length-1).replace(/;/g,":"),E.authority=E.authority.replace("[","").replace("]","").replace(/;/g,":"),E.ipv6uri=!0),E.pathNames=C0(E,E.path),E.queryKey=B0(E,E.query),E}function C0(o,i){const f=/\/{2,9}/g,s=i.replace(f,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&s.splice(0,1),i.slice(-1)=="/"&&s.splice(s.length-1,1),s}function B0(o,i){const f={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,m,E){m&&(f[m]=E)}),f}const qf=typeof addEventListener=="function"&&typeof removeEventListener=="function",ti=[];qf&&addEventListener("offline",()=>{ti.forEach(o=>o())},!1);class Nl extends Ot{constructor(i,f){if(super(),this.binaryType=h0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(f=i,i=null),i){const s=Bf(i);f.hostname=s.host,f.secure=s.protocol==="https"||s.protocol==="wss",f.port=s.port,s.query&&(f.query=s.query)}else f.host&&(f.hostname=Bf(f.host).host);ai(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},f.transports.forEach(s=>{const m=s.prototype.name;this.transports.push(m),this._transportsByName[m]=s}),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},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=S0(this.opts.query)),qf&&(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"})},ti.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const f=Object.assign({},this.opts.query);f.EIO=yd,f.transport=i,this.id&&(f.sid=this.id);const s=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&Nl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const f=this.createTransport(i);f.open(),this.setTransport(f)}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",f=>this._onClose("transport close",f))}onOpen(){this.readyState="open",Nl.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 f=new Error("server error");f.code=i.data,this._onError(f);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 f=1;for(let s=0;s0&&f>this._maxPayload)return this.writeBuffer.slice(0,s);f+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,ni(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,f,s){return this._sendPacket("message",i,f,s),this}send(i,f,s){return this._sendPacket("message",i,f,s),this}_sendPacket(i,f,s,m){if(typeof f=="function"&&(m=f,f=void 0),typeof s=="function"&&(m=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const E={type:i,data:f,options:s};this.emitReserved("packetCreate",E),this.writeBuffer.push(E),m&&this.once("flush",m),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),i()},s=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():i()}):this.upgrading?s():i()),this}_onError(i){if(Nl.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,f){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(),qf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ti.indexOf(this._offlineEventListener);s!==-1&&ti.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,f),this.writeBuffer=[],this._prevBufferLen=0}}}Nl.protocol=yd;class q0 extends Nl{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i{s||(f.send([{type:"ping",data:"probe"}]),f.once("packet",x=>{if(!s)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Nl.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(Q(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const K=new Error("probe error");K.transport=f.name,this.emitReserved("upgradeError",K)}}))};function E(){s||(s=!0,Q(),f.close(),f=null)}const R=x=>{const K=new Error("probe error: "+x);K.transport=f.name,E(),this.emitReserved("upgradeError",K)};function B(){R("transport closed")}function M(){R("socket closed")}function A(x){f&&x.name!==f.name&&E()}const Q=()=>{f.removeListener("open",m),f.removeListener("error",R),f.removeListener("close",B),this.off("close",M),this.off("upgrading",A)};f.once("open",m),f.once("error",R),f.once("close",B),this.once("close",M),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{s||f.open()},200):f.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const f=[];for(let s=0;sD0[m]).filter(m=>!!m)),super(i,s)}};function Y0(o,i="",f){let s=o;f=f||typeof location<"u"&&location,o==null&&(o=f.protocol+"//"+f.host),typeof o=="string"&&(o.charAt(0)==="/"&&(o.charAt(1)==="/"?o=f.protocol+o:o=f.host+o),/^(https?|wss?):\/\//.test(o)||(typeof f<"u"?o=f.protocol+"//"+o:o="https://"+o),s=Bf(o)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const E=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+E+":"+s.port+i,s.href=s.protocol+"://"+E+(f&&f.port===s.port?"":":"+s.port),s}const j0=typeof ArrayBuffer=="function",L0=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o.buffer instanceof ArrayBuffer,bd=Object.prototype.toString,X0=typeof Blob=="function"||typeof Blob<"u"&&bd.call(Blob)==="[object BlobConstructor]",Q0=typeof File=="function"||typeof File<"u"&&bd.call(File)==="[object FileConstructor]";function Vf(o){return j0&&(o instanceof ArrayBuffer||L0(o))||X0&&o instanceof Blob||Q0&&o instanceof File}function ei(o,i){if(!o||typeof o!="object")return!1;if(Array.isArray(o)){for(let f=0,s=o.length;f=0&&o.num{delete this.acks[i];for(let B=0;B{this.io.clearTimeoutFn(E),f.apply(this,B)};R.withError=!0,this.acks[i]=R}emitWithAck(i,...f){return new Promise((s,m)=>{const E=(R,B)=>R?m(R):s(B);E.withError=!0,f.push(E),this.emit(i,...f)})}_addToQueue(i){let f;typeof i[i.length-1]=="function"&&(f=i.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((m,...E)=>s!==this._queue[0]?void 0:(m!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(m)):(this._queue.shift(),f&&f(null,...E)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!i||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.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:tt.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,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(s=>String(s.id)===i)){const s=this.acks[i];delete this.acks[i],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case tt.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 tt.EVENT:case tt.BINARY_EVENT:this.onevent(i);break;case tt.ACK:case tt.BINARY_ACK:this.onack(i);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const s=new Error(i.data.message);s.data=i.data.data,this.emitReserved("connect_error",s);break}}onevent(i){const f=i.data||[];i.id!=null&&f.push(this.ack(i.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const s of f)s.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 f=this;let s=!1;return function(...m){s||(s=!0,f.packet({type:tt.ACK,id:i,data:m}))}}onack(i){const f=this.acks[i.id];typeof f=="function"&&(delete this.acks[i.id],f.withError&&i.data.unshift(null),f.apply(this,i.data))}onconnect(i,f){this.id=i,this.recovered=f&&this._pid===f,this._pid=f,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:tt.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 f=this._anyListeners;for(let s=0;s0&&o.jitter<=1?o.jitter:0,this.attempts=0}Bn.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),f=Math.floor(i*this.jitter*o);o=(Math.floor(i*10)&1)==0?o-f:o+f}return Math.min(o,this.max)|0};Bn.prototype.reset=function(){this.attempts=0};Bn.prototype.setMin=function(o){this.ms=o};Bn.prototype.setMax=function(o){this.max=o};Bn.prototype.setJitter=function(o){this.jitter=o};class jf extends Ot{constructor(i,f){var s;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(f=i,i=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,ai(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((s=f.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Bn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=i;const m=f.parser||k0;this.encoder=new m.Encoder,this.decoder=new m.Decoder,this._autoConnect=f.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 f;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(f=this.backoff)===null||f===void 0||f.setMin(i),this)}randomizationFactor(i){var f;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(f=this.backoff)===null||f===void 0||f.setJitter(i),this)}reconnectionDelayMax(i){var f;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(f=this.backoff)===null||f===void 0||f.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 H0(this.uri,this.opts);const f=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const m=ze(f,"open",function(){s.onopen(),i&&i()}),E=B=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",B),i?i(B):this.maybeReconnectOnOpen()},R=ze(f,"error",E);if(this._timeout!==!1){const B=this._timeout,M=this.setTimeoutFn(()=>{m(),E(new Error("timeout")),f.close()},B);this.opts.autoUnref&&M.unref(),this.subs.push(()=>{this.clearTimeoutFn(M)})}return this.subs.push(m),this.subs.push(R),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(ze(i,"ping",this.onping.bind(this)),ze(i,"data",this.ondata.bind(this)),ze(i,"error",this.onerror.bind(this)),ze(i,"close",this.onclose.bind(this)),ze(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(f){this.onclose("parse error",f)}}ondecoded(i){ni(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,f){let s=this.nsps[i];return s?this._autoConnect&&!s.active&&s.connect():(s=new _d(this,i,f),this.nsps[i]=s),s}_destroy(i){const f=Object.keys(this.nsps);for(const s of f)if(this.nsps[s].active)return;this._close()}_packet(i){const f=this.encoder.encode(i);for(let s=0;si()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,f){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,f),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 f=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(m=>{m?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",m)):i.onreconnect()}))},f);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Ua={};function li(o,i){typeof o=="object"&&(i=o,o=void 0),i=i||{};const f=Y0(o,i.path||"/socket.io"),s=f.source,m=f.id,E=f.path,R=Ua[m]&&E in Ua[m].nsps,B=i.forceNew||i["force new connection"]||i.multiplex===!1||R;let M;return B?M=new jf(s,i):(Ua[m]||(Ua[m]=new jf(s,i)),M=Ua[m]),f.query&&!i.query&&(i.query=f.queryKey),M.socket(f.path,i)}Object.assign(li,{Manager:jf,Socket:_d,io:li,connect:li});const $0=void 0,wf=li($0,{transports:["websocket"],query:{role:"user"}});wf.on("connect_error",o=>{console.error("Socket connection error:",o.message)});const Ed=Mt.createContext(wf),F0=({children:o})=>Y.jsx(Ed.Provider,{value:wf,children:o}),I0=()=>Mt.useContext(Ed),Td=Mt.createContext({connected:!1,session:null,logs:[],login:async()=>{},setRole:async()=>{},requestControl:async()=>{},releaseControl:async()=>{},subscribeAll:async()=>{}});function P0(o){return Mt.useCallback((i,f={})=>new Promise((s,m)=>{o.emit(i,f,(E={})=>{E.error?m(new Error(E.error)):s(E)})}),[o])}function tv({children:o}){const i=I0(),f=P0(i),[s,m]=Mt.useState(null),[E,R]=Mt.useState([]),[B,M]=Mt.useState(i.connected);Mt.useEffect(()=>{const x=()=>M(!0),K=()=>M(!1);return i.on("connect",x),i.on("disconnect",K),()=>{i.off("connect",x),i.off("disconnect",K)}},[i]),Mt.useEffect(()=>{function x(_t){m(_t)}function K(_t=[]){R(_t)}function Yt(_t){R(Ut=>[...Ut.slice(-199),_t])}return i.on("session:sync",x),i.on("log:init",K),i.on("log:entry",Yt),()=>{i.off("session:sync",x),i.off("log:init",K),i.off("log:entry",Yt)}},[i]);const A=Mt.useMemo(()=>({login:(x,K)=>f("auth:login",{username:x,password:K}),setRole:x=>f("session:setRole",{role:x}),requestControl:(x,K={})=>f("session:requestControl",{roverId:x,...K}),releaseControl:x=>f("session:releaseControl",{roverId:x}),subscribeAll:()=>f("session:subscribeAll")}),[f]),Q=Mt.useMemo(()=>({connected:B,session:s,logs:E,...A}),[A,B,E,s]);return Y.jsx(Td.Provider,{value:Q,children:o})}function qn(){return Mt.useContext(Td)}function ev({connected:o,role:i,mode:f}){const s=o?"bg-emerald-500/20 text-emerald-300":"bg-red-500/20 text-red-200";return Y.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[Y.jsx("span",{className:`rounded-full px-3 py-1 font-medium ${s}`,children:o?"Connected":"Disconnected"}),Y.jsxs("span",{className:"rounded-full bg-slate-800/80 px-3 py-1 text-slate-200",children:["Role: ",i||"unknown"]}),Y.jsxs("span",{className:"rounded-full bg-slate-800/80 px-3 py-1 text-slate-200",children:["Mode: ",f||"--"]})]})}function lv(){const{logs:o}=qn();return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-4",children:[Y.jsxs("header",{className:"mb-3 flex items-center justify-between",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Server logs"}),Y.jsxs("span",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:[o.length," entries"]})]}),Y.jsx("div",{className:"h-64 overflow-y-auto rounded-xl bg-slate-950/40 p-3 text-xs font-mono text-slate-300",children:o.length===0?Y.jsx("p",{children:"No logs yet."}):o.slice().reverse().map(i=>Y.jsxs("div",{className:"mb-2",children:[Y.jsx("span",{className:"text-slate-500",children:i.timestamp})," ",Y.jsxs("span",{className:"text-cyan-300",children:["[",i.level,"]"]})," ",i.label&&Y.jsxs("span",{className:"text-pink-300",children:["[",i.label,"]"]})," ",Y.jsx("span",{children:i.message})]},i.id))})]})}function nv(){const{session:o,requestControl:i}=qn(),f=o?.roster??[],[s,m]=Mt.useState({});async function E(R){m(B=>({...B,[R]:!0}));try{await i(R)}catch(B){alert(B.message)}finally{m(B=>({...B,[R]:!1}))}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Rovers"}),Y.jsxs("div",{className:"mt-4 space-y-3",children:[f.length===0&&Y.jsx("p",{className:"text-slate-400",children:"No rovers registered."}),f.map(R=>Y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl bg-slate-950/40 px-4 py-3",children:[Y.jsxs("div",{children:[Y.jsx("p",{className:"text-white",children:R.name}),Y.jsxs("p",{className:"text-xs text-slate-400",children:["Locked: ",R.locked?"yes":"no"]})]}),Y.jsx("button",{type:"button",onClick:()=>E(R.id),disabled:s[R.id],className:"rounded-full bg-blue-600 px-4 py-1 text-sm font-semibold text-white disabled:opacity-50",children:s[R.id]?"Requesting…":"Request control"})]},R.id))]})]})}function av(){const{session:o,releaseControl:i}=qn(),f=o?.assignment,s=f?.roverId,[m,E]=Mt.useState(!1);async function R(){if(s){E(!0);try{await i(s)}catch(B){alert(B.message)}finally{E(!1)}}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Assignment"}),s?Y.jsxs("div",{className:"mt-4 space-y-3",children:[Y.jsxs("p",{className:"text-slate-300",children:["Currently driving rover ",s]}),Y.jsx("button",{type:"button",onClick:R,disabled:m,className:"rounded-full bg-red-600 px-4 py-1 text-sm font-semibold text-white disabled:opacity-50",children:m?"Releasing…":"Release control"})]}):Y.jsxs("div",{className:"mt-4 text-slate-400",children:[Y.jsxs("p",{children:["Status: ",f?.status??"not assigned"]}),f?.queuePosition&&Y.jsxs("p",{children:["Queue position: ",f.queuePosition]})]})]})}function uv(){const{session:o}=qn(),i=Mt.useMemo(()=>JSON.stringify(o??{},null,2),[o]);return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Session snapshot"}),Y.jsx("pre",{className:"mt-4 max-h-64 overflow-y-auto text-sm text-teal-200",children:i})]})}function iv(){const{login:o,setRole:i}=qn(),[f,s]=Mt.useState(""),[m,E]=Mt.useState(""),[R,B]=Mt.useState(!1);async function M(A){A.preventDefault(),B(!0);try{await o(f,m),s(""),E("")}catch(Q){alert(Q.message)}finally{B(!1)}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Authentication"}),Y.jsxs("form",{className:"mt-4 flex flex-col gap-3",onSubmit:M,children:[Y.jsx("input",{className:"rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-white",placeholder:"Username",value:f,onChange:A=>s(A.target.value)}),Y.jsx("input",{className:"rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-white",placeholder:"Password",type:"password",value:m,onChange:A=>E(A.target.value)}),Y.jsx("button",{type:"submit",disabled:R,className:"rounded-lg bg-emerald-600 py-2 font-semibold text-white disabled:opacity-50",children:R?"Logging in…":"Login as admin"})]}),Y.jsxs("div",{className:"mt-4 flex gap-3",children:[Y.jsx("button",{type:"button",onClick:()=>i("user"),className:"rounded-lg border border-slate-700 px-3 py-1 text-sm text-slate-200",children:"Driver mode"}),Y.jsx("button",{type:"button",onClick:()=>i("spectator"),className:"rounded-lg border border-slate-700 px-3 py-1 text-sm text-slate-200",children:"Spectator mode"})]})]})}function cv(){const{connected:o,session:i}=qn();return Y.jsx("div",{className:"min-h-screen bg-slate-950 text-slate-50",children:Y.jsxs("main",{className:"mx-auto flex max-w-6xl flex-col gap-6 px-6 py-10",children:[Y.jsxs("header",{className:"space-y-4",children:[Y.jsx("h1",{className:"text-4xl font-semibold text-white",children:"Multi Roomba Rover Console"}),Y.jsx(ev,{connected:o,role:i?.role,mode:i?.mode})]}),Y.jsxs("section",{className:"grid gap-6 lg:grid-cols-2",children:[Y.jsx(nv,{}),Y.jsx(av,{}),Y.jsx(iv,{}),Y.jsx(uv,{})]}),Y.jsx(lv,{})]})})}l0.createRoot(document.getElementById("root")).render(Y.jsx(Mt.StrictMode,{children:Y.jsx(F0,{children:Y.jsx(tv,{children:Y.jsx(cv,{})})})})); +`).replace(mm,"")}function mh(t,e){return e=yh(e),yh(t)===e}function st(t,e,l,n,a,u){switch(l){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||en(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&en(t,""+n);break;case"className":Xa(t,"class",n);break;case"tabIndex":Xa(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Xa(t,l,n);break;case"style":ys(t,n,u);break;case"data":if(e!=="object"){Xa(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||l!=="href")){t.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(l);break}n=Ga(""+n),t.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){t.setAttribute(l,"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 u=="function"&&(l==="formAction"?(e!=="input"&&st(t,e,"name",a.name,a,null),st(t,e,"formEncType",a.formEncType,a,null),st(t,e,"formMethod",a.formMethod,a,null),st(t,e,"formTarget",a.formTarget,a,null)):(st(t,e,"encType",a.encType,a,null),st(t,e,"method",a.method,a,null),st(t,e,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(l);break}n=Ga(""+n),t.setAttribute(l,n);break;case"onClick":n!=null&&(t.onclick=je);break;case"onScroll":n!=null&&W("scroll",t);break;case"onScrollEnd":n!=null&&W("scrollend",t);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(s(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(s(60));t.innerHTML=l}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}l=Ga(""+n),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,""+n):t.removeAttribute(l);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":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":n===!0?t.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,n):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(l,n):t.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(l):t.setAttribute(l,n);break;case"popover":W("beforetoggle",t),W("toggle",t),La(t,"popover",n);break;case"xlinkActuate":Ye(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ye(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ye(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ye(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ye(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ye(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ye(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ye(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ye(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":La(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2r)break;var _=h.transferSize,O=h.initiatorType;_&&vh(O)&&(h=h.responseEnd,c+=_*(h"u"?null:document;function Mh(t,e,l){var n=Dn;if(n&&typeof e=="string"&&e){var a=re(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),Nh.has(a)||(Nh.add(a),t={rel:t,crossOrigin:l,href:e},n.querySelector(a)===null&&(e=n.createElement("link"),Ht(e,"link",t),Rt(e),n.head.appendChild(e)))}}function Nm(t){tl.D(t),Mh("dns-prefetch",t,null)}function Mm(t,e){tl.C(t,e),Mh("preconnect",t,e)}function Rm(t,e,l){tl.L(t,e,l);var n=Dn;if(n&&t&&e){var a='link[rel="preload"][as="'+re(e)+'"]';e==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+re(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+re(l.imageSizes)+'"]')):a+='[href="'+re(t)+'"]';var u=a;switch(e){case"style":u=Un(t);break;case"script":u=xn(t)}Se.has(u)||(t=x({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Se.set(u,t),n.querySelector(a)!==null||e==="style"&&n.querySelector(Ta(u))||e==="script"&&n.querySelector(Aa(u))||(e=n.createElement("link"),Ht(e,"link",t),Rt(e),n.head.appendChild(e)))}}function Dm(t,e){tl.m(t,e);var l=Dn;if(l&&t){var n=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+re(n)+'"][href="'+re(t)+'"]',u=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xn(t)}if(!Se.has(u)&&(t=x({rel:"modulepreload",href:t},e),Se.set(u,t),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Aa(u)))return}n=l.createElement("link"),Ht(n,"link",t),Rt(n),l.head.appendChild(n)}}}function Um(t,e,l){tl.S(t,e,l);var n=Dn;if(n&&t){var a=Il(n).hoistableStyles,u=Un(t);e=e||"default";var c=a.get(u);if(!c){var r={loading:0,preload:null};if(c=n.querySelector(Ta(u)))r.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Se.get(u))&&mf(t,l);var h=c=n.createElement("link");Rt(h),Ht(h,"link",t),h._p=new Promise(function(p,_){h.onload=p,h.onerror=_}),h.addEventListener("load",function(){r.loading|=1}),h.addEventListener("error",function(){r.loading|=2}),r.loading|=4,Lu(c,e,n)}c={type:"stylesheet",instance:c,count:1,state:r},a.set(u,c)}}}function xm(t,e){tl.X(t,e);var l=Dn;if(l&&t){var n=Il(l).hoistableScripts,a=xn(t),u=n.get(a);u||(u=l.querySelector(Aa(a)),u||(t=x({src:t,async:!0},e),(e=Se.get(a))&&vf(t,e),u=l.createElement("script"),Rt(u),Ht(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function Cm(t,e){tl.M(t,e);var l=Dn;if(l&&t){var n=Il(l).hoistableScripts,a=xn(t),u=n.get(a);u||(u=l.querySelector(Aa(a)),u||(t=x({src:t,async:!0,type:"module"},e),(e=Se.get(a))&&vf(t,e),u=l.createElement("script"),Rt(u),Ht(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function Rh(t,e,l,n){var a=(a=J.current)?ju(a):null;if(!a)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=Un(l.href),l=Il(a).hoistableStyles,n=l.get(e),n||(n={type:"style",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Un(l.href);var u=Il(a).hoistableStyles,c=u.get(t);if(c||(a=a.ownerDocument||a,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,c),(u=a.querySelector(Ta(t)))&&!u._p&&(c.instance=u,c.state.loading=5),Se.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Se.set(t,l),u||Bm(a,t,l,c.state))),e&&n===null)throw Error(s(528,""));return c}if(e&&n!==null)throw Error(s(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xn(l),l=Il(a).hoistableScripts,n=l.get(e),n||(n={type:"script",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Un(t){return'href="'+re(t)+'"'}function Ta(t){return'link[rel="stylesheet"]['+t+"]"}function Dh(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Bm(t,e,l,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),Ht(e,"link",l),Rt(e),t.head.appendChild(e))}function xn(t){return'[src="'+re(t)+'"]'}function Aa(t){return"script[async]"+t}function Uh(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+re(l.href)+'"]');if(n)return e.instance=n,Rt(n),n;var a=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Rt(n),Ht(n,"style",a),Lu(n,l.precedence,t),e.instance=n;case"stylesheet":a=Un(l.href);var u=t.querySelector(Ta(a));if(u)return e.state.loading|=4,e.instance=u,Rt(u),u;n=Dh(l),(a=Se.get(a))&&mf(n,a),u=(t.ownerDocument||t).createElement("link"),Rt(u);var c=u;return c._p=new Promise(function(r,h){c.onload=r,c.onerror=h}),Ht(u,"link",n),e.state.loading|=4,Lu(u,l.precedence,t),e.instance=u;case"script":return u=xn(l.src),(a=t.querySelector(Aa(u)))?(e.instance=a,Rt(a),a):(n=l,(a=Se.get(u))&&(n=x({},l),vf(n,a)),t=t.ownerDocument||t,a=t.createElement("script"),Rt(a),Ht(a,"link",n),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(s(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,Lu(n,l.precedence,t));return e.instance}function Lu(t,e,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,u=a,c=0;c title"):null)}function qm(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Bh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Hm(t,e,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=Un(n.href),u=e.querySelector(Ta(a));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Qu.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=u,Rt(u);return}u=e.ownerDocument||e,n=Dh(n),(a=Se.get(a))&&mf(n,a),u=u.createElement("link"),Rt(u);var c=u;c._p=new Promise(function(r,h){c.onload=r,c.onerror=h}),Ht(u,"link",n),l.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Qu.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var gf=0;function Ym(t,e){return t.stylesheets&&t.count===0&&Vu(t,t.stylesheets),0gf?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gu=null;function Vu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gu=new Map,e.forEach(jm,t),Gu=null,Qu.call(t))}function jm(t,e){if(!(e.state.loading&4)){var l=Gu.get(t);if(l)var n=l.get(null);else{l=new Map,Gu.set(t,l);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}}return o(),Of.exports=t0(),Of.exports}var l0=e0();const Be=Object.create(null);Be.open="0";Be.close="1";Be.ping="2";Be.pong="3";Be.message="4";Be.upgrade="5";Be.noop="6";const Pu=Object.create(null);Object.keys(Be).forEach(o=>{Pu[Be[o]]=o});const Cf={type:"error",data:"parser error"},sd=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",od=typeof ArrayBuffer=="function",rd=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o&&o.buffer instanceof ArrayBuffer,Xf=({type:o,data:i},f,s)=>sd&&i instanceof Blob?f?s(i):ad(i,s):od&&(i instanceof ArrayBuffer||rd(i))?f?s(i):ad(new Blob([i]),s):s(Be[o]+(i||"")),ad=(o,i)=>{const f=new FileReader;return f.onload=function(){const s=f.result.split(",")[1];i("b"+(s||""))},f.readAsDataURL(o)};function ud(o){return o instanceof Uint8Array?o:o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let Df;function n0(o,i){if(sd&&o.data instanceof Blob)return o.data.arrayBuffer().then(ud).then(i);if(od&&(o.data instanceof ArrayBuffer||rd(o.data)))return i(ud(o.data));Xf(o,!1,f=>{Df||(Df=new TextEncoder),i(Df.encode(f))})}const id="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let o=0;o{let i=o.length*.75,f=o.length,s,m=0,E,R,B,M;o[o.length-1]==="="&&(i--,o[o.length-2]==="="&&i--);const A=new ArrayBuffer(i),Q=new Uint8Array(A);for(s=0;s>4,Q[m++]=(R&15)<<4|B>>2,Q[m++]=(B&3)<<6|M&63;return A},u0=typeof ArrayBuffer=="function",Qf=(o,i)=>{if(typeof o!="string")return{type:"message",data:hd(o,i)};const f=o.charAt(0);return f==="b"?{type:"message",data:i0(o.substring(1),i)}:Pu[f]?o.length>1?{type:Pu[f],data:o.substring(1)}:{type:Pu[f]}:Cf},i0=(o,i)=>{if(u0){const f=a0(o);return hd(f,i)}else return{base64:!0,data:o}},hd=(o,i)=>{switch(i){case"blob":return o instanceof Blob?o:new Blob([o]);case"arraybuffer":default:return o instanceof ArrayBuffer?o:o.buffer}},dd="",c0=(o,i)=>{const f=o.length,s=new Array(f);let m=0;o.forEach((E,R)=>{Xf(E,!1,B=>{s[R]=B,++m===f&&i(s.join(dd))})})},f0=(o,i)=>{const f=o.split(dd),s=[];for(let m=0;m{const s=f.length;let m;if(s<126)m=new Uint8Array(1),new DataView(m.buffer).setUint8(0,s);else if(s<65536){m=new Uint8Array(3);const E=new DataView(m.buffer);E.setUint8(0,126),E.setUint16(1,s)}else{m=new Uint8Array(9);const E=new DataView(m.buffer);E.setUint8(0,127),E.setBigUint64(1,BigInt(s))}o.data&&typeof o.data!="string"&&(m[0]|=128),i.enqueue(m),i.enqueue(f)})}})}let Uf;function Fu(o){return o.reduce((i,f)=>i+f.length,0)}function Iu(o,i){if(o[0].length===i)return o.shift();const f=new Uint8Array(i);let s=0;for(let m=0;mMath.pow(2,21)-1){B.enqueue(Cf);break}m=Q*Math.pow(2,32)+A.getUint32(4),s=3}else{if(Fu(f)o){B.enqueue(Cf);break}}}})}const yd=4;function Ot(o){if(o)return r0(o)}function r0(o){for(var i in Ot.prototype)o[i]=Ot.prototype[i];return o}Ot.prototype.on=Ot.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(i),this};Ot.prototype.once=function(o,i){function f(){this.off(o,f),i.apply(this,arguments)}return f.fn=i,this.on(o,f),this};Ot.prototype.off=Ot.prototype.removeListener=Ot.prototype.removeAllListeners=Ot.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+o];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var s,m=0;mPromise.resolve().then(i):(i,f)=>f(i,0),be=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),h0="arraybuffer";function md(o,...i){return i.reduce((f,s)=>(o.hasOwnProperty(s)&&(f[s]=o[s]),f),{})}const d0=be.setTimeout,y0=be.clearTimeout;function ai(o,i){i.useNativeTimers?(o.setTimeoutFn=d0.bind(be),o.clearTimeoutFn=y0.bind(be)):(o.setTimeoutFn=be.setTimeout.bind(be),o.clearTimeoutFn=be.clearTimeout.bind(be))}const m0=1.33;function v0(o){return typeof o=="string"?g0(o):Math.ceil((o.byteLength||o.size)*m0)}function g0(o){let i=0,f=0;for(let s=0,m=o.length;s=57344?f+=3:(s++,f+=4);return f}function vd(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function p0(o){let i="";for(let f in o)o.hasOwnProperty(f)&&(i.length&&(i+="&"),i+=encodeURIComponent(f)+"="+encodeURIComponent(o[f]));return i}function S0(o){let i={},f=o.split("&");for(let s=0,m=f.length;s{this.readyState="paused",i()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||f()})),this.writable||(s++,this.once("drain",function(){--s||f()}))}else f()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const f=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};f0(i,this.socket.binaryType).forEach(f),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,c0(i,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=vd()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(i,f)}}let gd=!1;try{gd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const E0=gd;function T0(){}class A0 extends _0{constructor(i){if(super(i),typeof location<"u"){const f=location.protocol==="https:";let s=location.port;s||(s=f?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||s!==i.port}}doWrite(i,f){const s=this.request({method:"POST",data:i});s.on("success",f),s.on("error",(m,E)=>{this.onError("xhr post error",m,E)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(f,s)=>{this.onError("xhr poll error",f,s)}),this.pollXhr=i}}class Ce extends Ot{constructor(i,f,s){super(),this.createRequest=i,ai(this,s),this._opts=s,this._method=s.method||"GET",this._uri=f,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var i;const f=md(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(f);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let m in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(m)&&s.setRequestHeader(m,this._opts.extraHeaders[m])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var m;s.readyState===3&&((m=this._opts.cookieJar)===null||m===void 0||m.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(m){this.setTimeoutFn(()=>{this._onError(m)},0);return}typeof document<"u"&&(this._index=Ce.requestsCount++,Ce.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=T0,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ce.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()}}Ce.requestsCount=0;Ce.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cd);else if(typeof addEventListener=="function"){const o="onpagehide"in be?"pagehide":"unload";addEventListener(o,cd,!1)}}function cd(){for(let o in Ce.requests)Ce.requests.hasOwnProperty(o)&&Ce.requests[o].abort()}const z0=(function(){const o=pd({xdomain:!1});return o&&o.responseType!==null})();class O0 extends A0{constructor(i){super(i);const f=i&&i.forceBase64;this.supportsBinary=z0&&!f}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Ce(pd,this.uri(),i)}}function pd(o){const i=o.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||E0))return new XMLHttpRequest}catch{}if(!i)try{return new be[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Sd=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class N0 extends Gf{get name(){return"websocket"}doOpen(){const i=this.uri(),f=this.opts.protocols,s=Sd?{}:md(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,f,s)}catch(m){return this.emitReserved("error",m)}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 f=0;f{try{this.doWrite(s,E)}catch{}m&&ni(()=>{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",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=vd()),this.supportsBinary||(f.b64=1),this.createUri(i,f)}}const xf=be.WebSocket||be.MozWebSocket;class M0 extends N0{createSocket(i,f,s){return Sd?new xf(i,f,s):f?new xf(i,f):new xf(i)}doWrite(i,f){this.ws.send(f)}}class R0 extends Gf{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 f=o0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=i.readable.pipeThrough(f).getReader(),m=s0();m.readable.pipeTo(i.writable),this._writer=m.writable.getWriter();const E=()=>{s.read().then(({done:B,value:M})=>{B||(this.onPacket(M),E())}).catch(B=>{})};E();const R={type:"open"};this.query.sid&&(R.data=`{"sid":"${this.query.sid}"}`),this._writer.write(R).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let f=0;f{m&&ni(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const D0={websocket:M0,webtransport:R0,polling:O0},U0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,x0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Bf(o){if(o.length>8e3)throw"URI too long";const i=o,f=o.indexOf("["),s=o.indexOf("]");f!=-1&&s!=-1&&(o=o.substring(0,f)+o.substring(f,s).replace(/:/g,";")+o.substring(s,o.length));let m=U0.exec(o||""),E={},R=14;for(;R--;)E[x0[R]]=m[R]||"";return f!=-1&&s!=-1&&(E.source=i,E.host=E.host.substring(1,E.host.length-1).replace(/;/g,":"),E.authority=E.authority.replace("[","").replace("]","").replace(/;/g,":"),E.ipv6uri=!0),E.pathNames=C0(E,E.path),E.queryKey=B0(E,E.query),E}function C0(o,i){const f=/\/{2,9}/g,s=i.replace(f,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&s.splice(0,1),i.slice(-1)=="/"&&s.splice(s.length-1,1),s}function B0(o,i){const f={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,m,E){m&&(f[m]=E)}),f}const qf=typeof addEventListener=="function"&&typeof removeEventListener=="function",ti=[];qf&&addEventListener("offline",()=>{ti.forEach(o=>o())},!1);class Nl extends Ot{constructor(i,f){if(super(),this.binaryType=h0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(f=i,i=null),i){const s=Bf(i);f.hostname=s.host,f.secure=s.protocol==="https"||s.protocol==="wss",f.port=s.port,s.query&&(f.query=s.query)}else f.host&&(f.hostname=Bf(f.host).host);ai(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},f.transports.forEach(s=>{const m=s.prototype.name;this.transports.push(m),this._transportsByName[m]=s}),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},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=S0(this.opts.query)),qf&&(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"})},ti.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const f=Object.assign({},this.opts.query);f.EIO=yd,f.transport=i,this.id&&(f.sid=this.id);const s=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&Nl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const f=this.createTransport(i);f.open(),this.setTransport(f)}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",f=>this._onClose("transport close",f))}onOpen(){this.readyState="open",Nl.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 f=new Error("server error");f.code=i.data,this._onError(f);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 f=1;for(let s=0;s0&&f>this._maxPayload)return this.writeBuffer.slice(0,s);f+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,ni(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,f,s){return this._sendPacket("message",i,f,s),this}send(i,f,s){return this._sendPacket("message",i,f,s),this}_sendPacket(i,f,s,m){if(typeof f=="function"&&(m=f,f=void 0),typeof s=="function"&&(m=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const E={type:i,data:f,options:s};this.emitReserved("packetCreate",E),this.writeBuffer.push(E),m&&this.once("flush",m),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),i()},s=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():i()}):this.upgrading?s():i()),this}_onError(i){if(Nl.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,f){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(),qf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ti.indexOf(this._offlineEventListener);s!==-1&&ti.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,f),this.writeBuffer=[],this._prevBufferLen=0}}}Nl.protocol=yd;class q0 extends Nl{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i{s||(f.send([{type:"ping",data:"probe"}]),f.once("packet",x=>{if(!s)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Nl.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(Q(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const K=new Error("probe error");K.transport=f.name,this.emitReserved("upgradeError",K)}}))};function E(){s||(s=!0,Q(),f.close(),f=null)}const R=x=>{const K=new Error("probe error: "+x);K.transport=f.name,E(),this.emitReserved("upgradeError",K)};function B(){R("transport closed")}function M(){R("socket closed")}function A(x){f&&x.name!==f.name&&E()}const Q=()=>{f.removeListener("open",m),f.removeListener("error",R),f.removeListener("close",B),this.off("close",M),this.off("upgrading",A)};f.once("open",m),f.once("error",R),f.once("close",B),this.once("close",M),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{s||f.open()},200):f.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const f=[];for(let s=0;sD0[m]).filter(m=>!!m)),super(i,s)}};function Y0(o,i="",f){let s=o;f=f||typeof location<"u"&&location,o==null&&(o=f.protocol+"//"+f.host),typeof o=="string"&&(o.charAt(0)==="/"&&(o.charAt(1)==="/"?o=f.protocol+o:o=f.host+o),/^(https?|wss?):\/\//.test(o)||(typeof f<"u"?o=f.protocol+"//"+o:o="https://"+o),s=Bf(o)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const E=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+E+":"+s.port+i,s.href=s.protocol+"://"+E+(f&&f.port===s.port?"":":"+s.port),s}const j0=typeof ArrayBuffer=="function",L0=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o.buffer instanceof ArrayBuffer,bd=Object.prototype.toString,X0=typeof Blob=="function"||typeof Blob<"u"&&bd.call(Blob)==="[object BlobConstructor]",Q0=typeof File=="function"||typeof File<"u"&&bd.call(File)==="[object FileConstructor]";function Vf(o){return j0&&(o instanceof ArrayBuffer||L0(o))||X0&&o instanceof Blob||Q0&&o instanceof File}function ei(o,i){if(!o||typeof o!="object")return!1;if(Array.isArray(o)){for(let f=0,s=o.length;f=0&&o.num{delete this.acks[i];for(let B=0;B{this.io.clearTimeoutFn(E),f.apply(this,B)};R.withError=!0,this.acks[i]=R}emitWithAck(i,...f){return new Promise((s,m)=>{const E=(R,B)=>R?m(R):s(B);E.withError=!0,f.push(E),this.emit(i,...f)})}_addToQueue(i){let f;typeof i[i.length-1]=="function"&&(f=i.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((m,...E)=>s!==this._queue[0]?void 0:(m!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(m)):(this._queue.shift(),f&&f(null,...E)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!i||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.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:tt.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,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(s=>String(s.id)===i)){const s=this.acks[i];delete this.acks[i],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case tt.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 tt.EVENT:case tt.BINARY_EVENT:this.onevent(i);break;case tt.ACK:case tt.BINARY_ACK:this.onack(i);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const s=new Error(i.data.message);s.data=i.data.data,this.emitReserved("connect_error",s);break}}onevent(i){const f=i.data||[];i.id!=null&&f.push(this.ack(i.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const s of f)s.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 f=this;let s=!1;return function(...m){s||(s=!0,f.packet({type:tt.ACK,id:i,data:m}))}}onack(i){const f=this.acks[i.id];typeof f=="function"&&(delete this.acks[i.id],f.withError&&i.data.unshift(null),f.apply(this,i.data))}onconnect(i,f){this.id=i,this.recovered=f&&this._pid===f,this._pid=f,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:tt.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 f=this._anyListeners;for(let s=0;s0&&o.jitter<=1?o.jitter:0,this.attempts=0}Bn.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),f=Math.floor(i*this.jitter*o);o=(Math.floor(i*10)&1)==0?o-f:o+f}return Math.min(o,this.max)|0};Bn.prototype.reset=function(){this.attempts=0};Bn.prototype.setMin=function(o){this.ms=o};Bn.prototype.setMax=function(o){this.max=o};Bn.prototype.setJitter=function(o){this.jitter=o};class jf extends Ot{constructor(i,f){var s;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(f=i,i=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,ai(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((s=f.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Bn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=i;const m=f.parser||k0;this.encoder=new m.Encoder,this.decoder=new m.Decoder,this._autoConnect=f.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 f;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(f=this.backoff)===null||f===void 0||f.setMin(i),this)}randomizationFactor(i){var f;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(f=this.backoff)===null||f===void 0||f.setJitter(i),this)}reconnectionDelayMax(i){var f;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(f=this.backoff)===null||f===void 0||f.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 H0(this.uri,this.opts);const f=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const m=ze(f,"open",function(){s.onopen(),i&&i()}),E=B=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",B),i?i(B):this.maybeReconnectOnOpen()},R=ze(f,"error",E);if(this._timeout!==!1){const B=this._timeout,M=this.setTimeoutFn(()=>{m(),E(new Error("timeout")),f.close()},B);this.opts.autoUnref&&M.unref(),this.subs.push(()=>{this.clearTimeoutFn(M)})}return this.subs.push(m),this.subs.push(R),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(ze(i,"ping",this.onping.bind(this)),ze(i,"data",this.ondata.bind(this)),ze(i,"error",this.onerror.bind(this)),ze(i,"close",this.onclose.bind(this)),ze(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(f){this.onclose("parse error",f)}}ondecoded(i){ni(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,f){let s=this.nsps[i];return s?this._autoConnect&&!s.active&&s.connect():(s=new _d(this,i,f),this.nsps[i]=s),s}_destroy(i){const f=Object.keys(this.nsps);for(const s of f)if(this.nsps[s].active)return;this._close()}_packet(i){const f=this.encoder.encode(i);for(let s=0;si()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,f){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,f),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 f=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(m=>{m?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",m)):i.onreconnect()}))},f);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Ua={};function li(o,i){typeof o=="object"&&(i=o,o=void 0),i=i||{};const f=Y0(o,i.path||"/socket.io"),s=f.source,m=f.id,E=f.path,R=Ua[m]&&E in Ua[m].nsps,B=i.forceNew||i["force new connection"]||i.multiplex===!1||R;let M;return B?M=new jf(s,i):(Ua[m]||(Ua[m]=new jf(s,i)),M=Ua[m]),f.query&&!i.query&&(i.query=f.queryKey),M.socket(f.path,i)}Object.assign(li,{Manager:jf,Socket:_d,io:li,connect:li});const $0=void 0,wf=li($0,{transports:["websocket","polling"],timeout:15e3,reconnectionAttempts:5,query:{role:"user"}});wf.on("connect_error",o=>{console.error("Socket connection error:",o.message)});const Ed=Mt.createContext(wf),F0=({children:o})=>Y.jsx(Ed.Provider,{value:wf,children:o}),I0=()=>Mt.useContext(Ed),Td=Mt.createContext({connected:!1,session:null,logs:[],login:async()=>{},setRole:async()=>{},requestControl:async()=>{},releaseControl:async()=>{},subscribeAll:async()=>{}});function P0(o){return Mt.useCallback((i,f={})=>new Promise((s,m)=>{o.emit(i,f,(E={})=>{E.error?m(new Error(E.error)):s(E)})}),[o])}function tv({children:o}){const i=I0(),f=P0(i),[s,m]=Mt.useState(null),[E,R]=Mt.useState([]),[B,M]=Mt.useState(i.connected);Mt.useEffect(()=>{const x=()=>M(!0),K=()=>M(!1);return i.on("connect",x),i.on("disconnect",K),()=>{i.off("connect",x),i.off("disconnect",K)}},[i]),Mt.useEffect(()=>{function x(_t){m(_t)}function K(_t=[]){R(_t)}function Yt(_t){R(Ut=>[...Ut.slice(-199),_t])}return i.on("session:sync",x),i.on("log:init",K),i.on("log:entry",Yt),()=>{i.off("session:sync",x),i.off("log:init",K),i.off("log:entry",Yt)}},[i]);const A=Mt.useMemo(()=>({login:(x,K)=>f("auth:login",{username:x,password:K}),setRole:x=>f("session:setRole",{role:x}),requestControl:(x,K={})=>f("session:requestControl",{roverId:x,...K}),releaseControl:x=>f("session:releaseControl",{roverId:x}),subscribeAll:()=>f("session:subscribeAll")}),[f]),Q=Mt.useMemo(()=>({connected:B,session:s,logs:E,...A}),[A,B,E,s]);return Y.jsx(Td.Provider,{value:Q,children:o})}function qn(){return Mt.useContext(Td)}function ev({connected:o,role:i,mode:f}){const s=o?"bg-emerald-500/20 text-emerald-300":"bg-red-500/20 text-red-200";return Y.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[Y.jsx("span",{className:`rounded-full px-3 py-1 font-medium ${s}`,children:o?"Connected":"Disconnected"}),Y.jsxs("span",{className:"rounded-full bg-slate-800/80 px-3 py-1 text-slate-200",children:["Role: ",i||"unknown"]}),Y.jsxs("span",{className:"rounded-full bg-slate-800/80 px-3 py-1 text-slate-200",children:["Mode: ",f||"--"]})]})}function lv(){const{logs:o}=qn();return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/70 p-4",children:[Y.jsxs("header",{className:"mb-3 flex items-center justify-between",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Server logs"}),Y.jsxs("span",{className:"text-xs uppercase tracking-[0.2em] text-slate-500",children:[o.length," entries"]})]}),Y.jsx("div",{className:"h-64 overflow-y-auto rounded-xl bg-slate-950/40 p-3 text-xs font-mono text-slate-300",children:o.length===0?Y.jsx("p",{children:"No logs yet."}):o.slice().reverse().map(i=>Y.jsxs("div",{className:"mb-2",children:[Y.jsx("span",{className:"text-slate-500",children:i.timestamp})," ",Y.jsxs("span",{className:"text-cyan-300",children:["[",i.level,"]"]})," ",i.label&&Y.jsxs("span",{className:"text-pink-300",children:["[",i.label,"]"]})," ",Y.jsx("span",{children:i.message})]},i.id))})]})}function nv(){const{session:o,requestControl:i}=qn(),f=o?.roster??[],[s,m]=Mt.useState({});async function E(R){m(B=>({...B,[R]:!0}));try{await i(R)}catch(B){alert(B.message)}finally{m(B=>({...B,[R]:!1}))}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Rovers"}),Y.jsxs("div",{className:"mt-4 space-y-3",children:[f.length===0&&Y.jsx("p",{className:"text-slate-400",children:"No rovers registered."}),f.map(R=>Y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl bg-slate-950/40 px-4 py-3",children:[Y.jsxs("div",{children:[Y.jsx("p",{className:"text-white",children:R.name}),Y.jsxs("p",{className:"text-xs text-slate-400",children:["Locked: ",R.locked?"yes":"no"]})]}),Y.jsx("button",{type:"button",onClick:()=>E(R.id),disabled:s[R.id],className:"rounded-full bg-blue-600 px-4 py-1 text-sm font-semibold text-white disabled:opacity-50",children:s[R.id]?"Requesting…":"Request control"})]},R.id))]})]})}function av(){const{session:o,releaseControl:i}=qn(),f=o?.assignment,s=f?.roverId,[m,E]=Mt.useState(!1);async function R(){if(s){E(!0);try{await i(s)}catch(B){alert(B.message)}finally{E(!1)}}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Assignment"}),s?Y.jsxs("div",{className:"mt-4 space-y-3",children:[Y.jsxs("p",{className:"text-slate-300",children:["Currently driving rover ",s]}),Y.jsx("button",{type:"button",onClick:R,disabled:m,className:"rounded-full bg-red-600 px-4 py-1 text-sm font-semibold text-white disabled:opacity-50",children:m?"Releasing…":"Release control"})]}):Y.jsxs("div",{className:"mt-4 text-slate-400",children:[Y.jsxs("p",{children:["Status: ",f?.status??"not assigned"]}),f?.queuePosition&&Y.jsxs("p",{children:["Queue position: ",f.queuePosition]})]})]})}function uv(){const{session:o}=qn(),i=Mt.useMemo(()=>JSON.stringify(o??{},null,2),[o]);return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Session snapshot"}),Y.jsx("pre",{className:"mt-4 max-h-64 overflow-y-auto text-sm text-teal-200",children:i})]})}function iv(){const{login:o,setRole:i}=qn(),[f,s]=Mt.useState(""),[m,E]=Mt.useState(""),[R,B]=Mt.useState(!1);async function M(A){A.preventDefault(),B(!0);try{await o(f,m),s(""),E("")}catch(Q){alert(Q.message)}finally{B(!1)}}return Y.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/60 p-4",children:[Y.jsx("h2",{className:"text-lg font-semibold text-white",children:"Authentication"}),Y.jsxs("form",{className:"mt-4 flex flex-col gap-3",onSubmit:M,children:[Y.jsx("input",{className:"rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-white",placeholder:"Username",value:f,onChange:A=>s(A.target.value)}),Y.jsx("input",{className:"rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-white",placeholder:"Password",type:"password",value:m,onChange:A=>E(A.target.value)}),Y.jsx("button",{type:"submit",disabled:R,className:"rounded-lg bg-emerald-600 py-2 font-semibold text-white disabled:opacity-50",children:R?"Logging in…":"Login as admin"})]}),Y.jsxs("div",{className:"mt-4 flex gap-3",children:[Y.jsx("button",{type:"button",onClick:()=>i("user"),className:"rounded-lg border border-slate-700 px-3 py-1 text-sm text-slate-200",children:"Driver mode"}),Y.jsx("button",{type:"button",onClick:()=>i("spectator"),className:"rounded-lg border border-slate-700 px-3 py-1 text-sm text-slate-200",children:"Spectator mode"})]})]})}function cv(){const{connected:o,session:i}=qn();return Y.jsx("div",{className:"min-h-screen bg-slate-950 text-slate-50",children:Y.jsxs("main",{className:"mx-auto flex max-w-6xl flex-col gap-6 px-6 py-10",children:[Y.jsxs("header",{className:"space-y-4",children:[Y.jsx("h1",{className:"text-4xl font-semibold text-white",children:"Multi Roomba Rover Console"}),Y.jsx(ev,{connected:o,role:i?.role,mode:i?.mode})]}),Y.jsxs("section",{className:"grid gap-6 lg:grid-cols-2",children:[Y.jsx(nv,{}),Y.jsx(av,{}),Y.jsx(iv,{}),Y.jsx(uv,{})]}),Y.jsx(lv,{})]})})}l0.createRoot(document.getElementById("root")).render(Y.jsx(Mt.StrictMode,{children:Y.jsx(F0,{children:Y.jsx(tv,{children:Y.jsx(cv,{})})})})); diff --git a/server/public/index.html b/server/public/index.html index fb1266fa..b8d06e8c 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -5,7 +5,7 @@ webui - + diff --git a/webui/src/lib/socket.js b/webui/src/lib/socket.js index 28177dec..660d9ee1 100644 --- a/webui/src/lib/socket.js +++ b/webui/src/lib/socket.js @@ -4,7 +4,9 @@ const configuredUrl = import.meta.env.VITE_ROVERD_URL?.trim(); const serverUrl = configuredUrl && configuredUrl.length > 0 ? configuredUrl : undefined; export const socket = io(serverUrl, { - transports: ['websocket'], + transports: ['websocket', 'polling'], + timeout: 15000, + reconnectionAttempts: 5, query: { role: 'user' }, });