herdr-remote-relay 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var Ug=Object.defineProperty;var Bg=(r,s,o)=>s in r?Ug(r,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[s]=o;var Fe=(r,s,o)=>Bg(r,typeof s!="symbol"?s+"":s,o);import{r as Hh,g as Yh,a as Kh}from"./vendor-react-CYSfZuHu.js";import{r as Hg,a as Yg,b as Kg,c as Gg}from"./vendor-xterm-Bldps5fz.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))c(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const b of f.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&c(b)}).observe(document,{childList:!0,subtree:!0});function o(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(m){if(m.ep)return;m.ep=!0;const f=o(m);fetch(m.href,f)}})();var Lc={exports:{}},Ki={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var lh;function qg(){if(lh)return Ki;lh=1;var r=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(c,m,f){var b=null;if(f!==void 0&&(b=""+f),m.key!==void 0&&(b=""+m.key),"key"in m){f={};for(var p in m)p!=="key"&&(f[p]=m[p])}else f=m;return m=f.ref,{$$typeof:r,type:c,key:b,ref:m!==void 0?m:null,props:f}}return Ki.Fragment=s,Ki.jsx=o,Ki.jsxs=o,Ki}var ah;function Xg(){return ah||(ah=1,Lc.exports=qg()),Lc.exports}var u=Xg(),S=Hh();const fl=Yh(S);var Uc={exports:{}},Gi={},Bc={exports:{}},Hc={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ih;function Vg(){return ih||(ih=1,(function(r){function s(j,B){var Z=j.length;j.push(B);e:for(;0<Z;){var oe=Z-1>>>1,k=j[oe];if(0<m(k,B))j[oe]=B,j[Z]=k,Z=oe;else break e}}function o(j){return j.length===0?null:j[0]}function c(j){if(j.length===0)return null;var B=j[0],Z=j.pop();if(Z!==B){j[0]=Z;e:for(var oe=0,k=j.length,Je=k>>>1;oe<Je;){var Ge=2*(oe+1)-1,me=j[Ge],ve=Ge+1,ke=j[ve];if(0>m(me,Z))ve<k&&0>m(ke,me)?(j[oe]=ke,j[ve]=Z,oe=ve):(j[oe]=me,j[Ge]=Z,oe=Ge);else if(ve<k&&0>m(ke,Z))j[oe]=ke,j[ve]=Z,oe=ve;else break e}}return B}function m(j,B){var Z=j.sortIndex-B.sortIndex;return Z!==0?Z:j.id-B.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var b=Date,p=b.now();r.unstable_now=function(){return b.now()-p}}var v=[],w=[],y=1,T=null,K=3,O=!1,G=!1,V=!1,L=!1,Q=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function ie(j){for(var B=o(w);B!==null;){if(B.callback===null)c(w);else if(B.startTime<=j)c(w),B.sortIndex=B.expirationTime,s(v,B);else break;B=o(w)}}function pe(j){if(V=!1,ie(j),!G)if(o(v)!==null)G=!0,q||(q=!0,be());else{var B=o(w);B!==null&&we(pe,B.startTime-j)}}var q=!1,Y=-1,R=5,de=-1;function He(){return L?!0:!(r.unstable_now()-de<R)}function Te(){if(L=!1,q){var j=r.unstable_now();de=j;var B=!0;try{e:{G=!1,V&&(V=!1,$(Y),Y=-1),O=!0;var Z=K;try{t:{for(ie(j),T=o(v);T!==null&&!(T.expirationTime>j&&He());){var oe=T.callback;if(typeof oe=="function"){T.callback=null,K=T.priorityLevel;var k=oe(T.expirationTime<=j);if(j=r.unstable_now(),typeof k=="function"){T.callback=k,ie(j),B=!0;break t}T===o(v)&&c(v),ie(j)}else c(v);T=o(v)}if(T!==null)B=!0;else{var Je=o(w);Je!==null&&we(pe,Je.startTime-j),B=!1}}break e}finally{T=null,K=Z,O=!1}B=void 0}}finally{B?be():q=!1}}}var be;if(typeof I=="function")be=function(){I(Te)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ce=X.port2;X.port1.onmessage=Te,be=function(){ce.postMessage(null)}}else be=function(){Q(Te,0)};function we(j,B){Y=Q(function(){j(r.unstable_now())},B)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(j){j.callback=null},r.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<j?Math.floor(1e3/j):5},r.unstable_getCurrentPriorityLevel=function(){return K},r.unstable_next=function(j){switch(K){case 1:case 2:case 3:var B=3;break;default:B=K}var Z=K;K=B;try{return j()}finally{K=Z}},r.unstable_requestPaint=function(){L=!0},r.unstable_runWithPriority=function(j,B){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Z=K;K=j;try{return B()}finally{K=Z}},r.unstable_scheduleCallback=function(j,B,Z){var oe=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?oe+Z:oe):Z=oe,j){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=Z+k,j={id:y++,callback:B,priorityLevel:j,startTime:Z,expirationTime:k,sortIndex:-1},Z>oe?(j.sortIndex=Z,s(w,j),o(v)===null&&j===o(w)&&(V?($(Y),Y=-1):V=!0,we(pe,Z-oe))):(j.sortIndex=k,s(v,j),G||O||(G=!0,q||(q=!0,be()))),j},r.unstable_shouldYield=He,r.unstable_wrapCallback=function(j){var B=K;return function(){var Z=K;K=B;try{return j.apply(this,arguments)}finally{K=Z}}}})(Hc)),Hc}var sh;function Zg(){return sh||(sh=1,Bc.exports=Vg()),Bc.exports}/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom-client.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var oh;function Qg(){if(oh)return Gi;oh=1;var r=Zg(),s=Hh(),o=Kh();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function b(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(f(e)!==e)throw Error(c(188))}function w(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return v(a),e;if(i===l)return v(a),t;i=i.sibling}throw Error(c(188))}if(n.return!==l.return)n=a,l=i;else{for(var d=!1,h=a.child;h;){if(h===n){d=!0,n=a,l=i;break}if(h===l){d=!0,l=a,n=i;break}h=h.sibling}if(!d){for(h=i.child;h;){if(h===n){d=!0,n=i,l=a;break}if(h===l){d=!0,l=i,n=a;break}h=h.sibling}if(!d)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,K=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),I=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),pe=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),He=Symbol.for("react.memo_cache_sentinel"),Te=Symbol.iterator;function be(e){return e===null||typeof e!="object"?null:(e=Te&&e[Te]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case Q:return"Profiler";case L:return"StrictMode";case pe:return"Suspense";case q:return"SuspenseList";case de:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case I:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ie:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var we=Array.isArray,j=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},oe=[],k=-1;function Je(e){return{current:e}}function Ge(e){0>k||(e.current=oe[k],oe[k]=null,k--)}function me(e,t){k++,oe[k]=e.current,e.current=t}var ve=Je(null),ke=Je(null),Ne=Je(null),$e=Je(null);function zt(e,t){switch(me(Ne,t),me(ke,e),me(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Am(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Am(t),e=Em(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ge(ve),me(ve,e)}function De(){Ge(ve),Ge(ke),Ge(Ne)}function ut(e){e.memoizedState!==null&&me($e,e);var t=ve.current,n=Em(t,e.type);t!==n&&(me(ke,e),me(ve,n))}function ht(e){ke.current===e&&(Ge(ve),Ge(ke)),$e.current===e&&(Ge($e),Ui._currentValue=Z)}var Xt,_t;function lt(e){if(Xt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xt=t&&t[1]||"",_t=-1<n.stack.indexOf(`
|
|
26
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
27
|
+
`+Xt+e+_t}var Qt=!1;function Lt(e,t){if(!e||Qt)return"";Qt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(M){var E=M}Reflect.construct(e,[],U)}else{try{U.call()}catch(M){E=M}e.call(U.prototype)}}else{try{throw Error()}catch(M){E=M}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(M){if(M&&E&&typeof M.stack=="string")return[M.stack,E.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],h=i[1];if(d&&h){var g=d.split(`
|
|
28
|
+
`),A=h.split(`
|
|
29
|
+
`);for(a=l=0;l<g.length&&!g[l].includes("DetermineComponentFrameRoot");)l++;for(;a<A.length&&!A[a].includes("DetermineComponentFrameRoot");)a++;if(l===g.length||a===A.length)for(l=g.length-1,a=A.length-1;1<=l&&0<=a&&g[l]!==A[a];)a--;for(;1<=l&&0<=a;l--,a--)if(g[l]!==A[a]){if(l!==1||a!==1)do if(l--,a--,0>a||g[l]!==A[a]){var _=`
|
|
30
|
+
`+g[l].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=l&&0<=a);break}}}finally{Qt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?lt(n):""}function hn(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return Lt(e.type,!1);case 11:return Lt(e.type.render,!1);case 1:return Lt(e.type,!0);case 31:return lt("Activity");default:return""}}function ln(e){try{var t="",n=null;do t+=hn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
31
|
+
Error generating stack: `+l.message+`
|
|
32
|
+
`+l.stack}}var Vt=Object.prototype.hasOwnProperty,wt=r.unstable_scheduleCallback,Dn=r.unstable_cancelCallback,On=r.unstable_shouldYield,Ln=r.unstable_requestPaint,P=r.unstable_now,Ce=r.unstable_getCurrentPriorityLevel,Se=r.unstable_ImmediatePriority,Pe=r.unstable_UserBlockingPriority,Ft=r.unstable_NormalPriority,pn=r.unstable_LowPriority,Kt=r.unstable_IdlePriority,ml=r.log,Xn=r.unstable_setDisableYieldValue,J=null,W=null;function xe(e){if(typeof ml=="function"&&Xn(e),W&&typeof W.setStrictMode=="function")try{W.setStrictMode(J,e)}catch{}}var Re=Math.clz32?Math.clz32:Et,dt=Math.log,se=Math.LN2;function Et(e){return e>>>=0,e===0?32:31-(dt(e)/se|0)|0}var pt=256,Jt=262144,z=4194304;function H(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function te(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~i,l!==0?a=H(l):(d&=h,d!==0?a=H(d):n||(n=h&~e,n!==0&&(a=H(n))))):(h=l&~i,h!==0?a=H(h):d!==0?a=H(d):n||(n=l&~e,n!==0&&(a=H(n)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function he(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Me(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=z;return z<<=1,(z&62914560)===0&&(z=4194304),e}function Oe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bt(e,t,n,l,a,i){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var h=e.entanglements,g=e.expirationTimes,A=e.hiddenUpdates;for(n=d&~n;0<n;){var _=31-Re(n),U=1<<_;h[_]=0,g[_]=-1;var E=A[_];if(E!==null)for(A[_]=null,_=0;_<E.length;_++){var M=E[_];M!==null&&(M.lane&=-536870913)}n&=~U}l!==0&&Un(e,l,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function Un(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Re(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function an(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Re(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function Gt(e,t){var n=t&-t;return n=(n&42)!==0?1:Bn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Bn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ca(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function re(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:Wm(e.type))}function Ee(e,t){var n=B.p;try{return B.p=e,t()}finally{B.p=n}}var at=Math.random().toString(36).slice(2),ot="__reactFiber$"+at,gt="__reactProps$"+at,Wt="__reactContainer$"+at,fe="__reactEvents$"+at,jt="__reactListeners$"+at,kt="__reactHandles$"+at,sn="__reactResources$"+at,Kl="__reactMarker$"+at;function $a(e){delete e[ot],delete e[gt],delete e[fe],delete e[jt],delete e[kt]}function hl(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wt]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Dm(e);e!==null;){if(n=e[ot])return n;e=Dm(e)}return t}e=n,n=e.parentNode}return null}function Vn(e){if(e=e[ot]||e[Wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ua(e){var t=e[sn];return t||(t=e[sn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[Kl]=!0}var mu=new Set,hu={};function Gl(e,t){da(e,t),da(e+"Capture",t)}function da(e,t){for(hu[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var jp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),pu={},bu={};function Rp(e){return Vt.call(bu,e)?!0:Vt.call(pu,e)?!1:jp.test(e)?bu[e]=!0:(pu[e]=!0,!1)}function ns(e,t,n){if(Rp(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ls(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Zn(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function bn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Mp(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ro(e){if(!e._valueTracker){var t=gu(e)?"checked":"value";e._valueTracker=Mp(e,t,""+e[t])}}function yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=gu(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function as(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var zp=/[\n"\\]/g;function gn(e){return e.replace(zp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mo(e,t,n,l,a,i,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bn(t)):e.value!==""+bn(t)&&(e.value=""+bn(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?zo(e,d,bn(t)):n!=null?zo(e,d,bn(n)):l!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+bn(h):e.removeAttribute("name")}function vu(e,t,n,l,a,i,d,h){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Ro(e);return}n=n!=null?""+bn(n):"",t=t!=null?""+bn(t):n,h||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=h?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Ro(e)}function zo(e,t,n){t==="number"&&as(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fa(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+bn(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function xu(e,t,n){if(t!=null&&(t=""+bn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+bn(n):""}function Su(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(we(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=bn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ro(e)}function ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _p=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function wu(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||_p.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Cu(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&wu(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&wu(e,i,t[i])}function _o(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function is(e){return Dp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qn(){}var ko=null;function Do(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ha=null,pa=null;function Tu(e){var t=Vn(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mo(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+gn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[gt]||null;if(!a)throw Error(c(90));Mo(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&yu(l)}break e;case"textarea":xu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fa(e,!!n.multiple,t,!1)}}}var Oo=!1;function Nu(e,t,n){if(Oo)return e(t,n);Oo=!0;try{var l=e(t);return l}finally{if(Oo=!1,(ha!==null||pa!==null)&&(Zs(),ha&&(t=ha,e=pa,pa=ha=null,Tu(t),e)))for(t=0;t<e.length;t++)Tu(e[t])}}function ei(e,t){var n=e.stateNode;if(n===null)return null;var l=n[gt]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(Fn)try{var ti={};Object.defineProperty(ti,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",ti,ti),window.removeEventListener("test",ti,ti)}catch{Lo=!1}var pl=null,Uo=null,ss=null;function Au(){if(ss)return ss;var e,t=Uo,n=t.length,l,a="value"in pl?pl.value:pl.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===a[i-l];l++);return ss=a.slice(e,1<l?1-l:void 0)}function os(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function rs(){return!0}function Eu(){return!1}function It(e){function t(n,l,a,i,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?rs:Eu,this.isPropagationStopped=Eu,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=rs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=rs)},persist:function(){},isPersistent:rs}),t}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cs=It(ql),ni=T({},ql,{view:0,detail:0}),Op=It(ni),Bo,Ho,li,us=T({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ko,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==li&&(li&&e.type==="mousemove"?(Bo=e.screenX-li.screenX,Ho=e.screenY-li.screenY):Ho=Bo=0,li=e),Bo)},movementY:function(e){return"movementY"in e?e.movementY:Ho}}),ju=It(us),Lp=T({},us,{dataTransfer:0}),Up=It(Lp),Bp=T({},ni,{relatedTarget:0}),Yo=It(Bp),Hp=T({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Yp=It(Hp),Kp=T({},ql,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gp=It(Kp),qp=T({},ql,{data:0}),Ru=It(qp),Xp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Zp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zp[e])?!!t[e]:!1}function Ko(){return Qp}var Fp=T({},ni,{key:function(e){if(e.key){var t=Xp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ko,charCode:function(e){return e.type==="keypress"?os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jp=It(Fp),Wp=T({},us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mu=It(Wp),Ip=T({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ko}),$p=It(Ip),Pp=T({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),eb=It(Pp),tb=T({},us,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),nb=It(tb),lb=T({},ql,{newState:0,oldState:0}),ab=It(lb),ib=[9,13,27,32],Go=Fn&&"CompositionEvent"in window,ai=null;Fn&&"documentMode"in document&&(ai=document.documentMode);var sb=Fn&&"TextEvent"in window&&!ai,zu=Fn&&(!Go||ai&&8<ai&&11>=ai),_u=" ",ku=!1;function Du(e,t){switch(e){case"keyup":return ib.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ba=!1;function ob(e,t){switch(e){case"compositionend":return Ou(t);case"keypress":return t.which!==32?null:(ku=!0,_u);case"textInput":return e=t.data,e===_u&&ku?null:e;default:return null}}function rb(e,t){if(ba)return e==="compositionend"||!Go&&Du(e,t)?(e=Au(),ss=Uo=pl=null,ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zu&&t.locale!=="ko"?null:t.data;default:return null}}var cb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cb[e.type]:t==="textarea"}function Uu(e,t,n,l){ha?pa?pa.push(l):pa=[l]:ha=l,t=Ps(t,"onChange"),0<t.length&&(n=new cs("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ii=null,si=null;function ub(e){xm(e,0)}function ds(e){var t=Pa(e);if(yu(t))return e}function Bu(e,t){if(e==="change")return t}var Hu=!1;if(Fn){var qo;if(Fn){var Xo="oninput"in document;if(!Xo){var Yu=document.createElement("div");Yu.setAttribute("oninput","return;"),Xo=typeof Yu.oninput=="function"}qo=Xo}else qo=!1;Hu=qo&&(!document.documentMode||9<document.documentMode)}function Ku(){ii&&(ii.detachEvent("onpropertychange",Gu),si=ii=null)}function Gu(e){if(e.propertyName==="value"&&ds(si)){var t=[];Uu(t,si,e,Do(e)),Nu(ub,t)}}function db(e,t,n){e==="focusin"?(Ku(),ii=t,si=n,ii.attachEvent("onpropertychange",Gu)):e==="focusout"&&Ku()}function fb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(si)}function mb(e,t){if(e==="click")return ds(t)}function hb(e,t){if(e==="input"||e==="change")return ds(t)}function pb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var on=typeof Object.is=="function"?Object.is:pb;function oi(e,t){if(on(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!Vt.call(t,a)||!on(e[a],t[a]))return!1}return!0}function qu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xu(e,t){var n=qu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qu(n)}}function Vu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=as(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=as(e.document)}return t}function Vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var bb=Fn&&"documentMode"in document&&11>=document.documentMode,ga=null,Zo=null,ri=null,Qo=!1;function Qu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qo||ga==null||ga!==as(l)||(l=ga,"selectionStart"in l&&Vo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ri&&oi(ri,l)||(ri=l,l=Ps(Zo,"onSelect"),0<l.length&&(t=new cs("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=ga)))}function Xl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ya={animationend:Xl("Animation","AnimationEnd"),animationiteration:Xl("Animation","AnimationIteration"),animationstart:Xl("Animation","AnimationStart"),transitionrun:Xl("Transition","TransitionRun"),transitionstart:Xl("Transition","TransitionStart"),transitioncancel:Xl("Transition","TransitionCancel"),transitionend:Xl("Transition","TransitionEnd")},Fo={},Fu={};Fn&&(Fu=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Vl(e){if(Fo[e])return Fo[e];if(!ya[e])return e;var t=ya[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fu)return Fo[e]=t[n];return e}var Ju=Vl("animationend"),Wu=Vl("animationiteration"),Iu=Vl("animationstart"),gb=Vl("transitionrun"),yb=Vl("transitionstart"),vb=Vl("transitioncancel"),$u=Vl("transitionend"),Pu=new Map,Jo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Jo.push("scrollEnd");function Mn(e,t){Pu.set(e,t),Gl(t,[e])}var fs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yn=[],va=0,Wo=0;function ms(){for(var e=va,t=Wo=va=0;t<e;){var n=yn[t];yn[t++]=null;var l=yn[t];yn[t++]=null;var a=yn[t];yn[t++]=null;var i=yn[t];if(yn[t++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}i!==0&&ed(n,a,i)}}function hs(e,t,n,l){yn[va++]=e,yn[va++]=t,yn[va++]=n,yn[va++]=l,Wo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Io(e,t,n,l){return hs(e,t,n,l),ps(e)}function Zl(e,t){return hs(e,null,null,t),ps(e)}function ed(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,l=i.alternate,l!==null&&(l.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-Re(n),e=i.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),i):null}function ps(e){if(50<Mi)throw Mi=0,sc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xa={};function xb(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,n,l){return new xb(e,t,n,l)}function $o(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var n=e.alternate;return n===null?(n=rn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function td(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function bs(e,t,n,l,a,i){var d=0;if(l=e,typeof e=="function")$o(e)&&(d=1);else if(typeof e=="string")d=Ng(e,n,ve.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case de:return e=rn(31,n,t,a),e.elementType=de,e.lanes=i,e;case V:return Ql(n.children,a,i,t);case L:d=8,a|=24;break;case Q:return e=rn(12,n,t,a|2),e.elementType=Q,e.lanes=i,e;case pe:return e=rn(13,n,t,a),e.elementType=pe,e.lanes=i,e;case q:return e=rn(19,n,t,a),e.elementType=q,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:d=10;break e;case $:d=9;break e;case ie:d=11;break e;case Y:d=14;break e;case R:d=16,l=null;break e}d=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=rn(d,n,t,a),t.elementType=e,t.type=l,t.lanes=i,t}function Ql(e,t,n,l){return e=rn(7,e,l,t),e.lanes=n,e}function Po(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function nd(e){var t=rn(18,null,null,0);return t.stateNode=e,t}function er(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ld=new WeakMap;function vn(e,t){if(typeof e=="object"&&e!==null){var n=ld.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ln(t)},ld.set(e,t),t)}return{value:e,source:t,stack:ln(t)}}var Sa=[],wa=0,gs=null,ci=0,xn=[],Sn=0,bl=null,Hn=1,Yn="";function Wn(e,t){Sa[wa++]=ci,Sa[wa++]=gs,gs=e,ci=t}function ad(e,t,n){xn[Sn++]=Hn,xn[Sn++]=Yn,xn[Sn++]=bl,bl=e;var l=Hn;e=Yn;var a=32-Re(l)-1;l&=~(1<<a),n+=1;var i=32-Re(t)+a;if(30<i){var d=a-a%5;i=(l&(1<<d)-1).toString(32),l>>=d,a-=d,Hn=1<<32-Re(t)+a|n<<a|l,Yn=i+e}else Hn=1<<i|n<<a|l,Yn=e}function tr(e){e.return!==null&&(Wn(e,1),ad(e,1,0))}function nr(e){for(;e===gs;)gs=Sa[--wa],Sa[wa]=null,ci=Sa[--wa],Sa[wa]=null;for(;e===bl;)bl=xn[--Sn],xn[Sn]=null,Yn=xn[--Sn],xn[Sn]=null,Hn=xn[--Sn],xn[Sn]=null}function id(e,t){xn[Sn++]=Hn,xn[Sn++]=Yn,xn[Sn++]=bl,Hn=t.id,Yn=t.overflow,bl=e}var Ut=null,rt=null,Xe=!1,gl=null,wn=!1,lr=Error(c(519));function yl(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ui(vn(t,e)),lr}function sd(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[ot]=e,t[gt]=l,n){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(n=0;n<_i.length;n++)Ue(_i[n],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),vu(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Su(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Tm(t.textContent,n)?(l.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),l.onScroll!=null&&Ue("scroll",t),l.onScrollEnd!=null&&Ue("scrollend",t),l.onClick!=null&&(t.onclick=Qn),t=!0):t=!1,t||yl(e,!0)}function od(e){for(Ut=e.return;Ut;)switch(Ut.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:Ut=Ut.return}}function Ca(e){if(e!==Ut)return!1;if(!Xe)return od(e),Xe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Sc(e.type,e.memoizedProps)),n=!n),n&&rt&&yl(e),od(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));rt=km(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));rt=km(e)}else t===27?(t=rt,_l(e.type)?(e=Ac,Ac=null,rt=e):rt=t):rt=Ut?Tn(e.stateNode.nextSibling):null;return!0}function Fl(){rt=Ut=null,Xe=!1}function ar(){var e=gl;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),gl=null),e}function ui(e){gl===null?gl=[e]:gl.push(e)}var ir=Je(null),Jl=null,In=null;function vl(e,t,n){me(ir,t._currentValue),t._currentValue=n}function $n(e){e._currentValue=ir.current,Ge(ir)}function sr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function or(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var d=a.child;i=i.firstContext;e:for(;i!==null;){var h=i;i=a;for(var g=0;g<t.length;g++)if(h.context===t[g]){i.lanes|=n,h=i.alternate,h!==null&&(h.lanes|=n),sr(i.return,n,e),l||(d=null);break e}i=h.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(c(341));d.lanes|=n,i=d.alternate,i!==null&&(i.lanes|=n),sr(d,n,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function Ta(e,t,n,l){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var h=a.type;on(a.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(a===$e.current){if(d=a.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ui):e=[Ui])}a=a.return}e!==null&&or(t,e,n,l),t.flags|=262144}function ys(e){for(e=e.firstContext;e!==null;){if(!on(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return rd(Jl,e)}function vs(e,t){return Jl===null&&Wl(e),rd(e,t)}function rd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},In===null){if(e===null)throw Error(c(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return n}var Sb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},wb=r.unstable_scheduleCallback,Cb=r.unstable_NormalPriority,Ct={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rr(){return{controller:new Sb,data:new Map,refCount:0}}function di(e){e.refCount--,e.refCount===0&&wb(Cb,function(){e.controller.abort()})}var fi=null,cr=0,Na=0,Aa=null;function Tb(e,t){if(fi===null){var n=fi=[];cr=0,Na=fc(),Aa={status:"pending",value:void 0,then:function(l){n.push(l)}}}return cr++,t.then(cd,cd),t}function cd(){if(--cr===0&&fi!==null){Aa!==null&&(Aa.status="fulfilled");var e=fi;fi=null,Na=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Nb(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var ud=j.S;j.S=function(e,t){Ff=P(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Tb(e,t),ud!==null&&ud(e,t)};var Il=Je(null);function ur(){var e=Il.current;return e!==null?e:it.pooledCache}function xs(e,t){t===null?me(Il,Il.current):me(Il,t.pool)}function dd(){var e=ur();return e===null?null:{parent:Ct._currentValue,pool:e}}var Ea=Error(c(460)),dr=Error(c(474)),Ss=Error(c(542)),ws={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function md(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qn,Qn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pd(e),e;default:if(typeof t.status=="string")t.then(Qn,Qn);else{if(e=it,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pd(e),e}throw Pl=t,Ea}}function $l(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Pl=n,Ea):n}}var Pl=null;function hd(){if(Pl===null)throw Error(c(459));var e=Pl;return Pl=null,e}function pd(e){if(e===Ea||e===Ss)throw Error(c(483))}var ja=null,mi=0;function Cs(e){var t=mi;return mi+=1,ja===null&&(ja=[]),md(ja,e,t)}function hi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ts(e,t){throw t.$$typeof===K?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bd(e){function t(C,x){if(e){var N=C.deletions;N===null?(C.deletions=[x],C.flags|=16):N.push(x)}}function n(C,x){if(!e)return null;for(;x!==null;)t(C,x),x=x.sibling;return null}function l(C){for(var x=new Map;C!==null;)C.key!==null?x.set(C.key,C):x.set(C.index,C),C=C.sibling;return x}function a(C,x){return C=Jn(C,x),C.index=0,C.sibling=null,C}function i(C,x,N){return C.index=N,e?(N=C.alternate,N!==null?(N=N.index,N<x?(C.flags|=67108866,x):N):(C.flags|=67108866,x)):(C.flags|=1048576,x)}function d(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function h(C,x,N,D){return x===null||x.tag!==6?(x=Po(N,C.mode,D),x.return=C,x):(x=a(x,N),x.return=C,x)}function g(C,x,N,D){var ue=N.type;return ue===V?_(C,x,N.props.children,D,N.key):x!==null&&(x.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===R&&$l(ue)===x.type)?(x=a(x,N.props),hi(x,N),x.return=C,x):(x=bs(N.type,N.key,N.props,null,C.mode,D),hi(x,N),x.return=C,x)}function A(C,x,N,D){return x===null||x.tag!==4||x.stateNode.containerInfo!==N.containerInfo||x.stateNode.implementation!==N.implementation?(x=er(N,C.mode,D),x.return=C,x):(x=a(x,N.children||[]),x.return=C,x)}function _(C,x,N,D,ue){return x===null||x.tag!==7?(x=Ql(N,C.mode,D,ue),x.return=C,x):(x=a(x,N),x.return=C,x)}function U(C,x,N){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Po(""+x,C.mode,N),x.return=C,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case O:return N=bs(x.type,x.key,x.props,null,C.mode,N),hi(N,x),N.return=C,N;case G:return x=er(x,C.mode,N),x.return=C,x;case R:return x=$l(x),U(C,x,N)}if(we(x)||be(x))return x=Ql(x,C.mode,N,null),x.return=C,x;if(typeof x.then=="function")return U(C,Cs(x),N);if(x.$$typeof===I)return U(C,vs(C,x),N);Ts(C,x)}return null}function E(C,x,N,D){var ue=x!==null?x.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return ue!==null?null:h(C,x,""+N,D);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case O:return N.key===ue?g(C,x,N,D):null;case G:return N.key===ue?A(C,x,N,D):null;case R:return N=$l(N),E(C,x,N,D)}if(we(N)||be(N))return ue!==null?null:_(C,x,N,D,null);if(typeof N.then=="function")return E(C,x,Cs(N),D);if(N.$$typeof===I)return E(C,x,vs(C,N),D);Ts(C,N)}return null}function M(C,x,N,D,ue){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return C=C.get(N)||null,h(x,C,""+D,ue);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case O:return C=C.get(D.key===null?N:D.key)||null,g(x,C,D,ue);case G:return C=C.get(D.key===null?N:D.key)||null,A(x,C,D,ue);case R:return D=$l(D),M(C,x,N,D,ue)}if(we(D)||be(D))return C=C.get(N)||null,_(x,C,D,ue,null);if(typeof D.then=="function")return M(C,x,N,Cs(D),ue);if(D.$$typeof===I)return M(C,x,N,vs(x,D),ue);Ts(x,D)}return null}function le(C,x,N,D){for(var ue=null,Ve=null,ae=x,je=x=0,Ke=null;ae!==null&&je<N.length;je++){ae.index>je?(Ke=ae,ae=null):Ke=ae.sibling;var Ze=E(C,ae,N[je],D);if(Ze===null){ae===null&&(ae=Ke);break}e&&ae&&Ze.alternate===null&&t(C,ae),x=i(Ze,x,je),Ve===null?ue=Ze:Ve.sibling=Ze,Ve=Ze,ae=Ke}if(je===N.length)return n(C,ae),Xe&&Wn(C,je),ue;if(ae===null){for(;je<N.length;je++)ae=U(C,N[je],D),ae!==null&&(x=i(ae,x,je),Ve===null?ue=ae:Ve.sibling=ae,Ve=ae);return Xe&&Wn(C,je),ue}for(ae=l(ae);je<N.length;je++)Ke=M(ae,C,je,N[je],D),Ke!==null&&(e&&Ke.alternate!==null&&ae.delete(Ke.key===null?je:Ke.key),x=i(Ke,x,je),Ve===null?ue=Ke:Ve.sibling=Ke,Ve=Ke);return e&&ae.forEach(function(Ul){return t(C,Ul)}),Xe&&Wn(C,je),ue}function ge(C,x,N,D){if(N==null)throw Error(c(151));for(var ue=null,Ve=null,ae=x,je=x=0,Ke=null,Ze=N.next();ae!==null&&!Ze.done;je++,Ze=N.next()){ae.index>je?(Ke=ae,ae=null):Ke=ae.sibling;var Ul=E(C,ae,Ze.value,D);if(Ul===null){ae===null&&(ae=Ke);break}e&&ae&&Ul.alternate===null&&t(C,ae),x=i(Ul,x,je),Ve===null?ue=Ul:Ve.sibling=Ul,Ve=Ul,ae=Ke}if(Ze.done)return n(C,ae),Xe&&Wn(C,je),ue;if(ae===null){for(;!Ze.done;je++,Ze=N.next())Ze=U(C,Ze.value,D),Ze!==null&&(x=i(Ze,x,je),Ve===null?ue=Ze:Ve.sibling=Ze,Ve=Ze);return Xe&&Wn(C,je),ue}for(ae=l(ae);!Ze.done;je++,Ze=N.next())Ze=M(ae,C,je,Ze.value,D),Ze!==null&&(e&&Ze.alternate!==null&&ae.delete(Ze.key===null?je:Ze.key),x=i(Ze,x,je),Ve===null?ue=Ze:Ve.sibling=Ze,Ve=Ze);return e&&ae.forEach(function(Lg){return t(C,Lg)}),Xe&&Wn(C,je),ue}function nt(C,x,N,D){if(typeof N=="object"&&N!==null&&N.type===V&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case O:e:{for(var ue=N.key;x!==null;){if(x.key===ue){if(ue=N.type,ue===V){if(x.tag===7){n(C,x.sibling),D=a(x,N.props.children),D.return=C,C=D;break e}}else if(x.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===R&&$l(ue)===x.type){n(C,x.sibling),D=a(x,N.props),hi(D,N),D.return=C,C=D;break e}n(C,x);break}else t(C,x);x=x.sibling}N.type===V?(D=Ql(N.props.children,C.mode,D,N.key),D.return=C,C=D):(D=bs(N.type,N.key,N.props,null,C.mode,D),hi(D,N),D.return=C,C=D)}return d(C);case G:e:{for(ue=N.key;x!==null;){if(x.key===ue)if(x.tag===4&&x.stateNode.containerInfo===N.containerInfo&&x.stateNode.implementation===N.implementation){n(C,x.sibling),D=a(x,N.children||[]),D.return=C,C=D;break e}else{n(C,x);break}else t(C,x);x=x.sibling}D=er(N,C.mode,D),D.return=C,C=D}return d(C);case R:return N=$l(N),nt(C,x,N,D)}if(we(N))return le(C,x,N,D);if(be(N)){if(ue=be(N),typeof ue!="function")throw Error(c(150));return N=ue.call(N),ge(C,x,N,D)}if(typeof N.then=="function")return nt(C,x,Cs(N),D);if(N.$$typeof===I)return nt(C,x,vs(C,N),D);Ts(C,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,x!==null&&x.tag===6?(n(C,x.sibling),D=a(x,N),D.return=C,C=D):(n(C,x),D=Po(N,C.mode,D),D.return=C,C=D),d(C)):n(C,x)}return function(C,x,N,D){try{mi=0;var ue=nt(C,x,N,D);return ja=null,ue}catch(ae){if(ae===Ea||ae===Ss)throw ae;var Ve=rn(29,ae,null,C.mode);return Ve.lanes=D,Ve.return=C,Ve}finally{}}}var ea=bd(!0),gd=bd(!1),xl=!1;function fr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=ps(e),ed(e,null,n),t}return hs(e,l,t,n),ps(e)}function pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,an(e,n)}}function hr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=d:i=i.next=d,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var pr=!1;function bi(){if(pr){var e=Aa;if(e!==null)throw e}}function gi(e,t,n,l){pr=!1;var a=e.updateQueue;xl=!1;var i=a.firstBaseUpdate,d=a.lastBaseUpdate,h=a.shared.pending;if(h!==null){a.shared.pending=null;var g=h,A=g.next;g.next=null,d===null?i=A:d.next=A,d=g;var _=e.alternate;_!==null&&(_=_.updateQueue,h=_.lastBaseUpdate,h!==d&&(h===null?_.firstBaseUpdate=A:h.next=A,_.lastBaseUpdate=g))}if(i!==null){var U=a.baseState;d=0,_=A=g=null,h=i;do{var E=h.lane&-536870913,M=E!==h.lane;if(M?(Ye&E)===E:(l&E)===E){E!==0&&E===Na&&(pr=!0),_!==null&&(_=_.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var le=e,ge=h;E=t;var nt=n;switch(ge.tag){case 1:if(le=ge.payload,typeof le=="function"){U=le.call(nt,U,E);break e}U=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=ge.payload,E=typeof le=="function"?le.call(nt,U,E):le,E==null)break e;U=T({},U,E);break e;case 2:xl=!0}}E=h.callback,E!==null&&(e.flags|=64,M&&(e.flags|=8192),M=a.callbacks,M===null?a.callbacks=[E]:M.push(E))}else M={lane:E,tag:h.tag,payload:h.payload,callback:h.callback,next:null},_===null?(A=_=M,g=U):_=_.next=M,d|=E;if(h=h.next,h===null){if(h=a.shared.pending,h===null)break;M=h,h=M.next,M.next=null,a.lastBaseUpdate=M,a.shared.pending=null}}while(!0);_===null&&(g=U),a.baseState=g,a.firstBaseUpdate=A,a.lastBaseUpdate=_,i===null&&(a.shared.lanes=0),El|=d,e.lanes=d,e.memoizedState=U}}function yd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function vd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yd(n[e],t)}var Ra=Je(null),Ns=Je(0);function xd(e,t){e=ol,me(Ns,e),me(Ra,t),ol=e|t.baseLanes}function br(){me(Ns,ol),me(Ra,Ra.current)}function gr(){ol=Ns.current,Ge(Ra),Ge(Ns)}var cn=Je(null),Cn=null;function Cl(e){var t=e.alternate;me(xt,xt.current&1),me(cn,e),Cn===null&&(t===null||Ra.current!==null||t.memoizedState!==null)&&(Cn=e)}function yr(e){me(xt,xt.current),me(cn,e),Cn===null&&(Cn=e)}function Sd(e){e.tag===22?(me(xt,xt.current),me(cn,e),Cn===null&&(Cn=e)):Tl()}function Tl(){me(xt,xt.current),me(cn,cn.current)}function un(e){Ge(cn),Cn===e&&(Cn=null),Ge(xt)}var xt=Je(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Tc(n)||Nc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pn=0,Ae=null,et=null,Tt=null,Es=!1,Ma=!1,ta=!1,js=0,yi=0,za=null,Ab=0;function yt(){throw Error(c(321))}function vr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!on(e[n],t[n]))return!1;return!0}function xr(e,t,n,l,a,i){return Pn=i,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?af:Or,ta=!1,i=n(l,a),ta=!1,Ma&&(i=Cd(t,n,l,a)),wd(e),i}function wd(e){j.H=Si;var t=et!==null&&et.next!==null;if(Pn=0,Tt=et=Ae=null,Es=!1,yi=0,za=null,t)throw Error(c(300));e===null||Nt||(e=e.dependencies,e!==null&&ys(e)&&(Nt=!0))}function Cd(e,t,n,l){Ae=e;var a=0;do{if(Ma&&(za=null),yi=0,Ma=!1,25<=a)throw Error(c(301));if(a+=1,Tt=et=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}j.H=sf,i=t(n,l)}while(Ma);return i}function Eb(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?vi(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Sr(){var e=js!==0;return js=0,e}function wr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Cr(e){if(Es){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Es=!1}Pn=0,Tt=et=Ae=null,Ma=!1,yi=js=0,za=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ae.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function St(){if(et===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=Tt===null?Ae.memoizedState:Tt.next;if(t!==null)Tt=t,et=e;else{if(e===null)throw Ae.alternate===null?Error(c(467)):Error(c(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},Tt===null?Ae.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vi(e){var t=yi;return yi+=1,za===null&&(za=[]),e=md(za,e,t),t=Ae,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?af:Or),e}function Ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vi(e);if(e.$$typeof===I)return Bt(e)}throw Error(c(438,String(e)))}function Tr(e){var t=null,n=Ae.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ae.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Rs(),Ae.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=He;return t.index++,n}function el(e,t){return typeof t=="function"?t(e):t}function zs(e){var t=St();return Nr(t,et,e)}function Nr(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(i!==null){if(a!==null){var d=a.next;a.next=i.next,i.next=d}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var h=d=null,g=null,A=t,_=!1;do{var U=A.lane&-536870913;if(U!==A.lane?(Ye&U)===U:(Pn&U)===U){var E=A.revertLane;if(E===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),U===Na&&(_=!0);else if((Pn&E)===E){A=A.next,E===Na&&(_=!0);continue}else U={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},g===null?(h=g=U,d=i):g=g.next=U,Ae.lanes|=E,El|=E;U=A.action,ta&&n(i,U),i=A.hasEagerState?A.eagerState:n(i,U)}else E={lane:U,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},g===null?(h=g=E,d=i):g=g.next=E,Ae.lanes|=U,El|=U;A=A.next}while(A!==null&&A!==t);if(g===null?d=i:g.next=h,!on(i,e.memoizedState)&&(Nt=!0,_&&(n=Aa,n!==null)))throw n;e.memoizedState=i,e.baseState=d,e.baseQueue=g,l.lastRenderedState=i}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ar(e){var t=St(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do i=e(i,d.action),d=d.next;while(d!==a);on(i,t.memoizedState)||(Nt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function Td(e,t,n){var l=Ae,a=St(),i=Xe;if(i){if(n===void 0)throw Error(c(407));n=n()}else n=t();var d=!on((et||a).memoizedState,n);if(d&&(a.memoizedState=n,Nt=!0),a=a.queue,Rr(Ed.bind(null,l,a,e),[e]),a.getSnapshot!==t||d||Tt!==null&&Tt.memoizedState.tag&1){if(l.flags|=2048,_a(9,{destroy:void 0},Ad.bind(null,l,a,n,t),null),it===null)throw Error(c(349));i||(Pn&127)!==0||Nd(l,t,n)}return n}function Nd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ae.updateQueue,t===null?(t=Rs(),Ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ad(e,t,n,l){t.value=n,t.getSnapshot=l,jd(t)&&Rd(e)}function Ed(e,t,n){return n(function(){jd(t)&&Rd(e)})}function jd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!on(e,n)}catch{return!0}}function Rd(e){var t=Zl(e,2);t!==null&&nn(t,e,2)}function Er(e){var t=Zt();if(typeof e=="function"){var n=e;if(e=n(),ta){xe(!0);try{n()}finally{xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:e},t}function Md(e,t,n,l){return e.baseState=n,Nr(e,et,typeof l=="function"?l:el)}function jb(e,t,n,l,a){if(Ds(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};j.T!==null?n(!0):i.isTransition=!1,l(i),n=t.pending,n===null?(i.next=t.pending=i,zd(t,i)):(i.next=n.next,t.pending=n.next=i)}}function zd(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var i=j.T,d={};j.T=d;try{var h=n(a,l),g=j.S;g!==null&&g(d,h),_d(e,t,h)}catch(A){jr(e,t,A)}finally{i!==null&&d.types!==null&&(i.types=d.types),j.T=i}}else try{i=n(a,l),_d(e,t,i)}catch(A){jr(e,t,A)}}function _d(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){kd(e,t,l)},function(l){return jr(e,t,l)}):kd(e,t,n)}function kd(e,t,n){t.status="fulfilled",t.value=n,Dd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,zd(e,n)))}function jr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Dd(t),t=t.next;while(t!==l)}e.action=null}function Dd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Od(e,t){return t}function Ld(e,t){if(Xe){var n=it.formState;if(n!==null){e:{var l=Ae;if(Xe){if(rt){t:{for(var a=rt,i=wn;a.nodeType!==8;){if(!i){a=null;break t}if(a=Tn(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){rt=Tn(a.nextSibling),l=a.data==="F!";break e}}yl(l)}l=!1}l&&(t=n[0])}}return n=Zt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Od,lastRenderedState:t},n.queue=l,n=tf.bind(null,Ae,l),l.dispatch=n,l=Er(!1),i=Dr.bind(null,Ae,!1,l.queue),l=Zt(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=jb.bind(null,Ae,a,i,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function Ud(e){var t=St();return Bd(t,et,e)}function Bd(e,t,n){if(t=Nr(e,t,Od)[0],e=zs(el)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=vi(t)}catch(d){throw d===Ea?Ss:d}else l=t;t=St();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Ae.flags|=2048,_a(9,{destroy:void 0},Rb.bind(null,a,n),null)),[l,i,e]}function Rb(e,t){e.action=t}function Hd(e){var t=St(),n=et;if(n!==null)return Bd(t,n,e);St(),t=t.memoizedState,n=St();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function _a(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=Rs(),Ae.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Yd(){return St().memoizedState}function _s(e,t,n,l){var a=Zt();Ae.flags|=e,a.memoizedState=_a(1|t,{destroy:void 0},n,l===void 0?null:l)}function ks(e,t,n,l){var a=St();l=l===void 0?null:l;var i=a.memoizedState.inst;et!==null&&l!==null&&vr(l,et.memoizedState.deps)?a.memoizedState=_a(t,i,n,l):(Ae.flags|=e,a.memoizedState=_a(1|t,i,n,l))}function Kd(e,t){_s(8390656,8,e,t)}function Rr(e,t){ks(2048,8,e,t)}function Mb(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=Rs(),Ae.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gd(e){var t=St().memoizedState;return Mb({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function qd(e,t){return ks(4,2,e,t)}function Xd(e,t){return ks(4,4,e,t)}function Vd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Zd(e,t,n){n=n!=null?n.concat([e]):null,ks(4,4,Vd.bind(null,t,e),n)}function Mr(){}function Qd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&vr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Fd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&vr(t,l[1]))return l[0];if(l=e(),ta){xe(!0);try{e()}finally{xe(!1)}}return n.memoizedState=[l,t],l}function zr(e,t,n){return n===void 0||(Pn&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Wf(),Ae.lanes|=e,El|=e,n)}function Jd(e,t,n,l){return on(n,t)?n:Ra.current!==null?(e=zr(e,n,l),on(e,t)||(Nt=!0),e):(Pn&42)===0||(Pn&1073741824)!==0&&(Ye&261930)===0?(Nt=!0,e.memoizedState=n):(e=Wf(),Ae.lanes|=e,El|=e,t)}function Wd(e,t,n,l,a){var i=B.p;B.p=i!==0&&8>i?i:8;var d=j.T,h={};j.T=h,Dr(e,!1,t,n);try{var g=a(),A=j.S;if(A!==null&&A(h,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var _=Nb(g,l);xi(e,t,_,mn(e))}else xi(e,t,l,mn(e))}catch(U){xi(e,t,{then:function(){},status:"rejected",reason:U},mn())}finally{B.p=i,d!==null&&h.types!==null&&(d.types=h.types),j.T=d}}function zb(){}function _r(e,t,n,l){if(e.tag!==5)throw Error(c(476));var a=Id(e).queue;Wd(e,a,t,Z,n===null?zb:function(){return $d(e),n(l)})}function Id(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:Z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $d(e){var t=Id(e);t.next===null&&(t=e.alternate.memoizedState),xi(e,t.next.queue,{},mn())}function kr(){return Bt(Ui)}function Pd(){return St().memoizedState}function ef(){return St().memoizedState}function _b(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mn();e=Sl(n);var l=wl(t,e,n);l!==null&&(nn(l,t,n),pi(l,t,n)),t={cache:rr()},e.payload=t;return}t=t.return}}function kb(e,t,n){var l=mn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e)?nf(t,n):(n=Io(e,t,n,l),n!==null&&(nn(n,e,l),lf(n,t,l)))}function tf(e,t,n){var l=mn();xi(e,t,n,l)}function xi(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))nf(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,h=i(d,n);if(a.hasEagerState=!0,a.eagerState=h,on(h,d))return hs(e,t,a,0),it===null&&ms(),!1}catch{}finally{}if(n=Io(e,t,a,l),n!==null)return nn(n,e,l),lf(n,t,l),!0}return!1}function Dr(e,t,n,l){if(l={lane:2,revertLane:fc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(c(479))}else t=Io(e,n,l,2),t!==null&&nn(t,e,2)}function Ds(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function nf(e,t){Ma=Es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lf(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,an(e,n)}}var Si={readContext:Bt,use:Ms,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Si.useEffectEvent=yt;var af={readContext:Bt,use:Ms,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Kd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,_s(4194308,4,Vd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var n=Zt();t=t===void 0?null:t;var l=e();if(ta){xe(!0);try{e()}finally{xe(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Zt();if(n!==void 0){var a=n(t);if(ta){xe(!0);try{n(t)}finally{xe(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=kb.bind(null,Ae,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Er(e);var t=e.queue,n=tf.bind(null,Ae,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Mr,useDeferredValue:function(e,t){var n=Zt();return zr(n,e,t)},useTransition:function(){var e=Er(!1);return e=Wd.bind(null,Ae,e.queue,!0,!1),Zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ae,a=Zt();if(Xe){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),it===null)throw Error(c(349));(Ye&127)!==0||Nd(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Kd(Ed.bind(null,l,i,e),[e]),l.flags|=2048,_a(9,{destroy:void 0},Ad.bind(null,l,i,n,t),null),n},useId:function(){var e=Zt(),t=it.identifierPrefix;if(Xe){var n=Yn,l=Hn;n=(l&~(1<<32-Re(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=js++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ab++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kr,useFormState:Ld,useActionState:Ld,useOptimistic:function(e){var t=Zt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Dr.bind(null,Ae,!0,n),n.dispatch=t,[e,t]},useMemoCache:Tr,useCacheRefresh:function(){return Zt().memoizedState=_b.bind(null,Ae)},useEffectEvent:function(e){var t=Zt(),n={impl:e};return t.memoizedState=n,function(){if((Qe&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Or={readContext:Bt,use:Ms,useCallback:Qd,useContext:Bt,useEffect:Rr,useImperativeHandle:Zd,useInsertionEffect:qd,useLayoutEffect:Xd,useMemo:Fd,useReducer:zs,useRef:Yd,useState:function(){return zs(el)},useDebugValue:Mr,useDeferredValue:function(e,t){var n=St();return Jd(n,et.memoizedState,e,t)},useTransition:function(){var e=zs(el)[0],t=St().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:Td,useId:Pd,useHostTransitionStatus:kr,useFormState:Ud,useActionState:Ud,useOptimistic:function(e,t){var n=St();return Md(n,et,e,t)},useMemoCache:Tr,useCacheRefresh:ef};Or.useEffectEvent=Gd;var sf={readContext:Bt,use:Ms,useCallback:Qd,useContext:Bt,useEffect:Rr,useImperativeHandle:Zd,useInsertionEffect:qd,useLayoutEffect:Xd,useMemo:Fd,useReducer:Ar,useRef:Yd,useState:function(){return Ar(el)},useDebugValue:Mr,useDeferredValue:function(e,t){var n=St();return et===null?zr(n,e,t):Jd(n,et.memoizedState,e,t)},useTransition:function(){var e=Ar(el)[0],t=St().memoizedState;return[typeof e=="boolean"?e:vi(e),t]},useSyncExternalStore:Td,useId:Pd,useHostTransitionStatus:kr,useFormState:Hd,useActionState:Hd,useOptimistic:function(e,t){var n=St();return et!==null?Md(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Tr,useCacheRefresh:ef};sf.useEffectEvent=Gd;function Lr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ur={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=mn(),a=Sl(l);a.payload=t,n!=null&&(a.callback=n),t=wl(e,a,l),t!==null&&(nn(t,e,l),pi(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=mn(),a=Sl(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=wl(e,a,l),t!==null&&(nn(t,e,l),pi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mn(),l=Sl(n);l.tag=2,t!=null&&(l.callback=t),t=wl(e,l,n),t!==null&&(nn(t,e,n),pi(t,e,n))}};function of(e,t,n,l,a,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!oi(n,l)||!oi(a,i):!0}function rf(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Ur.enqueueReplaceState(t,t.state,null)}function na(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=T({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function cf(e){fs(e)}function uf(e){console.error(e)}function df(e){fs(e)}function Os(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ff(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Br(e,t,n){return n=Sl(n),n.tag=3,n.payload={element:null},n.callback=function(){Os(e,t)},n}function mf(e){return e=Sl(e),e.tag=3,e}function hf(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=l.value;e.payload=function(){return a(i)},e.callback=function(){ff(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){ff(t,n,l),typeof a!="function"&&(jl===null?jl=new Set([this]):jl.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function Db(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Ta(t,n,a,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return Cn===null?Qs():n.alternate===null&&vt===0&&(vt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===ws?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),cc(e,l,a)),!1;case 22:return n.flags|=65536,l===ws?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),cc(e,l,a)),!1}throw Error(c(435,n.tag))}return cc(e,l,a),Qs(),!1}if(Xe)return t=cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==lr&&(e=Error(c(422),{cause:l}),ui(vn(e,n)))):(l!==lr&&(t=Error(c(423),{cause:l}),ui(vn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=vn(l,n),a=Br(e.stateNode,l,a),hr(e,a),vt!==4&&(vt=2)),!1;var i=Error(c(520),{cause:l});if(i=vn(i,n),Ri===null?Ri=[i]:Ri.push(i),vt!==4&&(vt=2),t===null)return!0;l=vn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Br(n.stateNode,l,e),hr(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(jl===null||!jl.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=mf(a),hf(a,e,n,l),hr(n,a),!1}n=n.return}while(n!==null);return!1}var Hr=Error(c(461)),Nt=!1;function Ht(e,t,n,l){t.child=e===null?gd(t,null,n,l):ea(t,e.child,n,l)}function pf(e,t,n,l,a){n=n.render;var i=t.ref;if("ref"in l){var d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}else d=l;return Wl(t),l=xr(e,t,n,d,i,a),h=Sr(),e!==null&&!Nt?(wr(e,t,a),tl(e,t,a)):(Xe&&h&&tr(t),t.flags|=1,Ht(e,t,l,a),t.child)}function bf(e,t,n,l,a){if(e===null){var i=n.type;return typeof i=="function"&&!$o(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,gf(e,t,i,l,a)):(e=bs(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Qr(e,a)){var d=i.memoizedProps;if(n=n.compare,n=n!==null?n:oi,n(d,l)&&e.ref===t.ref)return tl(e,t,a)}return t.flags|=1,e=Jn(i,l),e.ref=t.ref,e.return=t,t.child=e}function gf(e,t,n,l,a){if(e!==null){var i=e.memoizedProps;if(oi(i,l)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=l=i,Qr(e,a))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,tl(e,t,a)}return Yr(e,t,n,l,a)}function yf(e,t,n,l){var a=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~i}else l=0,t.child=null;return vf(e,t,i,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xs(t,i!==null?i.cachePool:null),i!==null?xd(t,i):br(),Sd(t);else return l=t.lanes=536870912,vf(e,t,i!==null?i.baseLanes|n:n,n,l)}else i!==null?(xs(t,i.cachePool),xd(t,i),Tl(),t.memoizedState=null):(e!==null&&xs(t,null),br(),Tl());return Ht(e,t,a,n),t.child}function wi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function vf(e,t,n,l,a){var i=ur();return i=i===null?null:{parent:Ct._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&xs(t,null),br(),Sd(t),e!==null&&Ta(e,t,l,!0),t.childLanes=a,null}function Ls(e,t){return t=Bs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xf(e,t,n){return ea(t,e.child,null,n),e=Ls(t,t.pendingProps),e.flags|=2,un(t),t.memoizedState=null,e}function Ob(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(l.mode==="hidden")return e=Ls(t,l),t.lanes=536870912,wi(null,e);if(yr(t),(e=rt)?(e=_m(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bl!==null?{id:Hn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Ut=t,rt=null)):e=null,e===null)throw yl(t);return t.lanes=536870912,null}return Ls(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(yr(t),a)if(t.flags&256)t.flags&=-257,t=xf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Nt||Ta(e,t,n,!1),a=(n&e.childLanes)!==0,Nt||a){if(l=it,l!==null&&(d=Gt(l,n),d!==0&&d!==i.retryLane))throw i.retryLane=d,Zl(e,d),nn(l,e,d),Hr;Qs(),t=xf(e,t,n)}else e=i.treeContext,rt=Tn(d.nextSibling),Ut=t,Xe=!0,gl=null,wn=!1,e!==null&&id(t,e),t=Ls(t,l),t.flags|=4096;return t}return e=Jn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Us(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Yr(e,t,n,l,a){return Wl(t),n=xr(e,t,n,l,void 0,a),l=Sr(),e!==null&&!Nt?(wr(e,t,a),tl(e,t,a)):(Xe&&l&&tr(t),t.flags|=1,Ht(e,t,n,a),t.child)}function Sf(e,t,n,l,a,i){return Wl(t),t.updateQueue=null,n=Cd(t,l,n,a),wd(e),l=Sr(),e!==null&&!Nt?(wr(e,t,i),tl(e,t,i)):(Xe&&l&&tr(t),t.flags|=1,Ht(e,t,n,i),t.child)}function wf(e,t,n,l,a){if(Wl(t),t.stateNode===null){var i=xa,d=n.contextType;typeof d=="object"&&d!==null&&(i=Bt(d)),i=new n(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ur,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},fr(t),d=n.contextType,i.context=typeof d=="object"&&d!==null?Bt(d):xa,i.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Lr(t,n,d,l),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Ur.enqueueReplaceState(i,i.state,null),gi(t,l,i,a),bi(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var h=t.memoizedProps,g=na(n,h);i.props=g;var A=i.context,_=n.contextType;d=xa,typeof _=="object"&&_!==null&&(d=Bt(_));var U=n.getDerivedStateFromProps;_=typeof U=="function"||typeof i.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,_||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(h||A!==d)&&rf(t,i,l,d),xl=!1;var E=t.memoizedState;i.state=E,gi(t,l,i,a),bi(),A=t.memoizedState,h||E!==A||xl?(typeof U=="function"&&(Lr(t,n,U,l),A=t.memoizedState),(g=xl||of(t,n,g,l,E,A,d))?(_||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=A),i.props=l,i.state=A,i.context=d,l=g):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,mr(e,t),d=t.memoizedProps,_=na(n,d),i.props=_,U=t.pendingProps,E=i.context,A=n.contextType,g=xa,typeof A=="object"&&A!==null&&(g=Bt(A)),h=n.getDerivedStateFromProps,(A=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==U||E!==g)&&rf(t,i,l,g),xl=!1,E=t.memoizedState,i.state=E,gi(t,l,i,a),bi();var M=t.memoizedState;d!==U||E!==M||xl||e!==null&&e.dependencies!==null&&ys(e.dependencies)?(typeof h=="function"&&(Lr(t,n,h,l),M=t.memoizedState),(_=xl||of(t,n,_,l,E,M,g)||e!==null&&e.dependencies!==null&&ys(e.dependencies))?(A||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,M,g),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,M,g)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=M),i.props=l,i.state=M,i.context=g,l=_):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Us(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=ea(t,e.child,null,a),t.child=ea(t,null,n,a)):Ht(e,t,n,a),t.memoizedState=i.state,e=t.child):e=tl(e,t,a),e}function Cf(e,t,n,l){return Fl(),t.flags|=256,Ht(e,t,n,l),t.child}var Kr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gr(e){return{baseLanes:e,cachePool:dd()}}function qr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=fn),e}function Tf(e,t,n){var l=t.pendingProps,a=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(a?Cl(t):Tl(),(e=rt)?(e=_m(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bl!==null?{id:Hn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Ut=t,rt=null)):e=null,e===null)throw yl(t);return Nc(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,a?(Tl(),a=t.mode,h=Bs({mode:"hidden",children:h},a),l=Ql(l,a,n,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=Gr(n),l.childLanes=qr(e,d,n),t.memoizedState=Kr,wi(null,l)):(Cl(t),Xr(t,h))}var g=e.memoizedState;if(g!==null&&(h=g.dehydrated,h!==null)){if(i)t.flags&256?(Cl(t),t.flags&=-257,t=Vr(e,t,n)):t.memoizedState!==null?(Tl(),t.child=e.child,t.flags|=128,t=null):(Tl(),h=l.fallback,a=t.mode,l=Bs({mode:"visible",children:l.children},a),h=Ql(h,a,n,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,ea(t,e.child,null,n),l=t.child,l.memoizedState=Gr(n),l.childLanes=qr(e,d,n),t.memoizedState=Kr,t=wi(null,l));else if(Cl(t),Nc(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var A=d.dgst;d=A,l=Error(c(419)),l.stack="",l.digest=d,ui({value:l,source:null,stack:null}),t=Vr(e,t,n)}else if(Nt||Ta(e,t,n,!1),d=(n&e.childLanes)!==0,Nt||d){if(d=it,d!==null&&(l=Gt(d,n),l!==0&&l!==g.retryLane))throw g.retryLane=l,Zl(e,l),nn(d,e,l),Hr;Tc(h)||Qs(),t=Vr(e,t,n)}else Tc(h)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,rt=Tn(h.nextSibling),Ut=t,Xe=!0,gl=null,wn=!1,e!==null&&id(t,e),t=Xr(t,l.children),t.flags|=4096);return t}return a?(Tl(),h=l.fallback,a=t.mode,g=e.child,A=g.sibling,l=Jn(g,{mode:"hidden",children:l.children}),l.subtreeFlags=g.subtreeFlags&65011712,A!==null?h=Jn(A,h):(h=Ql(h,a,n,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,wi(null,l),l=t.child,h=e.child.memoizedState,h===null?h=Gr(n):(a=h.cachePool,a!==null?(g=Ct._currentValue,a=a.parent!==g?{parent:g,pool:g}:a):a=dd(),h={baseLanes:h.baseLanes|n,cachePool:a}),l.memoizedState=h,l.childLanes=qr(e,d,n),t.memoizedState=Kr,wi(e.child,l)):(Cl(t),n=e.child,e=n.sibling,n=Jn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function Xr(e,t){return t=Bs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bs(e,t){return e=rn(22,e,null,t),e.lanes=0,e}function Vr(e,t,n){return ea(t,e.child,null,n),e=Xr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),sr(e.return,t,n)}function Zr(e,t,n,l,a,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=i)}function Af(e,t,n){var l=t.pendingProps,a=l.revealOrder,i=l.tail;l=l.children;var d=xt.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,me(xt,d),Ht(e,t,l,n),l=Xe?ci:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nf(e,n,t);else if(e.tag===19)Nf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&As(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Zr(t,!1,a,n,i,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&As(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Zr(t,!0,n,null,i,l);break;case"together":Zr(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),El|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Jn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Jn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ys(e)))}function Lb(e,t,n){switch(t.tag){case 3:zt(t,t.stateNode.containerInfo),vl(t,Ct,e.memoizedState.cache),Fl();break;case 27:case 5:ut(t);break;case 4:zt(t,t.stateNode.containerInfo);break;case 10:vl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Cl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Tf(e,t,n):(Cl(t),e=tl(e,t,n),e!==null?e.sibling:null);Cl(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Ta(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Af(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),me(xt,xt.current),l)break;return null;case 22:return t.lanes=0,yf(e,t,n,t.pendingProps);case 24:vl(t,Ct,e.memoizedState.cache)}return tl(e,t,n)}function Ef(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!Qr(e,n)&&(t.flags&128)===0)return Nt=!1,Lb(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Xe&&(t.flags&1048576)!==0&&ad(t,ci,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=$l(t.elementType),t.type=e,typeof e=="function")$o(e)?(l=na(e,l),t.tag=1,t=wf(null,t,e,l,n)):(t.tag=0,t=Yr(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=pf(null,t,e,l,n);break e}else if(a===Y){t.tag=14,t=bf(null,t,e,l,n);break e}}throw t=ce(e)||e,Error(c(306,t,""))}}return t;case 0:return Yr(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=na(l,t.pendingProps),wf(e,t,l,a,n);case 3:e:{if(zt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,mr(e,t),gi(t,l,null,n);var d=t.memoizedState;if(l=d.cache,vl(t,Ct,l),l!==i.cache&&or(t,[Ct],n,!0),bi(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Cf(e,t,l,n);break e}else if(l!==a){a=vn(Error(c(424)),t),ui(a),t=Cf(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(rt=Tn(e.firstChild),Ut=t,Xe=!0,gl=null,wn=!0,n=gd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fl(),l===a){t=tl(e,t,n);break e}Ht(e,t,l,n)}t=t.child}return t;case 26:return Us(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Xe||(n=t.type,e=t.pendingProps,l=eo(Ne.current).createElement(n),l[ot]=t,l[gt]=e,Yt(l,n,e),Dt(l),t.stateNode=l):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ut(t),e===null&&Xe&&(l=t.stateNode=Om(t.type,t.pendingProps,Ne.current),Ut=t,wn=!0,a=rt,_l(t.type)?(Ac=a,rt=Tn(l.firstChild)):rt=a),Ht(e,t,t.pendingProps.children,n),Us(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((a=l=rt)&&(l=fg(l,t.type,t.pendingProps,wn),l!==null?(t.stateNode=l,Ut=t,rt=Tn(l.firstChild),wn=!1,a=!0):a=!1),a||yl(t)),ut(t),a=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,Sc(a,i)?l=null:d!==null&&Sc(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=xr(e,t,Eb,null,null,n),Ui._currentValue=a),Us(e,t),Ht(e,t,l,n),t.child;case 6:return e===null&&Xe&&((e=n=rt)&&(n=mg(n,t.pendingProps,wn),n!==null?(t.stateNode=n,Ut=t,rt=null,e=!0):e=!1),e||yl(t)),null;case 13:return Tf(e,t,n);case 4:return zt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ea(t,null,l,n):Ht(e,t,l,n),t.child;case 11:return pf(e,t,t.type,t.pendingProps,n);case 7:return Ht(e,t,t.pendingProps,n),t.child;case 8:return Ht(e,t,t.pendingProps.children,n),t.child;case 12:return Ht(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vl(t,t.type,l.value),Ht(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Wl(t),a=Bt(a),l=l(a),t.flags|=1,Ht(e,t,l,n),t.child;case 14:return bf(e,t,t.type,t.pendingProps,n);case 15:return gf(e,t,t.type,t.pendingProps,n);case 19:return Af(e,t,n);case 31:return Ob(e,t,n);case 22:return yf(e,t,n,t.pendingProps);case 24:return Wl(t),l=Bt(Ct),e===null?(a=ur(),a===null&&(a=it,i=rr(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},fr(t),vl(t,Ct,a)):((e.lanes&n)!==0&&(mr(e,t),gi(t,null,null,n),bi()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),vl(t,Ct,l)):(l=i.cache,vl(t,Ct,l),l!==a.cache&&or(t,[Ct],n,!0))),Ht(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function nl(e){e.flags|=4}function Fr(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(em())e.flags|=8192;else throw Pl=ws,dr}else e.flags&=-16777217}function jf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!qm(t))if(em())e.flags|=8192;else throw Pl=ws,dr}function Hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qe():536870912,e.lanes|=t,La|=t)}function Ci(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Ub(e,t,n){var l=t.pendingProps;switch(nr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return ct(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),$n(Ct),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ca(t)?nl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ar())),ct(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(nl(t),i!==null?(ct(t),jf(t,i)):(ct(t),Fr(t,a,null,l,n))):i?i!==e.memoizedState?(nl(t),ct(t),jf(t,i)):(ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&nl(t),ct(t),Fr(t,a,e,l,n)),null;case 27:if(ht(t),n=Ne.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return ct(t),null}e=ve.current,Ca(t)?sd(t):(e=Om(a,l,n),t.stateNode=e,nl(t))}return ct(t),null;case 5:if(ht(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return ct(t),null}if(i=ve.current,Ca(t))sd(t);else{var d=eo(Ne.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}i[ot]=t,i[gt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(Yt(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&nl(t)}}return ct(t),Fr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&nl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ne.current,Ca(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ut,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Tm(e.nodeValue,n)),e||yl(t,!0)}else e=eo(e).createTextNode(l),e[ot]=t,t.stateNode=e}return ct(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ca(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[ot]=t}else Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),e=!1}else n=ar(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(un(t),t):(un(t),null);if((t.flags&128)!==0)throw Error(c(558))}return ct(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ca(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(c(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[ot]=t}else Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),a=!1}else a=ar(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(un(t),t):(un(t),null)}return un(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hs(t,t.updateQueue),ct(t),null);case 4:return De(),e===null&&bc(t.stateNode.containerInfo),ct(t),null;case 10:return $n(t.type),ct(t),null;case 19:if(Ge(xt),l=t.memoizedState,l===null)return ct(t),null;if(a=(t.flags&128)!==0,i=l.rendering,i===null)if(a)Ci(l,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=As(e),i!==null){for(t.flags|=128,Ci(l,!1),e=i.updateQueue,t.updateQueue=e,Hs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)td(n,e),n=n.sibling;return me(xt,xt.current&1|2),Xe&&Wn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&P()>Xs&&(t.flags|=128,a=!0,Ci(l,!1),t.lanes=4194304)}else{if(!a)if(e=As(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hs(t,e),Ci(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Xe)return ct(t),null}else 2*P()-l.renderingStartTime>Xs&&n!==536870912&&(t.flags|=128,a=!0,Ci(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=P(),e.sibling=null,n=xt.current,me(xt,a?n&1|2:n&1),Xe&&Wn(t,l.treeForkCount),e):(ct(t),null);case 22:case 23:return un(t),gr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),n=t.updateQueue,n!==null&&Hs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ge(Il),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),$n(Ct),ct(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Bb(e,t){switch(nr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $n(Ct),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ht(t),null;case 31:if(t.memoizedState!==null){if(un(t),t.alternate===null)throw Error(c(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(un(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(xt),null;case 4:return De(),null;case 10:return $n(t.type),null;case 22:case 23:return un(t),gr(),e!==null&&Ge(Il),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $n(Ct),null;case 25:return null;default:return null}}function Rf(e,t){switch(nr(t),t.tag){case 3:$n(Ct),De();break;case 26:case 27:case 5:ht(t);break;case 4:De();break;case 31:t.memoizedState!==null&&un(t);break;case 13:un(t);break;case 19:Ge(xt);break;case 10:$n(t.type);break;case 22:case 23:un(t),gr(),e!==null&&Ge(Il);break;case 24:$n(Ct)}}function Ti(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var i=n.create,d=n.inst;l=i(),d.destroy=l}n=n.next}while(n!==a)}}catch(h){Ie(t,t.return,h)}}function Nl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var i=a.next;l=i;do{if((l.tag&e)===e){var d=l.inst,h=d.destroy;if(h!==void 0){d.destroy=void 0,a=t;var g=n,A=h;try{A()}catch(_){Ie(a,g,_)}}}l=l.next}while(l!==i)}}catch(_){Ie(t,t.return,_)}}function Mf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vd(t,n)}catch(l){Ie(e,e.return,l)}}}function zf(e,t,n){n.props=na(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ie(e,t,l)}}function Ni(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){Ie(e,t,a)}}function Kn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){Ie(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){Ie(e,t,a)}else n.current=null}function _f(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){Ie(e,e.return,a)}}function Jr(e,t,n){try{var l=e.stateNode;sg(l,e.type,n,t),l[gt]=t}catch(a){Ie(e,e.return,a)}}function kf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_l(e.type)||e.tag===4}function Wr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_l(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ir(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qn));else if(l!==4&&(l===27&&_l(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ir(e,t,n),e=e.sibling;e!==null;)Ir(e,t,n),e=e.sibling}function Ys(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&_l(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ys(e,t,n),e=e.sibling;e!==null;)Ys(e,t,n),e=e.sibling}function Df(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Yt(t,l,n),t[ot]=e,t[gt]=n}catch(i){Ie(e,e.return,i)}}var ll=!1,At=!1,$r=!1,Of=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Hb(e,t){if(e=e.containerInfo,vc=oo,e=Zu(e),Vo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var d=0,h=-1,g=-1,A=0,_=0,U=e,E=null;t:for(;;){for(var M;U!==n||a!==0&&U.nodeType!==3||(h=d+a),U!==i||l!==0&&U.nodeType!==3||(g=d+l),U.nodeType===3&&(d+=U.nodeValue.length),(M=U.firstChild)!==null;)E=U,U=M;for(;;){if(U===e)break t;if(E===n&&++A===a&&(h=d),E===i&&++_===l&&(g=d),(M=U.nextSibling)!==null)break;U=E,E=U.parentNode}U=M}n=h===-1||g===-1?null:{start:h,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(xc={focusedElem:e,selectionRange:n},oo=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var le=na(n.type,a);e=l.getSnapshotBeforeUpdate(le,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Ie(n,n.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Cc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Cc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Lf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:il(e,n),l&4&&Ti(5,n);break;case 1:if(il(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Ie(n,n.return,d)}else{var a=na(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ie(n,n.return,d)}}l&64&&Mf(n),l&512&&Ni(n,n.return);break;case 3:if(il(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{vd(e,t)}catch(d){Ie(n,n.return,d)}}break;case 27:t===null&&l&4&&Df(n);case 26:case 5:il(e,n),t===null&&l&4&&_f(n),l&512&&Ni(n,n.return);break;case 12:il(e,n);break;case 31:il(e,n),l&4&&Hf(e,n);break;case 13:il(e,n),l&4&&Yf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Fb.bind(null,n),hg(e,n))));break;case 22:if(l=n.memoizedState!==null||ll,!l){t=t!==null&&t.memoizedState!==null||At,a=ll;var i=At;ll=l,(At=t)&&!i?sl(e,n,(n.subtreeFlags&8772)!==0):il(e,n),ll=a,At=i}break;case 30:break;default:il(e,n)}}function Uf(e){var t=e.alternate;t!==null&&(e.alternate=null,Uf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$a(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,$t=!1;function al(e,t,n){for(n=n.child;n!==null;)Bf(e,t,n),n=n.sibling}function Bf(e,t,n){if(W&&typeof W.onCommitFiberUnmount=="function")try{W.onCommitFiberUnmount(J,n)}catch{}switch(n.tag){case 26:At||Kn(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||Kn(n,t);var l=ft,a=$t;_l(n.type)&&(ft=n.stateNode,$t=!1),al(e,t,n),Di(n.stateNode),ft=l,$t=a;break;case 5:At||Kn(n,t);case 6:if(l=ft,a=$t,ft=null,al(e,t,n),ft=l,$t=a,ft!==null)if($t)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(i){Ie(n,t,i)}else try{ft.removeChild(n.stateNode)}catch(i){Ie(n,t,i)}break;case 18:ft!==null&&($t?(e=ft,Mm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Xa(e)):Mm(ft,n.stateNode));break;case 4:l=ft,a=$t,ft=n.stateNode.containerInfo,$t=!0,al(e,t,n),ft=l,$t=a;break;case 0:case 11:case 14:case 15:Nl(2,n,t),At||Nl(4,n,t),al(e,t,n);break;case 1:At||(Kn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&zf(n,t,l)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:At=(l=At)||n.memoizedState!==null,al(e,t,n),At=l;break;default:al(e,t,n)}}function Hf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xa(e)}catch(n){Ie(t,t.return,n)}}}function Yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xa(e)}catch(n){Ie(t,t.return,n)}}function Yb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Of),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Of),t;default:throw Error(c(435,e.tag))}}function Ks(e,t){var n=Yb(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=Jb.bind(null,e,l);l.then(a,a)}})}function Pt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],i=e,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(_l(h.type)){ft=h.stateNode,$t=!1;break e}break;case 5:ft=h.stateNode,$t=!1;break e;case 3:case 4:ft=h.stateNode.containerInfo,$t=!0;break e}h=h.return}if(ft===null)throw Error(c(160));Bf(i,d,a),ft=null,$t=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Kf(t,e),t=t.sibling}var zn=null;function Kf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(Nl(3,e,e.return),Ti(3,e),Nl(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(At||n===null||Kn(n,n.return)),l&64&&ll&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=zn;if(Pt(t,e),en(e),l&512&&(At||n===null||Kn(n,n.return)),l&4){var i=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Kl]||i[ot]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),Yt(i,l,n),i[ot]=e,Dt(i),l=i;break e;case"link":var d=Km("link","href",a).get(l+(n.href||""));if(d){for(var h=0;h<d.length;h++)if(i=d[h],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(h,1);break t}}i=a.createElement(l),Yt(i,l,n),a.head.appendChild(i);break;case"meta":if(d=Km("meta","content",a).get(l+(n.content||""))){for(h=0;h<d.length;h++)if(i=d[h],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(h,1);break t}}i=a.createElement(l),Yt(i,l,n),a.head.appendChild(i);break;default:throw Error(c(468,l))}i[ot]=e,Dt(i),l=i}e.stateNode=l}else Gm(a,e.type,e.stateNode);else e.stateNode=Ym(a,l,e.memoizedProps);else i!==l?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,l===null?Gm(a,e.type,e.stateNode):Ym(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Jr(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(At||n===null||Kn(n,n.return)),n!==null&&l&4&&Jr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(At||n===null||Kn(n,n.return)),e.flags&32){a=e.stateNode;try{ma(a,"")}catch(le){Ie(e,e.return,le)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Jr(e,a,n!==null?n.memoizedProps:a)),l&1024&&($r=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(le){Ie(e,e.return,le)}}break;case 3:if(lo=null,a=zn,zn=to(t.containerInfo),Pt(t,e),zn=a,en(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Xa(t.containerInfo)}catch(le){Ie(e,e.return,le)}$r&&($r=!1,Gf(e));break;case 4:l=zn,zn=to(e.stateNode.containerInfo),Pt(t,e),en(e),zn=l;break;case 12:Pt(t,e),en(e);break;case 31:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qs=P()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));break;case 22:a=e.memoizedState!==null;var g=n!==null&&n.memoizedState!==null,A=ll,_=At;if(ll=A||a,At=_||g,Pt(t,e),At=_,ll=A,en(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||g||ll||At||la(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){g=n=t;try{if(i=g.stateNode,a)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=g.stateNode;var U=g.memoizedProps.style,E=U!=null&&U.hasOwnProperty("display")?U.display:null;h.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(le){Ie(g,g.return,le)}}}else if(t.tag===6){if(n===null){g=t;try{g.stateNode.nodeValue=a?"":g.memoizedProps}catch(le){Ie(g,g.return,le)}}}else if(t.tag===18){if(n===null){g=t;try{var M=g.stateNode;a?zm(M,!0):zm(g.stateNode,!1)}catch(le){Ie(g,g.return,le)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Ks(e,n))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(kf(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var a=n.stateNode,i=Wr(e);Ys(e,i,a);break;case 5:var d=n.stateNode;n.flags&32&&(ma(d,""),n.flags&=-33);var h=Wr(e);Ys(e,h,d);break;case 3:case 4:var g=n.stateNode.containerInfo,A=Wr(e);Ir(e,A,g);break;default:throw Error(c(161))}}catch(_){Ie(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function il(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Lf(e,t.alternate,t),t=t.sibling}function la(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nl(4,t,t.return),la(t);break;case 1:Kn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&zf(t,t.return,n),la(t);break;case 27:Di(t.stateNode);case 26:case 5:Kn(t,t.return),la(t);break;case 22:t.memoizedState===null&&la(t);break;case 30:la(t);break;default:la(t)}e=e.sibling}}function sl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:sl(a,i,n),Ti(4,i);break;case 1:if(sl(a,i,n),l=i,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(A){Ie(l,l.return,A)}if(l=i,a=l.updateQueue,a!==null){var h=l.stateNode;try{var g=a.shared.hiddenCallbacks;if(g!==null)for(a.shared.hiddenCallbacks=null,a=0;a<g.length;a++)yd(g[a],h)}catch(A){Ie(l,l.return,A)}}n&&d&64&&Mf(i),Ni(i,i.return);break;case 27:Df(i);case 26:case 5:sl(a,i,n),n&&l===null&&d&4&&_f(i),Ni(i,i.return);break;case 12:sl(a,i,n);break;case 31:sl(a,i,n),n&&d&4&&Hf(a,i);break;case 13:sl(a,i,n),n&&d&4&&Yf(a,i);break;case 22:i.memoizedState===null&&sl(a,i,n),Ni(i,i.return);break;case 30:break;default:sl(a,i,n)}t=t.sibling}}function Pr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&di(n))}function ec(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e))}function _n(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qf(e,t,n,l),t=t.sibling}function qf(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:_n(e,t,n,l),a&2048&&Ti(9,t);break;case 1:_n(e,t,n,l);break;case 3:_n(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e)));break;case 12:if(a&2048){_n(e,t,n,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,h=i.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){Ie(t,t.return,g)}}else _n(e,t,n,l);break;case 31:_n(e,t,n,l);break;case 13:_n(e,t,n,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?_n(e,t,n,l):Ai(e,t):i._visibility&2?_n(e,t,n,l):(i._visibility|=2,ka(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Pr(d,t);break;case 24:_n(e,t,n,l),a&2048&&ec(t.alternate,t);break;default:_n(e,t,n,l)}}function ka(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,h=n,g=l,A=d.flags;switch(d.tag){case 0:case 11:case 15:ka(i,d,h,g,a),Ti(8,d);break;case 23:break;case 22:var _=d.stateNode;d.memoizedState!==null?_._visibility&2?ka(i,d,h,g,a):Ai(i,d):(_._visibility|=2,ka(i,d,h,g,a)),a&&A&2048&&Pr(d.alternate,d);break;case 24:ka(i,d,h,g,a),a&&A&2048&&ec(d.alternate,d);break;default:ka(i,d,h,g,a)}t=t.sibling}}function Ai(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Ai(n,l),a&2048&&Pr(l.alternate,l);break;case 24:Ai(n,l),a&2048&&ec(l.alternate,l);break;default:Ai(n,l)}t=t.sibling}}var Ei=8192;function Da(e,t,n){if(e.subtreeFlags&Ei)for(e=e.child;e!==null;)Xf(e,t,n),e=e.sibling}function Xf(e,t,n){switch(e.tag){case 26:Da(e,t,n),e.flags&Ei&&e.memoizedState!==null&&Ag(n,zn,e.memoizedState,e.memoizedProps);break;case 5:Da(e,t,n);break;case 3:case 4:var l=zn;zn=to(e.stateNode.containerInfo),Da(e,t,n),zn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ei,Ei=16777216,Da(e,t,n),Ei=l):Da(e,t,n));break;default:Da(e,t,n)}}function Vf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ji(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ot=l,Qf(l,e)}Vf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zf(e),e=e.sibling}function Zf(e){switch(e.tag){case 0:case 11:case 15:ji(e),e.flags&2048&&Nl(9,e,e.return);break;case 3:ji(e);break;case 12:ji(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gs(e)):ji(e);break;default:ji(e)}}function Gs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Ot=l,Qf(l,e)}Vf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nl(8,t,t.return),Gs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gs(t));break;default:Gs(t)}e=e.sibling}}function Qf(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:Nl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:di(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ot=l;else e:for(n=e;Ot!==null;){l=Ot;var a=l.sibling,i=l.return;if(Uf(l),l===n){Ot=null;break e}if(a!==null){a.return=i,Ot=a;break e}Ot=i}}}var Kb={getCacheForType:function(e){var t=Bt(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Bt(Ct).controller.signal}},Gb=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Le=null,Ye=0,We=0,dn=null,Al=!1,Oa=!1,tc=!1,ol=0,vt=0,El=0,aa=0,nc=0,fn=0,La=0,Ri=null,tn=null,lc=!1,qs=0,Ff=0,Xs=1/0,Vs=null,jl=null,Rt=0,Rl=null,Ua=null,rl=0,ac=0,ic=null,Jf=null,Mi=0,sc=null;function mn(){return(Qe&2)!==0&&Ye!==0?Ye&-Ye:j.T!==null?fc():re()}function Wf(){if(fn===0)if((Ye&536870912)===0||Xe){var e=Jt;Jt<<=1,(Jt&3932160)===0&&(Jt=262144),fn=e}else fn=536870912;return e=cn.current,e!==null&&(e.flags|=32),fn}function nn(e,t,n){(e===it&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Ba(e,0),Ml(e,Ye,fn,!1)),st(e,n),((Qe&2)===0||e!==it)&&(e===it&&((Qe&2)===0&&(aa|=n),vt===4&&Ml(e,Ye,fn,!1)),Gn(e))}function If(e,t,n){if((Qe&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||he(e,t),a=l?Vb(e,t):rc(e,t,!0),i=l;do{if(a===0){Oa&&!l&&Ml(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!qb(n)){a=rc(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;a=Ri;var g=h.current.memoizedState.isDehydrated;if(g&&(Ba(h,d).flags|=256),d=rc(h,d,!1),d!==2){if(tc&&!g){h.errorRecoveryDisabledLanes|=i,aa|=i,a=4;break e}i=tn,tn=a,i!==null&&(tn===null?tn=i:tn.push.apply(tn,i))}a=d}if(i=!1,a!==2)continue}}if(a===1){Ba(e,0),Ml(e,t,0,!0);break}e:{switch(l=e,i=a,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ml(l,t,fn,!Al);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(a=qs+300-P(),10<a)){if(Ml(l,t,fn,!Al),te(l,0,!0)!==0)break e;rl=t,l.timeoutHandle=jm($f.bind(null,l,n,tn,Vs,lc,t,fn,aa,La,Al,i,"Throttled",-0,0),a);break e}$f(l,n,tn,Vs,lc,t,fn,aa,La,Al,i,null,-0,0)}}break}while(!0);Gn(e)}function $f(e,t,n,l,a,i,d,h,g,A,_,U,E,M){if(e.timeoutHandle=-1,U=t.subtreeFlags,U&8192||(U&16785408)===16785408){U={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},Xf(t,i,U);var le=(i&62914560)===i?qs-P():(i&4194048)===i?Ff-P():0;if(le=Eg(U,le),le!==null){rl=i,e.cancelPendingCommit=le(sm.bind(null,e,t,i,n,l,a,d,h,g,_,U,null,E,M)),Ml(e,i,d,!A);return}}sm(e,t,i,n,l,a,d,h,g)}function qb(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],i=a.getSnapshot;a=a.value;try{if(!on(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ml(e,t,n,l){t&=~nc,t&=~aa,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var i=31-Re(a),d=1<<i;l[i]=-1,a&=~d}n!==0&&Un(e,n,t)}function Zs(){return(Qe&6)===0?(zi(0),!1):!0}function oc(){if(Le!==null){if(We===0)var e=Le.return;else e=Le,In=Jl=null,Cr(e),ja=null,mi=0,e=Le;for(;e!==null;)Rf(e.alternate,e),e=e.return;Le=null}}function Ba(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),rl=0,oc(),it=e,Le=n=Jn(e.current,null),Ye=t,We=0,dn=null,Al=!1,Oa=he(e,t),tc=!1,La=fn=nc=aa=El=vt=0,tn=Ri=null,lc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-Re(l),i=1<<a;t|=e[a],l&=~i}return ol=t,ms(),n}function Pf(e,t){Ae=null,j.H=Si,t===Ea||t===Ss?(t=hd(),We=3):t===dr?(t=hd(),We=4):We=t===Hr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,dn=t,Le===null&&(vt=1,Os(e,vn(t,e.current)))}function em(){var e=cn.current;return e===null?!0:(Ye&4194048)===Ye?Cn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Cn:!1}function tm(){var e=j.H;return j.H=Si,e===null?Si:e}function nm(){var e=j.A;return j.A=Kb,e}function Qs(){vt=4,Al||(Ye&4194048)!==Ye&&cn.current!==null||(Oa=!0),(El&134217727)===0&&(aa&134217727)===0||it===null||Ml(it,Ye,fn,!1)}function rc(e,t,n){var l=Qe;Qe|=2;var a=tm(),i=nm();(it!==e||Ye!==t)&&(Vs=null,Ba(e,t)),t=!1;var d=vt;e:do try{if(We!==0&&Le!==null){var h=Le,g=dn;switch(We){case 8:oc(),d=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(t=!0);var A=We;if(We=0,dn=null,Ha(e,h,g,A),n&&Oa){d=0;break e}break;default:A=We,We=0,dn=null,Ha(e,h,g,A)}}Xb(),d=vt;break}catch(_){Pf(e,_)}while(!0);return t&&e.shellSuspendCounter++,In=Jl=null,Qe=l,j.H=a,j.A=i,Le===null&&(it=null,Ye=0,ms()),d}function Xb(){for(;Le!==null;)lm(Le)}function Vb(e,t){var n=Qe;Qe|=2;var l=tm(),a=nm();it!==e||Ye!==t?(Vs=null,Xs=P()+500,Ba(e,t)):Oa=he(e,t);e:do try{if(We!==0&&Le!==null){t=Le;var i=dn;t:switch(We){case 1:We=0,dn=null,Ha(e,t,i,1);break;case 2:case 9:if(fd(i)){We=0,dn=null,am(t);break}t=function(){We!==2&&We!==9||it!==e||(We=7),Gn(e)},i.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:fd(i)?(We=0,dn=null,am(t)):(We=0,dn=null,Ha(e,t,i,7));break;case 5:var d=null;switch(Le.tag){case 26:d=Le.memoizedState;case 5:case 27:var h=Le;if(d?qm(d):h.stateNode.complete){We=0,dn=null;var g=h.sibling;if(g!==null)Le=g;else{var A=h.return;A!==null?(Le=A,Fs(A)):Le=null}break t}}We=0,dn=null,Ha(e,t,i,5);break;case 6:We=0,dn=null,Ha(e,t,i,6);break;case 8:oc(),vt=6;break e;default:throw Error(c(462))}}Zb();break}catch(_){Pf(e,_)}while(!0);return In=Jl=null,j.H=l,j.A=a,Qe=n,Le!==null?0:(it=null,Ye=0,ms(),vt)}function Zb(){for(;Le!==null&&!On();)lm(Le)}function lm(e){var t=Ef(e.alternate,e,ol);e.memoizedProps=e.pendingProps,t===null?Fs(e):Le=t}function am(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sf(n,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=Sf(n,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Cr(t);default:Rf(n,t),t=Le=td(t,ol),t=Ef(n,t,ol)}e.memoizedProps=e.pendingProps,t===null?Fs(e):Le=t}function Ha(e,t,n,l){In=Jl=null,Cr(t),ja=null,mi=0;var a=t.return;try{if(Db(e,a,t,n,Ye)){vt=1,Os(e,vn(n,e.current)),Le=null;return}}catch(i){if(a!==null)throw Le=a,i;vt=1,Os(e,vn(n,e.current)),Le=null;return}t.flags&32768?(Xe||l===1?e=!0:Oa||(Ye&536870912)!==0?e=!1:(Al=e=!0,(l===2||l===9||l===3||l===6)&&(l=cn.current,l!==null&&l.tag===13&&(l.flags|=16384))),im(t,e)):Fs(t)}function Fs(e){var t=e;do{if((t.flags&32768)!==0){im(t,Al);return}e=t.return;var n=Ub(t.alternate,t,ol);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);vt===0&&(vt=5)}function im(e,t){do{var n=Bb(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);vt=6,Le=null}function sm(e,t,n,l,a,i,d,h,g){e.cancelPendingCommit=null;do Js();while(Rt!==0);if((Qe&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=Wo,bt(e,n,i,d,h,g),e===it&&(Le=it=null,Ye=0),Ua=t,Rl=e,rl=n,ac=i,ic=a,Jf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Wb(Ft,function(){return dm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,a=B.p,B.p=2,d=Qe,Qe|=4;try{Hb(e,t,n)}finally{Qe=d,B.p=a,j.T=l}}Rt=1,om(),rm(),cm()}}function om(){if(Rt===1){Rt=0;var e=Rl,t=Ua,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=j.T,j.T=null;var l=B.p;B.p=2;var a=Qe;Qe|=4;try{Kf(t,e);var i=xc,d=Zu(e.containerInfo),h=i.focusedElem,g=i.selectionRange;if(d!==h&&h&&h.ownerDocument&&Vu(h.ownerDocument.documentElement,h)){if(g!==null&&Vo(h)){var A=g.start,_=g.end;if(_===void 0&&(_=A),"selectionStart"in h)h.selectionStart=A,h.selectionEnd=Math.min(_,h.value.length);else{var U=h.ownerDocument||document,E=U&&U.defaultView||window;if(E.getSelection){var M=E.getSelection(),le=h.textContent.length,ge=Math.min(g.start,le),nt=g.end===void 0?ge:Math.min(g.end,le);!M.extend&&ge>nt&&(d=nt,nt=ge,ge=d);var C=Xu(h,ge),x=Xu(h,nt);if(C&&x&&(M.rangeCount!==1||M.anchorNode!==C.node||M.anchorOffset!==C.offset||M.focusNode!==x.node||M.focusOffset!==x.offset)){var N=U.createRange();N.setStart(C.node,C.offset),M.removeAllRanges(),ge>nt?(M.addRange(N),M.extend(x.node,x.offset)):(N.setEnd(x.node,x.offset),M.addRange(N))}}}}for(U=[],M=h;M=M.parentNode;)M.nodeType===1&&U.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<U.length;h++){var D=U[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}oo=!!vc,xc=vc=null}finally{Qe=a,B.p=l,j.T=n}}e.current=t,Rt=2}}function rm(){if(Rt===2){Rt=0;var e=Rl,t=Ua,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=j.T,j.T=null;var l=B.p;B.p=2;var a=Qe;Qe|=4;try{Lf(e,t.alternate,t)}finally{Qe=a,B.p=l,j.T=n}}Rt=3}}function cm(){if(Rt===4||Rt===3){Rt=0,Ln();var e=Rl,t=Ua,n=rl,l=Jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Ua=Rl=null,um(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(jl=null),ca(n),t=t.stateNode,W&&typeof W.onCommitFiberRoot=="function")try{W.onCommitFiberRoot(J,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=j.T,a=B.p,B.p=2,j.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var h=l[d];i(h.value,{componentStack:h.stack})}}finally{j.T=t,B.p=a}}(rl&3)!==0&&Js(),Gn(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===sc?Mi++:(Mi=0,sc=e):Mi=0,zi(0)}}function um(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,di(t)))}function Js(){return om(),rm(),cm(),dm()}function dm(){if(Rt!==5)return!1;var e=Rl,t=ac;ac=0;var n=ca(rl),l=j.T,a=B.p;try{B.p=32>n?32:n,j.T=null,n=ic,ic=null;var i=Rl,d=rl;if(Rt=0,Ua=Rl=null,rl=0,(Qe&6)!==0)throw Error(c(331));var h=Qe;if(Qe|=4,Zf(i.current),qf(i,i.current,d,n),Qe=h,zi(0,!1),W&&typeof W.onPostCommitFiberRoot=="function")try{W.onPostCommitFiberRoot(J,i)}catch{}return!0}finally{B.p=a,j.T=l,um(e,t)}}function fm(e,t,n){t=vn(n,t),t=Br(e.stateNode,t,2),e=wl(e,t,2),e!==null&&(st(e,2),Gn(e))}function Ie(e,t,n){if(e.tag===3)fm(e,e,n);else for(;t!==null;){if(t.tag===3){fm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(jl===null||!jl.has(l))){e=vn(n,e),n=mf(2),l=wl(t,n,2),l!==null&&(hf(n,l,t,e),st(l,2),Gn(l));break}}t=t.return}}function cc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Gb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(tc=!0,a.add(n),e=Qb.bind(null,e,t,n),t.then(e,e))}function Qb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,it===e&&(Ye&n)===n&&(vt===4||vt===3&&(Ye&62914560)===Ye&&300>P()-qs?(Qe&2)===0&&Ba(e,0):nc|=n,La===Ye&&(La=0)),Gn(e)}function mm(e,t){t===0&&(t=qe()),e=Zl(e,t),e!==null&&(st(e,t),Gn(e))}function Fb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mm(e,n)}function Jb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),mm(e,n)}function Wb(e,t){return wt(e,t)}var Ws=null,Ya=null,uc=!1,Is=!1,dc=!1,zl=0;function Gn(e){e!==Ya&&e.next===null&&(Ya===null?Ws=Ya=e:Ya=Ya.next=e),Is=!0,uc||(uc=!0,$b())}function zi(e,t){if(!dc&&Is){dc=!0;do for(var n=!1,l=Ws;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var i=0;else{var d=l.suspendedLanes,h=l.pingedLanes;i=(1<<31-Re(42|e)+1)-1,i&=a&~(d&~h),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,gm(l,i))}else i=Ye,i=te(l,l===it?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||he(l,i)||(n=!0,gm(l,i));l=l.next}while(n);dc=!1}}function Ib(){hm()}function hm(){Is=uc=!1;var e=0;zl!==0&&rg()&&(e=zl);for(var t=P(),n=null,l=Ws;l!==null;){var a=l.next,i=pm(l,t);i===0?(l.next=null,n===null?Ws=a:n.next=a,a===null&&(Ya=n)):(n=l,(e!==0||(i&3)!==0)&&(Is=!0)),l=a}Rt!==0&&Rt!==5||zi(e),zl!==0&&(zl=0)}function pm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-Re(i),h=1<<d,g=a[d];g===-1?((h&n)===0||(h&l)!==0)&&(a[d]=Me(h,t)):g<=t&&(e.expiredLanes|=h),i&=~h}if(t=it,n=Ye,n=te(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Dn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||he(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Dn(l),ca(n)){case 2:case 8:n=Pe;break;case 32:n=Ft;break;case 268435456:n=Kt;break;default:n=Ft}return l=bm.bind(null,e),n=wt(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Dn(l),e.callbackPriority=2,e.callbackNode=null,2}function bm(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Js()&&e.callbackNode!==n)return null;var l=Ye;return l=te(e,e===it?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(If(e,l,t),pm(e,P()),e.callbackNode!=null&&e.callbackNode===n?bm.bind(null,e):null)}function gm(e,t){if(Js())return null;If(e,t,!0)}function $b(){ug(function(){(Qe&6)!==0?wt(Se,Ib):hm()})}function fc(){if(zl===0){var e=Na;e===0&&(e=pt,pt<<=1,(pt&261888)===0&&(pt=256)),zl=e}return zl}function ym(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:is(""+e)}function vm(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Pb(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var i=ym((a[gt]||null).action),d=l.submitter;d&&(t=(t=d[gt]||null)?ym(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var h=new cs("action","action",null,l,a);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(zl!==0){var g=d?vm(a,d):new FormData(a);_r(n,{pending:!0,data:g,method:a.method,action:i},null,g)}}else typeof i=="function"&&(h.preventDefault(),g=d?vm(a,d):new FormData(a),_r(n,{pending:!0,data:g,method:a.method,action:i},i,g))},currentTarget:a}]})}}for(var mc=0;mc<Jo.length;mc++){var hc=Jo[mc],eg=hc.toLowerCase(),tg=hc[0].toUpperCase()+hc.slice(1);Mn(eg,"on"+tg)}Mn(Ju,"onAnimationEnd"),Mn(Wu,"onAnimationIteration"),Mn(Iu,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(gb,"onTransitionRun"),Mn(yb,"onTransitionStart"),Mn(vb,"onTransitionCancel"),Mn($u,"onTransitionEnd"),da("onMouseEnter",["mouseout","mouseover"]),da("onMouseLeave",["mouseout","mouseover"]),da("onPointerEnter",["pointerout","pointerover"]),da("onPointerLeave",["pointerout","pointerover"]),Gl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _i="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ng=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_i));function xm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var h=l[d],g=h.instance,A=h.currentTarget;if(h=h.listener,g!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=A;try{i(a)}catch(_){fs(_)}a.currentTarget=null,i=g}else for(d=0;d<l.length;d++){if(h=l[d],g=h.instance,A=h.currentTarget,h=h.listener,g!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=A;try{i(a)}catch(_){fs(_)}a.currentTarget=null,i=g}}}}function Ue(e,t){var n=t[fe];n===void 0&&(n=t[fe]=new Set);var l=e+"__bubble";n.has(l)||(Sm(t,e,2,!1),n.add(l))}function pc(e,t,n){var l=0;t&&(l|=4),Sm(n,e,l,t)}var $s="_reactListening"+Math.random().toString(36).slice(2);function bc(e){if(!e[$s]){e[$s]=!0,mu.forEach(function(n){n!=="selectionchange"&&(ng.has(n)||pc(n,!1,e),pc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$s]||(t[$s]=!0,pc("selectionchange",!1,t))}}function Sm(e,t,n,l){switch(Wm(t)){case 2:var a=Mg;break;case 8:a=zg;break;default:a=zc}n=a.bind(null,t,n,e),a=void 0,!Lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function gc(e,t,n,l,a){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var h=l.stateNode.containerInfo;if(h===a)break;if(d===4)for(d=l.return;d!==null;){var g=d.tag;if((g===3||g===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;h!==null;){if(d=hl(h),d===null)return;if(g=d.tag,g===5||g===6||g===26||g===27){l=i=d;continue e}h=h.parentNode}}l=l.return}Nu(function(){var A=i,_=Do(n),U=[];e:{var E=Pu.get(e);if(E!==void 0){var M=cs,le=e;switch(e){case"keypress":if(os(n)===0)break e;case"keydown":case"keyup":M=Jp;break;case"focusin":le="focus",M=Yo;break;case"focusout":le="blur",M=Yo;break;case"beforeblur":case"afterblur":M=Yo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":M=ju;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Up;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=$p;break;case Ju:case Wu:case Iu:M=Yp;break;case $u:M=eb;break;case"scroll":case"scrollend":M=Op;break;case"wheel":M=nb;break;case"copy":case"cut":case"paste":M=Gp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=Mu;break;case"toggle":case"beforetoggle":M=ab}var ge=(t&4)!==0,nt=!ge&&(e==="scroll"||e==="scrollend"),C=ge?E!==null?E+"Capture":null:E;ge=[];for(var x=A,N;x!==null;){var D=x;if(N=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||N===null||C===null||(D=ei(x,C),D!=null&&ge.push(ki(x,D,N))),nt)break;x=x.return}0<ge.length&&(E=new M(E,le,null,n,_),U.push({event:E,listeners:ge}))}}if((t&7)===0){e:{if(E=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",E&&n!==ko&&(le=n.relatedTarget||n.fromElement)&&(hl(le)||le[Wt]))break e;if((M||E)&&(E=_.window===_?_:(E=_.ownerDocument)?E.defaultView||E.parentWindow:window,M?(le=n.relatedTarget||n.toElement,M=A,le=le?hl(le):null,le!==null&&(nt=f(le),ge=le.tag,le!==nt||ge!==5&&ge!==27&&ge!==6)&&(le=null)):(M=null,le=A),M!==le)){if(ge=ju,D="onMouseLeave",C="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Mu,D="onPointerLeave",C="onPointerEnter",x="pointer"),nt=M==null?E:Pa(M),N=le==null?E:Pa(le),E=new ge(D,x+"leave",M,n,_),E.target=nt,E.relatedTarget=N,D=null,hl(_)===A&&(ge=new ge(C,x+"enter",le,n,_),ge.target=N,ge.relatedTarget=nt,D=ge),nt=D,M&&le)t:{for(ge=lg,C=M,x=le,N=0,D=C;D;D=ge(D))N++;D=0;for(var ue=x;ue;ue=ge(ue))D++;for(;0<N-D;)C=ge(C),N--;for(;0<D-N;)x=ge(x),D--;for(;N--;){if(C===x||x!==null&&C===x.alternate){ge=C;break t}C=ge(C),x=ge(x)}ge=null}else ge=null;M!==null&&wm(U,E,M,ge,!1),le!==null&&nt!==null&&wm(U,nt,le,ge,!0)}}e:{if(E=A?Pa(A):window,M=E.nodeName&&E.nodeName.toLowerCase(),M==="select"||M==="input"&&E.type==="file")var Ve=Bu;else if(Lu(E))if(Hu)Ve=hb;else{Ve=fb;var ae=db}else M=E.nodeName,!M||M.toLowerCase()!=="input"||E.type!=="checkbox"&&E.type!=="radio"?A&&_o(A.elementType)&&(Ve=Bu):Ve=mb;if(Ve&&(Ve=Ve(e,A))){Uu(U,Ve,n,_);break e}ae&&ae(e,E,A),e==="focusout"&&A&&E.type==="number"&&A.memoizedProps.value!=null&&zo(E,"number",E.value)}switch(ae=A?Pa(A):window,e){case"focusin":(Lu(ae)||ae.contentEditable==="true")&&(ga=ae,Zo=A,ri=null);break;case"focusout":ri=Zo=ga=null;break;case"mousedown":Qo=!0;break;case"contextmenu":case"mouseup":case"dragend":Qo=!1,Qu(U,n,_);break;case"selectionchange":if(bb)break;case"keydown":case"keyup":Qu(U,n,_)}var je;if(Go)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ba?Du(e,n)&&(Ke="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ke="onCompositionStart");Ke&&(zu&&n.locale!=="ko"&&(ba||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ba&&(je=Au()):(pl=_,Uo="value"in pl?pl.value:pl.textContent,ba=!0)),ae=Ps(A,Ke),0<ae.length&&(Ke=new Ru(Ke,e,null,n,_),U.push({event:Ke,listeners:ae}),je?Ke.data=je:(je=Ou(n),je!==null&&(Ke.data=je)))),(je=sb?ob(e,n):rb(e,n))&&(Ke=Ps(A,"onBeforeInput"),0<Ke.length&&(ae=new Ru("onBeforeInput","beforeinput",null,n,_),U.push({event:ae,listeners:Ke}),ae.data=je)),Pb(U,e,A,n,_)}xm(U,t)})}function ki(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ps(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=ei(e,n),a!=null&&l.unshift(ki(e,a,i)),a=ei(e,t),a!=null&&l.push(ki(e,a,i))),e.tag===3)return l;e=e.return}return[]}function lg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wm(e,t,n,l,a){for(var i=t._reactName,d=[];n!==null&&n!==l;){var h=n,g=h.alternate,A=h.stateNode;if(h=h.tag,g!==null&&g===l)break;h!==5&&h!==26&&h!==27||A===null||(g=A,a?(A=ei(n,i),A!=null&&d.unshift(ki(n,A,g))):a||(A=ei(n,i),A!=null&&d.push(ki(n,A,g)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var ag=/\r\n?/g,ig=/\u0000|\uFFFD/g;function Cm(e){return(typeof e=="string"?e:""+e).replace(ag,`
|
|
33
|
+
`).replace(ig,"")}function Tm(e,t){return t=Cm(t),Cm(e)===t}function tt(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ma(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ma(e,""+l);break;case"className":ls(e,"class",l);break;case"tabIndex":ls(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ls(e,n,l);break;case"style":Cu(e,l,i);break;case"data":if(t!=="object"){ls(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=is(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&tt(e,t,"name",a.name,a,null),tt(e,t,"formEncType",a.formEncType,a,null),tt(e,t,"formMethod",a.formMethod,a,null),tt(e,t,"formTarget",a.formTarget,a,null)):(tt(e,t,"encType",a.encType,a,null),tt(e,t,"method",a.method,a,null),tt(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=is(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Qn);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=is(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),ns(e,"popover",l);break;case"xlinkActuate":Zn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ns(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=kp.get(n)||n,ns(e,n,l))}}function yc(e,t,n,l,a,i){switch(n){case"style":Cu(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?ma(e,l):(typeof l=="number"||typeof l=="bigint")&&ma(e,""+l);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[gt]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):ns(e,n,l)}}}function Yt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:tt(e,t,i,d,n,null)}}a&&tt(e,t,"srcSet",n.srcSet,n,null),l&&tt(e,t,"src",n.src,n,null);return;case"input":Ue("invalid",e);var h=i=d=a=null,g=null,A=null;for(l in n)if(n.hasOwnProperty(l)){var _=n[l];if(_!=null)switch(l){case"name":a=_;break;case"type":d=_;break;case"checked":g=_;break;case"defaultChecked":A=_;break;case"value":i=_;break;case"defaultValue":h=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,t));break;default:tt(e,t,l,_,n,null)}}vu(e,i,h,g,A,d,a,!1);return;case"select":Ue("invalid",e),l=d=i=null;for(a in n)if(n.hasOwnProperty(a)&&(h=n[a],h!=null))switch(a){case"value":i=h;break;case"defaultValue":d=h;break;case"multiple":l=h;default:tt(e,t,a,h,n,null)}t=i,n=d,e.multiple=!!l,t!=null?fa(e,!!l,t,!1):n!=null&&fa(e,!!l,n,!0);return;case"textarea":Ue("invalid",e),i=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(h=n[d],h!=null))switch(d){case"value":l=h;break;case"defaultValue":a=h;break;case"children":i=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:tt(e,t,d,h,n,null)}Su(e,l,a,i);return;case"option":for(g in n)if(n.hasOwnProperty(g)&&(l=n[g],l!=null))switch(g){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:tt(e,t,g,l,n,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(l=0;l<_i.length;l++)Ue(_i[l],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in n)if(n.hasOwnProperty(A)&&(l=n[A],l!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:tt(e,t,A,l,n,null)}return;default:if(_o(t)){for(_ in n)n.hasOwnProperty(_)&&(l=n[_],l!==void 0&&yc(e,t,_,l,n,void 0));return}}for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!=null&&tt(e,t,h,l,n,null))}function sg(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,d=null,h=null,g=null,A=null,_=null;for(M in n){var U=n[M];if(n.hasOwnProperty(M)&&U!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":g=U;default:l.hasOwnProperty(M)||tt(e,t,M,null,l,U)}}for(var E in l){var M=l[E];if(U=n[E],l.hasOwnProperty(E)&&(M!=null||U!=null))switch(E){case"type":i=M;break;case"name":a=M;break;case"checked":A=M;break;case"defaultChecked":_=M;break;case"value":d=M;break;case"defaultValue":h=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(c(137,t));break;default:M!==U&&tt(e,t,E,M,l,U)}}Mo(e,d,h,g,A,_,i,a);return;case"select":M=d=h=E=null;for(i in n)if(g=n[i],n.hasOwnProperty(i)&&g!=null)switch(i){case"value":break;case"multiple":M=g;default:l.hasOwnProperty(i)||tt(e,t,i,null,l,g)}for(a in l)if(i=l[a],g=n[a],l.hasOwnProperty(a)&&(i!=null||g!=null))switch(a){case"value":E=i;break;case"defaultValue":h=i;break;case"multiple":d=i;default:i!==g&&tt(e,t,a,i,l,g)}t=h,n=d,l=M,E!=null?fa(e,!!n,E,!1):!!l!=!!n&&(t!=null?fa(e,!!n,t,!0):fa(e,!!n,n?[]:"",!1));return;case"textarea":M=E=null;for(h in n)if(a=n[h],n.hasOwnProperty(h)&&a!=null&&!l.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:tt(e,t,h,null,l,a)}for(d in l)if(a=l[d],i=n[d],l.hasOwnProperty(d)&&(a!=null||i!=null))switch(d){case"value":E=a;break;case"defaultValue":M=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==i&&tt(e,t,d,a,l,i)}xu(e,E,M);return;case"option":for(var le in n)if(E=n[le],n.hasOwnProperty(le)&&E!=null&&!l.hasOwnProperty(le))switch(le){case"selected":e.selected=!1;break;default:tt(e,t,le,null,l,E)}for(g in l)if(E=l[g],M=n[g],l.hasOwnProperty(g)&&E!==M&&(E!=null||M!=null))switch(g){case"selected":e.selected=E&&typeof E!="function"&&typeof E!="symbol";break;default:tt(e,t,g,E,l,M)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in n)E=n[ge],n.hasOwnProperty(ge)&&E!=null&&!l.hasOwnProperty(ge)&&tt(e,t,ge,null,l,E);for(A in l)if(E=l[A],M=n[A],l.hasOwnProperty(A)&&E!==M&&(E!=null||M!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(c(137,t));break;default:tt(e,t,A,E,l,M)}return;default:if(_o(t)){for(var nt in n)E=n[nt],n.hasOwnProperty(nt)&&E!==void 0&&!l.hasOwnProperty(nt)&&yc(e,t,nt,void 0,l,E);for(_ in l)E=l[_],M=n[_],!l.hasOwnProperty(_)||E===M||E===void 0&&M===void 0||yc(e,t,_,E,l,M);return}}for(var C in n)E=n[C],n.hasOwnProperty(C)&&E!=null&&!l.hasOwnProperty(C)&&tt(e,t,C,null,l,E);for(U in l)E=l[U],M=n[U],!l.hasOwnProperty(U)||E===M||E==null&&M==null||tt(e,t,U,E,l,M)}function Nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function og(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,d=a.initiatorType,h=a.duration;if(i&&h&&Nm(d)){for(d=0,h=a.responseEnd,l+=1;l<n.length;l++){var g=n[l],A=g.startTime;if(A>h)break;var _=g.transferSize,U=g.initiatorType;_&&Nm(U)&&(g=g.responseEnd,d+=_*(g<h?1:(h-A)/(g-A)))}if(--l,t+=8*(i+d)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var vc=null,xc=null;function eo(e){return e.nodeType===9?e:e.ownerDocument}function Am(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Em(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Sc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wc=null;function rg(){var e=window.event;return e&&e.type==="popstate"?e===wc?!1:(wc=e,!0):(wc=null,!1)}var jm=typeof setTimeout=="function"?setTimeout:void 0,cg=typeof clearTimeout=="function"?clearTimeout:void 0,Rm=typeof Promise=="function"?Promise:void 0,ug=typeof queueMicrotask=="function"?queueMicrotask:typeof Rm<"u"?function(e){return Rm.resolve(null).then(e).catch(dg)}:jm;function dg(e){setTimeout(function(){throw e})}function _l(e){return e==="head"}function Mm(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),Xa(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Di(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Di(n);for(var i=n.firstChild;i;){var d=i.nextSibling,h=i.nodeName;i[Kl]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=d}}else n==="body"&&Di(e.ownerDocument.body);n=a}while(n);Xa(t)}function zm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Cc(n),$a(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function fg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Kl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Tn(e.nextSibling),e===null)break}return null}function mg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Tn(e.nextSibling),e===null))return null;return e}function _m(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Tn(e.nextSibling),e===null))return null;return e}function Tc(e){return e.data==="$?"||e.data==="$~"}function Nc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ac=null;function km(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Tn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Dm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Om(e,t,n){switch(t=eo(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Di(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$a(e)}var Nn=new Map,Lm=new Set;function to(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cl=B.d;B.d={f:pg,r:bg,D:gg,C:yg,L:vg,m:xg,X:wg,S:Sg,M:Cg};function pg(){var e=cl.f(),t=Zs();return e||t}function bg(e){var t=Vn(e);t!==null&&t.tag===5&&t.type==="form"?$d(t):cl.r(e)}var Ka=typeof document>"u"?null:document;function Um(e,t,n){var l=Ka;if(l&&typeof t=="string"&&t){var a=gn(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),Lm.has(a)||(Lm.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Yt(t,"link",e),Dt(t),l.head.appendChild(t)))}}function gg(e){cl.D(e),Um("dns-prefetch",e,null)}function yg(e,t){cl.C(e,t),Um("preconnect",e,t)}function vg(e,t,n){cl.L(e,t,n);var l=Ka;if(l&&e&&t){var a='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+gn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+gn(n.imageSizes)+'"]')):a+='[href="'+gn(e)+'"]';var i=a;switch(t){case"style":i=Ga(e);break;case"script":i=qa(e)}Nn.has(i)||(e=T({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Nn.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Oi(i))||t==="script"&&l.querySelector(Li(i))||(t=l.createElement("link"),Yt(t,"link",e),Dt(t),l.head.appendChild(t)))}}function xg(e,t){cl.m(e,t);var n=Ka;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+gn(l)+'"][href="'+gn(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=qa(e)}if(!Nn.has(i)&&(e=T({rel:"modulepreload",href:e},t),Nn.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Li(i)))return}l=n.createElement("link"),Yt(l,"link",e),Dt(l),n.head.appendChild(l)}}}function Sg(e,t,n){cl.S(e,t,n);var l=Ka;if(l&&e){var a=ua(l).hoistableStyles,i=Ga(e);t=t||"default";var d=a.get(i);if(!d){var h={loading:0,preload:null};if(d=l.querySelector(Oi(i)))h.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nn.get(i))&&Ec(e,n);var g=d=l.createElement("link");Dt(g),Yt(g,"link",e),g._p=new Promise(function(A,_){g.onload=A,g.onerror=_}),g.addEventListener("load",function(){h.loading|=1}),g.addEventListener("error",function(){h.loading|=2}),h.loading|=4,no(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:h},a.set(i,d)}}}function wg(e,t){cl.X(e,t);var n=Ka;if(n&&e){var l=ua(n).hoistableScripts,a=qa(e),i=l.get(a);i||(i=n.querySelector(Li(a)),i||(e=T({src:e,async:!0},t),(t=Nn.get(a))&&jc(e,t),i=n.createElement("script"),Dt(i),Yt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function Cg(e,t){cl.M(e,t);var n=Ka;if(n&&e){var l=ua(n).hoistableScripts,a=qa(e),i=l.get(a);i||(i=n.querySelector(Li(a)),i||(e=T({src:e,async:!0,type:"module"},t),(t=Nn.get(a))&&jc(e,t),i=n.createElement("script"),Dt(i),Yt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function Bm(e,t,n,l){var a=(a=Ne.current)?to(a):null;if(!a)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ga(n.href),n=ua(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ga(n.href);var i=ua(a).hoistableStyles,d=i.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=a.querySelector(Oi(e)))&&!i._p&&(d.instance=i,d.state.loading=5),Nn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nn.set(e,n),i||Tg(a,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=qa(n),n=ua(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Ga(e){return'href="'+gn(e)+'"'}function Oi(e){return'link[rel="stylesheet"]['+e+"]"}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Tg(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Yt(t,"link",n),Dt(t),e.head.appendChild(t))}function qa(e){return'[src="'+gn(e)+'"]'}function Li(e){return"script[async]"+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+gn(n.href)+'"]');if(l)return t.instance=l,Dt(l),l;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Dt(l),Yt(l,"style",a),no(l,n.precedence,e),t.instance=l;case"stylesheet":a=Ga(n.href);var i=e.querySelector(Oi(a));if(i)return t.state.loading|=4,t.instance=i,Dt(i),i;l=Hm(n),(a=Nn.get(a))&&Ec(l,a),i=(e.ownerDocument||e).createElement("link"),Dt(i);var d=i;return d._p=new Promise(function(h,g){d.onload=h,d.onerror=g}),Yt(i,"link",l),t.state.loading|=4,no(i,n.precedence,e),t.instance=i;case"script":return i=qa(n.src),(a=e.querySelector(Li(i)))?(t.instance=a,Dt(a),a):(l=n,(a=Nn.get(i))&&(l=T({},n),jc(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),Dt(a),Yt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,no(l,n.precedence,e));return t.instance}function no(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,d=0;d<l.length;d++){var h=l[d];if(h.dataset.precedence===t)i=h;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ec(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lo=null;function Km(e,t,n){if(lo===null){var l=new Map,a=lo=new Map;a.set(n,l)}else a=lo,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Kl]||i[ot]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var h=l.get(d);h?h.push(i):l.set(d,[i])}}return l}function Gm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Ng(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function qm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ag(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ga(l.href),i=t.querySelector(Oi(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ao.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,Dt(i);return}i=t.ownerDocument||t,l=Hm(l),(a=Nn.get(a))&&Ec(l,a),i=i.createElement("link"),Dt(i);var d=i;d._p=new Promise(function(h,g){d.onload=h,d.onerror=g}),Yt(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ao.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Rc=0;function Eg(e,t){return e.stylesheets&&e.count===0&&so(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&so(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Rc===0&&(Rc=62500*og());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&so(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Rc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ao(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)so(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var io=null;function so(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,io=new Map,t.forEach(jg,e),io=null,ao.call(e))}function jg(e,t){if(!(t.state.loading&4)){var n=io.get(e);if(n)var l=n.get(null);else{n=new Map,io.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var d=a[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=t.instance,d=a.getAttribute("data-precedence"),i=n.get(d)||l,i===l&&n.set(null,a),n.set(d,a),this.count++,l=ao.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ui={$$typeof:I,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function Rg(e,t,n,l,a,i,d,h,g){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Oe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oe(0),this.hiddenUpdates=Oe(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Xm(e,t,n,l,a,i,d,h,g,A,_,U){return e=new Rg(e,t,n,d,g,A,_,U,h),t=1,i===!0&&(t|=24),i=rn(3,null,null,t),e.current=i,i.stateNode=e,t=rr(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},fr(i),e}function Vm(e){return e?(e=xa,e):xa}function Zm(e,t,n,l,a,i){a=Vm(a),l.context===null?l.context=a:l.pendingContext=a,l=Sl(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=wl(e,l,t),n!==null&&(nn(n,e,t),pi(n,e,t))}function Qm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Mc(e,t){Qm(e,t),(e=e.alternate)&&Qm(e,t)}function Fm(e){if(e.tag===13||e.tag===31){var t=Zl(e,67108864);t!==null&&nn(t,e,67108864),Mc(e,67108864)}}function Jm(e){if(e.tag===13||e.tag===31){var t=mn();t=Bn(t);var n=Zl(e,t);n!==null&&nn(n,e,t),Mc(e,t)}}var oo=!0;function Mg(e,t,n,l){var a=j.T;j.T=null;var i=B.p;try{B.p=2,zc(e,t,n,l)}finally{B.p=i,j.T=a}}function zg(e,t,n,l){var a=j.T;j.T=null;var i=B.p;try{B.p=8,zc(e,t,n,l)}finally{B.p=i,j.T=a}}function zc(e,t,n,l){if(oo){var a=_c(l);if(a===null)gc(e,t,l,ro,n),Im(e,l);else if(kg(a,e,t,n,l))l.stopPropagation();else if(Im(e,l),t&4&&-1<_g.indexOf(e)){for(;a!==null;){var i=Vn(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=H(i.pendingLanes);if(d!==0){var h=i;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var g=1<<31-Re(d);h.entanglements[1]|=g,d&=~g}Gn(i),(Qe&6)===0&&(Xs=P()+500,zi(0))}}break;case 31:case 13:h=Zl(i,2),h!==null&&nn(h,i,2),Zs(),Mc(i,2)}if(i=_c(l),i===null&&gc(e,t,l,ro,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else gc(e,t,l,null,n)}}function _c(e){return e=Do(e),kc(e)}var ro=null;function kc(e){if(ro=null,e=hl(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=b(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ro=e,null}function Wm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case Se:return 2;case Pe:return 8;case Ft:case pn:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var Dc=!1,kl=null,Dl=null,Ol=null,Bi=new Map,Hi=new Map,Ll=[],_g="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Im(e,t){switch(e){case"focusin":case"focusout":kl=null;break;case"dragenter":case"dragleave":Dl=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":Bi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hi.delete(t.pointerId)}}function Yi(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Vn(t),t!==null&&Fm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function kg(e,t,n,l,a){switch(t){case"focusin":return kl=Yi(kl,e,t,n,l,a),!0;case"dragenter":return Dl=Yi(Dl,e,t,n,l,a),!0;case"mouseover":return Ol=Yi(Ol,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return Bi.set(i,Yi(Bi.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,Hi.set(i,Yi(Hi.get(i)||null,e,t,n,l,a)),!0}return!1}function $m(e){var t=hl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=b(n),t!==null){e.blockedOn=t,Ee(e.priority,function(){Jm(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Ee(e.priority,function(){Jm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_c(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ko=l,n.target.dispatchEvent(l),ko=null}else return t=Vn(n),t!==null&&Fm(t),e.blockedOn=n,!1;t.shift()}return!0}function Pm(e,t,n){co(e)&&n.delete(t)}function Dg(){Dc=!1,kl!==null&&co(kl)&&(kl=null),Dl!==null&&co(Dl)&&(Dl=null),Ol!==null&&co(Ol)&&(Ol=null),Bi.forEach(Pm),Hi.forEach(Pm)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Dg)))}var fo=null;function eh(e){fo!==e&&(fo=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){fo===e&&(fo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(kc(l||n)===null)continue;break}var i=Vn(n);i!==null&&(e.splice(t,3),t-=3,_r(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function Xa(e){function t(g){return uo(g,e)}kl!==null&&uo(kl,e),Dl!==null&&uo(Dl,e),Ol!==null&&uo(Ol,e),Bi.forEach(t),Hi.forEach(t);for(var n=0;n<Ll.length;n++){var l=Ll[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ll.length&&(n=Ll[0],n.blockedOn===null);)$m(n),n.blockedOn===null&&Ll.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],d=a[gt]||null;if(typeof i=="function")d||eh(n);else if(d){var h=null;if(i&&i.hasAttribute("formAction")){if(a=i,d=i[gt]||null)h=d.formAction;else if(kc(a)!==null)continue}else h=d.action;typeof h=="function"?n[l+1]=h:(n.splice(l,3),l-=3),eh(n)}}}function th(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Oc(e){this._internalRoot=e}mo.prototype.render=Oc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=mn();Zm(n,l,e,t,null,null)},mo.prototype.unmount=Oc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zm(e.current,2,null,e,null,null),Zs(),t[Wt]=null}};function mo(e){this._internalRoot=e}mo.prototype.unstable_scheduleHydration=function(e){if(e){var t=re();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ll.length&&t!==0&&t<Ll[n].priority;n++);Ll.splice(n,0,e),n===0&&$m(e)}};var nh=s.version;if(nh!=="19.2.8")throw Error(c(527,nh,"19.2.8"));B.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=w(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Og={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ho.isDisabled&&ho.supportsFiber)try{J=ho.inject(Og),W=ho}catch{}}return Gi.createRoot=function(e,t){if(!m(e))throw Error(c(299));var n=!1,l="",a=cf,i=uf,d=df;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Xm(e,1,!1,null,null,n,l,null,a,i,d,th),e[Wt]=t.current,bc(e),new Oc(t)},Gi.hydrateRoot=function(e,t,n){if(!m(e))throw Error(c(299));var l=!1,a="",i=cf,d=uf,h=df,g=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(h=n.onRecoverableError),n.formState!==void 0&&(g=n.formState)),t=Xm(e,1,!0,t,n??null,l,a,g,i,d,h,th),t.context=Vm(null),n=t.current,l=mn(),l=Bn(l),a=Sl(l),a.callback=null,wl(n,a,l),n=l,t.current.lanes=n,st(t,n),Gn(t),e[Wt]=t.current,bc(e),new mo(t)},Gi.version="19.2.8",Gi}var rh;function Fg(){if(rh)return Uc.exports;rh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),Uc.exports=Qg(),Uc.exports}var Jg=Fg();const Wg=Yh(Jg),ye={ESC:"\x1B",TAB:" ",ENTER:"\r",BACKSPACE:"",UP:"\x1B[A",DOWN:"\x1B[B",RIGHT:"\x1B[C",LEFT:"\x1B[D",HOME:"\x1B[H",END:"\x1B[F",PAGE_UP:"\x1B[5~",PAGE_DOWN:"\x1B[6~",INSERT:"\x1B[2~",DELETE:"\x1B[3~",CTRL_C:"",CTRL_D:"",CTRL_Z:"",CTRL_L:"\f",CTRL_A:"",CTRL_E:"",CTRL_K:"\v",CTRL_R:"",CTRL_W:"",CTRL_U:"",CTRL_X:"",CTRL_N:"",CTRL_P:"",F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"},Ig=new TextEncoder;function Gh(r){return Ig.encode(r)}function $g(r){if(!r||r.length===0)return"";const o=r.toUpperCase().charCodeAt(0);return o>=65&&o<=90?String.fromCharCode(o-64):r==="@"||r===" "?"\0":r==="["?"\x1B":r==="\\"?"":r==="]"?"":r==="^"?"":r==="_"?"":r==="?"?"":r}function Pg(r){return`\x1B${r}`}function ey(r,s){let o=r;return s.shift&&r.length===1&&!s.ctrl&&(o=r.toUpperCase()),s.ctrl&&(o=$g(o)),s.alt&&(o=Pg(o)),o}class ty{constructor(s){Fe(this,"ws",null);Fe(this,"config");Fe(this,"state","disconnected");Fe(this,"currentRole","viewer");Fe(this,"controllerId");Fe(this,"hostId");Fe(this,"assignedClientId");Fe(this,"reconnectAttempts",0);Fe(this,"reconnectTimer",null);Fe(this,"pingTimer",null);Fe(this,"pingTimestamp",null);Fe(this,"isManuallyClosed",!1);Fe(this,"authFailureDetail",null);Fe(this,"authFailureCode",null);Fe(this,"temporaryFailureCode",null);Fe(this,"listeners",{stateChange:new Set,roleChange:new Set,ready:new Set,paired:new Set,controlState:new Set,controlRevoked:new Set,sessionReady:new Set,exit:new Set,controlGranted:new Set,controlDenied:new Set,status:new Set,peerCount:new Set,hostReconnecting:new Set,sessionRestarted:new Set,error:new Set,binaryData:new Set,rttUpdate:new Set});Fe(this,"terminalCols",80);Fe(this,"terminalRows",24);this.config={...s}}updateConfig(s){this.config={...this.config,...s}}getConfig(){return{...this.config}}getState(){return this.state}getRole(){return this.currentRole}getControllerId(){return this.controllerId}getHostId(){return this.hostId}getAssignedClientId(){return this.assignedClientId}on(s,o){return this.listeners[s].add(o),()=>{this.listeners[s].delete(o)}}emit(s,...o){this.listeners[s].forEach(m=>{try{m(...o)}catch(f){console.error(`Error in event listener for ${s}:`,f)}})}setState(s,o,c){this.state!==s&&(this.state=s,this.emit("stateChange",s,o,c))}connect(s){if(s&&(this.terminalCols=s.cols,this.terminalRows=s.rows),!(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))){this.teardownSocket(1e3,"Replaced by a new connection"),this.isManuallyClosed=!1,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.clearTimers(),this.setState("connecting");try{const o=this.resolveWsUrl(this.config.wsUrl),c=new WebSocket(o);this.ws=c,c.binaryType="arraybuffer",c.onopen=()=>{this.isStaleSocket(c)||this.handleOpen()},c.onmessage=m=>{this.isStaleSocket(c)||this.handleMessage(m)},c.onerror=m=>{this.isStaleSocket(c)||this.handleError(m)},c.onclose=m=>{this.isStaleSocket(c)||this.handleClose(m)}}catch(o){this.setState("error",o instanceof Error?o.message:"Connection failed","connection_failed"),this.scheduleReconnect()}}}isStaleSocket(s){return this.ws!==s}teardownSocket(s=1e3,o="Client closed the connection"){const c=this.ws;if(c){this.ws=null,c.onopen=null,c.onmessage=null,c.onerror=null,c.onclose=null;try{(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING)&&c.close(s,o)}catch{}}}disconnect(){this.isManuallyClosed=!0,this.clearTimers(),this.teardownSocket(1e3,"User initiated disconnect"),this.setState("disconnected")}reconnectWith(s){this.updateConfig(s),this.clearTimers(),this.teardownSocket(1e3,"Reconnecting with new credentials"),this.isManuallyClosed=!1,this.reconnectAttempts=0,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.connect()}handleOpen(){this.sendHello(),this.startHeartbeat()}async handleMessage(s){if(typeof s.data=="string")try{const o=JSON.parse(s.data);this.processJsonMessage(o)}catch(o){console.warn("Received unparseable text frame from server:",o)}else if(s.data instanceof ArrayBuffer)this.emit("binaryData",new Uint8Array(s.data));else if(typeof Blob<"u"&&s.data instanceof Blob)try{const o=await s.data.arrayBuffer();this.emit("binaryData",new Uint8Array(o))}catch(o){console.error("Failed to convert Blob to ArrayBuffer:",o)}}processJsonMessage(s){switch(s.type){case"ready":{this.reconnectAttempts=0,this.setState("connected"),this.currentRole=s.role,this.controllerId=s.controllerId,this.hostId=s.hostId,this.assignedClientId=s.clientId,this.emit("ready",s),this.emit("roleChange",s.role,s.controllerId,s.hostId,s.clientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"paired":{this.emit("paired",{token:s.token,deviceId:s.deviceId,hostId:s.hostId,expiresAt:s.expiresAt});break}case"control_state":{this.currentRole=s.role,this.controllerId=s.controllerId,this.emit("controlState",s.role,s.controllerId),this.emit("roleChange",s.role,s.controllerId,this.hostId,this.assignedClientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"host_reconnecting":{this.temporaryFailureCode="host_reconnecting",this.setState("reconnecting","Herdr host is reconnecting",s.code||"host_reconnecting"),this.emit("hostReconnecting",s.code);break}case"session_restarted":{this.setState("reconnecting","Herdr session is restarting","session_restarted"),this.emit("sessionRestarted",s.cols,s.rows,s.terminalPalette,s.hostname);break}case"control_revoked":{this.currentRole="viewer",this.emit("controlRevoked",s.reason),this.emit("roleChange","viewer",this.controllerId,this.hostId,this.assignedClientId);break}case"session_ready":{this.setState("connected"),this.emit("sessionReady",s);break}case"exit":{this.emit("exit",s.code,s.reason);break}case"control_granted":{this.currentRole="controller",this.controllerId=this.assignedClientId||this.config.clientId,this.emit("controlGranted"),this.emit("roleChange","controller",this.controllerId,this.hostId,this.assignedClientId);break}case"control_denied":{this.emit("controlDenied",s.message);break}case"status":{this.emit("status",s);break}case"error":{s.code==="host_offline"||s.code==="host_reconnecting"||s.code==="host_reconnect_timeout"||s.code==="rate_limited"?(this.temporaryFailureCode=String(s.code),this.setState("reconnecting",s.message,String(s.code))):(s.code==="auth_required"||s.code==="unauthorized"||s.code==="device_revoked"||s.code==="invalid_handshake"||s.code==="too_many_hosts"||s.code===401||s.code===403)&&(this.authFailureDetail=s.message,this.authFailureCode=String(s.code),this.setState("error",s.message,this.authFailureCode)),this.emit("error",{code:s.code,message:s.message});break}case"pong":{if(this.pingTimestamp){const o=Math.max(0,performance.now()-this.pingTimestamp);this.pingTimestamp=null,this.emit("rttUpdate",Math.round(o))}break}}}handleError(s){console.error("WebSocket error:",s),this.emit("error",{code:"WS_ERROR",message:"WebSocket connection error"})}handleClose(s){if(this.clearTimers(),this.ws=null,this.authFailureDetail){this.setState("error",this.authFailureDetail,this.authFailureCode??void 0);return}if(s.code===1008&&this.temporaryFailureCode){this.setState("reconnecting",s.reason||"The relay is temporarily unavailable",this.temporaryFailureCode),this.scheduleReconnect();return}if(s.code===1008){this.setState("error",s.reason||"The relay rejected the connection",String(s.code));return}!this.isManuallyClosed&&this.config.autoReconnect?(this.setState("reconnecting",`Connection closed (${s.code}). Retrying...`,"connection_closed"),this.scheduleReconnect()):this.setState("disconnected",`Closed: ${s.reason||s.code}`,"connection_closed")}scheduleReconnect(){if(this.isManuallyClosed||!this.config.autoReconnect)return;if(this.config.maxReconnectAttempts>0&&this.reconnectAttempts>=this.config.maxReconnectAttempts){this.setState("error","Max reconnect attempts reached");return}this.reconnectAttempts++;const s=this.config.reconnectIntervalMs||2e3,c=Math.min(3e4,Math.floor(s*Math.pow(1.5,this.reconnectAttempts-1)+Math.random()*500));this.reconnectTimer=setTimeout(()=>{this.connect()},c)}startHeartbeat(){this.pingTimer&&clearInterval(this.pingTimer);const s=this.config.pingIntervalMs||1e4;this.pingTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.sendPing()},s)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}sendHello(){const s={type:"hello",protocol:1,clientId:this.config.clientId,cols:this.terminalCols,rows:this.terminalRows,capabilities:["host_handoff"]};this.config.token&&(s.token=this.config.token),this.config.pairCode&&(s.pairCode=this.config.pairCode),this.sendJson(s)}claimControl(s=!1){const o={type:"claim_control",...s?{force:!0}:{}};this.sendJson(o)}releaseControl(){const s={type:"release_control"};this.sendJson(s)}sendResize(s,o){this.terminalCols=s,this.terminalRows=o;const c={type:"resize",cols:s,rows:o};this.sendJson(c)}sendPing(){this.pingTimestamp=performance.now();const s={type:"ping"};this.sendJson(s)}sendJson(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(s))}sendBinary(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(s)}sendText(s){const o=Gh(s);this.sendBinary(o)}resolveWsUrl(s){if(/^wss?:\/\//i.test(s))return s;if(/^https?:\/\//i.test(s)){const o=new URL(s);return o.protocol=o.protocol==="https:"?"wss:":"ws:",(!o.pathname||o.pathname==="/")&&(o.pathname="/ws/client"),o.toString()}if(typeof window<"u"&&window.location){const c=window.location.protocol==="https:"?"wss:":"ws:",m=window.location.host,f=s.startsWith("/")?s:`/${s}`;return`${c}//${m}${f}`}return"ws://127.0.0.1:8787/ws/client"}}const qh=27,Xh=91,ny=60,ch=59,Vh=77,Zh=48,ly=57,ay=64,iy=-30,Yc=32,uh=255;function Qh(r){return Number.isInteger(r)&&(r&iy)===ay}function sy(r){return r>=Zh&&r<=ly}function Kc(r,s){let o=s,c=0;for(;o<r.length&&sy(r[o]);){if(c=c*10+(r[o]-Zh),c>65535)return null;o+=1}return o===s?null:{value:c,next:o}}function oy(r,s){if(r[s]!==qh||r[s+1]!==Xh||r[s+2]!==ny)return-1;const o=Kc(r,s+3);if(!o||!Qh(o.value)||r[o.next]!==ch)return-1;const c=Kc(r,o.next+1);if(!c||r[c.next]!==ch)return-1;const m=Kc(r,c.next+1);return!m||r[m.next]!==Vh?-1:m.next+1}function ry(r,s){if(r[s]!==qh||r[s+1]!==Xh||r[s+2]!==Vh||s+6>r.length)return-1;const o=r[s+3]-Yc,c=r[s+4],m=r[s+5];return!Qh(o)||c<Yc||c>uh||m<Yc||m>uh?-1:s+6}function Zc(r){if(!r)return!1;const s=r instanceof Uint8Array?r:new Uint8Array(r);if(s.length===0)return!1;let o=0;for(;o<s.length;){const c=oy(s,o);if(c>o){o=c;continue}const m=ry(s,o);if(m>o){o=m;continue}return!1}return!0}const cy=10,uy=24,Ao=15,eu=13,tu=640;function dy(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches))return!0}catch{}return Za()<tu}function Za(){return typeof window>"u"?1024:window.visualViewport&&typeof window.visualViewport.width=="number"&&window.visualViewport.width>0?window.visualViewport.width:window.innerWidth||1024}function Gc(){return typeof window>"u"?768:window.visualViewport&&typeof window.visualViewport.height=="number"&&window.visualViewport.height>0?window.visualViewport.height:window.innerHeight||768}function wo(r,s=Ao){const o=typeof r=="number"?r:Number(r);return!Number.isFinite(o)||o<=0?s:Math.min(uy,Math.max(cy,Math.round(o)))}function dh(r,s=Za()){if(s<tu){const c=wo(r,eu);return Math.min(15,Math.max(12,c))}return wo(r,Ao)}const Fh=[{id:"esc",label:"ESC",code:ye.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:ye.TAB,type:"key",enabled:!0,title:"Tab"},{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"left",label:"←",code:ye.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:ye.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:ye.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:ye.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"drawer_chords",label:"^C",code:"",type:"drawer",enabled:!0,drawerType:"chords",title:"Quick Ctrl Chords"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"enter",label:"Enter",code:ye.ENTER,type:"key",enabled:!0,title:"Enter / Return"}],fy=[{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"shift",label:"SHIFT",code:"",type:"modifier",enabled:!0,modifierType:"shift",title:"Toggle Shift modifier latch"},{id:"meta",label:"META",code:"\x1B",type:"modifier",enabled:!0,modifierType:"meta",title:"Meta / Cmd key"},{id:"esc",label:"ESC",code:ye.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:ye.TAB,type:"key",enabled:!0,title:"Tab"},{id:"enter",label:"Enter",code:ye.ENTER,type:"key",enabled:!0,title:"Enter / Return"},{id:"backspace",label:"⌫",code:ye.BACKSPACE,type:"key",enabled:!0,title:"Backspace"},{id:"delete",label:"Del",code:ye.DELETE,type:"key",enabled:!0,title:"Delete"},{id:"left",label:"←",code:ye.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:ye.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:ye.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:ye.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"home",label:"Home",code:ye.HOME,type:"key",enabled:!0,title:"Home"},{id:"end",label:"End",code:ye.END,type:"key",enabled:!0,title:"End"},{id:"page_up",label:"PgUp",code:ye.PAGE_UP,type:"key",enabled:!0,title:"Page Up"},{id:"page_down",label:"PgDn",code:ye.PAGE_DOWN,type:"key",enabled:!0,title:"Page Down"},{id:"insert",label:"Ins",code:ye.INSERT,type:"key",enabled:!0,title:"Insert"},{id:"ctrl_c",label:"^C",code:ye.CTRL_C,type:"chord",enabled:!0,title:"Ctrl+C (SIGINT)"},{id:"ctrl_d",label:"^D",code:ye.CTRL_D,type:"chord",enabled:!0,title:"Ctrl+D (EOF/Exit)"},{id:"ctrl_z",label:"^Z",code:ye.CTRL_Z,type:"chord",enabled:!0,title:"Ctrl+Z (SIGTSTP)"},{id:"ctrl_l",label:"^L",code:ye.CTRL_L,type:"chord",enabled:!0,title:"Ctrl+L (Clear Screen)"},{id:"ctrl_a",label:"^A",code:ye.CTRL_A,type:"chord",enabled:!0,title:"Ctrl+A (Beginning of Line)"},{id:"ctrl_e",label:"^E",code:ye.CTRL_E,type:"chord",enabled:!0,title:"Ctrl+E (End of Line)"},{id:"ctrl_k",label:"^K",code:ye.CTRL_K,type:"chord",enabled:!0,title:"Ctrl+K (Kill to End)"},{id:"ctrl_r",label:"^R",code:ye.CTRL_R,type:"chord",enabled:!0,title:"Ctrl+R (Reverse Search)"},{id:"f1",label:"F1",code:ye.F1,type:"fn",enabled:!0,title:"F1"},{id:"f2",label:"F2",code:ye.F2,type:"fn",enabled:!0,title:"F2"},{id:"f3",label:"F3",code:ye.F3,type:"fn",enabled:!0,title:"F3"},{id:"f4",label:"F4",code:ye.F4,type:"fn",enabled:!0,title:"F4"},{id:"f5",label:"F5",code:ye.F5,type:"fn",enabled:!0,title:"F5"},{id:"f6",label:"F6",code:ye.F6,type:"fn",enabled:!0,title:"F6"},{id:"f7",label:"F7",code:ye.F7,type:"fn",enabled:!0,title:"F7"},{id:"f8",label:"F8",code:ye.F8,type:"fn",enabled:!0,title:"F8"},{id:"f9",label:"F9",code:ye.F9,type:"fn",enabled:!0,title:"F9"},{id:"f10",label:"F10",code:ye.F10,type:"fn",enabled:!0,title:"F10"},{id:"f11",label:"F11",code:ye.F11,type:"fn",enabled:!0,title:"F11"},{id:"f12",label:"F12",code:ye.F12,type:"fn",enabled:!0,title:"F12"},{id:"drawer_chords",label:"^C",code:"",type:"drawer",enabled:!0,drawerType:"chords",title:"Quick Ctrl Chords"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"sym_pipe",label:"|",code:"|",type:"symbol",enabled:!0,isPlainChar:!0,title:"Pipe (|)"},{id:"sym_tilde",label:"~",code:"~",type:"symbol",enabled:!0,isPlainChar:!0,title:"Tilde (~)"},{id:"sym_slash",label:"/",code:"/",type:"symbol",enabled:!0,isPlainChar:!0,title:"Slash (/)"},{id:"sym_backslash",label:"\\",code:"\\",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backslash (\\)"},{id:"sym_dash",label:"-",code:"-",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dash (-)"},{id:"sym_underscore",label:"_",code:"_",type:"symbol",enabled:!0,isPlainChar:!0,title:"Underscore (_)"},{id:"sym_dollar",label:"$",code:"$",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dollar ($)"},{id:"sym_ampersand",label:"&",code:"&",type:"symbol",enabled:!0,isPlainChar:!0,title:"Ampersand (&)"},{id:"sym_quote",label:'"',code:'"',type:"symbol",enabled:!0,isPlainChar:!0,title:'Double Quote (")'},{id:"sym_backtick",label:"`",code:"`",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backtick (`)"}];function Pi(){return JSON.parse(JSON.stringify(Fh))}const fh=["esc","tab","ctrl","alt","left","up","down","right","enter","drawer_chords","drawer_symbols","drawer_fn"];function my(r){return r.length!==fh.length?!1:r.every((s,o)=>s.id===fh[o]&&s.enabled!==!1)}function hy(r){if(!Array.isArray(r)||r.length===0)return Pi();const s=r.filter(o=>typeof o=="object"&&o!==null&&typeof o.id=="string"&&typeof o.label=="string"&&typeof o.code=="string");return my(s)?Pi():s}function Qc(r,s){if(s){const o=`keyTitles.${r.id}`,c=s(o);if(c&&c!==o)return c}return r.title||r.label}const Fc='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace',py='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',mh="JetBrains Mono, Menlo, Monaco, Consolas, monospace",Qa="herdr_remote_settings_v1",$i="herdr_remote_session_view_v1",Jh=64,es=4096,Jc={local:{},session:{}};function Co(r,s){if(typeof window>"u")return Jc[r][s]||null;try{return(r==="local"?window.localStorage:window.sessionStorage).getItem(s)}catch{return Jc[r][s]||null}}function sa(r,s,o){if(Jc[r][s]=o,!(typeof window>"u"))try{(r==="local"?window.localStorage:window.sessionStorage).setItem(s,o)}catch(c){console.warn(`Failed to write to ${r}Storage:`,c)}}function by(){return`client-${Math.random().toString(36).substring(2,8)}`}function nu(){const r=Math.random().toString(36).substring(2,10);return`profile-${Date.now().toString(36)}-${r}`}function gy(r,s){return(typeof r=="string"?r.trim().slice(0,Jh):"")||s}function To(r,s){if(!r||typeof r!="object"||Array.isArray(r))return null;const o=r,c=typeof o.wsUrl=="string"?o.wsUrl.trim().slice(0,2048):"",m=typeof o.token=="string"?o.token.slice(0,es):"",f=typeof o.pairCode=="string"?o.pairCode.trim().toUpperCase().slice(0,32):"";if(!c||!c.startsWith("/")&&!/^(?:wss?|https?):\/\//i.test(c)||!m&&!f)return null;const b=Date.now(),p=typeof o.id=="string"&&o.id.length>0?o.id.slice(0,128):nu(),v=typeof o.hostname=="string"&&o.hostname.trim()?o.hostname.trim().slice(0,Jh):`Herdr ${s+1}`;return{id:p,displayName:gy(o.displayName,v),wsUrl:c,token:m,...f?{pairCode:f}:{},...typeof o.hostId=="string"&&o.hostId.trim()?{hostId:o.hostId.trim().slice(0,128)}:{},...typeof o.hostname=="string"&&o.hostname.trim()?{hostname:o.hostname.trim().slice(0,128)}:{},...typeof o.deviceId=="string"&&o.deviceId.trim()?{deviceId:o.deviceId.trim().slice(0,128)}:{},autoReconnect:o.autoReconnect!==!1,createdAt:Number.isFinite(o.createdAt)?Number(o.createdAt):b,lastUsedAt:Number.isFinite(o.lastUsedAt)?Number(o.lastUsedAt):b}}function hh(r,s=0){const o=To({...r,id:r.id||nu()},s);if(!o)throw new Error("a connection profile requires a relay URL and token or pairing code");return o}function ph(r){let s=r.wsUrl.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"").toLowerCase();if(typeof window<"u")try{const o=new URL(r.wsUrl,window.location.origin);o.protocol=o.protocol==="wss:"?"https:":"http:",o.pathname=o.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"")||"/",o.search="",o.hash="",s=o.toString().replace(/\/$/,"").toLowerCase()}catch{}return`${s}::${r.hostId||""}`}function Wh(){return typeof navigator<"u"&&navigator.language&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function Ih(){const r=typeof window<"u"&&window.innerWidth<640;return{wsUrl:"/ws/client",token:"",pairCode:"",clientId:by(),autoReconnect:!0,profiles:[],activeProfileId:"",fontSize:r?eu:Ao,fontFamily:Fc,toolbarVisible:!0,toolbarPosition:"bottom",vibrateOnKeyPress:!0,language:Wh(),virtualKeys:Pi(),adminToken:"",adminTokens:{}}}const yy=["wsUrl","token","pairCode","clientId","autoReconnect","language"],vy=["wsUrl","token","pairCode","autoReconnect"],lu=["fontSize","fontFamily","toolbarVisible","toolbarPosition","vibrateOnKeyPress","virtualKeys","adminToken","adminTokens"],xy=lu.filter(r=>r!=="adminToken"&&r!=="adminTokens"),bh=["theme","colorMode"];function Wc(r){const s=r;if(!bh.some(m=>s[m]!==void 0))return{data:r,changed:!1};const c={...s};for(const m of bh)delete c[m];return{data:c,changed:!0}}function $h(r){if(!r||typeof r!="object"||Array.isArray(r))return{};const s={};for(const[o,c]of Object.entries(r).slice(0,32))typeof c!="string"||c.length===0||(s[o.slice(0,512)]=c.slice(0,es));return s}function Ph(r){var f;const s=[];if((Array.isArray(r.profiles)?r.profiles.slice(0,64):[]).forEach((b,p)=>{const v=To(b,p);v&&!s.some(w=>w.id===v.id)&&s.push(v)}),s.length===0&&(typeof r.token=="string"&&r.token||typeof r.pairCode=="string"&&r.pairCode)){const b=To({id:"profile-migrated",displayName:"Herdr 1",wsUrl:typeof r.wsUrl=="string"&&r.wsUrl.trim()?r.wsUrl:"/ws/client",token:r.token||"",pairCode:r.pairCode||"",autoReconnect:r.autoReconnect!==!1},0);b&&s.push(b)}const c=typeof r.activeProfileId=="string"?r.activeProfileId:"",m=s.some(b=>b.id===c)?c:((f=s[0])==null?void 0:f.id)||"";return{profiles:s,activeProfileId:m}}function ep(){const r=Ih();if(typeof window>"u")return r;let s={};const o=Co("local",Qa);if(o)try{s=JSON.parse(o)}catch(Y){console.warn("Failed to parse localStorage settings:",Y)}const c=Wc(s);c.changed&&(s=c.data,sa("local",Qa,JSON.stringify(s)));let m=null;const f=Co("session",$i);if(f)try{m=JSON.parse(f)}catch(Y){console.warn("Failed to parse sessionStorage settings:",Y)}if(!m){const Y={};for(const R of lu)s[R]!==void 0&&(Y[R]=s[R]);m=Y,sa("session",$i,JSON.stringify(m))}let b=m.fontFamily??s.fontFamily??r.fontFamily;(!b||b===mh||b===py)&&(b=Fc);const p=window.innerWidth<640?eu:Ao,v=m.fontSize??s.fontSize??r.fontSize,w=wo(v,p),y=m.virtualKeys??s.virtualKeys??r.virtualKeys,T=hy(y),K=s.language??r.language,O=K==="zh"||K==="en"?K:Wh(),G=Ph(s),V=G.profiles.find(Y=>Y.id===G.activeProfileId),L=Wc(m);L.changed&&(m=L.data,sa("session",$i,JSON.stringify(m)));const Q=m.toolbarVisible??s.toolbarVisible??r.toolbarVisible,$=m.toolbarPosition??s.toolbarPosition??r.toolbarPosition,I=m.vibrateOnKeyPress??s.vibrateOnKeyPress??r.vibrateOnKeyPress,ie=typeof m.adminToken=="string"?m.adminToken.slice(0,es):typeof s.adminToken=="string"?s.adminToken.slice(0,es):r.adminToken,pe=$h(m.adminTokens),q={...r,...s,...m,wsUrl:(V==null?void 0:V.wsUrl)||(typeof s.wsUrl=="string"?s.wsUrl:r.wsUrl),token:(V==null?void 0:V.token)||"",pairCode:(V==null?void 0:V.pairCode)||"",autoReconnect:(V==null?void 0:V.autoReconnect)??r.autoReconnect,profiles:G.profiles,activeProfileId:G.activeProfileId,clientId:typeof s.clientId=="string"&&s.clientId.trim()?s.clientId.trim().slice(0,128):r.clientId,fontFamily:b,fontSize:w,toolbarVisible:Q,toolbarPosition:$,vibrateOnKeyPress:I,virtualKeys:T,language:O,adminToken:ie,adminTokens:pe};return s.fontFamily===mh&&(s.fontFamily=Fc,sa("local",Qa,JSON.stringify(s))),q}function Bl(r){var K;const o={...ep(),...r};o.adminTokens=$h(o.adminTokens),typeof o.adminToken=="string"&&(o.adminToken=o.adminToken.slice(0,es)),r.fontSize!==void 0&&(o.fontSize=wo(r.fontSize));const c=Ph(o);let m=c.profiles,f=c.activeProfileId;if(vy.some(O=>r[O]!==void 0)){const O=m.findIndex(L=>L.id===f),G=O>=0?{...m[O]}:{id:nu(),displayName:`Herdr ${m.length+1}`,wsUrl:o.wsUrl,token:"",autoReconnect:!0,createdAt:Date.now(),lastUsedAt:Date.now()};G.wsUrl=o.wsUrl,G.token=o.token,G.pairCode=o.pairCode||void 0,G.autoReconnect=o.autoReconnect,G.lastUsedAt=Date.now();const V=To(G,Math.max(O,0));V?O>=0?m[O]=V:(m.push(V),f=V.id):O>=0&&(m=m.filter(L=>L.id!==f),f=((K=m[0])==null?void 0:K.id)||"")}m.length>0&&!m.some(O=>O.id===f)&&(f=m[0].id);const p=m.find(O=>O.id===f);o.profiles=m,o.activeProfileId=f,o.wsUrl=(p==null?void 0:p.wsUrl)||o.wsUrl||"/ws/client",o.token=(p==null?void 0:p.token)||"",o.pairCode=(p==null?void 0:p.pairCode)||"",o.autoReconnect=(p==null?void 0:p.autoReconnect)??o.autoReconnect;const v=Co("local",Qa);let w={};if(v)try{w=JSON.parse(v)}catch{}w=Wc(w).data;for(const O of yy)o[O]!==void 0&&(w[O]=o[O]);w.profiles=m,w.activeProfileId=f,sa("local",Qa,JSON.stringify(w));const y=Co("session",$i);let T={};if(y)try{T=JSON.parse(y)}catch{}for(const O of lu)o[O]!==void 0&&(T[O]=o[O]);sa("session",$i,JSON.stringify(T));for(const O of xy)o[O]!==void 0&&(w[O]=o[O]);return sa("local",Qa,JSON.stringify(w)),o}const Sy={header:{appName:"Herdr",tagline:"remote terminal client",terminalTab:"Terminal",adminTab:"Admin",rttMs:"{rtt}ms",hostLabel:"Host",clientIdLabel:"ID:",copyClientIdTitle:"Click to copy Client ID",languageToggleTitle:"Switch language (EN / 中文)",pairingTitle:"Connection & pairing",settingsTitle:"Terminal settings",virtualKeyboardTitle:"Quick command helper",latencyTitle:"Round-trip latency (RTT)",mainNavigationAria:"Main Navigation",actionKeyboard:"cmd",actionPairing:"link",actionSettings:"cfg",languageShort:"en"},common:{connecting:"Connecting...",connected:"Connected",reconnecting:"Reconnecting...",disconnected:"Disconnected",error:"Error",save:"Save",cancel:"Cancel",close:"Close",done:"Done",retry:"Retry",connect:"Connect",disconnect:"Disconnect",copy:"Copy",copied:"Copied",loading:"Loading...",offline:"Offline",role:"Role",host:"Host",status:"Status",settings:"Settings",admin:"Admin",terminal:"Terminal",pairing:"Pairing",keyBar:"Key bar",quickInput:"Quick input",dismissNotification:"Dismiss notification",closeDialog:"Close dialog",clickToCopy:"Click to copy",controller:"Controller",viewer:"Viewer",live:"Live"},connection:{live:"Live",connecting:"Connecting",reconnecting:"Reconnecting",reconnectNow:"Reconnect now",error:"Error",offline:"Offline",connect:"Connect",retry:"Retry"},role:{controllerMode:"Controller mode active",viewerMode:"Viewer mode",controlActive:"Full Control",viewerReadOnly:"Viewer",viewerWithController:"Viewer (Active: {controllerId})",sharedControl:"Full control",sharedControlDesc:"Every paired window shares this terminal and may type into it.",sharedWindows:"{count} windows",thisWindow:"Window",claimControl:"Claim Control",claimControlTitle:"Claim terminal control",releaseControl:"Release",releaseControlTitle:"Switch to viewer mode",takeoverControl:"Takeover",takeoverControlTitle:"Take over control from {controllerId}",takeoverModalTitle:"Confirm Control Takeover",takeoverModalDesc:"Another client is controlling this terminal.",takeoverModalWarning:"Input focus will transfer to this window.",confirmTakeover:"Confirm Takeover"},statusBanner:{connecting:"Connecting to relay...",reconnectingDefault:"Connection lost. Reconnecting...",reconnectNow:"Reconnect Now",errorDefault:"Unable to connect to relay",disconnected:"Terminal disconnected"},onboarding:{title:"Pair with Herdr Remote",subtitle:"Connect your mobile or browser to your local terminal session",description:"Control Herdr sessions from any browser or phone.",firstTimeSetup:"First-time Setup",authRequired:"Authorization Required",authRequiredDesc:"Pair your device or provide a valid access token.",step1Title:"Generate Pairing Code on Host",step1Desc:"Run on the host running Herdr:",step1CopyPlugin:"Using Herdr Plugin:",step1CopyCli:"Copy CLI Command",step1TuiNote:"Interactive TUI config:",step2Title:"Enter 6-character Pairing Code",step2Placeholder:"e.g. 7X9K2A",step2Note:"Pairing code expires in 5 minutes; credentials are saved automatically.",connectAndPair:"Connect & Pair",connectingAndPairing:"Pairing with Relay...",advancedTitle:"Advanced Options",manualTokenLabel:"Authentication Token",manualTokenPlaceholder:"Optional token (skips pairing code)",wsEndpointLabel:"Relay WebSocket Endpoint",wsEndpointPlaceholder:"/ws/client or wss://your-relay-host/ws/client",clientIdLabel:"Device Client Identifier"},pairing:{title:"Relay Connection & Pairing",addTitle:"Add Herdr Instance",displayNameLabel:"Host Name",displayNamePlaceholder:"e.g. Workstation",displayNameHelp:"This name is stored only in this browser.",credentialsRequired:"Enter a pairing code or device token.",subtitle:"Manage WebSocket endpoints and credentials",pairCodeLabel:"Pairing Code",pairCodeNote:"(6-char code)",pairCodePlaceholder:"e.g. A1B2C3",pairCodeHelp:'Run "herdr-remote pair" on host.',tokenLabel:"Access Token",tokenNote:"(Device secret)",tokenPlaceholder:"Device token...",wsUrlLabel:"Relay WebSocket Endpoint URL",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:"Defaults to same-origin /ws/client",clientIdLabel:"Client Identifier",newIdButton:"New ID",regenerateClientIdTitle:"Regenerate client ID",autoReconnectLabel:"Auto-reconnect",autoReconnectDesc:"Automatically reconnect when disconnected",copyDirectLink:"Copy direct pairing link",saveAndConnect:"Save & Connect"},settings:{title:"Terminal Preferences",subtitle:"Font, size, and touch settings",tabGeneral:"General",tabAppearance:"Appearance & Font",tabVirtualKeys:"Virtual Keys",fontFamilyLabel:"Monospace Font",fontSizeLabel:"Terminal Text Size ({size}px)",fontSizeCompact:"10px (Compact)",fontSizeDefault:"15px (Default)",fontSizeLarge:"24px (Large)",mobileFontNote:"Terminal font scales automatically on small screens for 80-column layout.",colorPassthroughNote:"Terminal colors and cursor style pass through from the host.",touchKeyToolbar:"Touch Key Toolbar",touchKeyToolbarDesc:"Show modifier and navigation keys",touchHaptics:"Haptic Feedback",touchHapticsDesc:"Vibrate on key press",languageLabel:"Language",languageDesc:"Choose English or 简体中文",resetDefaults:"Reset to Defaults",resetDefaultsToast:"Settings reset to defaults",windowZoomSharedNote:"Host view isolation is not active; zoom applies locally.",fontSizeZoomHelp:"Adjusts font size in this window only."},virtualKeyboard:{collapseToolbar:"Collapse Toolbar",expandToolbar:"Expand Toolbar",helperTitle:"Quick Commands",closeHelper:"Close Helper",placeholder:"Type command and press Enter...",sendButton:"Send",clearInput:"Clear Input",customizeTitle:"Custom Key Toolbar",customizeDesc:"Reorder, enable, or disable keys for your toolbar.",enabledKeysCount:"{count} keys enabled",resetLayout:"Reset to Default",addKey:"Add Key",availableKeys:"Available Keys",moveUp:"Move Up",moveDown:"Move Down",enableKey:"Enable Key",disableKey:"Disable Key",deleteKeyTitle:"Remove Key",keyTypeModifier:"Modifier",keyTypeNav:"Navigation",keyTypeAction:"Action",keyTypeChord:"Chord",keyTypeFn:"Function",keyTypeSymbol:"Symbol",fnDrawerTitle:"Function Keys (F1-F12)",chordsDrawerTitle:"Control Chords (^C, ^D, ^Z)",symbolsDrawerTitle:"Symbols (~, |, /, \\)",touchKeyboardShortcuts:"Shortcuts Toolbar",ctrlCTitle:"Ctrl+C (SIGINT)",ctrlDTitle:"Ctrl+D (EOF)",ctrlZTitle:"Ctrl+Z (SIGTSTP)",ctrlLTitle:"Ctrl+L (Clear)",ctrlRTitle:"Ctrl+R (Search)",ctrlATitle:"Ctrl+A (Start of line)",ctrlETitle:"Ctrl+E (End of line)",ctrlKTitle:"Ctrl+K (Kill to end)",badgeSigint:"SIGINT",badgeEof:"EOF",badgeTstp:"SIGTSTP",badgeClear:"CLEAR",badgeSearch:"SEARCH",badgeStart:"START",badgeEnd:"END",badgeKill:"KILL",keyEnter:"Enter"},profiles:{title:"Herdr instances",switcherLabel:"Switch Herdr instance",current:"current",empty:"No paired Herdr instances yet.",addHost:"Add Herdr instance",rename:"Rename instance",remove:"Remove locally",removeConfirm:"Remove this saved connection from this browser?"},mobile:{sessionControls:"Session controls",closeSessionControls:"Close session controls",connectionStatusAria:"Connection status",terminalControlAria:"Terminal control",inputControl:"Input control",settingsAria:"Terminal settings",adminAria:"Admin dashboard",pairingAria:"Connection & pairing",keybarAria:"Toggle key toolbar",quickInputAria:"Toggle quick commands",menu:"Menu",statusBarAria:"Session status bar"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"Connected to Herdr session.",windowAriaLabel:"Terminal Window",bufferAriaLabel:"Terminal Buffer",offlineStatusAria:"Offline Status",releaseControlAria:"Release Control",takeoverControlAria:"Takeover Control",claimControlAria:"Claim Control"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",ctrl:"Toggle Ctrl Lock",alt:"Toggle Alt Lock",shift:"Toggle Shift Lock",meta:"Meta / Cmd",enter:"Enter",backspace:"Backspace",delete:"Delete",left:"Left (←)",up:"Up (↑)",down:"Down (↓)",right:"Right (→)",home:"Home",end:"End",page_up:"Page Up",page_down:"Page Down",insert:"Insert",drawer_chords:"Ctrl Chords",drawer_symbols:"Symbols",drawer_fn:"Function Keys (F1-F12)",ctrl_c:"Ctrl+C (SIGINT)",ctrl_d:"Ctrl+D (EOF)",ctrl_z:"Ctrl+Z (SIGTSTP)",ctrl_l:"Ctrl+L (Clear)",ctrl_a:"Ctrl+A (Start of line)",ctrl_e:"Ctrl+E (End of line)",ctrl_k:"Ctrl+K (Kill to end)",ctrl_r:"Ctrl+R (Search history)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"Pipe (|)",sym_tilde:"Tilde (~)",sym_slash:"Slash (/)",sym_backslash:"Backslash (\\)",sym_dash:"Dash (-)",sym_underscore:"Underscore (_)",sym_dollar:"Dollar ($)",sym_ampersand:"Ampersand (&)",sym_quote:'Quote (")',sym_backtick:"Backtick (`)"},admin:{title:"Admin Dashboard",subtitle:"Connected hosts, paired devices, and relay traffic",returnToTerminal:"Return to Terminal",terminalShells:"Terminal Shells",startedAt:"Started at {time}",accessPanel:"Access",acrossWindows:"across {count} windows",perSecond:"{value}/s",framesPerSecond:"{count} fps",unitDay:"d",unitHour:"h",unitMinute:"m",unitSecond:"s",startedRecently:"Started recently",updatedAt:"Updated at {time}",autoRefresh:"Auto Refresh:",paused:"Paused",refreshNow:"Refresh",connectedHosts:"Connected Hosts",activeUsers:"Active Users",activePtys:"Active PTYs",activeController:"Active Controller",uptime:"Uptime",none:"None",noHost:"No host connected",tabOverview:"Overview",tabClients:"Clients ({count})",tabPtys:"PTY Sessions ({count})",tabDevices:"Paired Devices ({count})",throughput:"Throughput",bytesInTotal:"Total Inbound:",bytesOutTotal:"Total Outbound:",frameRate:"Frame Rate:",hostsTitle:"Hosts ({count})",noHosts:"No hosts connected or paired",hostConnectedDevices:"{count} connected",hostPairedDevices:"{count} paired",hostStatusOnline:"Online",hostStatusBusy:"In use",hostStatusReconnecting:"Reconnecting",hostStatusOffline:"Offline",hostRosterOperatorOnly:"Device list is visible to the relay operator only.",connectedClientsTitle:"Connected Clients ({count})",noClients:"No clients connected",colClientId:"Client ID",colDevice:"Device",colDeviceId:"Device ID",colLastSeen:"Last Seen",colActions:"Actions",unknownDevice:"Unknown Device",pairedDevicesTitle:"Paired Devices ({count})",noDevices:"No paired devices",revokeDevice:"Revoke",revokeConfirm:"Confirm Revocation",revokeFailed:"Revocation failed",colRole:"Role",colIp:"IP Address",colConnectedAt:"Connected At",colTraffic:"Traffic (In/Out)",activePtysTitle:"Active PTY Sessions ({count})",noPtys:"No active PTY sessions",colPtyId:"PTY ID",colPid:"PID",colCommand:"Command",colGrid:"Grid",colCwd:"Working Directory",colViewers:"Windows",copiedJson:"Copied",unauthorizedTitle:"Unauthorized (401/403)",unauthorizedDesc:"GET /api/status requires an authorized device token.",pairingStepsTitle:"Device Pairing:",pairingStepsHelp:"Run pairing command on host to get a code, then enter it here.",enterPairCodeBtn:"Enter Pairing Code",retryFetchBtn:"Retry Status",errorConnecting:"Failed to fetch GET /api/status: {error}",loadingStatus:"Loading status from /api/status...",remoteRelayTitle:"Remote Relay Administration",remoteRelayBadge:"Connected to Remote Relay",remoteRelayNotice:"Connected to remote relay. For server metrics, access the operator dashboard.",remoteRelayEndpoint:"Remote WebSocket Endpoint:",remoteRelayAdminUrl:"Remote Admin URL:",openRemoteAdminBtn:"Open Remote Admin",remoteRelayHelp:"Open remote relay admin dashboard.",relayAdminTitle:"Relay Operator Dashboard",relayAdminTokenLabel:"Relay Admin Token (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"Enter RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"RELAY_ADMIN_TOKEN is not configured on this relay.",relayAdminLoginBtn:"Verify & View Metrics",relayAdminAuthError:"Invalid or unauthorized admin token.",remoteRelayClientNotice:"Terminal client connection. For server metrics, use the operator dashboard.",openOperatorPortal:"Open Operator Dashboard",localWorkstationBadge:"Local Relay",modeLocal:"Local Mode",modeRemote:"Remote Mode",hintTabs:"switch tabs",hintRefresh:"refresh status",hintBack:"return to terminal"},toasts:{connected:"Connected to relay",connectionError:"Connection error",controlGranted:"Control granted",controlDenied:"Request denied: another controller is active",controlRevoked:"Control transferred to another device",pairedSuccess:"Paired successfully",sessionEnded:"Session ended",controlReleased:"Control released",viewerModeWarning:'In viewer mode. Click "Claim Control" first.',clientIdCopied:"Client ID copied: {id}",pairingLinkCopied:"Pairing link copied",switchedLanguage:"Language switched to {lang}",settingsReset:"Settings reset to default",fontReset:"Font reset to default",commandCopied:"Command copied",keyLayoutReset:"Key layout reset"},shortcuts:{title:"Shortcuts",help:"Active outside terminal input area:",terminalInputNote:"Terminal shortcuts pass directly to host PTY."},serverErrors:{auth_required:"Pairing required: enter a pairing code, or a device token that is still valid.",unauthorized:"This device is not authorised for that workstation.",host_offline:"The paired workstation is not connected to this relay.",host_disconnected:"The workstation disconnected.",stale_host:"The workstation stopped answering and was dropped.",too_many_clients:"That workstation has reached its window limit.",rate_limited:"Too many pairing attempts. Wait a minute and try again.",invalid_handshake:"The relay rejected the handshake. Reload the page.",device_revoked:"This device was revoked by the relay operator.",connection_closed:"Connection closed. Reconnecting…",connection_failed:"Could not open a connection to the relay.",host_reconnecting:"The Herdr host is reconnecting.",host_reconnect_timeout:"The Herdr host did not reconnect in time.",host_replaced:"The Herdr host connection was replaced.",slow_client:"This browser was disconnected because it could not keep up.",client_send_failed:"The relay could not send data to this browser.",too_many_hosts:"This relay has reached its host limit."},fontPresets:{system:"System Default",apple:"SF Mono / Menlo",windows:"Consolas",linux:"Liberation Mono",courier:"Courier New",firacode:"Fira Code"},clipboard:{copySelection:"Copy Selection",copyLine:"Copy Line",copyScreen:"Copy Screen",paste:"Paste",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Failed to copy",pasteHint:"Long-press here to paste, then tap Send",pasteSend:"Send",pasteUnavailable:"Clipboard is empty or unavailable",pasteTitle:"Paste Content",pasted:"Pasted"}},wy={header:{appName:"Herdr",tagline:"远程终端客户端",terminalTab:"终端",adminTab:"管理面板",rttMs:"{rtt}ms",hostLabel:"主机",clientIdLabel:"客户端 ID:",copyClientIdTitle:"点击复制客户端 ID",languageToggleTitle:"切换语言 (EN / 中文)",pairingTitle:"连接与配对",settingsTitle:"终端设置",virtualKeyboardTitle:"快捷命令",latencyTitle:"网络延迟 (RTT)",mainNavigationAria:"主导航菜单",actionKeyboard:"命令",actionPairing:"配对",actionSettings:"设置",languageShort:"中"},common:{connecting:"连接中...",connected:"已连接",reconnecting:"重连中...",disconnected:"已断开",error:"错误",save:"保存",cancel:"取消",close:"关闭",done:"完成",retry:"重试",connect:"连接",disconnect:"断开连接",copy:"复制",copied:"已复制",loading:"加载中...",offline:"离线",role:"角色",host:"主机",status:"连接状态",settings:"设置",admin:"管理面板",terminal:"终端",pairing:"配对",keyBar:"按键条",quickInput:"快捷输入",dismissNotification:"关闭通知",closeDialog:"关闭对话框",clickToCopy:"点击复制",controller:"控制端",viewer:"观察者",live:"运行中"},connection:{live:"在线",connecting:"连接中",reconnecting:"正在重连",reconnectNow:"立即重连",error:"连接错误",offline:"离线",connect:"发起连接",retry:"重试"},role:{controllerMode:"控制模式",viewerMode:"观察者模式",controlActive:"控制端",viewerReadOnly:"观察者",viewerWithController:"观察者(控制者: {controllerId})",sharedControl:"完全控制",sharedControlDesc:"所有已配对窗口共享同一个终端,均可输入。",sharedWindows:"{count} 个窗口",thisWindow:"本窗口",claimControl:"获取控制权",claimControlTitle:"获取终端控制权",releaseControl:"释放控制权",releaseControlTitle:"切回观察者模式",takeoverControl:"强占控制权",takeoverControlTitle:"从 {controllerId} 接管控制权",takeoverModalTitle:"确认接管终端控制权?",takeoverModalDesc:"当前已有其他客户端控制该终端。",takeoverModalWarning:"接管后输入焦点切换至当前窗口。",confirmTakeover:"确认接管"},statusBanner:{connecting:"连接 Relay 服务中...",reconnectingDefault:"连接断开,正在重连...",reconnectNow:"立即重连",errorDefault:"无法连接 Relay 服务",disconnected:"会话已断开"},onboarding:{title:"配对 Herdr Remote",subtitle:"连接手机或浏览器至本地终端会话",description:"在浏览器或移动设备中控制 Herdr 会话。",firstTimeSetup:"首次配对",authRequired:"需要认证",authRequiredDesc:"使用配对码配对设备,或提供有效访问令牌。",step1Title:"在 Herdr 宿主机生成配对码",step1Desc:"在运行 Herdr 的主机终端执行:",step1CopyPlugin:"使用 Herdr 插件:",step1CopyCli:"复制 CLI 命令",step1TuiNote:"交互式 TUI 配置:",step2Title:"输入 6 位配对码",step2Placeholder:"例如:7X9K2A",step2Note:"配对码 5 分钟内有效,连接后自动保存凭据。",connectAndPair:"连接并完成配对",connectingAndPairing:"配对中...",advancedTitle:"高级选项",manualTokenLabel:"认证 Token",manualTokenPlaceholder:"可选 Token(跳过配对码)",wsEndpointLabel:"Relay WebSocket 端点",wsEndpointPlaceholder:"/ws/client 或 wss://relay-host/ws/client",clientIdLabel:"客户端标识 (Client ID)"},pairing:{title:"Relay 连接与配对",addTitle:"添加 Herdr 实例",displayNameLabel:"主机名称",displayNamePlaceholder:"例如:工作电脑",displayNameHelp:"名称仅保存在此浏览器中。",credentialsRequired:"请输入配对码或设备令牌。",subtitle:"管理 WebSocket 服务端点与凭证",pairCodeLabel:"配对码",pairCodeNote:"(6 位代码)",pairCodePlaceholder:"例如:A1B2C3",pairCodeHelp:'在主机运行 "herdr-remote pair" 获取。',tokenLabel:"访问 Token",tokenNote:"(设备凭据)",tokenPlaceholder:"设备 Token...",wsUrlLabel:"Relay WebSocket 端点",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:'默认同源端点 "/ws/client"',clientIdLabel:"客户端标识",newIdButton:"生成新 ID",regenerateClientIdTitle:"重新生成客户端 ID",autoReconnectLabel:"掉线自动重连",autoReconnectDesc:"连接断开时自动尝试重连",copyDirectLink:"复制配对链接(含配对码)",saveAndConnect:"保存并连接"},settings:{title:"终端设置",subtitle:"字体、字号与触控管理",tabGeneral:"常规设置",tabAppearance:"终端与字体",tabVirtualKeys:"虚拟按键",fontFamilyLabel:"等宽字体",fontSizeLabel:"终端字号 ({size}px)",fontSizeCompact:"10px (紧凑)",fontSizeDefault:"15px (默认)",fontSizeLarge:"24px (大字号)",mobileFontNote:"小屏设备自动适配字号,保持 80 列完整显示。",colorPassthroughNote:"终端配色与光标样式透传自宿主环境。",touchKeyToolbar:"底部触控按键条",touchKeyToolbarDesc:"显示移动端修饰键与方向键工具栏",touchHaptics:"触控振动反馈",touchHapticsDesc:"移动端按键时轻微震动",languageLabel:"显示语言",languageDesc:"选择 English 或 简体中文",resetDefaults:"恢复默认设置",resetDefaultsToast:"设置已恢复默认",windowZoomSharedNote:"当前宿主未启用视图隔离,字号调整仅影响本地窗口。",fontSizeZoomHelp:"仅调节当前窗口字号,不影响其他窗口。"},virtualKeyboard:{collapseToolbar:"收起按键栏",expandToolbar:"展开按键栏",helperTitle:"快捷命令",closeHelper:"关闭命令助手",placeholder:"输入终端命令并回车...",sendButton:"发送",clearInput:"清除输入内容",customizeTitle:"自定义虚拟按键",customizeDesc:"调整按键顺序与启禁用状态。",enabledKeysCount:"已启用 {count} 个按键",resetLayout:"恢复默认布局",addKey:"添加按键",availableKeys:"可选按键库",moveUp:"前移",moveDown:"后移",enableKey:"启用按键",disableKey:"禁用按键",deleteKeyTitle:"删除按键",keyTypeModifier:"修饰键",keyTypeNav:"导航键",keyTypeAction:"动作键",keyTypeChord:"组合键",keyTypeFn:"功能键",keyTypeSymbol:"符号",fnDrawerTitle:"功能键 (F1-F12)",chordsDrawerTitle:"控制组合键 (^C, ^D, ^Z)",symbolsDrawerTitle:"终端常用符号 (~, |, /, \\)",touchKeyboardShortcuts:"快捷键工具栏",ctrlCTitle:"Ctrl+C (中断)",ctrlDTitle:"Ctrl+D (退出)",ctrlZTitle:"Ctrl+Z (挂起)",ctrlLTitle:"Ctrl+L (清屏)",ctrlRTitle:"Ctrl+R (搜索)",ctrlATitle:"Ctrl+A (行首)",ctrlETitle:"Ctrl+E (行尾)",ctrlKTitle:"Ctrl+K (剪切)",badgeSigint:"中断",badgeEof:"退出",badgeTstp:"挂起",badgeClear:"清屏",badgeSearch:"搜索",badgeStart:"行首",badgeEnd:"行尾",badgeKill:"剪切",keyEnter:"回车"},profiles:{title:"Herdr 实例",switcherLabel:"切换 Herdr 实例",current:"当前",empty:"还没有已配对的 Herdr 实例。",addHost:"添加 Herdr 实例",rename:"重命名实例",remove:"仅本地移除",removeConfirm:"确认从此浏览器移除已保存的连接?"},mobile:{sessionControls:"会话控制",closeSessionControls:"关闭会话控制面板",connectionStatusAria:"连接状态",terminalControlAria:"终端控制权",inputControl:"输入控制权",settingsAria:"终端设置",adminAria:"打开管理面板",pairingAria:"连接与配对设置",keybarAria:"切换触控按键条",quickInputAria:"切换快捷命令",menu:"菜单",statusBarAria:"会话状态栏"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"已连接至 Herdr 会话。",windowAriaLabel:"远程终端窗口",bufferAriaLabel:"xterm 终端缓冲区",offlineStatusAria:"离线状态",releaseControlAria:"释放终端控制权",takeoverControlAria:"强占终端控制权",claimControlAria:"获取终端控制权"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",ctrl:"切换 Ctrl 锁定",alt:"切换 Alt 锁定",shift:"切换 Shift 锁定",meta:"Meta / 命令键",enter:"回车 (Enter)",backspace:"退格 (Backspace)",delete:"删除 (Delete)",left:"左箭头 (←)",up:"上箭头 (↑)",down:"下箭头 (↓)",right:"右箭头 (→)",home:"行首 (Home)",end:"行尾 (End)",page_up:"向上翻页 (Page Up)",page_down:"向下翻页 (Page Down)",insert:"插入 (Insert)",drawer_chords:"常用 Ctrl 组合键",drawer_symbols:"常用特殊符号",drawer_fn:"功能键 (F1-F12)",ctrl_c:"Ctrl+C (中断)",ctrl_d:"Ctrl+D (退出)",ctrl_z:"Ctrl+Z (挂起)",ctrl_l:"Ctrl+L (清屏)",ctrl_a:"Ctrl+A (行首)",ctrl_e:"Ctrl+E (行尾)",ctrl_k:"Ctrl+K (剪切)",ctrl_r:"Ctrl+R (历史搜索)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"管道符 (|)",sym_tilde:"波浪号 (~)",sym_slash:"正斜杠 (/)",sym_backslash:"反斜杠 (\\)",sym_dash:"连字符 (-)",sym_underscore:"下划线 (_)",sym_dollar:"美元符 ($)",sym_ampersand:"与符号 (&)",sym_quote:'双引号 (")',sym_backtick:"反引号 (`)"},admin:{title:"系统管理面板",subtitle:"接入主机、配对设备与中转流量",returnToTerminal:"返回终端",terminalShells:"个终端 Shell",startedAt:"启动于 {time}",accessPanel:"接入概览",acrossWindows:"共 {count} 个窗口",perSecond:"{value}/秒",framesPerSecond:"{count} 帧/秒",unitDay:" 天",unitHour:" 小时",unitMinute:" 分",unitSecond:" 秒",startedRecently:"最近启动",updatedAt:"更新于 {time}",autoRefresh:"自动刷新:",paused:"暂停刷新",refreshNow:"立即刷新",connectedHosts:"接入主机",activeUsers:"活跃用户",activePtys:"活动 PTY",activeController:"活跃控制者",uptime:"运行时间",none:"无",noHost:"未连接主机",tabOverview:"系统概览",tabClients:"客户端列表 ({count})",tabPtys:"PTY 会话 ({count})",tabDevices:"已配对设备 ({count})",throughput:"网络吞吐流量",bytesInTotal:"入站流量:",bytesOutTotal:"出站流量:",frameRate:"帧率统计:",hostsTitle:"主机 ({count})",noHosts:"暂无接入或配对的主机",hostConnectedDevices:"{count} 台在线",hostPairedDevices:"{count} 台已配对",hostStatusOnline:"在线",hostStatusBusy:"使用中",hostStatusReconnecting:"重连中",hostStatusOffline:"离线",hostRosterOperatorOnly:"设备清单仅 Relay 操作员可见。",connectedClientsTitle:"已连接客户端 ({count})",noClients:"当前暂无客户端连接",colClientId:"客户端 ID",colDevice:"设备",colDeviceId:"设备 ID",colLastSeen:"最近活动",colActions:"操作",unknownDevice:"未知设备",pairedDevicesTitle:"已配对设备 ({count})",noDevices:"尚未配对任何设备",revokeDevice:"撤销",revokeConfirm:"确认撤销",revokeFailed:"撤销失败",colRole:"角色",colIp:"IP 地址",colConnectedAt:"连接时间",colTraffic:"网络流量 (入/出)",activePtysTitle:"活动 PTY 终端会话 ({count})",noPtys:"当前无活跃的 PTY 会话",colPtyId:"PTY 标识",colPid:"进程 PID",colCommand:"运行命令",colGrid:"网格规格",colCwd:"工作目录",colViewers:"窗口数",copiedJson:"已复制",unauthorizedTitle:"管理接口未授权 (401/403)",unauthorizedDesc:"访问 GET /api/status 需要已授权的设备 Token。",pairingStepsTitle:"设备配对指引:",pairingStepsHelp:"在主机运行配对命令获取配对码后输入。",enterPairCodeBtn:"输入配对码",retryFetchBtn:"重新获取状态",errorConnecting:"连接 GET /api/status 失败:{error}",loadingStatus:"正在加载系统状态...",remoteRelayTitle:"远程 Relay 服务管理",remoteRelayBadge:"已连接远程 Relay 服务",remoteRelayNotice:"当前连接至远程独立 Relay 服务。如需查看服务端指标,请使用操作员后台。",remoteRelayEndpoint:"远程端点:",remoteRelayAdminUrl:"远程后台地址:",openRemoteAdminBtn:"前往远程管理后台",remoteRelayHelp:"直接访问远程 Relay 管理后台。",relayAdminTitle:"Relay 操作员管理后台",relayAdminTokenLabel:"Relay 管理员令牌 (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"请输入 RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"该 Relay 服务未配置 RELAY_ADMIN_TOKEN。",relayAdminLoginBtn:"验证并查看服务端指标",relayAdminAuthError:"管理员令牌无效或未授权。",remoteRelayClientNotice:"当前为终端客户端连接。如需查看服务端指标,请访问操作员后台。",openOperatorPortal:"打开服务端管理后台",localWorkstationBadge:"本地宿主 Relay",modeLocal:"本地模式",modeRemote:"远程模式",hintTabs:"切换标签页",hintRefresh:"刷新状态",hintBack:"返回终端"},toasts:{connected:"已连接至 Relay 服务",connectionError:"连接发生错误",controlGranted:"已获得控制权",controlDenied:"控制请求被拒绝:已有活跃控制者",controlRevoked:"控制权已转移",pairedSuccess:"设备配对成功,已保存凭证",sessionEnded:"终端会话已结束",controlReleased:"已释放控制权,切回观察者模式",viewerModeWarning:"处于观察者模式,请先获取控制权",clientIdCopied:"客户端 ID 已复制: {id}",pairingLinkCopied:"配对链接已复制",switchedLanguage:"语言已切换为 {lang}",settingsReset:"设置已恢复默认",fontReset:"字体已恢复默认",commandCopied:"命令已复制",keyLayoutReset:"虚拟按键布局已恢复默认"},shortcuts:{title:"WebUI 快捷键",help:"以下快捷键仅在非终端输入区域生效:",terminalInputNote:"终端操作快捷键直接透传至宿主 PTY。"},serverErrors:{auth_required:"需要配对:请输入配对码,或填写仍然有效的设备令牌。",unauthorized:"该设备无权访问此工作站。",host_offline:"已配对的工作站未连接到该 relay。",host_disconnected:"工作站已断开连接。",stale_host:"工作站长时间无响应,已被断开。",too_many_clients:"该工作站的窗口数量已达上限。",rate_limited:"配对尝试过于频繁,请稍后再试。",invalid_handshake:"relay 拒绝了握手,请刷新页面。",device_revoked:"该设备已被 relay 管理员撤销。",connection_closed:"连接已断开,正在重连…",connection_failed:"无法建立到 relay 的连接。",host_reconnecting:"Herdr 主机正在重连。",host_reconnect_timeout:"Herdr 主机未能及时恢复连接。",host_replaced:"Herdr 主机连接已被替换。",slow_client:"由于浏览器处理速度过慢,连接已关闭。",client_send_failed:"Relay 无法向此浏览器发送数据。",too_many_hosts:"此 relay 已达到主机数量上限。"},fontPresets:{system:"系统默认",apple:"Apple SF Mono / Menlo",windows:"Windows Consolas",linux:"Linux Liberation Mono",courier:"Courier New",firacode:"Fira Code"},clipboard:{copySelection:"复制选中",copyLine:"复制本行",copyScreen:"复制整屏",paste:"粘贴",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteHint:"长按此处粘贴,然后按发送",pasteSend:"发送",pasteUnavailable:"剪贴板为空或不可用",pasteTitle:"粘贴内容",pasted:"已粘贴"}},qc={en:Sy,zh:wy};function au(r,s,o){const c=qc[r]||qc.en,m=s.split(".");let f=c;for(const b of m)if(f&&typeof f=="object"&&b in f)f=f[b];else{let p=qc.en;for(const v of m)if(p&&typeof p=="object"&&v in p)p=p[v];else return s;f=p;break}if(typeof f!="string")return s;if(o){let b=f;for(const[p,v]of Object.entries(o))b=b.replaceAll(`{${p}}`,String(v));return b}return f}const gh="#11111b",Ic=[{id:"system",name:"System Default (Recommended)",font:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace'},{id:"apple",name:"Apple SF Mono / Menlo",font:'SFMono-Regular, Menlo, Monaco, "Symbols Nerd Font Mono", monospace'},{id:"windows",name:"Windows Consolas",font:'Consolas, "Lucida Console", "Symbols Nerd Font Mono", monospace'},{id:"linux",name:"Linux Liberation Mono",font:'"Liberation Mono", "DejaVu Sans Mono", "Symbols Nerd Font Mono", monospace'},{id:"courier",name:"Courier New",font:'"Courier New", Courier, "Symbols Nerd Font Mono", monospace'},{id:"firacode",name:"Fira Code (Ligatures)",font:'"Fira Code", "Symbols Nerd Font Mono", monospace'}];function yh(r){if(!r||typeof r!="string")return Ic[0].font;const s=r.trim();if(s.includes("Symbols Nerd Font"))return s;if(/^['"]?monospace['"]?$/i.test(s))return'"Symbols Nerd Font Mono", monospace';const o=/,\s*['"]?monospace['"]?\s*$/i;return o.test(s)?s.replace(o,', "Symbols Nerd Font Mono", monospace'):`${s}, "Symbols Nerd Font Mono", monospace`}function Cy(r){if(!r)return null;const s={};return r.background&&(s.background=r.background,s.cursorAccent=r.background),r.foreground&&(s.foreground=r.foreground),r.cursor&&(s.cursor=r.cursor),r.ansi&&Object.assign(s,r.ansi),Object.keys(s).length===0?null:(s.selectionBackground="rgba(137, 180, 250, 0.35)",s)}function tp(){if(typeof document>"u")return;const r=document.querySelector('meta[name="theme-color"]');document.documentElement.style.colorScheme="dark",r==null||r.setAttribute("content",gh),document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),document.body.classList.add("dark"),document.body.classList.remove("light"),document.body.style.backgroundColor=gh}const Ty=4e3,Ny=3,Ay=4096,Ey=8*1024*1024,np=S.createContext(null);function Va(r){return{wsUrl:r.wsUrl,token:r.token||void 0,pairCode:r.pairCode||void 0,clientId:r.clientId,autoReconnect:r.autoReconnect,reconnectIntervalMs:2e3,maxReconnectAttempts:0,pingIntervalMs:1e4}}const jy=({children:r})=>{const[s,o]=S.useState(ep),[c,m]=S.useState("disconnected"),[f,b]=S.useState(),[p,v]=S.useState(),[w,y]=S.useState("viewer"),[T,K]=S.useState(),[O,G]=S.useState(),[V,L]=S.useState(),[Q,$]=S.useState(null),[I,ie]=S.useState(),[pe,q]=S.useState(null),[Y,R]=S.useState(1),[de,He]=S.useState(0),[Te,be]=S.useState(null),[X,ce]=S.useState(null),[we,j]=S.useState({cols:80,rows:24}),[B,Z]=S.useState([]);S.useEffect(()=>{tp()},[]);const oe=S.useRef(s);oe.current=s;const k=S.useRef(null),Je=S.useRef(!1),Ge=S.useRef(we);Ge.current=we;const me=S.useCallback((z,H)=>au(s.language,z,H),[s.language]),ve=S.useRef(me);ve.current=me;const ke=S.useRef(null),Ne=S.useRef([]),$e=S.useRef(0),zt=S.useCallback(z=>{for(Ne.current.push(z),$e.current+=z.byteLength;Ne.current.length>Ay||$e.current>Ey;){const H=Ne.current.shift();if(!H)break;$e.current-=H.byteLength}},[]),De=S.useCallback(z=>{const H=ke.current;if(H)try{H(z);return}catch(te){console.debug("Terminal output sink threw, buffering chunk instead:",te)}zt(z)},[zt]),ut=S.useRef(De);ut.current=De;const ht=S.useCallback(z=>{ke.current=z;const H=Ne.current;Ne.current=[],$e.current=0;for(let te=0;te<H.length;te++)try{z(H[te])}catch(he){console.debug("Terminal sink threw while flushing, re-buffering the tail:",he);for(let Me=te;Me<H.length;Me++)zt(H[Me]);break}return()=>{ke.current===z&&(ke.current=null)}},[zt]),Xt=S.useCallback(()=>Ne.current.length,[]),_t=S.useCallback(()=>{Ne.current=[],$e.current=0},[]),lt=S.useCallback((z=!0)=>{y("viewer"),K(void 0),G(void 0),L(void 0),$(null),ie(void 0),q(null),R(1),be(null),_t(),z&&He(H=>H+1)},[_t]),Qt=S.useRef([]),Lt=S.useRef(new Map),hn=S.useCallback(z=>{Qt.current=z,Z(z)},[]),ln=S.useCallback(z=>{const H=Lt.current.get(z);H&&(clearTimeout(H),Lt.current.delete(z)),hn(Qt.current.filter(te=>te.id!==z))},[hn]),Vt=S.useRef(ln);Vt.current=ln;const wt=S.useCallback((z,H)=>{const te=Date.now(),he=Qt.current,Me=he.find(bt=>bt.type===z&&bt.message===H),qe=Me?Me.id:`${te}-${Math.random().toString(36).substring(2,6)}`;let Oe;if(Me)Oe=he.map(bt=>bt.id===qe?{...bt,count:bt.count+1,timestamp:te}:bt);else for(Oe=[...he,{id:qe,type:z,message:H,timestamp:te,count:1}];Oe.length>Ny;){const[bt,...Un]=Oe,an=Lt.current.get(bt.id);an&&(clearTimeout(an),Lt.current.delete(bt.id)),Oe=Un}hn(Oe);const st=Lt.current.get(qe);st&&clearTimeout(st),Lt.current.set(qe,setTimeout(()=>Vt.current(qe),Ty))},[hn]),Dn=S.useCallback(z=>{Vt.current(z)},[]),On=S.useRef(!0);S.useEffect(()=>{w==="controller"&&(On.current=!0)},[w]);const Ln=S.useCallback(()=>{On.current&&(On.current=!1,wt("warning",ve.current("toasts.viewerModeWarning")))},[wt]);S.useEffect(()=>{const z=Lt.current;return()=>{for(const H of z.values())clearTimeout(H);z.clear()}},[]);const P=S.useCallback(z=>{const H=Bl(z);oe.current=H,o(H)},[]),Ce=S.useCallback(z=>{P({language:z})},[P]),Se=S.useCallback(z=>{oe.current=z,o(z)},[]),Pe=S.useCallback(z=>{var Me;const H=oe.current,te=hh({...z,wsUrl:z.wsUrl||"/ws/client",token:z.token||"",displayName:z.displayName||`Herdr ${H.profiles.length+1}`,autoReconnect:z.autoReconnect!==!1},H.profiles.length),he=Bl({profiles:[...H.profiles,te],activeProfileId:te.id,wsUrl:te.wsUrl,token:te.token,pairCode:te.pairCode||"",autoReconnect:te.autoReconnect});Se(he),lt(),(Me=k.current)==null||Me.reconnectWith(Va(he))},[Se,lt]),Ft=S.useCallback(z=>{var Me;const H=oe.current,te=H.profiles.find(qe=>qe.id===z);if(!te||te.id===H.activeProfileId)return;const he=Bl({activeProfileId:te.id,wsUrl:te.wsUrl,token:te.token,pairCode:te.pairCode||"",autoReconnect:te.autoReconnect,profiles:H.profiles.map(qe=>qe.id===te.id?{...qe,lastUsedAt:Date.now()}:qe)});Se(he),lt(),(Me=k.current)==null||Me.reconnectWith(Va(he))},[Se,lt]),pn=S.useCallback((z,H)=>{const te=oe.current;if(!te.profiles.find(Oe=>Oe.id===z))return;const Me=H.trim().slice(0,64);if(!Me)return;const qe=Bl({profiles:te.profiles.map(Oe=>Oe.id===z?{...Oe,displayName:Me}:Oe)});Se(qe)},[Se]),Kt=S.useCallback(z=>{var qe;const H=oe.current;if(!H.profiles.some(Oe=>Oe.id===z))return;const te=H.profiles.filter(Oe=>Oe.id!==z),he=te.find(Oe=>Oe.id===H.activeProfileId)||te[0],Me=Bl(he?{profiles:te,activeProfileId:he.id,wsUrl:he.wsUrl,token:he.token,pairCode:he.pairCode||"",autoReconnect:he.autoReconnect}:{profiles:[],activeProfileId:"",wsUrl:"/ws/client",token:"",pairCode:""});Se(Me),z===H.activeProfileId&&(lt(),(qe=k.current)==null||qe.reconnectWith(Va(Me)))},[Se,lt]),ml=S.useCallback(z=>{const H=oe.current,te=H.profiles.find(Gt=>Gt.id===H.activeProfileId),he=z.hostId?ph({wsUrl:H.wsUrl,hostId:z.hostId}):null,Me=he?H.profiles.findIndex(Gt=>ph(Gt)===he):-1,qe=Me>=0?Me:Math.max(0,H.profiles.findIndex(Gt=>Gt.id===H.activeProfileId)),st={...H.profiles[qe]||te||hh({wsUrl:H.wsUrl||"/ws/client",token:"",pairCode:H.pairCode||"PENDING",displayName:`Herdr ${H.profiles.length+1}`},H.profiles.length),token:z.token,pairCode:void 0,...z.hostId?{hostId:z.hostId}:{},...z.deviceId?{deviceId:z.deviceId}:{},lastUsedAt:Date.now()};let bt=[...H.profiles];qe>=0&&qe<bt.length?bt[qe]=st:bt.push(st);const Un=te==null?void 0:te.id;bt=bt.filter((Gt,Bn)=>Bn===qe||Gt.id===st.id?!0:!(Me>=0&&Un&&Gt.id===Un));const an=Bl({profiles:bt,activeProfileId:st.id,wsUrl:st.wsUrl,token:st.token,pairCode:"",autoReconnect:st.autoReconnect});return Se(an),an},[Se]),Xn=S.useCallback(z=>{const H=oe.current,te=H.profiles.find(Oe=>Oe.id===H.activeProfileId);if(!te||!z.hostId&&!z.hostname)return;const he=/^Herdr \d+$/.test(te.displayName),Me={...te,...z.hostId?{hostId:z.hostId}:{},...z.hostname?{hostname:z.hostname}:{},...z.hostname&&he?{displayName:z.hostname}:{}},qe=Bl({profiles:H.profiles.map(Oe=>Oe.id===te.id?Me:Oe)});Se(qe)},[Se]);if(!k.current){const z=new ty(Va(s));k.current=z,z.on("stateChange",(H,te,he)=>{m(H),v(he);const Me=he?`serverErrors.${he}`:null,qe=Me?ve.current(Me):null,Oe=qe&&qe!==Me?qe:te;b(Oe),H==="connected"?wt("success",ve.current("toasts.connected")):H==="error"&&wt("error",Oe||ve.current("toasts.connectionError"))}),z.on("ready",H=>{Je.current&&(_t(),He(te=>te+1)),Je.current=!0,y(H.role),K(H.controllerId),G(H.hostId),L(H.hostname),Xn(H),H.clientId&&ie(H.clientId),$(H.terminalPalette||null)}),z.on("hostReconnecting",H=>{v(H||"host_reconnecting"),b(ve.current(`serverErrors.${H||"host_reconnecting"}`)),y("viewer"),K(void 0),L(void 0),$(null),q(null),R(1),be(null),_t()}),z.on("sessionRestarted",(H,te,he,Me)=>{_t(),L(Me),Xn({hostId:z.getHostId(),hostname:Me}),$(he||null),He(qe=>qe+1)}),z.on("roleChange",(H,te,he,Me)=>{y(H),K(te),he&&G(he),Me&&ie(Me)}),z.on("controlGranted",()=>{y("controller"),wt("success",ve.current("toasts.controlGranted"))}),z.on("controlDenied",H=>{wt("warning",H||ve.current("toasts.controlDenied"))}),z.on("controlRevoked",H=>{y("viewer"),wt("warning",H||ve.current("toasts.controlRevoked"))}),z.on("paired",H=>{const te=ml(H);wt("success",ve.current("toasts.pairedSuccess")),ce(Date.now()),z.reconnectWith(Va(te))}),z.on("exit",(H,te)=>{wt("info",`${ve.current("toasts.sessionEnded")}${te?`: ${te}`:""}${H!==void 0?` (${H})`:""}`)}),z.on("status",H=>{be(H)}),z.on("error",H=>{wt("error",`[${H.code}] ${H.message}`)}),z.on("rttUpdate",H=>{q(H)}),z.on("peerCount",H=>{R(Math.max(1,H))}),z.on("sessionReady",()=>{m("connected")}),z.on("binaryData",H=>{ut.current(H)})}const J=k.current,W=s.profiles.find(z=>z.id===s.activeProfileId);S.useEffect(()=>{var z;(z=k.current)==null||z.updateConfig(Va(s))},[s]);const xe=S.useCallback(z=>{k.current&&(z&&k.current.updateConfig(z),k.current.connect(Ge.current))},[]),Re=S.useCallback(()=>{k.current&&k.current.disconnect()},[]),dt=S.useCallback((z=!1)=>{k.current&&k.current.claimControl(z)},[]),se=S.useCallback(()=>{var z;(z=k.current)==null||z.releaseControl()},[]),Et=S.useCallback(z=>{if(w!=="controller"){Ln();return}k.current&&k.current.sendText(z)},[w,Ln]),pt=S.useCallback(z=>{w!=="controller"&&!Zc(z)||k.current&&k.current.sendBinary(z)},[w]),Jt=S.useCallback((z,H)=>{Ge.current={cols:z,rows:H},j({cols:z,rows:H}),k.current&&k.current.sendResize(z,H)},[]);return u.jsx(np.Provider,{value:{connectionState:c,stateDetail:f,stateCode:p,role:w,controllerId:T,hostId:O,hostname:V,assignedClientId:I,profiles:s.profiles,activeProfileId:s.activeProfileId,activeProfile:W,isController:w==="controller",sharedWindowCount:Y,terminalResetVersion:de,rttMs:pe,statusPayload:Te,lastPairedAt:X,settings:s,hostPalette:Q,terminalDimensions:we,toasts:B,adapter:J,language:s.language,t:me,setLanguage:Ce,connect:xe,disconnect:Re,switchProfile:Ft,addProfileAndConnect:Pe,renameProfile:pn,removeProfile:Kt,claimControl:dt,releaseControl:se,sendKey:Et,sendBinary:pt,sendResize:Jt,updateSettings:P,addToast:wt,removeToast:Dn,warnViewerMode:Ln,subscribeToOutput:ht,getPendingOutputChunkCount:Xt},children:r})};function mt(){const r=S.useContext(np);if(!r)throw new Error("useTerminal must be used within a TerminalProvider");return r}function lp(r){var s,o,c="";if(typeof r=="string"||typeof r=="number")c+=r;else if(typeof r=="object")if(Array.isArray(r)){var m=r.length;for(s=0;s<m;s++)r[s]&&(o=lp(r[s]))&&(c&&(c+=" "),c+=o)}else for(o in r)r[o]&&(c&&(c+=" "),c+=o);return c}function Ry(){for(var r,s,o=0,c="",m=arguments.length;o<m;o++)(r=arguments[o])&&(s=lp(r))&&(c&&(c+=" "),c+=s);return c}const My=(r,s)=>{const o=new Array(r.length+s.length);for(let c=0;c<r.length;c++)o[c]=r[c];for(let c=0;c<s.length;c++)o[r.length+c]=s[c];return o},zy=(r,s)=>({classGroupId:r,validator:s}),ap=(r=new Map,s=null,o)=>({nextPart:r,validators:s,classGroupId:o}),No="-",vh=[],_y="arbitrary..",ky=r=>{const s=Oy(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:c}=r;return{getClassGroupId:b=>{if(b.startsWith("[")&&b.endsWith("]"))return Dy(b);const p=b.split(No),v=p[0]===""&&p.length>1?1:0;return ip(p,v,s)},getConflictingClassGroupIds:(b,p)=>{if(p){const v=c[b],w=o[b];return v?w?My(w,v):v:w||vh}return o[b]||vh}}},ip=(r,s,o)=>{if(r.length-s===0)return o.classGroupId;const m=r[s],f=o.nextPart.get(m);if(f){const w=ip(r,s+1,f);if(w)return w}const b=o.validators;if(b===null)return;const p=s===0?r.join(No):r.slice(s).join(No),v=b.length;for(let w=0;w<v;w++){const y=b[w];if(y.validator(p))return y.classGroupId}},Dy=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=r.slice(1,-1),o=s.indexOf(":"),c=s.slice(0,o);return c?_y+c:void 0})(),Oy=r=>{const{theme:s,classGroups:o}=r;return Ly(o,s)},Ly=(r,s)=>{const o=ap();for(const c in r){const m=r[c];iu(m,o,c,s)}return o},iu=(r,s,o,c)=>{const m=r.length;for(let f=0;f<m;f++){const b=r[f];Uy(b,s,o,c)}},Uy=(r,s,o,c)=>{if(typeof r=="string"){By(r,s,o);return}if(typeof r=="function"){Hy(r,s,o,c);return}Yy(r,s,o,c)},By=(r,s,o)=>{const c=r===""?s:sp(s,r);c.classGroupId=o},Hy=(r,s,o,c)=>{if(Ky(r)){iu(r(c),s,o,c);return}s.validators===null&&(s.validators=[]),s.validators.push(zy(o,r))},Yy=(r,s,o,c)=>{const m=Object.entries(r),f=m.length;for(let b=0;b<f;b++){const[p,v]=m[b];iu(v,sp(s,p),o,c)}},sp=(r,s)=>{let o=r;const c=s.split(No),m=c.length;for(let f=0;f<m;f++){const b=c[f];let p=o.nextPart.get(b);p||(p=ap(),o.nextPart.set(b,p)),o=p}return o},Ky=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,Gy=r=>{if(r<1)return{get:()=>{},set:()=>{}};let s=0,o=Object.create(null),c=Object.create(null);const m=(f,b)=>{o[f]=b,s++,s>r&&(s=0,c=o,o=Object.create(null))};return{get(f){let b=o[f];if(b!==void 0)return b;if((b=c[f])!==void 0)return m(f,b),b},set(f,b){f in o?o[f]=b:m(f,b)}}},$c="!",xh=":",qy=[],Sh=(r,s,o,c,m)=>({modifiers:r,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:c,isExternal:m}),Xy=r=>{const{prefix:s,experimentalParseClassName:o}=r;let c=m=>{const f=[];let b=0,p=0,v=0,w;const y=m.length;for(let V=0;V<y;V++){const L=m[V];if(b===0&&p===0){if(L===xh){f.push(m.slice(v,V)),v=V+1;continue}if(L==="/"){w=V;continue}}L==="["?b++:L==="]"?b--:L==="("?p++:L===")"&&p--}const T=f.length===0?m:m.slice(v);let K=T,O=!1;T.endsWith($c)?(K=T.slice(0,-1),O=!0):T.startsWith($c)&&(K=T.slice(1),O=!0);const G=w&&w>v?w-v:void 0;return Sh(f,O,K,G)};if(s){const m=s+xh,f=c;c=b=>b.startsWith(m)?f(b.slice(m.length)):Sh(qy,!1,b,void 0,!0)}if(o){const m=c;c=f=>o({className:f,parseClassName:m})}return c},Vy=r=>{const s=new Map;return r.orderSensitiveModifiers.forEach((o,c)=>{s.set(o,1e6+c)}),o=>{const c=[];let m=[];for(let f=0;f<o.length;f++){const b=o[f],p=b[0]==="[",v=s.has(b);p||v?(m.length>0&&(m.sort(),c.push(...m),m=[]),c.push(b)):m.push(b)}return m.length>0&&(m.sort(),c.push(...m)),c}},Zy=r=>({cache:Gy(r.cacheSize),parseClassName:Xy(r),sortModifiers:Vy(r),postfixLookupClassGroupIds:Qy(r),...ky(r)}),Qy=r=>{const s=Object.create(null),o=r.postfixLookupClassGroups;if(o)for(let c=0;c<o.length;c++)s[o[c]]=!0;return s},Fy=/\s+/,Jy=(r,s)=>{const{parseClassName:o,getClassGroupId:c,getConflictingClassGroupIds:m,sortModifiers:f,postfixLookupClassGroupIds:b}=s,p=[],v=r.trim().split(Fy);let w="";for(let y=v.length-1;y>=0;y-=1){const T=v[y],{isExternal:K,modifiers:O,hasImportantModifier:G,baseClassName:V,maybePostfixModifierPosition:L}=o(T);if(K){w=T+(w.length>0?" "+w:w);continue}let Q=!!L,$;if(Q){const Y=V.substring(0,L);$=c(Y);const R=$&&b[$]?c(V):void 0;R&&R!==$&&($=R,Q=!1)}else $=c(V);if(!$){if(!Q){w=T+(w.length>0?" "+w:w);continue}if($=c(V),!$){w=T+(w.length>0?" "+w:w);continue}Q=!1}const I=O.length===0?"":O.length===1?O[0]:f(O).join(":"),ie=G?I+$c:I,pe=ie+$;if(p.indexOf(pe)>-1)continue;p.push(pe);const q=m($,Q);for(let Y=0;Y<q.length;++Y){const R=q[Y];p.push(ie+R)}w=T+(w.length>0?" "+w:w)}return w},Wy=(...r)=>{let s=0,o,c,m="";for(;s<r.length;)(o=r[s++])&&(c=op(o))&&(m&&(m+=" "),m+=c);return m},op=r=>{if(typeof r=="string")return r;let s,o="";for(let c=0;c<r.length;c++)r[c]&&(s=op(r[c]))&&(o&&(o+=" "),o+=s);return o},Iy=(r,...s)=>{let o,c,m,f;const b=v=>{const w=s.reduce((y,T)=>T(y),r());return o=Zy(w),c=o.cache.get,m=o.cache.set,f=p,p(v)},p=v=>{const w=c(v);if(w)return w;const y=Jy(v,o);return m(v,y),y};return f=b,(...v)=>f(Wy(...v))},$y=[],Mt=r=>{const s=o=>o[r]||$y;return s.isThemeGetter=!0,s},rp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Py=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ev=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,av=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hl=r=>Py.test(r),ze=r=>!!r&&!Number.isNaN(Number(r)),qn=r=>!!r&&Number.isInteger(Number(r)),Xc=r=>r.endsWith("%")&&ze(r.slice(0,-1)),ul=r=>ev.test(r),up=()=>!0,iv=r=>tv.test(r)&&!nv.test(r),su=()=>!1,sv=r=>lv.test(r),ov=r=>av.test(r),rv=r=>!ee(r)&&!ne(r),cv=r=>r.startsWith("@container")&&(r[10]==="/"&&r[11]!==void 0||r[11]==="s"&&r[16]!==void 0&&r.startsWith("-size/",10)||r[11]==="n"&&r[18]!==void 0&&r.startsWith("-normal/",10)),uv=r=>Yl(r,mp,su),ee=r=>rp.test(r),ia=r=>Yl(r,hp,iv),wh=r=>Yl(r,yv,ze),dv=r=>Yl(r,bp,up),fv=r=>Yl(r,pp,su),Ch=r=>Yl(r,dp,su),mv=r=>Yl(r,fp,ov),po=r=>Yl(r,gp,sv),ne=r=>cp.test(r),qi=r=>ra(r,hp),hv=r=>ra(r,pp),Th=r=>ra(r,dp),pv=r=>ra(r,mp),bv=r=>ra(r,fp),bo=r=>ra(r,gp,!0),gv=r=>ra(r,bp,!0),Yl=(r,s,o)=>{const c=rp.exec(r);return c?c[1]?s(c[1]):o(c[2]):!1},ra=(r,s,o=!1)=>{const c=cp.exec(r);return c?c[1]?s(c[1]):o:!1},dp=r=>r==="position"||r==="percentage",fp=r=>r==="image"||r==="url",mp=r=>r==="length"||r==="size"||r==="bg-size",hp=r=>r==="length",yv=r=>r==="number",pp=r=>r==="family-name",bp=r=>r==="number"||r==="weight",gp=r=>r==="shadow",vv=()=>{const r=Mt("color"),s=Mt("font"),o=Mt("text"),c=Mt("font-weight"),m=Mt("tracking"),f=Mt("leading"),b=Mt("breakpoint"),p=Mt("container"),v=Mt("spacing"),w=Mt("radius"),y=Mt("shadow"),T=Mt("inset-shadow"),K=Mt("text-shadow"),O=Mt("drop-shadow"),G=Mt("blur"),V=Mt("perspective"),L=Mt("aspect"),Q=Mt("ease"),$=Mt("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],pe=()=>[...ie(),ne,ee],q=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],R=()=>[ne,ee,v],de=()=>[Hl,"full","auto",...R()],He=()=>[qn,"none","subgrid",ne,ee],Te=()=>["auto",{span:["full",qn,ne,ee]},qn,ne,ee],be=()=>[qn,"auto",ne,ee],X=()=>["auto","min","max","fr",ne,ee],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...R()],B=()=>[Hl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],Z=()=>[Hl,"screen","full","dvw","lvw","svw","min","max","fit",...R()],oe=()=>[Hl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],k=()=>[r,ne,ee],Je=()=>[...ie(),Th,Ch,{position:[ne,ee]}],Ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],me=()=>["auto","cover","contain",pv,uv,{size:[ne,ee]}],ve=()=>[Xc,qi,ia],ke=()=>["","none","full",w,ne,ee],Ne=()=>["",ze,qi,ia],$e=()=>["solid","dashed","dotted","double"],zt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],De=()=>[ze,Xc,Th,Ch],ut=()=>["","none",G,ne,ee],ht=()=>["none",ze,ne,ee],Xt=()=>["none",ze,ne,ee],_t=()=>[ze,ne,ee],lt=()=>[Hl,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ul],breakpoint:[ul],color:[up],container:[ul],"drop-shadow":[ul],ease:["in","out","in-out"],font:[rv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ul],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ul],shadow:[ul],spacing:["px",ze],text:[ul],"text-shadow":[ul],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hl,ee,ne,L]}],container:["container"],"container-type":[{"@container":["","normal","size",ne,ee]}],"container-named":[cv],columns:[{columns:[ze,ee,ne,p]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:pe()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{"inset-s":de(),start:de()}],end:[{"inset-e":de(),end:de()}],"inset-bs":[{"inset-bs":de()}],"inset-be":[{"inset-be":de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[qn,"auto",ne,ee]}],basis:[{basis:[Hl,"full","auto",p,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,Hl,"auto","initial","none",ee]}],grow:[{grow:["",ze,ne,ee]}],shrink:[{shrink:["",ze,ne,ee]}],order:[{order:[qn,"first","last","none",ne,ee]}],"grid-cols":[{"grid-cols":He()}],"col-start-end":[{col:Te()}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":He()}],"row-start-end":[{row:Te()}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...oe()]}],"min-block-size":[{"min-block":["auto",...oe()]}],"max-block-size":[{"max-block":["none",...oe()]}],w:[{w:[p,"screen",...B()]}],"min-w":[{"min-w":[p,"screen","none",...B()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[b]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",o,qi,ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,gv,dv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xc,ee]}],"font-family":[{font:[hv,fv,s]}],"font-features":[{"font-features":[ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[m,ne,ee]}],"line-clamp":[{"line-clamp":[ze,"none",ne,wh]}],leading:[{leading:[f,...R()]}],"list-image":[{"list-image":["none",ne,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$e(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",ne,ia]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[ze,"auto",ne,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[qn,ne,ee]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Je()}],"bg-repeat":[{bg:Ge()}],"bg-size":[{bg:me()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qn,ne,ee],radial:["",ne,ee],conic:[qn,ne,ee]},bv,mv]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ve()}],"gradient-via-pos":[{via:ve()}],"gradient-to-pos":[{to:ve()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:ke()}],"rounded-s":[{"rounded-s":ke()}],"rounded-e":[{"rounded-e":ke()}],"rounded-t":[{"rounded-t":ke()}],"rounded-r":[{"rounded-r":ke()}],"rounded-b":[{"rounded-b":ke()}],"rounded-l":[{"rounded-l":ke()}],"rounded-ss":[{"rounded-ss":ke()}],"rounded-se":[{"rounded-se":ke()}],"rounded-ee":[{"rounded-ee":ke()}],"rounded-es":[{"rounded-es":ke()}],"rounded-tl":[{"rounded-tl":ke()}],"rounded-tr":[{"rounded-tr":ke()}],"rounded-br":[{"rounded-br":ke()}],"rounded-bl":[{"rounded-bl":ke()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-bs":[{"border-bs":Ne()}],"border-w-be":[{"border-be":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$e(),"hidden","none"]}],"divide-style":[{divide:[...$e(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...$e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,ne,ee]}],"outline-w":[{outline:["",ze,qi,ia]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",y,bo,po]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",T,bo,po]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[ze,ia]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",K,bo,po]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[ze,ne,ee]}],"mix-blend":[{"mix-blend":[...zt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":zt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":De()}],"mask-image-linear-to-pos":[{"mask-linear-to":De()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":De()}],"mask-image-t-to-pos":[{"mask-t-to":De()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":De()}],"mask-image-r-to-pos":[{"mask-r-to":De()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":De()}],"mask-image-b-to-pos":[{"mask-b-to":De()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":De()}],"mask-image-l-to-pos":[{"mask-l-to":De()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":De()}],"mask-image-x-to-pos":[{"mask-x-to":De()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":De()}],"mask-image-y-to-pos":[{"mask-y-to":De()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[ne,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":De()}],"mask-image-radial-to-pos":[{"mask-radial-to":De()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ie()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":De()}],"mask-image-conic-to-pos":[{"mask-conic-to":De()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Je()}],"mask-repeat":[{mask:Ge()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,ee]}],filter:[{filter:["","none",ne,ee]}],blur:[{blur:ut()}],brightness:[{brightness:[ze,ne,ee]}],contrast:[{contrast:[ze,ne,ee]}],"drop-shadow":[{"drop-shadow":["","none",O,bo,po]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",ze,ne,ee]}],"hue-rotate":[{"hue-rotate":[ze,ne,ee]}],invert:[{invert:["",ze,ne,ee]}],saturate:[{saturate:[ze,ne,ee]}],sepia:[{sepia:["",ze,ne,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,ee]}],"backdrop-blur":[{"backdrop-blur":ut()}],"backdrop-brightness":[{"backdrop-brightness":[ze,ne,ee]}],"backdrop-contrast":[{"backdrop-contrast":[ze,ne,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,ne,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,ne,ee]}],"backdrop-invert":[{"backdrop-invert":["",ze,ne,ee]}],"backdrop-opacity":[{"backdrop-opacity":[ze,ne,ee]}],"backdrop-saturate":[{"backdrop-saturate":[ze,ne,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,ne,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ne,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",ne,ee]}],ease:[{ease:["linear","initial",Q,ne,ee]}],delay:[{delay:[ze,ne,ee]}],animate:[{animate:["none",$,ne,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[V,ne,ee]}],"perspective-origin":[{"perspective-origin":pe()}],rotate:[{rotate:ht()}],"rotate-x":[{"rotate-x":ht()}],"rotate-y":[{"rotate-y":ht()}],"rotate-z":[{"rotate-z":ht()}],scale:[{scale:Xt()}],"scale-x":[{"scale-x":Xt()}],"scale-y":[{"scale-y":Xt()}],"scale-z":[{"scale-z":Xt()}],"scale-3d":["scale-3d"],skew:[{skew:_t()}],"skew-x":[{"skew-x":_t()}],"skew-y":[{"skew-y":_t()}],transform:[{transform:[ne,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:pe()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:lt()}],"translate-x":[{"translate-x":lt()}],"translate-y":[{"translate-y":lt()}],"translate-z":[{"translate-z":lt()}],"translate-none":["translate-none"],zoom:[{zoom:[qn,ne,ee]}],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne,ee]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[ze,qi,ia,wh]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},xv=Iy(vv);function F(...r){return xv(Ry(r))}var Sv=Kh();const _e={cursor:"▸",on:"●",off:"○",dot:"·",check:"✓",cross:"✗",warn:"!",arrowRight:"→",arrowLeft:"←",chevronDown:"▾",chevronRight:"▸",ellipsis:"…",meterFull:"█",meterEmpty:"░",tabDivider:"│"},An={ok:{text:"text-tui-ok",edgeL:"border-l-tui-ok",edgeB:"border-b-tui-ok"},warn:{text:"text-tui-warn",edgeL:"border-l-tui-warn",edgeB:"border-b-tui-warn"},bad:{text:"text-tui-bad",edgeL:"border-l-tui-bad",edgeB:"border-b-tui-bad"},idle:{text:"text-tui-faint",edgeL:"border-l-tui-border",edgeB:"border-b-tui-border"},accent:{text:"text-tui-accent",edgeL:"border-l-tui-accent",edgeB:"border-b-tui-accent"},alt:{text:"text-tui-alt",edgeL:"border-l-tui-alt",edgeB:"border-b-tui-alt"},info:{text:"text-tui-info",edgeL:"border-l-tui-info",edgeB:"border-b-tui-info"}},ts={ok:An.ok.text,warn:An.warn.text,bad:An.bad.text,idle:An.idle.text,accent:An.accent.text,alt:An.alt.text,info:An.info.text},Rn=({level:r,className:s})=>u.jsx("span",{"aria-hidden":"true",className:F("select-none leading-none",ts[r],s),children:r==="idle"?_e.off:_e.on}),yp=({className:r})=>u.jsx("span",{"aria-hidden":"true",className:F("select-none text-tui-faint",r),children:_e.dot}),qt=({title:r,aside:s,tone:o="accent",className:c,bodyClassName:m,children:f,...b})=>u.jsxs("fieldset",{className:F("tui-panel tui-block relative min-w-0 border border-tui-border bg-tui-base",r?"px-3 pb-3 pt-1":"p-3",c),...b,children:[r?u.jsx("legend",{className:F("flex items-center gap-2 text-tui font-bold",ts[o]),children:u.jsx("span",{children:r})}):null,s?u.jsx("span",{className:"pointer-events-none absolute -top-[10px] right-2 max-w-[60%] truncate bg-tui-base px-1 text-tui-sm text-tui-faint",children:s}):null,u.jsx("div",{className:F("min-w-0",m),children:f})]}),kn=({label:r,labelWidth:s=16,className:o,children:c})=>u.jsxs("div",{className:F("flex items-baseline gap-2 text-tui",o),children:[u.jsx("span",{className:"shrink-0 truncate text-tui-muted",style:{width:`${s}ch`},title:typeof r=="string"?r:void 0,children:r}),u.jsx("span",{className:"min-w-0 flex-1 text-tui-text",children:c})]}),Fa=({className:r,label:s})=>s?u.jsxs("div",{className:F("flex items-center gap-2",r),children:[u.jsx("span",{className:"h-px w-3 bg-tui-border-dim","aria-hidden":"true"}),u.jsx("span",{className:"text-tui-sm text-tui-faint",children:s}),u.jsx("span",{className:"h-px flex-1 bg-tui-border-dim","aria-hidden":"true"})]}):u.jsx("div",{className:F("h-px w-full bg-tui-border-dim",r),"aria-hidden":"true"}),wv={default:"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",primary:"border-tui-accent text-tui-accent hover:bg-tui-accent hover:text-tui-crust active:bg-tui-accent-dim",danger:"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust active:bg-tui-bad",warn:"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust active:bg-tui-warn",ghost:"border-transparent text-tui-muted hover:text-tui-accent hover:border-tui-border active:bg-tui-selection"},Be=({variant:r="default",brackets:s=!0,glyph:o,block:c=!1,className:m,children:f,type:b="button",...p})=>u.jsxs("button",{type:b,className:F("tui-focusable inline-flex select-none items-center justify-center gap-1.5 border bg-transparent px-2 py-0.5 text-tui font-medium transition-colors","disabled:cursor-not-allowed disabled:border-tui-border-dim disabled:text-tui-faint disabled:hover:bg-transparent",wv[r],c&&"w-full",m),...p,children:[s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"["}):null,o?u.jsx("span",{"aria-hidden":"true",className:"leading-none",children:o}):null,u.jsx("span",{className:"truncate",children:f}),s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"]"}):null]}),Eo=({tone:r="accent",dot:s=!1,className:o,children:c})=>u.jsxs("span",{className:F("inline-flex select-none items-center gap-1 whitespace-nowrap text-tui font-bold uppercase",ts[r],o),children:[s?u.jsx(Rn,{level:r}):null,c]}),ou=({tabs:r,activeId:s,onSelect:o,ariaLabel:c,className:m,labelClassName:f})=>u.jsx("nav",{className:F("flex items-center gap-2",m),"aria-label":c,children:r.map((b,p)=>{const v=b.id===s;return u.jsxs(fl.Fragment,{children:[p>0?u.jsx("span",{"aria-hidden":"true",className:"select-none text-tui-border",children:_e.tabDivider}):null,u.jsxs("button",{type:"button",onClick:()=>o(b.id),"aria-current":v?"page":void 0,"aria-label":b.ariaLabel??b.label,title:b.title,className:F("tui-focusable select-none whitespace-nowrap border-b px-0.5 pb-0.5 text-tui transition-colors",v?"border-tui-accent font-bold text-tui-accent":"border-transparent text-tui-muted hover:border-tui-border-bright hover:text-tui-text"),children:[b.index!==void 0?u.jsx("span",{"aria-hidden":"true",className:F("text-tui-faint",v&&"text-tui-accent"),children:b.index}):null,u.jsx("span",{"aria-hidden":"true",className:F("ml-1",f),children:b.label})]})]},b.id)})}),vp=({hints:r,className:s})=>u.jsx("div",{className:F("flex flex-wrap items-center gap-x-3 gap-y-0.5 text-tui-sm text-tui-faint",s),children:r.map((o,c)=>u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"border border-tui-border-dim px-1 not-italic text-tui-muted",children:o.keys}),u.jsx("span",{children:o.action})]},`${o.keys}-${c}`))}),En=({htmlFor:r,hint:s,className:o,children:c})=>u.jsxs("label",{htmlFor:r,className:F("block text-tui-sm font-bold text-tui-muted",o),children:[c,s?u.jsx("span",{className:"ml-2 font-normal text-tui-faint",children:s}):null]}),jn=fl.forwardRef(({className:r,...s},o)=>u.jsx("input",{ref:o,className:F("tui-input w-full px-2 py-1 text-tui",r),...s}));jn.displayName="Input";const ru=fl.forwardRef(({className:r,children:s,...o},c)=>u.jsx("select",{ref:c,className:F("tui-input w-full px-2 py-1 text-tui",r),...o,children:s}));ru.displayName="Select";const Pc=({checked:r,onChange:s,disabled:o=!1,label:c,description:m,className:f,id:b})=>u.jsxs("label",{className:F("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",o&&"cursor-not-allowed opacity-60",f),children:[u.jsx("input",{id:b,type:"checkbox",className:"sr-only",checked:r,disabled:o,onChange:p=>s(p.target.checked)}),u.jsx("span",{"aria-hidden":"true",className:F("mt-px shrink-0 font-bold leading-tight",r?"text-tui-ok":"text-tui-faint",!o&&"group-hover:text-tui-accent"),children:r?"[x]":"[ ]"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:F("block",r?"text-tui-text":"text-tui-muted"),children:c}),m?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:m}):null]})]}),Nh=({checked:r,onChange:s,name:o,disabled:c=!1,label:m,description:f,className:b})=>u.jsxs("label",{className:F("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",c&&"cursor-not-allowed opacity-60",b),children:[u.jsx("input",{type:"radio",name:o,className:"sr-only",checked:r,disabled:c,onChange:s}),u.jsx("span",{"aria-hidden":"true",className:F("mt-px shrink-0 font-bold leading-tight",r?"text-tui-accent":"text-tui-faint",!c&&"group-hover:text-tui-accent"),children:r?"(•)":"( )"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:F("block",r?"text-tui-text":"text-tui-muted"),children:m}),f?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:f}):null]})]}),Cv=({value:r,width:s=20,tone:o="accent",className:c})=>{const m=Number.isFinite(r)?Math.min(1,Math.max(0,r)):0,f=Math.round(m*s);return u.jsxs("span",{className:F("inline-flex select-none whitespace-pre font-mono leading-none",c),role:"presentation",children:[u.jsx("span",{className:ts[o],children:_e.meterFull.repeat(f)}),u.jsx("span",{className:"text-tui-border",children:_e.meterEmpty.repeat(Math.max(0,s-f))})]})};function cu({columns:r,items:s,rowKey:o,empty:c,className:m}){return s.length===0?u.jsx("div",{className:F("px-1 py-4 text-center text-tui text-tui-faint",m),children:c}):u.jsx("div",{className:F("w-full overflow-x-auto",m),children:u.jsxs("table",{className:"w-full border-collapse text-tui",children:[u.jsx("thead",{children:u.jsx("tr",{className:"border-b border-tui-border",children:r.map(f=>u.jsx("th",{scope:"col",style:f.width?{width:`${f.width}ch`}:void 0,className:F("whitespace-nowrap px-2 py-1 text-tui-sm font-bold text-tui-muted",f.align==="right"?"text-right":"text-left",f.className),children:f.header},f.key))})}),u.jsx("tbody",{children:s.map((f,b)=>u.jsx("tr",{className:"border-b border-tui-border-dim last:border-b-0 hover:bg-tui-selection",children:r.map(p=>u.jsx("td",{className:F("px-2 py-1 align-top text-tui-text",p.align==="right"?"text-right":"text-left",p.className),children:p.render(f,b)},p.key))},o(f,b)))})]})})}const uu=({isOpen:r,onClose:s,title:o,subtitle:c,closeLabel:m,footer:f,hints:b,size:p="md",className:v,children:w})=>{if(!r)return null;const y=p==="sm"?"max-w-md":p==="lg"?"max-w-3xl":"max-w-xl",T=`tui-modal-${o.replace(/\s+/g,"-").toLowerCase()}`,K=u.jsx("div",{className:"fixed inset-0 inset-x-0 z-50 grid place-items-center overflow-y-auto bg-tui-crust/85 p-3 sm:p-6",style:{height:"var(--app-height, 100dvh)",width:"100vw"},role:"dialog","aria-modal":"true","aria-labelledby":T,onMouseDown:O=>{O.target===O.currentTarget&&s()},children:u.jsxs("div",{className:F("flex w-full flex-col border border-tui-border bg-tui-base",y,v),style:{maxHeight:"calc(var(--app-height, 100dvh) - 1.5rem)"},children:[u.jsxs("header",{className:"flex shrink-0 items-center gap-2 border-b border-tui-border bg-tui-mantle px-3 py-1.5",children:[u.jsx("h2",{id:T,className:"truncate text-tui font-bold text-tui-accent",children:o}),c?u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-sm text-tui-faint",children:c}):u.jsx("span",{className:"flex-1"}),u.jsx(Be,{variant:"ghost",onClick:s,"aria-label":m,title:m,children:"esc"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:w}),f||b?u.jsxs("footer",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-tui-border bg-tui-mantle px-3 py-1.5",children:[b?u.jsx(vp,{hints:b}):u.jsx("span",{}),f?u.jsx("div",{className:"flex items-center gap-2",children:f}):null]}):null]})});return typeof document>"u"?K:Sv.createPortal(K,document.body)},So=({tone:r="accent",className:s,children:o,action:c})=>{const m=r==="ok"?_e.check:r==="bad"?_e.cross:r==="warn"?_e.warn:"›",f=An[r].edgeL;return u.jsxs("div",{className:F("flex items-start gap-2 border border-tui-border-dim border-l-2 bg-tui-mantle px-2 py-1.5 text-tui",f,s),children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0 font-bold",ts[r]),children:m}),u.jsx("div",{className:"min-w-0 flex-1 leading-snug text-tui-text",children:o}),c?u.jsx("div",{className:"shrink-0",children:c}):null]})},Tv=({active:r=!1,className:s,children:o})=>u.jsx("span",{className:F("inline-flex min-w-[2ch] select-none items-center justify-center border px-1 text-tui",r?"border-tui-accent bg-tui-accent text-tui-crust":"border-tui-border bg-tui-surface text-tui-muted",s),children:o}),Ah=({items:r,className:s})=>{const o=r.filter(Boolean);return u.jsx("span",{className:F("flex min-w-0 items-center gap-1.5",s),children:o.map((c,m)=>u.jsxs(fl.Fragment,{children:[m>0?u.jsx(yp,{className:"shrink-0"}):null,c]},m))})},xp=({left:r,right:s,className:o})=>u.jsxs("footer",{className:F("relative flex h-[var(--tui-row)] w-full shrink-0 items-center justify-between gap-3 overflow-visible border-t border-tui-border bg-tui-mantle px-2 text-tui-sm",o),children:[u.jsx("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-muted",children:r}),u.jsx("div",{className:"flex shrink-0 items-center gap-3",children:s})]}),Nv=({name:r,tagline:s,aside:o,tabs:c,activeTabId:m,onSelectTab:f,tabsAriaLabel:b,hints:p,footerAside:v,bodyClassName:w,className:y,children:T})=>u.jsxs("div",{className:F("flex h-full min-h-0 w-full flex-col bg-tui-crust",y),children:[u.jsxs("div",{className:"flex h-[var(--tui-row)] shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[u.jsx("span",{className:"shrink-0 font-bold text-tui-accent",children:r}),s?u.jsx("span",{className:"hidden truncate text-tui-sm text-tui-faint sm:block",children:s}):null]}),o?u.jsx("span",{className:"flex shrink-0 items-center gap-2",children:o}):null]}),c&&c.length>0&&m!==void 0&&f?u.jsx("div",{className:"scrollbar-none shrink-0 overflow-x-auto border-b border-tui-border bg-tui-mantle px-2",children:u.jsx(ou,{tabs:c,activeId:m,onSelect:f,ariaLabel:b,className:"gap-3"})}):null,u.jsx("div",{className:F("min-h-0 flex-1 overflow-y-auto p-2",w),children:T}),p||v?u.jsx(xp,{left:p?u.jsx(vp,{hints:p}):null,right:v}):null]}),Eh=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Wa=({className:r,label:s})=>{const[o,c]=fl.useState(0);return fl.useEffect(()=>{const m=setInterval(()=>c(f=>(f+1)%Eh.length),90);return()=>clearInterval(m)},[]),u.jsxs("span",{className:F("inline-flex items-center gap-1.5",r),role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:Eh[o]}),s?u.jsx("span",{children:s}):null]})},go="tui-focusable select-none border border-transparent px-1.5 text-tui uppercase transition-colors",yo="text-tui-muted hover:border-tui-border hover:text-tui-accent",Av="border-tui-accent bg-tui-accent text-tui-crust",Ev=({currentView:r,onNavigate:s,showAdminEntry:o=!0,onOpenPairing:c,onOpenSettings:m,onToggleVirtualKeyboard:f,isVirtualKeyboardOpen:b})=>{const{addToast:p,language:v,setLanguage:w,t:y}=mt(),T=()=>{const O=v==="zh"?"en":"zh";w(O),p("info",au(O,"toasts.switchedLanguage",{lang:O==="zh"?"简体中文":"English"}))},K=[{id:"terminal",label:y("header.terminalTab"),index:1,ariaLabel:y("header.terminalTab")},...o||r==="admin"?[{id:"admin",label:y("header.adminTab"),index:2,ariaLabel:y("header.adminTab")}]:[]];return u.jsx("header",{role:"banner",className:"z-30 w-full shrink-0 select-none overflow-hidden border-b border-tui-border bg-tui-mantle px-2 pt-[max(env(safe-area-inset-top,0px),0.125rem)]",children:u.jsxs("div",{className:"scrollbar-none flex min-h-[var(--tui-row)] items-center gap-2 overflow-x-auto text-tui",children:[u.jsxs("span",{className:"flex shrink-0 items-baseline gap-2",children:[u.jsx("span",{className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("span",{className:"hidden text-tui-sm text-tui-faint sm:inline",children:y("header.tagline")})]}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsx(ou,{tabs:K,activeId:r,onSelect:O=>s(O),ariaLabel:y("header.mainNavigationAria"),className:"shrink-0 gap-3"}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[u.jsx("button",{type:"button",onClick:T,className:F(go,yo),title:y("header.languageToggleTitle"),"aria-label":y("header.languageToggleTitle"),children:y("header.languageShort")}),r==="terminal"&&u.jsx("button",{type:"button",onClick:f,className:F(go,b?Av:yo),title:y("header.virtualKeyboardTitle"),"aria-label":y("header.virtualKeyboardTitle"),children:y("header.actionKeyboard")}),u.jsx("button",{type:"button",onClick:c,className:F(go,yo),title:y("header.pairingTitle"),"aria-label":y("header.pairingTitle"),children:y("header.actionPairing")}),u.jsx("button",{type:"button",onClick:m,className:F(go,yo),title:y("header.settingsTitle"),"aria-label":y("header.settingsTitle"),children:y("header.actionSettings")})]})]})})},vo=({tone:r,glyph:s,message:o,assertive:c=!1,action:m})=>u.jsxs("aside",{className:F("flex w-full items-center justify-between gap-3 border-b bg-tui-mantle px-2 py-0.5 text-tui sm:px-3",An[r].edgeB),"aria-live":c?"assertive":"polite",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",An[r].text),children:s}),u.jsx("span",{className:"truncate text-tui-text",children:o})]}),m]}),jv=()=>{const{connectionState:r,stateDetail:s,connect:o,settings:c,t:m}=mt();return r==="connected"||!c.token&&!c.pairCode&&r==="disconnected"?null:r==="connecting"?u.jsx(vo,{tone:"accent",glyph:u.jsx(Wa,{}),message:m("statusBanner.connecting")}):r==="reconnecting"?u.jsx(vo,{tone:"warn",glyph:u.jsx(Wa,{}),assertive:!0,message:s||m("statusBanner.reconnectingDefault"),action:u.jsx(Be,{variant:"warn",onClick:()=>o(),className:"shrink-0",children:m("statusBanner.reconnectNow")})}):r==="error"?u.jsx(vo,{tone:"bad",glyph:_e.cross,assertive:!0,message:s||m("statusBanner.errorDefault"),action:u.jsx(Be,{variant:"danger",onClick:()=>o(),className:"shrink-0",children:m("common.retry")})}):r==="disconnected"?u.jsx(vo,{tone:"idle",glyph:_e.off,message:m("statusBanner.disconnected"),action:u.jsx(Be,{variant:"primary",onClick:()=>o(),className:"shrink-0",children:m("common.connect")})}):null};var Rv=Hg(),Mv=Yg();const zv=20,_v=6,kv=500,Dv=300,Ia=13,Sp=.602,wp=1.3;function dl(r,s){return Number.isFinite(r)&&r>0?r:s}function jh(r,s,o){return Math.min(o,Math.max(s,r))}function Rh(r){const{width:s,height:o,cellWidth:c,cellHeight:m,minCols:f=zv,minRows:b=_v,maxCols:p=kv,maxRows:v=Dv}=r,w=dl(c,Ia*Sp),y=dl(m,Ia*wp);return{cols:jh(Math.floor(dl(s,0)/w),f,p),rows:jh(Math.floor(dl(o,0)/y),b,v)}}function Ja(r,s=Ia){var c,m,f;if(r)try{const b=r._core,p=(f=(m=(c=b==null?void 0:b._renderService)==null?void 0:c.dimensions)==null?void 0:m.css)==null?void 0:f.cell;if(p&&p.width&&p.width>0&&p.height&&p.height>0)return{cellWidth:p.width,cellHeight:p.height,measured:!0}}catch{}const o=dl(s,Ia);return{cellWidth:Math.round(o*Sp*100)/100,cellHeight:Math.round(o*wp*100)/100,measured:!1}}function Ov(r){var c;const s=(c=r==null?void 0:r.querySelector)==null?void 0:c.call(r,".xterm-viewport");if(!s)return 0;const o=(s.offsetWidth||0)-(s.clientWidth||0);return Number.isFinite(o)&&o>0?o:0}function Vc(r,s,o){if(!r)return{width:s,height:o};let c=0,m=0;if(typeof r.getBoundingClientRect=="function"){const f=r.getBoundingClientRect();c=(f==null?void 0:f.width)||0,m=(f==null?void 0:f.height)||0}return{width:dl(c,dl(r.clientWidth,s)),height:dl(m,dl(r.clientHeight,o))}}function Cp(r,s,o,c){const m=Number.isFinite(c)&&c>.01?c:1;return{clientX:o.left+(r-o.left)/m,clientY:o.top+(s-o.top)/m}}function Xi(r){var s,o;if(!r)return!1;try{const c=r.modes;if(c&&typeof c.mouseTrackingMode=="string"&&c.mouseTrackingMode!=="none")return!0;const m=r._core;if((s=m==null?void 0:m._coreMouseService)!=null&&s.areMouseEventsActive||(o=m==null?void 0:m.coreMouseService)!=null&&o.areMouseEventsActive||m!=null&&m.mouseMode&&m.mouseMode!=="none")return!0}catch{}return!1}function Lv(r,s){const o=s.button??0,c=s.buttons??(r==="mouseup"?0:1);return new MouseEvent(r,{bubbles:!0,cancelable:!0,clientX:s.clientX,clientY:s.clientY,screenX:s.clientX,screenY:s.clientY,button:o,buttons:c})}function Mh(r,s,o){const c=Lv(s,o);return r.dispatchEvent(c)}class Uv{constructor(s){Fe(this,"options");Fe(this,"state","idle");Fe(this,"startX",0);Fe(this,"startY",0);Fe(this,"lastX",0);Fe(this,"lastY",0);Fe(this,"activeTarget",null);Fe(this,"longPressTimer",null);Fe(this,"capturedPointerId",null);Fe(this,"captureElement",null);Fe(this,"scrollRemainderY",0);this.options={longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,...s}}getState(){return this.state}setGestureState(s){var o,c;this.state!==s&&(this.state=s,(c=(o=this.options).onGestureStateChange)==null||c.call(o,s))}getActiveBuffer(s){var o;try{return((o=s.buffer)==null?void 0:o.active)||null}catch{return null}}getViewportY(s){var c;const o=(c=this.getActiveBuffer(s))==null?void 0:c.viewportY;return typeof o=="number"&&Number.isFinite(o)?o:null}blurTerminal(s){var o;try{(o=s.blur)==null||o.call(s)}catch{}}getLogicalCoordinates(s,o){const c=this.options.getScale?this.options.getScale():1,m=this.options.getSurfaceElement?this.options.getSurfaceElement():null;if(c!==1&&m&&typeof m.getBoundingClientRect=="function"){const f=m.getBoundingClientRect();return Cp(s,o,f,c)}return{clientX:s,clientY:o}}getViewportElement(s){var m;const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(o==null?void 0:o.querySelector(".xterm-viewport"))||((m=s.element)==null?void 0:m.querySelector(".xterm-viewport"))||null}isInputLineHit(s,o){var $;const c=($=o.buffer)==null?void 0:$.active,m=this.options.getSurfaceElement?this.options.getSurfaceElement():null,f=(m==null?void 0:m.querySelector(".xterm-screen"))||o.element||m,b=Ja(o);if(!f||typeof f.getBoundingClientRect!="function"||b.cellHeight<=0)return!1;const p=f.getBoundingClientRect(),v=this.getLogicalCoordinates(s.clientX,s.clientY),w=p.width>0&&p.height>0;if(![c==null?void 0:c.cursorY,c==null?void 0:c.viewportY,c==null?void 0:c.baseY].every(I=>typeof I=="number"&&Number.isFinite(I)))return!1;const T=c==null?void 0:c.cursorY,K=c==null?void 0:c.viewportY,G=(c==null?void 0:c.baseY)+T-K,V=p.top+G*b.cellHeight,L=V+b.cellHeight,Q=Number(o.rows);return G>=0&&(!Number.isFinite(Q)||G<Q)&&v.clientY>=V-2&&v.clientY<=L+2&&(!w||v.clientX>=p.left&&v.clientX<=p.right)}resolveDispatchTarget(s,o){var p;const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,m=(c==null?void 0:c.querySelector(".xterm-screen"))||o.querySelector(".xterm-screen")||null,f=((p=m==null?void 0:m.closest)==null?void 0:p.call(m,".xterm"))||null;let b=null;return typeof document<"u"&&typeof document.elementFromPoint=="function"&&(b=document.elementFromPoint(s.clientX,s.clientY)),b&&f&&(b===f||f.contains(b))?b:m||c||o}getMouseReport(s,o){const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,m=(c==null?void 0:c.querySelector(".xterm-screen"))||o.element;if(!m||typeof m.getBoundingClientRect!="function")return null;const f=m.getBoundingClientRect(),b=this.getLogicalCoordinates(s.clientX,s.clientY),p=Ja(o);if(p.cellWidth<=0||p.cellHeight<=0)return null;const v=Math.max(1,f.width||o.cols*p.cellWidth),w=Math.max(1,f.height||o.rows*p.cellHeight),y=Math.max(0,Math.min(v-1,b.clientX-f.left)),T=Math.max(0,Math.min(w-1,b.clientY-f.top)),K=Math.max(0,Math.min(o.cols-1,Math.floor(y/p.cellWidth))),O=Math.max(0,Math.min(o.rows-1,Math.floor(T/p.cellHeight)));return{col:K,row:O,x:Math.floor(y),y:Math.floor(T),button:0,action:0}}getCoreMouseService(s){var c,m;const o=s;return o.coreMouseService||((c=o._core)==null?void 0:c.coreMouseService)||((m=o._core)==null?void 0:m._coreMouseService)||null}getCoreService(s){var c;const o=s;return o.coreService||((c=o._core)==null?void 0:c.coreService)||null}getWheelDispatchTarget(s){const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(o==null?void 0:o.querySelector(".xterm"))||s.element||null}dispatchWheel(s,o,c,m){const f=this.getWheelDispatchTarget(c);if(!f||typeof WheelEvent>"u"||o===0)return!1;const b=this.getLogicalCoordinates(s.clientX,s.clientY),p=o<0?-1:1;let v=0;for(let w=0;w<Math.abs(o);w+=1)try{const y=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:b.clientX,clientY:b.clientY,deltaX:0,deltaY:p,deltaMode:1,ctrlKey:!!(m!=null&&m.ctrlKey),altKey:!!(m!=null&&m.altKey),shiftKey:!!(m!=null&&m.shiftKey)});f.dispatchEvent(y),v+=1}catch{return v>0}return v>0}emitWheel(s,o,c,m){if(o===0)return!1;if(this.dispatchWheel(s,o,c,m))return!0;const f=this.getCoreMouseService(c);if(!(f!=null&&f.triggerMouseEvent))return!1;let b=0;for(let p=0;p<Math.abs(o);p+=1){const v=this.getMouseReport(s,c);v&&(v.button=4,v.action=o<0?0:1,v.ctrl=!!(m!=null&&m.ctrlKey),v.alt=!!(m!=null&&m.altKey),v.shift=!!(m!=null&&m.shiftKey),f.triggerMouseEvent(v)&&(b+=1))}return b>0}scrollAlternateBuffer(s,o,c,m){var b;if(o===0)return"none";const f=Xi(c);if(!f&&!this.options.getIsController())return"none";if(this.emitWheel(s,o,c,m))return f?"application-mouse":"application-keys";if(!f){const p=this.getCoreService(c);if(!(p!=null&&p.triggerDataEvent))return"none";const w=`\x1B${!!((b=p.decPrivateModes)!=null&&b.applicationCursorKeys)?"O":"["}${o<0?"A":"B"}`;return p.triggerDataEvent(w.repeat(Math.abs(o)),!0),"application-keys"}return"none"}emitMouse(s,o,c){const m=this.options.getTerminal();if(!m)return;const f=this.getCoreMouseService(m);if(f!=null&&f.triggerMouseEvent){const p=this.getMouseReport(o,m);p&&(p.action=s==="mousedown"?1:s==="mouseup"?0:32,p.ctrl=!!(c!=null&&c.ctrlKey),p.alt=!!(c!=null&&c.altKey),p.shift=!!(c!=null&&c.shiftKey),f.triggerMouseEvent(p));return}if(this.options.allowSyntheticMouseFallback===!1||!this.activeTarget)return;const b=this.getLogicalCoordinates(o.clientX,o.clientY);Mh(this.activeTarget,s,{clientX:b.clientX,clientY:b.clientY,button:0,buttons:s==="mouseup"?0:1})}beginGesture(s,o){this.startX=s.clientX,this.startY=s.clientY,this.lastX=s.clientX,this.lastY=s.clientY,this.setGestureState("pending"),this.scrollRemainderY=0,this.activeTarget=this.resolveDispatchTarget(s,o),this.clearLongPressTimer(),this.longPressTimer=setTimeout(()=>{var c,m;this.state==="pending"&&(this.setGestureState("longpress"),(m=(c=this.options).onLongPress)==null||m.call(c,{clientX:this.startX,clientY:this.startY}))},this.options.longPressDelayMs)}moveGesture(s,o){var w,y,T,K;if(this.state==="longpress"){(y=(w=this.options).onSelectionExtend)==null||y.call(w,{clientX:s.clientX,clientY:s.clientY}),o!=null&&o.cancelable&&((T=o.preventDefault)==null||T.call(o));return}if(this.state==="idle")return;const c=s.clientX-this.startX,m=s.clientY-this.startY,f=Math.hypot(c,m);if(this.state==="scrolling"){this.scrollGesture(s,o);return}const b=this.options.getTerminal(),p=this.options.getIsController(),v=Xi(b);if(!(f<=(this.options.dragThresholdPx||8))){if(this.clearLongPressTimer(),Math.abs(m)>=Math.abs(c)||!v||!p){this.setGestureState("scrolling"),b&&this.blurTerminal(b),this.lastX=s.clientX,this.lastY=this.startY,this.scrollRemainderY=0,this.scrollGesture(s,o);return}if(v&&p){this.state==="pending"&&(this.setGestureState("dragging"),this.emitMouse("mousedown",{clientX:this.startX,clientY:this.startY},o)),this.state==="dragging"&&(this.lastX=s.clientX,this.lastY=s.clientY,this.emitMouse("mousemove",s,o),o!=null&&o.cancelable&&((K=o.preventDefault)==null||K.call(o)));return}this.lastX=s.clientX,this.lastY=s.clientY}}scrollGesture(s,o){var G,V,L;const c=this.options.getTerminal();if(!c)return;const m=s.clientY-this.lastY;this.lastX=s.clientX,this.lastY=s.clientY;const f=Ja(c),b=f.measured?f.cellHeight:this.options.scrollLineHeightPx||f.cellHeight||18;this.scrollRemainderY+=m;const p=Math.trunc(this.scrollRemainderY/b),v=-p;let w=!1,y="none";const T=this.getActiveBuffer(c),K=Xi(c);if(v!==0){if((T==null?void 0:T.type)==="alternate")y=this.scrollAlternateBuffer(s,v,c,o),w=y!=="none";else{const Q=this.getViewportY(c);c.scrollLines(v);const $=this.getViewportY(c);y="buffer",w=Q===null||$===null||Q!==$}this.scrollRemainderY-=p*b}const O=this.getViewportElement(c);(V=(G=this.options).onGestureScroll)==null||V.call(G,{deltaY:m,lines:v,viewportY:this.getViewportY(c),scrollTop:(O==null?void 0:O.scrollTop)??null,scrollHeight:(O==null?void 0:O.scrollHeight)??null,clientHeight:(O==null?void 0:O.clientHeight)??null,moved:w,bufferType:(T==null?void 0:T.type)||null,baseY:typeof(T==null?void 0:T.baseY)=="number"?T.baseY:null,cursorY:typeof(T==null?void 0:T.cursorY)=="number"?T.cursorY:null,hasScrollback:typeof(T==null?void 0:T.hasScrollback)=="boolean"?T.hasScrollback:null,mouseTracking:K,scrollMode:y}),o!=null&&o.cancelable&&((L=o.preventDefault)==null||L.call(o))}endGesture(s,o){var b,p,v;this.clearLongPressTimer();const c=this.options.getTerminal(),m=this.options.getIsController(),f=Xi(c);if(this.state==="pending"){if(f&&m){const y={clientX:this.startX,clientY:this.startY};this.emitMouse("mousedown",y,o),this.emitMouse("mouseup",y,o)}const w={clientX:this.startX,clientY:this.startY};m&&c&&this.isInputLineHit(w,c)&&((p=(b=this.options).onFocus)==null||p.call(b))}else if(this.state==="dragging"&&f&&m){const w=s??{clientX:this.lastX,clientY:this.lastY};this.emitMouse("mouseup",w,o),o!=null&&o.cancelable&&((v=o.preventDefault)==null||v.call(o))}this.reset()}handlePointerDown(s,o){if(s.pointerType==="mouse")return!1;if(!s.isPrimary)return this.releasePointerCapture(),this.reset(),!1;if(s.cancelable&&s.preventDefault(),this.beginGesture(s,o),s.pointerType!=="touch")try{typeof o.setPointerCapture=="function"&&(o.setPointerCapture(s.pointerId),this.capturedPointerId=s.pointerId,this.captureElement=o)}catch{}return!0}handlePointerMove(s){s.pointerType==="mouse"||this.state==="idle"||this.moveGesture(s,s)}handlePointerUp(s){s.pointerType==="mouse"||this.state==="idle"||(this.releasePointerCapture(),this.endGesture(s,s))}handlePointerCancel(s){s&&s.pointerType==="mouse"||(this.releasePointerCapture(),this.cancelGesture())}handleTouchStart(s,o){if(s.touches.length!==1){this.reset();return}s.cancelable&&s.preventDefault(),this.beginGesture(s.touches[0],o)}handleTouchMove(s){s.touches.length===1&&this.moveGesture(s.touches[0],s)}handleTouchEnd(s){s.cancelable&&s.preventDefault(),this.endGesture(null,s)}handleTouchCancel(){this.cancelGesture()}cancelGesture(){this.clearLongPressTimer();const s=this.options.getTerminal(),o=this.options.getIsController(),c=Xi(s);if(this.state==="dragging"&&c&&o&&this.activeTarget){const m=this.getLogicalCoordinates(this.lastX,this.lastY);Mh(this.activeTarget,"mouseup",{clientX:m.clientX,clientY:m.clientY,button:0,buttons:0})}this.reset()}releasePointerCapture(){const s=this.captureElement,o=this.capturedPointerId;if(this.captureElement=null,this.capturedPointerId=null,!(!s||o===null))try{typeof s.releasePointerCapture=="function"&&(typeof s.hasPointerCapture!="function"||s.hasPointerCapture(o))&&s.releasePointerCapture(o)}catch{}}clearLongPressTimer(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}reset(){this.clearLongPressTimer(),this.releasePointerCapture(),this.setGestureState("idle"),this.activeTarget=null}}var zh=Kg(),Bv=Gg();function Hv(r,s){if(s.coarsePointer)return{kind:"dom",dispose:()=>{}};try{const o=new Bv.WebglAddon;let c=null;return o.onContextLoss(()=>{var m;try{o.dispose()}catch{}try{c=new zh.CanvasAddon,r.loadAddon(c)}catch(f){console.debug("Canvas fallback failed after WebGL context loss:",f)}(m=s.onRendererSwapped)==null||m.call(s)}),r.loadAddon(o),{kind:"webgl",dispose:()=>{for(const m of[c,o])try{m==null||m.dispose()}catch{}}}}catch(o){console.debug("WebGL renderer unavailable, falling back to canvas:",o)}try{const o=new zh.CanvasAddon;return r.loadAddon(o),{kind:"canvas",dispose:()=>{try{o.dispose()}catch{}}}}catch(o){console.debug("Canvas renderer unavailable, using the DOM renderer:",o)}return{kind:"dom",dispose:()=>{}}}function _h(r,s){const o=typeof window<"u"?window:void 0,c=o&&typeof o.devicePixelRatio=="number"&&o.devicePixelRatio>0?o.devicePixelRatio:1,m=o&&o.visualViewport&&typeof o.visualViewport.scale=="number"&&o.visualViewport.scale>0?o.visualViewport.scale:1,f=Math.max(0,r.width),b=Math.max(0,r.height),p=Math.round(f*c*100)/100,v=Math.round(b*c*100)/100;return{dpr:c,scale:m,cssWidth:f,cssHeight:b,physicalWidth:p,physicalHeight:v}}function Yv(r){const{lastSnapshot:s,currentSnapshot:o,physicalTolerancePx:c=6}=r;if(!s)return{shouldIgnore:!1,isVisualZoom:!1,reason:"initial"};const m=Math.abs(o.scale-s.scale)>.01,f=Math.abs(o.scale-1)>.01;if(m||f)return{shouldIgnore:!0,isVisualZoom:!0,reason:"visual_pinch_zoom"};if(Math.abs(o.dpr-s.dpr)>.01){const w=Math.abs(o.physicalWidth-s.physicalWidth),y=Math.abs(o.physicalHeight-s.physicalHeight);if(w<=c&&y<=c)return{shouldIgnore:!0,isVisualZoom:!0,reason:"dpr_zoom"}}const p=Math.abs(o.cssWidth-s.cssWidth),v=Math.abs(o.cssHeight-s.cssHeight);return p<1&&v<1?{shouldIgnore:!0,isVisualZoom:!1,reason:"no_box_change"}:{shouldIgnore:!1,isVisualZoom:!1,reason:"genuine_resize"}}const Kv=" ()[]{}'\"\\`";function kh(r,s,o,c=1){var L,Q;if(!s||!((L=s.buffer)!=null&&L.active)||s.cols<=0||s.rows<=0)return null;const m=o||((Q=s.element)==null?void 0:Q.querySelector(".xterm-screen"))||s.element;if(!m||typeof m.getBoundingClientRect!="function")return null;const f=m.getBoundingClientRect(),b=Cp(r.clientX,r.clientY,f,c),p=Ja(s);if(p.cellWidth<=0||p.cellHeight<=0)return null;const v=Math.max(1,f.width||s.cols*p.cellWidth),w=Math.max(1,f.height||s.rows*p.cellHeight),y=Math.max(0,Math.min(v-1,b.clientX-f.left)),T=Math.max(0,Math.min(w-1,b.clientY-f.top)),K=Math.max(0,Math.min(s.cols-1,Math.floor(y/p.cellWidth))),O=Math.max(0,Math.min(s.rows-1,Math.floor(T/p.cellHeight))),V=(s.buffer.active.viewportY??0)+O;return{col:K,bufferRow:V}}function Gv(r,s){if(!r||r.length===0||r==="\0")return!0;for(const o of r)if(o==="\0"||/\s/.test(o)||s.includes(o))return!0;return!1}function qv(r,s,o){var K,O;if(!r||!((K=r.buffer)!=null&&K.active)||s<0||s>=r.cols)return null;const c=r.buffer.active.getLine(o);if(!c)return null;const m=((O=r.options)==null?void 0:O.wordSeparator)??Kv,f=new Array(r.cols).fill(null),b=Math.min(r.cols,c.length);let p=0;for(;p<b;){const G=c.getCell(p);if(!G){f[p]={startCol:p,endCol:p+1,isSeparator:!0},p++;continue}const V=G.getWidth();if(V===0){f[p]||(f[p]={startCol:p,endCol:p+1,isSeparator:!0}),p++;continue}const L=G.getChars(),Q=Gv(L,m),$=Math.min(r.cols,p+V),I={startCol:p,endCol:$,isSeparator:Q};for(let ie=p;ie<$;ie++)f[ie]=I;p+=Math.max(1,V)}for(let G=b;G<r.cols;G++)f[G]||(f[G]={startCol:G,endCol:G+1,isSeparator:!0});const v=f[s];if(!v||v.isSeparator)return null;let w=v.startCol;for(;w>0;){const G=f[w-1];if(G&&!G.isSeparator)w=G.startCol;else break}let y=v.endCol;for(;y<r.cols;){const G=f[y];if(G&&!G.isSeparator)y=G.endCol;else break}const T=y-w;return T<=0?null:{startCol:w,length:T}}function Xv(r){var f;if(!r||!((f=r.buffer)!=null&&f.active))return"";const s=r.buffer.active,o=s.viewportY??0,c=r.rows,m=[];for(let b=0;b<c;b++){const p=s.getLine(o+b);m.push(p?p.translateToString(!0):"")}for(;m.length>0&&m[m.length-1]==="";)m.pop();return m.join(`
|
|
34
|
+
`)}async function oa(r){if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")try{return await navigator.clipboard.writeText(r),"clipboard"}catch{}if(typeof document<"u"&&typeof document.execCommand=="function"){let s=null,o=null,c=null;try{if(s=document.createElement("textarea"),s.style.userSelect="text",s.style.webkitUserSelect="text",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="1px",s.style.height="1px",s.style.padding="0",s.style.border="none",s.style.outline="none",s.style.boxShadow="none",s.style.background="transparent",s.style.opacity="0",s.style.fontSize="16px",s.setAttribute("readonly",""),s.setAttribute("aria-hidden","true"),s.value=r,typeof window<"u"&&typeof window.getSelection=="function"&&(c=window.getSelection(),c&&c.rangeCount>0&&(o=c.getRangeAt(0))),document.body.appendChild(s),typeof navigator<"u"&&(/iPad|iPhone|iPod/.test(navigator.userAgent||"")||navigator.platform==="MacIntel"&&(navigator.maxTouchPoints||0)>1)){const b=document.createRange();b.selectNodeContents(s),c&&(c.removeAllRanges(),c.addRange(b)),s.setSelectionRange(0,r.length)}else s.focus({preventScroll:!0}),s.select();if(document.execCommand("copy"))return"exec"}catch{}finally{s&&s.parentNode&&s.parentNode.removeChild(s),c&&(c.removeAllRanges(),o&&c.addRange(o))}}return"failed"}async function Vv(){if(!(typeof window>"u"||window.isSecureContext!==!1)||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")return{ok:!1,reason:"insecure"};try{const s=await navigator.clipboard.readText();return!s||s.length===0?{ok:!1,reason:"empty"}:{ok:!0,text:s}}catch(s){return typeof window<"u"&&window.isSecureContext===!1?{ok:!1,reason:"insecure"}:(s==null?void 0:s.name)==="SecurityError"?{ok:!1,reason:"insecure"}:{ok:!1,reason:"denied"}}}const Vi="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",Zi="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",Zv=({anchorPoint:r,hasSelection:s,isController:o,vibrateOnKeyPress:c=!1,onCopySelection:m,onCopyLine:f,onCopyScreen:b,onPaste:p,onClose:v})=>{const{t:w}=mt(),y=S.useRef(null),[T,K]=S.useState(null);S.useEffect(()=>{if(c&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[c]),S.useLayoutEffect(()=>{const L=y.current;if(!L||!L.parentElement)return;const Q=L.parentElement.getBoundingClientRect(),$=L.getBoundingClientRect(),I=$.width||208,ie=$.height||220,pe=Q.width,q=Q.height;let Y=r.x-I/2;Y=Math.max(8,Math.min(Math.max(8,pe-I-8),Y));let R=r.y-ie-8;R<8&&(R=r.y+8),R=Math.max(8,Math.min(Math.max(8,q-ie-8),R)),K({x:Y,y:R})},[r.x,r.y,s,o]);const O=Math.max(8,r.x-104),G=Math.max(8,r.y-200),V={position:"absolute",left:`${T?T.x:O}px`,top:`${T?T.y:G}px`,visibility:T?"visible":"hidden"};return u.jsx("div",{ref:y,role:"menu","aria-label":"终端选择操作",className:"z-50 w-52 select-none font-mono",style:V,onMouseDown:L=>L.stopPropagation(),onTouchStart:L=>L.stopPropagation(),onPointerDown:L=>L.stopPropagation(),children:u.jsxs(qt,{tone:"accent",className:"border border-tui-border bg-tui-base p-1.5 shadow-lg",bodyClassName:"flex flex-col gap-1",children:[s&&u.jsxs("button",{type:"button",role:"menuitem",className:F(Vi,Zi),onClick:()=>{m(),v()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:_e.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copySelection")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:F(Vi,Zi),onClick:()=>{f(),v()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:_e.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copyLine")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:F(Vi,Zi),onClick:()=>{b(),v()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:_e.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copyScreen")})]}),o&&u.jsxs("button",{type:"button",role:"menuitem",className:F(Vi,Zi),onClick:()=>{p(),v()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:_e.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.paste")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:F(Vi,Zi),onClick:v,children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:_e.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.cancel")})]})]})})},Qv=({isOpen:r,onClose:s,onSend:o})=>{const{t:c}=mt(),[m,f]=S.useState("");S.useEffect(()=>{r&&f("")},[r]);const b=()=>{m&&(o(m),s())};return u.jsx(uu,{isOpen:r,onClose:s,title:c("clipboard.pasteTitle"),closeLabel:c("clipboard.cancel"),size:"sm",footer:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Be,{variant:"ghost",onClick:s,children:c("clipboard.cancel")}),u.jsx(Be,{variant:"primary",onClick:b,disabled:!m,children:c("clipboard.pasteSend")})]}),children:u.jsxs("div",{className:"flex flex-col gap-2 p-3 font-mono select-text",children:[u.jsx("label",{htmlFor:"paste-fallback-input",className:"text-tui-sm text-tui-muted",children:c("clipboard.pasteHint")}),u.jsx("textarea",{id:"paste-fallback-input",autoFocus:!0,rows:5,className:"tui-input w-full resize-none p-2 text-tui font-mono",placeholder:c("clipboard.pasteHint"),value:m,onChange:p=>f(p.target.value)})]})})},Fv=250,Jv=({onTerminalFocus:r,isActive:s=!0})=>{var Xn;const o=S.useRef(null),c=S.useRef(null),m=S.useRef(null),f=S.useRef(null),b=S.useRef(1),p=S.useRef({cols:0,rows:0}),v=S.useRef(null),w=S.useRef(null),y=S.useRef(null),T=S.useRef(null),K=S.useRef({width:0,height:0}),O=S.useRef(null),G=dy(),V=G||typeof navigator<"u"&&navigator.maxTouchPoints>0||typeof window<"u"&&"ontouchstart"in window,L=typeof window<"u"&&new URLSearchParams(window.location.search).get("debug")==="1",[Q,$]=S.useState({state:"idle",deltaY:0,lines:0,viewportY:null,scrollTop:null,scrollHeight:null,clientHeight:null,moved:!1,focused:!1,bufferType:null,baseY:null,cursorY:null,hasScrollback:null,mouseTracking:!1,scrollMode:"none",scrollCalls:0,lastScrollLines:null,lastInputEvent:"",pointerEvents:0,touchEvents:0}),{isController:I,connectionState:ie,settings:pe,hostPalette:q,terminalResetVersion:Y,sendResize:R,sendBinary:de,addToast:He,warnViewerMode:Te,connect:be,subscribeToOutput:X,t:ce}=mt(),we=fl.useMemo(()=>Cy(q),[q]),j=S.useRef(we);j.current=we;const B=S.useRef(I);B.current=I;const Z=S.useRef(de);Z.current=de;const oe=S.useRef(He);oe.current=He;const k=S.useRef(Te);k.current=Te;const Je=S.useRef(R);Je.current=R;const Ge=S.useRef(s);Ge.current=s;const me=S.useRef(ce);me.current=ce;const ve=S.useRef(null),[ke,Ne]=S.useState(null),$e=S.useRef(null);$e.current=ke;const[zt,De]=S.useState(!1),ut=S.useRef(!1),ht=S.useRef(null),[Xt,_t]=S.useState(!1),lt=S.useRef(null),Qt=S.useRef(null),Lt=S.useCallback(J=>{var dt;const W=f.current;if(!W)return;const xe=(dt=m.current)==null?void 0:dt.querySelector(".xterm-screen"),Re=kh(J,W,xe,b.current);if(Re){lt.current=Re,Qt.current=Re;const se=qv(W,Re.col,Re.bufferRow);se?W.select(se.startCol,Re.bufferRow,se.length):W.clearSelection()}else lt.current=null,Qt.current=null,W.clearSelection();if(ve.current){const se=ve.current.getBoundingClientRect(),Et=J.clientX-se.left,pt=J.clientY-se.top;Ne({x:Et,y:pt}),$e.current={x:Et,y:pt}}De(!1),ut.current=!1},[]),hn=S.useCallback(J=>{var se;const W=f.current,xe=lt.current;if(!W||!xe)return;ut.current||(ut.current=!0,De(!0)),ht.current=J;const Re=(se=m.current)==null?void 0:se.querySelector(".xterm-screen"),dt=kh(J,W,Re,b.current);if(dt)if(Qt.current=dt,xe.bufferRow===dt.bufferRow){const Et=Math.min(xe.col,dt.col),pt=Math.max(xe.col,dt.col);W.select(Et,xe.bufferRow,pt-Et+1)}else{const Et=dt.bufferRow>xe.bufferRow||dt.bufferRow===xe.bufferRow&&dt.col>=xe.col,pt=Et?xe:dt,Jt=Et?dt:xe,z=(Jt.bufferRow-pt.bufferRow)*W.cols+(Jt.col-pt.col+1);W.select(pt.col,pt.bufferRow,Math.max(1,z))}},[]),ln=S.useRef(Lt);ln.current=Lt;const Vt=S.useRef(hn);Vt.current=hn;const wt=S.useCallback(async()=>{const J=f.current;if(!J)return;const W=J.getSelection();if(!W)return;await oa(W)==="failed"?oe.current("error",me.current("clipboard.copyFailed")):oe.current("success",me.current("clipboard.copied"))},[]),Dn=S.useCallback(async()=>{var se;const J=f.current;if(!J)return;const W=((se=lt.current)==null?void 0:se.bufferRow)??J.buffer.active.viewportY,xe=J.buffer.active.getLine(W),Re=xe?xe.translateToString(!0):"";await oa(Re)==="failed"?oe.current("error",me.current("clipboard.copyFailed")):oe.current("success",me.current("clipboard.copied"))},[]),On=S.useCallback(async()=>{const J=f.current;if(!J)return;const W=Xv(J);await oa(W)==="failed"?oe.current("error",me.current("clipboard.copyFailed")):oe.current("success",me.current("clipboard.copied"))},[]),Ln=S.useCallback(async()=>{const J=f.current;if(!J)return;if(!B.current){k.current();return}const W=await Vv();W.ok?(J.paste(W.text),oe.current("success",me.current("clipboard.pasted"))):W.reason==="empty"?oe.current("info",me.current("clipboard.pasteUnavailable")):_t(!0)},[]),P=S.useCallback(J=>{const W=f.current;if(W){if(!B.current){k.current();return}W.paste(J),oe.current("success",me.current("clipboard.pasted"))}},[]),Ce=S.useCallback((J,W)=>{!Number.isFinite(J)||!Number.isFinite(W)||J<=0||W<=0||J===p.current.cols&&W===p.current.rows||(v.current={cols:J,rows:W},!w.current&&(w.current=setTimeout(()=>{w.current=null;const xe=v.current;v.current=null,xe&&(xe.cols===p.current.cols&&xe.rows===p.current.rows||(p.current=xe,Je.current(xe.cols,xe.rows)))},Fv)))},[]),Se=S.useCallback((J=!1)=>{const W=f.current,xe=o.current,Re=m.current,dt=c.current;if(!W||!xe||!Re||!dt)return;const se=Vc(xe,Za(),Gc());if(se.width<=0||se.height<=0)return;dt.style.width="100%",dt.style.height="100%",Re.style.width="100%",Re.style.height="100%",Re.style.transform="none",Re.style.transformOrigin="top left",b.current=1;const Et=_h(se),pt=Yv({lastSnapshot:O.current,currentSnapshot:Et});if(pt.isVisualZoom&&!J){O.current=Et;try{W.refresh(0,Math.max(0,W.rows-1))}catch{}return}if(pt.shouldIgnore&&!J)return;O.current=Et;const Jt=Ja(W,Ia),z=Rh({width:se.width-Ov(Re),height:se.height,cellWidth:Jt.cellWidth,cellHeight:Jt.cellHeight}),H=Math.abs(se.width-K.current.width)>1||Math.abs(se.height-K.current.height)>1;if(W.cols!==z.cols||W.rows!==z.rows)try{W.resize(z.cols,z.rows)}catch(he){console.debug("Error resizing terminal grid:",he)}const te=z.cols!==p.current.cols||z.rows!==p.current.rows;Ge.current&&(H||J||te)&&(K.current={width:se.width,height:se.height},Ce(z.cols,z.rows));try{W.refresh(0,Math.max(0,W.rows-1))}catch{}},[Ce]),Pe=S.useRef(Se);Pe.current=Se;const Ft=S.useCallback(()=>{if(y.current===null){if(typeof requestAnimationFrame!="function"){Pe.current();return}y.current=requestAnimationFrame(()=>{y.current=null,Pe.current()})}},[]),pn=S.useCallback((J=30)=>{T.current!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(T.current),T.current=null);let W=0;const xe=()=>{T.current=null,W++;const Re=W>=J;Pe.current(!0),!Re&&W<2&&typeof requestAnimationFrame=="function"&&(T.current=requestAnimationFrame(xe))};typeof requestAnimationFrame=="function"?T.current=requestAnimationFrame(xe):xe()},[]);S.useEffect(()=>{var ca;if(!o.current||!m.current)return;const J=o.current,W=Vc(J,Za(),Gc()),xe=Ja(null,Ia),Re=Rh({width:W.width,height:W.height,cellWidth:xe.cellWidth,cellHeight:xe.cellHeight});Je.current(Re.cols,Re.rows),K.current={width:W.width,height:W.height},O.current=_h(W);const dt=dh(pe.fontSize,W.width),se=new Rv.Terminal({fontSize:dt,fontFamily:yh(pe.fontFamily),lineHeight:1.15,...j.current?{theme:{...j.current}}:{},allowProposedApi:!0,convertEol:!0,scrollback:5e3,cols:Re.cols,rows:Re.rows,screenReaderMode:!1});try{const re=new Mv.Unicode11Addon;se.loadAddon(re),se.unicode.activeVersion="11"}catch(re){console.debug("Unicode11 addon unavailable, using default width table:",re)}se.open(m.current),f.current=se,G&&se.textarea&&(se.textarea.readOnly=!1,se.textarea.tabIndex=0,se.textarea.inputMode="text");let Et=()=>{};if(L&&se.textarea){const re=()=>{$(Ee=>({...Ee,focused:document.activeElement===se.textarea}))};se.textarea.addEventListener("focus",re),se.textarea.addEventListener("blur",re),Et=()=>{var Ee,at;(Ee=se.textarea)==null||Ee.removeEventListener("focus",re),(at=se.textarea)==null||at.removeEventListener("blur",re)},re()}const pt=Hv(se,{coarsePointer:G,onRendererSwapped:()=>{try{se.refresh(0,Math.max(0,se.rows-1))}catch{}}});J&&(J.dataset.renderer=pt.kind);const Jt=me.current("terminal.bannerTitle"),z=me.current("terminal.bannerSubtitle");if(se.writeln(" ___ ___ .___ "),se.writeln(` / | \\ ____ _______| _/______ \x1B[1m${Jt}\x1B[0m`),se.writeln(`/ ~ \\/ __ \\\\_ __ \\ __/ ___/ \x1B[2m${z}\x1B[0m`),se.writeln("\\ Y / ___/ | | \\/|_ \\___ \\ "),se.writeln(" \\___|_ / \\___ >|__| /___/____ >"),se.writeln(" \\/ \\/ \\/ "),se.writeln(""),!G)try{se.focus()}catch{}typeof document<"u"&&"fonts"in document&&typeof((ca=document.fonts)==null?void 0:ca.load)=="function"&&document.fonts.load('13px "Symbols Nerd Font Mono"').then(()=>{if(f.current){try{f.current.refresh(0,Math.max(0,f.current.rows-1))}catch{}pn(5)}}).catch(()=>{});const H=se.onData(re=>{const Ee=Gh(re);if(!B.current&&!Zc(Ee)){k.current();return}Z.current(Ee)}),te=se.onBinary(re=>{const Ee=new Uint8Array(re.length);for(let at=0;at<re.length;at++)Ee[at]=re.charCodeAt(at)&255;!B.current&&!Zc(Ee)||Z.current(Ee)}),he=new Uv({getTerminal:()=>f.current,getIsController:()=>B.current,getScale:()=>b.current,getSurfaceElement:()=>m.current,allowSyntheticMouseFallback:!1,onFocus:()=>{try{se.focus()}catch{}L&&$(re=>({...re,focused:document.activeElement===se.textarea})),r==null||r()},onGestureStateChange:re=>{L&&$(Ee=>({...Ee,state:re}))},onGestureScroll:({deltaY:re,lines:Ee,viewportY:at,scrollTop:ot,scrollHeight:gt,clientHeight:Wt,moved:fe,bufferType:jt,baseY:kt,cursorY:sn,hasScrollback:Kl,mouseTracking:$a,scrollMode:hl})=>{L&&$(Vn=>({...Vn,deltaY:re,lines:Ee,viewportY:at,scrollTop:ot,scrollHeight:gt,clientHeight:Wt,moved:fe,focused:document.activeElement===se.textarea,bufferType:jt,baseY:kt,cursorY:sn,hasScrollback:Kl,mouseTracking:$a,scrollMode:hl,scrollCalls:Vn.scrollCalls+(Ee!==0?1:0),lastScrollLines:Ee}))},longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,onLongPress:G?(re=>{var Ee;return(Ee=ln.current)==null?void 0:Ee.call(ln,re)}):void 0,onSelectionExtend:G?(re=>{var Ee;return(Ee=Vt.current)==null?void 0:Ee.call(Vt,re)}):void 0}),Me=typeof window<"u"&&"PointerEvent"in window,qe=typeof TouchEvent<"u",Oe=[],st=(re,Ee=!1)=>{const at=re.target;return at instanceof Node&&J.contains(at)||Ee&&he.getState()!=="idle"};if(Me){const re={passive:!1,capture:!0},Ee=fe=>{L&&$(jt=>({...jt,pointerEvents:jt.pointerEvents+1,lastInputEvent:fe}))},at=fe=>{if(!st(fe))return;if(Ee("pointerdown"),$e.current){Ne(null),$e.current=null,fe.cancelable&&fe.preventDefault(),fe.stopPropagation();return}he.handlePointerDown(fe,J)&&fe.stopPropagation()},ot=fe=>{st(fe,!0)&&(Ee("pointermove"),he.handlePointerMove(fe),fe.pointerType!=="mouse"&&fe.stopPropagation())},gt=fe=>{if(st(fe,!0)){if(Ee("pointerup"),ut.current&&(ut.current=!1,De(!1),ht.current&&ve.current)){const jt=ve.current.getBoundingClientRect(),kt=ht.current.clientX-jt.left,sn=ht.current.clientY-jt.top;Ne({x:kt,y:sn}),$e.current={x:kt,y:sn}}he.handlePointerUp(fe),fe.pointerType!=="mouse"&&fe.stopPropagation()}},Wt=fe=>{st(fe,!0)&&(Ee("pointercancel"),ut.current&&(ut.current=!1,De(!1)),he.handlePointerCancel(fe),fe.pointerType!=="mouse"&&fe.stopPropagation())};if(document.addEventListener("pointerdown",at,re),document.addEventListener("pointermove",ot,re),document.addEventListener("pointerup",gt,re),document.addEventListener("pointercancel",Wt,re),Oe.push(()=>{document.removeEventListener("pointerdown",at,re),document.removeEventListener("pointermove",ot,re),document.removeEventListener("pointerup",gt,re),document.removeEventListener("pointercancel",Wt,re)}),qe){const fe=kt=>{st(kt,!0)&&(L&&$(sn=>({...sn,touchEvents:sn.touchEvents+1})),kt.cancelable&&kt.preventDefault(),kt.stopPropagation())},jt=["touchstart","touchmove","touchend","touchcancel"];for(const kt of jt)document.addEventListener(kt,fe,re);Oe.push(()=>{for(const kt of jt)document.removeEventListener(kt,fe,re)})}}else{const re={passive:!1,capture:!0},Ee=fe=>{L&&$(jt=>({...jt,touchEvents:jt.touchEvents+1,lastInputEvent:fe}))},at=fe=>{if(st(fe)){if(Ee("touchstart"),$e.current){Ne(null),$e.current=null,fe.cancelable&&fe.preventDefault(),fe.stopPropagation();return}fe.touches.length===1&&fe.stopPropagation(),he.handleTouchStart(fe,J)}},ot=fe=>{st(fe,!0)&&(Ee("touchmove"),fe.touches.length===1&&fe.stopPropagation(),he.handleTouchMove(fe))},gt=fe=>{if(st(fe,!0)){if(Ee("touchend"),ut.current&&(ut.current=!1,De(!1),ht.current&&ve.current)){const jt=ve.current.getBoundingClientRect(),kt=ht.current.clientX-jt.left,sn=ht.current.clientY-jt.top;Ne({x:kt,y:sn}),$e.current={x:kt,y:sn}}fe.stopPropagation(),he.handleTouchEnd(fe)}},Wt=fe=>{st(fe,!0)&&(Ee("touchcancel"),ut.current&&(ut.current=!1,De(!1)),fe.stopPropagation(),he.handleTouchCancel())};document.addEventListener("touchstart",at,re),document.addEventListener("touchmove",ot,re),document.addEventListener("touchend",gt,re),document.addEventListener("touchcancel",Wt,re),Oe.push(()=>{document.removeEventListener("touchstart",at,re),document.removeEventListener("touchmove",ot,re),document.removeEventListener("touchend",gt,re),document.removeEventListener("touchcancel",Wt,re)})}const bt=re=>{re.preventDefault()};J.addEventListener("contextmenu",bt),Oe.push(()=>{J.removeEventListener("contextmenu",bt)});const Un=new ResizeObserver(()=>{Ft()});Un.observe(J);const an=()=>{Ft()},Gt=()=>{var re,Ee;if(document.visibilityState==="visible"){pn(10);try{(Ee=f.current)==null||Ee.refresh(0,Math.max(0,(((re=f.current)==null?void 0:re.rows)||1)-1))}catch{}}};window.addEventListener("resize",an),window.addEventListener("orientationchange",an),document.addEventListener("visibilitychange",Gt),window.addEventListener("pageshow",Gt);const Bn=()=>{Ft()};return typeof window<"u"&&window.visualViewport&&(window.visualViewport.addEventListener("resize",Bn),window.visualViewport.addEventListener("scroll",Bn)),()=>{H.dispose(),te.dispose(),he.handlePointerCancel();for(const re of Oe)re();Un.disconnect(),window.removeEventListener("resize",an),window.removeEventListener("orientationchange",an),document.removeEventListener("visibilitychange",Gt),window.removeEventListener("pageshow",Gt),typeof window<"u"&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",Bn),window.visualViewport.removeEventListener("scroll",Bn)),w.current&&(clearTimeout(w.current),w.current=null),y.current!==null&&(cancelAnimationFrame(y.current),y.current=null),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),Et(),pt.dispose(),se.dispose(),f.current=null}},[]),S.useEffect(()=>{const J=f.current;if(!J)return;const W=Vc(o.current,Za(),Gc());J.options.fontSize=dh(pe.fontSize,W.width),J.options.fontFamily=yh(pe.fontFamily);try{J.refresh(0,Math.max(0,J.rows-1))}catch{}pn(10)},[pe.fontSize,pe.fontFamily]);const Kt=S.useRef(Y);S.useEffect(()=>{var W;if(Kt.current===Y)return;Kt.current=Y;const J=f.current;if(J)try{(W=J.reset)==null||W.call(J),J.clear(),J.refresh(0,Math.max(0,J.rows-1))}catch{}},[Y]),S.useEffect(()=>{const J=f.current;if(!(!J||!we)){J.options.theme={...we};try{J.refresh(0,Math.max(0,J.rows-1))}catch{}}},[we]),S.useEffect(()=>X(W=>{const xe=f.current;if(!xe)throw new Error("terminal not ready");xe.write(W)}),[X]),S.useEffect(()=>{if(!s)return;pn(10);const J=f.current;if(J){try{J.refresh(0,Math.max(0,J.rows-1))}catch{}if(!G)try{J.focus()}catch{}}},[s,G,pn]),S.useEffect(()=>{ie==="disconnected"&&be()},[]);const ml=J=>{J.preventDefault()};return u.jsxs("main",{ref:ve,className:"flex-1 w-full min-w-0 min-h-0 overflow-hidden relative flex flex-col",onContextMenu:ml,"aria-label":ce("terminal.windowAriaLabel"),children:[u.jsx("div",{id:"terminal-container",ref:o,className:"absolute inset-0 overflow-hidden cursor-text",style:{touchAction:V?"none":"auto"},tabIndex:0,onContextMenu:ml,"aria-label":ce("terminal.bufferAriaLabel"),role:"region",children:u.jsx("div",{id:"terminal-frame",ref:c,className:"relative overflow-hidden",style:{width:"100%",height:"100%"},children:u.jsx("div",{id:"terminal-surface",ref:m,className:"absolute top-0 left-0",style:{transformOrigin:"top left",width:"100%",height:"100%"}})})}),L&&u.jsxs("pre",{"data-testid":"terminal-touch-debug",className:"pointer-events-none absolute left-1 top-1 z-50 border border-tui-border bg-tui-crust/90 px-2 py-1 font-mono text-tui-sm leading-relaxed text-tui-muted","aria-hidden":"true",children:[`gesture: ${Q.state}
|
|
35
|
+
`,`deltaY: ${Q.deltaY} lines: ${Q.lines}
|
|
36
|
+
`,`viewportY: ${Q.viewportY??"-"} focus: ${Q.focused}
|
|
37
|
+
`,`buffer: ${Q.bufferType??"-"} base: ${Q.baseY??"-"} cursor: ${Q.cursorY??"-"} scrollback: ${Q.hasScrollback??"-"}
|
|
38
|
+
`,`scroll: ${Q.scrollTop??"-"} / ${Q.scrollHeight??"-"} (h ${Q.clientHeight??"-"}) moved: ${Q.moved}
|
|
39
|
+
`,`mode: ${Q.scrollMode} calls: ${Q.scrollCalls} lines: ${Q.lastScrollLines??"-"} mouse: ${Q.mouseTracking}
|
|
40
|
+
`,`event: ${Q.lastInputEvent||"-"} pointer: ${Q.pointerEvents} touch: ${Q.touchEvents}`]}),G&&ke&&!zt&&u.jsx(Zv,{anchorPoint:ke,hasSelection:((Xn=f.current)==null?void 0:Xn.hasSelection())??!1,isController:I,vibrateOnKeyPress:pe.vibrateOnKeyPress,onCopySelection:wt,onCopyLine:Dn,onCopyScreen:On,onPaste:Ln,onClose:()=>{Ne(null),$e.current=null}}),G&&u.jsx(Qv,{isOpen:Xt,onClose:()=>_t(!1),onSend:P})]})},Wv=({onPairedSuccess:r})=>{const{settings:s,updateSettings:o,connect:c,connectionState:m,stateDetail:f,addToast:b,t:p}=mt(),[v,w]=S.useState(""),[y,T]=S.useState(null),[K,O]=S.useState(!1),[G,V]=S.useState(s.wsUrl||"/ws/client"),[L,Q]=S.useState(s.token||""),[$,I]=S.useState(s.clientId||""),ie="node bin/service.js pair",pe="node bin/config-tui.js",q="herdr plugin pane open --plugin herdr.remote.web --entrypoint config --placement zoomed --focus",Y=Te=>{oa(Te).then(be=>{if(be==="failed"){b("error",p("clipboard.copyFailed"));return}T(Te),b("success",p("toasts.commandCopied")),setTimeout(()=>T(null),2e3)})},R=Te=>{Te.preventDefault();const be=v.trim().toUpperCase();if(!be&&!L.trim()){b("warning",p("toasts.connectionError"));return}const X={pairCode:be,wsUrl:G.trim()||"/ws/client",clientId:$.trim()||s.clientId};L.trim()&&(X.token=L.trim()),o(X),c({pairCode:be||void 0,token:L.trim()||void 0,wsUrl:G.trim()||"/ws/client",clientId:$.trim()||s.clientId}),r&&r()},de=m==="connecting"||m==="reconnecting",He=({n:Te})=>u.jsxs("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:["[",Te,"]"]});return u.jsx("div",{className:"flex h-full w-full flex-1 justify-center overflow-y-auto bg-tui-crust p-2 sm:p-4",children:u.jsxs("div",{className:"my-auto w-full max-w-3xl space-y-3",children:[u.jsxs("div",{className:"border border-tui-border bg-tui-base px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[u.jsx("span",{"aria-hidden":"true",className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("h1",{className:"text-tui font-bold text-tui-text",children:p("onboarding.title")}),u.jsx("span",{className:"text-tui uppercase text-tui-warn",children:p("onboarding.firstTimeSetup")})]}),u.jsx("p",{className:"mt-0.5 text-tui leading-snug text-tui-muted",children:p("onboarding.description")})]}),m==="error"&&u.jsxs(So,{tone:"warn",action:u.jsx(Be,{variant:"warn",onClick:()=>c(),children:p("common.retry")}),children:[u.jsx("span",{className:"block font-bold",children:p("onboarding.authRequired")}),u.jsx("span",{className:"block text-tui-muted",children:f||p("onboarding.authRequiredDesc")})]}),u.jsxs("form",{onSubmit:R,className:"grid gap-3",children:[u.jsx(qt,{title:p("onboarding.step1Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("p",{className:"flex items-start gap-2 text-tui text-tui-muted",children:[u.jsx(He,{n:1}),u.jsx("span",{className:"leading-snug",children:p("onboarding.step1Desc")})]}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-mantle px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui text-tui-text",children:ie}),u.jsx(Be,{onClick:()=>Y(ie),glyph:y===ie?_e.check:"⧉",className:F("shrink-0",y===ie&&"border-tui-ok text-tui-ok"),children:p(y===ie?"common.copied":"common.copy")})]}),u.jsxs("div",{className:"space-y-0.5 text-tui-sm",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:p("onboarding.step1CopyPlugin")}),u.jsx("button",{type:"button",onClick:()=>Y(q),className:"tui-focusable shrink-0 text-tui-accent underline-offset-2 hover:underline",children:p(y===q?"common.copied":"onboarding.step1CopyCli")})]}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:p("onboarding.step1TuiNote")}),u.jsx("code",{onClick:()=>Y(pe),className:"shrink-0 cursor-pointer border border-tui-border-dim px-1 text-tui-muted hover:border-tui-accent hover:text-tui-accent",title:p("common.clickToCopy"),children:pe})]})]})]})}),u.jsx(qt,{title:p("onboarding.step2Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(He,{n:2}),u.jsx(jn,{type:"text",value:v,onChange:Te=>w(Te.target.value.toUpperCase()),placeholder:p("onboarding.step2Placeholder"),maxLength:12,autoFocus:!0,"aria-label":p("onboarding.step2Title"),className:"font-bold uppercase"})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("onboarding.step2Note")})]})}),u.jsx(Be,{variant:"primary",type:"submit",block:!0,disabled:de,className:"py-1.5",children:de?u.jsx(Wa,{label:p("onboarding.connectingAndPairing")}):p("onboarding.connectAndPair")}),u.jsxs("div",{className:"border border-tui-border bg-tui-base",children:[u.jsxs("button",{type:"button",onClick:()=>O(!K),"aria-expanded":K,className:"tui-focusable flex w-full items-center gap-2 px-2 py-1 text-left text-tui text-tui-muted transition-colors hover:text-tui-accent",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:K?_e.chevronDown:_e.chevronRight}),u.jsx("span",{className:"uppercase",children:p("onboarding.advancedTitle")})]}),K&&u.jsxs("div",{className:"space-y-2.5 border-t border-tui-border-dim px-2 py-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"onboarding-token",children:p("onboarding.manualTokenLabel")}),u.jsx(jn,{id:"onboarding-token",type:"password",value:L,onChange:Te=>Q(Te.target.value),placeholder:p("onboarding.manualTokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"onboarding-ws",children:p("onboarding.wsEndpointLabel")}),u.jsx(jn,{id:"onboarding-ws",type:"text",value:G,onChange:Te=>V(Te.target.value),placeholder:p("onboarding.wsEndpointPlaceholder")})]}),u.jsx(Fa,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"onboarding-client-id",children:p("onboarding.clientIdLabel")}),u.jsx(jn,{id:"onboarding-client-id",type:"text",value:$,onChange:Te=>I(Te.target.value)})]})]})]})]})]})})},Qi="tui-focusable inline-flex shrink-0 select-none items-center justify-center border text-tui font-medium transition-colors",xo="border-tui-border bg-tui-surface text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",Iv="border-tui-accent bg-tui-accent text-tui-crust font-bold",$v="border-tui-ok bg-transparent text-tui-ok hover:bg-tui-ok hover:text-tui-crust font-bold",Pv=({compact:r=!1})=>{const{sendKey:s,settings:o,updateSettings:c,isController:m,warnViewerMode:f,t:b}=mt(),p="h-9 min-w-[2.25rem] px-2",v="h-9 w-9",w="h-9 px-2",[y,T]=S.useState(!1),[K,O]=S.useState(!1),[G,V]=S.useState(!1),[L,Q]=S.useState(!1),[$,I]=S.useState(!1),[ie,pe]=S.useState(!1),q=S.useCallback(()=>{if(o.vibrateOnKeyPress&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[o.vibrateOnKeyPress]),Y=S.useCallback((X,ce=!1)=>{if(q(),!m){f();return}let we=X;ce&&(y||K||G)&&(we=ey(X,{ctrl:y,alt:K,shift:G})),s(we),y&&T(!1),K&&O(!1),G&&V(!1)},[m,y,K,G,s,f,q,b]);if(!o.toolbarVisible)return u.jsx("div",{"data-testid":"key-toolbar-collapsed",className:"z-20 flex shrink-0 justify-center border-t border-tui-border bg-tui-mantle pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]",children:u.jsxs("button",{type:"button",onClick:()=>c({toolbarVisible:!0}),className:"tui-focusable flex h-6 w-28 items-center justify-center gap-1 text-tui uppercase text-tui-faint transition-colors hover:text-tui-accent",title:b("virtualKeyboard.expandToolbar"),"aria-label":b("virtualKeyboard.expandToolbar"),"aria-expanded":!1,children:[u.jsx("span",{"aria-hidden":"true",children:"▴"}),u.jsx("span",{"aria-hidden":"true",children:b("common.keyBar")})]})});const R=o.virtualKeys&&o.virtualKeys.length>0?o.virtualKeys.filter(X=>X.enabled):Fh,de=X=>X.id==="left"?u.jsx("span",{"aria-hidden":"true",children:"←"}):X.id==="up"?u.jsx("span",{"aria-hidden":"true",children:"↑"}):X.id==="down"?u.jsx("span",{"aria-hidden":"true",children:"↓"}):X.id==="right"?u.jsx("span",{"aria-hidden":"true",children:"→"}):X.id==="enter"?u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{"aria-hidden":"true",children:"⏎"}),u.jsx("span",{className:"hidden sm:inline",children:b("virtualKeyboard.keyEnter")})]}):X.id==="drawer_chords"?u.jsx("span",{children:"^C"}):X.id==="drawer_fn"?u.jsxs("span",{className:"flex items-center gap-0.5",children:[u.jsx("span",{children:"Fn"}),u.jsx("span",{"aria-hidden":"true",children:L?"▾":"▴"})]}):u.jsx("span",{children:X.label}),He=X=>{if(q(),X.type==="modifier"){X.modifierType==="ctrl"?T(!y):X.modifierType==="alt"?O(!K):X.modifierType==="shift"?V(!G):X.modifierType==="meta"&&Y(ye.ESC);return}if(X.type==="drawer"){X.drawerType==="fn"?(Q(!L),I(!1),pe(!1)):X.drawerType==="chords"?(pe(!ie),Q(!1),I(!1)):X.drawerType==="symbols"&&(I(!$),Q(!1),pe(!1));return}Y(X.code,X.isPlainChar||X.type==="symbol")},Te=X=>{if(X.type==="modifier"){if(X.modifierType==="ctrl")return y;if(X.modifierType==="alt")return K;if(X.modifierType==="shift")return G}if(X.type==="drawer"){if(X.drawerType==="fn")return L;if(X.drawerType==="chords")return ie;if(X.drawerType==="symbols")return $}return!1},be=(X,ce,we,j,B="default")=>u.jsxs("button",{type:"button",onClick:()=>Y(X),className:F(Qi,"h-8 gap-1.5 px-2",B==="bad"?"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust":B==="warn"?"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust":xo),title:we,children:[u.jsx("span",{className:"font-bold",children:ce}),u.jsx("span",{className:"text-tui-sm opacity-70",children:j})]});return u.jsxs("div",{"data-testid":"key-toolbar",className:F("z-20 flex shrink-0 select-none flex-col border-t border-tui-border bg-tui-mantle",r?"pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]":"pb-[max(env(safe-area-inset-bottom,0px),0.25rem)]"),role:"toolbar","aria-label":b("virtualKeyboard.touchKeyboardShortcuts"),children:[L&&u.jsx("div",{className:"grid grid-cols-6 gap-1 border-b border-tui-border-dim bg-tui-crust p-1.5 sm:grid-cols-12",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(X=>{const ce=`F${X}`;return u.jsxs("button",{type:"button",onClick:()=>Y(ye[ce]),className:F(Qi,xo,"h-8"),children:["F",X]},ce)})}),ie&&u.jsxs("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:[be(ye.CTRL_C,"^C",b("virtualKeyboard.ctrlCTitle"),b("virtualKeyboard.badgeSigint"),"bad"),be(ye.CTRL_D,"^D",b("virtualKeyboard.ctrlDTitle"),b("virtualKeyboard.badgeEof")),be(ye.CTRL_Z,"^Z",b("virtualKeyboard.ctrlZTitle"),b("virtualKeyboard.badgeTstp"),"warn"),be(ye.CTRL_L,"^L",b("virtualKeyboard.ctrlLTitle"),b("virtualKeyboard.badgeClear")),be(ye.CTRL_R,"^R",b("virtualKeyboard.ctrlRTitle"),b("virtualKeyboard.badgeSearch")),be(ye.CTRL_A,"^A",b("virtualKeyboard.ctrlATitle"),b("virtualKeyboard.badgeStart")),be(ye.CTRL_E,"^E",b("virtualKeyboard.ctrlETitle"),b("virtualKeyboard.badgeEnd")),be(ye.CTRL_K,"^K",b("virtualKeyboard.ctrlKTitle"),b("virtualKeyboard.badgeKill"))]}),$&&u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:["|","~","/","\\","-","_","$","&",";",":","`",'"',"'",">","<","=","#","@","{","}","[","]"].map(X=>u.jsx("button",{type:"button",onClick:()=>Y(X,!0),className:F(Qi,xo,"h-8 w-8 font-bold"),children:X},X))}),u.jsxs("div",{"data-testid":"key-toolbar-row",className:F("flex flex-wrap items-center justify-center gap-1",r?"px-1.5 py-1":"px-2 py-1.5"),children:[u.jsx("button",{type:"button",onClick:()=>c({toolbarVisible:!1}),className:F(Qi,v,"mr-1 border-tui-border-dim bg-transparent text-tui-faint hover:border-tui-border hover:text-tui-text"),title:b("virtualKeyboard.collapseToolbar"),"aria-label":b("virtualKeyboard.collapseToolbar"),"aria-expanded":!0,children:u.jsx("span",{"aria-hidden":"true",children:"▾"})}),R.map(X=>{const ce=Te(X),we=X.id==="enter",j=["left","up","down","right"].includes(X.id),B=X.type==="drawer",Z=Qc(X,b);return u.jsx("button",{type:"button",onClick:()=>He(X),className:F(Qi,j?v:B?w:p,we?$v:ce?Iv:xo),title:Z,"aria-label":Z,"aria-pressed":ce,children:de(X)},X.id)})]})]})},ex=["ls -la","clear","git status","pwd","top","exit","cat"],tx=({isOpen:r,onClose:s})=>{const{sendKey:o,isController:c,warnViewerMode:m,t:f}=mt(),[b,p]=S.useState("");if(!r)return null;const v=y=>{if(y&&y.preventDefault(),!c){m();return}b.length>0?(o(b+"\r"),p("")):o("\r")},w=y=>{if(!c){m();return}o(y+"\r")};return u.jsxs("div",{className:"z-20 flex flex-col gap-1.5 border-t border-tui-border bg-tui-mantle p-2",role:"region","aria-label":f("virtualKeyboard.helperTitle"),children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-tui font-bold uppercase text-tui-accent",children:f("virtualKeyboard.helperTitle")}),u.jsx(Be,{variant:"ghost",onClick:s,"aria-label":f("virtualKeyboard.closeHelper"),children:"esc"})]}),u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto py-0.5",children:ex.map(y=>u.jsx("button",{type:"button",onClick:()=>w(y),className:"tui-focusable shrink-0 select-none border border-tui-border bg-tui-surface px-2 py-0.5 text-tui-sm text-tui-muted transition-colors hover:border-tui-accent hover:text-tui-accent",children:y},y))}),u.jsxs("form",{onSubmit:v,className:"flex items-center gap-1.5",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none font-bold text-tui-ok",children:"$"}),u.jsxs("div",{className:"relative flex-1",children:[u.jsx("label",{htmlFor:"virtual-keyboard-input",className:"sr-only",children:f("virtualKeyboard.placeholder")}),u.jsx(jn,{id:"virtual-keyboard-input",name:"terminal-input",type:"text",value:b,onChange:y=>p(y.target.value),placeholder:f("virtualKeyboard.placeholder"),inputMode:"text",enterKeyHint:"send",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,className:"select-text pr-7"}),b.length>0&&u.jsx("button",{type:"button",onClick:()=>p(""),className:"tui-focusable absolute right-1 top-1/2 -translate-y-1/2 px-1 text-tui-faint hover:text-tui-bad","aria-label":f("virtualKeyboard.clearInput"),children:u.jsx("span",{"aria-hidden":"true",children:_e.cross})})]}),u.jsx(Be,{variant:"primary",type:"submit",title:f("virtualKeyboard.sendButton"),glyph:"⏎",className:"h-9 shrink-0",children:u.jsx("span",{className:"hidden sm:inline",children:f("virtualKeyboard.sendButton")})})]})]})};function jo(r,s){const o=(c,m)=>s?s(c):m;switch(r){case"connected":return{label:o("connection.live","Live"),level:"ok",needsAttention:!1};case"connecting":return{label:o("connection.connecting","Connecting"),level:"warn",needsAttention:!0};case"reconnecting":return{label:o("connection.reconnecting","Reconnecting"),level:"warn",needsAttention:!0,actionLabel:o("connection.reconnectNow","Reconnect now")};case"error":return{label:o("connection.error","Error"),level:"bad",needsAttention:!0,actionLabel:o("connection.retry","Retry")};default:return{label:o("connection.offline","Offline"),level:"idle",needsAttention:!0,actionLabel:o("connection.connect","Connect")}}}const nx={connected:"ok",connecting:"warn",reconnecting:"warn",error:"bad",disconnected:"idle"},lx=({isOpen:r,onClose:s,isAddMode:o=!1})=>{const{settings:c,updateSettings:m,connect:f,disconnect:b,connectionState:p,hostId:v,addToast:w,t:y,activeProfile:T,activeProfileId:K,addProfileAndConnect:O,renameProfile:G}=mt(),[V,L]=S.useState(c.wsUrl),[Q,$]=S.useState(c.token),[I,ie]=S.useState(c.pairCode),[pe,q]=S.useState(c.clientId),[Y,R]=S.useState((T==null?void 0:T.displayName)||""),[de,He]=S.useState(c.autoReconnect),[Te,be]=S.useState(!1);if(S.useEffect(()=>{r&&(L(c.wsUrl),$(o?"":c.token),ie(o?"":c.pairCode),q(c.clientId),R(o?"":(T==null?void 0:T.displayName)||""),He(c.autoReconnect))},[r,o,c,T]),!r)return null;const X=B=>{B.preventDefault();const Z={wsUrl:V.trim()||"/ws/client",token:Q.trim(),pairCode:I.trim().toUpperCase(),clientId:pe.trim()||c.clientId,autoReconnect:de};if(!Z.token&&!Z.pairCode){w("warning",y("pairing.credentialsRequired"));return}o?O({...Z,displayName:Y.trim()||void 0}):(m(Z),K&&Y.trim()&&G(K,Y),b(),f({wsUrl:Z.wsUrl,token:Z.token||void 0,pairCode:Z.pairCode||void 0,clientId:Z.clientId,autoReconnect:de})),s()},ce=()=>{const B=`client-${Math.random().toString(36).substring(2,8)}`;q(B)},we=()=>{const B=new URL(window.location.href);B.search="",I.trim()&&B.searchParams.set("pairCode",I.trim().toUpperCase()),oa(B.toString()).then(Z=>{if(Z==="failed"){w("error",y("clipboard.copyFailed"));return}be(!0),w("success",y("toasts.pairingLinkCopied")),setTimeout(()=>be(!1),2e3)})},j=nx[p]??"idle";return u.jsxs(uu,{isOpen:r,onClose:s,title:y(o?"pairing.addTitle":"pairing.title"),subtitle:y("pairing.subtitle"),closeLabel:y("common.closeDialog"),hints:[{keys:"esc",action:y("common.close")},{keys:"⏎",action:y("pairing.saveAndConnect")}],footer:u.jsxs(u.Fragment,{children:[p==="connected"&&u.jsx(Be,{variant:"danger",onClick:()=>{b(),s()},children:y("common.disconnect")}),u.jsx(Be,{variant:"primary",type:"submit",form:"pairing-form",children:y("pairing.saveAndConnect")})]}),children:[u.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 border-b border-tui-border-dim pb-2 text-tui",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Rn,{level:j}),u.jsx("span",{className:"text-tui-muted",children:y("common.status")}),u.jsx("span",{className:F(j==="ok"?"text-tui-ok":j==="bad"?"text-tui-bad":j==="warn"?"text-tui-warn":"text-tui-faint"),children:jo(p,y).label})]}),v&&u.jsxs("span",{className:"flex items-center gap-1.5 text-tui-muted",children:[y("common.host")," ",u.jsx("span",{className:"text-tui-text",children:v})]})]}),u.jsxs("form",{id:"pairing-form",onSubmit:X,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"pairing-name",children:y("pairing.displayNameLabel")}),u.jsx(jn,{id:"pairing-name",type:"text",value:Y,onChange:B=>R(B.target.value),placeholder:y("pairing.displayNamePlaceholder"),maxLength:64,autoComplete:"off"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.displayNameHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"pairing-code",hint:y("pairing.pairCodeNote"),children:y("pairing.pairCodeLabel")}),u.jsx(jn,{id:"pairing-code",type:"text",value:I,onChange:B=>ie(B.target.value.toUpperCase()),placeholder:y("pairing.pairCodePlaceholder"),maxLength:12,className:"uppercase"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.pairCodeHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"pairing-token",hint:y("pairing.tokenNote"),children:y("pairing.tokenLabel")}),u.jsx(jn,{id:"pairing-token",type:"password",value:Q,onChange:B=>$(B.target.value),placeholder:y("pairing.tokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"pairing-ws",children:y("pairing.wsUrlLabel")}),u.jsx(jn,{id:"pairing-ws",type:"text",value:V,onChange:B=>L(B.target.value),placeholder:y("pairing.wsUrlPlaceholder")}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.wsUrlDefaultNote")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"pairing-client-id",children:y("pairing.clientIdLabel")}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(jn,{id:"pairing-client-id",type:"text",value:pe,onChange:B=>q(B.target.value),className:"flex-1"}),u.jsx(Be,{onClick:ce,title:y("pairing.regenerateClientIdTitle"),className:"shrink-0",children:y("pairing.newIdButton")})]})]}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Pc,{checked:de,onChange:He,label:y("pairing.autoReconnectLabel"),description:y("pairing.autoReconnectDesc")})}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Be,{onClick:we,block:!0,glyph:Te?_e.check:"⧉",className:F(Te&&"border-tui-ok text-tui-ok"),children:y("pairing.copyDirectLink")})})]})]})},ax=({isOpen:r,onClose:s})=>{const{settings:o,updateSettings:c,addToast:m,language:f,setLanguage:b,t:p}=mt(),[v,w]=S.useState("appearance"),[y,T]=S.useState(!1);if(!r)return null;const K=Ic.find(q=>q.font===o.fontFamily),O=o.virtualKeys&&o.virtualKeys.length>0?o.virtualKeys:Pi(),G=()=>{const q=Ih();c({fontSize:q.fontSize,fontFamily:q.fontFamily,toolbarVisible:q.toolbarVisible,vibrateOnKeyPress:q.vibrateOnKeyPress,language:q.language,virtualKeys:q.virtualKeys}),m("info",p("settings.resetDefaultsToast"))},V=q=>{const Y=O.map(R=>R.id===q?{...R,enabled:!R.enabled}:R);c({virtualKeys:Y})},L=(q,Y)=>{const R=Y==="up"?q-1:q+1;if(R<0||R>=O.length)return;const de=[...O],He=de[q];de[q]=de[R],de[R]=He,c({virtualKeys:de})},Q=q=>{if(O.some(R=>R.id===q.id)){const R=O.map(de=>de.id===q.id?{...de,enabled:!0}:de);c({virtualKeys:R})}else{const R=[...O,{...q,enabled:!0}];c({virtualKeys:R})}T(!1)},$=q=>{const Y=O.filter(R=>R.id!==q);c({virtualKeys:Y})},I=()=>{c({virtualKeys:Pi()}),m("info",p("toasts.keyLayoutReset"))},ie=10,pe=24;return u.jsxs(uu,{isOpen:r,onClose:s,title:p("settings.title"),subtitle:p("settings.subtitle"),closeLabel:p("common.closeDialog"),size:"lg",hints:[{keys:"esc",action:p("common.close")}],footer:u.jsxs(u.Fragment,{children:[u.jsx(Be,{variant:"ghost",onClick:G,children:p("settings.resetDefaults")}),u.jsx(Be,{variant:"primary",onClick:s,children:p("common.done")})]}),children:[u.jsx(ou,{tabs:[{id:"appearance",label:p("settings.tabAppearance"),index:1},{id:"virtualKeys",label:p("settings.tabVirtualKeys"),index:2}],activeId:v,onSelect:q=>w(q),className:"mb-3 border-b border-tui-border-dim pb-1"}),v==="appearance"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{children:p("settings.languageLabel")}),u.jsxs("div",{className:"grid gap-0.5 sm:grid-cols-2",children:[u.jsx(Nh,{name:"ui-language",checked:f==="zh",onChange:()=>b("zh"),label:"简体中文"}),u.jsx(Nh,{name:"ui-language",checked:f==="en",onChange:()=>b("en"),label:"English"})]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"terminal-font-select",children:p("settings.fontFamilyLabel")}),u.jsxs(ru,{id:"terminal-font-select",value:o.fontFamily,onChange:q=>c({fontFamily:q.target.value}),"aria-label":p("settings.fontFamilyLabel"),children:[!K&&u.jsx("option",{value:o.fontFamily,children:o.fontFamily}),Ic.map(q=>u.jsx("option",{value:q.font,children:p(`fontPresets.${q.id}`)||q.name},q.id))]}),u.jsxs("div",{className:"overflow-x-auto whitespace-nowrap border border-tui-border bg-tui-mantle px-2 py-1.5 leading-snug text-tui-text",style:{fontFamily:o.fontFamily,fontSize:`${o.fontSize}px`},children:[u.jsx("span",{className:"text-tui-ok",children:"$"}),' echo "Herdr 0O 1lI ',' [] () -> => !="']})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"terminal-font-size",children:p("settings.fontSizeLabel",{size:o.fontSize})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Cv,{value:(o.fontSize-ie)/(pe-ie),width:24,className:"hidden shrink-0 sm:inline-flex"}),u.jsx("input",{id:"terminal-font-size",type:"range",min:ie,max:pe,step:1,value:o.fontSize,onChange:q=>c({fontSize:Number(q.target.value)}),className:"h-1 w-full cursor-pointer appearance-none bg-tui-border accent-tui-accent"})]}),u.jsxs("div",{className:"flex justify-between text-tui-sm text-tui-faint",children:[u.jsx("span",{children:p("settings.fontSizeCompact")}),u.jsx("span",{children:p("settings.fontSizeDefault")}),u.jsx("span",{children:p("settings.fontSizeLarge")})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.mobileFontNote")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.windowZoomSharedNote")})]}),u.jsx(Fa,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Pc,{checked:o.toolbarVisible,onChange:q=>c({toolbarVisible:q}),label:p("settings.touchKeyToolbar"),description:p("settings.touchKeyToolbarDesc")}),u.jsx(Pc,{checked:o.vibrateOnKeyPress,onChange:q=>c({vibrateOnKeyPress:q}),label:p("settings.touchHaptics"),description:p("settings.touchHapticsDesc")})]}),u.jsx(Fa,{}),u.jsxs("p",{className:"text-tui-sm leading-snug text-tui-faint",children:[u.jsx("span",{"aria-hidden":"true",className:"mr-1",children:_e.arrowRight}),p("settings.colorPassthroughNote")]})]}),v==="virtualKeys"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-tui font-bold uppercase text-tui-accent",children:p("virtualKeyboard.customizeTitle")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("virtualKeyboard.customizeDesc")})]}),u.jsx(Be,{variant:"ghost",onClick:I,className:"shrink-0",children:p("virtualKeyboard.resetLayout")})]}),u.jsx("div",{className:"max-h-72 overflow-y-auto border border-tui-border bg-tui-mantle",children:O.map((q,Y)=>u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border-dim px-2 py-1 last:border-b-0 hover:bg-tui-selection",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("input",{type:"checkbox",checked:q.enabled,onChange:()=>V(q.id),className:"sr-only",id:`toggle-${q.id}`}),u.jsx("label",{htmlFor:`toggle-${q.id}`,className:F("shrink-0 cursor-pointer select-none font-bold",q.enabled?"text-tui-ok":"text-tui-faint"),"aria-hidden":"true",children:q.enabled?"[x]":"[ ]"}),u.jsx(Tv,{className:F(!q.enabled&&"opacity-50"),children:q.label}),u.jsx("span",{className:"truncate text-tui-sm text-tui-muted",children:Qc(q,p)})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Be,{variant:"ghost",brackets:!1,disabled:Y===0,onClick:()=>L(Y,"up"),title:p("virtualKeyboard.moveUp"),"aria-label":p("virtualKeyboard.moveUp"),className:"px-1",children:"↑"}),u.jsx(Be,{variant:"ghost",brackets:!1,disabled:Y===O.length-1,onClick:()=>L(Y,"down"),title:p("virtualKeyboard.moveDown"),"aria-label":p("virtualKeyboard.moveDown"),className:"px-1",children:"↓"}),u.jsx(Be,{variant:"ghost",brackets:!1,onClick:()=>$(q.id),title:p("virtualKeyboard.deleteKeyTitle"),"aria-label":p("virtualKeyboard.deleteKeyTitle"),className:"px-1 text-tui-bad hover:text-tui-bad",children:_e.cross})]})]},q.id))}),u.jsx(Be,{block:!0,glyph:"+",onClick:()=>T(!y),className:"border-dashed",children:p("virtualKeyboard.addKey")}),y&&u.jsxs("div",{className:"space-y-2 border border-tui-border bg-tui-mantle p-2",children:[u.jsx(Fa,{label:p("virtualKeyboard.availableKeys")}),u.jsx("div",{className:"flex max-h-48 flex-wrap gap-1 overflow-y-auto",children:fy.map(q=>{const Y=O.some(R=>R.id===q.id);return u.jsxs("button",{type:"button",onClick:()=>Q(q),title:Qc(q,p),className:F("tui-focusable flex select-none items-center gap-1 border px-1.5 py-0.5 text-tui-sm transition-colors",Y?"border-tui-border-dim text-tui-faint":"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent"),children:[u.jsx("span",{children:q.label}),u.jsx("span",{"aria-hidden":"true",className:Y?"text-tui-ok":"text-tui-accent",children:Y?_e.check:"+"})]},q.id)})})]})]})]})},ix={success:"ok",warning:"warn",error:"bad",info:"accent"},sx={success:_e.check,warning:_e.warn,error:_e.cross,info:"›"},ox=()=>{const{toasts:r,removeToast:s,t:o}=mt();return r.length===0?null:u.jsx("div",{className:"pointer-events-none fixed right-2 top-12 z-50 flex w-[calc(100vw-16px)] max-w-sm flex-col gap-1","aria-live":"polite","aria-atomic":"true",children:r.map(c=>{const m=ix[c.type];return u.jsxs("div",{className:F("pointer-events-auto flex items-start gap-2 border border-tui-border border-l-2 bg-tui-base px-2 py-1 text-tui",An[m].edgeL),role:"alert",children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0 font-bold",An[m].text),children:sx[c.type]}),u.jsx("div",{className:"min-w-0 flex-1 break-words leading-snug text-tui-text",children:c.message}),c.count>1&&u.jsxs("span",{className:"shrink-0 border border-tui-border-dim px-1 text-tui-sm text-tui-muted","aria-label":`×${c.count}`,children:["×",c.count]}),u.jsx("button",{type:"button",onClick:()=>s(c.id),className:"tui-focusable shrink-0 select-none px-0.5 text-tui-faint transition-colors hover:text-tui-bad","aria-label":o("common.dismissNotification"),children:u.jsx("span",{"aria-hidden":"true",children:_e.cross})})]},c.id)})})},du=({onAddProfile:r,mobile:s=!1,statusBar:o=!1})=>{const{profiles:c,activeProfileId:m,activeProfile:f,connectionState:b,switchProfile:p,renameProfile:v,removeProfile:w,t:y}=mt(),[T,K]=S.useState(!1),[O,G]=S.useState(null),[V,L]=S.useState(""),Q=S.useRef(null);S.useEffect(()=>{if(!T)return;const Y=R=>{Q.current&&!Q.current.contains(R.target)&&K(!1)};return document.addEventListener("pointerdown",Y),()=>document.removeEventListener("pointerdown",Y)},[T]);const $=(Y,R)=>{G(Y),L(R)},I=Y=>{const R=V.trim();R&&v(Y,R),G(null)},ie=Y=>{typeof window<"u"&&!window.confirm(y("profiles.removeConfirm"))||(w(Y),G(null))},pe=(f==null?void 0:f.displayName)||y("profiles.addHost"),q=b==="connected"?"ok":b==="connecting"||b==="reconnecting"?"warn":b==="error"?"bad":"idle";return u.jsxs("div",{ref:Q,className:F("relative min-w-0",s&&"w-full",o&&"flex-1"),children:[u.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":T,"aria-label":y("profiles.switcherLabel"),onClick:()=>K(Y=>!Y),className:F("tui-focusable flex min-w-0 items-center gap-1.5 border border-transparent text-left text-tui-muted transition-colors hover:border-tui-border hover:text-tui-accent",o?"min-h-11 w-full max-w-none px-2":s?"min-h-11 w-full px-2":"min-h-[24px] max-w-[18rem] px-1"),children:[u.jsx(Rn,{level:q}),u.jsx("span",{className:F("truncate text-tui-text",o&&"min-w-0 flex-1"),children:pe}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:T?_e.chevronDown:_e.chevronRight})]}),T&&u.jsxs("div",{role:"menu","aria-label":y("profiles.switcherLabel"),className:F("absolute bottom-full left-0 z-[100] mb-1 max-h-[min(70vh,24rem)] overflow-y-auto border border-tui-border bg-tui-base p-1 shadow-lg",o?"w-80 max-w-[calc(100vw-1rem)]":s?"inset-x-0 bottom-auto top-full mt-1 mb-0 w-full":"w-80 max-w-[calc(100vw-1rem)]"),children:[u.jsx("div",{className:"border-b border-tui-border-dim px-2 py-1 text-tui-sm uppercase text-tui-faint",children:y("profiles.title")}),c.length===0?u.jsx("p",{className:"px-2 py-2 text-tui-sm text-tui-muted",children:y("profiles.empty")}):c.map(Y=>{const R=Y.id===m,de=Y.id===O;return u.jsxs("div",{role:"none",className:"border-b border-tui-border-dim last:border-b-0",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs("button",{type:"button",role:"menuitem","aria-current":R?"true":void 0,onClick:()=>{p(Y.id),K(!1)},className:F("tui-focusable flex min-h-11 min-w-0 flex-1 items-center gap-2 px-2 text-left text-tui transition-colors hover:bg-tui-selection",R?"text-tui-accent":"text-tui-text"),children:[u.jsx("span",{"aria-hidden":"true",className:"w-3 shrink-0",children:R?_e.cursor:""}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate font-bold",children:Y.displayName}),u.jsx("span",{className:"block truncate text-tui-sm text-tui-faint",title:Y.hostname||Y.hostId,children:Y.hostname||Y.hostId||Y.wsUrl})]}),R&&u.jsx("span",{className:"shrink-0 text-tui-sm text-tui-ok",children:y("profiles.current")})]}),u.jsx("button",{type:"button",role:"menuitem","aria-label":y("profiles.rename"),title:y("profiles.rename"),onClick:()=>$(Y.id,Y.displayName),className:"tui-focusable min-h-11 min-w-11 px-2 text-tui-muted hover:text-tui-accent",children:_e.ellipsis})]}),de&&u.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[u.jsx("input",{autoFocus:!0,value:V,maxLength:64,onChange:He=>L(He.target.value),onKeyDown:He=>{He.key==="Enter"&&I(Y.id),He.key==="Escape"&&G(null)},"aria-label":y("profiles.rename"),className:"tui-input min-w-0 flex-1 px-2 py-1 text-tui"}),u.jsx(Be,{onClick:()=>I(Y.id),variant:"primary",className:"min-h-11",children:y("common.save")}),u.jsx(Be,{onClick:()=>ie(Y.id),variant:"danger",className:"min-h-11",children:y("profiles.remove")})]})]},Y.id)}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{K(!1),r()},className:"tui-focusable flex min-h-11 w-full items-center gap-2 px-2 text-left text-tui-accent hover:bg-tui-selection",children:[u.jsx("span",{"aria-hidden":"true",children:"+"}),u.jsx("span",{children:y("profiles.addHost")})]})]})]})},rx=({onAddProfile:r=()=>{}})=>{const{connectionState:s,role:o,hostId:c,assignedClientId:m,sharedWindowCount:f,settings:b,rttMs:p,t:v}=mt(),w=jo(s,v),y=s==="connected";return u.jsx(xp,{left:u.jsxs(u.Fragment,{children:[u.jsx(du,{onAddProfile:r}),u.jsx(Ah,{items:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Rn,{level:w.level}),u.jsx("span",{className:"text-tui-text",children:w.label})]},"status"),y?u.jsx(Eo,{tone:o==="controller"?"ok":"warn",children:v(o==="controller"?"role.sharedControl":"common.viewer")},"role"):null,y&&f>1?u.jsx("span",{className:"text-tui-muted",children:v("role.sharedWindows",{count:f})},"windows"):null,c?u.jsxs("span",{children:[u.jsxs("span",{className:"text-tui-faint",children:[v("common.host"),":"]})," ",u.jsx("span",{className:"text-tui-text",children:c})]},"host"):null,u.jsxs("span",{children:[u.jsx("span",{className:"text-tui-faint",children:v("header.clientIdLabel")})," ",u.jsx("span",{className:"text-tui-text",children:m||b.clientId})]},"client")]})]}),right:u.jsx(Ah,{items:[p!==null?u.jsxs("span",{className:"text-tui-muted",children:[v("header.latencyTitle"),": ",u.jsxs("span",{className:"text-tui-text",children:[p,"ms"]})]},"rtt"):null,u.jsx("span",{className:"hidden text-tui-faint sm:inline",children:v("header.tagline")},"mode")]})})},cx=[[/\biPhone\b/i,"iPhone"],[/\biPad\b/i,"iPad"],[/\biPod\b/i,"iPod"],[/\bAndroid\b/i,"Android"],[/\bCrOS\b/i,"ChromeOS"],[/\bWindows NT\b/i,"Windows"],[/\bMac OS X\b|\bMacintosh\b/i,"macOS"],[/\bLinux\b/i,"Linux"]],ux=[[/\bEdgA?\/|\bEdge\//i,"Edge"],[/\bOPR\/|\bOpera\//i,"Opera"],[/\bSamsungBrowser\//i,"Samsung Internet"],[/\bFirefox\/|\bFxiOS\//i,"Firefox"],[/\bCriOS\//i,"Chrome"],[/\bChrome\//i,"Chrome"],[/\bSafari\//i,"Safari"]];function Dh(r,s){for(const[o,c]of r)if(o.test(s))return c;return null}function fu(r){const s=typeof r=="string"?r.trim():"";if(!s)return{label:"",raw:""};const o=Dh(cx,s),c=Dh(ux,s);return o&&c?{label:`${o} · ${c}`,raw:s}:o?{label:o,raw:s}:c?{label:c,raw:s}:{label:s.length>32?`${s.slice(0,32)}…`:s,raw:s}}function Oh(r){if(r===0)return"0 B";const s=1024,o=["B","KB","MB","GB"],c=Math.floor(Math.log(r)/Math.log(s));return`${(r/Math.pow(s,c)).toFixed(1)} ${o[c]}`}const dx=({clients:r})=>{const{t:s}=mt(),o=[{key:"id",header:s("admin.colClientId"),render:c=>u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Rn,{level:"ok"}),u.jsx("span",{className:"font-bold text-tui-text",children:c.id})]})},{key:"role",header:s("admin.colRole"),width:12,render:c=>{const m=c.role==="controller";return u.jsx(Eo,{tone:m?"ok":"warn",children:s(m?"common.controller":"common.viewer")})}},{key:"device",header:s("admin.colDevice"),render:c=>{const m=fu(c.userAgent);return m.label?u.jsx("span",{className:"text-tui-muted",title:m.raw,children:m.label}):u.jsx("span",{className:"text-tui-faint",children:s("admin.unknownDevice")})}},{key:"ip",header:s("admin.colIp"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.ip||"127.0.0.1"})},{key:"connectedAt",header:s("admin.colConnectedAt"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.connectedAt?new Date(c.connectedAt).toLocaleTimeString():s("admin.startedRecently")})},{key:"traffic",header:s("admin.colTraffic"),align:"right",render:c=>u.jsxs("span",{className:"whitespace-nowrap",children:[u.jsx("span",{className:"text-tui-accent",children:Oh(c.bytesReceived||0)}),u.jsx("span",{"aria-hidden":"true",className:"mx-1 text-tui-faint",children:"/"}),u.jsx("span",{className:"text-tui-ok",children:Oh(c.bytesSent||0)})]})}];return u.jsx(qt,{title:s("admin.connectedClientsTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cu,{columns:o,items:r,rowKey:c=>c.id,empty:s("admin.noClients")})})},Lh={online:"ok",busy:"ok",reconnecting:"warn",offline:"idle"};function fx(r=[],s=[]){const o=new Map;for(const f of s){if(!(f!=null&&f.hostId))continue;const b=o.get(f.hostId);b?b.push(f):o.set(f.hostId,[f])}const c=r.map(f=>{const b=o.get(f.id)||[];return{id:f.id,hostname:f.hostname||f.id,status:f.status||"online",connectedDeviceCount:f.connectedDeviceCount??0,pairedDeviceCount:f.pairedDeviceCount??b.length,devices:b,fromRosterOnly:!1}}),m=new Set(c.map(f=>f.id));for(const[f,b]of o)m.has(f)||c.push({id:f,hostname:f,status:"offline",connectedDeviceCount:0,pairedDeviceCount:b.length,devices:b,fromRosterOnly:!0});return c.sort((f,b)=>f.fromRosterOnly!==b.fromRosterOnly?f.fromRosterOnly?1:-1:f.hostname.localeCompare(b.hostname))}const mx=({hosts:r,devices:s})=>{const{t:o}=mt(),c=fx(r,s),m={online:o("admin.hostStatusOnline"),busy:o("admin.hostStatusBusy"),reconnecting:o("admin.hostStatusReconnecting"),offline:o("admin.hostStatusOffline")};return u.jsx(qt,{title:o("admin.hostsTitle",{count:c.length}),bodyClassName:"space-y-2",children:c.length===0?u.jsx("p",{className:"px-1 py-2 text-tui text-tui-faint",children:o("admin.noHosts")}):c.map(f=>u.jsxs("div",{className:"border border-tui-border-dim bg-tui-mantle",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-tui-border-dim px-2 py-1",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-tui",children:[u.jsx(Rn,{level:Lh[f.status]}),u.jsx("span",{className:"truncate font-bold text-tui-text",children:f.hostname}),f.hostname!==f.id?u.jsx("code",{className:"truncate text-tui-sm text-tui-faint",children:f.id}):null]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-3 text-tui-sm",children:[u.jsx(Eo,{tone:Lh[f.status],children:m[f.status]}),u.jsx("span",{className:"text-tui-accent",children:o("admin.hostConnectedDevices",{count:f.connectedDeviceCount})}),u.jsx("span",{className:"text-tui-muted",children:o("admin.hostPairedDevices",{count:f.pairedDeviceCount})})]})]}),f.devices.length>0?u.jsx("ul",{className:"divide-y divide-tui-border-dim",children:f.devices.map(b=>{const p=fu(b.userAgent);return u.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-2 py-0.5 text-tui",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:"·"}),u.jsx("span",{className:"truncate text-tui-text",title:p.raw,children:p.label||o("admin.unknownDevice")}),u.jsx("code",{className:"truncate text-tui-sm text-tui-muted",children:b.deviceId}),u.jsx("span",{className:"ml-auto shrink-0 text-tui-sm text-tui-faint",children:b.lastIp||"—"})]},b.deviceId)})}):u.jsx("p",{className:"px-2 py-1 text-tui-sm text-tui-faint",children:f.pairedDeviceCount>0?o("admin.hostRosterOperatorOnly"):o("admin.noDevices")})]},f.id))})},hx=({ptys:r})=>{const{t:s}=mt(),o=[{key:"id",header:s("admin.colPtyId"),render:c=>u.jsx("span",{className:"font-bold text-tui-accent",children:c.id})},{key:"pid",header:s("admin.colPid"),width:9,render:c=>u.jsx("span",{className:"text-tui-muted",children:c.pid})},{key:"command",header:s("admin.colCommand"),render:c=>u.jsx("code",{className:"border border-tui-border-dim bg-tui-mantle px-1 text-tui-text",children:c.command})},{key:"grid",header:s("admin.colGrid"),width:11,render:c=>u.jsxs("span",{className:"whitespace-nowrap text-tui-muted",children:[c.cols,u.jsx("span",{"aria-hidden":"true",className:"mx-0.5 text-tui-faint",children:"×"}),c.rows]})},{key:"cwd",header:s("admin.colCwd"),className:"max-w-xs truncate",render:c=>u.jsx("span",{className:"text-tui-muted",children:c.cwd||"~"})},{key:"viewers",header:s("admin.colViewers"),align:"right",width:9,render:c=>u.jsx("span",{className:"font-bold text-tui-ok",children:c.activeClients})}];return u.jsx(qt,{title:s("admin.activePtysTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cu,{columns:o,items:r,rowKey:c=>c.id,empty:s("admin.noPtys")})})};function px(r){if(!r)return"—";const s=new Date(r);return Number.isNaN(s.getTime())?"—":s.toLocaleString()}const bx=({devices:r,onRevoke:s})=>{const{t:o}=mt(),[c,m]=S.useState(null),[f,b]=S.useState(null),p=async w=>{if(c!==w){m(w);return}b(w);try{await s(w)}finally{b(null),m(null)}},v=[{key:"device",header:o("admin.colDevice"),render:w=>{const y=fu(w.userAgent);return u.jsx("span",{className:"text-tui-text",title:y.raw,children:y.label||o("admin.unknownDevice")})}},{key:"deviceId",header:o("admin.colDeviceId"),render:w=>u.jsx("span",{className:"text-tui-muted",children:w.deviceId})},{key:"ip",header:o("admin.colIp"),render:w=>u.jsx("span",{className:"text-tui-muted",children:w.lastIp||"—"})},{key:"lastSeen",header:o("admin.colLastSeen"),render:w=>u.jsx("span",{className:"whitespace-nowrap text-tui-muted",children:px(w.lastSeenAt)})},{key:"actions",header:o("admin.colActions"),align:"right",render:w=>{const y=c===w.deviceId,T=f===w.deviceId;return u.jsx(Be,{variant:"danger",disabled:T,onClick:()=>void p(w.deviceId),onBlur:()=>m(K=>K===w.deviceId?null:K),"aria-label":o("admin.revokeDevice"),className:y?"bg-tui-bad text-tui-crust":void 0,children:T?u.jsx(Wa,{}):o(y?"admin.revokeConfirm":"admin.revokeDevice")})}}];return u.jsx(qt,{title:o("admin.pairedDevicesTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cu,{columns:v,items:r,rowKey:w=>w.deviceId,empty:o("admin.noDevices")})})};function Tp(r){if(typeof window>"u"||!r||r.startsWith("/"))return"";try{const s=new URL(r.replace(/^ws/,"http")),o=s.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"");return s.origin===window.location.origin&&!o?"":`${s.origin}${o}`}catch{return""}}function Fi(r,s){const o=Tp(r);return o?`${o}${s.startsWith("/")?s:`/${s}`}`:s}const gx=({onBackToTerminal:r,onOpenPairing:s})=>{var ut,ht,Xt,_t,lt,Qt,Lt,hn,ln,Vt,wt,Dn,On,Ln;const{settings:o,updateSettings:c,addToast:m,t:f}=mt(),b=Tp(o.wsUrl)||(typeof window<"u"?window.location.origin:"local"),p=((ut=o.adminTokens)==null?void 0:ut[b])||(b===(typeof window<"u"?window.location.origin:"local")?o.adminToken:"")||"",[v,w]=S.useState(null),[y,T]=S.useState(null),[K,O]=S.useState(!1),[G,V]=S.useState(!0),[L,Q]=S.useState(null),[$,I]=S.useState(!1),[ie,pe]=S.useState(3e3),[q,Y]=S.useState(null),[R,de]=S.useState("overview"),[He,Te]=S.useState(!1),[be,X]=S.useState(p),[ce,we]=S.useState(!!p),j="node bin/service.js pair";S.useEffect(()=>{X(p),we(!!p),w(null),T(null),O(!1)},[b]);const B=()=>{oa(j).then(P=>{if(P==="failed"){m("error",f("clipboard.copyFailed"));return}Te(!0),m("success",f("toasts.commandCopied")),setTimeout(()=>Te(!1),2e3)})};S.useEffect(()=>{let P=!0;V(!0);async function Ce(){try{const Se=await fetch(Fi(o.wsUrl,"/api/info"),{headers:{Accept:"application/json"}});if(Se.ok){const Pe=await Se.json();P&&(T(Pe),O(!0));return}}catch{}if(P){const Se=!!(o.wsUrl&&!o.wsUrl.startsWith("/")&&!o.wsUrl.includes("localhost")&&!o.wsUrl.includes("127.0.0.1")&&typeof window<"u"&&!o.wsUrl.startsWith(window.location.origin.replace("http","ws")));T({ok:!0,version:"0.1.0",protocol:1,relayMode:Se?"remote":"local",adminConfigured:!1,adminPath:"/admin",adminStatusPath:"/api/admin/status"}),O(!0)}}return Ce(),()=>{P=!1}},[o.wsUrl,b]);const Z=(y==null?void 0:y.relayMode)==="remote",oe=()=>{if(y!=null&&y.adminPath)return y.publicUrl?`${y.publicUrl.replace(/\/$/,"")}${y.adminPath}`:Fi(o.wsUrl,y.adminPath);if(v!=null&&v.remoteAdminUrl)return v.remoteAdminUrl;if(o.wsUrl)try{return Fi(o.wsUrl,"/admin")}catch{}return"/admin"},k=S.useCallback(async()=>{if(K){if(Z){if(!ce&&!be){w(null),V(!1),Q(null),I(!1);return}try{V(!0);const P=Fi(o.wsUrl,(y==null?void 0:y.adminStatusPath)||"/api/admin/status"),Se=await fetch(P,{headers:{Accept:"application/json","X-Relay-Admin-Token":be}});if(Se.status===401||Se.status===403){I(!0),Q(f("admin.relayAdminAuthError")),w(null);return}if(!Se.ok)throw new Error(`HTTP ${Se.status}: ${Se.statusText}`);const Pe=await Se.json();w(Pe),Q(null),I(!1),Y(new Date)}catch(P){console.warn("GET /api/admin/status request failed:",P),I(!1),Q(P instanceof Error?P.message:"Failed to fetch remote admin status"),w(null)}finally{V(!1)}return}try{V(!0);const P={Accept:"application/json"};o.token&&(P.Authorization=`Bearer ${o.token}`);const Ce=await fetch("/api/status",{headers:P});if(Ce.status===401||Ce.status===403){I(!0),Q(`Authentication failed (HTTP ${Ce.status}): Access denied. Please configure an authorized token or pair with the host.`),w(null);return}if(!Ce.ok)throw new Error(`HTTP ${Ce.status}: ${Ce.statusText}`);const Se=await Ce.json();w(Se),Q(null),I(!1),Y(new Date)}catch(P){console.warn("GET /api/status request failed:",P),I(!1),Q(P instanceof Error?P.message:"Failed to fetch status"),w(null)}finally{V(!1)}}},[K,Z,ce,be,y,o.token,o.wsUrl,b,f]),Je=S.useCallback(async P=>{try{if(!(await fetch(Fi(o.wsUrl,`/api/admin/devices/${encodeURIComponent(P)}`),{method:"DELETE",headers:{Accept:"application/json","X-Relay-Admin-Token":be}})).ok){Q(f("admin.revokeFailed"));return}await k()}catch{Q(f("admin.revokeFailed"))}},[be,k,o.wsUrl,f]);S.useEffect(()=>{if(!K)return;k();let P=null;const Ce=()=>{ie>0&&!P&&(P=setInterval(()=>{document.visibilityState==="visible"&&k()},ie))},Se=()=>{P&&(clearInterval(P),P=null)},Pe=()=>{document.visibilityState==="visible"?(k(),Ce()):Se()};return Ce(),document.addEventListener("visibilitychange",Pe),()=>{Se(),document.removeEventListener("visibilitychange",Pe)}},[K,k,ie]);const Ge=P=>{P.preventDefault();const Ce=be.trim();c({adminToken:Ce,adminTokens:{...o.adminTokens||{},[b]:Ce}}),we(!!Ce)},me=P=>{const Ce=Math.max(0,Math.floor(P)),Se=Math.floor(Ce/86400),Pe=Math.floor(Ce%86400/3600),Ft=Math.floor(Ce%3600/60),pn=Ce%60,Kt=(ml,Xn)=>`${ml}${f(`admin.unit${Xn}`)}`;return Se>0?[Kt(Se,"Day"),Kt(Pe,"Hour"),Kt(Ft,"Minute")].join(" "):Pe>0?[Kt(Pe,"Hour"),Kt(Ft,"Minute"),Kt(pn,"Second")].join(" "):[Kt(Ft,"Minute"),Kt(pn,"Second")].join(" ")},ve=P=>{if(!P||P===0)return"0 B";const Ce=1024,Se=["B","KB","MB","GB"],Pe=Math.floor(Math.log(P)/Math.log(Ce));return`${(P/Math.pow(Ce,Pe)).toFixed(1)} ${Se[Pe]}`},ke=()=>{const P=oe();window.open(P,"_blank","noopener,noreferrer")},Ne=v?v.activeUserCount??((ht=v.clients)==null?void 0:ht.length)??0:0,$e=v?[{id:"overview",label:f("admin.tabOverview"),index:1},{id:"clients",label:f("admin.tabClients",{count:((Xt=v.clients)==null?void 0:Xt.length)||0}),index:2},{id:"ptys",label:f("admin.tabPtys",{count:((_t=v.ptys)==null?void 0:_t.length)||0}),index:3},...v.devices?[{id:"devices",label:f("admin.tabDevices",{count:v.devices.length}),index:4}]:[]]:[],zt=$e.map(P=>P.id);S.useEffect(()=>{const P=Ce=>{if(Ce.ctrlKey||Ce.altKey||Ce.metaKey)return;const Se=Ce.target;if(Se instanceof HTMLInputElement||Se instanceof HTMLTextAreaElement||Se instanceof HTMLSelectElement||Se!=null&&Se.isContentEditable||document.querySelector('[role="dialog"]'))return;if(Ce.key==="Escape"&&r){Ce.preventDefault(),r();return}if(Ce.key.toLowerCase()==="r"){Ce.preventDefault(),k();return}const Pe=Number.parseInt(Ce.key,10)-1;Number.isInteger(Pe)&&Pe>=0&&Pe<zt.length&&(Ce.preventDefault(),de(zt[Pe]))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[k,zt.join("|")]);const De=u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r&&u.jsx(Be,{variant:"ghost",onClick:r,title:f("admin.returnToTerminal"),"aria-label":f("admin.returnToTerminal"),glyph:_e.arrowLeft,brackets:!1,className:"shrink-0",children:u.jsx("span",{className:"sr-only",children:f("admin.returnToTerminal")})}),u.jsxs("span",{className:"hidden text-tui-sm text-tui-accent sm:inline",children:["v",(y==null?void 0:y.version)||(v==null?void 0:v.version)||"0.1.0"]}),u.jsx(Eo,{tone:Z?"alt":"ok",children:f(Z?"admin.modeRemote":"admin.localWorkstationBadge")}),u.jsxs("label",{className:"hidden items-center gap-1.5 text-tui-sm text-tui-muted md:flex",children:[u.jsx("span",{children:f("admin.autoRefresh")}),u.jsxs(ru,{value:ie,onChange:P=>pe(Number(P.target.value)),"aria-label":f("admin.autoRefresh"),className:"w-auto",children:[u.jsx("option",{value:0,children:f("admin.paused")}),u.jsx("option",{value:1e3,children:"1s"}),u.jsx("option",{value:3e3,children:"3s"}),u.jsx("option",{value:5e3,children:"5s"}),u.jsx("option",{value:1e4,children:"10s"})]})]}),u.jsx(Be,{variant:"primary",onClick:k,disabled:G,title:f("admin.refreshNow"),children:G?u.jsx(Wa,{}):f("admin.refreshNow")})]});return u.jsxs(Nv,{name:f("admin.title"),tagline:f("admin.subtitle"),aside:De,tabs:$e,activeTabId:R,onSelectTab:P=>de(P),tabsAriaLabel:f("header.mainNavigationAria"),hints:[{keys:"1–4",action:f("admin.hintTabs")},{keys:"r",action:f("admin.hintRefresh")},...r?[{keys:"esc",action:f("admin.hintBack")}]:[]],footerAside:q?u.jsx("span",{className:"text-tui-faint",children:f("admin.updatedAt",{time:q.toLocaleTimeString()})}):null,bodyClassName:"space-y-3 pb-2",children:[!K&&u.jsx("div",{className:"flex items-center justify-center gap-2 border border-tui-border bg-tui-base px-3 py-8 text-tui text-tui-muted",children:u.jsx(Wa,{label:f("admin.loadingStatus")})}),K&&Z&&!ce&&u.jsxs(qt,{title:f("admin.remoteRelayTitle"),aside:f("admin.remoteRelayBadge"),bodyClassName:"space-y-2",children:[u.jsx("p",{className:"text-tui leading-snug text-tui-muted",children:f("admin.remoteRelayNotice")}),u.jsxs("div",{className:"space-y-0.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx(kn,{label:f("admin.remoteRelayEndpoint"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-accent",children:o.wsUrl})}),u.jsx(kn,{label:f("admin.remoteRelayAdminUrl"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-ok",children:oe()})})]}),u.jsx(Fa,{}),u.jsxs("div",{className:"flex flex-col items-start justify-between gap-2 sm:flex-row sm:items-center",children:[u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:f("admin.remoteRelayHelp")}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(Be,{onClick:()=>we(!0),children:f("admin.relayAdminLoginBtn")}),u.jsx(Be,{variant:"primary",onClick:ke,glyph:_e.arrowRight,children:f("admin.openRemoteAdminBtn")})]})]})]}),K&&Z&&ce&&!v&&u.jsxs(qt,{title:f("admin.relayAdminTitle"),bodyClassName:"space-y-2",children:[u.jsx(So,{tone:(y==null?void 0:y.adminConfigured)===!1?"warn":"bad",children:(y==null?void 0:y.adminConfigured)===!1?f("admin.relayAdminNotConfigured"):f("admin.relayAdminAuthError")}),u.jsxs("form",{onSubmit:Ge,className:"space-y-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(En,{htmlFor:"relay-admin-token",children:f("admin.relayAdminTokenLabel")}),u.jsx(jn,{id:"relay-admin-token",type:"password",value:be,onChange:P=>X(P.target.value),placeholder:f("admin.relayAdminTokenPlaceholder")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Be,{variant:"primary",type:"submit",children:f("admin.relayAdminLoginBtn")}),u.jsx(Be,{variant:"ghost",onClick:()=>we(!1),children:f("common.cancel")})]})]})]}),K&&!Z&&$&&u.jsxs(qt,{title:f("admin.unauthorizedTitle"),tone:"bad",bodyClassName:"space-y-2",children:[u.jsx(So,{tone:"bad",children:f("admin.unauthorizedDesc")}),u.jsxs("div",{className:"space-y-1.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx("span",{className:"block text-tui-sm uppercase text-tui-muted",children:f("admin.pairingStepsTitle")}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-crust px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui-text",children:j}),u.jsx(Be,{onClick:B,glyph:He?_e.check:"⧉",className:F("shrink-0",He&&"border-tui-ok text-tui-ok"),children:f(He?"admin.copiedJson":"common.copy")})]}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:f("admin.pairingStepsHelp")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[s&&u.jsx(Be,{variant:"primary",onClick:s,children:f("admin.enterPairCodeBtn")}),u.jsx(Be,{onClick:k,children:f("admin.retryFetchBtn")})]})]}),K&&L&&!$&&!(!Z&&$)&&u.jsx(So,{tone:"warn",action:u.jsx(Be,{variant:"warn",onClick:k,children:f("common.retry")}),children:f("admin.errorConnecting",{error:L})}),v&&u.jsxs(u.Fragment,{children:[R==="overview"&&u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[u.jsxs(qt,{title:f("admin.accessPanel"),aside:me(v.uptimeSeconds||0),bodyClassName:"space-y-0.5",children:[u.jsx(kn,{label:f("admin.connectedHosts"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Rn,{level:(lt=v.hosts)!=null&<.length?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:((Qt=v.hosts)==null?void 0:Qt.length)||0})]})}),u.jsx(kn,{label:f("admin.activeUsers"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Rn,{level:Ne?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:Ne}),u.jsx("span",{className:"text-tui-faint",children:f("admin.acrossWindows",{count:((Lt=v.clients)==null?void 0:Lt.length)||0})})]})}),u.jsxs(kn,{label:f("admin.activePtys"),labelWidth:14,children:[u.jsx("span",{className:"font-bold",children:((hn=v.ptys)==null?void 0:hn.length)||0}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.terminalShells")})]}),u.jsx(kn,{label:f("admin.uptime"),labelWidth:14,children:u.jsx("span",{className:"text-tui-muted",children:v.startTime?f("admin.startedAt",{time:new Date(v.startTime).toLocaleTimeString()}):f("admin.startedRecently")})})]}),u.jsxs(qt,{title:f("admin.throughput"),aside:f("admin.perSecond",{value:ve(((ln=v.throughput)==null?void 0:ln.bytesOutPerSec)||0)}),bodyClassName:"space-y-0.5",children:[u.jsxs(kn,{label:f("admin.bytesInTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-accent",children:ve(((Vt=v.throughput)==null?void 0:Vt.bytesIn)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:ve(((wt=v.throughput)==null?void 0:wt.bytesInPerSec)||0)})})]}),u.jsxs(kn,{label:f("admin.bytesOutTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-ok",children:ve(((Dn=v.throughput)==null?void 0:Dn.bytesOut)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:ve(((On=v.throughput)==null?void 0:On.bytesOutPerSec)||0)})})]}),u.jsx(Fa,{}),u.jsx(kn,{label:f("admin.frameRate"),labelWidth:13,children:u.jsx("span",{className:"font-bold",children:f("admin.framesPerSecond",{count:(((Ln=v.throughput)==null?void 0:Ln.framesOutPerSec)||0).toFixed(0)})})})]})]}),u.jsx(mx,{hosts:v.hosts||[],devices:v.devices})]}),R==="clients"&&u.jsx(dx,{clients:v.clients||[]}),R==="ptys"&&u.jsx(hx,{ptys:v.ptys||[]}),R==="devices"&&u.jsx(bx,{devices:v.devices||[],onRevoke:Je})]})]})},yx=({compact:r=!1})=>{const{role:s,connectionState:o,sharedWindowCount:c,assignedClientId:m,t:f}=mt();if(!(o==="connected"))return u.jsxs("div",{className:"inline-flex select-none items-center gap-1.5 text-tui uppercase text-tui-faint",role:"status","aria-label":f("terminal.offlineStatusAria"),children:[u.jsx(Rn,{level:"idle"}),u.jsx("span",{children:f("common.offline")})]});const p=s==="controller",v=c>1,w=u.jsxs("div",{className:F("inline-flex min-w-0 select-none items-center gap-1.5 text-tui uppercase",p?"text-tui-ok":"text-tui-warn"),role:"status","aria-label":f(p?"role.controllerMode":"role.viewerMode"),children:[u.jsx(Rn,{level:p?"ok":"warn"}),u.jsx("span",{className:"truncate",children:f(p?"role.sharedControl":"role.viewerReadOnly")}),v?u.jsx("span",{className:"shrink-0 normal-case text-tui-muted",children:f("role.sharedWindows",{count:c})}):null]});return r?w:u.jsxs("div",{className:"flex w-full flex-col gap-1",children:[w,u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:f("role.sharedControlDesc")}),m?u.jsx(kn,{label:f("role.thisWindow"),labelWidth:9,className:"text-tui-sm",children:u.jsx("span",{className:"truncate text-tui-muted",children:m})}):null]})},Ji="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",Wi="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",vx="border-tui-accent bg-tui-selection text-tui-accent",Ii=({active:r=!1})=>u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",r?"text-tui-accent":"text-tui-faint group-hover:text-tui-accent"),children:_e.cursor}),xx=({onClose:r,onNavigateAdmin:s,showAdminEntry:o=!0,onOpenPairing:c,onOpenSettings:m,onAddProfile:f=()=>{}})=>{const{connectionState:b,stateDetail:p,rttMs:v,hostId:w,settings:y,updateSettings:T,connect:K,addToast:O,language:G,setLanguage:V,t:L}=mt(),[Q,$]=fl.useState(!1),I=jo(b,L),ie=Y=>()=>{var de;const R=document.activeElement;(de=R==null?void 0:R.blur)==null||de.call(R),Y()},pe=()=>{oa(y.clientId).then(Y=>{if(Y==="failed"){O("error",L("clipboard.copyFailed"));return}$(!0),O("info",L("toasts.clientIdCopied",{id:y.clientId})),setTimeout(()=>$(!1),2e3)})},q=()=>{const Y=G==="zh"?"en":"zh";V(Y),O("info",au(Y,"toasts.switchedLanguage",{lang:Y==="zh"?"简体中文":"English"}))};return u.jsxs("div",{className:"flex flex-col gap-3 px-3 pb-2 pt-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border pb-1.5",children:[u.jsx("h2",{className:"text-tui font-bold uppercase text-tui-accent",children:L("mobile.sessionControls")}),u.jsx(Be,{variant:"ghost",onClick:r,"aria-label":L("mobile.closeSessionControls"),children:"esc"})]}),u.jsx(qt,{title:L("profiles.title"),tone:"accent",bodyClassName:"space-y-1",children:u.jsx(du,{mobile:!0,onAddProfile:f})}),u.jsxs(qt,{title:L("common.status"),tone:I.level==="ok"?"ok":I.level==="bad"?"bad":"warn",bodyClassName:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2","aria-label":L("mobile.connectionStatusAria"),children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(Rn,{level:I.level}),u.jsx("span",{className:"truncate text-tui uppercase text-tui-text",children:I.label}),b==="connected"&&v!==null&&u.jsxs("span",{className:"text-tui-sm text-tui-muted",children:[v,"ms"]})]}),I.actionLabel&&u.jsx(Be,{variant:"primary",onClick:()=>K(),className:"shrink-0",children:I.actionLabel})]}),I.needsAttention&&p&&u.jsx("p",{className:"text-tui-sm leading-snug text-tui-muted",children:p}),w&&u.jsx(kn,{label:L("common.host"),labelWidth:9,children:w}),u.jsxs("button",{type:"button",onClick:pe,className:"tui-focusable flex w-full items-baseline gap-2 text-left text-tui",title:L("header.copyClientIdTitle"),children:[u.jsx("span",{className:"shrink-0 text-tui-muted",style:{width:"9ch"},children:L("header.clientIdLabel")}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-text",children:y.clientId}),u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",Q?"text-tui-ok":"text-tui-faint"),children:Q?_e.check:"⧉"})]})]}),u.jsx(qt,{title:L("mobile.inputControl"),tone:"accent","aria-label":L("mobile.terminalControlAria"),children:u.jsx(yx,{})}),u.jsxs(qt,{title:L("mobile.menu"),tone:"accent",bodyClassName:"flex flex-col gap-1",children:[u.jsxs("button",{type:"button",onClick:q,className:F(Ji,Wi),"aria-label":L("header.languageToggleTitle"),children:[u.jsx(Ii,{}),u.jsx("span",{className:"truncate",children:G==="zh"?"English":"中文"})]}),u.jsxs("button",{type:"button",onClick:ie(m),className:F(Ji,Wi),"aria-label":L("mobile.settingsAria"),children:[u.jsx(Ii,{}),u.jsx("span",{className:"truncate",children:L("common.settings")})]}),u.jsxs("button",{type:"button",onClick:ie(c),className:F(Ji,Wi),"aria-label":L("mobile.pairingAria"),children:[u.jsx(Ii,{}),u.jsx("span",{className:"truncate",children:L("common.pairing")})]}),o&&u.jsxs("button",{type:"button",onClick:ie(s),className:F(Ji,Wi),"aria-label":L("mobile.adminAria"),children:[u.jsx(Ii,{}),u.jsx("span",{className:"truncate",children:L("common.admin")})]}),u.jsxs("button",{type:"button",onClick:()=>T({toolbarVisible:!y.toolbarVisible}),className:F(Ji,y.toolbarVisible?vx:Wi),"aria-label":L("mobile.keybarAria"),"aria-pressed":y.toolbarVisible,children:[u.jsx(Ii,{active:y.toolbarVisible}),u.jsx("span",{className:"truncate",children:L("common.keyBar")}),u.jsx("span",{"aria-hidden":"true",className:"ml-auto shrink-0 text-tui-sm",children:y.toolbarVisible?"[x]":"[ ]"})]})]})]})},Sx=({onAddProfile:r})=>{const{rttMs:s,t:o}=mt();return u.jsxs("footer",{"data-testid":"mobile-status-bar",role:"status","aria-label":o("mobile.statusBarAria"),className:"absolute inset-x-0 bottom-0 z-40 flex h-11 shrink-0 items-center gap-2 border-t border-tui-border bg-tui-mantle px-1 text-tui-sm",children:[u.jsx(du,{statusBar:!0,onAddProfile:r}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-border",children:"│"}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 px-1 text-tui-muted",title:o("header.latencyTitle"),children:[u.jsx("span",{className:"text-tui-faint",children:"RTT"}),u.jsx("span",{className:F(s===null?"text-tui-faint":"text-tui-text"),children:s===null?"—":`${s}ms`})]})]})},wx=({onNavigateAdmin:r,showAdminEntry:s=!0,onOpenPairing:o,onOpenSettings:c,onAddProfile:m=()=>{}})=>{const{connectionState:f,isController:b,t:p}=mt(),[v,w]=S.useState(!1),y=S.useRef(null),T=S.useCallback(()=>w(!1),[]);S.useEffect(()=>{if(!v)return;const O=G=>{if(!(G.ctrlKey||G.altKey||G.metaKey)&&G.key==="Escape"){const V=G.target;V&&typeof V.closest=="function"&&!!V.closest("#terminal-container")||(G.stopPropagation(),G.preventDefault(),T())}};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[v,T]),S.useEffect(()=>{var O;v&&((O=y.current)==null||O.focus({preventScroll:!0}))},[v]);const K=jo(f,p);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{"data-testid":"mobile-topbar",role:"toolbar","aria-label":p("mobile.sessionControls"),className:"pointer-events-none absolute inset-x-0 top-0 z-40 flex h-12 items-center justify-between gap-2 border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-sm text-tui-muted",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:"herdr"}),u.jsx(yp,{className:"shrink-0"}),u.jsx(Rn,{level:K.level}),u.jsx("span",{className:"truncate uppercase",children:K.label})]}),u.jsxs("button",{type:"button","data-testid":"mobile-chrome-trigger",onClick:()=>w(!0),"aria-label":p("mobile.sessionControls"),"aria-expanded":v,"aria-haspopup":"dialog",className:F("tui-focusable pointer-events-auto flex h-9 shrink-0 select-none items-center gap-1.5 border px-2 text-tui uppercase transition-colors",K.needsAttention?"border-tui-warn text-tui-warn":b?"border-tui-border text-tui-muted":"border-tui-accent text-tui-accent"),children:[!b&&!K.needsAttention&&u.jsx("span",{className:"max-w-[8rem] truncate",children:p("common.viewer")}),u.jsx("span",{"aria-hidden":"true",className:"text-tui",children:_e.chevronDown}),u.jsx("span",{"aria-hidden":"true",children:p("mobile.menu")})]})]}),v&&u.jsxs(u.Fragment,{children:[u.jsx("div",{"data-testid":"mobile-sheet-scrim",className:"absolute inset-0 z-40 bg-tui-crust/70",onClick:T,"aria-hidden":"true"}),u.jsx("div",{ref:y,"data-testid":"mobile-control-sheet",role:"dialog","aria-modal":"true","aria-label":p("mobile.sessionControls"),tabIndex:-1,className:"herdr-sheet absolute inset-x-0 bottom-0 z-50 max-h-[85%] overflow-y-auto border-t border-tui-border bg-tui-base pb-3 focus:outline-none",children:u.jsx(xx,{onClose:T,showAdminEntry:s,onNavigateAdmin:()=>{T(),r()},onOpenPairing:()=>{T(),o()},onOpenSettings:()=>{T(),c()},onAddProfile:()=>{T(),m()}})})]}),u.jsx(Sx,{onAddProfile:m})]})},Np="--app-height",Ap="--keyboard-inset",Cx=80;function Tx(){if(typeof window>"u")return{height:768,keyboardInset:0};const r=window.innerHeight||768,s=window.visualViewport;if(s&&typeof s.height=="number"&&s.height>0){const o=r-s.height-(s.offsetTop||0),c=o>=Cx?Math.round(o):0;return{height:Math.round(s.height),keyboardInset:c}}return{height:r,keyboardInset:0}}function Uh(r,s=Tx()){return r.style.setProperty(Np,`${s.height}px`),r.style.setProperty(Ap,`${s.keyboardInset}px`),s}function Nx(r=typeof document<"u"?document.documentElement:null){if(!r||typeof window>"u")return()=>{};let s=null;const o=()=>{s=null,Uh(r)},c=()=>{if(s===null){if(typeof requestAnimationFrame!="function"){o();return}s=requestAnimationFrame(o)}};Uh(r);const m=window.visualViewport;return m==null||m.addEventListener("resize",c),m==null||m.addEventListener("scroll",c),window.addEventListener("resize",c),window.addEventListener("orientationchange",c),()=>{s!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(s),s=null),m==null||m.removeEventListener("resize",c),m==null||m.removeEventListener("scroll",c),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),r.style.removeProperty(Np),r.style.removeProperty(Ap)}}const Ax=900;function Bh(){if(typeof window>"u")return!1;const r=Za();return r<tu?!0:r<=Ax}function Ex(){const[r,s]=S.useState(Bh);return S.useEffect(()=>{var m,f;const o=()=>{const b=Bh();s(p=>p===b?p:b)};o();let c=null;try{c=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null}catch{c=null}return(m=c==null?void 0:c.addEventListener)==null||m.call(c,"change",o),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),(f=window.visualViewport)==null||f.addEventListener("resize",o),()=>{var b,p;(b=c==null?void 0:c.removeEventListener)==null||b.call(c,"change",o),window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o),(p=window.visualViewport)==null||p.removeEventListener("resize",o)}},[]),r}function jx(r){const s=r.target;if(!s)return!1;if(s.id==="terminal-container"||s.id==="terminal-frame"||s.id==="terminal-surface"||s.classList.contains("xterm-helper-textarea")||s.classList.contains("xterm")||s.closest("#terminal-container")||s.closest(".xterm"))return!0;if(typeof document<"u"&&document.activeElement){const o=document.activeElement;if(o.id==="terminal-container"||o.classList.contains("xterm-helper-textarea")||o.closest("#terminal-container")||o.closest(".xterm"))return!0}return!1}function Rx(r,s={}){if(typeof window>"u")return()=>{};const o=c=>{var m;c.ctrlKey||c.altKey||c.metaKey||c.key==="Escape"&&(s.isModalOpen||s.isSheetOpen)&&(jx(c)||(c.preventDefault(),c.stopPropagation(),(m=r.onCloseModals)==null||m.call(r)))};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}}function Mx(){const[r,s]=S.useState("terminal"),[o,c]=S.useState(!1),[m,f]=S.useState(!1),[b,p]=S.useState(!1),[v,w]=S.useState(!1),{updateSettings:y,settings:T,connectionState:K,stateDetail:O,stateCode:G,lastPairedAt:V}=mt(),L=Ex();S.useEffect(()=>Nx(),[]);const[Q,$]=S.useState(!0);S.useEffect(()=>{let X=!1;return fetch("/api/info",{headers:{Accept:"application/json"}}).then(ce=>ce.ok?ce.json():null).then(ce=>{X||!ce||$(!ce.isRemoteRelay)}).catch(()=>{}),()=>{X=!0}},[]),S.useEffect(()=>{tp()},[]),S.useEffect(()=>{const X=o||b||v;if(X)return Rx({onCloseModals:()=>{c(!1),p(!1),w(!1)}},{isModalOpen:X})},[o,b,v]),S.useEffect(()=>{const X=()=>{const ce=window.location.pathname,we=window.location.hash;s(ce==="/admin"||we==="#admin"?"admin":"terminal")};X(),window.addEventListener("popstate",X),window.addEventListener("hashchange",X);try{const ce=new URL(window.location.href),we=ce.searchParams.get("token"),j=ce.searchParams.get("pairCode"),B=ce.searchParams.get("ws")||ce.searchParams.get("wsUrl"),Z={};we&&(Z.token=we),j&&(Z.pairCode=j.toUpperCase()),B&&(Z.wsUrl=B),Object.keys(Z).length>0&&y(Z);let oe=!1;if(ce.searchParams.has("token")&&(ce.searchParams.delete("token"),oe=!0),ce.searchParams.has("pairCode")&&(ce.searchParams.delete("pairCode"),oe=!0),oe){const k=ce.searchParams.toString(),Je=ce.pathname+(k?`?${k}`:"")+ce.hash;window.history.replaceState({},"",Je)}}catch(ce){console.warn("Failed to parse URL query params:",ce)}return()=>{window.removeEventListener("popstate",X),window.removeEventListener("hashchange",X)}},[]);const I=(X=!1)=>{f(X),c(!0)},ie=()=>{c(!1),f(!1)},pe=X=>{s(X),X==="admin"?window.history.pushState({},"","/admin"):window.history.pushState({},"","/")},q=!T.token&&!T.pairCode&&K!=="connected",Y=K==="error"&&(["auth_required","unauthorized","device_revoked"].includes(G||"")||/auth|unauthor|forbidden|permission|token|pair/i.test(O||"")),R=q||Y,[de,He]=S.useState(!R);S.useEffect(()=>{R||He(!0)},[R]),S.useEffect(()=>{V&&(c(!1),He(!0),s("terminal"))},[V]);const Te=r==="terminal"&&!R,be=X=>({visibility:X?"visible":"hidden",opacity:X?1:0,pointerEvents:X?"auto":"none",zIndex:X?1:0});return u.jsxs("div",{"data-testid":"app-shell",style:L?{paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"}:void 0,className:"flex h-full w-full select-none flex-col overflow-hidden bg-tui-crust font-mono text-tui text-tui-text",onContextMenu:X=>{X.preventDefault(),X.stopPropagation()},children:[!L&&u.jsx(Ev,{currentView:r,onNavigate:pe,showAdminEntry:Q,onOpenPairing:()=>I(!1),onOpenSettings:()=>p(!0),onToggleVirtualKeyboard:()=>w(!v),isVirtualKeyboardOpen:v}),!L&&!R&&u.jsx(jv,{}),u.jsxs("div",{className:"flex-1 min-h-0 w-full overflow-hidden relative",children:[de&&u.jsxs("div",{"data-testid":"terminal-layer",className:`absolute ${L?"inset-x-0 top-12 bottom-11":"inset-0"} flex flex-col min-h-0 w-full overflow-hidden`,style:be(Te),"aria-hidden":!Te,children:[u.jsx(Jv,{isActive:Te}),!L&&u.jsx(tx,{isOpen:v,onClose:()=>w(!1)}),u.jsx(Pv,{compact:L})]}),r==="terminal"&&R&&u.jsx("div",{"data-testid":"onboarding-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-10",children:u.jsx(Wv,{onPairedSuccess:()=>{}})}),r==="admin"&&u.jsx("div",{"data-testid":"admin-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-20",children:u.jsx(gx,{onBackToTerminal:()=>pe("terminal"),onOpenPairing:()=>I(!1)})}),L&&Te&&u.jsx(wx,{onNavigateAdmin:()=>pe("admin"),showAdminEntry:Q,onOpenPairing:()=>I(!1),onOpenSettings:()=>p(!0),onAddProfile:()=>I(!0)})]}),!L&&r!=="admin"&&u.jsx(rx,{onAddProfile:()=>I(!0)}),u.jsx(lx,{isOpen:o,isAddMode:m,onClose:ie}),u.jsx(ax,{isOpen:b,onClose:()=>p(!1)}),u.jsx(ox,{})]})}function zx(){return u.jsx(jy,{children:u.jsx(Mx,{})})}const Ep=document.getElementById("root");if(!Ep)throw new Error("Root element not found");Wg.createRoot(Ep).render(u.jsx(fl.StrictMode,{children:u.jsx(zx,{})}));
|