@fengye404/termpilot 0.2.2 → 0.2.4

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,21 @@
1
+ (function(){const he=document.createElement("link").relList;if(he&&he.supports&&he.supports("modulepreload"))return;for(const ce of document.querySelectorAll('link[rel="modulepreload"]'))G(ce);new MutationObserver(ce=>{for(const me of ce)if(me.type==="childList")for(const F of me.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&G(F)}).observe(document,{childList:!0,subtree:!0});function ye(ce){const me={};return ce.integrity&&(me.integrity=ce.integrity),ce.referrerPolicy&&(me.referrerPolicy=ce.referrerPolicy),ce.crossOrigin==="use-credentials"?me.credentials="include":ce.crossOrigin==="anonymous"?me.credentials="omit":me.credentials="same-origin",me}function G(ce){if(ce.ep)return;ce.ep=!0;const me=ye(ce);fetch(ce.href,me)}})();function Jf(k){return k&&k.__esModule&&Object.prototype.hasOwnProperty.call(k,"default")?k.default:k}var No={exports:{}},cn={};var kf;function cv(){if(kf)return cn;kf=1;var k=Symbol.for("react.transitional.element"),he=Symbol.for("react.fragment");function ye(G,ce,me){var F=null;if(me!==void 0&&(F=""+me),ce.key!==void 0&&(F=""+ce.key),"key"in ce){me={};for(var u in ce)u!=="key"&&(me[u]=ce[u])}else me=ce;return ce=me.ref,{$$typeof:k,type:G,key:F,ref:ce!==void 0?ce:null,props:me}}return cn.Fragment=he,cn.jsx=ye,cn.jsxs=ye,cn}var Hf;function uv(){return Hf||(Hf=1,No.exports=cv()),No.exports}var K=uv(),zo={exports:{}},Ce={};var Nf;function hv(){if(Nf)return Ce;Nf=1;var k=Symbol.for("react.transitional.element"),he=Symbol.for("react.portal"),ye=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),me=Symbol.for("react.consumer"),F=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function b(w){return w===null||typeof w!="object"?null:(w=p&&w[p]||w["@@iterator"],typeof w=="function"?w:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,l={};function c(w,j,Z){this.props=w,this.context=j,this.refs=l,this.updater=Z||D}c.prototype.isReactComponent={},c.prototype.setState=function(w,j){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,j,"setState")},c.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function o(){}o.prototype=c.prototype;function a(w,j,Z){this.props=w,this.context=j,this.refs=l,this.updater=Z||D}var _=a.prototype=new o;_.constructor=a,S(_,c.prototype),_.isPureReactComponent=!0;var g=Array.isArray;function C(){}var x={H:null,A:null,T:null,S:null},v=Object.prototype.hasOwnProperty;function E(w,j,Z){var se=Z.ref;return{$$typeof:k,type:w,key:j,ref:se!==void 0?se:null,props:Z}}function B(w,j){return E(w.type,j,w.props)}function z(w){return typeof w=="object"&&w!==null&&w.$$typeof===k}function L(w){var j={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(Z){return j[Z]})}var U=/\/+/g;function ee(w,j){return typeof w=="object"&&w!==null&&w.key!=null?L(""+w.key):j.toString(36)}function W(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(C,C):(w.status="pending",w.then(function(j){w.status==="pending"&&(w.status="fulfilled",w.value=j)},function(j){w.status==="pending"&&(w.status="rejected",w.reason=j)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function H(w,j,Z,se,ae){var fe=typeof w;(fe==="undefined"||fe==="boolean")&&(w=null);var T=!1;if(w===null)T=!0;else switch(fe){case"bigint":case"string":case"number":T=!0;break;case"object":switch(w.$$typeof){case k:case he:T=!0;break;case y:return T=w._init,H(T(w._payload),j,Z,se,ae)}}if(T)return ae=ae(w),T=se===""?"."+ee(w,0):se,g(ae)?(Z="",T!=null&&(Z=T.replace(U,"$&/")+"/"),H(ae,j,Z,"",function(ie){return ie})):ae!=null&&(z(ae)&&(ae=B(ae,Z+(ae.key==null||w&&w.key===ae.key?"":(""+ae.key).replace(U,"$&/")+"/")+T)),j.push(ae)),1;T=0;var X=se===""?".":se+":";if(g(w))for(var J=0;J<w.length;J++)se=w[J],fe=X+ee(se,J),T+=H(se,j,Z,fe,ae);else if(J=b(w),typeof J=="function")for(w=J.call(w),J=0;!(se=w.next()).done;)se=se.value,fe=X+ee(se,J++),T+=H(se,j,Z,fe,ae);else if(fe==="object"){if(typeof w.then=="function")return H(W(w),j,Z,se,ae);throw j=String(w),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return T}function I(w,j,Z){if(w==null)return w;var se=[],ae=0;return H(w,se,"","",function(fe){return j.call(Z,fe,ae++)}),se}function A(w){if(w._status===-1){var j=w._result;j=j(),j.then(function(Z){(w._status===0||w._status===-1)&&(w._status=1,w._result=Z)},function(Z){(w._status===0||w._status===-1)&&(w._status=2,w._result=Z)}),w._status===-1&&(w._status=0,w._result=j)}if(w._status===1)return w._result.default;throw w._result}var M=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},O={map:I,forEach:function(w,j,Z){I(w,function(){j.apply(this,arguments)},Z)},count:function(w){var j=0;return I(w,function(){j++}),j},toArray:function(w){return I(w,function(j){return j})||[]},only:function(w){if(!z(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ce.Activity=h,Ce.Children=O,Ce.Component=c,Ce.Fragment=ye,Ce.Profiler=ce,Ce.PureComponent=a,Ce.StrictMode=G,Ce.Suspense=f,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(w){return x.H.useMemoCache(w)}},Ce.cache=function(w){return function(){return w.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(w,j,Z){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var se=S({},w.props),ae=w.key;if(j!=null)for(fe in j.key!==void 0&&(ae=""+j.key),j)!v.call(j,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&j.ref===void 0||(se[fe]=j[fe]);var fe=arguments.length-2;if(fe===1)se.children=Z;else if(1<fe){for(var T=Array(fe),X=0;X<fe;X++)T[X]=arguments[X+2];se.children=T}return E(w.type,ae,se)},Ce.createContext=function(w){return w={$$typeof:F,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:me,_context:w},w},Ce.createElement=function(w,j,Z){var se,ae={},fe=null;if(j!=null)for(se in j.key!==void 0&&(fe=""+j.key),j)v.call(j,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ae[se]=j[se]);var T=arguments.length-2;if(T===1)ae.children=Z;else if(1<T){for(var X=Array(T),J=0;J<T;J++)X[J]=arguments[J+2];ae.children=X}if(w&&w.defaultProps)for(se in T=w.defaultProps,T)ae[se]===void 0&&(ae[se]=T[se]);return E(w,fe,ae)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(w){return{$$typeof:u,render:w}},Ce.isValidElement=z,Ce.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:A}},Ce.memo=function(w,j){return{$$typeof:d,type:w,compare:j===void 0?null:j}},Ce.startTransition=function(w){var j=x.T,Z={};x.T=Z;try{var se=w(),ae=x.S;ae!==null&&ae(Z,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(C,M)}catch(fe){M(fe)}finally{j!==null&&Z.types!==null&&(j.types=Z.types),x.T=j}},Ce.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},Ce.use=function(w){return x.H.use(w)},Ce.useActionState=function(w,j,Z){return x.H.useActionState(w,j,Z)},Ce.useCallback=function(w,j){return x.H.useCallback(w,j)},Ce.useContext=function(w){return x.H.useContext(w)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(w,j){return x.H.useDeferredValue(w,j)},Ce.useEffect=function(w,j){return x.H.useEffect(w,j)},Ce.useEffectEvent=function(w){return x.H.useEffectEvent(w)},Ce.useId=function(){return x.H.useId()},Ce.useImperativeHandle=function(w,j,Z){return x.H.useImperativeHandle(w,j,Z)},Ce.useInsertionEffect=function(w,j){return x.H.useInsertionEffect(w,j)},Ce.useLayoutEffect=function(w,j){return x.H.useLayoutEffect(w,j)},Ce.useMemo=function(w,j){return x.H.useMemo(w,j)},Ce.useOptimistic=function(w,j){return x.H.useOptimistic(w,j)},Ce.useReducer=function(w,j,Z){return x.H.useReducer(w,j,Z)},Ce.useRef=function(w){return x.H.useRef(w)},Ce.useState=function(w){return x.H.useState(w)},Ce.useSyncExternalStore=function(w,j,Z){return x.H.useSyncExternalStore(w,j,Z)},Ce.useTransition=function(){return x.H.useTransition()},Ce.version="19.2.4",Ce}var zf;function Go(){return zf||(zf=1,zo.exports=hv()),zo.exports}var _e=Go();const fv=Jf(_e);var Uo={exports:{}},un={},jo={exports:{}},qo={};var Uf;function dv(){return Uf||(Uf=1,(function(k){function he(H,I){var A=H.length;H.push(I);e:for(;0<A;){var M=A-1>>>1,O=H[M];if(0<ce(O,I))H[M]=I,H[A]=O,A=M;else break e}}function ye(H){return H.length===0?null:H[0]}function G(H){if(H.length===0)return null;var I=H[0],A=H.pop();if(A!==I){H[0]=A;e:for(var M=0,O=H.length,w=O>>>1;M<w;){var j=2*(M+1)-1,Z=H[j],se=j+1,ae=H[se];if(0>ce(Z,A))se<O&&0>ce(ae,Z)?(H[M]=ae,H[se]=A,M=se):(H[M]=Z,H[j]=A,M=j);else if(se<O&&0>ce(ae,A))H[M]=ae,H[se]=A,M=se;else break e}}return I}function ce(H,I){var A=H.sortIndex-I.sortIndex;return A!==0?A:H.id-I.id}if(k.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var me=performance;k.unstable_now=function(){return me.now()}}else{var F=Date,u=F.now();k.unstable_now=function(){return F.now()-u}}var f=[],d=[],y=1,h=null,p=3,b=!1,D=!1,S=!1,l=!1,c=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;function _(H){for(var I=ye(d);I!==null;){if(I.callback===null)G(d);else if(I.startTime<=H)G(d),I.sortIndex=I.expirationTime,he(f,I);else break;I=ye(d)}}function g(H){if(S=!1,_(H),!D)if(ye(f)!==null)D=!0,C||(C=!0,L());else{var I=ye(d);I!==null&&W(g,I.startTime-H)}}var C=!1,x=-1,v=5,E=-1;function B(){return l?!0:!(k.unstable_now()-E<v)}function z(){if(l=!1,C){var H=k.unstable_now();E=H;var I=!0;try{e:{D=!1,S&&(S=!1,o(x),x=-1),b=!0;var A=p;try{t:{for(_(H),h=ye(f);h!==null&&!(h.expirationTime>H&&B());){var M=h.callback;if(typeof M=="function"){h.callback=null,p=h.priorityLevel;var O=M(h.expirationTime<=H);if(H=k.unstable_now(),typeof O=="function"){h.callback=O,_(H),I=!0;break t}h===ye(f)&&G(f),_(H)}else G(f);h=ye(f)}if(h!==null)I=!0;else{var w=ye(d);w!==null&&W(g,w.startTime-H),I=!1}}break e}finally{h=null,p=A,b=!1}I=void 0}}finally{I?L():C=!1}}}var L;if(typeof a=="function")L=function(){a(z)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,ee=U.port2;U.port1.onmessage=z,L=function(){ee.postMessage(null)}}else L=function(){c(z,0)};function W(H,I){x=c(function(){H(k.unstable_now())},I)}k.unstable_IdlePriority=5,k.unstable_ImmediatePriority=1,k.unstable_LowPriority=4,k.unstable_NormalPriority=3,k.unstable_Profiling=null,k.unstable_UserBlockingPriority=2,k.unstable_cancelCallback=function(H){H.callback=null},k.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<H?Math.floor(1e3/H):5},k.unstable_getCurrentPriorityLevel=function(){return p},k.unstable_next=function(H){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var A=p;p=I;try{return H()}finally{p=A}},k.unstable_requestPaint=function(){l=!0},k.unstable_runWithPriority=function(H,I){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var A=p;p=H;try{return I()}finally{p=A}},k.unstable_scheduleCallback=function(H,I,A){var M=k.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?M+A:M):A=M,H){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=A+O,H={id:y++,callback:I,priorityLevel:H,startTime:A,expirationTime:O,sortIndex:-1},A>M?(H.sortIndex=A,he(d,H),ye(f)===null&&H===ye(d)&&(S?(o(x),x=-1):S=!0,W(g,A-M))):(H.sortIndex=O,he(f,H),D||b||(D=!0,C||(C=!0,L()))),H},k.unstable_shouldYield=B,k.unstable_wrapCallback=function(H){var I=p;return function(){var A=p;p=I;try{return H.apply(this,arguments)}finally{p=A}}}})(qo)),qo}var jf;function _v(){return jf||(jf=1,jo.exports=dv()),jo.exports}var Ko={exports:{}},wt={};var qf;function vv(){if(qf)return wt;qf=1;var k=Go();function he(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)d+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ye(){}var G={d:{f:ye,r:function(){throw Error(he(522))},D:ye,C:ye,L:ye,m:ye,X:ye,S:ye,M:ye},p:0,findDOMNode:null},ce=Symbol.for("react.portal");function me(f,d,y){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ce,key:h==null?null:""+h,children:f,containerInfo:d,implementation:y}}var F=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,wt.createPortal=function(f,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(he(299));return me(f,d,null,y)},wt.flushSync=function(f){var d=F.T,y=G.p;try{if(F.T=null,G.p=2,f)return f()}finally{F.T=d,G.p=y,G.d.f()}},wt.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,G.d.C(f,d))},wt.prefetchDNS=function(f){typeof f=="string"&&G.d.D(f)},wt.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var y=d.as,h=u(y,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;y==="style"?G.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:p,fetchPriority:b}):y==="script"&&G.d.X(f,{crossOrigin:h,integrity:p,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},wt.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var y=u(d.as,d.crossOrigin);G.d.M(f,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&G.d.M(f)},wt.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var y=d.as,h=u(y,d.crossOrigin);G.d.L(f,y,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},wt.preloadModule=function(f,d){if(typeof f=="string")if(d){var y=u(d.as,d.crossOrigin);G.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else G.d.m(f)},wt.requestFormReset=function(f){G.d.r(f)},wt.unstable_batchedUpdates=function(f,d){return f(d)},wt.useFormState=function(f,d,y){return F.H.useFormState(f,d,y)},wt.useFormStatus=function(){return F.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var Kf;function mv(){if(Kf)return Ko.exports;Kf=1;function k(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k)}catch(he){console.error(he)}}return k(),Ko.exports=vv(),Ko.exports}var If;function gv(){if(If)return un;If=1;var k=_v(),he=Go(),ye=mv();function G(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 ce(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function me(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function F(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 u(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 f(e){if(me(e)!==e)throw Error(G(188))}function d(e){var t=e.alternate;if(!t){if(t=me(e),t===null)throw Error(G(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return f(r),e;if(n===s)return f(r),t;n=n.sibling}throw Error(G(188))}if(i.return!==s.return)i=r,s=n;else{for(var m=!1,R=r.child;R;){if(R===i){m=!0,i=r,s=n;break}if(R===s){m=!0,s=r,i=n;break}R=R.sibling}if(!m){for(R=n.child;R;){if(R===i){m=!0,i=n,s=r;break}if(R===s){m=!0,s=n,i=r;break}R=R.sibling}if(!m)throw Error(G(189))}}if(i.alternate!==s)throw Error(G(190))}if(i.tag!==3)throw Error(G(188));return i.stateNode.current===i?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 h=Object.assign,p=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case c:return"Profiler";case l:return"StrictMode";case g:return"Suspense";case C:return"SuspenseList";case E:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case D:return"Portal";case a:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case x:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case v:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var W=Array.isArray,H=he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=ye.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A={pending:!1,data:null,method:null,action:null},M=[],O=-1;function w(e){return{current:e}}function j(e){0>O||(e.current=M[O],M[O]=null,O--)}function Z(e,t){O++,M[O]=e.current,e.current=t}var se=w(null),ae=w(null),fe=w(null),T=w(null);function X(e,t){switch(Z(fe,t),Z(ae,e),Z(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sf(t),e=rf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(se),Z(se,e)}function J(){j(se),j(ae),j(fe)}function ie(e){e.memoizedState!==null&&Z(T,e);var t=se.current,i=rf(t,e.type);t!==i&&(Z(ae,e),Z(se,i))}function Se(e){ae.current===e&&(j(se),j(ae)),T.current===e&&(j(T),nn._currentValue=A)}var oe,xe;function qe(e){if(oe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||"",xe=-1<i.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+oe+e+xe}var Ye=!1;function ht(e,t){if(!e||Ye)return"";Ye=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch($){var Q=$}Reflect.construct(e,[],ne)}else{try{ne.call()}catch($){Q=$}e.call(ne.prototype)}}else{try{throw Error()}catch($){Q=$}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch($){if($&&Q&&typeof $.stack=="string")return[$.stack,Q.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),m=n[0],R=n[1];if(m&&R){var N=m.split(`
4
+ `),P=R.split(`
5
+ `);for(r=s=0;s<N.length&&!N[s].includes("DetermineComponentFrameRoot");)s++;for(;r<P.length&&!P[r].includes("DetermineComponentFrameRoot");)r++;if(s===N.length||r===P.length)for(s=N.length-1,r=P.length-1;1<=s&&0<=r&&N[s]!==P[r];)r--;for(;1<=s&&0<=r;s--,r--)if(N[s]!==P[r]){if(s!==1||r!==1)do if(s--,r--,0>r||N[s]!==P[r]){var te=`
6
+ `+N[s].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=s&&0<=r);break}}}finally{Ye=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?qe(i):""}function be(e,t){switch(e.tag){case 26:case 27:case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return e.child!==t&&t!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return ht(e.type,!1);case 11:return ht(e.type.render,!1);case 1:return ht(e.type,!0);case 31:return qe("Activity");default:return""}}function Yt(e){try{var t="",i=null;do t+=be(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
7
+ Error generating stack: `+s.message+`
8
+ `+s.stack}}var ii=Object.prototype.hasOwnProperty,si=k.unstable_scheduleCallback,ri=k.unstable_cancelCallback,gi=k.unstable_shouldYield,_t=k.unstable_requestPaint,$e=k.unstable_now,Pe=k.unstable_getCurrentPriorityLevel,ni=k.unstable_ImmediatePriority,zi=k.unstable_UserBlockingPriority,xt=k.unstable_NormalPriority,Gt=k.unstable_LowPriority,Ct=k.unstable_IdlePriority,li=k.log,Ue=k.unstable_setDisableYieldValue,At=null,Ne=null;function ft(e){if(typeof li=="function"&&Ue(e),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(At,e)}catch{}}var Et=Math.clz32?Math.clz32:_n,fn=Math.log,dn=Math.LN2;function _n(e){return e>>>=0,e===0?32:31-(fn(e)/dn|0)|0}var lt=256,Tt=262144,fi=4194304;function Ht(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 Ms(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var R=s&134217727;return R!==0?(s=R&~n,s!==0?r=Ht(s):(m&=R,m!==0?r=Ht(m):i||(i=R&~e,i!==0&&(r=Ht(i))))):(R=s&~n,R!==0?r=Ht(R):m!==0?r=Ht(m):i||(i=s&~e,i!==0&&(r=Ht(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function Ui(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _r(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 vr(){var e=fi;return fi<<=1,(fi&62914560)===0&&(fi=4194304),e}function Ls(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ji(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function us(e,t,i,s,r,n){var m=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var R=e.entanglements,N=e.expirationTimes,P=e.hiddenUpdates;for(i=m&~i;0<i;){var te=31-Et(i),ne=1<<te;R[te]=0,N[te]=-1;var Q=P[te];if(Q!==null)for(P[te]=null,te=0;te<Q.length;te++){var $=Q[te];$!==null&&($.lane&=-536870913)}i&=~ne}s!==0&&Bs(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(m&~t))}function Bs(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Et(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function mr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Et(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function gr(e,t){var i=t&-t;return i=(i&42)!==0?1:ai(i),(i&(e.suspendedLanes|t))!==0?0:i}function ai(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 hs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pr(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Af(e.type))}function Sr(e,t){var i=I.p;try{return I.p=e,t()}finally{I.p=i}}var oi=Math.random().toString(36).slice(2),st="__reactFiber$"+oi,gt="__reactProps$"+oi,qi="__reactContainer$"+oi,yr="__reactEvents$"+oi,le="__reactListeners$"+oi,ue="__reactHandles$"+oi,De="__reactResources$"+oi,Oe="__reactMarker$"+oi;function Ft(e){delete e[st],delete e[gt],delete e[yr],delete e[le],delete e[ue]}function je(e){var t=e[st];if(t)return t;for(var i=e.parentNode;i;){if(t=i[qi]||i[st]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=hf(e);e!==null;){if(i=e[st])return i;e=hf(e)}return t}e=i,i=e.parentNode}return null}function Be(e){if(e=e[st]||e[qi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Je(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(G(33))}function vt(e){var t=e[De];return t||(t=e[De]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Oe]=!0}var vn=new Set,Fo={};function fs(e,t){Os(e,t),Os(e+"Capture",t)}function Os(e,t){for(Fo[e]=t,e=0;e<t.length;e++)vn.add(t[e])}var ed=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]*$"),Xo={},Vo={};function td(e){return ii.call(Vo,e)?!0:ii.call(Xo,e)?!1:ed.test(e)?Vo[e]=!0:(Xo[e]=!0,!1)}function mn(e,t,i){if(td(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function gn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function pi(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Po(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function id(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){i=""+m,n.call(this,m)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(m){i=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tl(e){if(!e._valueTracker){var t=Po(e)?"checked":"value";e._valueTracker=id(e,t,""+e[t])}}function Wo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Po(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function pn(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 sd=/[\n"\\]/g;function Vt(e){return e.replace(sd,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rl(e,t,i,s,r,n,m,R){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?Ml(e,m,Xt(t)):i!=null?Ml(e,m,Xt(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Xt(R):e.removeAttribute("name")}function Qo(e,t,i,s,r,n,m,R){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Tl(e);return}i=i!=null?""+Xt(i):"",t=t!=null?""+Xt(t):i,R||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=R?e.checked:!!s,e.defaultChecked=!!s,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Tl(e)}function Ml(e,t,i){t==="number"&&pn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ks(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Xt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Zo(e,t,i){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Xt(i):""}function Jo(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(G(92));if(W(s)){if(1<s.length)throw Error(G(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Xt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Tl(e)}function Hs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var rd=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 $o(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||rd.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ec(e,t,i){if(t!=null&&typeof t!="object")throw Error(G(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&$o(e,r,s)}else for(var n in t)t.hasOwnProperty(n)&&$o(e,n,t[n])}function Ll(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 nd=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"]]),ld=/^[\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 Sn(e){return ld.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Si(){}var Bl=null;function Ol(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ns=null,zs=null;function tc(e){var t=Be(e);if(t&&(e=t.stateNode)){var i=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rl(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Vt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[gt]||null;if(!r)throw Error(G(90));Rl(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Wo(s)}break e;case"textarea":Zo(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ks(e,!!i.multiple,t,!1)}}}var kl=!1;function ic(e,t,i){if(kl)return e(t,i);kl=!0;try{var s=e(t);return s}finally{if(kl=!1,(Ns!==null||zs!==null)&&(ll(),Ns&&(t=Ns,e=zs,zs=Ns=null,tc(t),e)))for(t=0;t<e.length;t++)tc(e[t])}}function br(e,t){var i=e.stateNode;if(i===null)return null;var s=i[gt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(G(231,t,typeof i));return i}var yi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=!1;if(yi)try{var Cr={};Object.defineProperty(Cr,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",Cr,Cr),window.removeEventListener("test",Cr,Cr)}catch{Hl=!1}var Ki=null,Nl=null,yn=null;function sc(){if(yn)return yn;var e,t=Nl,i=t.length,s,r="value"in Ki?Ki.value:Ki.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var m=i-e;for(s=1;s<=m&&t[i-s]===r[n-s];s++);return yn=r.slice(e,1<s?1-s:void 0)}function bn(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 Cn(){return!0}function rc(){return!1}function Rt(e){function t(i,s,r,n,m){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=m,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(i=e[R],this[R]=i?i(n):n[R]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Cn:rc,this.isPropagationStopped=rc,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Cn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=Rt(ds),Er=h({},ds,{view:0,detail:0}),ad=Rt(Er),zl,Ul,wr,wn=h({},Er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ql,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!==wr&&(wr&&e.type==="mousemove"?(zl=e.screenX-wr.screenX,Ul=e.screenY-wr.screenY):Ul=zl=0,wr=e),zl)},movementY:function(e){return"movementY"in e?e.movementY:Ul}}),nc=Rt(wn),od=h({},wn,{dataTransfer:0}),cd=Rt(od),ud=h({},Er,{relatedTarget:0}),jl=Rt(ud),hd=h({},ds,{animationName:0,elapsedTime:0,pseudoElement:0}),fd=Rt(hd),dd=h({},ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_d=Rt(dd),vd=h({},ds,{data:0}),lc=Rt(vd),md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gd={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"},pd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pd[e])?!!t[e]:!1}function ql(){return Sd}var yd=h({},Er,{key:function(e){if(e.key){var t=md[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ql,charCode:function(e){return e.type==="keypress"?bn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bd=Rt(yd),Cd=h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ac=Rt(Cd),Ed=h({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ql}),wd=Rt(Ed),xd=h({},ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dd=Rt(xd),Ad=h({},wn,{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}),Td=Rt(Ad),Rd=h({},ds,{newState:0,oldState:0}),Md=Rt(Rd),Ld=[9,13,27,32],Kl=yi&&"CompositionEvent"in window,xr=null;yi&&"documentMode"in document&&(xr=document.documentMode);var Bd=yi&&"TextEvent"in window&&!xr,oc=yi&&(!Kl||xr&&8<xr&&11>=xr),cc=" ",uc=!1;function hc(e,t){switch(e){case"keyup":return Ld.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Us=!1;function Od(e,t){switch(e){case"compositionend":return fc(t);case"keypress":return t.which!==32?null:(uc=!0,cc);case"textInput":return e=t.data,e===cc&&uc?null:e;default:return null}}function kd(e,t){if(Us)return e==="compositionend"||!Kl&&hc(e,t)?(e=sc(),yn=Nl=Ki=null,Us=!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 oc&&t.locale!=="ko"?null:t.data;default:return null}}var Hd={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 dc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hd[e.type]:t==="textarea"}function _c(e,t,i,s){Ns?zs?zs.push(s):zs=[s]:Ns=s,t=dl(t,"onChange"),0<t.length&&(i=new En("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Dr=null,Ar=null;function Nd(e){Qh(e,0)}function xn(e){var t=Je(e);if(Wo(t))return e}function vc(e,t){if(e==="change")return t}var mc=!1;if(yi){var Il;if(yi){var Yl="oninput"in document;if(!Yl){var gc=document.createElement("div");gc.setAttribute("oninput","return;"),Yl=typeof gc.oninput=="function"}Il=Yl}else Il=!1;mc=Il&&(!document.documentMode||9<document.documentMode)}function pc(){Dr&&(Dr.detachEvent("onpropertychange",Sc),Ar=Dr=null)}function Sc(e){if(e.propertyName==="value"&&xn(Ar)){var t=[];_c(t,Ar,e,Ol(e)),ic(Nd,t)}}function zd(e,t,i){e==="focusin"?(pc(),Dr=t,Ar=i,Dr.attachEvent("onpropertychange",Sc)):e==="focusout"&&pc()}function Ud(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xn(Ar)}function jd(e,t){if(e==="click")return xn(t)}function qd(e,t){if(e==="input"||e==="change")return xn(t)}function Kd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Kd;function Tr(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!ii.call(t,r)||!Nt(e[r],t[r]))return!1}return!0}function yc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bc(e,t){var i=yc(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=yc(i)}}function Cc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ec(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pn(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=pn(e.document)}return t}function Gl(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 Id=yi&&"documentMode"in document&&11>=document.documentMode,js=null,Fl=null,Rr=null,Xl=!1;function wc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Xl||js==null||js!==pn(s)||(s=js,"selectionStart"in s&&Gl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Rr&&Tr(Rr,s)||(Rr=s,s=dl(Fl,"onSelect"),0<s.length&&(t=new En("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=js)))}function _s(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var qs={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},Vl={},xc={};yi&&(xc=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function vs(e){if(Vl[e])return Vl[e];if(!qs[e])return e;var t=qs[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in xc)return Vl[e]=t[i];return e}var Dc=vs("animationend"),Ac=vs("animationiteration"),Tc=vs("animationstart"),Yd=vs("transitionrun"),Gd=vs("transitionstart"),Fd=vs("transitioncancel"),Rc=vs("transitionend"),Mc=new Map,Pl="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(" ");Pl.push("scrollEnd");function ci(e,t){Mc.set(e,t),fs(t,[e])}var Dn=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)},Pt=[],Ks=0,Wl=0;function An(){for(var e=Ks,t=Wl=Ks=0;t<e;){var i=Pt[t];Pt[t++]=null;var s=Pt[t];Pt[t++]=null;var r=Pt[t];Pt[t++]=null;var n=Pt[t];if(Pt[t++]=null,s!==null&&r!==null){var m=s.pending;m===null?r.next=r:(r.next=m.next,m.next=r),s.pending=r}n!==0&&Lc(i,r,n)}}function Tn(e,t,i,s){Pt[Ks++]=e,Pt[Ks++]=t,Pt[Ks++]=i,Pt[Ks++]=s,Wl|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ql(e,t,i,s){return Tn(e,t,i,s),Rn(e)}function ms(e,t){return Tn(e,null,null,t),Rn(e)}function Lc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-Et(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function Rn(e){if(50<Zr)throw Zr=0,no=null,Error(G(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Is={};function Xd(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zt(e,t,i,s){return new Xd(e,t,i,s)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bi(e,t){var i=e.alternate;return i===null?(i=zt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Bc(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mn(e,t,i,s,r,n){var m=0;if(s=e,typeof e=="function")Zl(e)&&(m=1);else if(typeof e=="string")m=Z_(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case E:return e=zt(31,i,t,r),e.elementType=E,e.lanes=n,e;case S:return gs(i.children,r,n,t);case l:m=8,r|=24;break;case c:return e=zt(12,i,t,r|2),e.elementType=c,e.lanes=n,e;case g:return e=zt(13,i,t,r),e.elementType=g,e.lanes=n,e;case C:return e=zt(19,i,t,r),e.elementType=C,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case a:m=10;break e;case o:m=9;break e;case _:m=11;break e;case x:m=14;break e;case v:m=16,s=null;break e}m=29,i=Error(G(130,e===null?"null":typeof e,"")),s=null}return t=zt(m,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function gs(e,t,i,s){return e=zt(7,e,s,t),e.lanes=i,e}function Jl(e,t,i){return e=zt(6,e,null,t),e.lanes=i,e}function Oc(e){var t=zt(18,null,null,0);return t.stateNode=e,t}function $l(e,t,i){return t=zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kc=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=kc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Yt(t)},kc.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var Ys=[],Gs=0,Ln=null,Mr=0,Qt=[],Zt=0,Ii=null,di=1,_i="";function Ci(e,t){Ys[Gs++]=Mr,Ys[Gs++]=Ln,Ln=e,Mr=t}function Hc(e,t,i){Qt[Zt++]=di,Qt[Zt++]=_i,Qt[Zt++]=Ii,Ii=e;var s=di;e=_i;var r=32-Et(s)-1;s&=~(1<<r),i+=1;var n=32-Et(t)+r;if(30<n){var m=r-r%5;n=(s&(1<<m)-1).toString(32),s>>=m,r-=m,di=1<<32-Et(t)+r|i<<r|s,_i=n+e}else di=1<<n|i<<r|s,_i=e}function ea(e){e.return!==null&&(Ci(e,1),Hc(e,1,0))}function ta(e){for(;e===Ln;)Ln=Ys[--Gs],Ys[Gs]=null,Mr=Ys[--Gs],Ys[Gs]=null;for(;e===Ii;)Ii=Qt[--Zt],Qt[Zt]=null,_i=Qt[--Zt],Qt[Zt]=null,di=Qt[--Zt],Qt[Zt]=null}function Nc(e,t){Qt[Zt++]=di,Qt[Zt++]=_i,Qt[Zt++]=Ii,di=t.id,_i=t.overflow,Ii=e}var pt=null,We=null,Le=!1,Yi=null,Jt=!1,ia=Error(G(519));function Gi(e){var t=Error(G(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Lr(Wt(t,e)),ia}function zc(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[st]=e,t[gt]=s,i){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(i=0;i<$r.length;i++)Te($r[i],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),Qo(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),Jo(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||ef(t.textContent,i)?(s.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),s.onScroll!=null&&Te("scroll",t),s.onScrollEnd!=null&&Te("scrollend",t),s.onClick!=null&&(t.onclick=Si),t=!0):t=!1,t||Gi(e,!0)}function Uc(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:Jt=!1;return;case 27:case 3:Jt=!0;return;default:pt=pt.return}}function Fs(e){if(e!==pt)return!1;if(!Le)return Uc(e),Le=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||bo(e.type,e.memoizedProps)),i=!i),i&&We&&Gi(e),Uc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));We=uf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));We=uf(e)}else t===27?(t=We,rs(e.type)?(e=Do,Do=null,We=e):We=t):We=pt?ei(e.stateNode.nextSibling):null;return!0}function ps(){We=pt=null,Le=!1}function sa(){var e=Yi;return e!==null&&(Ot===null?Ot=e:Ot.push.apply(Ot,e),Yi=null),e}function Lr(e){Yi===null?Yi=[e]:Yi.push(e)}var ra=w(null),Ss=null,Ei=null;function Fi(e,t,i){Z(ra,t._currentValue),t._currentValue=i}function wi(e){e._currentValue=ra.current,j(ra)}function na(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function la(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var m=r.child;n=n.firstContext;e:for(;n!==null;){var R=n;n=r;for(var N=0;N<t.length;N++)if(R.context===t[N]){n.lanes|=i,R=n.alternate,R!==null&&(R.lanes|=i),na(n.return,i,e),s||(m=null);break e}n=R.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(G(341));m.lanes|=i,n=m.alternate,n!==null&&(n.lanes|=i),na(m,i,e),m=null}else m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function Xs(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(G(387));if(m=m.memoizedProps,m!==null){var R=r.type;Nt(r.pendingProps.value,m.value)||(e!==null?e.push(R):e=[R])}}else if(r===T.current){if(m=r.alternate,m===null)throw Error(G(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(nn):e=[nn])}r=r.return}e!==null&&la(t,e,i,s),t.flags|=262144}function Bn(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ys(e){Ss=e,Ei=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return jc(Ss,e)}function On(e,t){return Ss===null&&ys(e),jc(e,t)}function jc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ei===null){if(e===null)throw Error(G(308));Ei=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ei=Ei.next=t;return i}var Vd=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Pd=k.unstable_scheduleCallback,Wd=k.unstable_NormalPriority,at={$$typeof:a,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new Vd,data:new Map,refCount:0}}function Br(e){e.refCount--,e.refCount===0&&Pd(Wd,function(){e.controller.abort()})}var Or=null,oa=0,Vs=0,Ps=null;function Qd(e,t){if(Or===null){var i=Or=[];oa=0,Vs=ho(),Ps={status:"pending",value:void 0,then:function(s){i.push(s)}}}return oa++,t.then(qc,qc),t}function qc(){if(--oa===0&&Or!==null){Ps!==null&&(Ps.status="fulfilled");var e=Or;Or=null,Vs=0,Ps=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Zd(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var Kc=H.S;H.S=function(e,t){wh=$e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qd(e,t),Kc!==null&&Kc(e,t)};var bs=w(null);function ca(){var e=bs.current;return e!==null?e:Ve.pooledCache}function kn(e,t){t===null?Z(bs,bs.current):Z(bs,t.pool)}function Ic(){var e=ca();return e===null?null:{parent:at._currentValue,pool:e}}var Ws=Error(G(460)),ua=Error(G(474)),Hn=Error(G(542)),Nn={then:function(){}};function Yc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Gc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Si,Si),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xc(e),e;default:if(typeof t.status=="string")t.then(Si,Si);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(G(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xc(e),e}throw Es=t,Ws}}function Cs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Es=i,Ws):i}}var Es=null;function Fc(){if(Es===null)throw Error(G(459));var e=Es;return Es=null,e}function Xc(e){if(e===Ws||e===Hn)throw Error(G(483))}var Qs=null,kr=0;function zn(e){var t=kr;return kr+=1,Qs===null&&(Qs=[]),Gc(Qs,e,t)}function Hr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Un(e,t){throw t.$$typeof===p?Error(G(525)):(e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Vc(e){function t(Y,q){if(e){var V=Y.deletions;V===null?(Y.deletions=[q],Y.flags|=16):V.push(q)}}function i(Y,q){if(!e)return null;for(;q!==null;)t(Y,q),q=q.sibling;return null}function s(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function r(Y,q){return Y=bi(Y,q),Y.index=0,Y.sibling=null,Y}function n(Y,q,V){return Y.index=V,e?(V=Y.alternate,V!==null?(V=V.index,V<q?(Y.flags|=67108866,q):V):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function m(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function R(Y,q,V,re){return q===null||q.tag!==6?(q=Jl(V,Y.mode,re),q.return=Y,q):(q=r(q,V),q.return=Y,q)}function N(Y,q,V,re){var ge=V.type;return ge===S?te(Y,q,V.props.children,re,V.key):q!==null&&(q.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===v&&Cs(ge)===q.type)?(q=r(q,V.props),Hr(q,V),q.return=Y,q):(q=Mn(V.type,V.key,V.props,null,Y.mode,re),Hr(q,V),q.return=Y,q)}function P(Y,q,V,re){return q===null||q.tag!==4||q.stateNode.containerInfo!==V.containerInfo||q.stateNode.implementation!==V.implementation?(q=$l(V,Y.mode,re),q.return=Y,q):(q=r(q,V.children||[]),q.return=Y,q)}function te(Y,q,V,re,ge){return q===null||q.tag!==7?(q=gs(V,Y.mode,re,ge),q.return=Y,q):(q=r(q,V),q.return=Y,q)}function ne(Y,q,V){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Jl(""+q,Y.mode,V),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return V=Mn(q.type,q.key,q.props,null,Y.mode,V),Hr(V,q),V.return=Y,V;case D:return q=$l(q,Y.mode,V),q.return=Y,q;case v:return q=Cs(q),ne(Y,q,V)}if(W(q)||L(q))return q=gs(q,Y.mode,V,null),q.return=Y,q;if(typeof q.then=="function")return ne(Y,zn(q),V);if(q.$$typeof===a)return ne(Y,On(Y,q),V);Un(Y,q)}return null}function Q(Y,q,V,re){var ge=q!==null?q.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ge!==null?null:R(Y,q,""+V,re);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return V.key===ge?N(Y,q,V,re):null;case D:return V.key===ge?P(Y,q,V,re):null;case v:return V=Cs(V),Q(Y,q,V,re)}if(W(V)||L(V))return ge!==null?null:te(Y,q,V,re,null);if(typeof V.then=="function")return Q(Y,q,zn(V),re);if(V.$$typeof===a)return Q(Y,q,On(Y,V),re);Un(Y,V)}return null}function $(Y,q,V,re,ge){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Y=Y.get(V)||null,R(q,Y,""+re,ge);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return Y=Y.get(re.key===null?V:re.key)||null,N(q,Y,re,ge);case D:return Y=Y.get(re.key===null?V:re.key)||null,P(q,Y,re,ge);case v:return re=Cs(re),$(Y,q,V,re,ge)}if(W(re)||L(re))return Y=Y.get(V)||null,te(q,Y,re,ge,null);if(typeof re.then=="function")return $(Y,q,V,zn(re),ge);if(re.$$typeof===a)return $(Y,q,V,On(q,re),ge);Un(q,re)}return null}function de(Y,q,V,re){for(var ge=null,ke=null,ve=q,we=q=0,Me=null;ve!==null&&we<V.length;we++){ve.index>we?(Me=ve,ve=null):Me=ve.sibling;var He=Q(Y,ve,V[we],re);if(He===null){ve===null&&(ve=Me);break}e&&ve&&He.alternate===null&&t(Y,ve),q=n(He,q,we),ke===null?ge=He:ke.sibling=He,ke=He,ve=Me}if(we===V.length)return i(Y,ve),Le&&Ci(Y,we),ge;if(ve===null){for(;we<V.length;we++)ve=ne(Y,V[we],re),ve!==null&&(q=n(ve,q,we),ke===null?ge=ve:ke.sibling=ve,ke=ve);return Le&&Ci(Y,we),ge}for(ve=s(ve);we<V.length;we++)Me=$(ve,Y,we,V[we],re),Me!==null&&(e&&Me.alternate!==null&&ve.delete(Me.key===null?we:Me.key),q=n(Me,q,we),ke===null?ge=Me:ke.sibling=Me,ke=Me);return e&&ve.forEach(function(cs){return t(Y,cs)}),Le&&Ci(Y,we),ge}function pe(Y,q,V,re){if(V==null)throw Error(G(151));for(var ge=null,ke=null,ve=q,we=q=0,Me=null,He=V.next();ve!==null&&!He.done;we++,He=V.next()){ve.index>we?(Me=ve,ve=null):Me=ve.sibling;var cs=Q(Y,ve,He.value,re);if(cs===null){ve===null&&(ve=Me);break}e&&ve&&cs.alternate===null&&t(Y,ve),q=n(cs,q,we),ke===null?ge=cs:ke.sibling=cs,ke=cs,ve=Me}if(He.done)return i(Y,ve),Le&&Ci(Y,we),ge;if(ve===null){for(;!He.done;we++,He=V.next())He=ne(Y,He.value,re),He!==null&&(q=n(He,q,we),ke===null?ge=He:ke.sibling=He,ke=He);return Le&&Ci(Y,we),ge}for(ve=s(ve);!He.done;we++,He=V.next())He=$(ve,Y,we,He.value,re),He!==null&&(e&&He.alternate!==null&&ve.delete(He.key===null?we:He.key),q=n(He,q,we),ke===null?ge=He:ke.sibling=He,ke=He);return e&&ve.forEach(function(ov){return t(Y,ov)}),Le&&Ci(Y,we),ge}function Xe(Y,q,V,re){if(typeof V=="object"&&V!==null&&V.type===S&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case b:e:{for(var ge=V.key;q!==null;){if(q.key===ge){if(ge=V.type,ge===S){if(q.tag===7){i(Y,q.sibling),re=r(q,V.props.children),re.return=Y,Y=re;break e}}else if(q.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===v&&Cs(ge)===q.type){i(Y,q.sibling),re=r(q,V.props),Hr(re,V),re.return=Y,Y=re;break e}i(Y,q);break}else t(Y,q);q=q.sibling}V.type===S?(re=gs(V.props.children,Y.mode,re,V.key),re.return=Y,Y=re):(re=Mn(V.type,V.key,V.props,null,Y.mode,re),Hr(re,V),re.return=Y,Y=re)}return m(Y);case D:e:{for(ge=V.key;q!==null;){if(q.key===ge)if(q.tag===4&&q.stateNode.containerInfo===V.containerInfo&&q.stateNode.implementation===V.implementation){i(Y,q.sibling),re=r(q,V.children||[]),re.return=Y,Y=re;break e}else{i(Y,q);break}else t(Y,q);q=q.sibling}re=$l(V,Y.mode,re),re.return=Y,Y=re}return m(Y);case v:return V=Cs(V),Xe(Y,q,V,re)}if(W(V))return de(Y,q,V,re);if(L(V)){if(ge=L(V),typeof ge!="function")throw Error(G(150));return V=ge.call(V),pe(Y,q,V,re)}if(typeof V.then=="function")return Xe(Y,q,zn(V),re);if(V.$$typeof===a)return Xe(Y,q,On(Y,V),re);Un(Y,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,q!==null&&q.tag===6?(i(Y,q.sibling),re=r(q,V),re.return=Y,Y=re):(i(Y,q),re=Jl(V,Y.mode,re),re.return=Y,Y=re),m(Y)):i(Y,q)}return function(Y,q,V,re){try{kr=0;var ge=Xe(Y,q,V,re);return Qs=null,ge}catch(ve){if(ve===Ws||ve===Hn)throw ve;var ke=zt(29,ve,null,Y.mode);return ke.lanes=re,ke.return=Y,ke}}}var ws=Vc(!0),Pc=Vc(!1),Xi=!1;function ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fa(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 Vi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Rn(e),Lc(e,null,i),t}return Tn(e,s,t,i),Rn(e)}function Nr(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mr(e,i)}}function da(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var m={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=m:n=n.next=m,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var _a=!1;function zr(){if(_a){var e=Ps;if(e!==null)throw e}}function Ur(e,t,i,s){_a=!1;var r=e.updateQueue;Xi=!1;var n=r.firstBaseUpdate,m=r.lastBaseUpdate,R=r.shared.pending;if(R!==null){r.shared.pending=null;var N=R,P=N.next;N.next=null,m===null?n=P:m.next=P,m=N;var te=e.alternate;te!==null&&(te=te.updateQueue,R=te.lastBaseUpdate,R!==m&&(R===null?te.firstBaseUpdate=P:R.next=P,te.lastBaseUpdate=N))}if(n!==null){var ne=r.baseState;m=0,te=P=N=null,R=n;do{var Q=R.lane&-536870913,$=Q!==R.lane;if($?(Re&Q)===Q:(s&Q)===Q){Q!==0&&Q===Vs&&(_a=!0),te!==null&&(te=te.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var de=e,pe=R;Q=t;var Xe=i;switch(pe.tag){case 1:if(de=pe.payload,typeof de=="function"){ne=de.call(Xe,ne,Q);break e}ne=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=pe.payload,Q=typeof de=="function"?de.call(Xe,ne,Q):de,Q==null)break e;ne=h({},ne,Q);break e;case 2:Xi=!0}}Q=R.callback,Q!==null&&(e.flags|=64,$&&(e.flags|=8192),$=r.callbacks,$===null?r.callbacks=[Q]:$.push(Q))}else $={lane:Q,tag:R.tag,payload:R.payload,callback:R.callback,next:null},te===null?(P=te=$,N=ne):te=te.next=$,m|=Q;if(R=R.next,R===null){if(R=r.shared.pending,R===null)break;$=R,R=$.next,$.next=null,r.lastBaseUpdate=$,r.shared.pending=null}}while(!0);te===null&&(N=ne),r.baseState=N,r.firstBaseUpdate=P,r.lastBaseUpdate=te,n===null&&(r.shared.lanes=0),$i|=m,e.lanes=m,e.memoizedState=ne}}function Wc(e,t){if(typeof e!="function")throw Error(G(191,e));e.call(t)}function Qc(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Wc(i[e],t)}var Zs=w(null),jn=w(0);function Zc(e,t){e=Oi,Z(jn,e),Z(Zs,t),Oi=e|t.baseLanes}function va(){Z(jn,Oi),Z(Zs,Zs.current)}function ma(){Oi=jn.current,j(Zs),j(jn)}var Ut=w(null),$t=null;function Wi(e){var t=e.alternate;Z(rt,rt.current&1),Z(Ut,e),$t===null&&(t===null||Zs.current!==null||t.memoizedState!==null)&&($t=e)}function ga(e){Z(rt,rt.current),Z(Ut,e),$t===null&&($t=e)}function Jc(e){e.tag===22?(Z(rt,rt.current),Z(Ut,e),$t===null&&($t=e)):Qi()}function Qi(){Z(rt,rt.current),Z(Ut,Ut.current)}function jt(e){j(Ut),$t===e&&($t=null),j(rt)}var rt=w(0);function qn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||wo(i)||xo(i)))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 xi=0,Ee=null,Ge=null,ot=null,Kn=!1,Js=!1,xs=!1,In=0,jr=0,$s=null,Jd=0;function tt(){throw Error(G(321))}function pa(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Nt(e[i],t[i]))return!1;return!0}function Sa(e,t,i,s,r,n){return xi=n,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Hu:ka,xs=!1,n=i(s,r),xs=!1,Js&&(n=eu(t,i,s,r)),$c(e),n}function $c(e){H.H=Ir;var t=Ge!==null&&Ge.next!==null;if(xi=0,ot=Ge=Ee=null,Kn=!1,jr=0,$s=null,t)throw Error(G(300));e===null||ct||(e=e.dependencies,e!==null&&Bn(e)&&(ct=!0))}function eu(e,t,i,s){Ee=e;var r=0;do{if(Js&&($s=null),jr=0,Js=!1,25<=r)throw Error(G(301));if(r+=1,ot=Ge=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}H.H=Nu,n=t(i,s)}while(Js);return n}function $d(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?qr(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Ee.flags|=1024),t}function ya(){var e=In!==0;return In=0,e}function ba(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Ca(e){if(Kn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Kn=!1}xi=0,ot=Ge=Ee=null,Js=!1,jr=In=0,$s=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Ee.memoizedState=ot=e:ot=ot.next=e,ot}function nt(){if(Ge===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=ot===null?Ee.memoizedState:ot.next;if(t!==null)ot=t,Ge=e;else{if(e===null)throw Ee.alternate===null?Error(G(467)):Error(G(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},ot===null?Ee.memoizedState=ot=e:ot=ot.next=e}return ot}function Yn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qr(e){var t=jr;return jr+=1,$s===null&&($s=[]),e=Gc($s,e,t),t=Ee,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Hu:ka),e}function Gn(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return qr(e);if(e.$$typeof===a)return St(e)}throw Error(G(438,String(e)))}function Ea(e){var t=null,i=Ee.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Ee.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Yn(),Ee.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=B;return t.index++,i}function Di(e,t){return typeof t=="function"?t(e):t}function Fn(e){var t=nt();return wa(t,Ge,e)}function wa(e,t,i){var s=e.queue;if(s===null)throw Error(G(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var m=r.next;r.next=n.next,n.next=m}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var R=m=null,N=null,P=t,te=!1;do{var ne=P.lane&-536870913;if(ne!==P.lane?(Re&ne)===ne:(xi&ne)===ne){var Q=P.revertLane;if(Q===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),ne===Vs&&(te=!0);else if((xi&Q)===Q){P=P.next,Q===Vs&&(te=!0);continue}else ne={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},N===null?(R=N=ne,m=n):N=N.next=ne,Ee.lanes|=Q,$i|=Q;ne=P.action,xs&&i(n,ne),n=P.hasEagerState?P.eagerState:i(n,ne)}else Q={lane:ne,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},N===null?(R=N=Q,m=n):N=N.next=Q,Ee.lanes|=ne,$i|=ne;P=P.next}while(P!==null&&P!==t);if(N===null?m=n:N.next=R,!Nt(n,e.memoizedState)&&(ct=!0,te&&(i=Ps,i!==null)))throw i;e.memoizedState=n,e.baseState=m,e.baseQueue=N,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function xa(e){var t=nt(),i=t.queue;if(i===null)throw Error(G(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var m=r=r.next;do n=e(n,m.action),m=m.next;while(m!==r);Nt(n,t.memoizedState)||(ct=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function tu(e,t,i){var s=Ee,r=nt(),n=Le;if(n){if(i===void 0)throw Error(G(407));i=i()}else i=t();var m=!Nt((Ge||r).memoizedState,i);if(m&&(r.memoizedState=i,ct=!0),r=r.queue,Ta(ru.bind(null,s,r,e),[e]),r.getSnapshot!==t||m||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,er(9,{destroy:void 0},su.bind(null,s,r,i,t),null),Ve===null)throw Error(G(349));n||(xi&127)!==0||iu(s,t,i)}return i}function iu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ee.updateQueue,t===null?(t=Yn(),Ee.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function su(e,t,i,s){t.value=i,t.getSnapshot=s,nu(t)&&lu(e)}function ru(e,t,i){return i(function(){nu(t)&&lu(e)})}function nu(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Nt(e,i)}catch{return!0}}function lu(e){var t=ms(e,2);t!==null&&kt(t,e,2)}function Da(e){var t=Dt();if(typeof e=="function"){var i=e;if(e=i(),xs){ft(!0);try{i()}finally{ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t}function au(e,t,i,s){return e.baseState=i,wa(e,Ge,typeof s=="function"?s:Di)}function e_(e,t,i,s,r){if(Pn(e))throw Error(G(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){n.listeners.push(m)}};H.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,ou(t,n)):(n.next=i.next,t.pending=i.next=n)}}function ou(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=H.T,m={};H.T=m;try{var R=i(r,s),N=H.S;N!==null&&N(m,R),cu(e,t,R)}catch(P){Aa(e,t,P)}finally{n!==null&&m.types!==null&&(n.types=m.types),H.T=n}}else try{n=i(r,s),cu(e,t,n)}catch(P){Aa(e,t,P)}}function cu(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){uu(e,t,s)},function(s){return Aa(e,t,s)}):uu(e,t,i)}function uu(e,t,i){t.status="fulfilled",t.value=i,hu(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,ou(e,i)))}function Aa(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,hu(t),t=t.next;while(t!==s)}e.action=null}function hu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function fu(e,t){return t}function du(e,t){if(Le){var i=Ve.formState;if(i!==null){e:{var s=Ee;if(Le){if(We){t:{for(var r=We,n=Jt;r.nodeType!==8;){if(!n){r=null;break t}if(r=ei(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){We=ei(r.nextSibling),s=r.data==="F!";break e}}Gi(s)}s=!1}s&&(t=i[0])}}return i=Dt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fu,lastRenderedState:t},i.queue=s,i=Bu.bind(null,Ee,s),s.dispatch=i,s=Da(!1),n=Oa.bind(null,Ee,!1,s.queue),s=Dt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=e_.bind(null,Ee,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function _u(e){var t=nt();return vu(t,Ge,e)}function vu(e,t,i){if(t=wa(e,t,fu)[0],e=Fn(Di)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=qr(t)}catch(m){throw m===Ws?Hn:m}else s=t;t=nt();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(Ee.flags|=2048,er(9,{destroy:void 0},t_.bind(null,r,i),null)),[s,n,e]}function t_(e,t){e.action=t}function mu(e){var t=nt(),i=Ge;if(i!==null)return vu(t,i,e);nt(),t=t.memoizedState,i=nt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function er(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=Yn(),Ee.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function gu(){return nt().memoizedState}function Xn(e,t,i,s){var r=Dt();Ee.flags|=e,r.memoizedState=er(1|t,{destroy:void 0},i,s===void 0?null:s)}function Vn(e,t,i,s){var r=nt();s=s===void 0?null:s;var n=r.memoizedState.inst;Ge!==null&&s!==null&&pa(s,Ge.memoizedState.deps)?r.memoizedState=er(t,n,i,s):(Ee.flags|=e,r.memoizedState=er(1|t,n,i,s))}function pu(e,t){Xn(8390656,8,e,t)}function Ta(e,t){Vn(2048,8,e,t)}function i_(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=Yn(),Ee.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Su(e){var t=nt().memoizedState;return i_({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(G(440));return t.impl.apply(void 0,arguments)}}function yu(e,t){return Vn(4,2,e,t)}function bu(e,t){return Vn(4,4,e,t)}function Cu(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eu(e,t,i){i=i!=null?i.concat([e]):null,Vn(4,4,Cu.bind(null,t,e),i)}function Ra(){}function wu(e,t){var i=nt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&pa(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function xu(e,t){var i=nt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&pa(t,s[1]))return s[0];if(s=e(),xs){ft(!0);try{e()}finally{ft(!1)}}return i.memoizedState=[s,t],s}function Ma(e,t,i){return i===void 0||(xi&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Dh(),Ee.lanes|=e,$i|=e,i)}function Du(e,t,i,s){return Nt(i,t)?i:Zs.current!==null?(e=Ma(e,i,s),Nt(e,t)||(ct=!0),e):(xi&42)===0||(xi&1073741824)!==0&&(Re&261930)===0?(ct=!0,e.memoizedState=i):(e=Dh(),Ee.lanes|=e,$i|=e,t)}function Au(e,t,i,s,r){var n=I.p;I.p=n!==0&&8>n?n:8;var m=H.T,R={};H.T=R,Oa(e,!1,t,i);try{var N=r(),P=H.S;if(P!==null&&P(R,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var te=Zd(N,s);Kr(e,t,te,It(e))}else Kr(e,t,s,It(e))}catch(ne){Kr(e,t,{then:function(){},status:"rejected",reason:ne},It())}finally{I.p=n,m!==null&&R.types!==null&&(m.types=R.types),H.T=m}}function s_(){}function La(e,t,i,s){if(e.tag!==5)throw Error(G(476));var r=Tu(e).queue;Au(e,r,t,A,i===null?s_:function(){return Ru(e),i(s)})}function Tu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:A,baseState:A,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:A},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ru(e){var t=Tu(e);t.next===null&&(t=e.alternate.memoizedState),Kr(e,t.next.queue,{},It())}function Ba(){return St(nn)}function Mu(){return nt().memoizedState}function Lu(){return nt().memoizedState}function r_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=It();e=Vi(i);var s=Pi(t,e,i);s!==null&&(kt(s,t,i),Nr(s,t,i)),t={cache:aa()},e.payload=t;return}t=t.return}}function n_(e,t,i){var s=It();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Pn(e)?Ou(t,i):(i=Ql(e,t,i,s),i!==null&&(kt(i,e,s),ku(i,t,s)))}function Bu(e,t,i){var s=It();Kr(e,t,i,s)}function Kr(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Pn(e))Ou(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var m=t.lastRenderedState,R=n(m,i);if(r.hasEagerState=!0,r.eagerState=R,Nt(R,m))return Tn(e,t,r,0),Ve===null&&An(),!1}catch{}if(i=Ql(e,t,r,s),i!==null)return kt(i,e,s),ku(i,t,s),!0}return!1}function Oa(e,t,i,s){if(s={lane:2,revertLane:ho(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Pn(e)){if(t)throw Error(G(479))}else t=Ql(e,i,s,2),t!==null&&kt(t,e,2)}function Pn(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Ou(e,t){Js=Kn=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function ku(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mr(e,i)}}var Ir={readContext:St,use:Gn,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};Ir.useEffectEvent=tt;var Hu={readContext:St,use:Gn,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:pu,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Xn(4194308,4,Cu.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Xn(4194308,4,e,t)},useInsertionEffect:function(e,t){Xn(4,2,e,t)},useMemo:function(e,t){var i=Dt();t=t===void 0?null:t;var s=e();if(xs){ft(!0);try{e()}finally{ft(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Dt();if(i!==void 0){var r=i(t);if(xs){ft(!0);try{i(t)}finally{ft(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=n_.bind(null,Ee,e),[s.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Da(e);var t=e.queue,i=Bu.bind(null,Ee,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Ra,useDeferredValue:function(e,t){var i=Dt();return Ma(i,e,t)},useTransition:function(){var e=Da(!1);return e=Au.bind(null,Ee,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ee,r=Dt();if(Le){if(i===void 0)throw Error(G(407));i=i()}else{if(i=t(),Ve===null)throw Error(G(349));(Re&127)!==0||iu(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,pu(ru.bind(null,s,n,e),[e]),s.flags|=2048,er(9,{destroy:void 0},su.bind(null,s,n,i,t),null),i},useId:function(){var e=Dt(),t=Ve.identifierPrefix;if(Le){var i=_i,s=di;i=(s&~(1<<32-Et(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=In++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Jd++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ba,useFormState:du,useActionState:du,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Oa.bind(null,Ee,!0,i),i.dispatch=t,[e,t]},useMemoCache:Ea,useCacheRefresh:function(){return Dt().memoizedState=r_.bind(null,Ee)},useEffectEvent:function(e){var t=Dt(),i={impl:e};return t.memoizedState=i,function(){if((ze&2)!==0)throw Error(G(440));return i.impl.apply(void 0,arguments)}}},ka={readContext:St,use:Gn,useCallback:wu,useContext:St,useEffect:Ta,useImperativeHandle:Eu,useInsertionEffect:yu,useLayoutEffect:bu,useMemo:xu,useReducer:Fn,useRef:gu,useState:function(){return Fn(Di)},useDebugValue:Ra,useDeferredValue:function(e,t){var i=nt();return Du(i,Ge.memoizedState,e,t)},useTransition:function(){var e=Fn(Di)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:qr(e),t]},useSyncExternalStore:tu,useId:Mu,useHostTransitionStatus:Ba,useFormState:_u,useActionState:_u,useOptimistic:function(e,t){var i=nt();return au(i,Ge,e,t)},useMemoCache:Ea,useCacheRefresh:Lu};ka.useEffectEvent=Su;var Nu={readContext:St,use:Gn,useCallback:wu,useContext:St,useEffect:Ta,useImperativeHandle:Eu,useInsertionEffect:yu,useLayoutEffect:bu,useMemo:xu,useReducer:xa,useRef:gu,useState:function(){return xa(Di)},useDebugValue:Ra,useDeferredValue:function(e,t){var i=nt();return Ge===null?Ma(i,e,t):Du(i,Ge.memoizedState,e,t)},useTransition:function(){var e=xa(Di)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:qr(e),t]},useSyncExternalStore:tu,useId:Mu,useHostTransitionStatus:Ba,useFormState:mu,useActionState:mu,useOptimistic:function(e,t){var i=nt();return Ge!==null?au(i,Ge,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Ea,useCacheRefresh:Lu};Nu.useEffectEvent=Su;function Ha(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:h({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Na={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=It(),r=Vi(s);r.payload=t,i!=null&&(r.callback=i),t=Pi(e,r,s),t!==null&&(kt(t,e,s),Nr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=It(),r=Vi(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=Pi(e,r,s),t!==null&&(kt(t,e,s),Nr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=It(),s=Vi(i);s.tag=2,t!=null&&(s.callback=t),t=Pi(e,s,i),t!==null&&(kt(t,e,i),Nr(t,e,i))}};function zu(e,t,i,s,r,n,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,m):t.prototype&&t.prototype.isPureReactComponent?!Tr(i,s)||!Tr(r,n):!0}function Uu(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Na.enqueueReplaceState(t,t.state,null)}function Ds(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=h({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function ju(e){Dn(e)}function qu(e){console.error(e)}function Ku(e){Dn(e)}function Wn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Iu(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function za(e,t,i){return i=Vi(i),i.tag=3,i.payload={element:null},i.callback=function(){Wn(e,t)},i}function Yu(e){return e=Vi(e),e.tag=3,e}function Gu(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){Iu(t,i,s)}}var m=i.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Iu(t,i,s),typeof r!="function"&&(es===null?es=new Set([this]):es.add(this));var R=s.stack;this.componentDidCatch(s.value,{componentStack:R!==null?R:""})})}function l_(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Xs(t,i,r,!0),i=Ut.current,i!==null){switch(i.tag){case 31:case 13:return $t===null?al():i.alternate===null&&it===0&&(it=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===Nn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),oo(e,s,r)),!1;case 22:return i.flags|=65536,s===Nn?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),oo(e,s,r)),!1}throw Error(G(435,i.tag))}return oo(e,s,r),al(),!1}if(Le)return t=Ut.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==ia&&(e=Error(G(422),{cause:s}),Lr(Wt(e,i)))):(s!==ia&&(t=Error(G(423),{cause:s}),Lr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Wt(s,i),r=za(e.stateNode,s,r),da(e,r),it!==4&&(it=2)),!1;var n=Error(G(520),{cause:s});if(n=Wt(n,i),Qr===null?Qr=[n]:Qr.push(n),it!==4&&(it=2),t===null)return!0;s=Wt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=za(i.stateNode,s,e),da(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(es===null||!es.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=Yu(r),Gu(r,e,i,s),da(i,r),!1}i=i.return}while(i!==null);return!1}var Ua=Error(G(461)),ct=!1;function yt(e,t,i,s){t.child=e===null?Pc(t,null,i,s):ws(t,e.child,i,s)}function Fu(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var m={};for(var R in s)R!=="ref"&&(m[R]=s[R])}else m=s;return ys(t),s=Sa(e,t,i,m,n,r),R=ya(),e!==null&&!ct?(ba(e,t,r),Ai(e,t,r)):(Le&&R&&ea(t),t.flags|=1,yt(e,t,s,r),t.child)}function Xu(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!Zl(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,Vu(e,t,n,s,r)):(e=Mn(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Xa(e,r)){var m=n.memoizedProps;if(i=i.compare,i=i!==null?i:Tr,i(m,s)&&e.ref===t.ref)return Ai(e,t,r)}return t.flags|=1,e=bi(n,s),e.ref=t.ref,e.return=t,t.child=e}function Vu(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(Tr(n,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=n,Xa(e,r))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Ai(e,t,r)}return ja(e,t,i,s,r)}function Pu(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return Wu(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&kn(t,n!==null?n.cachePool:null),n!==null?Zc(t,n):va(),Jc(t);else return s=t.lanes=536870912,Wu(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(kn(t,n.cachePool),Zc(t,n),Qi(),t.memoizedState=null):(e!==null&&kn(t,null),va(),Qi());return yt(e,t,r,i),t.child}function Yr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wu(e,t,i,s,r){var n=ca();return n=n===null?null:{parent:at._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&kn(t,null),va(),Jc(t),e!==null&&Xs(e,t,s,!0),t.childLanes=r,null}function Qn(e,t){return t=Jn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qu(e,t,i){return ws(t,e.child,null,i),e=Qn(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function a_(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(s.mode==="hidden")return e=Qn(t,s),t.lanes=536870912,Yr(null,e);if(ga(t),(e=We)?(e=cf(e,Jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ii!==null?{id:di,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},i=Oc(e),i.return=t,t.child=i,pt=t,We=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return Qn(t,s)}var n=e.memoizedState;if(n!==null){var m=n.dehydrated;if(ga(t),r)if(t.flags&256)t.flags&=-257,t=Qu(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(G(558));else if(ct||Xs(e,t,i,!1),r=(i&e.childLanes)!==0,ct||r){if(s=Ve,s!==null&&(m=gr(s,i),m!==0&&m!==n.retryLane))throw n.retryLane=m,ms(e,m),kt(s,e,m),Ua;al(),t=Qu(e,t,i)}else e=n.treeContext,We=ei(m.nextSibling),pt=t,Le=!0,Yi=null,Jt=!1,e!==null&&Nc(t,e),t=Qn(t,s),t.flags|=4096;return t}return e=bi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zn(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(G(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function ja(e,t,i,s,r){return ys(t),i=Sa(e,t,i,s,void 0,r),s=ya(),e!==null&&!ct?(ba(e,t,r),Ai(e,t,r)):(Le&&s&&ea(t),t.flags|=1,yt(e,t,i,r),t.child)}function Zu(e,t,i,s,r,n){return ys(t),t.updateQueue=null,i=eu(t,s,i,r),$c(e),s=ya(),e!==null&&!ct?(ba(e,t,n),Ai(e,t,n)):(Le&&s&&ea(t),t.flags|=1,yt(e,t,i,n),t.child)}function Ju(e,t,i,s,r){if(ys(t),t.stateNode===null){var n=Is,m=i.contextType;typeof m=="object"&&m!==null&&(n=St(m)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Na,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},ha(t),m=i.contextType,n.context=typeof m=="object"&&m!==null?St(m):Is,n.state=t.memoizedState,m=i.getDerivedStateFromProps,typeof m=="function"&&(Ha(t,i,m,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(m=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),m!==n.state&&Na.enqueueReplaceState(n,n.state,null),Ur(t,s,n,r),zr(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var R=t.memoizedProps,N=Ds(i,R);n.props=N;var P=n.context,te=i.contextType;m=Is,typeof te=="object"&&te!==null&&(m=St(te));var ne=i.getDerivedStateFromProps;te=typeof ne=="function"||typeof n.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,te||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(R||P!==m)&&Uu(t,n,s,m),Xi=!1;var Q=t.memoizedState;n.state=Q,Ur(t,s,n,r),zr(),P=t.memoizedState,R||Q!==P||Xi?(typeof ne=="function"&&(Ha(t,i,ne,s),P=t.memoizedState),(N=Xi||zu(t,i,N,s,Q,P,m))?(te||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=P),n.props=s,n.state=P,n.context=m,s=N):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,fa(e,t),m=t.memoizedProps,te=Ds(i,m),n.props=te,ne=t.pendingProps,Q=n.context,P=i.contextType,N=Is,typeof P=="object"&&P!==null&&(N=St(P)),R=i.getDerivedStateFromProps,(P=typeof R=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(m!==ne||Q!==N)&&Uu(t,n,s,N),Xi=!1,Q=t.memoizedState,n.state=Q,Ur(t,s,n,r),zr();var $=t.memoizedState;m!==ne||Q!==$||Xi||e!==null&&e.dependencies!==null&&Bn(e.dependencies)?(typeof R=="function"&&(Ha(t,i,R,s),$=t.memoizedState),(te=Xi||zu(t,i,te,s,Q,$,N)||e!==null&&e.dependencies!==null&&Bn(e.dependencies))?(P||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,$,N),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,$,N)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||m===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=$),n.props=s,n.state=$,n.context=N,s=te):(typeof n.componentDidUpdate!="function"||m===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,Zn(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=ws(t,e.child,null,r),t.child=ws(t,null,i,r)):yt(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Ai(e,t,r),e}function $u(e,t,i,s){return ps(),t.flags|=256,yt(e,t,i,s),t.child}var qa={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ka(e){return{baseLanes:e,cachePool:Ic()}}function Ia(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Kt),e}function eh(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,m;if((m=n)||(m=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(r?Wi(t):Qi(),(e=We)?(e=cf(e,Jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ii!==null?{id:di,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},i=Oc(e),i.return=t,t.child=i,pt=t,We=null)):e=null,e===null)throw Gi(t);return xo(e)?t.lanes=32:t.lanes=536870912,null}var R=s.children;return s=s.fallback,r?(Qi(),r=t.mode,R=Jn({mode:"hidden",children:R},r),s=gs(s,r,i,null),R.return=t,s.return=t,R.sibling=s,t.child=R,s=t.child,s.memoizedState=Ka(i),s.childLanes=Ia(e,m,i),t.memoizedState=qa,Yr(null,s)):(Wi(t),Ya(t,R))}var N=e.memoizedState;if(N!==null&&(R=N.dehydrated,R!==null)){if(n)t.flags&256?(Wi(t),t.flags&=-257,t=Ga(e,t,i)):t.memoizedState!==null?(Qi(),t.child=e.child,t.flags|=128,t=null):(Qi(),R=s.fallback,r=t.mode,s=Jn({mode:"visible",children:s.children},r),R=gs(R,r,i,null),R.flags|=2,s.return=t,R.return=t,s.sibling=R,t.child=s,ws(t,e.child,null,i),s=t.child,s.memoizedState=Ka(i),s.childLanes=Ia(e,m,i),t.memoizedState=qa,t=Yr(null,s));else if(Wi(t),xo(R)){if(m=R.nextSibling&&R.nextSibling.dataset,m)var P=m.dgst;m=P,s=Error(G(419)),s.stack="",s.digest=m,Lr({value:s,source:null,stack:null}),t=Ga(e,t,i)}else if(ct||Xs(e,t,i,!1),m=(i&e.childLanes)!==0,ct||m){if(m=Ve,m!==null&&(s=gr(m,i),s!==0&&s!==N.retryLane))throw N.retryLane=s,ms(e,s),kt(m,e,s),Ua;wo(R)||al(),t=Ga(e,t,i)}else wo(R)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,We=ei(R.nextSibling),pt=t,Le=!0,Yi=null,Jt=!1,e!==null&&Nc(t,e),t=Ya(t,s.children),t.flags|=4096);return t}return r?(Qi(),R=s.fallback,r=t.mode,N=e.child,P=N.sibling,s=bi(N,{mode:"hidden",children:s.children}),s.subtreeFlags=N.subtreeFlags&65011712,P!==null?R=bi(P,R):(R=gs(R,r,i,null),R.flags|=2),R.return=t,s.return=t,s.sibling=R,t.child=s,Yr(null,s),s=t.child,R=e.child.memoizedState,R===null?R=Ka(i):(r=R.cachePool,r!==null?(N=at._currentValue,r=r.parent!==N?{parent:N,pool:N}:r):r=Ic(),R={baseLanes:R.baseLanes|i,cachePool:r}),s.memoizedState=R,s.childLanes=Ia(e,m,i),t.memoizedState=qa,Yr(e.child,s)):(Wi(t),i=e.child,e=i.sibling,i=bi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=i,t.memoizedState=null,i)}function Ya(e,t){return t=Jn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Jn(e,t){return e=zt(22,e,null,t),e.lanes=0,e}function Ga(e,t,i){return ws(t,e.child,null,i),e=Ya(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function th(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),na(e.return,t,i)}function Fa(e,t,i,s,r,n){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=s,m.tail=i,m.tailMode=r,m.treeForkCount=n)}function ih(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var m=rt.current,R=(m&2)!==0;if(R?(m=m&1|2,t.flags|=128):m&=1,Z(rt,m),yt(e,t,s,i),s=Le?Mr:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&th(e,i,t);else if(e.tag===19)th(e,i,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(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&qn(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),Fa(t,!1,r,i,n,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&qn(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}Fa(t,!0,i,null,n,s);break;case"together":Fa(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ai(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),$i|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Xs(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,i=bi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=bi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Xa(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Bn(e)))}function o_(e,t,i){switch(t.tag){case 3:X(t,t.stateNode.containerInfo),Fi(t,at,e.memoizedState.cache),ps();break;case 27:case 5:ie(t);break;case 4:X(t,t.stateNode.containerInfo);break;case 10:Fi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ga(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Wi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?eh(e,t,i):(Wi(t),e=Ai(e,t,i),e!==null?e.sibling:null);Wi(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Xs(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return ih(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Z(rt,rt.current),s)break;return null;case 22:return t.lanes=0,Pu(e,t,i,t.pendingProps);case 24:Fi(t,at,e.memoizedState.cache)}return Ai(e,t,i)}function sh(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Xa(e,i)&&(t.flags&128)===0)return ct=!1,o_(e,t,i);ct=(e.flags&131072)!==0}else ct=!1,Le&&(t.flags&1048576)!==0&&Hc(t,Mr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Cs(t.elementType),t.type=e,typeof e=="function")Zl(e)?(s=Ds(e,s),t.tag=1,t=Ju(null,t,e,s,i)):(t.tag=0,t=ja(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===_){t.tag=11,t=Fu(null,t,e,s,i);break e}else if(r===x){t.tag=14,t=Xu(null,t,e,s,i);break e}}throw t=ee(e)||e,Error(G(306,t,""))}}return t;case 0:return ja(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=Ds(s,t.pendingProps),Ju(e,t,s,r,i);case 3:e:{if(X(t,t.stateNode.containerInfo),e===null)throw Error(G(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,fa(e,t),Ur(t,s,null,i);var m=t.memoizedState;if(s=m.cache,Fi(t,at,s),s!==n.cache&&la(t,[at],i,!0),zr(),s=m.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=$u(e,t,s,i);break e}else if(s!==r){r=Wt(Error(G(424)),t),Lr(r),t=$u(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,We=ei(e.firstChild),pt=t,Le=!0,Yi=null,Jt=!0,i=Pc(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ps(),s===r){t=Ai(e,t,i);break e}yt(e,t,s,i)}t=t.child}return t;case 26:return Zn(e,t),e===null?(i=vf(t.type,null,t.pendingProps,null))?t.memoizedState=i:Le||(i=t.type,e=t.pendingProps,s=_l(fe.current).createElement(i),s[st]=t,s[gt]=e,bt(s,i,e),et(s),t.stateNode=s):t.memoizedState=vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ie(t),e===null&&Le&&(s=t.stateNode=ff(t.type,t.pendingProps,fe.current),pt=t,Jt=!0,r=We,rs(t.type)?(Do=r,We=ei(s.firstChild)):We=r),yt(e,t,t.pendingProps.children,i),Zn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((r=s=We)&&(s=U_(s,t.type,t.pendingProps,Jt),s!==null?(t.stateNode=s,pt=t,We=ei(s.firstChild),Jt=!1,r=!0):r=!1),r||Gi(t)),ie(t),r=t.type,n=t.pendingProps,m=e!==null?e.memoizedProps:null,s=n.children,bo(r,n)?s=null:m!==null&&bo(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=Sa(e,t,$d,null,null,i),nn._currentValue=r),Zn(e,t),yt(e,t,s,i),t.child;case 6:return e===null&&Le&&((e=i=We)&&(i=j_(i,t.pendingProps,Jt),i!==null?(t.stateNode=i,pt=t,We=null,e=!0):e=!1),e||Gi(t)),null;case 13:return eh(e,t,i);case 4:return X(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ws(t,null,s,i):yt(e,t,s,i),t.child;case 11:return Fu(e,t,t.type,t.pendingProps,i);case 7:return yt(e,t,t.pendingProps,i),t.child;case 8:return yt(e,t,t.pendingProps.children,i),t.child;case 12:return yt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Fi(t,t.type,s.value),yt(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,ys(t),r=St(r),s=s(r),t.flags|=1,yt(e,t,s,i),t.child;case 14:return Xu(e,t,t.type,t.pendingProps,i);case 15:return Vu(e,t,t.type,t.pendingProps,i);case 19:return ih(e,t,i);case 31:return a_(e,t,i);case 22:return Pu(e,t,i,t.pendingProps);case 24:return ys(t),s=St(at),e===null?(r=ca(),r===null&&(r=Ve,n=aa(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},ha(t),Fi(t,at,r)):((e.lanes&i)!==0&&(fa(e,t),Ur(t,null,null,i),zr()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Fi(t,at,s)):(s=n.cache,Fi(t,at,s),s!==r.cache&&la(t,[at],i,!0))),yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(G(156,t.tag))}function Ti(e){e.flags|=4}function Va(e,t,i,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Mh())e.flags|=8192;else throw Es=Nn,ua}else e.flags&=-16777217}function rh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yf(t))if(Mh())e.flags|=8192;else throw Es=Nn,ua}function $n(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vr():536870912,e.lanes|=t,rr|=t)}function Gr(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function c_(e,t,i){var s=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(t),null;case 1:return Qe(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),wi(at),J(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?Ti(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sa())),Qe(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Ti(t),n!==null?(Qe(t),rh(t,n)):(Qe(t),Va(t,r,null,s,i))):n?n!==e.memoizedState?(Ti(t),Qe(t),rh(t,n)):(Qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ti(t),Qe(t),Va(t,r,e,s,i)),null;case 27:if(Se(t),i=fe.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ti(t);else{if(!s){if(t.stateNode===null)throw Error(G(166));return Qe(t),null}e=se.current,Fs(t)?zc(t):(e=ff(r,s,i),t.stateNode=e,Ti(t))}return Qe(t),null;case 5:if(Se(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ti(t);else{if(!s){if(t.stateNode===null)throw Error(G(166));return Qe(t),null}if(n=se.current,Fs(t))zc(t);else{var m=_l(fe.current);switch(n){case 1:n=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=m.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?m.createElement("select",{is:s.is}):m.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?m.createElement(r,{is:s.is}):m.createElement(r)}}n[st]=t,n[gt]=s;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)n.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=n;e:switch(bt(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ti(t)}}return Qe(t),Va(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ti(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(G(166));if(e=fe.current,Fs(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=pt,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[st]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||ef(e.nodeValue,i)),e||Gi(t,!0)}else e=_l(e).createTextNode(s),e[st]=t,t.stateNode=e}return Qe(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Fs(t),i!==null){if(e===null){if(!s)throw Error(G(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(557));e[st]=t}else ps(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Qe(t),e=!1}else i=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(G(558))}return Qe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(G(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(G(317));r[st]=t}else ps(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Qe(t),r=!1}else r=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),$n(t,t.updateQueue),Qe(t),null);case 4:return J(),e===null&&mo(t.stateNode.containerInfo),Qe(t),null;case 10:return wi(t.type),Qe(t),null;case 19:if(j(rt),s=t.memoizedState,s===null)return Qe(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)Gr(s,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=qn(e),n!==null){for(t.flags|=128,Gr(s,!1),e=n.updateQueue,t.updateQueue=e,$n(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Bc(i,e),i=i.sibling;return Z(rt,rt.current&1|2),Le&&Ci(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&$e()>rl&&(t.flags|=128,r=!0,Gr(s,!1),t.lanes=4194304)}else{if(!r)if(e=qn(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,$n(t,e),Gr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!n.alternate&&!Le)return Qe(t),null}else 2*$e()-s.renderingStartTime>rl&&i!==536870912&&(t.flags|=128,r=!0,Gr(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=$e(),e.sibling=null,i=rt.current,Z(rt,r?i&1|2:i&1),Le&&Ci(t,s.treeForkCount),e):(Qe(t),null);case 22:case 23:return jt(t),ma(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),i=t.updateQueue,i!==null&&$n(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&j(bs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),wi(at),Qe(t),null;case 25:return null;case 30:return null}throw Error(G(156,t.tag))}function u_(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wi(at),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(G(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(rt),null;case 4:return J(),null;case 10:return wi(t.type),null;case 22:case 23:return jt(t),ma(),e!==null&&j(bs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wi(at),null;case 25:return null;default:return null}}function nh(e,t){switch(ta(t),t.tag){case 3:wi(at),J();break;case 26:case 27:case 5:Se(t);break;case 4:J();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:j(rt);break;case 10:wi(t.type);break;case 22:case 23:jt(t),ma(),e!==null&&j(bs);break;case 24:wi(at)}}function Fr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,m=i.inst;s=n(),m.destroy=s}i=i.next}while(i!==r)}}catch(R){Ie(t,t.return,R)}}function Zi(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var m=s.inst,R=m.destroy;if(R!==void 0){m.destroy=void 0,r=t;var N=i,P=R;try{P()}catch(te){Ie(r,N,te)}}}s=s.next}while(s!==n)}}catch(te){Ie(t,t.return,te)}}function lh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Qc(t,i)}catch(s){Ie(e,e.return,s)}}}function ah(e,t,i){i.props=Ds(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ie(e,t,s)}}function Xr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(r){Ie(e,t,r)}}function vi(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){Ie(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){Ie(e,t,r)}else i.current=null}function oh(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){Ie(e,e.return,r)}}function Pa(e,t,i){try{var s=e.stateNode;B_(s,e.type,i,t),s[gt]=t}catch(r){Ie(e,e.return,r)}}function ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rs(e.type)||e.tag===4}function Wa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ch(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rs(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 Qa(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Si));else if(s!==4&&(s===27&&rs(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Qa(e,t,i),e=e.sibling;e!==null;)Qa(e,t,i),e=e.sibling}function el(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&rs(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(el(e,t,i),e=e.sibling;e!==null;)el(e,t,i),e=e.sibling}function uh(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);bt(t,s,i),t[st]=e,t[gt]=i}catch(n){Ie(e,e.return,n)}}var Ri=!1,ut=!1,Za=!1,hh=typeof WeakSet=="function"?WeakSet:Set,mt=null;function h_(e,t){if(e=e.containerInfo,So=bl,e=Ec(e),Gl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var r=s.anchorOffset,n=s.focusNode;s=s.focusOffset;try{i.nodeType,n.nodeType}catch{i=null;break e}var m=0,R=-1,N=-1,P=0,te=0,ne=e,Q=null;t:for(;;){for(var $;ne!==i||r!==0&&ne.nodeType!==3||(R=m+r),ne!==n||s!==0&&ne.nodeType!==3||(N=m+s),ne.nodeType===3&&(m+=ne.nodeValue.length),($=ne.firstChild)!==null;)Q=ne,ne=$;for(;;){if(ne===e)break t;if(Q===i&&++P===r&&(R=m),Q===n&&++te===s&&(N=m),($=ne.nextSibling)!==null)break;ne=Q,Q=ne.parentNode}ne=$}i=R===-1||N===-1?null:{start:R,end:N}}else i=null}i=i||{start:0,end:0}}else i=null;for(yo={focusedElem:e,selectionRange:i},bl=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,n=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(i=0;i<e.length;i++)r=e[i],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,i=t,r=n.memoizedProps,n=n.memoizedState,s=i.stateNode;try{var de=Ds(i.type,r);e=s.getSnapshotBeforeUpdate(de,n),s.__reactInternalSnapshotBeforeUpdate=e}catch(pe){Ie(i,i.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Eo(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Eo(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(G(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function fh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Li(e,i),s&4&&Fr(5,i);break;case 1:if(Li(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(m){Ie(i,i.return,m)}else{var r=Ds(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ie(i,i.return,m)}}s&64&&lh(i),s&512&&Xr(i,i.return);break;case 3:if(Li(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Qc(e,t)}catch(m){Ie(i,i.return,m)}}break;case 27:t===null&&s&4&&uh(i);case 26:case 5:Li(e,i),t===null&&s&4&&oh(i),s&512&&Xr(i,i.return);break;case 12:Li(e,i);break;case 31:Li(e,i),s&4&&vh(e,i);break;case 13:Li(e,i),s&4&&mh(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=y_.bind(null,i),q_(e,i))));break;case 22:if(s=i.memoizedState!==null||Ri,!s){t=t!==null&&t.memoizedState!==null||ut,r=Ri;var n=ut;Ri=s,(ut=t)&&!n?Bi(e,i,(i.subtreeFlags&8772)!==0):Li(e,i),Ri=r,ut=n}break;case 30:break;default:Li(e,i)}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,Mt=!1;function Mi(e,t,i){for(i=i.child;i!==null;)_h(e,t,i),i=i.sibling}function _h(e,t,i){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(At,i)}catch{}switch(i.tag){case 26:ut||vi(i,t),Mi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ut||vi(i,t);var s=Ze,r=Mt;rs(i.type)&&(Ze=i.stateNode,Mt=!1),Mi(e,t,i),tn(i.stateNode),Ze=s,Mt=r;break;case 5:ut||vi(i,t);case 6:if(s=Ze,r=Mt,Ze=null,Mi(e,t,i),Ze=s,Mt=r,Ze!==null)if(Mt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(i.stateNode)}catch(n){Ie(i,t,n)}else try{Ze.removeChild(i.stateNode)}catch(n){Ie(i,t,n)}break;case 18:Ze!==null&&(Mt?(e=Ze,af(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),fr(e)):af(Ze,i.stateNode));break;case 4:s=Ze,r=Mt,Ze=i.stateNode.containerInfo,Mt=!0,Mi(e,t,i),Ze=s,Mt=r;break;case 0:case 11:case 14:case 15:Zi(2,i,t),ut||Zi(4,i,t),Mi(e,t,i);break;case 1:ut||(vi(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&ah(i,t,s)),Mi(e,t,i);break;case 21:Mi(e,t,i);break;case 22:ut=(s=ut)||i.memoizedState!==null,Mi(e,t,i),ut=s;break;default:Mi(e,t,i)}}function vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fr(e)}catch(i){Ie(t,t.return,i)}}}function mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fr(e)}catch(i){Ie(t,t.return,i)}}function f_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hh),t;default:throw Error(G(435,e.tag))}}function tl(e,t){var i=f_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=b_.bind(null,e,s);s.then(r,r)}})}function Lt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s],n=e,m=t,R=m;e:for(;R!==null;){switch(R.tag){case 27:if(rs(R.type)){Ze=R.stateNode,Mt=!1;break e}break;case 5:Ze=R.stateNode,Mt=!1;break e;case 3:case 4:Ze=R.stateNode.containerInfo,Mt=!0;break e}R=R.return}if(Ze===null)throw Error(G(160));_h(n,m,r),Ze=null,Mt=!1,n=r.alternate,n!==null&&(n.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gh(t,e),t=t.sibling}var ui=null;function gh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),Bt(e),s&4&&(Zi(3,e,e.return),Fr(3,e),Zi(5,e,e.return));break;case 1:Lt(t,e),Bt(e),s&512&&(ut||i===null||vi(i,i.return)),s&64&&Ri&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var r=ui;if(Lt(t,e),Bt(e),s&512&&(ut||i===null||vi(i,i.return)),s&4){var n=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":n=r.getElementsByTagName("title")[0],(!n||n[Oe]||n[st]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=r.createElement(s),r.head.insertBefore(n,r.querySelector("head > title"))),bt(n,s,i),n[st]=e,et(n),s=n;break e;case"link":var m=pf("link","href",r).get(s+(i.href||""));if(m){for(var R=0;R<m.length;R++)if(n=m[R],n.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&n.getAttribute("rel")===(i.rel==null?null:i.rel)&&n.getAttribute("title")===(i.title==null?null:i.title)&&n.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){m.splice(R,1);break t}}n=r.createElement(s),bt(n,s,i),r.head.appendChild(n);break;case"meta":if(m=pf("meta","content",r).get(s+(i.content||""))){for(R=0;R<m.length;R++)if(n=m[R],n.getAttribute("content")===(i.content==null?null:""+i.content)&&n.getAttribute("name")===(i.name==null?null:i.name)&&n.getAttribute("property")===(i.property==null?null:i.property)&&n.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&n.getAttribute("charset")===(i.charSet==null?null:i.charSet)){m.splice(R,1);break t}}n=r.createElement(s),bt(n,s,i),r.head.appendChild(n);break;default:throw Error(G(468,s))}n[st]=e,et(n),s=n}e.stateNode=s}else Sf(r,e.type,e.stateNode);else e.stateNode=gf(r,s,e.memoizedProps);else n!==s?(n===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):n.count--,s===null?Sf(r,e.type,e.stateNode):gf(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Pa(e,e.memoizedProps,i.memoizedProps)}break;case 27:Lt(t,e),Bt(e),s&512&&(ut||i===null||vi(i,i.return)),i!==null&&s&4&&Pa(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Lt(t,e),Bt(e),s&512&&(ut||i===null||vi(i,i.return)),e.flags&32){r=e.stateNode;try{Hs(r,"")}catch(de){Ie(e,e.return,de)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,Pa(e,r,i!==null?i.memoizedProps:r)),s&1024&&(Za=!0);break;case 6:if(Lt(t,e),Bt(e),s&4){if(e.stateNode===null)throw Error(G(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(de){Ie(e,e.return,de)}}break;case 3:if(gl=null,r=ui,ui=vl(t.containerInfo),Lt(t,e),ui=r,Bt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{fr(t.containerInfo)}catch(de){Ie(e,e.return,de)}Za&&(Za=!1,ph(e));break;case 4:s=ui,ui=vl(e.stateNode.containerInfo),Lt(t,e),Bt(e),ui=s;break;case 12:Lt(t,e),Bt(e);break;case 31:Lt(t,e),Bt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 13:Lt(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(sl=$e()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 22:r=e.memoizedState!==null;var N=i!==null&&i.memoizedState!==null,P=Ri,te=ut;if(Ri=P||r,ut=te||N,Lt(t,e),ut=te,Ri=P,Bt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||N||Ri||ut||As(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){N=i=t;try{if(n=N.stateNode,r)m=n.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{R=N.stateNode;var ne=N.memoizedProps.style,Q=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;R.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(de){Ie(N,N.return,de)}}}else if(t.tag===6){if(i===null){N=t;try{N.stateNode.nodeValue=r?"":N.memoizedProps}catch(de){Ie(N,N.return,de)}}}else if(t.tag===18){if(i===null){N=t;try{var $=N.stateNode;r?of($,!0):of(N.stateNode,!1)}catch(de){Ie(N,N.return,de)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,tl(e,i))));break;case 19:Lt(t,e),Bt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 30:break;case 21:break;default:Lt(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(ch(s)){i=s;break}s=s.return}if(i==null)throw Error(G(160));switch(i.tag){case 27:var r=i.stateNode,n=Wa(e);el(e,n,r);break;case 5:var m=i.stateNode;i.flags&32&&(Hs(m,""),i.flags&=-33);var R=Wa(e);el(e,R,m);break;case 3:case 4:var N=i.stateNode.containerInfo,P=Wa(e);Qa(e,P,N);break;default:throw Error(G(161))}}catch(te){Ie(e,e.return,te)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ph(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ph(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fh(e,t.alternate,t),t=t.sibling}function As(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zi(4,t,t.return),As(t);break;case 1:vi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&ah(t,t.return,i),As(t);break;case 27:tn(t.stateNode);case 26:case 5:vi(t,t.return),As(t);break;case 22:t.memoizedState===null&&As(t);break;case 30:As(t);break;default:As(t)}e=e.sibling}}function Bi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,m=n.flags;switch(n.tag){case 0:case 11:case 15:Bi(r,n,i),Fr(4,n);break;case 1:if(Bi(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(P){Ie(s,s.return,P)}if(s=n,r=s.updateQueue,r!==null){var R=s.stateNode;try{var N=r.shared.hiddenCallbacks;if(N!==null)for(r.shared.hiddenCallbacks=null,r=0;r<N.length;r++)Wc(N[r],R)}catch(P){Ie(s,s.return,P)}}i&&m&64&&lh(n),Xr(n,n.return);break;case 27:uh(n);case 26:case 5:Bi(r,n,i),i&&s===null&&m&4&&oh(n),Xr(n,n.return);break;case 12:Bi(r,n,i);break;case 31:Bi(r,n,i),i&&m&4&&vh(r,n);break;case 13:Bi(r,n,i),i&&m&4&&mh(r,n);break;case 22:n.memoizedState===null&&Bi(r,n,i),Xr(n,n.return);break;case 30:break;default:Bi(r,n,i)}t=t.sibling}}function Ja(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Br(i))}function $a(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Br(e))}function hi(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sh(e,t,i,s),t=t.sibling}function Sh(e,t,i,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:hi(e,t,i,s),r&2048&&Fr(9,t);break;case 1:hi(e,t,i,s);break;case 3:hi(e,t,i,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Br(e)));break;case 12:if(r&2048){hi(e,t,i,s),e=t.stateNode;try{var n=t.memoizedProps,m=n.id,R=n.onPostCommit;typeof R=="function"&&R(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Ie(t,t.return,N)}}else hi(e,t,i,s);break;case 31:hi(e,t,i,s);break;case 13:hi(e,t,i,s);break;case 23:break;case 22:n=t.stateNode,m=t.alternate,t.memoizedState!==null?n._visibility&2?hi(e,t,i,s):Vr(e,t):n._visibility&2?hi(e,t,i,s):(n._visibility|=2,tr(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ja(m,t);break;case 24:hi(e,t,i,s),r&2048&&$a(t.alternate,t);break;default:hi(e,t,i,s)}}function tr(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,m=t,R=i,N=s,P=m.flags;switch(m.tag){case 0:case 11:case 15:tr(n,m,R,N,r),Fr(8,m);break;case 23:break;case 22:var te=m.stateNode;m.memoizedState!==null?te._visibility&2?tr(n,m,R,N,r):Vr(n,m):(te._visibility|=2,tr(n,m,R,N,r)),r&&P&2048&&Ja(m.alternate,m);break;case 24:tr(n,m,R,N,r),r&&P&2048&&$a(m.alternate,m);break;default:tr(n,m,R,N,r)}t=t.sibling}}function Vr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Vr(i,s),r&2048&&Ja(s.alternate,s);break;case 24:Vr(i,s),r&2048&&$a(s.alternate,s);break;default:Vr(i,s)}t=t.sibling}}var Pr=8192;function ir(e,t,i){if(e.subtreeFlags&Pr)for(e=e.child;e!==null;)yh(e,t,i),e=e.sibling}function yh(e,t,i){switch(e.tag){case 26:ir(e,t,i),e.flags&Pr&&e.memoizedState!==null&&J_(i,ui,e.memoizedState,e.memoizedProps);break;case 5:ir(e,t,i);break;case 3:case 4:var s=ui;ui=vl(e.stateNode.containerInfo),ir(e,t,i),ui=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Pr,Pr=16777216,ir(e,t,i),Pr=s):ir(e,t,i));break;default:ir(e,t,i)}}function bh(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 Wr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];mt=s,Eh(s,e)}bh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ch(e),e=e.sibling}function Ch(e){switch(e.tag){case 0:case 11:case 15:Wr(e),e.flags&2048&&Zi(9,e,e.return);break;case 3:Wr(e);break;case 12:Wr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,il(e)):Wr(e);break;default:Wr(e)}}function il(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];mt=s,Eh(s,e)}bh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zi(8,t,t.return),il(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,il(t));break;default:il(t)}e=e.sibling}}function Eh(e,t){for(;mt!==null;){var i=mt;switch(i.tag){case 0:case 11:case 15:Zi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Br(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,mt=s;else e:for(i=e;mt!==null;){s=mt;var r=s.sibling,n=s.return;if(dh(s),s===i){mt=null;break e}if(r!==null){r.return=n,mt=r;break e}mt=n}}}var d_={getCacheForType:function(e){var t=St(at),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return St(at).controller.signal}},__=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ve=null,Ae=null,Re=0,Ke=0,qt=null,Ji=!1,sr=!1,eo=!1,Oi=0,it=0,$i=0,Ts=0,to=0,Kt=0,rr=0,Qr=null,Ot=null,io=!1,sl=0,wh=0,rl=1/0,nl=null,es=null,dt=0,ts=null,nr=null,ki=0,so=0,ro=null,xh=null,Zr=0,no=null;function It(){return(ze&2)!==0&&Re!==0?Re&-Re:H.T!==null?ho():pr()}function Dh(){if(Kt===0)if((Re&536870912)===0||Le){var e=Tt;Tt<<=1,(Tt&3932160)===0&&(Tt=262144),Kt=e}else Kt=536870912;return e=Ut.current,e!==null&&(e.flags|=32),Kt}function kt(e,t,i){(e===Ve&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(lr(e,0),is(e,Re,Kt,!1)),ji(e,i),((ze&2)===0||e!==Ve)&&(e===Ve&&((ze&2)===0&&(Ts|=i),it===4&&is(e,Re,Kt,!1)),mi(e))}function Ah(e,t,i){if((ze&6)!==0)throw Error(G(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Ui(e,t),r=s?g_(e,t):ao(e,t,!0),n=s;do{if(r===0){sr&&!s&&is(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!v_(i)){r=ao(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var R=e;r=Qr;var N=R.current.memoizedState.isDehydrated;if(N&&(lr(R,m).flags|=256),m=ao(R,m,!1),m!==2){if(eo&&!N){R.errorRecoveryDisabledLanes|=n,Ts|=n,r=4;break e}n=Ot,Ot=r,n!==null&&(Ot===null?Ot=n:Ot.push.apply(Ot,n))}r=m}if(n=!1,r!==2)continue}}if(r===1){lr(e,0),is(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(G(345));case 4:if((t&4194048)!==t)break;case 6:is(s,t,Kt,!Ji);break e;case 2:Ot=null;break;case 3:case 5:break;default:throw Error(G(329))}if((t&62914560)===t&&(r=sl+300-$e(),10<r)){if(is(s,t,Kt,!Ji),Ms(s,0,!0)!==0)break e;ki=t,s.timeoutHandle=nf(Th.bind(null,s,i,Ot,nl,io,t,Kt,Ts,rr,Ji,n,"Throttled",-0,0),r);break e}Th(s,i,Ot,nl,io,t,Kt,Ts,rr,Ji,n,null,-0,0)}}break}while(!0);mi(e)}function Th(e,t,i,s,r,n,m,R,N,P,te,ne,Q,$){if(e.timeoutHandle=-1,ne=t.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Si},yh(t,n,ne);var de=(n&62914560)===n?sl-$e():(n&4194048)===n?wh-$e():0;if(de=$_(ne,de),de!==null){ki=n,e.cancelPendingCommit=de(Nh.bind(null,e,t,n,i,s,r,m,R,N,te,ne,null,Q,$)),is(e,n,m,!P);return}}Nh(e,t,n,i,s,r,m,R,N)}function v_(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!Nt(n(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 is(e,t,i,s){t&=~to,t&=~Ts,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-Et(r),m=1<<n;s[n]=-1,r&=~m}i!==0&&Bs(e,i,t)}function ll(){return(ze&6)===0?(Jr(0),!1):!0}function lo(){if(Ae!==null){if(Ke===0)var e=Ae.return;else e=Ae,Ei=Ss=null,Ca(e),Qs=null,kr=0,e=Ae;for(;e!==null;)nh(e.alternate,e),e=e.return;Ae=null}}function lr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,H_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ki=0,lo(),Ve=e,Ae=i=bi(e.current,null),Re=t,Ke=0,qt=null,Ji=!1,sr=Ui(e,t),eo=!1,rr=Kt=to=Ts=$i=it=0,Ot=Qr=null,io=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-Et(s),n=1<<r;t|=e[r],s&=~n}return Oi=t,An(),i}function Rh(e,t){Ee=null,H.H=Ir,t===Ws||t===Hn?(t=Fc(),Ke=3):t===ua?(t=Fc(),Ke=4):Ke=t===Ua?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qt=t,Ae===null&&(it=1,Wn(e,Wt(t,e.current)))}function Mh(){var e=Ut.current;return e===null?!0:(Re&4194048)===Re?$t===null:(Re&62914560)===Re||(Re&536870912)!==0?e===$t:!1}function Lh(){var e=H.H;return H.H=Ir,e===null?Ir:e}function Bh(){var e=H.A;return H.A=d_,e}function al(){it=4,Ji||(Re&4194048)!==Re&&Ut.current!==null||(sr=!0),($i&134217727)===0&&(Ts&134217727)===0||Ve===null||is(Ve,Re,Kt,!1)}function ao(e,t,i){var s=ze;ze|=2;var r=Lh(),n=Bh();(Ve!==e||Re!==t)&&(nl=null,lr(e,t)),t=!1;var m=it;e:do try{if(Ke!==0&&Ae!==null){var R=Ae,N=qt;switch(Ke){case 8:lo(),m=6;break e;case 3:case 2:case 9:case 6:Ut.current===null&&(t=!0);var P=Ke;if(Ke=0,qt=null,ar(e,R,N,P),i&&sr){m=0;break e}break;default:P=Ke,Ke=0,qt=null,ar(e,R,N,P)}}m_(),m=it;break}catch(te){Rh(e,te)}while(!0);return t&&e.shellSuspendCounter++,Ei=Ss=null,ze=s,H.H=r,H.A=n,Ae===null&&(Ve=null,Re=0,An()),m}function m_(){for(;Ae!==null;)Oh(Ae)}function g_(e,t){var i=ze;ze|=2;var s=Lh(),r=Bh();Ve!==e||Re!==t?(nl=null,rl=$e()+500,lr(e,t)):sr=Ui(e,t);e:do try{if(Ke!==0&&Ae!==null){t=Ae;var n=qt;t:switch(Ke){case 1:Ke=0,qt=null,ar(e,t,n,1);break;case 2:case 9:if(Yc(n)){Ke=0,qt=null,kh(t);break}t=function(){Ke!==2&&Ke!==9||Ve!==e||(Ke=7),mi(e)},n.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Yc(n)?(Ke=0,qt=null,kh(t)):(Ke=0,qt=null,ar(e,t,n,7));break;case 5:var m=null;switch(Ae.tag){case 26:m=Ae.memoizedState;case 5:case 27:var R=Ae;if(m?yf(m):R.stateNode.complete){Ke=0,qt=null;var N=R.sibling;if(N!==null)Ae=N;else{var P=R.return;P!==null?(Ae=P,ol(P)):Ae=null}break t}}Ke=0,qt=null,ar(e,t,n,5);break;case 6:Ke=0,qt=null,ar(e,t,n,6);break;case 8:lo(),it=6;break e;default:throw Error(G(462))}}p_();break}catch(te){Rh(e,te)}while(!0);return Ei=Ss=null,H.H=s,H.A=r,ze=i,Ae!==null?0:(Ve=null,Re=0,An(),it)}function p_(){for(;Ae!==null&&!gi();)Oh(Ae)}function Oh(e){var t=sh(e.alternate,e,Oi);e.memoizedProps=e.pendingProps,t===null?ol(e):Ae=t}function kh(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Zu(i,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=Zu(i,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:Ca(t);default:nh(i,t),t=Ae=Bc(t,Oi),t=sh(i,t,Oi)}e.memoizedProps=e.pendingProps,t===null?ol(e):Ae=t}function ar(e,t,i,s){Ei=Ss=null,Ca(t),Qs=null,kr=0;var r=t.return;try{if(l_(e,r,t,i,Re)){it=1,Wn(e,Wt(i,e.current)),Ae=null;return}}catch(n){if(r!==null)throw Ae=r,n;it=1,Wn(e,Wt(i,e.current)),Ae=null;return}t.flags&32768?(Le||s===1?e=!0:sr||(Re&536870912)!==0?e=!1:(Ji=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ut.current,s!==null&&s.tag===13&&(s.flags|=16384))),Hh(t,e)):ol(t)}function ol(e){var t=e;do{if((t.flags&32768)!==0){Hh(t,Ji);return}e=t.return;var i=c_(t.alternate,t,Oi);if(i!==null){Ae=i;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);it===0&&(it=5)}function Hh(e,t){do{var i=u_(e.alternate,e);if(i!==null){i.flags&=32767,Ae=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=i}while(e!==null);it=6,Ae=null}function Nh(e,t,i,s,r,n,m,R,N){e.cancelPendingCommit=null;do cl();while(dt!==0);if((ze&6)!==0)throw Error(G(327));if(t!==null){if(t===e.current)throw Error(G(177));if(n=t.lanes|t.childLanes,n|=Wl,us(e,i,n,m,R,N),e===Ve&&(Ae=Ve=null,Re=0),nr=t,ts=e,ki=i,so=n,ro=r,xh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,C_(xt,function(){return Kh(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=H.T,H.T=null,r=I.p,I.p=2,m=ze,ze|=4;try{h_(e,t,i)}finally{ze=m,I.p=r,H.T=s}}dt=1,zh(),Uh(),jh()}}function zh(){if(dt===1){dt=0;var e=ts,t=nr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=H.T,H.T=null;var s=I.p;I.p=2;var r=ze;ze|=4;try{gh(t,e);var n=yo,m=Ec(e.containerInfo),R=n.focusedElem,N=n.selectionRange;if(m!==R&&R&&R.ownerDocument&&Cc(R.ownerDocument.documentElement,R)){if(N!==null&&Gl(R)){var P=N.start,te=N.end;if(te===void 0&&(te=P),"selectionStart"in R)R.selectionStart=P,R.selectionEnd=Math.min(te,R.value.length);else{var ne=R.ownerDocument||document,Q=ne&&ne.defaultView||window;if(Q.getSelection){var $=Q.getSelection(),de=R.textContent.length,pe=Math.min(N.start,de),Xe=N.end===void 0?pe:Math.min(N.end,de);!$.extend&&pe>Xe&&(m=Xe,Xe=pe,pe=m);var Y=bc(R,pe),q=bc(R,Xe);if(Y&&q&&($.rangeCount!==1||$.anchorNode!==Y.node||$.anchorOffset!==Y.offset||$.focusNode!==q.node||$.focusOffset!==q.offset)){var V=ne.createRange();V.setStart(Y.node,Y.offset),$.removeAllRanges(),pe>Xe?($.addRange(V),$.extend(q.node,q.offset)):(V.setEnd(q.node,q.offset),$.addRange(V))}}}}for(ne=[],$=R;$=$.parentNode;)$.nodeType===1&&ne.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ne.length;R++){var re=ne[R];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}bl=!!So,yo=So=null}finally{ze=r,I.p=s,H.T=i}}e.current=t,dt=2}}function Uh(){if(dt===2){dt=0;var e=ts,t=nr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=H.T,H.T=null;var s=I.p;I.p=2;var r=ze;ze|=4;try{fh(e,t.alternate,t)}finally{ze=r,I.p=s,H.T=i}}dt=3}}function jh(){if(dt===4||dt===3){dt=0,_t();var e=ts,t=nr,i=ki,s=xh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,nr=ts=null,qh(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(es=null),hs(i),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(At,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=H.T,r=I.p,I.p=2,H.T=null;try{for(var n=e.onRecoverableError,m=0;m<s.length;m++){var R=s[m];n(R.value,{componentStack:R.stack})}}finally{H.T=t,I.p=r}}(ki&3)!==0&&cl(),mi(e),r=e.pendingLanes,(i&261930)!==0&&(r&42)!==0?e===no?Zr++:(Zr=0,no=e):Zr=0,Jr(0)}}function qh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Br(t)))}function cl(){return zh(),Uh(),jh(),Kh()}function Kh(){if(dt!==5)return!1;var e=ts,t=so;so=0;var i=hs(ki),s=H.T,r=I.p;try{I.p=32>i?32:i,H.T=null,i=ro,ro=null;var n=ts,m=ki;if(dt=0,nr=ts=null,ki=0,(ze&6)!==0)throw Error(G(331));var R=ze;if(ze|=4,Ch(n.current),Sh(n,n.current,m,i),ze=R,Jr(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(At,n)}catch{}return!0}finally{I.p=r,H.T=s,qh(e,t)}}function Ih(e,t,i){t=Wt(i,t),t=za(e.stateNode,t,2),e=Pi(e,t,2),e!==null&&(ji(e,2),mi(e))}function Ie(e,t,i){if(e.tag===3)Ih(e,e,i);else for(;t!==null;){if(t.tag===3){Ih(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(es===null||!es.has(s))){e=Wt(i,e),i=Yu(2),s=Pi(t,i,2),s!==null&&(Gu(i,s,t,e),ji(s,2),mi(s));break}}t=t.return}}function oo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new __;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(eo=!0,r.add(i),e=S_.bind(null,e,t,i),t.then(e,e))}function S_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ve===e&&(Re&i)===i&&(it===4||it===3&&(Re&62914560)===Re&&300>$e()-sl?(ze&2)===0&&lr(e,0):to|=i,rr===Re&&(rr=0)),mi(e)}function Yh(e,t){t===0&&(t=vr()),e=ms(e,t),e!==null&&(ji(e,t),mi(e))}function y_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Yh(e,i)}function b_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(G(314))}s!==null&&s.delete(t),Yh(e,i)}function C_(e,t){return si(e,t)}var ul=null,or=null,co=!1,hl=!1,uo=!1,ss=0;function mi(e){e!==or&&e.next===null&&(or===null?ul=or=e:or=or.next=e),hl=!0,co||(co=!0,w_())}function Jr(e,t){if(!uo&&hl){uo=!0;do for(var i=!1,s=ul;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var m=s.suspendedLanes,R=s.pingedLanes;n=(1<<31-Et(42|e)+1)-1,n&=r&~(m&~R),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,Vh(s,n))}else n=Re,n=Ms(s,s===Ve?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||Ui(s,n)||(i=!0,Vh(s,n));s=s.next}while(i);uo=!1}}function E_(){Gh()}function Gh(){hl=co=!1;var e=0;ss!==0&&k_()&&(e=ss);for(var t=$e(),i=null,s=ul;s!==null;){var r=s.next,n=Fh(s,t);n===0?(s.next=null,i===null?ul=r:i.next=r,r===null&&(or=i)):(i=s,(e!==0||(n&3)!==0)&&(hl=!0)),s=r}dt!==0&&dt!==5||Jr(e),ss!==0&&(ss=0)}function Fh(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var m=31-Et(n),R=1<<m,N=r[m];N===-1?((R&i)===0||(R&s)!==0)&&(r[m]=_r(R,t)):N<=t&&(e.expiredLanes|=R),n&=~R}if(t=Ve,i=Re,i=Ms(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ri(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Ui(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&ri(s),hs(i)){case 2:case 8:i=zi;break;case 32:i=xt;break;case 268435456:i=Ct;break;default:i=xt}return s=Xh.bind(null,e),i=si(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&ri(s),e.callbackPriority=2,e.callbackNode=null,2}function Xh(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(cl()&&e.callbackNode!==i)return null;var s=Re;return s=Ms(e,e===Ve?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ah(e,s,t),Fh(e,$e()),e.callbackNode!=null&&e.callbackNode===i?Xh.bind(null,e):null)}function Vh(e,t){if(cl())return null;Ah(e,t,!0)}function w_(){N_(function(){(ze&6)!==0?si(ni,E_):Gh()})}function ho(){if(ss===0){var e=Vs;e===0&&(e=lt,lt<<=1,(lt&261888)===0&&(lt=256)),ss=e}return ss}function Ph(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Sn(""+e)}function Wh(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function x_(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Ph((r[gt]||null).action),m=s.submitter;m&&(t=(t=m[gt]||null)?Ph(t.formAction):m.getAttribute("formAction"),t!==null&&(n=t,m=null));var R=new En("action","action",null,s,r);e.push({event:R,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ss!==0){var N=m?Wh(r,m):new FormData(r);La(i,{pending:!0,data:N,method:r.method,action:n},null,N)}}else typeof n=="function"&&(R.preventDefault(),N=m?Wh(r,m):new FormData(r),La(i,{pending:!0,data:N,method:r.method,action:n},n,N))},currentTarget:r}]})}}for(var fo=0;fo<Pl.length;fo++){var _o=Pl[fo],D_=_o.toLowerCase(),A_=_o[0].toUpperCase()+_o.slice(1);ci(D_,"on"+A_)}ci(Dc,"onAnimationEnd"),ci(Ac,"onAnimationIteration"),ci(Tc,"onAnimationStart"),ci("dblclick","onDoubleClick"),ci("focusin","onFocus"),ci("focusout","onBlur"),ci(Yd,"onTransitionRun"),ci(Gd,"onTransitionStart"),ci(Fd,"onTransitionCancel"),ci(Rc,"onTransitionEnd"),Os("onMouseEnter",["mouseout","mouseover"]),Os("onMouseLeave",["mouseout","mouseover"]),Os("onPointerEnter",["pointerout","pointerover"]),Os("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $r="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(" "),T_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($r));function Qh(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var m=s.length-1;0<=m;m--){var R=s[m],N=R.instance,P=R.currentTarget;if(R=R.listener,N!==n&&r.isPropagationStopped())break e;n=R,r.currentTarget=P;try{n(r)}catch(te){Dn(te)}r.currentTarget=null,n=N}else for(m=0;m<s.length;m++){if(R=s[m],N=R.instance,P=R.currentTarget,R=R.listener,N!==n&&r.isPropagationStopped())break e;n=R,r.currentTarget=P;try{n(r)}catch(te){Dn(te)}r.currentTarget=null,n=N}}}}function Te(e,t){var i=t[yr];i===void 0&&(i=t[yr]=new Set);var s=e+"__bubble";i.has(s)||(Zh(t,e,2,!1),i.add(s))}function vo(e,t,i){var s=0;t&&(s|=4),Zh(i,e,s,t)}var fl="_reactListening"+Math.random().toString(36).slice(2);function mo(e){if(!e[fl]){e[fl]=!0,vn.forEach(function(i){i!=="selectionchange"&&(T_.has(i)||vo(i,!1,e),vo(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fl]||(t[fl]=!0,vo("selectionchange",!1,t))}}function Zh(e,t,i,s){switch(Af(t)){case 2:var r=iv;break;case 8:r=sv;break;default:r=Lo}i=r.bind(null,t,i,e),r=void 0,!Hl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function go(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var m=s.tag;if(m===3||m===4){var R=s.stateNode.containerInfo;if(R===r)break;if(m===4)for(m=s.return;m!==null;){var N=m.tag;if((N===3||N===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;R!==null;){if(m=je(R),m===null)return;if(N=m.tag,N===5||N===6||N===26||N===27){s=n=m;continue e}R=R.parentNode}}s=s.return}ic(function(){var P=n,te=Ol(i),ne=[];e:{var Q=Mc.get(e);if(Q!==void 0){var $=En,de=e;switch(e){case"keypress":if(bn(i)===0)break e;case"keydown":case"keyup":$=bd;break;case"focusin":de="focus",$=jl;break;case"focusout":de="blur",$=jl;break;case"beforeblur":case"afterblur":$=jl;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=nc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=cd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=wd;break;case Dc:case Ac:case Tc:$=fd;break;case Rc:$=Dd;break;case"scroll":case"scrollend":$=ad;break;case"wheel":$=Td;break;case"copy":case"cut":case"paste":$=_d;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=ac;break;case"toggle":case"beforetoggle":$=Md}var pe=(t&4)!==0,Xe=!pe&&(e==="scroll"||e==="scrollend"),Y=pe?Q!==null?Q+"Capture":null:Q;pe=[];for(var q=P,V;q!==null;){var re=q;if(V=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||V===null||Y===null||(re=br(q,Y),re!=null&&pe.push(en(q,re,V))),Xe)break;q=q.return}0<pe.length&&(Q=new $(Q,de,null,i,te),ne.push({event:Q,listeners:pe}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",Q&&i!==Bl&&(de=i.relatedTarget||i.fromElement)&&(je(de)||de[qi]))break e;if(($||Q)&&(Q=te.window===te?te:(Q=te.ownerDocument)?Q.defaultView||Q.parentWindow:window,$?(de=i.relatedTarget||i.toElement,$=P,de=de?je(de):null,de!==null&&(Xe=me(de),pe=de.tag,de!==Xe||pe!==5&&pe!==27&&pe!==6)&&(de=null)):($=null,de=P),$!==de)){if(pe=nc,re="onMouseLeave",Y="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(pe=ac,re="onPointerLeave",Y="onPointerEnter",q="pointer"),Xe=$==null?Q:Je($),V=de==null?Q:Je(de),Q=new pe(re,q+"leave",$,i,te),Q.target=Xe,Q.relatedTarget=V,re=null,je(te)===P&&(pe=new pe(Y,q+"enter",de,i,te),pe.target=V,pe.relatedTarget=Xe,re=pe),Xe=re,$&&de)t:{for(pe=R_,Y=$,q=de,V=0,re=Y;re;re=pe(re))V++;re=0;for(var ge=q;ge;ge=pe(ge))re++;for(;0<V-re;)Y=pe(Y),V--;for(;0<re-V;)q=pe(q),re--;for(;V--;){if(Y===q||q!==null&&Y===q.alternate){pe=Y;break t}Y=pe(Y),q=pe(q)}pe=null}else pe=null;$!==null&&Jh(ne,Q,$,pe,!1),de!==null&&Xe!==null&&Jh(ne,Xe,de,pe,!0)}}e:{if(Q=P?Je(P):window,$=Q.nodeName&&Q.nodeName.toLowerCase(),$==="select"||$==="input"&&Q.type==="file")var ke=vc;else if(dc(Q))if(mc)ke=qd;else{ke=Ud;var ve=zd}else $=Q.nodeName,!$||$.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?P&&Ll(P.elementType)&&(ke=vc):ke=jd;if(ke&&(ke=ke(e,P))){_c(ne,ke,i,te);break e}ve&&ve(e,Q,P),e==="focusout"&&P&&Q.type==="number"&&P.memoizedProps.value!=null&&Ml(Q,"number",Q.value)}switch(ve=P?Je(P):window,e){case"focusin":(dc(ve)||ve.contentEditable==="true")&&(js=ve,Fl=P,Rr=null);break;case"focusout":Rr=Fl=js=null;break;case"mousedown":Xl=!0;break;case"contextmenu":case"mouseup":case"dragend":Xl=!1,wc(ne,i,te);break;case"selectionchange":if(Id)break;case"keydown":case"keyup":wc(ne,i,te)}var we;if(Kl)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Us?hc(e,i)&&(Me="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Me="onCompositionStart");Me&&(oc&&i.locale!=="ko"&&(Us||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Us&&(we=sc()):(Ki=te,Nl="value"in Ki?Ki.value:Ki.textContent,Us=!0)),ve=dl(P,Me),0<ve.length&&(Me=new lc(Me,e,null,i,te),ne.push({event:Me,listeners:ve}),we?Me.data=we:(we=fc(i),we!==null&&(Me.data=we)))),(we=Bd?Od(e,i):kd(e,i))&&(Me=dl(P,"onBeforeInput"),0<Me.length&&(ve=new lc("onBeforeInput","beforeinput",null,i,te),ne.push({event:ve,listeners:Me}),ve.data=we)),x_(ne,e,P,i,te)}Qh(ne,t)})}function en(e,t,i){return{instance:e,listener:t,currentTarget:i}}function dl(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=br(e,i),r!=null&&s.unshift(en(e,r,n)),r=br(e,t),r!=null&&s.push(en(e,r,n))),e.tag===3)return s;e=e.return}return[]}function R_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jh(e,t,i,s,r){for(var n=t._reactName,m=[];i!==null&&i!==s;){var R=i,N=R.alternate,P=R.stateNode;if(R=R.tag,N!==null&&N===s)break;R!==5&&R!==26&&R!==27||P===null||(N=P,r?(P=br(i,n),P!=null&&m.unshift(en(i,P,N))):r||(P=br(i,n),P!=null&&m.push(en(i,P,N)))),i=i.return}m.length!==0&&e.push({event:t,listeners:m})}var M_=/\r\n?/g,L_=/\u0000|\uFFFD/g;function $h(e){return(typeof e=="string"?e:""+e).replace(M_,`
9
+ `).replace(L_,"")}function ef(e,t){return t=$h(t),$h(e)===t}function Fe(e,t,i,s,r,n){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Hs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Hs(e,""+s);break;case"className":gn(e,"class",s);break;case"tabIndex":gn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":gn(e,i,s);break;case"style":ec(e,s,n);break;case"data":if(t!=="object"){gn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Sn(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 n=="function"&&(i==="formAction"?(t!=="input"&&Fe(e,t,"name",r.name,r,null),Fe(e,t,"formEncType",r.formEncType,r,null),Fe(e,t,"formMethod",r.formMethod,r,null),Fe(e,t,"formTarget",r.formTarget,r,null)):(Fe(e,t,"encType",r.encType,r,null),Fe(e,t,"method",r.method,r,null),Fe(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Sn(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Si);break;case"onScroll":s!=null&&Te("scroll",e);break;case"onScrollEnd":s!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(G(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(G(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Sn(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Te("beforetoggle",e),Te("toggle",e),mn(e,"popover",s);break;case"xlinkActuate":pi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":pi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":pi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":pi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":pi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":pi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":pi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":pi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":pi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":mn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=nd.get(i)||i,mn(e,i,s))}}function po(e,t,i,s,r,n){switch(i){case"style":ec(e,s,n);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(G(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(G(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Hs(e,s):(typeof s=="number"||typeof s=="bigint")&&Hs(e,""+s);break;case"onScroll":s!=null&&Te("scroll",e);break;case"onScrollEnd":s!=null&&Te("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Si);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fo.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),n=e[gt]||null,n=n!=null?n[i]:null,typeof n=="function"&&e.removeEventListener(t,n,r),typeof s=="function")){typeof n!="function"&&n!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,r);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):mn(e,i,s)}}}function bt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var m=i[n];if(m!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(G(137,t));default:Fe(e,t,n,m,i,null)}}r&&Fe(e,t,"srcSet",i.srcSet,i,null),s&&Fe(e,t,"src",i.src,i,null);return;case"input":Te("invalid",e);var R=n=m=r=null,N=null,P=null;for(s in i)if(i.hasOwnProperty(s)){var te=i[s];if(te!=null)switch(s){case"name":r=te;break;case"type":m=te;break;case"checked":N=te;break;case"defaultChecked":P=te;break;case"value":n=te;break;case"defaultValue":R=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(G(137,t));break;default:Fe(e,t,s,te,i,null)}}Qo(e,n,R,N,P,m,r,!1);return;case"select":Te("invalid",e),s=m=n=null;for(r in i)if(i.hasOwnProperty(r)&&(R=i[r],R!=null))switch(r){case"value":n=R;break;case"defaultValue":m=R;break;case"multiple":s=R;default:Fe(e,t,r,R,i,null)}t=n,i=m,e.multiple=!!s,t!=null?ks(e,!!s,t,!1):i!=null&&ks(e,!!s,i,!0);return;case"textarea":Te("invalid",e),n=r=s=null;for(m in i)if(i.hasOwnProperty(m)&&(R=i[m],R!=null))switch(m){case"value":s=R;break;case"defaultValue":r=R;break;case"children":n=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(G(91));break;default:Fe(e,t,m,R,i,null)}Jo(e,s,r,n);return;case"option":for(N in i)i.hasOwnProperty(N)&&(s=i[N],s!=null)&&(N==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Fe(e,t,N,s,i,null));return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(s=0;s<$r.length;s++)Te($r[s],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("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(P in i)if(i.hasOwnProperty(P)&&(s=i[P],s!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(G(137,t));default:Fe(e,t,P,s,i,null)}return;default:if(Ll(t)){for(te in i)i.hasOwnProperty(te)&&(s=i[te],s!==void 0&&po(e,t,te,s,i,void 0));return}}for(R in i)i.hasOwnProperty(R)&&(s=i[R],s!=null&&Fe(e,t,R,s,i,null))}function B_(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,m=null,R=null,N=null,P=null,te=null;for($ in i){var ne=i[$];if(i.hasOwnProperty($)&&ne!=null)switch($){case"checked":break;case"value":break;case"defaultValue":N=ne;default:s.hasOwnProperty($)||Fe(e,t,$,null,s,ne)}}for(var Q in s){var $=s[Q];if(ne=i[Q],s.hasOwnProperty(Q)&&($!=null||ne!=null))switch(Q){case"type":n=$;break;case"name":r=$;break;case"checked":P=$;break;case"defaultChecked":te=$;break;case"value":m=$;break;case"defaultValue":R=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(G(137,t));break;default:$!==ne&&Fe(e,t,Q,$,s,ne)}}Rl(e,m,R,N,P,te,n,r);return;case"select":$=m=R=Q=null;for(n in i)if(N=i[n],i.hasOwnProperty(n)&&N!=null)switch(n){case"value":break;case"multiple":$=N;default:s.hasOwnProperty(n)||Fe(e,t,n,null,s,N)}for(r in s)if(n=s[r],N=i[r],s.hasOwnProperty(r)&&(n!=null||N!=null))switch(r){case"value":Q=n;break;case"defaultValue":R=n;break;case"multiple":m=n;default:n!==N&&Fe(e,t,r,n,s,N)}t=R,i=m,s=$,Q!=null?ks(e,!!i,Q,!1):!!s!=!!i&&(t!=null?ks(e,!!i,t,!0):ks(e,!!i,i?[]:"",!1));return;case"textarea":$=Q=null;for(R in i)if(r=i[R],i.hasOwnProperty(R)&&r!=null&&!s.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Fe(e,t,R,null,s,r)}for(m in s)if(r=s[m],n=i[m],s.hasOwnProperty(m)&&(r!=null||n!=null))switch(m){case"value":Q=r;break;case"defaultValue":$=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(G(91));break;default:r!==n&&Fe(e,t,m,r,s,n)}Zo(e,Q,$);return;case"option":for(var de in i)Q=i[de],i.hasOwnProperty(de)&&Q!=null&&!s.hasOwnProperty(de)&&(de==="selected"?e.selected=!1:Fe(e,t,de,null,s,Q));for(N in s)Q=s[N],$=i[N],s.hasOwnProperty(N)&&Q!==$&&(Q!=null||$!=null)&&(N==="selected"?e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":Fe(e,t,N,Q,s,$));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 pe in i)Q=i[pe],i.hasOwnProperty(pe)&&Q!=null&&!s.hasOwnProperty(pe)&&Fe(e,t,pe,null,s,Q);for(P in s)if(Q=s[P],$=i[P],s.hasOwnProperty(P)&&Q!==$&&(Q!=null||$!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(G(137,t));break;default:Fe(e,t,P,Q,s,$)}return;default:if(Ll(t)){for(var Xe in i)Q=i[Xe],i.hasOwnProperty(Xe)&&Q!==void 0&&!s.hasOwnProperty(Xe)&&po(e,t,Xe,void 0,s,Q);for(te in s)Q=s[te],$=i[te],!s.hasOwnProperty(te)||Q===$||Q===void 0&&$===void 0||po(e,t,te,Q,s,$);return}}for(var Y in i)Q=i[Y],i.hasOwnProperty(Y)&&Q!=null&&!s.hasOwnProperty(Y)&&Fe(e,t,Y,null,s,Q);for(ne in s)Q=s[ne],$=i[ne],!s.hasOwnProperty(ne)||Q===$||Q==null&&$==null||Fe(e,t,ne,Q,s,$)}function tf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,m=r.initiatorType,R=r.duration;if(n&&R&&tf(m)){for(m=0,R=r.responseEnd,s+=1;s<i.length;s++){var N=i[s],P=N.startTime;if(P>R)break;var te=N.transferSize,ne=N.initiatorType;te&&tf(ne)&&(N=N.responseEnd,m+=te*(N<R?1:(R-P)/(N-P)))}if(--s,t+=8*(n+m)/(r.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 So=null,yo=null;function _l(e){return e.nodeType===9?e:e.ownerDocument}function sf(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 rf(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 bo(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 Co=null;function k_(){var e=window.event;return e&&e.type==="popstate"?e===Co?!1:(Co=e,!0):(Co=null,!1)}var nf=typeof setTimeout=="function"?setTimeout:void 0,H_=typeof clearTimeout=="function"?clearTimeout:void 0,lf=typeof Promise=="function"?Promise:void 0,N_=typeof queueMicrotask=="function"?queueMicrotask:typeof lf<"u"?function(e){return lf.resolve(null).then(e).catch(z_)}:nf;function z_(e){setTimeout(function(){throw e})}function rs(e){return e==="head"}function af(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),fr(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")tn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,tn(i);for(var n=i.firstChild;n;){var m=n.nextSibling,R=n.nodeName;n[Oe]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=m}}else i==="body"&&tn(e.ownerDocument.body);i=r}while(i);fr(t)}function of(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function Eo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Eo(i),Ft(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function U_(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Oe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=ei(e.nextSibling),e===null)break}return null}function j_(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ei(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ei(e.nextSibling),e===null))return null;return e}function wo(e){return e.data==="$?"||e.data==="$~"}function xo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function q_(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function ei(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 Do=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return ei(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function hf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function ff(e,t,i){switch(t=_l(i),e){case"html":if(e=t.documentElement,!e)throw Error(G(452));return e;case"head":if(e=t.head,!e)throw Error(G(453));return e;case"body":if(e=t.body,!e)throw Error(G(454));return e;default:throw Error(G(451))}}function tn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ft(e)}var ti=new Map,df=new Set;function vl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Hi=I.d;I.d={f:K_,r:I_,D:Y_,C:G_,L:F_,m:X_,X:P_,S:V_,M:W_};function K_(){var e=Hi.f(),t=ll();return e||t}function I_(e){var t=Be(e);t!==null&&t.tag===5&&t.type==="form"?Ru(t):Hi.r(e)}var cr=typeof document>"u"?null:document;function _f(e,t,i){var s=cr;if(s&&typeof t=="string"&&t){var r=Vt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),df.has(r)||(df.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),bt(t,"link",e),et(t),s.head.appendChild(t)))}}function Y_(e){Hi.D(e),_f("dns-prefetch",e,null)}function G_(e,t){Hi.C(e,t),_f("preconnect",e,t)}function F_(e,t,i){Hi.L(e,t,i);var s=cr;if(s&&e&&t){var r='link[rel="preload"][as="'+Vt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Vt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Vt(i.imageSizes)+'"]')):r+='[href="'+Vt(e)+'"]';var n=r;switch(t){case"style":n=ur(e);break;case"script":n=hr(e)}ti.has(n)||(e=h({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),ti.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(sn(n))||t==="script"&&s.querySelector(rn(n))||(t=s.createElement("link"),bt(t,"link",e),et(t),s.head.appendChild(t)))}}function X_(e,t){Hi.m(e,t);var i=cr;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Vt(s)+'"][href="'+Vt(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=hr(e)}if(!ti.has(n)&&(e=h({rel:"modulepreload",href:e},t),ti.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(rn(n)))return}s=i.createElement("link"),bt(s,"link",e),et(s),i.head.appendChild(s)}}}function V_(e,t,i){Hi.S(e,t,i);var s=cr;if(s&&e){var r=vt(s).hoistableStyles,n=ur(e);t=t||"default";var m=r.get(n);if(!m){var R={loading:0,preload:null};if(m=s.querySelector(sn(n)))R.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},i),(i=ti.get(n))&&Ao(e,i);var N=m=s.createElement("link");et(N),bt(N,"link",e),N._p=new Promise(function(P,te){N.onload=P,N.onerror=te}),N.addEventListener("load",function(){R.loading|=1}),N.addEventListener("error",function(){R.loading|=2}),R.loading|=4,ml(m,t,s)}m={type:"stylesheet",instance:m,count:1,state:R},r.set(n,m)}}}function P_(e,t){Hi.X(e,t);var i=cr;if(i&&e){var s=vt(i).hoistableScripts,r=hr(e),n=s.get(r);n||(n=i.querySelector(rn(r)),n||(e=h({src:e,async:!0},t),(t=ti.get(r))&&To(e,t),n=i.createElement("script"),et(n),bt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function W_(e,t){Hi.M(e,t);var i=cr;if(i&&e){var s=vt(i).hoistableScripts,r=hr(e),n=s.get(r);n||(n=i.querySelector(rn(r)),n||(e=h({src:e,async:!0,type:"module"},t),(t=ti.get(r))&&To(e,t),n=i.createElement("script"),et(n),bt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function vf(e,t,i,s){var r=(r=fe.current)?vl(r):null;if(!r)throw Error(G(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ur(i.href),i=vt(r).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ur(i.href);var n=vt(r).hoistableStyles,m=n.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,m),(n=r.querySelector(sn(e)))&&!n._p&&(m.instance=n,m.state.loading=5),ti.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},ti.set(e,i),n||Q_(r,e,i,m.state))),t&&s===null)throw Error(G(528,""));return m}if(t&&s!==null)throw Error(G(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=hr(i),i=vt(r).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(G(444,e))}}function ur(e){return'href="'+Vt(e)+'"'}function sn(e){return'link[rel="stylesheet"]['+e+"]"}function mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Q_(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),bt(t,"link",i),et(t),e.head.appendChild(t))}function hr(e){return'[src="'+Vt(e)+'"]'}function rn(e){return"script[async]"+e}function gf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Vt(i.href)+'"]');if(s)return t.instance=s,et(s),s;var r=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),et(s),bt(s,"style",r),ml(s,i.precedence,e),t.instance=s;case"stylesheet":r=ur(i.href);var n=e.querySelector(sn(r));if(n)return t.state.loading|=4,t.instance=n,et(n),n;s=mf(i),(r=ti.get(r))&&Ao(s,r),n=(e.ownerDocument||e).createElement("link"),et(n);var m=n;return m._p=new Promise(function(R,N){m.onload=R,m.onerror=N}),bt(n,"link",s),t.state.loading|=4,ml(n,i.precedence,e),t.instance=n;case"script":return n=hr(i.src),(r=e.querySelector(rn(n)))?(t.instance=r,et(r),r):(s=i,(r=ti.get(n))&&(s=h({},i),To(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),et(r),bt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(G(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,ml(s,i.precedence,e));return t.instance}function ml(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,m=0;m<s.length;m++){var R=s[m];if(R.dataset.precedence===t)n=R;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ao(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function To(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gl=null;function pf(e,t,i){if(gl===null){var s=new Map,r=gl=new Map;r.set(i,s)}else r=gl,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Oe]||n[st]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var m=n.getAttribute(t)||"";m=e+m;var R=s.get(m);R?R.push(n):s.set(m,[n])}}return s}function Sf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Z_(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 yf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function J_(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=ur(s.href),n=t.querySelector(sn(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,et(n);return}n=t.ownerDocument||t,s=mf(s),(r=ti.get(r))&&Ao(s,r),n=n.createElement("link"),et(n);var m=n;m._p=new Promise(function(R,N){m.onload=R,m.onerror=N}),bt(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=pl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ro=0;function $_(e,t){return e.stylesheets&&e.count===0&&yl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&yl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Ro===0&&(Ro=62500*O_());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Ro?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function pl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Sl=null;function yl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Sl=new Map,t.forEach(ev,e),Sl=null,pl.call(e))}function ev(e,t){if(!(t.state.loading&4)){var i=Sl.get(e);if(i)var s=i.get(null);else{i=new Map,Sl.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var m=r[n];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(i.set(m.dataset.precedence,m),s=m)}s&&i.set(null,s)}r=t.instance,m=r.getAttribute("data-precedence"),n=i.get(m)||s,n===s&&i.set(null,r),i.set(m,r),this.count++,s=pl.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var nn={$$typeof:a,Provider:null,Consumer:null,_currentValue:A,_currentValue2:A,_threadCount:0};function tv(e,t,i,s,r,n,m,R,N){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=Ls(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ls(0),this.hiddenUpdates=Ls(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function bf(e,t,i,s,r,n,m,R,N,P,te,ne){return e=new tv(e,t,i,m,N,P,te,ne,R),t=1,n===!0&&(t|=24),n=zt(3,null,null,t),e.current=n,n.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},ha(n),e}function Cf(e){return e?(e=Is,e):Is}function Ef(e,t,i,s,r,n){r=Cf(r),s.context===null?s.context=r:s.pendingContext=r,s=Vi(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=Pi(e,s,t),i!==null&&(kt(i,e,t),Nr(i,e,t))}function wf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Mo(e,t){wf(e,t),(e=e.alternate)&&wf(e,t)}function xf(e){if(e.tag===13||e.tag===31){var t=ms(e,67108864);t!==null&&kt(t,e,67108864),Mo(e,67108864)}}function Df(e){if(e.tag===13||e.tag===31){var t=It();t=ai(t);var i=ms(e,t);i!==null&&kt(i,e,t),Mo(e,t)}}var bl=!0;function iv(e,t,i,s){var r=H.T;H.T=null;var n=I.p;try{I.p=2,Lo(e,t,i,s)}finally{I.p=n,H.T=r}}function sv(e,t,i,s){var r=H.T;H.T=null;var n=I.p;try{I.p=8,Lo(e,t,i,s)}finally{I.p=n,H.T=r}}function Lo(e,t,i,s){if(bl){var r=Bo(s);if(r===null)go(e,t,s,Cl,i),Tf(e,s);else if(nv(r,e,t,i,s))s.stopPropagation();else if(Tf(e,s),t&4&&-1<rv.indexOf(e)){for(;r!==null;){var n=Be(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var m=Ht(n.pendingLanes);if(m!==0){var R=n;for(R.pendingLanes|=2,R.entangledLanes|=2;m;){var N=1<<31-Et(m);R.entanglements[1]|=N,m&=~N}mi(n),(ze&6)===0&&(rl=$e()+500,Jr(0))}}break;case 31:case 13:R=ms(n,2),R!==null&&kt(R,n,2),ll(),Mo(n,2)}if(n=Bo(s),n===null&&go(e,t,s,Cl,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else go(e,t,s,null,i)}}function Bo(e){return e=Ol(e),Oo(e)}var Cl=null;function Oo(e){if(Cl=null,e=je(e),e!==null){var t=me(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=F(t),e!==null)return e;e=null}else if(i===31){if(e=u(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cl=e,null}function Af(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(Pe()){case ni:return 2;case zi:return 8;case xt:case Gt:return 32;case Ct:return 268435456;default:return 32}default:return 32}}var ko=!1,ns=null,ls=null,as=null,ln=new Map,an=new Map,os=[],rv="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 Tf(e,t){switch(e){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":ln.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":an.delete(t.pointerId)}}function on(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=Be(t),t!==null&&xf(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function nv(e,t,i,s,r){switch(t){case"focusin":return ns=on(ns,e,t,i,s,r),!0;case"dragenter":return ls=on(ls,e,t,i,s,r),!0;case"mouseover":return as=on(as,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return ln.set(n,on(ln.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,an.set(n,on(an.get(n)||null,e,t,i,s,r)),!0}return!1}function Rf(e){var t=je(e.target);if(t!==null){var i=me(t);if(i!==null){if(t=i.tag,t===13){if(t=F(i),t!==null){e.blockedOn=t,Sr(e.priority,function(){Df(i)});return}}else if(t===31){if(t=u(i),t!==null){e.blockedOn=t,Sr(e.priority,function(){Df(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function El(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Bo(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Bl=s,i.target.dispatchEvent(s),Bl=null}else return t=Be(i),t!==null&&xf(t),e.blockedOn=i,!1;t.shift()}return!0}function Mf(e,t,i){El(e)&&i.delete(t)}function lv(){ko=!1,ns!==null&&El(ns)&&(ns=null),ls!==null&&El(ls)&&(ls=null),as!==null&&El(as)&&(as=null),ln.forEach(Mf),an.forEach(Mf)}function wl(e,t){e.blockedOn===t&&(e.blockedOn=null,ko||(ko=!0,k.unstable_scheduleCallback(k.unstable_NormalPriority,lv)))}var xl=null;function Lf(e){xl!==e&&(xl=e,k.unstable_scheduleCallback(k.unstable_NormalPriority,function(){xl===e&&(xl=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Oo(s||i)===null)continue;break}var n=Be(i);n!==null&&(e.splice(t,3),t-=3,La(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function fr(e){function t(N){return wl(N,e)}ns!==null&&wl(ns,e),ls!==null&&wl(ls,e),as!==null&&wl(as,e),ln.forEach(t),an.forEach(t);for(var i=0;i<os.length;i++){var s=os[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<os.length&&(i=os[0],i.blockedOn===null);)Rf(i),i.blockedOn===null&&os.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],m=r[gt]||null;if(typeof n=="function")m||Lf(i);else if(m){var R=null;if(n&&n.hasAttribute("formAction")){if(r=n,m=n[gt]||null)R=m.formAction;else if(Oo(r)!==null)continue}else R=m.action;typeof R=="function"?i[s+1]=R:(i.splice(s,3),s-=3),Lf(i)}}}function Bf(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Ho(e){this._internalRoot=e}Dl.prototype.render=Ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));var i=t.current,s=It();Ef(i,s,e,t,null,null)},Dl.prototype.unmount=Ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ef(e.current,2,null,e,null,null),ll(),t[qi]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var t=pr();e={blockedOn:null,target:e,priority:t};for(var i=0;i<os.length&&t!==0&&t<os[i].priority;i++);os.splice(i,0,e),i===0&&Rf(e)}};var Of=he.version;if(Of!=="19.2.4")throw Error(G(527,Of,"19.2.4"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=d(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var av={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Al.isDisabled&&Al.supportsFiber)try{At=Al.inject(av),Ne=Al}catch{}}return un.createRoot=function(e,t){if(!ce(e))throw Error(G(299));var i=!1,s="",r=ju,n=qu,m=Ku;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=bf(e,1,!1,null,null,i,s,null,r,n,m,Bf),e[qi]=t.current,mo(e),new Ho(t)},un.hydrateRoot=function(e,t,i){if(!ce(e))throw Error(G(299));var s=!1,r="",n=ju,m=qu,R=Ku,N=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(R=i.onRecoverableError),i.formState!==void 0&&(N=i.formState)),t=bf(e,1,!0,t,i??null,s,r,N,n,m,R,Bf),t.context=Cf(null),i=t.current,s=It(),s=ai(s),r=Vi(s),r.callback=null,Pi(i,r,s),i=s,t.current.lanes=i,ji(t,i),mi(t),e[qi]=t.current,mo(e),new Dl(t)},un.version="19.2.4",un}var Yf;function pv(){if(Yf)return Uo.exports;Yf=1;function k(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k)}catch(he){console.error(he)}}return k(),Uo.exports=gv(),Uo.exports}var Sv=pv();const yv=Jf(Sv);var Io={exports:{}},Gf;function bv(){return Gf||(Gf=1,(function(k,he){(function(ye,G){k.exports=G()})(self,(()=>(()=>{var ye={};return(()=>{var G=ye;Object.defineProperty(G,"__esModule",{value:!0}),G.FitAddon=void 0,G.FitAddon=class{activate(ce){this._terminal=ce}dispose(){}fit(){const ce=this.proposeDimensions();if(!ce||!this._terminal||isNaN(ce.cols)||isNaN(ce.rows))return;const me=this._terminal._core;this._terminal.rows===ce.rows&&this._terminal.cols===ce.cols||(me._renderService.clear(),this._terminal.resize(ce.cols,ce.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const ce=this._terminal._core,me=ce._renderService.dimensions;if(me.css.cell.width===0||me.css.cell.height===0)return;const F=this._terminal.options.scrollback===0?0:ce.viewport.scrollBarWidth,u=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(u.getPropertyValue("height")),d=Math.max(0,parseInt(u.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),h=f-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),p=d-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-F;return{cols:Math.max(2,Math.floor(p/me.css.cell.width)),rows:Math.max(1,Math.floor(h/me.css.cell.height))}}}})(),ye})()))})(Io)),Io.exports}var Cv=bv(),Yo={exports:{}},Ff;function Ev(){return Ff||(Ff=1,(function(k,he){(function(ye,G){k.exports=G()})(self,(()=>(()=>{var ye={4567:function(F,u,f){var d=this&&this.__decorate||function(a,_,g,C){var x,v=arguments.length,E=v<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,g):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,_,g,C);else for(var B=a.length-1;B>=0;B--)(x=a[B])&&(E=(v<3?x(E):v>3?x(_,g,E):x(_,g))||E);return v>3&&E&&Object.defineProperty(_,g,E),E},y=this&&this.__param||function(a,_){return function(g,C){_(g,C,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.AccessibilityManager=void 0;const h=f(9042),p=f(6114),b=f(9924),D=f(844),S=f(5596),l=f(4725),c=f(3656);let o=u.AccessibilityManager=class extends D.Disposable{constructor(a,_){super(),this._terminal=a,this._renderService=_,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let g=0;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);if(this._topBoundaryFocusListener=g=>this._handleBoundaryFocus(g,0),this._bottomBoundaryFocusListener=g=>this._handleBoundaryFocus(g,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((g=>this._handleResize(g.rows)))),this.register(this._terminal.onRender((g=>this._refreshRows(g.start,g.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((g=>this._handleChar(g)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
10
+ `)))),this.register(this._terminal.onA11yTab((g=>this._handleTab(g)))),this.register(this._terminal.onKey((g=>this._handleKey(g.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new S.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,c.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,D.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let _=0;_<a;_++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
11
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)),p.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,p.isMac&&this._liveRegion.remove()}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,_){this._liveRegionDebouncer.refresh(a,_,this._terminal.rows)}_renderRows(a,_){const g=this._terminal.buffer,C=g.lines.length.toString();for(let x=a;x<=_;x++){const v=g.translateBufferLineToString(g.ydisp+x,!0),E=(g.ydisp+x+1).toString(),B=this._rowElements[x];B&&(v.length===0?B.innerText=" ":B.textContent=v,B.setAttribute("aria-posinset",E),B.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,_){const g=a.target,C=this._rowElements[_===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==C)return;let x,v;if(_===0?(x=g,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(x=this._rowElements.shift(),v=g,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=document.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};u.AccessibilityManager=o=d([y(1,l.IRenderService)],o)},3614:(F,u)=>{function f(p){return p.replace(/\r?\n/g,"\r")}function d(p,b){return b?"\x1B[200~"+p+"\x1B[201~":p}function y(p,b,D,S){p=d(p=f(p),D.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),D.triggerDataEvent(p,!0),b.value=""}function h(p,b,D){const S=D.getBoundingClientRect(),l=p.clientX-S.left-10,c=p.clientY-S.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${l}px`,b.style.top=`${c}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(u,"__esModule",{value:!0}),u.rightClickHandler=u.moveTextAreaUnderMouseCursor=u.paste=u.handlePasteEvent=u.copyHandler=u.bracketTextForPaste=u.prepareTextForTerminal=void 0,u.prepareTextForTerminal=f,u.bracketTextForPaste=d,u.copyHandler=function(p,b){p.clipboardData&&p.clipboardData.setData("text/plain",b.selectionText),p.preventDefault()},u.handlePasteEvent=function(p,b,D,S){p.stopPropagation(),p.clipboardData&&y(p.clipboardData.getData("text/plain"),b,D,S)},u.paste=y,u.moveTextAreaUnderMouseCursor=h,u.rightClickHandler=function(p,b,D,S,l){h(p,b,D),l&&S.rightClickSelect(p),b.value=S.selectionText,b.select()}},7239:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorContrastCache=void 0;const d=f(1505);u.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(y,h,p){this._css.set(y,h,p)}getCss(y,h){return this._css.get(y,h)}setColor(y,h,p){this._color.set(y,h,p)}getColor(y,h){return this._color.get(y,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.addDisposableDomListener=void 0,u.addDisposableDomListener=function(f,d,y,h){f.addEventListener(d,y,h);let p=!1;return{dispose:()=>{p||(p=!0,f.removeEventListener(d,y,h))}}}},6465:function(F,u,f){var d=this&&this.__decorate||function(l,c,o,a){var _,g=arguments.length,C=g<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,o,a);else for(var x=l.length-1;x>=0;x--)(_=l[x])&&(C=(g<3?_(C):g>3?_(c,o,C):_(c,o))||C);return g>3&&C&&Object.defineProperty(c,o,C),C},y=this&&this.__param||function(l,c){return function(o,a){c(o,a,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Linkifier2=void 0;const h=f(3656),p=f(8460),b=f(844),D=f(2585);let S=u.Linkifier2=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(l){super(),this._bufferService=l,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(l){return this._linkProviders.push(l),{dispose:()=>{const c=this._linkProviders.indexOf(l);c!==-1&&this._linkProviders.splice(c,1)}}}attachToDom(l,c,o){this._element=l,this._mouseService=c,this._renderService=o,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){if(this._lastMouseEvent=l,!this._element||!this._mouseService)return;const c=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!c)return;this._isMouseOut=!1;const o=l.composedPath();for(let a=0;a<o.length;a++){const _=o[a];if(_.classList.contains("xterm"))break;if(_.classList.contains("xterm-hover"))return}this._lastBufferCell&&c.x===this._lastBufferCell.x&&c.y===this._lastBufferCell.y||(this._handleHover(c),this._lastBufferCell=c)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,c){var o,a;this._activeProviderReplies&&c||((o=this._activeProviderReplies)===null||o===void 0||o.forEach((g=>{g?.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=l.y);let _=!1;for(const[g,C]of this._linkProviders.entries())c?!((a=this._activeProviderReplies)===null||a===void 0)&&a.get(g)&&(_=this._checkLinkProviderResult(g,l,_)):C.provideLinks(l.y,(x=>{var v,E;if(this._isMouseOut)return;const B=x?.map((z=>({link:z})));(v=this._activeProviderReplies)===null||v===void 0||v.set(g,B),_=this._checkLinkProviderResult(g,l,_),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)}))}_removeIntersectingLinks(l,c){const o=new Set;for(let a=0;a<c.size;a++){const _=c.get(a);if(_)for(let g=0;g<_.length;g++){const C=_[g],x=C.link.range.start.y<l?0:C.link.range.start.x,v=C.link.range.end.y>l?this._bufferService.cols:C.link.range.end.x;for(let E=x;E<=v;E++){if(o.has(E)){_.splice(g--,1);break}o.add(E)}}}}_checkLinkProviderResult(l,c,o){var a;if(!this._activeProviderReplies)return o;const _=this._activeProviderReplies.get(l);let g=!1;for(let C=0;C<l;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(g=!0);if(!g&&_){const C=_.find((x=>this._linkAtPosition(x.link,c)));C&&(o=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let C=0;C<this._activeProviderReplies.size;C++){const x=(a=this._activeProviderReplies.get(C))===null||a===void 0?void 0:a.find((v=>this._linkAtPosition(v.link,c)));if(x){o=!0,this._handleNewLink(x);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._element||!this._mouseService||!this._currentLink)return;const c=this._positionFromMouseEvent(l,this._element,this._mouseService);c&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,c)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,c){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!c||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=c)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._linkAtPosition(l.link,c)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var o,a;return(a=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||a===void 0?void 0:a.decorations.pointerCursor},set:o=>{var a,_;!((a=this._currentLink)===null||a===void 0)&&a.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&((_=this._element)===null||_===void 0||_.classList.toggle("xterm-cursor-pointer",o)))}},underline:{get:()=>{var o,a;return(a=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||a===void 0?void 0:a.decorations.underline},set:o=>{var a,_,g;!((a=this._currentLink)===null||a===void 0)&&a.state&&((g=(_=this._currentLink)===null||_===void 0?void 0:_.state)===null||g===void 0?void 0:g.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,o))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((o=>{if(!this._currentLink)return;const a=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,_=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=_&&(this._clearCurrentLink(a,_),this._lastMouseEvent&&this._element)){const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._askForLink(g,!1)}}))))}_linkHover(l,c,o){var a;!((a=this._currentLink)===null||a===void 0)&&a.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),c.hover&&c.hover(o,c.text)}_fireUnderlineEvent(l,c){const o=l.range,a=this._bufferService.buffer.ydisp,_=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-a-1,o.end.x,o.end.y-a-1,void 0);(c?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(_)}_linkLeave(l,c,o){var a;!((a=this._currentLink)===null||a===void 0)&&a.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),c.leave&&c.leave(o,c.text)}_linkAtPosition(l,c){const o=l.range.start.y*this._bufferService.cols+l.range.start.x,a=l.range.end.y*this._bufferService.cols+l.range.end.x,_=c.y*this._bufferService.cols+c.x;return o<=_&&_<=a}_positionFromMouseEvent(l,c,o){const a=o.getCoords(l,c,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,c,o,a,_){return{x1:l,y1:c,x2:o,y2:a,cols:this._bufferService.cols,fg:_}}};u.Linkifier2=S=d([y(0,D.IBufferService)],S)},9042:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.tooMuchOutput=u.promptLabel=void 0,u.promptLabel="Terminal input",u.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(F,u,f){var d=this&&this.__decorate||function(S,l,c,o){var a,_=arguments.length,g=_<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,l,c,o);else for(var C=S.length-1;C>=0;C--)(a=S[C])&&(g=(_<3?a(g):_>3?a(l,c,g):a(l,c))||g);return _>3&&g&&Object.defineProperty(l,c,g),g},y=this&&this.__param||function(S,l){return function(c,o){l(c,o,S)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkProvider=void 0;const h=f(511),p=f(2585);let b=u.OscLinkProvider=class{constructor(S,l,c){this._bufferService=S,this._optionsService=l,this._oscLinkService=c}provideLinks(S,l){var c;const o=this._bufferService.buffer.lines.get(S-1);if(!o)return void l(void 0);const a=[],_=this._optionsService.rawOptions.linkHandler,g=new h.CellData,C=o.getTrimmedLength();let x=-1,v=-1,E=!1;for(let B=0;B<C;B++)if(v!==-1||o.hasContent(B)){if(o.loadCell(B,g),g.hasExtendedAttrs()&&g.extended.urlId){if(v===-1){v=B,x=g.extended.urlId;continue}E=g.extended.urlId!==x}else v!==-1&&(E=!0);if(E||v!==-1&&B===C-1){const z=(c=this._oscLinkService.getLinkData(x))===null||c===void 0?void 0:c.uri;if(z){const L={start:{x:v+1,y:S},end:{x:B+(E||B!==C-1?0:1),y:S}};let U=!1;if(!_?.allowNonHttpProtocols)try{const ee=new URL(z);["http:","https:"].includes(ee.protocol)||(U=!0)}catch{U=!0}U||a.push({text:z,range:L,activate:(ee,W)=>_?_.activate(ee,W,L):D(0,W),hover:(ee,W)=>{var H;return(H=_?.hover)===null||H===void 0?void 0:H.call(_,ee,W,L)},leave:(ee,W)=>{var H;return(H=_?.leave)===null||H===void 0?void 0:H.call(_,ee,W,L)}})}E=!1,g.hasExtendedAttrs()&&g.extended.urlId?(v=B,x=g.extended.urlId):(v=-1,x=-1)}}l(a)}};function D(S,l){if(confirm(`Do you want to navigate to ${l}?
12
+
13
+ WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}u.OscLinkProvider=b=d([y(0,p.IBufferService),y(1,p.IOptionsService),y(2,p.IOscLinkService)],b)},6193:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.RenderDebouncer=void 0,u.RenderDebouncer=class{constructor(f,d){this._parentWindow=f,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(f){return this._refreshCallbacks.push(f),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(f,d,y){this._rowCount=y,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},5596:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ScreenDprMonitor=void 0;const d=f(844);class y extends d.Disposable{constructor(p){super(),this._parentWindow=p,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)((()=>{this.clearListener()})))}setListener(p){this._listener&&this.clearListener(),this._listener=p,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)===null||p===void 0||p.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}u.ScreenDprMonitor=y},3236:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const d=f(3614),y=f(3656),h=f(6465),p=f(9042),b=f(3730),D=f(1680),S=f(3107),l=f(5744),c=f(2950),o=f(1296),a=f(428),_=f(4269),g=f(5114),C=f(8934),x=f(3230),v=f(9312),E=f(4725),B=f(6731),z=f(8055),L=f(8969),U=f(8460),ee=f(844),W=f(6114),H=f(8437),I=f(2584),A=f(7399),M=f(5941),O=f(9074),w=f(2585),j=f(5435),Z=f(4567),se=typeof window<"u"?window.document:null;class ae extends L.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(T={}){super(T),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ee.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(h.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(w.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((X,J)=>this.refresh(X,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((X=>this._reportWindowsOptions(X)))),this.register(this._inputHandler.onColor((X=>this._handleColorEvent(X)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((X=>this._afterResize(X.cols,X.rows)))),this.register((0,ee.toDisposable)((()=>{var X,J;this._customKeyEventHandler=void 0,(J=(X=this.element)===null||X===void 0?void 0:X.parentNode)===null||J===void 0||J.removeChild(this.element)})))}_handleColorEvent(T){if(this._themeService)for(const X of T){let J,ie="";switch(X.index){case 256:J="foreground",ie="10";break;case 257:J="background",ie="11";break;case 258:J="cursor",ie="12";break;default:J="ansi",ie="4;"+X.index}switch(X.type){case 0:const Se=z.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[X.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${I.C0.ESC}]${ie};${(0,M.toRgbString)(Se)}${I.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((oe=>oe.ansi[X.index]=z.rgba.toColor(...X.color)));else{const oe=J;this._themeService.modifyColors((xe=>xe[oe]=z.rgba.toColor(...X.color)))}break;case 2:this._themeService.restoreColor(X.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.C0.ESC+"[I"),this.updateCursorStyle(T),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)===null||T===void 0?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const T=this.buffer.ybase+this.buffer.y,X=this.buffer.lines.get(T);if(!X)return;const J=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,Se=X.getWidth(J),oe=this._renderService.dimensions.css.cell.width*Se,xe=this.buffer.y*this._renderService.dimensions.css.cell.height,qe=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=qe+"px",this.textarea.style.top=xe+"px",this.textarea.style.width=oe+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(X=>{this.hasSelection()&&(0,d.copyHandler)(X,this._selectionService)})));const T=X=>(0,d.handlePasteEvent)(X,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,y.addDisposableDomListener)(this.element,"paste",T)),W.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(X=>{X.button===2&&(0,d.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(X=>{(0,d.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(X=>{X.button===1&&(0,d.moveTextAreaUnderMouseCursor)(X,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(T=>this._keyUp(T)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(T=>this._keyDown(T)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(T=>this._keyPress(T)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(T=>this._compositionHelper.compositionupdate(T)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(T=>this._inputEvent(T)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(T){var X;if(!T)throw new Error("Terminal requires a parent element.");T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=T.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),T.appendChild(this.element);const J=se.createDocumentFragment();this._viewportElement=se.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),J.appendChild(this._viewportElement),this._viewportScrollArea=se.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=se.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=se.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),J.appendChild(this.screenElement),this.textarea=se.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(g.CoreBrowserService,this.textarea,(X=this._document.defaultView)!==null&&X!==void 0?X:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ie=>this._handleTextAreaFocus(ie)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ie=>this._onRender.fire(ie)))),this.onResize((ie=>this._renderService.resize(ie.cols,ie.rows))),this._compositionView=se.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(J);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(D.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ie=>this._renderService.handleSelectionChanged(ie.start,ie.end,ie.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ie=>{this.textarea.value=ie,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ie=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ie=>this._selectionService.handleMouseDown(ie)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ie=>this._handleScreenReaderModeOptionChange(ie)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ie=>{!this._overviewRulerRenderer&&ie&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const T=this,X=this.element;function J(oe){const xe=T._mouseService.getMouseReportCoords(oe,T.screenElement);if(!xe)return!1;let qe,Ye;switch(oe.overrideType||oe.type){case"mousemove":Ye=32,oe.buttons===void 0?(qe=3,oe.button!==void 0&&(qe=oe.button<3?oe.button:3)):qe=1&oe.buttons?0:4&oe.buttons?1:2&oe.buttons?2:3;break;case"mouseup":Ye=0,qe=oe.button<3?oe.button:3;break;case"mousedown":Ye=1,qe=oe.button<3?oe.button:3;break;case"wheel":if(T.viewport.getLinesScrolled(oe)===0)return!1;Ye=oe.deltaY<0?0:1,qe=4;break;default:return!1}return!(Ye===void 0||qe===void 0||qe>4)&&T.coreMouseService.triggerMouseEvent({col:xe.col,row:xe.row,x:xe.x,y:xe.y,button:qe,action:Ye,ctrl:oe.ctrlKey,alt:oe.altKey,shift:oe.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:oe=>(J(oe),oe.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(oe)),wheel:oe=>(J(oe),this.cancel(oe,!0)),mousedrag:oe=>{oe.buttons&&J(oe)},mousemove:oe=>{oe.buttons||J(oe)}};this.register(this.coreMouseService.onProtocolChange((oe=>{oe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(oe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&oe?ie.mousemove||(X.addEventListener("mousemove",Se.mousemove),ie.mousemove=Se.mousemove):(X.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&oe?ie.wheel||(X.addEventListener("wheel",Se.wheel,{passive:!1}),ie.wheel=Se.wheel):(X.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&oe?ie.mouseup||(X.addEventListener("mouseup",Se.mouseup),ie.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),X.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&oe?ie.mousedrag||(ie.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(X,"mousedown",(oe=>{if(oe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(oe))return J(oe),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(oe)}))),this.register((0,y.addDisposableDomListener)(X,"wheel",(oe=>{if(!ie.wheel){if(!this.buffer.hasScrollback){const xe=this.viewport.getLinesScrolled(oe);if(xe===0)return;const qe=I.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let Ye="";for(let ht=0;ht<Math.abs(xe);ht++)Ye+=qe;return this.coreService.triggerDataEvent(Ye,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(X,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(X,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(T,X){var J;(J=this._renderService)===null||J===void 0||J.refreshRows(T,X)}updateCursorStyle(T){var X;!((X=this._selectionService)===null||X===void 0)&&X.shouldColumnSelect(T)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(T,X,J=0){var ie;J===1?(super.scrollLines(T,X,J),this.refresh(0,this.rows-1)):(ie=this.viewport)===null||ie===void 0||ie.scrollLines(T)}paste(T){(0,d.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}registerLinkProvider(T){return this.linkifier2.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const X=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),X}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,X,J){this._selectionService.setSelection(T,X,J)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var T;(T=this._selectionService)===null||T===void 0||T.clearSelection()}selectAll(){var T;(T=this._selectionService)===null||T===void 0||T.selectAll()}selectLines(T,X){var J;(J=this._selectionService)===null||J===void 0||J.selectLines(T,X)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const X=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!X&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;X||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,A.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),J.type===3||J.type===2){const ie=this.rows-1;return this.scrollLines(J.type===2?-ie:ie),this.cancel(T,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(J.cancel&&this.cancel(T,!0),!J.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==I.C0.ETX&&J.key!==I.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,X){const J=T.isMac&&!this.options.macOptionIsMeta&&X.altKey&&!X.ctrlKey&&!X.metaKey||T.isWindows&&X.altKey&&X.ctrlKey&&!X.metaKey||T.isWindows&&X.getModifierState("AltGraph");return X.type==="keypress"?J:J&&(!X.keyCode||X.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||((function(X){return X.keyCode===16||X.keyCode===17||X.keyCode===18})(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let X;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)X=T.charCode;else if(T.which===null||T.which===void 0)X=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;X=T.which}return!(!X||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(X=String.fromCharCode(X),this._onKey.fire({key:X,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(X,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const X=T.data;return this.coreService.triggerDataEvent(X,!0),this.cancel(T),!0}return!1}resize(T,X){T!==this.cols||X!==this.rows?super.resize(T,X):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,X){var J,ie;(J=this._charSizeService)===null||J===void 0||J.measure(),(ie=this.viewport)===null||ie===void 0||ie.syncScrollArea(!0)}clear(){var T;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)===null||T===void 0||T.reset(),this.refresh(0,this.rows-1)}}reset(){var T,X;this.options.rows=this.rows,this.options.cols=this.cols;const J=this._customKeyEventHandler;this._setup(),super.reset(),(T=this._selectionService)===null||T===void 0||T.reset(),this._decorationService.reset(),(X=this.viewport)===null||X===void 0||X.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)===null||T===void 0||T.clearTextureAtlas()}_reportFocus(){var T;!((T=this.element)===null||T===void 0)&&T.classList.contains("focus")?this.coreService.triggerDataEvent(I.C0.ESC+"[I"):this.coreService.triggerDataEvent(I.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const X=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${I.C0.ESC}[4;${J};${X}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${I.C0.ESC}[6;${Se};${ie}t`)}}cancel(T,X){if(this.options.cancelEvents||X)return T.preventDefault(),T.stopPropagation(),!1}}u.Terminal=ae},9924:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TimeBasedDebouncer=void 0,u.TimeBasedDebouncer=class{constructor(f,d=1e3){this._renderCallback=f,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,d,y){this._rowCount=y,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=h-this._lastRefreshMs,b=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d)}}},1680:function(F,u,f){var d=this&&this.__decorate||function(c,o,a,_){var g,C=arguments.length,x=C<3?o:_===null?_=Object.getOwnPropertyDescriptor(o,a):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,a,_);else for(var v=c.length-1;v>=0;v--)(g=c[v])&&(x=(C<3?g(x):C>3?g(o,a,x):g(o,a))||x);return C>3&&x&&Object.defineProperty(o,a,x),x},y=this&&this.__param||function(c,o){return function(a,_){o(a,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Viewport=void 0;const h=f(3656),p=f(4725),b=f(8460),D=f(844),S=f(2585);let l=u.Viewport=class extends D.Disposable{constructor(c,o,a,_,g,C,x,v){super(),this._viewportElement=c,this._scrollArea=o,this._bufferService=a,this._optionsService=_,this._charSizeService=g,this._renderService=C,this._coreBrowserService=x,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((E=>this._activeBuffer=E.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((E=>this._renderDimensions=E))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((E=>this._handleThemeChange(E)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(c){if(c)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(c,o){const a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&a<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const o=this._getPixelsScrolled(c);return o!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(c,o){var a;let _,g="";const C=[],x=o??this._bufferService.buffer.lines.length,v=this._bufferService.buffer.lines;for(let E=c;E<x;E++){const B=v.get(E);if(!B)continue;const z=(a=v.get(E+1))===null||a===void 0?void 0:a.isWrapped;if(g+=B.translateToString(!z),!z||E===v.length-1){const L=document.createElement("div");L.textContent=g,C.push(L),g.length>0&&(_=L),g=""}}return{bufferElements:C,cursorElement:_}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(c,o){const a=this._optionsService.rawOptions.fastScrollModifier;return a==="alt"&&o.altKey||a==="ctrl"&&o.ctrlKey||a==="shift"&&o.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const o=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}};u.Viewport=l=d([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,p.ICharSizeService),y(5,p.IRenderService),y(6,p.ICoreBrowserService),y(7,p.IThemeService)],l)},3107:function(F,u,f){var d=this&&this.__decorate||function(l,c,o,a){var _,g=arguments.length,C=g<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,o,a);else for(var x=l.length-1;x>=0;x--)(_=l[x])&&(C=(g<3?_(C):g>3?_(c,o,C):_(c,o))||C);return g>3&&C&&Object.defineProperty(c,o,C),C},y=this&&this.__param||function(l,c){return function(o,a){c(o,a,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferDecorationRenderer=void 0;const h=f(3656),p=f(4725),b=f(844),D=f(2585);let S=u.BufferDecorationRenderer=class extends b.Disposable{constructor(l,c,o,a){super(),this._screenElement=l,this._bufferService=c,this._decorationService=o,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,h.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const l of this._decorationService.decorations)this._renderDecoration(l);this._dimensionsChanged=!1}_renderDecoration(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)}_createElement(l){var c,o;const a=document.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",((c=l?.options)===null||c===void 0?void 0:c.layer)==="top"),a.style.width=`${Math.round((l.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(l.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=(o=l.options.x)!==null&&o!==void 0?o:0;return _&&_>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(l,a),a}_refreshStyle(l){const c=l.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{let o=this._decorationElements.get(l);o||(o=this._createElement(l),l.element=o,this._decorationElements.set(l,o),this._container.appendChild(o),l.onDispose((()=>{this._decorationElements.delete(l),o.remove()}))),o.style.top=c*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(o)}}_refreshXPosition(l,c=l.element){var o;if(!c)return;const a=(o=l.options.x)!==null&&o!==void 0?o:0;(l.options.anchor||"left")==="right"?c.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(l){var c;(c=this._decorationElements.get(l))===null||c===void 0||c.remove(),this._decorationElements.delete(l),l.dispose()}};u.BufferDecorationRenderer=S=d([y(1,D.IBufferService),y(2,D.IDecorationService),y(3,p.IRenderService)],S)},5871:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorZoneStore=void 0,u.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(f){if(f.options.overviewRulerOptions){for(const d of this._zones)if(d.color===f.options.overviewRulerOptions.color&&d.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,f.marker.line))return;if(this._lineAdjacentToZone(d,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(d,f.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=f.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=f.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=f.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=f.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:f.options.overviewRulerOptions.color,position:f.options.overviewRulerOptions.position,startBufferLine:f.marker.line,endBufferLine:f.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(f){this._linePadding=f}_lineIntersectsZone(f,d){return d>=f.startBufferLine&&d<=f.endBufferLine}_lineAdjacentToZone(f,d,y){return d>=f.startBufferLine-this._linePadding[y||"full"]&&d<=f.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(f,d){f.startBufferLine=Math.min(f.startBufferLine,d),f.endBufferLine=Math.max(f.endBufferLine,d)}}},5744:function(F,u,f){var d=this&&this.__decorate||function(_,g,C,x){var v,E=arguments.length,B=E<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(_,g,C,x);else for(var z=_.length-1;z>=0;z--)(v=_[z])&&(B=(E<3?v(B):E>3?v(g,C,B):v(g,C))||B);return E>3&&B&&Object.defineProperty(g,C,B),B},y=this&&this.__param||function(_,g){return function(C,x){g(C,x,_)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OverviewRulerRenderer=void 0;const h=f(5871),p=f(3656),b=f(4725),D=f(844),S=f(2585),l={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let a=u.OverviewRulerRenderer=class extends D.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,g,C,x,v,E,B){var z;super(),this._viewportElement=_,this._screenElement=g,this._bufferService=C,this._decorationService=x,this._renderService=v,this._optionsService=E,this._coreBrowseService=B,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)===null||z===void 0||z.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,D.toDisposable)((()=>{var U;(U=this._canvas)===null||U===void 0||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register((0,p.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),g=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=_,c.center=g,c.right=_,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=c.left,o.right=c.left+c.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,g=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowseService.dpr);l.left=g,l.center=g,l.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const g of this._decorationService.decorations)this._colorZoneStore.addDecoration(g);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const g of _)g.position!=="full"&&this._renderColorZone(g);for(const g of _)g.position==="full"&&this._renderColorZone(g);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(o[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-l[_.position||"full"]/2),c[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[_.position||"full"]))}_queueRefresh(_,g){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=g||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u.OverviewRulerRenderer=a=d([y(2,S.IBufferService),y(3,S.IDecorationService),y(4,b.IRenderService),y(5,S.IOptionsService),y(6,b.ICoreBrowserService)],a)},2950:function(F,u,f){var d=this&&this.__decorate||function(S,l,c,o){var a,_=arguments.length,g=_<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(S,l,c,o);else for(var C=S.length-1;C>=0;C--)(a=S[C])&&(g=(_<3?a(g):_>3?a(l,c,g):a(l,c))||g);return _>3&&g&&Object.defineProperty(l,c,g),g},y=this&&this.__param||function(S,l){return function(c,o){l(c,o,S)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CompositionHelper=void 0;const h=f(4725),p=f(2585),b=f(2584);let D=u.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,l,c,o,a,_){this._textarea=S,this._compositionView=l,this._bufferService=c,this._optionsService=o,this._coreService=a,this._renderService=_,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const l=this._textarea.value,c=l.replace(S,"");this._dataAlreadySent=c,l.length>S.length?this._coreService.triggerDataEvent(c,!0):l.length<S.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):l.length===S.length&&l!==S&&this._coreService.triggerDataEvent(l,!0)}}),0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=l*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}S||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};u.CompositionHelper=D=d([y(2,p.IBufferService),y(3,p.IOptionsService),y(4,p.ICoreService),y(5,h.IRenderService)],D)},9806:(F,u)=>{function f(d,y,h){const p=h.getBoundingClientRect(),b=d.getComputedStyle(h),D=parseInt(b.getPropertyValue("padding-left")),S=parseInt(b.getPropertyValue("padding-top"));return[y.clientX-p.left-D,y.clientY-p.top-S]}Object.defineProperty(u,"__esModule",{value:!0}),u.getCoords=u.getCoordsRelativeToElement=void 0,u.getCoordsRelativeToElement=f,u.getCoords=function(d,y,h,p,b,D,S,l,c){if(!D)return;const o=f(d,y,h);return o?(o[0]=Math.ceil((o[0]+(c?S/2:0))/S),o[1]=Math.ceil(o[1]/l),o[0]=Math.min(Math.max(o[0],1),p+(c?1:0)),o[1]=Math.min(Math.max(o[1],1),b),o):void 0}},9504:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.moveToCellSequence=void 0;const d=f(2584);function y(l,c,o,a){const _=l-h(l,o),g=c-h(c,o),C=Math.abs(_-g)-(function(x,v,E){let B=0;const z=x-h(x,E),L=v-h(v,E);for(let U=0;U<Math.abs(z-L);U++){const ee=p(x,v)==="A"?-1:1,W=E.buffer.lines.get(z+ee*U);W?.isWrapped&&B++}return B})(l,c,o);return S(C,D(p(l,c),a))}function h(l,c){let o=0,a=c.buffer.lines.get(l),_=a?.isWrapped;for(;_&&l>=0&&l<c.rows;)o++,a=c.buffer.lines.get(--l),_=a?.isWrapped;return o}function p(l,c){return l>c?"A":"B"}function b(l,c,o,a,_,g){let C=l,x=c,v="";for(;C!==o||x!==a;)C+=_?1:-1,_&&C>g.cols-1?(v+=g.buffer.translateBufferLineToString(x,!1,l,C),C=0,l=0,x++):!_&&C<0&&(v+=g.buffer.translateBufferLineToString(x,!1,0,l+1),C=g.cols-1,l=C,x--);return v+g.buffer.translateBufferLineToString(x,!1,l,C)}function D(l,c){const o=c?"O":"[";return d.C0.ESC+o+l}function S(l,c){l=Math.floor(l);let o="";for(let a=0;a<l;a++)o+=c;return o}u.moveToCellSequence=function(l,c,o,a){const _=o.buffer.x,g=o.buffer.y;if(!o.buffer.hasScrollback)return(function(v,E,B,z,L,U){return y(E,z,L,U).length===0?"":S(b(v,E,v,E-h(E,L),!1,L).length,D("D",U))})(_,g,0,c,o,a)+y(g,c,o,a)+(function(v,E,B,z,L,U){let ee;ee=y(E,z,L,U).length>0?z-h(z,L):E;const W=z,H=(function(I,A,M,O,w,j){let Z;return Z=y(M,O,w,j).length>0?O-h(O,w):A,I<M&&Z<=O||I>=M&&Z<O?"C":"D"})(v,E,B,z,L,U);return S(b(v,ee,B,W,H==="C",L).length,D(H,U))})(_,g,l,c,o,a);let C;if(g===c)return C=_>l?"D":"C",S(Math.abs(_-l),D(C,a));C=g>c?"D":"C";const x=Math.abs(g-c);return S((function(v,E){return E.cols-v})(g>c?l:_,o)+(x-1)*o.cols+1+((g>c?_:l)-1),D(C,a))}},1296:function(F,u,f){var d=this&&this.__decorate||function(L,U,ee,W){var H,I=arguments.length,A=I<3?U:W===null?W=Object.getOwnPropertyDescriptor(U,ee):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(L,U,ee,W);else for(var M=L.length-1;M>=0;M--)(H=L[M])&&(A=(I<3?H(A):I>3?H(U,ee,A):H(U,ee))||A);return I>3&&A&&Object.defineProperty(U,ee,A),A},y=this&&this.__param||function(L,U){return function(ee,W){U(ee,W,L)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRenderer=void 0;const h=f(3787),p=f(2550),b=f(2223),D=f(6171),S=f(4725),l=f(8055),c=f(8460),o=f(844),a=f(2585),_="xterm-dom-renderer-owner-",g="xterm-rows",C="xterm-fg-",x="xterm-bg-",v="xterm-focus",E="xterm-selection";let B=1,z=u.DomRenderer=class extends o.Disposable{constructor(L,U,ee,W,H,I,A,M,O,w){super(),this._element=L,this._screenElement=U,this._viewportElement=ee,this._linkifier2=W,this._charSizeService=I,this._optionsService=A,this._bufferService=M,this._coreBrowserService=O,this._themeService=w,this._terminalClass=B++,this._rowElements=[],this.onRequestRedraw=this.register(new c.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,D.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((j=>this._injectCss(j)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(_+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((j=>this._handleLinkHover(j)))),this.register(this._linkifier2.onHideLinkUnderline((j=>this._handleLinkLeave(j)))),this.register((0,o.toDisposable)((()=>{this._element.classList.remove(_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(L){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${g} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${g} .xterm-dim { color: ${l.color.multiplyOpacity(L.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,U+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",U+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,U+=`${this._terminalSelector} .${g}.${v} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${g}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,W]of L.ansi.entries())U+=`${this._terminalSelector} .${C}${ee} { color: ${W.css}; }${this._terminalSelector} .${C}${ee}.xterm-dim { color: ${l.color.multiplyOpacity(W,.5).css}; }${this._terminalSelector} .${x}${ee} { background-color: ${W.css}; }`;U+=`${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(L.background).css}; }${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${x}${b.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,U){for(let ee=this._rowElements.length;ee<=U;ee++){const W=document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,U){this._refreshRowElements(L,U),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,U,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,U,ee),this.renderRows(0,this._bufferService.rows-1),!L||!U)return;const W=L[1]-this._bufferService.buffer.ydisp,H=U[1]-this._bufferService.buffer.ydisp,I=Math.max(W,0),A=Math.min(H,this._bufferService.rows-1);if(I>=this._bufferService.rows||A<0)return;const M=document.createDocumentFragment();if(ee){const O=L[0]>U[0];M.appendChild(this._createSelectionElement(I,O?U[0]:L[0],O?L[0]:U[0],A-I+1))}else{const O=W===I?L[0]:0,w=I===H?U[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(I,O,w));const j=A-I-1;if(M.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,j)),I!==A){const Z=H===A?U[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(A,0,Z))}}this._selectionContainer.appendChild(M)}_createSelectionElement(L,U,ee,W=1){const H=document.createElement("div");return H.style.height=W*this.dimensions.css.cell.height+"px",H.style.top=L*this.dimensions.css.cell.height+"px",H.style.left=U*this.dimensions.css.cell.width+"px",H.style.width=this.dimensions.css.cell.width*(ee-U)+"px",H}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const L of this._rowElements)L.replaceChildren()}renderRows(L,U){const ee=this._bufferService.buffer,W=ee.ybase+ee.y,H=Math.min(ee.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=L;O<=U;O++){const w=O+ee.ydisp,j=this._rowElements[O],Z=ee.lines.get(w);if(!j||!Z)break;j.replaceChildren(...this._rowFactory.createRow(Z,w,w===W,A,M,H,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${_}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,U,ee,W,H,I){ee<0&&(L=0),W<0&&(U=0);const A=this._bufferService.rows-1;ee=Math.max(Math.min(ee,A),0),W=Math.max(Math.min(W,A),0),H=Math.min(H,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,w=Math.min(M.x,H-1),j=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,se=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=ee;ae<=W;++ae){const fe=ae+M.ydisp,T=this._rowElements[ae],X=M.lines.get(fe);if(!T||!X)break;T.replaceChildren(...this._rowFactory.createRow(X,fe,fe===O,Z,se,w,j,this.dimensions.css.cell.width,this._widthCache,I?ae===ee?L:0:-1,I?(ae===W?U:H)-1:-1))}}};u.DomRenderer=z=d([y(4,a.IInstantiationService),y(5,S.ICharSizeService),y(6,a.IOptionsService),y(7,a.IBufferService),y(8,S.ICoreBrowserService),y(9,S.IThemeService)],z)},3787:function(F,u,f){var d=this&&this.__decorate||function(C,x,v,E){var B,z=arguments.length,L=z<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,x,v,E);else for(var U=C.length-1;U>=0;U--)(B=C[U])&&(L=(z<3?B(L):z>3?B(x,v,L):B(x,v))||L);return z>3&&L&&Object.defineProperty(x,v,L),L},y=this&&this.__param||function(C,x){return function(v,E){x(v,E,C)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRendererRowFactory=void 0;const h=f(2223),p=f(643),b=f(511),D=f(2585),S=f(8055),l=f(4725),c=f(4269),o=f(6171),a=f(3734);let _=u.DomRendererRowFactory=class{constructor(C,x,v,E,B,z,L){this._document=C,this._characterJoinerService=x,this._optionsService=v,this._coreBrowserService=E,this._coreService=B,this._decorationService=z,this._themeService=L,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,x,v){this._selectionStart=C,this._selectionEnd=x,this._columnSelectMode=v}createRow(C,x,v,E,B,z,L,U,ee,W,H){const I=[],A=this._characterJoinerService.getJoinedCharacters(x),M=this._themeService.colors;let O,w=C.getNoBgTrimmedLength();v&&w<z+1&&(w=z+1);let j=0,Z="",se=0,ae=0,fe=0,T=!1,X=0,J=!1,ie=0;const Se=[],oe=W!==-1&&H!==-1;for(let xe=0;xe<w;xe++){C.loadCell(xe,this._workCell);let qe=this._workCell.getWidth();if(qe===0)continue;let Ye=!1,ht=xe,be=this._workCell;if(A.length>0&&xe===A[0][0]){Ye=!0;const Ue=A.shift();be=new c.JoinedCellData(this._workCell,C.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),ht=Ue[1]-1,qe=be.getWidth()}const Yt=this._isCellInSelection(xe,x),ii=v&&xe===z,si=oe&&xe>=W&&xe<=H;let ri=!1;this._decorationService.forEachDecorationAtCell(xe,x,void 0,(Ue=>{ri=!0}));let gi=be.getChars()||p.WHITESPACE_CELL_CHAR;if(gi===" "&&(be.isUnderline()||be.isOverline())&&(gi=" "),ie=qe*U-ee.get(gi,be.isBold(),be.isItalic()),O){if(j&&(Yt&&J||!Yt&&!J&&be.bg===se)&&(Yt&&J&&M.selectionForeground||be.fg===ae)&&be.extended.ext===fe&&si===T&&ie===X&&!ii&&!Ye&&!ri){Z+=gi,j++;continue}j&&(O.textContent=Z),O=this._document.createElement("span"),j=0,Z=""}else O=this._document.createElement("span");if(se=be.bg,ae=be.fg,fe=be.extended.ext,T=si,X=ie,J=Yt,Ye&&z>=xe&&z<=ht&&(z=xe),!this._coreService.isCursorHidden&&ii){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&Se.push("xterm-cursor-blink"),Se.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(be.isBold()&&Se.push("xterm-bold"),be.isItalic()&&Se.push("xterm-italic"),be.isDim()&&Se.push("xterm-dim"),Z=be.isInvisible()?p.WHITESPACE_CELL_CHAR:be.getChars()||p.WHITESPACE_CELL_CHAR,be.isUnderline()&&(Se.push(`xterm-underline-${be.extended.underlineStyle}`),Z===" "&&(Z=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${a.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Ue=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Ue<8&&(Ue+=8),O.style.textDecorationColor=M.ansi[Ue].css}be.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),be.isStrikethrough()&&Se.push("xterm-strikethrough"),si&&(O.style.textDecoration="underline");let _t=be.getFgColor(),$e=be.getFgColorMode(),Pe=be.getBgColor(),ni=be.getBgColorMode();const zi=!!be.isInverse();if(zi){const Ue=_t;_t=Pe,Pe=Ue;const At=$e;$e=ni,ni=At}let xt,Gt,Ct,li=!1;switch(this._decorationService.forEachDecorationAtCell(xe,x,void 0,(Ue=>{Ue.options.layer!=="top"&&li||(Ue.backgroundColorRGB&&(ni=50331648,Pe=Ue.backgroundColorRGB.rgba>>8&16777215,xt=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&($e=50331648,_t=Ue.foregroundColorRGB.rgba>>8&16777215,Gt=Ue.foregroundColorRGB),li=Ue.options.layer==="top")})),!li&&Yt&&(xt=this._coreBrowserService.isFocused?M.selectionBackgroundOpaque:M.selectionInactiveBackgroundOpaque,Pe=xt.rgba>>8&16777215,ni=50331648,li=!0,M.selectionForeground&&($e=50331648,_t=M.selectionForeground.rgba>>8&16777215,Gt=M.selectionForeground)),li&&Se.push("xterm-decoration-top"),ni){case 16777216:case 33554432:Ct=M.ansi[Pe],Se.push(`xterm-bg-${Pe}`);break;case 50331648:Ct=S.rgba.toColor(Pe>>16,Pe>>8&255,255&Pe),this._addStyle(O,`background-color:#${g((Pe>>>0).toString(16),"0",6)}`);break;default:zi?(Ct=M.foreground,Se.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=M.background}switch(xt||be.isDim()&&(xt=S.color.multiplyOpacity(Ct,.5)),$e){case 16777216:case 33554432:be.isBold()&&_t<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_t+=8),this._applyMinimumContrast(O,Ct,M.ansi[_t],be,xt,void 0)||Se.push(`xterm-fg-${_t}`);break;case 50331648:const Ue=S.rgba.toColor(_t>>16&255,_t>>8&255,255&_t);this._applyMinimumContrast(O,Ct,Ue,be,xt,Gt)||this._addStyle(O,`color:#${g(_t.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Ct,M.foreground,be,xt,void 0)||zi&&Se.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Se.length&&(O.className=Se.join(" "),Se.length=0),ii||Ye||ri?O.textContent=Z:j++,ie!==this.defaultSpacing&&(O.style.letterSpacing=`${ie}px`),I.push(O),xe=ht}return O&&j&&(O.textContent=Z),I}_applyMinimumContrast(C,x,v,E,B,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(E.getCode()))return!1;const L=this._getContrastCache(E);let U;if(B||z||(U=L.getColor(x.rgba,v.rgba)),U===void 0){const ee=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);U=S.color.ensureContrastRatio(B||x,z||v,ee),L.setColor((B||x).rgba,(z||v).rgba,U??null)}return!!U&&(this._addStyle(C,`color:${U.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,x){C.setAttribute("style",`${C.getAttribute("style")||""}${x};`)}_isCellInSelection(C,x){const v=this._selectionStart,E=this._selectionEnd;return!(!v||!E)&&(this._columnSelectMode?v[0]<=E[0]?C>=v[0]&&x>=v[1]&&C<E[0]&&x<=E[1]:C<v[0]&&x>=v[1]&&C>=E[0]&&x<=E[1]:x>v[1]&&x<E[1]||v[1]===E[1]&&x===v[1]&&C>=v[0]&&C<E[0]||v[1]<E[1]&&x===E[1]&&C<E[0]||v[1]<E[1]&&x===v[1]&&C>=v[0])}};function g(C,x,v){for(;C.length<v;)C=x+C;return C}u.DomRendererRowFactory=_=d([y(1,l.ICharacterJoinerService),y(2,D.IOptionsService),y(3,l.ICoreBrowserService),y(4,D.ICoreService),y(5,D.IDecorationService),y(6,l.IThemeService)],_)},2550:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WidthCache=void 0,u.WidthCache=class{constructor(f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=f.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=f.createElement("span"),y=f.createElement("span");y.style.fontWeight="bold";const h=f.createElement("span");h.style.fontStyle="italic";const p=f.createElement("span");p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[d,y,h,p],this._container.appendChild(d),this._container.appendChild(y),this._container.appendChild(h),this._container.appendChild(p),f.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(f,d,y,h){f===this._font&&d===this._fontSize&&y===this._weight&&h===this._weightBold||(this._font=f,this._fontSize=d,this._weight=y,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(f,d,y){let h=0;if(!d&&!y&&f.length===1&&(h=f.charCodeAt(0))<256)return this._flat[h]!==-9999?this._flat[h]:this._flat[h]=this._measure(f,0);let p=f;d&&(p+="B"),y&&(p+="I");let b=this._holey.get(p);if(b===void 0){let D=0;d&&(D|=1),y&&(D|=2),b=this._measure(f,D),this._holey.set(p,b)}return b}_measure(f,d){const y=this._measureElements[d];return y.textContent=f.repeat(32),y.offsetWidth/32}}},2223:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TEXT_BASELINE=u.DIM_OPACITY=u.INVERTED_DEFAULT_COLOR=void 0;const d=f(6114);u.INVERTED_DEFAULT_COLOR=257,u.DIM_OPACITY=.5,u.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(F,u)=>{function f(d){return 57508<=d&&d<=57558}Object.defineProperty(u,"__esModule",{value:!0}),u.createRenderDimensions=u.excludeFromContrastRatioDemands=u.isRestrictedPowerlineGlyph=u.isPowerlineGlyph=u.throwIfFalsy=void 0,u.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},u.isPowerlineGlyph=f,u.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},u.excludeFromContrastRatioDemands=function(d){return f(d)||(function(y){return 9472<=y&&y<=9631})(d)},u.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionModel=void 0,u.SelectionModel=class{constructor(f){this._bufferService=f,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?f%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)-1]:[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[Math.max(f,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const f=this.selectionStart,d=this.selectionEnd;return!(!f||!d)&&(f[1]>d[1]||f[1]===d[1]&&f[0]>d[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(F,u,f){var d=this&&this.__decorate||function(l,c,o,a){var _,g=arguments.length,C=g<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,o,a);else for(var x=l.length-1;x>=0;x--)(_=l[x])&&(C=(g<3?_(C):g>3?_(c,o,C):_(c,o))||C);return g>3&&C&&Object.defineProperty(c,o,C),C},y=this&&this.__param||function(l,c){return function(o,a){c(o,a,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharSizeService=void 0;const h=f(2585),p=f(8460),b=f(844);let D=u.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,c,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new S(l,c,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};u.CharSizeService=D=d([y(2,h.IOptionsService)],D);class S{constructor(c,o,a){this._document=c,this._parentElement=o,this._optionsService=a,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const c={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return c.width!==0&&c.height!==0&&(this._result.width=c.width/32,this._result.height=Math.ceil(c.height)),this._result}}},4269:function(F,u,f){var d=this&&this.__decorate||function(c,o,a,_){var g,C=arguments.length,x=C<3?o:_===null?_=Object.getOwnPropertyDescriptor(o,a):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,a,_);else for(var v=c.length-1;v>=0;v--)(g=c[v])&&(x=(C<3?g(x):C>3?g(o,a,x):g(o,a))||x);return C>3&&x&&Object.defineProperty(o,a,x),x},y=this&&this.__param||function(c,o){return function(a,_){o(a,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharacterJoinerService=u.JoinedCellData=void 0;const h=f(3734),p=f(643),b=f(511),D=f(2585);class S extends h.AttributeData{constructor(o,a,_){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=a,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.JoinedCellData=S;let l=u.CharacterJoinerService=class $f{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(o){const a={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(a),a.id}deregister(o){for(let a=0;a<this._characterJoiners.length;a++)if(this._characterJoiners[a].id===o)return this._characterJoiners.splice(a,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const a=this._bufferService.buffer.lines.get(o);if(!a||a.length===0)return[];const _=[],g=a.translateToString(!0);let C=0,x=0,v=0,E=a.getFg(0),B=a.getBg(0);for(let z=0;z<a.getTrimmedLength();z++)if(a.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==B){if(z-C>1){const L=this._getJoinedRanges(g,v,x,a,C);for(let U=0;U<L.length;U++)_.push(L[U])}C=z,v=x,E=this._workCell.fg,B=this._workCell.bg}x+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const z=this._getJoinedRanges(g,v,x,a,C);for(let L=0;L<z.length;L++)_.push(z[L])}return _}_getJoinedRanges(o,a,_,g,C){const x=o.substring(a,_);let v=[];try{v=this._characterJoiners[0].handler(x)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const B=this._characterJoiners[E].handler(x);for(let z=0;z<B.length;z++)$f._mergeRanges(v,B[z])}catch(B){console.error(B)}return this._stringRangesToCellRanges(v,g,C),v}_stringRangesToCellRanges(o,a,_){let g=0,C=!1,x=0,v=o[g];if(v){for(let E=_;E<this._bufferService.cols;E++){const B=a.getWidth(E),z=a.getString(E).length||p.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!C&&v[0]<=x&&(v[0]=E,C=!0),v[1]<=x){if(v[1]=E,v=o[++g],!v)break;v[0]<=x?(v[0]=E,C=!0):C=!1}x+=z}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(o,a){let _=!1;for(let g=0;g<o.length;g++){const C=o[g];if(_){if(a[1]<=C[0])return o[g-1][1]=a[1],o;if(a[1]<=C[1])return o[g-1][1]=Math.max(a[1],C[1]),o.splice(g,1),o;o.splice(g,1),g--}else{if(a[1]<=C[0])return o.splice(g,0,a),o;if(a[1]<=C[1])return C[0]=Math.min(a[0],C[0]),o;a[0]<C[1]&&(C[0]=Math.min(a[0],C[0]),_=!0)}}return _?o[o.length-1][1]=a[1]:o.push(a),o}};u.CharacterJoinerService=l=d([y(0,D.IBufferService)],l)},5114:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreBrowserService=void 0,u.CoreBrowserService=class{constructor(f,d){this._textarea=f,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}},8934:function(F,u,f){var d=this&&this.__decorate||function(D,S,l,c){var o,a=arguments.length,_=a<3?S:c===null?c=Object.getOwnPropertyDescriptor(S,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(D,S,l,c);else for(var g=D.length-1;g>=0;g--)(o=D[g])&&(_=(a<3?o(_):a>3?o(S,l,_):o(S,l))||_);return a>3&&_&&Object.defineProperty(S,l,_),_},y=this&&this.__param||function(D,S){return function(l,c){S(l,c,D)}};Object.defineProperty(u,"__esModule",{value:!0}),u.MouseService=void 0;const h=f(4725),p=f(9806);let b=u.MouseService=class{constructor(D,S){this._renderService=D,this._charSizeService=S}getCoords(D,S,l,c,o){return(0,p.getCoords)(window,D,S,l,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(D,S){const l=(0,p.getCoordsRelativeToElement)(window,D,S);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};u.MouseService=b=d([y(0,h.IRenderService),y(1,h.ICharSizeService)],b)},3230:function(F,u,f){var d=this&&this.__decorate||function(_,g,C,x){var v,E=arguments.length,B=E<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(_,g,C,x);else for(var z=_.length-1;z>=0;z--)(v=_[z])&&(B=(E<3?v(B):E>3?v(g,C,B):v(g,C))||B);return E>3&&B&&Object.defineProperty(g,C,B),B},y=this&&this.__param||function(_,g){return function(C,x){g(C,x,_)}};Object.defineProperty(u,"__esModule",{value:!0}),u.RenderService=void 0;const h=f(3656),p=f(6193),b=f(5596),D=f(4725),S=f(8460),l=f(844),c=f(7226),o=f(2585);let a=u.RenderService=class extends l.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,g,C,x,v,E,B,z){if(super(),this._rowCount=_,this._charSizeService=x,this._renderer=this.register(new l.MutableDisposable),this._pausedResizeTask=new c.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(B.window,((L,U)=>this._renderRows(L,U))),this.register(this._renderDebouncer),this._screenDprMonitor=new b.ScreenDprMonitor(B.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)===null||L===void 0?void 0:L.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(v.onDecorationRegistered((()=>this._fullRefresh()))),this.register(v.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register((0,h.addDisposableDomListener)(B.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(z.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in B.window){const L=new B.window.IntersectionObserver((U=>this._handleIntersectionChange(U[U.length-1])),{threshold:0});L.observe(g),this.register({dispose:()=>L.disconnect()})}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(_,g,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,g,this._rowCount))}_renderRows(_,g){this._renderer.value&&(_=Math.min(_,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(_,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:g}),this._onRender.fire({start:_,end:g}),this._isNextRenderRedrawOnly=!0)}resize(_,g){this._rowCount=g,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(_){this._renderer.value=_,this._renderer.value.onRequestRedraw((g=>this.refreshRows(g.start,g.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,g;this._renderer.value&&((g=(_=this._renderer.value).clearTextureAtlas)===null||g===void 0||g.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(_,g))):this._renderer.value.handleResize(_,g),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)===null||_===void 0||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)===null||_===void 0||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)===null||_===void 0||_.handleFocus()}handleSelectionChanged(_,g,C){var x;this._selectionState.start=_,this._selectionState.end=g,this._selectionState.columnSelectMode=C,(x=this._renderer.value)===null||x===void 0||x.handleSelectionChanged(_,g,C)}handleCursorMove(){var _;(_=this._renderer.value)===null||_===void 0||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)===null||_===void 0||_.clear()}};u.RenderService=a=d([y(2,o.IOptionsService),y(3,D.ICharSizeService),y(4,o.IDecorationService),y(5,o.IBufferService),y(6,D.ICoreBrowserService),y(7,D.IThemeService)],a)},9312:function(F,u,f){var d=this&&this.__decorate||function(v,E,B,z){var L,U=arguments.length,ee=U<3?E:z===null?z=Object.getOwnPropertyDescriptor(E,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(v,E,B,z);else for(var W=v.length-1;W>=0;W--)(L=v[W])&&(ee=(U<3?L(ee):U>3?L(E,B,ee):L(E,B))||ee);return U>3&&ee&&Object.defineProperty(E,B,ee),ee},y=this&&this.__param||function(v,E){return function(B,z){E(B,z,v)}};Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionService=void 0;const h=f(9806),p=f(9504),b=f(456),D=f(4725),S=f(8460),l=f(844),c=f(6114),o=f(4841),a=f(511),_=f(2585),g=" ",C=new RegExp(g,"g");let x=u.SelectionService=class extends l.Disposable{constructor(v,E,B,z,L,U,ee,W,H){super(),this._element=v,this._screenElement=E,this._linkifier=B,this._bufferService=z,this._coreService=L,this._mouseService=U,this._optionsService=ee,this._renderService=W,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=I=>this._handleMouseMove(I),this._mouseUpListener=I=>this._handleMouseUp(I),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((I=>this._handleTrim(I))),this.register(this._bufferService.buffers.onBufferActivate((I=>this._handleBufferActivate(I)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const v=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!v||!E||v[0]===E[0]&&v[1]===E[1])}get selectionText(){const v=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!v||!E)return"";const B=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(v[0]===E[0])return"";const L=v[0]<E[0]?v[0]:E[0],U=v[0]<E[0]?E[0]:v[0];for(let ee=v[1];ee<=E[1];ee++){const W=B.translateBufferLineToString(ee,!0,L,U);z.push(W)}}else{const L=v[1]===E[1]?E[0]:void 0;z.push(B.translateBufferLineToString(v[1],!0,v[0],L));for(let U=v[1]+1;U<=E[1]-1;U++){const ee=B.lines.get(U),W=B.translateBufferLineToString(U,!0);ee?.isWrapped?z[z.length-1]+=W:z.push(W)}if(v[1]!==E[1]){const U=B.lines.get(E[1]),ee=B.translateBufferLineToString(E[1],!0,0,E[0]);U&&U.isWrapped?z[z.length-1]+=ee:z.push(ee)}}return z.map((L=>L.replace(C," "))).join(c.isWindows?`\r
14
+ `:`
15
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&v&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(v){const E=this._getMouseBufferCoords(v),B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(B&&z&&E)&&this._areCoordsInSelection(E,B,z)}isCellInSelection(v,E){const B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!B||!z)&&this._areCoordsInSelection([v,E],B,z)}_areCoordsInSelection(v,E,B){return v[1]>E[1]&&v[1]<B[1]||E[1]===B[1]&&v[1]===E[1]&&v[0]>=E[0]&&v[0]<B[0]||E[1]<B[1]&&v[1]===B[1]&&v[0]<B[0]||E[1]<B[1]&&v[1]===E[1]&&v[0]>=E[0]}_selectWordAtCursor(v,E){var B,z;const L=(z=(B=this._linkifier.currentLink)===null||B===void 0?void 0:B.link)===null||z===void 0?void 0:z.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(v);return!!U&&(this._selectWordAt(U,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,E){this._model.clearSelection(),v=Math.max(v,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const E=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(v){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=B?0:(E>B&&(E-=B),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(v){return c.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const E=this._getMouseBufferCoords(v);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(v){return v.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const z=B.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const E=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const z=(0,p.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,B=!(!v||!E||v[0]===E[0]&&v[1]===E[1]);B?v&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,E,B)):this._oldHasSelection&&this._fireOnSelectionChange(v,E,B)}_fireOnSelectionChange(v,E,B){this._oldSelectionStart=v,this._oldSelectionEnd=E,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((E=>this._handleTrim(E)))}_convertViewportColToCharacterIndex(v,E){let B=E;for(let z=0;E>=z;z++){const L=v.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:L>1&&E!==z&&(B+=L-1)}return B}setSelection(v,E,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,E],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,E,B=!0,z=!0){if(v[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,U=L.lines.get(v[1]);if(!U)return;const ee=L.translateBufferLineToString(v[1],!1);let W=this._convertViewportColToCharacterIndex(U,v[0]),H=W;const I=v[0]-W;let A=0,M=0,O=0,w=0;if(ee.charAt(W)===" "){for(;W>0&&ee.charAt(W-1)===" ";)W--;for(;H<ee.length&&ee.charAt(H+1)===" ";)H++}else{let se=v[0],ae=v[0];U.getWidth(se)===0&&(A++,se--),U.getWidth(ae)===2&&(M++,ae++);const fe=U.getString(ae).length;for(fe>1&&(w+=fe-1,H+=fe-1);se>0&&W>0&&!this._isCharWordSeparator(U.loadCell(se-1,this._workCell));){U.loadCell(se-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(A++,se--):T>1&&(O+=T-1,W-=T-1),W--,se--}for(;ae<U.length&&H+1<ee.length&&!this._isCharWordSeparator(U.loadCell(ae+1,this._workCell));){U.loadCell(ae+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(M++,ae++):T>1&&(w+=T-1,H+=T-1),H++,ae++}}H++;let j=W+I-A+O,Z=Math.min(this._bufferService.cols,H-W+A+M-O-w);if(E||ee.slice(W,H).trim()!==""){if(B&&j===0&&U.getCodePoint(0)!==32){const se=L.lines.get(v[1]-1);if(se&&U.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(ae){const fe=this._bufferService.cols-ae.start;j-=fe,Z+=fe}}}if(z&&j+Z===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const se=L.lines.get(v[1]+1);if(se?.isWrapped&&se.getCodePoint(0)!==32){const ae=this._getWordAt([0,v[1]+1],!1,!1,!0);ae&&(Z+=ae.length)}}return{start:j,length:Z}}}_selectWordAt(v,E){const B=this._getWordAt(v,E);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[B.start,v[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(v){const E=this._getWordAt(v,!0);if(E){let B=v[1];for(;E.start<0;)E.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,B]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const E=this._bufferService.buffer.getWrappedRangeForLine(v),B={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(B,this._bufferService.cols)}};u.SelectionService=x=d([y(3,_.IBufferService),y(4,_.ICoreService),y(5,D.IMouseService),y(6,_.IOptionsService),y(7,D.IRenderService),y(8,D.ICoreBrowserService)],x)},4725:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.IThemeService=u.ICharacterJoinerService=u.ISelectionService=u.IRenderService=u.IMouseService=u.ICoreBrowserService=u.ICharSizeService=void 0;const d=f(8343);u.ICharSizeService=(0,d.createDecorator)("CharSizeService"),u.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),u.IMouseService=(0,d.createDecorator)("MouseService"),u.IRenderService=(0,d.createDecorator)("RenderService"),u.ISelectionService=(0,d.createDecorator)("SelectionService"),u.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),u.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(F,u,f){var d=this&&this.__decorate||function(x,v,E,B){var z,L=arguments.length,U=L<3?v:B===null?B=Object.getOwnPropertyDescriptor(v,E):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(x,v,E,B);else for(var ee=x.length-1;ee>=0;ee--)(z=x[ee])&&(U=(L<3?z(U):L>3?z(v,E,U):z(v,E))||U);return L>3&&U&&Object.defineProperty(v,E,U),U},y=this&&this.__param||function(x,v){return function(E,B){v(E,B,x)}};Object.defineProperty(u,"__esModule",{value:!0}),u.ThemeService=u.DEFAULT_ANSI_COLORS=void 0;const h=f(7239),p=f(8055),b=f(8460),D=f(844),S=f(2585),l=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),o=p.css.toColor("#ffffff"),a=p.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};u.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const x=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let E=0;E<216;E++){const B=v[E/36%6|0],z=v[E/6%6|0],L=v[E%6];x.push({css:p.channels.toCss(B,z,L),rgba:p.channels.toRgba(B,z,L)})}for(let E=0;E<24;E++){const B=8+10*E;x.push({css:p.channels.toCss(B,B,B),rgba:p.channels.toRgba(B,B,B)})}return x})());let g=u.ThemeService=class extends D.Disposable{get colors(){return this._colors}constructor(x){super(),this._optionsService=x,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:c,cursor:o,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:p.color.blend(c,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:p.color.blend(c,_),ansi:u.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(x={}){const v=this._colors;if(v.foreground=C(x.foreground,l),v.background=C(x.background,c),v.cursor=C(x.cursor,o),v.cursorAccent=C(x.cursorAccent,a),v.selectionBackgroundTransparent=C(x.selectionBackground,_),v.selectionBackgroundOpaque=p.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=C(x.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=p.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=x.selectionForeground?C(x.selectionForeground,p.NULL_COLOR):void 0,v.selectionForeground===p.NULL_COLOR&&(v.selectionForeground=void 0),p.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=p.color.opacity(v.selectionBackgroundTransparent,.3)),p.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=p.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=u.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=C(x.black,u.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=C(x.red,u.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=C(x.green,u.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=C(x.yellow,u.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=C(x.blue,u.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=C(x.magenta,u.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=C(x.cyan,u.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=C(x.white,u.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=C(x.brightBlack,u.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=C(x.brightRed,u.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=C(x.brightGreen,u.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=C(x.brightYellow,u.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=C(x.brightBlue,u.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=C(x.brightMagenta,u.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=C(x.brightCyan,u.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=C(x.brightWhite,u.DEFAULT_ANSI_COLORS[15]),x.extendedAnsi){const E=Math.min(v.ansi.length-16,x.extendedAnsi.length);for(let B=0;B<E;B++)v.ansi[B+16]=C(x.extendedAnsi[B],u.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(x){this._restoreColor(x),this._onChangeColors.fire(this.colors)}_restoreColor(x){if(x!==void 0)switch(x){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[x]=this._restoreColors.ansi[x]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(x){x(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function C(x,v){if(x!==void 0)try{return p.css.toColor(x)}catch{}return v}u.ThemeService=g=d([y(0,S.IOptionsService)],g)},6349:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CircularList=void 0;const d=f(8460),y=f(844);class h extends y.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const D=new Array(b);for(let S=0;S<Math.min(b,this.length);S++)D[S]=this._array[this._getCyclicIndex(S)];this._array=D,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let D=this._length;D<b;D++)this._array[D]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,D){this._array[this._getCyclicIndex(b)]=D}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,D,...S){if(D){for(let l=b;l<this._length-D;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+D)];this._length-=D,this.onDeleteEmitter.fire({index:b,amount:D})}for(let l=this._length-1;l>=b;l--)this._array[this._getCyclicIndex(l+S.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<S.length;l++)this._array[this._getCyclicIndex(b+l)]=S[l];if(S.length&&this.onInsertEmitter.fire({index:b,amount:S.length}),this._length+S.length>this._maxLength){const l=this._length+S.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=S.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,D,S){if(!(D<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let c=D-1;c>=0;c--)this.set(b+c+S,this.get(b+c));const l=b+D+S-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<D;l++)this.set(b+l+S,this.get(b+l))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}u.CircularList=h},1439:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.clone=void 0,u.clone=function f(d,y=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const p in d)h[p]=y<=1?d[p]:d[p]&&f(d[p],y-1);return h}},8055:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.contrastRatio=u.toPaddedHex=u.rgba=u.rgb=u.css=u.color=u.channels=u.NULL_COLOR=void 0;const d=f(6114);let y=0,h=0,p=0,b=0;var D,S,l,c,o;function a(g){const C=g.toString(16);return C.length<2?"0"+C:C}function _(g,C){return g<C?(C+.05)/(g+.05):(g+.05)/(C+.05)}u.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(C,x,v,E){return E!==void 0?`#${a(C)}${a(x)}${a(v)}${a(E)}`:`#${a(C)}${a(x)}${a(v)}`},g.toRgba=function(C,x,v,E=255){return(C<<24|x<<16|v<<8|E)>>>0}})(D||(u.channels=D={})),(function(g){function C(x,v){return b=Math.round(255*v),[y,h,p]=o.toChannels(x.rgba),{css:D.toCss(y,h,p,b),rgba:D.toRgba(y,h,p,b)}}g.blend=function(x,v){if(b=(255&v.rgba)/255,b===1)return{css:v.css,rgba:v.rgba};const E=v.rgba>>24&255,B=v.rgba>>16&255,z=v.rgba>>8&255,L=x.rgba>>24&255,U=x.rgba>>16&255,ee=x.rgba>>8&255;return y=L+Math.round((E-L)*b),h=U+Math.round((B-U)*b),p=ee+Math.round((z-ee)*b),{css:D.toCss(y,h,p),rgba:D.toRgba(y,h,p)}},g.isOpaque=function(x){return(255&x.rgba)==255},g.ensureContrastRatio=function(x,v,E){const B=o.ensureContrastRatio(x.rgba,v.rgba,E);if(B)return o.toColor(B>>24&255,B>>16&255,B>>8&255)},g.opaque=function(x){const v=(255|x.rgba)>>>0;return[y,h,p]=o.toChannels(v),{css:D.toCss(y,h,p),rgba:v}},g.opacity=C,g.multiplyOpacity=function(x,v){return b=255&x.rgba,C(x,b*v/255)},g.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(S||(u.color=S={})),(function(g){let C,x;if(!d.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const E=v.getContext("2d",{willReadFrequently:!0});E&&(C=E,C.globalCompositeOperation="copy",x=C.createLinearGradient(0,0,1,1))}g.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return y=parseInt(v.slice(1,2).repeat(2),16),h=parseInt(v.slice(2,3).repeat(2),16),p=parseInt(v.slice(3,4).repeat(2),16),o.toColor(y,h,p);case 5:return y=parseInt(v.slice(1,2).repeat(2),16),h=parseInt(v.slice(2,3).repeat(2),16),p=parseInt(v.slice(3,4).repeat(2),16),b=parseInt(v.slice(4,5).repeat(2),16),o.toColor(y,h,p,b);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const E=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return y=parseInt(E[1]),h=parseInt(E[2]),p=parseInt(E[3]),b=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),o.toColor(y,h,p,b);if(!C||!x)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=x,C.fillStyle=v,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[y,h,p,b]=C.getImageData(0,0,1,1).data,b!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:D.toRgba(y,h,p,b),css:v}}})(l||(u.css=l={})),(function(g){function C(x,v,E){const B=x/255,z=v/255,L=E/255;return .2126*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.7152*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(x){return C(x>>16&255,x>>8&255,255&x)},g.relativeLuminance2=C})(c||(u.rgb=c={})),(function(g){function C(v,E,B){const z=v>>24&255,L=v>>16&255,U=v>>8&255;let ee=E>>24&255,W=E>>16&255,H=E>>8&255,I=_(c.relativeLuminance2(ee,W,H),c.relativeLuminance2(z,L,U));for(;I<B&&(ee>0||W>0||H>0);)ee-=Math.max(0,Math.ceil(.1*ee)),W-=Math.max(0,Math.ceil(.1*W)),H-=Math.max(0,Math.ceil(.1*H)),I=_(c.relativeLuminance2(ee,W,H),c.relativeLuminance2(z,L,U));return(ee<<24|W<<16|H<<8|255)>>>0}function x(v,E,B){const z=v>>24&255,L=v>>16&255,U=v>>8&255;let ee=E>>24&255,W=E>>16&255,H=E>>8&255,I=_(c.relativeLuminance2(ee,W,H),c.relativeLuminance2(z,L,U));for(;I<B&&(ee<255||W<255||H<255);)ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),W=Math.min(255,W+Math.ceil(.1*(255-W))),H=Math.min(255,H+Math.ceil(.1*(255-H))),I=_(c.relativeLuminance2(ee,W,H),c.relativeLuminance2(z,L,U));return(ee<<24|W<<16|H<<8|255)>>>0}g.ensureContrastRatio=function(v,E,B){const z=c.relativeLuminance(v>>8),L=c.relativeLuminance(E>>8);if(_(z,L)<B){if(L<z){const W=C(v,E,B),H=_(z,c.relativeLuminance(W>>8));if(H<B){const I=x(v,E,B);return H>_(z,c.relativeLuminance(I>>8))?W:I}return W}const U=x(v,E,B),ee=_(z,c.relativeLuminance(U>>8));if(ee<B){const W=C(v,E,B);return ee>_(z,c.relativeLuminance(W>>8))?U:W}return U}},g.reduceLuminance=C,g.increaseLuminance=x,g.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]},g.toColor=function(v,E,B,z){return{css:D.toCss(v,E,B,z),rgba:D.toRgba(v,E,B,z)}}})(o||(u.rgba=o={})),u.toPaddedHex=a,u.contrastRatio=_},8969:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreTerminal=void 0;const d=f(844),y=f(2585),h=f(4348),p=f(7866),b=f(744),D=f(7302),S=f(6975),l=f(8460),c=f(1753),o=f(1480),a=f(7994),_=f(9282),g=f(5435),C=f(5981),x=f(2660);let v=!1;class E extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((z=>{var L;(L=this._onScrollApi)===null||L===void 0||L.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const L in z)this.optionsService.options[L]=z[L]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new D.OptionsService(z)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(a.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(x.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new C.WriteBuffer(((L,U)=>this._inputHandler.parse(L,U)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,L){this._writeBuffer.write(z,L)}writeSync(z,L){this._logService.logLevel<=y.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(z,L)}resize(z,L){isNaN(z)||isNaN(L)||(z=Math.max(z,b.MINIMUM_COLS),L=Math.max(L,b.MINIMUM_ROWS),this._bufferService.resize(z,L))}scroll(z,L=!1){this._bufferService.scroll(z,L)}scrollLines(z,L,U){this._bufferService.scrollLines(z,L,U)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const L=z-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(z,L){return this._inputHandler.registerEscHandler(z,L)}registerDcsHandler(z,L){return this._inputHandler.registerDcsHandler(z,L)}registerCsiHandler(z,L){return this._inputHandler.registerCsiHandler(z,L)}registerOscHandler(z,L){return this._inputHandler.registerOscHandler(z,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?z=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const L of z)L.dispose()}))}}}u.CoreTerminal=E},8460:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.forwardEvent=u.EventEmitter=void 0,u.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===f)return void this._listeners.splice(d,1)}}})),this._event}fire(f,d){const y=[];for(let h=0;h<this._listeners.length;h++)y.push(this._listeners[h]);for(let h=0;h<y.length;h++)y[h].call(void 0,f,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},u.forwardEvent=function(f,d){return f((y=>d.fire(y)))}},5435:function(F,u,f){var d=this&&this.__decorate||function(I,A,M,O){var w,j=arguments.length,Z=j<3?A:O===null?O=Object.getOwnPropertyDescriptor(A,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(I,A,M,O);else for(var se=I.length-1;se>=0;se--)(w=I[se])&&(Z=(j<3?w(Z):j>3?w(A,M,Z):w(A,M))||Z);return j>3&&Z&&Object.defineProperty(A,M,Z),Z},y=this&&this.__param||function(I,A){return function(M,O){A(M,O,I)}};Object.defineProperty(u,"__esModule",{value:!0}),u.InputHandler=u.WindowsOptionsReportType=void 0;const h=f(2584),p=f(7116),b=f(2015),D=f(844),S=f(482),l=f(8437),c=f(8460),o=f(643),a=f(511),_=f(3734),g=f(2585),C=f(6242),x=f(6351),v=f(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function z(I,A){if(I>24)return A.setWinLines||!1;switch(I){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var L;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(u.WindowsOptionsReportType=L={}));let U=0;class ee extends D.Disposable{getAttrData(){return this._curAttrData}constructor(A,M,O,w,j,Z,se,ae,fe=new b.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=M,this._coreService=O,this._logService=w,this._optionsService=j,this._oscLinkService=Z,this._coreMouseService=se,this._unicodeService=ae,this._parser=fe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new a.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((T=>this._activeBuffer=T.activeBuffer))),this._parser.setCsiHandlerFallback(((T,X)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(T),params:X.toArray()})})),this._parser.setEscHandlerFallback((T=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(T)})})),this._parser.setExecuteHandlerFallback((T=>{this._logService.debug("Unknown EXECUTE code: ",{code:T})})),this._parser.setOscHandlerFallback(((T,X,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:T,action:X,data:J})})),this._parser.setDcsHandlerFallback(((T,X,J)=>{X==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(T),action:X,payload:J})})),this._parser.setPrintHandler(((T,X,J)=>this.print(T,X,J))),this._parser.registerCsiHandler({final:"@"},(T=>this.insertChars(T))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(T=>this.scrollLeft(T))),this._parser.registerCsiHandler({final:"A"},(T=>this.cursorUp(T))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(T=>this.scrollRight(T))),this._parser.registerCsiHandler({final:"B"},(T=>this.cursorDown(T))),this._parser.registerCsiHandler({final:"C"},(T=>this.cursorForward(T))),this._parser.registerCsiHandler({final:"D"},(T=>this.cursorBackward(T))),this._parser.registerCsiHandler({final:"E"},(T=>this.cursorNextLine(T))),this._parser.registerCsiHandler({final:"F"},(T=>this.cursorPrecedingLine(T))),this._parser.registerCsiHandler({final:"G"},(T=>this.cursorCharAbsolute(T))),this._parser.registerCsiHandler({final:"H"},(T=>this.cursorPosition(T))),this._parser.registerCsiHandler({final:"I"},(T=>this.cursorForwardTab(T))),this._parser.registerCsiHandler({final:"J"},(T=>this.eraseInDisplay(T,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(T=>this.eraseInDisplay(T,!0))),this._parser.registerCsiHandler({final:"K"},(T=>this.eraseInLine(T,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(T=>this.eraseInLine(T,!0))),this._parser.registerCsiHandler({final:"L"},(T=>this.insertLines(T))),this._parser.registerCsiHandler({final:"M"},(T=>this.deleteLines(T))),this._parser.registerCsiHandler({final:"P"},(T=>this.deleteChars(T))),this._parser.registerCsiHandler({final:"S"},(T=>this.scrollUp(T))),this._parser.registerCsiHandler({final:"T"},(T=>this.scrollDown(T))),this._parser.registerCsiHandler({final:"X"},(T=>this.eraseChars(T))),this._parser.registerCsiHandler({final:"Z"},(T=>this.cursorBackwardTab(T))),this._parser.registerCsiHandler({final:"`"},(T=>this.charPosAbsolute(T))),this._parser.registerCsiHandler({final:"a"},(T=>this.hPositionRelative(T))),this._parser.registerCsiHandler({final:"b"},(T=>this.repeatPrecedingCharacter(T))),this._parser.registerCsiHandler({final:"c"},(T=>this.sendDeviceAttributesPrimary(T))),this._parser.registerCsiHandler({prefix:">",final:"c"},(T=>this.sendDeviceAttributesSecondary(T))),this._parser.registerCsiHandler({final:"d"},(T=>this.linePosAbsolute(T))),this._parser.registerCsiHandler({final:"e"},(T=>this.vPositionRelative(T))),this._parser.registerCsiHandler({final:"f"},(T=>this.hVPosition(T))),this._parser.registerCsiHandler({final:"g"},(T=>this.tabClear(T))),this._parser.registerCsiHandler({final:"h"},(T=>this.setMode(T))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(T=>this.setModePrivate(T))),this._parser.registerCsiHandler({final:"l"},(T=>this.resetMode(T))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(T=>this.resetModePrivate(T))),this._parser.registerCsiHandler({final:"m"},(T=>this.charAttributes(T))),this._parser.registerCsiHandler({final:"n"},(T=>this.deviceStatus(T))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(T=>this.deviceStatusPrivate(T))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(T=>this.softReset(T))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(T=>this.setCursorStyle(T))),this._parser.registerCsiHandler({final:"r"},(T=>this.setScrollRegion(T))),this._parser.registerCsiHandler({final:"s"},(T=>this.saveCursor(T))),this._parser.registerCsiHandler({final:"t"},(T=>this.windowOptions(T))),this._parser.registerCsiHandler({final:"u"},(T=>this.restoreCursor(T))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(T=>this.insertColumns(T))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(T=>this.deleteColumns(T))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(T=>this.selectProtected(T))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(T=>this.requestMode(T,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(T=>this.requestMode(T,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((T=>(this.setTitle(T),this.setIconName(T),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((T=>this.setIconName(T)))),this._parser.registerOscHandler(2,new C.OscHandler((T=>this.setTitle(T)))),this._parser.registerOscHandler(4,new C.OscHandler((T=>this.setOrReportIndexedColor(T)))),this._parser.registerOscHandler(8,new C.OscHandler((T=>this.setHyperlink(T)))),this._parser.registerOscHandler(10,new C.OscHandler((T=>this.setOrReportFgColor(T)))),this._parser.registerOscHandler(11,new C.OscHandler((T=>this.setOrReportBgColor(T)))),this._parser.registerOscHandler(12,new C.OscHandler((T=>this.setOrReportCursorColor(T)))),this._parser.registerOscHandler(104,new C.OscHandler((T=>this.restoreIndexedColor(T)))),this._parser.registerOscHandler(110,new C.OscHandler((T=>this.restoreFgColor(T)))),this._parser.registerOscHandler(111,new C.OscHandler((T=>this.restoreBgColor(T)))),this._parser.registerOscHandler(112,new C.OscHandler((T=>this.restoreCursorColor(T)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const T in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:T},(()=>this.selectCharset("("+T))),this._parser.registerEscHandler({intermediates:")",final:T},(()=>this.selectCharset(")"+T))),this._parser.registerEscHandler({intermediates:"*",final:T},(()=>this.selectCharset("*"+T))),this._parser.registerEscHandler({intermediates:"+",final:T},(()=>this.selectCharset("+"+T))),this._parser.registerEscHandler({intermediates:"-",final:T},(()=>this.selectCharset("-"+T))),this._parser.registerEscHandler({intermediates:".",final:T},(()=>this.selectCharset("."+T))),this._parser.registerEscHandler({intermediates:"/",final:T},(()=>this.selectCharset("/"+T)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((T=>(this._logService.error("Parsing error: ",T),T))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((T,X)=>this.requestStatusString(T,X))))}_preserveStack(A,M,O,w){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=w}_logSlowResolvingAsync(A){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([A,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,M){let O,w=this._activeBuffer.x,j=this._activeBuffer.y,Z=0;const se=this._parseStack.paused;if(se){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;w=this._parseStack.cursorStartX,j=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>B&&(Z=this._parseStack.position+B)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(ae=>String.fromCharCode(ae))).join("")}"`),typeof A=="string"?A.split("").map((ae=>ae.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(A.length,B))),se||this._dirtyRowTracker.clearRange(),A.length>B)for(let ae=Z;ae<A.length;ae+=B){const fe=ae+B<A.length?ae+B:A.length,T=typeof A=="string"?this._stringDecoder.decode(A.substring(ae,fe),this._parseBuffer):this._utf8Decoder.decode(A.subarray(ae,fe),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,T))return this._preserveStack(w,j,T,ae),this._logSlowResolvingAsync(O),O}else if(!se){const ae=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(w,j,ae,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===w&&this._activeBuffer.y===j||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(A,M,O){let w,j;const Z=this._charsetService.charset,se=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,fe=this._coreService.decPrivateModes.wraparound,T=this._coreService.modes.insertMode,X=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-M>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodePoint(this._activeBuffer.x-1,0,1,X.fg,X.bg,X.extended);for(let ie=M;ie<O;++ie){if(w=A[ie],j=this._unicodeService.wcwidth(w),w<127&&Z){const Se=Z[String.fromCharCode(w)];Se&&(w=Se.charCodeAt(0))}if(se&&this._onA11yChar.fire((0,S.stringFromCodePoint)(w)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),j||!this._activeBuffer.x){if(this._activeBuffer.x+j-1>=ae){if(fe){for(;this._activeBuffer.x<ae;)J.setCellFromCodePoint(this._activeBuffer.x++,0,1,X.fg,X.bg,X.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=ae-1,j===2)continue}if(T&&(J.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(X),X),J.getWidth(ae-1)===2&&J.setCellFromCodePoint(ae-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,X.fg,X.bg,X.extended)),J.setCellFromCodePoint(this._activeBuffer.x++,w,j,X.fg,X.bg,X.extended),j>0)for(;--j;)J.setCellFromCodePoint(this._activeBuffer.x++,0,0,X.fg,X.bg,X.extended)}else J.getWidth(this._activeBuffer.x-1)?J.addCodepointToCell(this._activeBuffer.x-1,w):J.addCodepointToCell(this._activeBuffer.x-2,w)}O-M>0&&(J.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<ae&&O-M>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodePoint(this._activeBuffer.x,0,1,X.fg,X.bg,X.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,M){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,M):this._parser.registerCsiHandler(A,(O=>!z(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(A,M){return this._parser.registerDcsHandler(A,new x.DcsHandler(M))}registerEscHandler(A,M){return this._parser.registerEscHandler(A,M)}registerOscHandler(A,M){return this._parser.registerOscHandler(A,new C.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var A;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||A===void 0)&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(A,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=A,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+M)}cursorUp(A){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const M=A.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=A.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=A.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const M=A.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,M,O,w=!1,j=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);Z.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),j),w&&(Z.isWrapped=!1)}_resetBufferLine(A,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),O.isWrapped=!1)}eraseInDisplay(A,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O<this._bufferService.rows;O++)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const w=this._activeBuffer.lines.length-this._bufferService.rows;w>0&&(this._activeBuffer.lines.trimStart(w),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-w,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-w,0),this._onScroll.fire(0))}return!0}eraseInLine(A,M=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let M=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,w=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-w+1;for(;M--;)this._activeBuffer.lines.splice(j-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let M=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let w;for(w=this._bufferService.rows-1-this._activeBuffer.scrollBottom,w=this._bufferService.rows-1+this._activeBuffer.ybase-w;M--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(w,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let M=A.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(A){let M=A.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=A.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);w.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),w.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=A.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);w.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),w.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=A.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);w.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),w.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=A.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);w.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),w.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){if(!this._parser.precedingCodepoint)return!0;const M=A.params[0]||1,O=new Uint32Array(M);for(let w=0;w<M;++w)O[w]=this._parser.precedingCodepoint;return this.print(O,0,O.length),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let M=0;M<A.length;M++)switch(A.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let M=0;M<A.length;M++)switch(A.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(A){for(let M=0;M<A.length;M++)switch(A.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let M=0;M<A.length;M++)switch(A.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),A.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(A,M){const O=this._coreService.decPrivateModes,{activeProtocol:w,activeEncoding:j}=this._coreMouseService,Z=this._coreService,{buffers:se,cols:ae}=this._bufferService,{active:fe,alt:T}=se,X=this._optionsService.rawOptions,J=xe=>xe?1:2,ie=A.params[0];return Se=ie,oe=M?ie===2?4:ie===4?J(Z.modes.insertMode):ie===12?3:ie===20?J(X.convertEol):0:ie===1?J(O.applicationCursorKeys):ie===3?X.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ie===6?J(O.origin):ie===7?J(O.wraparound):ie===8?3:ie===9?J(w==="X10"):ie===12?J(X.cursorBlink):ie===25?J(!Z.isCursorHidden):ie===45?J(O.reverseWraparound):ie===66?J(O.applicationKeypad):ie===67?4:ie===1e3?J(w==="VT200"):ie===1002?J(w==="DRAG"):ie===1003?J(w==="ANY"):ie===1004?J(O.sendFocus):ie===1005?4:ie===1006?J(j==="SGR"):ie===1015?4:ie===1016?J(j==="SGR_PIXELS"):ie===1048?1:ie===47||ie===1047||ie===1049?J(fe===T):ie===2004?J(O.bracketedPasteMode):0,Z.triggerDataEvent(`${h.C0.ESC}[${M?"":"?"}${Se};${oe}$y`),!0;var Se,oe}_updateAttrColor(A,M,O,w,j){return M===2?(A|=50331648,A&=-16777216,A|=_.AttributeData.fromColorRGB([O,w,j])):M===5&&(A&=-50331904,A|=33554432|255&O),A}_extractColor(A,M,O){const w=[0,0,-1,0,0,0];let j=0,Z=0;do{if(w[Z+j]=A.params[M+Z],A.hasSubParams(M+Z)){const se=A.getSubParams(M+Z);let ae=0;do w[1]===5&&(j=1),w[Z+ae+1+j]=se[ae];while(++ae<se.length&&ae+Z+1+j<w.length);break}if(w[1]===5&&Z+j>=2||w[1]===2&&Z+j>=5)break;w[1]&&(j=1)}while(++Z+M<A.length&&Z+j<w.length);for(let se=2;se<w.length;++se)w[se]===-1&&(w[se]=0);switch(w[0]){case 38:O.fg=this._updateAttrColor(O.fg,w[1],w[3],w[4],w[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,w[1],w[3],w[4],w[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,w[1],w[3],w[4],w[5])}return Z}_processUnderline(A,M){M.extended=M.extended.clone(),(!~A||A>5)&&(A=1),M.extended.underlineStyle=A,M.fg|=268435456,A===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(A){A.fg=l.DEFAULT_ATTR_DATA.fg,A.bg=l.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=A.length;let O;const w=this._curAttrData;for(let j=0;j<M;j++)O=A.params[j],O>=30&&O<=37?(w.fg&=-50331904,w.fg|=16777216|O-30):O>=40&&O<=47?(w.bg&=-50331904,w.bg|=16777216|O-40):O>=90&&O<=97?(w.fg&=-50331904,w.fg|=16777224|O-90):O>=100&&O<=107?(w.bg&=-50331904,w.bg|=16777224|O-100):O===0?this._processSGR0(w):O===1?w.fg|=134217728:O===3?w.bg|=67108864:O===4?(w.fg|=268435456,this._processUnderline(A.hasSubParams(j)?A.getSubParams(j)[0]:1,w)):O===5?w.fg|=536870912:O===7?w.fg|=67108864:O===8?w.fg|=1073741824:O===9?w.fg|=2147483648:O===2?w.bg|=134217728:O===21?this._processUnderline(2,w):O===22?(w.fg&=-134217729,w.bg&=-134217729):O===23?w.bg&=-67108865:O===24?(w.fg&=-268435457,this._processUnderline(0,w)):O===25?w.fg&=-536870913:O===27?w.fg&=-67108865:O===28?w.fg&=-1073741825:O===29?w.fg&=2147483647:O===39?(w.fg&=-67108864,w.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):O===49?(w.bg&=-67108864,w.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?j+=this._extractColor(A,j,w):O===53?w.bg|=1073741824:O===55?w.bg&=-1073741825:O===59?(w.extended=w.extended.clone(),w.extended.underlineColor=-1,w.updateExtended()):O===100?(w.fg&=-67108864,w.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,w.bg&=-67108864,w.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${M};${O}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(A){const M=A.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(A){const M=A.params[0]||1;let O;return(A.length<2||(O=A.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(A){if(!z(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(A){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const M=[],O=A.split(";");for(;O.length>1;){const w=O.shift(),j=O.shift();if(/^\d+$/.exec(w)){const Z=parseInt(w);if(H(Z))if(j==="?")M.push({type:0,index:Z});else{const se=(0,v.parseColor)(j);se&&M.push({type:1,index:Z,color:se})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(A){const M=A.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(A,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=A.split(":");let w;const j=O.findIndex((Z=>Z.startsWith("id=")));return j!==-1&&(w=O[j].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:w,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,M){const O=A.split(";");for(let w=0;w<O.length&&!(M>=this._specialColors.length);++w,++M)if(O[w]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const j=(0,v.parseColor)(O[w]);j&&this._onColor.fire([{type:1,index:this._specialColors[M],color:j}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const M=[],O=A.split(";");for(let w=0;w<O.length;++w)if(/^\d+$/.exec(O[w])){const j=parseInt(O[w]);H(j)&&M.push({type:2,index:j})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(E[A[0]],p.CHARSETS[A[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new a.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const O=this._activeBuffer.ybase+this._activeBuffer.y+M,w=this._activeBuffer.lines.get(O);w&&(w.fill(A),w.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,M){const O=this._bufferService.buffer,w=this._optionsService.rawOptions;return(j=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${j}${h.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[w.cursorStyle]-(w.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,M){this._dirtyRowTracker.markRangeDirty(A,M)}}u.InputHandler=ee;let W=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,A){I>A&&(U=I,I=A,A=U),I<this.start&&(this.start=I),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(I){return 0<=I&&I<256}W=d([y(0,g.IBufferService)],W)},844:(F,u)=>{function f(d){for(const y of d)y.dispose();d.length=0}Object.defineProperty(u,"__esModule",{value:!0}),u.getDisposeArrayDisposable=u.disposeArray=u.toDisposable=u.MutableDisposable=u.Disposable=void 0,u.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const y=this._disposables.indexOf(d);y!==-1&&this._disposables.splice(y,1)}},u.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var y;this._isDisposed||d===this._value||((y=this._value)===null||y===void 0||y.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},u.toDisposable=function(d){return{dispose:d}},u.disposeArray=f,u.getDisposeArrayDisposable=function(d){return{dispose:()=>f(d)}}},1505:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.FourKeyMap=u.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(y,h,p){this._data[y]||(this._data[y]={}),this._data[y][h]=p}get(y,h){return this._data[y]?this._data[y][h]:void 0}clear(){this._data={}}}u.TwoKeyMap=f,u.FourKeyMap=class{constructor(){this._data=new f}set(d,y,h,p,b){this._data.get(d,y)||this._data.set(d,y,new f),this._data.get(d,y).set(h,p,b)}get(d,y,h,p){var b;return(b=this._data.get(d,y))===null||b===void 0?void 0:b.get(h,p)}clear(){this._data.clear()}}},6114:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.isChromeOS=u.isLinux=u.isWindows=u.isIphone=u.isIpad=u.isMac=u.getSafariVersion=u.isSafari=u.isLegacyEdge=u.isFirefox=u.isNode=void 0,u.isNode=typeof navigator>"u";const f=u.isNode?"node":navigator.userAgent,d=u.isNode?"node":navigator.platform;u.isFirefox=f.includes("Firefox"),u.isLegacyEdge=f.includes("Edge"),u.isSafari=/^((?!chrome|android).)*safari/i.test(f),u.getSafariVersion=function(){if(!u.isSafari)return 0;const y=f.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},u.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),u.isIpad=d==="iPad",u.isIphone=d==="iPhone",u.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),u.isLinux=d.indexOf("Linux")>=0,u.isChromeOS=/\bCrOS\b/.test(f)},6106:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SortedList=void 0;let f=0;u.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(f=this._search(this._getKey(d)),this._array.splice(f,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(f=this._search(y),f===-1)||this._getKey(this._array[f])!==y)return!1;do if(this._array[f]===d)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===d)}forEachByKey(d,y){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do y(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===d)}values(){return[...this._array].values()}_search(d){let y=0,h=this._array.length-1;for(;h>=y;){let p=y+h>>1;const b=this._getKey(this._array[p]);if(b>d)h=p-1;else{if(!(b<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}y=p+1}}return y}}},7226:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DebouncedIdleTask=u.IdleTaskQueue=u.PriorityTaskQueue=void 0;const d=f(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(b){this._idleCallback=void 0;let D=0,S=0,l=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(D=Date.now(),this._tasks[this._i]()||this._i++,D=Math.max(1,Date.now()-D),S=Math.max(D,S),c=b.timeRemaining(),1.5*S>c)return l-D<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-D))}ms`),void this._start();l=c}this.clear()}}class h extends y{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const D=Date.now()+b;return{timeRemaining:()=>Math.max(0,D-Date.now())}}}u.PriorityTaskQueue=h,u.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:h,u.DebouncedIdleTask=class{constructor(){this._queue=new u.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.updateWindowsModeWrappedState=void 0;const d=f(643);u.updateWindowsModeWrappedState=function(y){const h=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),p=h?.get(y.cols-1),b=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);b&&p&&(b.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ExtendedAttrs=u.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new f;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}u.AttributeData=f;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}constructor(h=0,p=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}u.ExtendedAttrs=d},9092:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Buffer=u.MAX_BUFFER_SIZE=void 0;const d=f(6349),y=f(7226),h=f(3734),p=f(8437),b=f(4634),D=f(511),S=f(643),l=f(4863),c=f(7116);u.MAX_BUFFER_SIZE=4294967295,u.Buffer=class{constructor(o,a,_){this._hasScrollback=o,this._optionsService=a,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=D.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=D.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,a){return new p.BufferLine(this._bufferService.cols,this.getNullCell(o),a)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const a=o+this._optionsService.rawOptions.scrollback;return a>u.MAX_BUFFER_SIZE?u.MAX_BUFFER_SIZE:a}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=p.DEFAULT_ATTR_DATA);let a=this._rows;for(;a--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,a){const _=this.getNullCell(p.DEFAULT_ATTR_DATA);let g=0;const C=this._getCorrectBufferLength(a);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<o)for(let v=0;v<this.lines.length;v++)g+=+this.lines.get(v).resize(o,_);let x=0;if(this._rows<a)for(let v=this._rows;v<a;v++)this.lines.length<a+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(o,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+x+1?(this.ybase--,x++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(o,_)));else for(let v=this._rows;v>a;v--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const v=this.lines.length-C;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=C}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,a-1),x&&(this.y+=x),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(o,a),this._cols>o))for(let x=0;x<this.lines.length;x++)g+=+this.lines.get(x).resize(o,_);this._cols=o,this._rows=a,this._memoryCleanupQueue.clear(),g>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let a=0;for(;this._memoryCleanupPosition<this.lines.length;)if(a+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),a>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,a){this._cols!==o&&(o>this._cols?this._reflowLarger(o,a):this._reflowSmaller(o,a))}_reflowLarger(o,a){const _=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(_.length>0){const g=(0,b.reflowLargerCreateNewLayout)(this.lines,_);(0,b.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(o,a,g.countRemoved)}}_reflowLargerAdjustViewport(o,a,_){const g=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=_;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<a&&this.lines.push(new p.BufferLine(o,g))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(o,a){const _=this.getNullCell(p.DEFAULT_ATTR_DATA),g=[];let C=0;for(let x=this.lines.length-1;x>=0;x--){let v=this.lines.get(x);if(!v||!v.isWrapped&&v.getTrimmedLength()<=o)continue;const E=[v];for(;v.isWrapped&&x>0;)v=this.lines.get(--x),E.unshift(v);const B=this.ybase+this.y;if(B>=x&&B<x+E.length)continue;const z=E[E.length-1].getTrimmedLength(),L=(0,b.reflowSmallerGetNewLineLengths)(E,this._cols,o),U=L.length-E.length;let ee;ee=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const W=[];for(let w=0;w<U;w++){const j=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);W.push(j)}W.length>0&&(g.push({start:x+E.length+C,newLines:W}),C+=W.length),E.push(...W);let H=L.length-1,I=L[H];I===0&&(H--,I=L[H]);let A=E.length-U-1,M=z;for(;A>=0;){const w=Math.min(M,I);if(E[H]===void 0)break;if(E[H].copyCellsFrom(E[A],M-w,I-w,w,!0),I-=w,I===0&&(H--,I=L[H]),M-=w,M===0){A--;const j=Math.max(A,0);M=(0,b.getWrappedLineTrimmedLength)(E,j,this._cols)}}for(let w=0;w<E.length;w++)L[w]<o&&E[w].setCell(L[w],_);let O=U-ee;for(;O-- >0;)this.ybase===0?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+a-1)}if(g.length>0){const x=[],v=[];for(let H=0;H<this.lines.length;H++)v.push(this.lines.get(H));const E=this.lines.length;let B=E-1,z=0,L=g[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let U=0;for(let H=Math.min(this.lines.maxLength-1,E+C-1);H>=0;H--)if(L&&L.start>B+U){for(let I=L.newLines.length-1;I>=0;I--)this.lines.set(H--,L.newLines[I]);H++,x.push({index:B+1,amount:L.newLines.length}),U+=L.newLines.length,L=g[++z]}else this.lines.set(H,v[B--]);let ee=0;for(let H=x.length-1;H>=0;H--)x[H].index+=ee,this.lines.onInsertEmitter.fire(x[H]),ee+=x[H].amount;const W=Math.max(0,E+C-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(o,a,_=0,g){const C=this.lines.get(o);return C?C.translateToString(a,_,g):""}getWrappedRangeForLine(o){let a=o,_=o;for(;a>0&&this.lines.get(a).isWrapped;)a--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:a,last:_}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].line===o&&(this.markers[a].dispose(),this.markers.splice(a--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const a=new l.Marker(o);return this.markers.push(a),a.register(this.lines.onTrim((_=>{a.line-=_,a.line<0&&a.dispose()}))),a.register(this.lines.onInsert((_=>{a.line>=_.index&&(a.line+=_.amount)}))),a.register(this.lines.onDelete((_=>{a.line>=_.index&&a.line<_.index+_.amount&&a.dispose(),a.line>_.index&&(a.line-=_.amount)}))),a.register(a.onDispose((()=>this._removeMarker(a)))),a}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLine=u.DEFAULT_ATTR_DATA=void 0;const d=f(3734),y=f(511),h=f(643),p=f(482);u.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class D{constructor(l,c,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const a=c||y.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let _=0;_<l;++_)this.setCell(_,a);this.length=l}get(l){const c=this._data[3*l+0],o=2097151&c;return[this._data[3*l+1],2097152&c?this._combined[l]:o?(0,p.stringFromCodePoint)(o):"",c>>22,2097152&c?this._combined[l].charCodeAt(this._combined[l].length-1):o]}set(l,c){this._data[3*l+1]=c[h.CHAR_DATA_ATTR_INDEX],c[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=c[1],this._data[3*l+0]=2097152|l|c[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=c[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const c=this._data[3*l+0];return 2097152&c?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&c}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const c=this._data[3*l+0];return 2097152&c?this._combined[l]:2097151&c?(0,p.stringFromCodePoint)(2097151&c):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,c){return b=3*l,c.content=this._data[b+0],c.fg=this._data[b+1],c.bg=this._data[b+2],2097152&c.content&&(c.combinedData=this._combined[l]),268435456&c.bg&&(c.extended=this._extendedAttrs[l]),c}setCell(l,c){2097152&c.content&&(this._combined[l]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[l]=c.extended),this._data[3*l+0]=c.content,this._data[3*l+1]=c.fg,this._data[3*l+2]=c.bg}setCellFromCodePoint(l,c,o,a,_,g){268435456&_&&(this._extendedAttrs[l]=g),this._data[3*l+0]=c|o<<22,this._data[3*l+1]=a,this._data[3*l+2]=_}addCodepointToCell(l,c){let o=this._data[3*l+0];2097152&o?this._combined[l]+=(0,p.stringFromCodePoint)(c):(2097151&o?(this._combined[l]=(0,p.stringFromCodePoint)(2097151&o)+(0,p.stringFromCodePoint)(c),o&=-2097152,o|=2097152):o=c|4194304,this._data[3*l+0]=o)}insertCells(l,c,o,a){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs),c<this.length-l){const _=new y.CellData;for(let g=this.length-l-c-1;g>=0;--g)this.setCell(l+c+g,this.loadCell(l+g,_));for(let g=0;g<c;++g)this.setCell(l+g,o)}else for(let _=l;_<this.length;++_)this.setCell(_,o);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs)}deleteCells(l,c,o,a){if(l%=this.length,c<this.length-l){const _=new y.CellData;for(let g=0;g<this.length-l-c;++g)this.setCell(l+g,this.loadCell(l+c+g,_));for(let g=this.length-c;g<this.length;++g)this.setCell(g,o)}else for(let _=l;_<this.length;++_)this.setCell(_,o);l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs),this.getWidth(l)!==0||this.hasContent(l)||this.setCellFromCodePoint(l,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs)}replaceCells(l,c,o,a,_=!1){if(_)for(l&&this.getWidth(l-1)===2&&!this.isProtected(l-1)&&this.setCellFromCodePoint(l-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodePoint(c,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs);l<c&&l<this.length;)this.isProtected(l)||this.setCell(l,o),l++;else for(l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c,0,1,a?.fg||0,a?.bg||0,a?.extended||new d.ExtendedAttrs);l<c&&l<this.length;)this.setCell(l++,o)}resize(l,c){if(l===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*l;if(l>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const a=new Uint32Array(o);a.set(this._data),this._data=a}for(let a=this.length;a<l;++a)this.setCell(a,c)}else{this._data=this._data.subarray(0,o);const a=Object.keys(this._combined);for(let g=0;g<a.length;g++){const C=parseInt(a[g],10);C>=l&&delete this._combined[C]}const _=Object.keys(this._extendedAttrs);for(let g=0;g<_.length;g++){const C=parseInt(_[g],10);C>=l&&delete this._extendedAttrs[C]}}return this.length=l,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const l=new Uint32Array(this._data.length);return l.set(this._data),this._data=l,1}return 0}fill(l,c=!1){if(c)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,l);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,l)}}copyFrom(l){this.length!==l.length?this._data=new Uint32Array(l._data):this._data.set(l._data),this.length=l.length,this._combined={};for(const c in l._combined)this._combined[c]=l._combined[c];this._extendedAttrs={};for(const c in l._extendedAttrs)this._extendedAttrs[c]=l._extendedAttrs[c];this.isWrapped=l.isWrapped}clone(){const l=new D(0);l._data=new Uint32Array(this._data),l.length=this.length;for(const c in this._combined)l._combined[c]=this._combined[c];for(const c in this._extendedAttrs)l._extendedAttrs[c]=this._extendedAttrs[c];return l.isWrapped=this.isWrapped,l}getTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,c,o,a,_){const g=l._data;if(_)for(let x=a-1;x>=0;x--){for(let v=0;v<3;v++)this._data[3*(o+x)+v]=g[3*(c+x)+v];268435456&g[3*(c+x)+2]&&(this._extendedAttrs[o+x]=l._extendedAttrs[c+x])}else for(let x=0;x<a;x++){for(let v=0;v<3;v++)this._data[3*(o+x)+v]=g[3*(c+x)+v];268435456&g[3*(c+x)+2]&&(this._extendedAttrs[o+x]=l._extendedAttrs[c+x])}const C=Object.keys(l._combined);for(let x=0;x<C.length;x++){const v=parseInt(C[x],10);v>=c&&(this._combined[v-c+o]=l._combined[v])}}translateToString(l=!1,c=0,o=this.length){l&&(o=Math.min(o,this.getTrimmedLength()));let a="";for(;c<o;){const _=this._data[3*c+0],g=2097151&_;a+=2097152&_?this._combined[c]:g?(0,p.stringFromCodePoint)(g):h.WHITESPACE_CELL_CHAR,c+=_>>22||1}return a}}u.BufferLine=D},4841:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getRangeLength=void 0,u.getRangeLength=function(f,d){if(f.start.y>f.end.y)throw new Error(`Buffer range end (${f.end.x}, ${f.end.y}) cannot be before start (${f.start.x}, ${f.start.y})`);return d*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(F,u)=>{function f(d,y,h){if(y===d.length-1)return d[y].getTrimmedLength();const p=!d[y].hasContent(h-1)&&d[y].getWidth(h-1)===1,b=d[y+1].getWidth(0)===2;return p&&b?h-1:h}Object.defineProperty(u,"__esModule",{value:!0}),u.getWrappedLineTrimmedLength=u.reflowSmallerGetNewLineLengths=u.reflowLargerApplyNewLayout=u.reflowLargerCreateNewLayout=u.reflowLargerGetLinesToRemove=void 0,u.reflowLargerGetLinesToRemove=function(d,y,h,p,b){const D=[];for(let S=0;S<d.length-1;S++){let l=S,c=d.get(++l);if(!c.isWrapped)continue;const o=[d.get(S)];for(;l<d.length&&c.isWrapped;)o.push(c),c=d.get(++l);if(p>=S&&p<l){S+=o.length-1;continue}let a=0,_=f(o,a,y),g=1,C=0;for(;g<o.length;){const v=f(o,g,y),E=v-C,B=h-_,z=Math.min(E,B);o[a].copyCellsFrom(o[g],C,_,z,!1),_+=z,_===h&&(a++,_=0),C+=z,C===v&&(g++,C=0),_===0&&a!==0&&o[a-1].getWidth(h-1)===2&&(o[a].copyCellsFrom(o[a-1],h-1,_++,1,!1),o[a-1].setCell(h-1,b))}o[a].replaceCells(_,h,b);let x=0;for(let v=o.length-1;v>0&&(v>a||o[v].getTrimmedLength()===0);v--)x++;x>0&&(D.push(S+o.length-x),D.push(x)),S+=o.length-1}return D},u.reflowLargerCreateNewLayout=function(d,y){const h=[];let p=0,b=y[p],D=0;for(let S=0;S<d.length;S++)if(b===S){const l=y[++p];d.onDeleteEmitter.fire({index:S-D,amount:l}),S+=l-1,D+=l,b=y[++p]}else h.push(S);return{layout:h,countRemoved:D}},u.reflowLargerApplyNewLayout=function(d,y){const h=[];for(let p=0;p<y.length;p++)h.push(d.get(y[p]));for(let p=0;p<h.length;p++)d.set(p,h[p]);d.length=y.length},u.reflowSmallerGetNewLineLengths=function(d,y,h){const p=[],b=d.map(((c,o)=>f(d,o,y))).reduce(((c,o)=>c+o));let D=0,S=0,l=0;for(;l<b;){if(b-l<h){p.push(b-l);break}D+=h;const c=f(d,S,y);D>c&&(D-=c,S++);const o=d[S].getWidth(D-1)===2;o&&D--;const a=o?h-1:h;p.push(a),l+=a}return p},u.getWrappedLineTrimmedLength=f},5295:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferSet=void 0;const d=f(8460),y=f(844),h=f(9092);class p extends y.Disposable{constructor(D,S){super(),this._optionsService=D,this._bufferService=S,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(D){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(D),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(D,S){this._normal.resize(D,S),this._alt.resize(D,S),this.setupTabStops(D)}setupTabStops(D){this._normal.setupTabStops(D),this._alt.setupTabStops(D)}}u.BufferSet=p},511:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CellData=void 0;const d=f(482),y=f(643),h=f(3734);class p extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(D){const S=new p;return S.setFromCharData(D),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(D){this.fg=D[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(D[y.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(D[y.CHAR_DATA_CHAR_INDEX].length===2){const l=D[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const c=D[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(l-55296)+c-56320+65536|D[y.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=D[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|D[y.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=D[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|D[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.CellData=p},643:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WHITESPACE_CELL_CODE=u.WHITESPACE_CELL_WIDTH=u.WHITESPACE_CELL_CHAR=u.NULL_CELL_CODE=u.NULL_CELL_WIDTH=u.NULL_CELL_CHAR=u.CHAR_DATA_CODE_INDEX=u.CHAR_DATA_WIDTH_INDEX=u.CHAR_DATA_CHAR_INDEX=u.CHAR_DATA_ATTR_INDEX=u.DEFAULT_EXT=u.DEFAULT_ATTR=u.DEFAULT_COLOR=void 0,u.DEFAULT_COLOR=0,u.DEFAULT_ATTR=256|u.DEFAULT_COLOR<<9,u.DEFAULT_EXT=0,u.CHAR_DATA_ATTR_INDEX=0,u.CHAR_DATA_CHAR_INDEX=1,u.CHAR_DATA_WIDTH_INDEX=2,u.CHAR_DATA_CODE_INDEX=3,u.NULL_CELL_CHAR="",u.NULL_CELL_WIDTH=1,u.NULL_CELL_CODE=0,u.WHITESPACE_CELL_CHAR=" ",u.WHITESPACE_CELL_WIDTH=1,u.WHITESPACE_CELL_CODE=32},4863:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Marker=void 0;const d=f(8460),y=f(844);class h{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}u.Marker=h,h._nextId=1},7116:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DEFAULT_CHARSET=u.CHARSETS=void 0,u.CHARSETS={},u.DEFAULT_CHARSET=u.CHARSETS.B,u.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},u.CHARSETS.A={"#":"£"},u.CHARSETS.B=void 0,u.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},u.CHARSETS.C=u.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},u.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},u.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},u.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},u.CHARSETS.E=u.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},u.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},u.CHARSETS.H=u.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(F,u)=>{var f,d,y;Object.defineProperty(u,"__esModule",{value:!0}),u.C1_ESCAPED=u.C1=u.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
16
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(f||(u.C0=f={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(d||(u.C1=d={})),(function(h){h.ST=`${f.ESC}\\`})(y||(u.C1_ESCAPED=y={}))},7399:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.evaluateKeyboardEvent=void 0;const d=f(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};u.evaluateKeyboardEvent=function(h,p,b,D){const S={type:0,cancel:!1,key:void 0},l=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?S.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?S.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?S.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(S.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(h.altKey){S.key=d.C0.ESC+d.C0.DEL;break}S.key=d.C0.DEL;break;case 9:if(h.shiftKey){S.key=d.C0.ESC+"[Z";break}S.key=d.C0.HT,S.cancel=!0;break;case 13:S.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,S.cancel=!0;break;case 27:S.key=d.C0.ESC,h.altKey&&(S.key=d.C0.ESC+d.C0.ESC),S.cancel=!0;break;case 37:if(h.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"D",S.key===d.C0.ESC+"[1;3D"&&(S.key=d.C0.ESC+(b?"b":"[1;5D"))):S.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"C",S.key===d.C0.ESC+"[1;3C"&&(S.key=d.C0.ESC+(b?"f":"[1;5C"))):S.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"A",b||S.key!==d.C0.ESC+"[1;3A"||(S.key=d.C0.ESC+"[1;5A")):S.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;l?(S.key=d.C0.ESC+"[1;"+(l+1)+"B",b||S.key!==d.C0.ESC+"[1;3B"||(S.key=d.C0.ESC+"[1;5B")):S.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(S.key=d.C0.ESC+"[2~");break;case 46:S.key=l?d.C0.ESC+"[3;"+(l+1)+"~":d.C0.ESC+"[3~";break;case 36:S.key=l?d.C0.ESC+"[1;"+(l+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:S.key=l?d.C0.ESC+"[1;"+(l+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?S.type=2:h.ctrlKey?S.key=d.C0.ESC+"[5;"+(l+1)+"~":S.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?S.type=3:h.ctrlKey?S.key=d.C0.ESC+"[6;"+(l+1)+"~":S.key=d.C0.ESC+"[6~";break;case 112:S.key=l?d.C0.ESC+"[1;"+(l+1)+"P":d.C0.ESC+"OP";break;case 113:S.key=l?d.C0.ESC+"[1;"+(l+1)+"Q":d.C0.ESC+"OQ";break;case 114:S.key=l?d.C0.ESC+"[1;"+(l+1)+"R":d.C0.ESC+"OR";break;case 115:S.key=l?d.C0.ESC+"[1;"+(l+1)+"S":d.C0.ESC+"OS";break;case 116:S.key=l?d.C0.ESC+"[15;"+(l+1)+"~":d.C0.ESC+"[15~";break;case 117:S.key=l?d.C0.ESC+"[17;"+(l+1)+"~":d.C0.ESC+"[17~";break;case 118:S.key=l?d.C0.ESC+"[18;"+(l+1)+"~":d.C0.ESC+"[18~";break;case 119:S.key=l?d.C0.ESC+"[19;"+(l+1)+"~":d.C0.ESC+"[19~";break;case 120:S.key=l?d.C0.ESC+"[20;"+(l+1)+"~":d.C0.ESC+"[20~";break;case 121:S.key=l?d.C0.ESC+"[21;"+(l+1)+"~":d.C0.ESC+"[21~";break;case 122:S.key=l?d.C0.ESC+"[23;"+(l+1)+"~":d.C0.ESC+"[23~";break;case 123:S.key=l?d.C0.ESC+"[24;"+(l+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(b&&!D||!h.altKey||h.metaKey)!b||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?S.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(S.key=d.C0.US),h.key==="@"&&(S.key=d.C0.NUL)):h.keyCode===65&&(S.type=1);else{const c=y[h.keyCode],o=c?.[h.shiftKey?1:0];if(o)S.key=d.C0.ESC+o;else if(h.keyCode>=65&&h.keyCode<=90){const a=h.ctrlKey?h.keyCode-64:h.keyCode+32;let _=String.fromCharCode(a);h.shiftKey&&(_=_.toUpperCase()),S.key=d.C0.ESC+_}else if(h.keyCode===32)S.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let a=h.code.slice(3,4);h.shiftKey||(a=a.toLowerCase()),S.key=d.C0.ESC+a,S.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?S.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?S.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?S.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?S.key=d.C0.DEL:h.keyCode===219?S.key=d.C0.ESC:h.keyCode===220?S.key=d.C0.FS:h.keyCode===221&&(S.key=d.C0.GS)}return S}},482:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Utf8ToUtf32=u.StringToUtf32=u.utf32ToString=u.stringFromCodePoint=void 0,u.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},u.utf32ToString=function(f,d=0,y=f.length){let h="";for(let p=d;p<y;++p){let b=f[p];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},u.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,d){const y=f.length;if(!y)return 0;let h=0,p=0;if(this._interim){const b=f.charCodeAt(p++);56320<=b&&b<=57343?d[h++]=1024*(this._interim-55296)+b-56320+65536:(d[h++]=this._interim,d[h++]=b),this._interim=0}for(let b=p;b<y;++b){const D=f.charCodeAt(b);if(55296<=D&&D<=56319){if(++b>=y)return this._interim=D,h;const S=f.charCodeAt(b);56320<=S&&S<=57343?d[h++]=1024*(D-55296)+S-56320+65536:(d[h++]=D,d[h++]=S)}else D!==65279&&(d[h++]=D)}return h}},u.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,d){const y=f.length;if(!y)return 0;let h,p,b,D,S=0,l=0,c=0;if(this.interim[0]){let _=!1,g=this.interim[0];g&=(224&g)==192?31:(240&g)==224?15:7;let C,x=0;for(;(C=63&this.interim[++x])&&x<4;)g<<=6,g|=C;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=v-x;for(;c<E;){if(c>=y)return 0;if(C=f[c++],(192&C)!=128){c--,_=!0;break}this.interim[x++]=C,g<<=6,g|=63&C}_||(v===2?g<128?c--:d[S++]=g:v===3?g<2048||g>=55296&&g<=57343||g===65279||(d[S++]=g):g<65536||g>1114111||(d[S++]=g)),this.interim.fill(0)}const o=y-4;let a=c;for(;a<y;){for(;!(!(a<o)||128&(h=f[a])||128&(p=f[a+1])||128&(b=f[a+2])||128&(D=f[a+3]));)d[S++]=h,d[S++]=p,d[S++]=b,d[S++]=D,a+=4;if(h=f[a++],h<128)d[S++]=h;else if((224&h)==192){if(a>=y)return this.interim[0]=h,S;if(p=f[a++],(192&p)!=128){a--;continue}if(l=(31&h)<<6|63&p,l<128){a--;continue}d[S++]=l}else if((240&h)==224){if(a>=y)return this.interim[0]=h,S;if(p=f[a++],(192&p)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=p,S;if(b=f[a++],(192&b)!=128){a--;continue}if(l=(15&h)<<12|(63&p)<<6|63&b,l<2048||l>=55296&&l<=57343||l===65279)continue;d[S++]=l}else if((248&h)==240){if(a>=y)return this.interim[0]=h,S;if(p=f[a++],(192&p)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=p,S;if(b=f[a++],(192&b)!=128){a--;continue}if(a>=y)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=b,S;if(D=f[a++],(192&D)!=128){a--;continue}if(l=(7&h)<<18|(63&p)<<12|(63&b)<<6|63&D,l<65536||l>1114111)continue;d[S++]=l}}return S}}},225:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeV6=void 0;const f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;u.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let h=0;h<f.length;++h)y.fill(0,f[h][0],f[h][1]+1)}}wcwidth(h){return h<32?0:h<127?1:h<65536?y[h]:(function(p,b){let D,S=0,l=b.length-1;if(p<b[0][0]||p>b[l][1])return!1;for(;l>=S;)if(D=S+l>>1,p>b[D][1])S=D+1;else{if(!(p<b[D][0]))return!0;l=D-1}return!1})(h,d)?0:h>=131072&&h<=196605||h>=196608&&h<=262141?2:1}}},5981:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WriteBuffer=void 0;const d=f(8460),y=f(844);class h extends y.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,D){if(D!==void 0&&this._syncCalls>D)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,D){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(D),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(D)}_innerWrite(b=0,D=!0){const S=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],c=this._action(l,D);if(c){const a=_=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(S,_);return void c.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(a)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}u.WriteBuffer=h},5941:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.toRgbString=u.parseColor=void 0;const f=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function y(h,p){const b=h.toString(16),D=b.length<2?"0"+b:b;switch(p){case 4:return b[0];case 8:return D;case 12:return(D+D).slice(0,3);default:return D+D}}u.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const b=f.exec(p);if(b){const D=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/D*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/D*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/D*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const b=p.length/3,D=[0,0,0];for(let S=0;S<3;++S){const l=parseInt(p.slice(b*S,b*S+b),16);D[S]=b===1?l<<4:b===2?l:b===3?l>>4:l>>8}return D}},u.toRgbString=function(h,p=16){const[b,D,S]=h;return`rgb:${y(b,p)}/${y(D,p)}/${y(S,p)}`}},5770:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.PAYLOAD_LIMIT=void 0,u.PAYLOAD_LIMIT=1e7},6351:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DcsHandler=u.DcsParser=void 0;const d=f(482),y=f(8742),h=f(5770),p=[];u.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(D,S){this._handlers[D]===void 0&&(this._handlers[D]=[]);const l=this._handlers[D];return l.push(S),{dispose:()=>{const c=l.indexOf(S);c!==-1&&l.splice(c,1)}}}clearHandler(D){this._handlers[D]&&delete this._handlers[D]}setHandlerFallback(D){this._handlerFb=D}reset(){if(this._active.length)for(let D=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;D>=0;--D)this._active[D].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(D,S){if(this.reset(),this._ident=D,this._active=this._handlers[D]||p,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(D,S,l){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(D,S,l);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(D,S,l))}unhook(D,S=!0){if(this._active.length){let l=!1,c=this._active.length-1,o=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,l=S,o=this._stack.fallThrough,this._stack.paused=!1),!o&&l===!1){for(;c>=0&&(l=this._active[c].unhook(D),l!==!0);c--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,l;c--}for(;c>=0;c--)if(l=this._active[c].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",D);this._active=p,this._ident=0}};const b=new y.Params;b.addParam(0),u.DcsHandler=class{constructor(D){this._handler=D,this._data="",this._params=b,this._hitLimit=!1}hook(D){this._params=D.length>1||D.params[0]?D.clone():b,this._data="",this._hitLimit=!1}put(D,S,l){this._hitLimit||(this._data+=(0,d.utf32ToString)(D,S,l),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(D){let S=!1;if(this._hitLimit)S=!1;else if(D&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((l=>(this._params=b,this._data="",this._hitLimit=!1,l)));return this._params=b,this._data="",this._hitLimit=!1,S}}},2015:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.EscapeSequenceParser=u.VT500_TRANSITION_TABLE=u.TransitionTable=void 0;const d=f(844),y=f(8742),h=f(6242),p=f(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,o){this.table.fill(c<<4|o)}add(c,o,a,_){this.table[o<<8|c]=a<<4|_}addMany(c,o,a,_){for(let g=0;g<c.length;g++)this.table[o<<8|c[g]]=a<<4|_}}u.TransitionTable=b;const D=160;u.VT500_TRANSITION_TABLE=(function(){const l=new b(4095),c=Array.apply(null,Array(256)).map(((x,v)=>v)),o=(x,v)=>c.slice(x,v),a=o(32,127),_=o(0,24);_.push(25),_.push.apply(_,o(28,32));const g=o(0,14);let C;for(C in l.setDefault(1,0),l.addMany(a,0,2,0),g)l.addMany([24,26,153,154],C,3,0),l.addMany(o(128,144),C,3,0),l.addMany(o(144,152),C,3,0),l.add(156,C,0,0),l.add(27,C,11,1),l.add(157,C,4,8),l.addMany([152,158,159],C,0,7),l.add(155,C,11,3),l.add(144,C,11,9);return l.addMany(_,0,3,0),l.addMany(_,1,3,1),l.add(127,1,0,1),l.addMany(_,8,0,8),l.addMany(_,3,3,3),l.add(127,3,0,3),l.addMany(_,4,3,4),l.add(127,4,0,4),l.addMany(_,6,3,6),l.addMany(_,5,3,5),l.add(127,5,0,5),l.addMany(_,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(a,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(o(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(a,7,0,7),l.addMany(_,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(o(64,127),3,7,0),l.addMany(o(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(o(48,60),4,8,4),l.addMany(o(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(o(32,64),6,0,6),l.add(127,6,0,6),l.addMany(o(64,127),6,0,0),l.addMany(o(32,48),3,9,5),l.addMany(o(32,48),5,9,5),l.addMany(o(48,64),5,0,6),l.addMany(o(64,127),5,7,0),l.addMany(o(32,48),4,9,5),l.addMany(o(32,48),1,9,2),l.addMany(o(32,48),2,9,2),l.addMany(o(48,127),2,10,0),l.addMany(o(48,80),1,10,0),l.addMany(o(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(o(96,127),1,10,0),l.add(80,1,11,9),l.addMany(_,9,0,9),l.add(127,9,0,9),l.addMany(o(28,32),9,0,9),l.addMany(o(32,48),9,9,12),l.addMany(o(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(_,11,0,11),l.addMany(o(32,128),11,0,11),l.addMany(o(28,32),11,0,11),l.addMany(_,10,0,10),l.add(127,10,0,10),l.addMany(o(28,32),10,0,10),l.addMany(o(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(o(32,48),10,9,12),l.addMany(_,12,0,12),l.add(127,12,0,12),l.addMany(o(28,32),12,0,12),l.addMany(o(32,48),12,9,12),l.addMany(o(48,64),12,0,11),l.addMany(o(64,127),12,12,13),l.addMany(o(64,127),10,12,13),l.addMany(o(64,127),9,12,13),l.addMany(_,13,13,13),l.addMany(a,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(D,0,2,0),l.add(D,8,5,8),l.add(D,6,0,6),l.add(D,11,0,11),l.add(D,13,13,13),l})();class S extends d.Disposable{constructor(c=u.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(o,a,_)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,a)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,o=[64,126]){let a=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=c.prefix.charCodeAt(0),a&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let g=0;g<c.intermediates.length;++g){const C=c.intermediates.charCodeAt(g);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=C}}if(c.final.length!==1)throw new Error("final must be a single byte");const _=c.final.charCodeAt(0);if(o[0]>_||_>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return a<<=8,a|=_,a}identToString(c){const o=[];for(;c;)o.push(String.fromCharCode(255&c)),c>>=8;return o.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,o){const a=this._identifier(c,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);const _=this._escHandlers[a];return _.push(o),{dispose:()=>{const g=_.indexOf(o);g!==-1&&_.splice(g,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,o){this._executeHandlers[c.charCodeAt(0)]=o}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,o){const a=this._identifier(c);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);const _=this._csiHandlers[a];return _.push(o),{dispose:()=>{const g=_.indexOf(o);g!==-1&&_.splice(g,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,o){return this._dcsParser.registerHandler(this._identifier(c),o)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,o){return this._oscParser.registerHandler(c,o)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(c,o,a,_,g){this._parseStack.state=c,this._parseStack.handlers=o,this._parseStack.handlerPos=a,this._parseStack.transition=_,this._parseStack.chunkPos=g}parse(c,o,a){let _,g=0,C=0,x=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,x=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&E>-1){for(;E>=0&&(_=v[E](this._params),_!==!0);E--)if(_ instanceof Promise)return this._parseStack.handlerPos=E,_}this._parseStack.handlers=[];break;case 4:if(a===!1&&E>-1){for(;E>=0&&(_=v[E](),_!==!0);E--)if(_ instanceof Promise)return this._parseStack.handlerPos=E,_}this._parseStack.handlers=[];break;case 6:if(g=c[this._parseStack.chunkPos],_=this._dcsParser.unhook(g!==24&&g!==26,a),_)return _;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(g=c[this._parseStack.chunkPos],_=this._oscParser.end(g!==24&&g!==26,a),_)return _;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,x=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let v=x;v<o;++v){switch(g=c[v],C=this._transitions.table[this.currentState<<8|(g<160?g:D)],C>>4){case 2:for(let U=v+1;;++U){if(U>=o||(g=c[U])<32||g>126&&g<D){this._printHandler(c,v,U),v=U-1;break}if(++U>=o||(g=c[U])<32||g>126&&g<D){this._printHandler(c,v,U),v=U-1;break}if(++U>=o||(g=c[U])<32||g>126&&g<D){this._printHandler(c,v,U),v=U-1;break}if(++U>=o||(g=c[U])<32||g>126&&g<D){this._printHandler(c,v,U),v=U-1;break}}break;case 3:this._executeHandlers[g]?this._executeHandlers[g]():this._executeHandlerFb(g),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:g,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|g];let B=E?E.length-1:-1;for(;B>=0&&(_=E[B](this._params),_!==!0);B--)if(_ instanceof Promise)return this._preserveStack(3,E,B,C,v),_;B<0&&this._csiHandlerFb(this._collect<<8|g,this._params),this.precedingCodepoint=0;break;case 8:do switch(g){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(g-48)}while(++v<o&&(g=c[v])>47&&g<60);v--;break;case 9:this._collect<<=8,this._collect|=g;break;case 10:const z=this._escHandlers[this._collect<<8|g];let L=z?z.length-1:-1;for(;L>=0&&(_=z[L](),_!==!0);L--)if(_ instanceof Promise)return this._preserveStack(4,z,L,C,v),_;L<0&&this._escHandlerFb(this._collect<<8|g),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|g,this._params);break;case 13:for(let U=v+1;;++U)if(U>=o||(g=c[U])===24||g===26||g===27||g>127&&g<D){this._dcsParser.put(c,v,U),v=U-1;break}break;case 14:if(_=this._dcsParser.unhook(g!==24&&g!==26),_)return this._preserveStack(6,[],0,C,v),_;g===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let U=v+1;;U++)if(U>=o||(g=c[U])<32||g>127&&g<D){this._oscParser.put(c,v,U),v=U-1;break}break;case 6:if(_=this._oscParser.end(g!==24&&g!==26),_)return this._preserveStack(5,[],0,C,v),_;g===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}u.EscapeSequenceParser=S},6242:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OscHandler=u.OscParser=void 0;const d=f(5770),y=f(482),h=[];u.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,b){this._handlers[p]===void 0&&(this._handlers[p]=[]);const D=this._handlers[p];return D.push(b),{dispose:()=>{const S=D.indexOf(b);S!==-1&&D.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,b,D){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,b,D);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(p,b,D))}start(){this.reset(),this._state=1}put(p,b,D){if(this._state!==3){if(this._state===1)for(;b<D;){const S=p[b++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&D-b>0&&this._put(p,b,D)}}end(p,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let D=!1,S=this._active.length-1,l=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,D=b,l=this._stack.fallThrough,this._stack.paused=!1),!l&&D===!1){for(;S>=0&&(D=this._active[S].end(p),D!==!0);S--)if(D instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,D;S--}for(;S>=0;S--)if(D=this._active[S].end(!1),D instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,D}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},u.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,b,D){this._hitLimit||(this._data+=(0,y.utf32ToString)(p,b,D),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let b=!1;if(this._hitLimit)b=!1;else if(p&&(b=this._handler(this._data),b instanceof Promise))return b.then((D=>(this._data="",this._hitLimit=!1,D)));return this._data="",this._hitLimit=!1,b}}},8742:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Params=void 0;const f=2147483647;class d{static fromArray(h){const p=new d;if(!h.length)return p;for(let b=Array.isArray(h[0])?1:0;b<h.length;++b){const D=h[b];if(Array.isArray(D))for(let S=0;S<D.length;++S)p.addSubParam(D[S]);else p.addParam(D)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const b=this._subParamsIdx[p]>>8,D=255&this._subParamsIdx[p];D-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,D))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>f?f:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>f?f:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];return b-p>0?this._subParams.subarray(p,b):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const b=this._subParamsIdx[p]>>8,D=255&this._subParamsIdx[p];D-b>0&&(h[p]=this._subParams.slice(b,D))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,D=b[p-1];b[p-1]=~D?Math.min(10*D+h,f):h}}u.Params=d},5741:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.AddonManager=void 0,u.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===f){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(d,1)}}},8771:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferApiView=void 0;const d=f(3785),y=f(511);u.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const p=this._buffer.lines.get(h);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new y.CellData}}},3785:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLineApiView=void 0;const d=f(511);u.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,h){if(!(y<0||y>=this._line.length))return h?(this._line.loadCell(y,h),h):this._line.loadCell(y,new d.CellData)}translateToString(y,h,p){return this._line.translateToString(y,h,p)}}},8285:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferNamespaceApi=void 0;const d=f(8771),y=f(8460),h=f(844);class p extends h.Disposable{constructor(D){super(),this._core=D,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}u.BufferNamespaceApi=p},7975:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ParserApi=void 0,u.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,d){return this._core.registerCsiHandler(f,(y=>d(y.toArray())))}addCsiHandler(f,d){return this.registerCsiHandler(f,d)}registerDcsHandler(f,d){return this._core.registerDcsHandler(f,((y,h)=>d(y,h.toArray())))}addDcsHandler(f,d){return this.registerDcsHandler(f,d)}registerEscHandler(f,d){return this._core.registerEscHandler(f,d)}addEscHandler(f,d){return this.registerEscHandler(f,d)}registerOscHandler(f,d){return this._core.registerOscHandler(f,d)}addOscHandler(f,d){return this.registerOscHandler(f,d)}}},7090:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeApi=void 0,u.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(F,u,f){var d=this&&this.__decorate||function(l,c,o,a){var _,g=arguments.length,C=g<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,o,a);else for(var x=l.length-1;x>=0;x--)(_=l[x])&&(C=(g<3?_(C):g>3?_(c,o,C):_(c,o))||C);return g>3&&C&&Object.defineProperty(c,o,C),C},y=this&&this.__param||function(l,c){return function(o,a){c(o,a,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferService=u.MINIMUM_ROWS=u.MINIMUM_COLS=void 0;const h=f(8460),p=f(844),b=f(5295),D=f(2585);u.MINIMUM_COLS=2,u.MINIMUM_ROWS=1;let S=u.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,u.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,u.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(l,this))}resize(l,c){this.cols=l,this.rows=c,this.buffers.resize(l,c),this._onResize.fire({cols:l,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,c=!1){const o=this.buffer;let a;a=this._cachedBlankLine,a&&a.length===this.cols&&a.getFg(0)===l.fg&&a.getBg(0)===l.bg||(a=o.getBlankLine(l,c),this._cachedBlankLine=a),a.isWrapped=c;const _=o.ybase+o.scrollTop,g=o.ybase+o.scrollBottom;if(o.scrollTop===0){const C=o.lines.isFull;g===o.lines.length-1?C?o.lines.recycle().copyFrom(a):o.lines.push(a.clone()):o.lines.splice(g+1,0,a.clone()),C?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const C=g-_+1;o.lines.shiftElements(_+1,C-1,-1),o.lines.set(g,a.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(l,c,o){const a=this.buffer;if(l<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else l+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);const _=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+l,a.ybase),0),_!==a.ydisp&&(c||this._onScroll.fire(a.ydisp))}};u.BufferService=S=d([y(0,D.IOptionsService)],S)},7994:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CharsetService=void 0,u.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(f){this.glevel=f,this.charset=this._charsets[f]}setgCharset(f,d){this._charsets[f]=d,this.glevel===f&&(this.charset=d)}}},1753:function(F,u,f){var d=this&&this.__decorate||function(a,_,g,C){var x,v=arguments.length,E=v<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,g):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,_,g,C);else for(var B=a.length-1;B>=0;B--)(x=a[B])&&(E=(v<3?x(E):v>3?x(_,g,E):x(_,g))||E);return v>3&&E&&Object.defineProperty(_,g,E),E},y=this&&this.__param||function(a,_){return function(g,C){_(g,C,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreMouseService=void 0;const h=f(2585),p=f(8460),b=f(844),D={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:a=>a.button!==4&&a.action===1&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)},VT200:{events:19,restrict:a=>a.action!==32},DRAG:{events:23,restrict:a=>a.action!==32||a.button!==3},ANY:{events:31,restrict:a=>!0}};function S(a,_){let g=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return a.button===4?(g|=64,g|=a.action):(g|=3&a.button,4&a.button&&(g|=64),8&a.button&&(g|=128),a.action===32?g|=32:a.action!==0||_||(g|=3)),g}const l=String.fromCharCode,c={DEFAULT:a=>{const _=[S(a,!1)+32,a.col+32,a.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${l(_[0])}${l(_[1])}${l(_[2])}`},SGR:a=>{const _=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${S(a,!0)};${a.col};${a.row}${_}`},SGR_PIXELS:a=>{const _=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${S(a,!0)};${a.x};${a.y}${_}`}};let o=u.CoreMouseService=class extends b.Disposable{constructor(a,_){super(),this._bufferService=a,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const g of Object.keys(D))this.addProtocol(g,D[g]);for(const g of Object.keys(c))this.addEncoding(g,c[g]);this.reset()}addProtocol(a,_){this._protocols[a]=_}addEncoding(a,_){this._encodings[a]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(a){if(!this._protocols[a])throw new Error(`unknown protocol "${a}"`);this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(a){if(!this._encodings[a])throw new Error(`unknown encoding "${a}"`);this._activeEncoding=a}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows||a.button===4&&a.action===32||a.button===3&&a.action!==32||a.button!==4&&(a.action===2||a.action===3)||(a.col++,a.row++,a.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,a,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(a))return!1;const _=this._encodings[this._activeEncoding](a);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=a,!0}explainEvents(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}}_equalEvents(a,_,g){if(g){if(a.x!==_.x||a.y!==_.y)return!1}else if(a.col!==_.col||a.row!==_.row)return!1;return a.button===_.button&&a.action===_.action&&a.ctrl===_.ctrl&&a.alt===_.alt&&a.shift===_.shift}};u.CoreMouseService=o=d([y(0,h.IBufferService),y(1,h.ICoreService)],o)},6975:function(F,u,f){var d=this&&this.__decorate||function(o,a,_,g){var C,x=arguments.length,v=x<3?a:g===null?g=Object.getOwnPropertyDescriptor(a,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(o,a,_,g);else for(var E=o.length-1;E>=0;E--)(C=o[E])&&(v=(x<3?C(v):x>3?C(a,_,v):C(a,_))||v);return x>3&&v&&Object.defineProperty(a,_,v),v},y=this&&this.__param||function(o,a){return function(_,g){a(_,g,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreService=void 0;const h=f(1439),p=f(8460),b=f(844),D=f(2585),S=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=u.CoreService=class extends b.Disposable{constructor(o,a,_){super(),this._bufferService=o,this._logService=a,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(S),this.decPrivateModes=(0,h.clone)(l)}reset(){this.modes=(0,h.clone)(S),this.decPrivateModes=(0,h.clone)(l)}triggerDataEvent(o,a=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;a&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),a&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((g=>g.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((a=>a.charCodeAt(0))))),this._onBinary.fire(o))}};u.CoreService=c=d([y(0,D.IBufferService),y(1,D.ILogService),y(2,D.IOptionsService)],c)},9074:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DecorationService=void 0;const d=f(8055),y=f(8460),h=f(844),p=f(6106);let b=0,D=0;class S extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((o=>o?.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const a=new l(o);if(a){const _=a.marker.onDispose((()=>a.dispose()));a.onDispose((()=>{a&&(this._decorations.delete(a)&&this._onDecorationRemoved.fire(a),_.dispose())})),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,a,_){var g,C,x;let v=0,E=0;for(const B of this._decorations.getKeyIterator(a))v=(g=B.options.x)!==null&&g!==void 0?g:0,E=v+((C=B.options.width)!==null&&C!==void 0?C:1),o>=v&&o<E&&(!_||((x=B.options.layer)!==null&&x!==void 0?x:"bottom")===_)&&(yield B)}forEachDecorationAtCell(o,a,_,g){this._decorations.forEachByKey(a,(C=>{var x,v,E;b=(x=C.options.x)!==null&&x!==void 0?x:0,D=b+((v=C.options.width)!==null&&v!==void 0?v:1),o>=b&&o<D&&(!_||((E=C.options.layer)!==null&&E!==void 0?E:"bottom")===_)&&g(C)}))}}u.DecorationService=S;class l extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.InstantiationService=u.ServiceCollection=void 0;const d=f(2585),y=f(8343);class h{constructor(...b){this._entries=new Map;for(const[D,S]of b)this.set(D,S)}set(b,D){const S=this._entries.get(b);return this._entries.set(b,D),S}forEach(b){for(const[D,S]of this._entries.entries())b(D,S)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}u.ServiceCollection=h,u.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(p,b){this._services.set(p,b)}getService(p){return this._services.get(p)}createInstance(p,...b){const D=(0,y.getServiceDependencies)(p).sort(((c,o)=>c.index-o.index)),S=[];for(const c of D){const o=this._services.get(c.id);if(!o)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${c.id}.`);S.push(o)}const l=D.length>0?D[0].index:b.length;if(b.length!==l)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${l+1} conflicts with ${b.length} static arguments`);return new p(...b,...S)}}},7866:function(F,u,f){var d=this&&this.__decorate||function(l,c,o,a){var _,g=arguments.length,C=g<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,o,a);else for(var x=l.length-1;x>=0;x--)(_=l[x])&&(C=(g<3?_(C):g>3?_(c,o,C):_(c,o))||C);return g>3&&C&&Object.defineProperty(c,o,C),C},y=this&&this.__param||function(l,c){return function(o,a){c(o,a,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.traceCall=u.setTraceLogger=u.LogService=void 0;const h=f(844),p=f(2585),b={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let D,S=u.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),D=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let c=0;c<l.length;c++)typeof l[c]=="function"&&(l[c]=l[c]())}_log(l,c,o){this._evalLazyOptionalParams(o),l.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(l,...c){var o,a;this._logLevel<=p.LogLevelEnum.TRACE&&this._log((a=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&a!==void 0?a:console.log,l,c)}debug(l,...c){var o,a;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log((a=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&a!==void 0?a:console.log,l,c)}info(l,...c){var o,a;this._logLevel<=p.LogLevelEnum.INFO&&this._log((a=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&a!==void 0?a:console.info,l,c)}warn(l,...c){var o,a;this._logLevel<=p.LogLevelEnum.WARN&&this._log((a=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&a!==void 0?a:console.warn,l,c)}error(l,...c){var o,a;this._logLevel<=p.LogLevelEnum.ERROR&&this._log((a=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&a!==void 0?a:console.error,l,c)}};u.LogService=S=d([y(0,p.IOptionsService)],S),u.setTraceLogger=function(l){D=l},u.traceCall=function(l,c,o){if(typeof o.value!="function")throw new Error("not supported");const a=o.value;o.value=function(..._){if(D.logLevel!==p.LogLevelEnum.TRACE)return a.apply(this,_);D.trace(`GlyphRenderer#${a.name}(${_.map((C=>JSON.stringify(C))).join(", ")})`);const g=a.apply(this,_);return D.trace(`GlyphRenderer#${a.name} return`,g),g}}},7302:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OptionsService=u.DEFAULT_OPTIONS=void 0;const d=f(8460),y=f(844),h=f(6114);u.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends y.Disposable{constructor(S){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l=Object.assign({},u.DEFAULT_OPTIONS);for(const c in S)if(c in l)try{const o=S[c];l[c]=this._sanitizeAndValidateOption(c,o)}catch(o){console.error(o)}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}onSpecificOptionChange(S,l){return this.onOptionChange((c=>{c===S&&l(this.rawOptions[S])}))}onMultipleOptionChange(S,l){return this.onOptionChange((c=>{S.indexOf(c)!==-1&&l()}))}_setupOptions(){const S=c=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},l=(c,o)=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);o=this._sanitizeAndValidateOption(c,o),this.rawOptions[c]!==o&&(this.rawOptions[c]=o,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const o={get:S.bind(this,c),set:l.bind(this,c)};Object.defineProperty(this.options,c,o)}}_sanitizeAndValidateOption(S,l){switch(S){case"cursorStyle":if(l||(l=u.DEFAULT_OPTIONS[S]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(l))throw new Error(`"${l}" is not a valid value for ${S}`);break;case"wordSeparator":l||(l=u.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=p.includes(l)?l:u.DEFAULT_OPTIONS[S];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${S} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${S} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}u.OptionsService=b},2660:function(F,u,f){var d=this&&this.__decorate||function(b,D,S,l){var c,o=arguments.length,a=o<3?D:l===null?l=Object.getOwnPropertyDescriptor(D,S):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,D,S,l);else for(var _=b.length-1;_>=0;_--)(c=b[_])&&(a=(o<3?c(a):o>3?c(D,S,a):c(D,S))||a);return o>3&&a&&Object.defineProperty(D,S,a),a},y=this&&this.__param||function(b,D){return function(S,l){D(S,l,b)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkService=void 0;const h=f(2585);let p=u.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const D=this._bufferService.buffer;if(b.id===void 0){const _=D.addMarker(D.ybase+D.y),g={data:b,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(g,_))),this._dataByLinkId.set(g.id,g),g.id}const S=b,l=this._getEntryIdKey(S),c=this._entriesWithId.get(l);if(c)return this.addLineToLink(c.id,D.ybase+D.y),c.id;const o=D.addMarker(D.ybase+D.y),a={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(a,o))),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(b,D){const S=this._dataByLinkId.get(b);if(S&&S.lines.every((l=>l.line!==D))){const l=this._bufferService.buffer.addMarker(D);S.lines.push(l),l.onDispose((()=>this._removeMarkerFromLink(S,l)))}}getLinkData(b){var D;return(D=this._dataByLinkId.get(b))===null||D===void 0?void 0:D.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,D){const S=b.lines.indexOf(D);S!==-1&&(b.lines.splice(S,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};u.OscLinkService=p=d([y(0,h.IBufferService)],p)},8343:(F,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createDecorator=u.getServiceDependencies=u.serviceRegistry=void 0;const f="di$target",d="di$dependencies";u.serviceRegistry=new Map,u.getServiceDependencies=function(y){return y[d]||[]},u.createDecorator=function(y){if(u.serviceRegistry.has(y))return u.serviceRegistry.get(y);const h=function(p,b,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,l,c){l[f]===l?l[d].push({id:S,index:c}):(l[d]=[{id:S,index:c}],l[f]=l)})(h,p,D)};return h.toString=()=>y,u.serviceRegistry.set(y,h),h}},2585:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.IDecorationService=u.IUnicodeService=u.IOscLinkService=u.IOptionsService=u.ILogService=u.LogLevelEnum=u.IInstantiationService=u.ICharsetService=u.ICoreService=u.ICoreMouseService=u.IBufferService=void 0;const d=f(8343);var y;u.IBufferService=(0,d.createDecorator)("BufferService"),u.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),u.ICoreService=(0,d.createDecorator)("CoreService"),u.ICharsetService=(0,d.createDecorator)("CharsetService"),u.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(y||(u.LogLevelEnum=y={})),u.ILogService=(0,d.createDecorator)("LogService"),u.IOptionsService=(0,d.createDecorator)("OptionsService"),u.IOscLinkService=(0,d.createDecorator)("OscLinkService"),u.IUnicodeService=(0,d.createDecorator)("UnicodeService"),u.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(F,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeService=void 0;const d=f(8460),y=f(225);u.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const h=new y.UnicodeV6;this.register(h),this._active=h.version,this._activeProvider=h}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(h){if(!this._providers[h])throw new Error(`unknown Unicode version "${h}"`);this._active=h,this._activeProvider=this._providers[h],this._onChange.fire(h)}register(h){this._providers[h.version]=h}wcwidth(h){return this._activeProvider.wcwidth(h)}getStringCellWidth(h){let p=0;const b=h.length;for(let D=0;D<b;++D){let S=h.charCodeAt(D);if(55296<=S&&S<=56319){if(++D>=b)return p+this.wcwidth(S);const l=h.charCodeAt(D);56320<=l&&l<=57343?S=1024*(S-55296)+l-56320+65536:p+=this.wcwidth(l)}p+=this.wcwidth(S)}return p}}}},G={};function ce(F){var u=G[F];if(u!==void 0)return u.exports;var f=G[F]={exports:{}};return ye[F].call(f.exports,f,f.exports,ce),f.exports}var me={};return(()=>{var F=me;Object.defineProperty(F,"__esModule",{value:!0}),F.Terminal=void 0;const u=ce(9042),f=ce(3236),d=ce(844),y=ce(5741),h=ce(8285),p=ce(7975),b=ce(7090),D=["cols","rows"];class S extends d.Disposable{constructor(c){super(),this._core=this.register(new f.Terminal(c)),this._addonManager=this.register(new y.AddonManager),this._publicOptions=Object.assign({},this._core.options);const o=_=>this._core.options[_],a=(_,g)=>{this._checkReadonlyOptions(_),this._core.options[_]=g};for(const _ in this._core.options){const g={get:o.bind(this,_),set:a.bind(this,_)};Object.defineProperty(this._publicOptions,_,g)}}_checkReadonlyOptions(c){if(D.includes(c))throw new Error(`Option "${c}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const o in c)this._publicOptions[o]=c[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(c,o){this._verifyIntegers(c,o),this._core.resize(c,o)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){var o,a,_;return this._checkProposedApi(),this._verifyPositiveIntegers((o=c.x)!==null&&o!==void 0?o:0,(a=c.width)!==null&&a!==void 0?a:0,(_=c.height)!==null&&_!==void 0?_:0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,o,a){this._verifyIntegers(c,o,a),this._core.select(c,o,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,o){this._verifyIntegers(c,o),this._core.selectLines(c,o)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,o){this._core.write(c,o)}writeln(c,o){this._core.write(c),this._core.write(`\r
17
+ `,o)}paste(c){this._core.paste(c)}refresh(c,o){this._verifyIntegers(c,o),this._core.refresh(c,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return u}_verifyIntegers(...c){for(const o of c)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const o of c)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}F.Terminal=S})(),me})()))})(Yo)),Yo.exports}var wv=Ev();function Ni(k="req"){return`${k}_${Math.random().toString(36).slice(2,10)}`}function hn(k){return K.jsxs("section",{className:"rounded-3xl border border-slate-800/80 bg-slate-900/72 p-5 shadow-2xl shadow-slate-950/30 backdrop-blur",children:[K.jsx("div",{className:"mb-4 flex items-center justify-between gap-3",children:K.jsx("h2",{className:"text-lg font-semibold text-white",children:k.title})}),k.children]})}function dr(k){return K.jsxs("label",{className:"block",children:[K.jsx("span",{className:"mb-2 block text-sm text-slate-400",children:k.label}),K.jsx("input",{className:"w-full rounded-2xl border border-slate-700 bg-slate-950/60 px-4 py-3 text-[16px] outline-none placeholder:text-slate-500 disabled:opacity-50",value:k.value,onChange:he=>k.onChange(he.target.value),placeholder:k.placeholder,disabled:k.disabled})]})}function xv(k){const he=k.kind==="error"?"border-rose-500/40 bg-rose-500/10 text-rose-100":k.kind==="success"?"border-emerald-500/40 bg-emerald-500/10 text-emerald-100":"border-sky-500/40 bg-sky-500/10 text-sky-100";return K.jsxs("div",{className:`flex items-start justify-between gap-3 rounded-2xl border px-4 py-3 text-sm ${he}`,children:[K.jsx("p",{children:k.text}),K.jsx("button",{className:"rounded-full border border-current/30 px-3 py-1 text-xs",type:"button",onClick:k.onDismiss,children:"关闭"})]})}function Xf(k){const he=k.connectionPhase==="connected",ye=k.showConnectionFields??!0,G=k.showPairingSection??!0,ce=k.showActions??!0;return K.jsx(hn,{title:k.title??"连接",children:K.jsxs("div",{className:"space-y-3",children:[ye?K.jsxs(K.Fragment,{children:[K.jsx(dr,{label:"WebSocket 地址",value:k.wsUrl,onChange:k.onWsUrlChange}),K.jsx(dr,{label:"访问令牌",value:k.clientToken,onChange:k.onClientTokenChange,placeholder:"首次配对后会自动写入"}),K.jsx(dr,{label:"设备 ID",value:k.deviceId,onChange:k.onDeviceIdChange,disabled:!k.deviceIdEditable})]}):null,G?K.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-950/40 p-3",children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"设备配对"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"电脑上执行 `termpilot agent --relay 你的 relay 地址`。命令会直接启动后台 agent 并打印一次性配对码。"}),K.jsxs("div",{className:"mt-3 flex gap-3",children:[K.jsx("input",{className:"flex-1 rounded-2xl border border-slate-700 bg-slate-950/60 px-4 py-3 text-[16px] uppercase outline-none placeholder:text-slate-500",value:k.pairingCode,onChange:me=>k.onPairingCodeChange(me.target.value),placeholder:"ABC-234"}),K.jsx("button",{className:"rounded-full bg-emerald-400 px-4 py-3 text-sm font-medium text-slate-950 disabled:opacity-60",type:"button",disabled:k.pairingPending||!k.wsUrlValid,onClick:k.onRedeemPairingCode,children:k.pairingPending?"配对中":"配对"})]}),k.pairingMessage?K.jsx("p",{className:"mt-2 text-xs text-slate-400",children:k.pairingMessage}):null]}):null,ce?K.jsxs(K.Fragment,{children:[K.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[K.jsx("button",{className:"w-full rounded-full bg-sky-500 px-4 py-2.5 text-sm font-medium text-slate-950 disabled:opacity-60",disabled:k.connectionPhase==="connecting"||!k.wsUrlValid,onClick:k.onConnect,children:he?"重新连接":k.connectionPhase==="connecting"?"连接中":"连接"}),K.jsx("button",{className:"w-full rounded-full border border-slate-700 px-4 py-2.5 text-sm text-slate-200 disabled:opacity-40",disabled:!he,onClick:k.onRefresh,children:"刷新"}),K.jsx("button",{className:"w-full rounded-full border border-slate-700 px-4 py-2.5 text-sm text-slate-200 disabled:opacity-40",disabled:k.connectionPhase==="idle",onClick:k.onDisconnect,children:"断开"})]}),K.jsx("button",{className:"w-full rounded-full border border-rose-500/40 px-4 py-2.5 text-sm text-rose-200",type:"button",onClick:k.onClearBinding,children:"清除本机绑定"}),K.jsx("button",{className:"w-full rounded-full border border-slate-700 px-4 py-2.5 text-sm text-slate-200",type:"button",onClick:k.onToggleNotifications,children:k.notificationsEnabled?"关闭浏览器提醒":"开启浏览器提醒"}),K.jsx("p",{className:"text-xs text-slate-500",children:"断线后会自动重连。连接参数、访问令牌和最近查看的会话会保存在本机浏览器里。"})]}):null]})})}function Vf(k){return K.jsx(hn,{title:"创建会话",children:K.jsxs("form",{className:"space-y-3",onSubmit:k.onSubmit,children:[K.jsx(dr,{label:"名称",value:k.createName,onChange:k.onCreateNameChange,placeholder:"claude-main",disabled:!k.canControl}),K.jsx(dr,{label:"工作目录",value:k.createCwd,onChange:k.onCreateCwdChange,placeholder:"/Users/...",disabled:!k.canControl}),K.jsx(dr,{label:"Shell",value:k.createShell,onChange:k.onCreateShellChange,placeholder:"/bin/zsh",disabled:!k.canControl}),K.jsx("button",{className:"w-full rounded-full bg-emerald-400 px-4 py-2.5 text-sm font-medium text-slate-950 disabled:opacity-60",type:"submit",disabled:!k.canControl,children:"创建"})]})})}const Dv=[{value:"all",label:"全部"},{value:"running",label:"运行中"},{value:"exited",label:"已退出"}];function Pf(k){return K.jsx(hn,{title:"会话列表",children:K.jsxs("div",{className:"space-y-3",children:[K.jsx("input",{className:"w-full rounded-2xl border border-slate-700 bg-slate-950/60 px-4 py-3 text-[16px] outline-none placeholder:text-slate-500",value:k.sessionQuery,onChange:he=>k.onSessionQueryChange(he.target.value),placeholder:"搜索会话名称或目录"}),K.jsx("div",{className:"flex flex-wrap gap-2",children:Dv.map(he=>K.jsx("button",{className:`min-h-11 rounded-full px-3 py-2 text-sm ${k.statusFilter===he.value?"bg-sky-500 text-slate-950":"border border-slate-700 text-slate-200"}`,type:"button",onClick:()=>k.onStatusFilterChange(he.value),children:he.label},he.value))}),K.jsxs("p",{className:"text-xs text-slate-500",children:["当前显示 ",k.filteredSessions.length," / ",k.sessions.length," 个会话。置顶会话会始终排在最前面。"]}),k.filteredSessions.length===0?K.jsx("p",{className:"text-sm text-slate-400",children:k.sessions.length===0?"当前没有会话。":"没有匹配当前搜索或筛选条件的会话。"}):k.filteredSessions.map(he=>K.jsxs("div",{"data-session-name":he.name,className:`w-full rounded-2xl border px-4 py-3 text-left transition ${he.sid===k.activeSid?"border-sky-400/70 bg-sky-500/10":"border-slate-800 bg-slate-950/40"}`,children:[K.jsxs("div",{className:"flex items-start justify-between gap-3",children:[K.jsxs("div",{children:[K.jsx("p",{className:"font-medium text-white",children:he.name}),K.jsx("p",{className:"mt-1 text-xs text-slate-400",children:he.cwd})]}),K.jsx("span",{className:`rounded-full px-2.5 py-1 text-[11px] ${he.status==="running"?"bg-emerald-500/15 text-emerald-300":"bg-slate-700 text-slate-300"}`,children:he.status==="running"?"运行中":"已退出"})]}),K.jsxs("div",{className:"mt-3 flex gap-2",children:[K.jsx("button",{className:`rounded-full border px-3 py-1.5 text-xs ${k.pinnedSids.includes(he.sid)?"border-amber-400/50 text-amber-200":"border-slate-700 text-slate-200"}`,type:"button",onClick:()=>k.onTogglePinnedSession(he.sid),children:k.pinnedSids.includes(he.sid)?"取消置顶":"置顶"}),K.jsx("button",{className:"rounded-full border border-slate-700 px-3 py-1.5 text-xs text-slate-200",type:"button",onClick:()=>k.onSelectSession(he.sid),children:"查看"}),K.jsx("button",{className:"rounded-full border border-rose-500/40 px-3 py-1.5 text-xs text-rose-200 disabled:opacity-40",type:"button",disabled:he.status!=="running"||!k.canControl,onClick:()=>k.onKillSession(he.sid),children:"关闭"})]})]},he.sid))]})})}function Wf(k){const he=!!k.onBack,ye=k.shortcutKeys.filter(F=>["enter","ctrl_c","ctrl_d"].includes(F.key)),G=k.shortcutKeys.filter(F=>!["enter","ctrl_c","ctrl_d"].includes(F.key)),ce=G.filter(F=>!F.key.startsWith("arrow_")),me=F=>{const u=F.tone==="primary"?"border-sky-400/40 bg-sky-500/10 text-sky-100":F.tone==="danger"?"border-rose-400/40 bg-rose-500/10 text-rose-100":"border-slate-700/80 bg-slate-950/60 text-slate-100";return K.jsxs("button",{className:`flex min-h-14 items-center gap-3 rounded-2xl border px-3 py-3 text-left transition disabled:opacity-40 ${u}`,disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey(F.key),children:[K.jsx("span",{className:"inline-flex min-w-11 items-center justify-center rounded-xl border border-white/10 bg-slate-950/80 px-2 py-2 font-mono text-[13px] text-white",children:F.chip}),K.jsxs("span",{className:"min-w-0",children:[K.jsx("span",{className:"block truncate text-sm font-medium",children:F.label}),K.jsx("span",{className:"mt-0.5 block text-xs text-slate-400",children:F.description})]})]},F.key)};return K.jsx(hn,{title:k.activeSession?`${k.activeSession.name} · ${k.activeSession.status==="running"?"运行中":"已退出"}`:"当前未选择会话",children:k.activeSession?K.jsxs("div",{className:"flex h-full min-h-[68vh] flex-col gap-4",children:[k.onBack?K.jsx("button",{className:"inline-flex min-h-11 w-fit items-center rounded-full border border-slate-700 px-4 py-2 text-sm text-slate-200",type:"button",onClick:k.onBack,children:"返回会话列表"}):null,he?K.jsxs("div",{className:"space-y-4",children:[K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-950/90 p-3 shadow-[0_24px_80px_rgba(2,6,23,0.45)]",children:[K.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3 px-1",children:[K.jsxs("div",{children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"终端输出"}),K.jsx("p",{className:"text-xs text-slate-500",children:"和电脑看的是同一个 tmux 会话。"})]}),K.jsxs("div",{className:"flex items-center gap-2",children:[k.onToggleFocusMode?K.jsx("button",{className:"rounded-full border border-slate-700 bg-slate-950/70 px-3 py-1.5 text-[11px] font-medium text-slate-200",type:"button",onClick:k.onToggleFocusMode,children:k.focusMode?"退出全屏":"横屏全屏"}):null,K.jsx("span",{className:"rounded-full border border-emerald-500/30 bg-emerald-500/10 px-3 py-1 text-[11px] font-medium text-emerald-200",children:k.activeSession.status==="running"?"实时同步":"已结束"})]})]}),K.jsx("div",{className:`${k.focusMode?"h-[72svh] min-h-[540px]":"h-[56svh] min-h-[460px]"} overflow-hidden rounded-[22px] border border-slate-800 bg-[#020617] p-3`,children:K.jsx("div",{ref:k.terminalHostRef,className:"h-full min-h-full w-full overflow-hidden"})})]}),K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-900/80 p-4 shadow-xl shadow-slate-950/25",children:[K.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[K.jsxs("div",{children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"终端键盘"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"手机软键盘输入会直接写进当前光标位置,回车立即发送。"})]}),K.jsx("button",{className:"min-h-9 rounded-full border border-slate-700 bg-slate-950/70 px-3 py-2 text-xs text-slate-200 disabled:opacity-50",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onKeyboardBridgeKey("enter"),children:"回车"})]}),K.jsx("input",{className:"min-h-11 w-full rounded-2xl border border-slate-700 bg-slate-950/70 px-4 py-3 text-[16px] outline-none ring-0 placeholder:text-slate-500 disabled:opacity-50",value:k.keyboardBridge,onChange:F=>k.onKeyboardBridgeChange(F.target.value),onKeyDown:F=>{if(F.key==="Enter"&&!F.nativeEvent.isComposing){F.preventDefault(),k.onKeyboardBridgeKey("enter");return}if(F.key==="Backspace"&&k.keyboardBridge.length===0){k.onKeyboardBridgeKey("backspace");return}F.key==="Tab"&&(F.preventDefault(),k.onKeyboardBridgeKey("tab"))},placeholder:"点这里唤起键盘,直接往当前光标输入",enterKeyHint:"send",autoCapitalize:"off",autoCorrect:"off",disabled:!k.activeSid||!k.canControl})]}),K.jsxs("form",{className:"rounded-[28px] border border-slate-800 bg-slate-900/80 p-4 shadow-xl shadow-slate-950/25",onSubmit:k.onSubmitCommand,children:[K.jsxs("div",{className:"flex items-center justify-between gap-3",children:[K.jsxs("div",{children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"快速输入"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"补一条命令最方便,发送时会自动回车。"})]}),K.jsx("button",{className:"min-h-9 rounded-full bg-sky-500 px-4 py-2 text-sm font-medium text-slate-950 disabled:opacity-60",type:"submit",disabled:!k.activeSid||!k.canControl,children:"发送"})]}),K.jsx("input",{className:"mt-4 min-h-14 w-full rounded-2xl border border-slate-700 bg-slate-950/70 px-4 py-3 text-[16px] outline-none ring-0 placeholder:text-slate-500 disabled:opacity-50",value:k.command,onChange:F=>k.onCommandChange(F.target.value),onKeyDown:F=>{F.key==="Enter"&&!F.nativeEvent.isComposing&&(F.preventDefault(),k.onSendCommandNow())},placeholder:"例如:claude code / git status / npm test",enterKeyHint:"send",disabled:!k.activeSid||!k.canControl})]}),K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("div",{className:"mb-3",children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"快捷操作"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"全部收成紧凑按钮,减少对终端区域的挤压。"})]}),K.jsx("div",{className:"grid grid-cols-3 gap-2",children:ye.map(F=>K.jsxs("button",{className:`min-h-11 rounded-2xl border px-2 py-2 text-center text-xs font-medium disabled:opacity-40 ${F.tone==="primary"?"border-sky-400/40 bg-sky-500/10 text-sky-100":F.tone==="danger"?"border-rose-400/40 bg-rose-500/10 text-rose-100":"border-slate-700/80 bg-slate-950/60 text-slate-100"}`,disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey(F.key),children:[K.jsx("span",{className:"block font-mono text-[12px] opacity-80",children:F.chip}),K.jsx("span",{className:"mt-0.5 block",children:F.label})]},F.key))}),K.jsxs("div",{className:"mt-3 grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[K.jsx("div",{className:"flex justify-end",children:K.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-slate-700 bg-slate-950/60 text-lg text-slate-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey("arrow_left"),children:"←"})}),K.jsxs("div",{className:"grid gap-2",children:[K.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-slate-700 bg-slate-950/60 text-lg text-slate-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey("arrow_up"),children:"↑"}),K.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-amber-400/30 bg-amber-500/10 text-[11px] font-medium text-amber-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey("escape"),children:"Esc"}),K.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-slate-700 bg-slate-950/60 text-lg text-slate-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey("arrow_down"),children:"↓"})]}),K.jsx("div",{className:"flex justify-start",children:K.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-slate-700 bg-slate-950/60 text-lg text-slate-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey("arrow_right"),children:"→"})})]}),K.jsx("div",{className:"mt-3 grid grid-cols-2 gap-2",children:ce.map(F=>K.jsxs("button",{className:"min-h-10 rounded-2xl border border-slate-700 bg-slate-950/60 px-2 py-2 text-xs text-slate-100 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl,onClick:()=>k.onSendKey(F.key),children:[K.jsx("span",{className:"block font-mono text-[12px] opacity-80",children:F.chip}),K.jsx("span",{className:"mt-0.5 block",children:F.label})]},F.key))})]}),K.jsxs("details",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("summary",{className:"cursor-pointer list-none text-sm font-medium text-white",children:["多行粘贴",K.jsx("span",{className:"ml-2 text-xs font-normal text-slate-500",children:"脚本、长 prompt、多行命令放这里"})]}),K.jsx("textarea",{className:"mt-4 min-h-36 w-full rounded-2xl border border-slate-700 bg-slate-950/70 px-4 py-3 text-[16px] outline-none placeholder:text-slate-500 disabled:opacity-50",value:k.pasteBuffer,onChange:F=>k.onPasteBufferChange(F.target.value),placeholder:"在这里粘贴多行内容。原样发送不会自动补回车;发送并回车会在末尾补一个回车。",disabled:!k.activeSid||!k.canControl}),K.jsxs("div",{className:"mt-3 flex flex-col gap-3 sm:flex-row",children:[K.jsx("button",{className:"min-h-12 flex-1 rounded-2xl border border-slate-700 px-4 py-3 text-sm text-slate-200 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl||!k.pasteBuffer,onClick:()=>k.onSendPaste("raw"),children:"原样发送"}),K.jsx("button",{className:"min-h-12 flex-1 rounded-2xl bg-emerald-400 px-4 py-3 text-sm font-medium text-slate-950 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl||!k.pasteBuffer,onClick:()=>k.onSendPaste("line"),children:"发送并回车"})]})]})]}):K.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_312px]",children:[K.jsxs("div",{className:"space-y-4",children:[K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-950/90 p-3 shadow-[0_24px_80px_rgba(2,6,23,0.45)]",children:[K.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3 px-1",children:[K.jsxs("div",{children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"终端输出"}),K.jsx("p",{className:"text-xs text-slate-500",children:"这里显示同一个 tmux 会话的实时快照输出。"})]}),K.jsx("span",{className:"rounded-full border border-emerald-500/30 bg-emerald-500/10 px-3 py-1 text-[11px] font-medium text-emerald-200",children:k.activeSession.status==="running"?"实时同步":"已结束"})]}),K.jsx("div",{className:"h-[52svh] min-h-[440px] max-h-[720px] overflow-hidden rounded-[22px] border border-slate-800 bg-[#020617] p-3",children:K.jsx("div",{ref:k.terminalHostRef,className:"h-full min-h-full w-full overflow-hidden"})})]}),K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("div",{className:"flex items-center justify-between gap-3",children:[K.jsxs("div",{children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"快速输入"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"适合补一条命令、确认一步操作,发送时会自动追加回车。"})]}),K.jsx("span",{className:"rounded-full border border-slate-700 px-3 py-1 text-[11px] text-slate-400",children:"当前会话"})]}),K.jsxs("form",{className:"mt-4 flex flex-col gap-3 md:flex-row",onSubmit:k.onSubmitCommand,children:[K.jsx("input",{className:"min-h-14 flex-1 rounded-2xl border border-slate-700 bg-slate-950/70 px-4 py-3 text-[16px] outline-none ring-0 placeholder:text-slate-500 disabled:opacity-50",value:k.command,onChange:F=>k.onCommandChange(F.target.value),onKeyDown:F=>{F.key==="Enter"&&!F.nativeEvent.isComposing&&(F.preventDefault(),k.onSendCommandNow())},placeholder:"例如:claude code / git status / npm test",enterKeyHint:"send",disabled:!k.activeSid||!k.canControl}),K.jsx("button",{className:"min-h-14 rounded-2xl bg-sky-500 px-5 py-3 text-sm font-medium text-slate-950 disabled:opacity-60",type:"submit",disabled:!k.activeSid||!k.canControl,children:"发送命令"})]})]}),K.jsxs("details",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("summary",{className:"cursor-pointer list-none text-sm font-medium text-white",children:["多行粘贴",K.jsx("span",{className:"ml-2 text-xs font-normal text-slate-500",children:"脚本、长 prompt、多行命令放这里"})]}),K.jsx("textarea",{className:"mt-4 min-h-36 w-full rounded-2xl border border-slate-700 bg-slate-950/70 px-4 py-3 text-[16px] outline-none placeholder:text-slate-500 disabled:opacity-50",value:k.pasteBuffer,onChange:F=>k.onPasteBufferChange(F.target.value),placeholder:"在这里粘贴多行内容。原样发送不会自动补回车;发送并回车会在末尾补一个回车。",disabled:!k.activeSid||!k.canControl}),K.jsxs("div",{className:"mt-3 flex flex-col gap-3 sm:flex-row",children:[K.jsx("button",{className:"min-h-12 flex-1 rounded-2xl border border-slate-700 px-4 py-3 text-sm text-slate-200 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl||!k.pasteBuffer,onClick:()=>k.onSendPaste("raw"),children:"原样发送"}),K.jsx("button",{className:"min-h-12 flex-1 rounded-2xl bg-emerald-400 px-4 py-3 text-sm font-medium text-slate-950 disabled:opacity-40",type:"button",disabled:!k.activeSid||!k.canControl||!k.pasteBuffer,onClick:()=>k.onSendPaste("line"),children:"发送并回车"})]})]})]}),K.jsxs("aside",{className:"space-y-4",children:[K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("div",{className:"mb-3",children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"执行操作"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"把最常用的几类控制集中到右侧,不再散成一排丑按钮。"})]}),K.jsx("div",{className:"grid gap-3",children:ye.map(me)})]}),K.jsxs("div",{className:"rounded-[28px] border border-slate-800 bg-slate-900/72 p-4",children:[K.jsxs("div",{className:"mb-3",children:[K.jsx("p",{className:"text-sm font-medium text-white",children:"移动与补全"}),K.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"参考 WeTTY / ttyd 这类网页终端的做法,用紧凑的快捷控制代替原来那种裸文本按钮。"})]}),K.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-1",children:G.map(me)})]})]})]}),K.jsx("p",{className:"text-xs text-slate-500",children:"当前模式是浏览器直开 PWA。适合查看流式输出、补命令和关闭会话,不适合重度长文本输入。"})]}):K.jsxs("div",{className:"flex min-h-[56vh] flex-col items-center justify-center rounded-3xl border border-dashed border-slate-700 bg-slate-950/35 px-6 py-12 text-center",children:[K.jsx("p",{className:"text-sm font-semibold text-white",children:"先选择一个会话"}),K.jsx("p",{className:"mt-2 max-w-md text-sm text-slate-400",children:"你可以在左侧查看已有会话,或者先创建一个新的 tmux 会话。选中之后这里才会显示终端输出和输入控件。"})]})})}const Qf=[{key:"enter",label:"发送回车",chip:"↵",description:"执行当前命令",tone:"primary"},{key:"ctrl_c",label:"中断",chip:"^C",description:"停止当前任务",tone:"danger"},{key:"ctrl_d",label:"结束输入",chip:"^D",description:"发送 EOF",tone:"neutral"},{key:"tab",label:"补全",chip:"⇥",description:"触发 shell 补全",tone:"neutral"},{key:"escape",label:"返回",chip:"Esc",description:"退出当前模式",tone:"neutral"},{key:"arrow_up",label:"上一条",chip:"↑",description:"查看历史命令",tone:"neutral"},{key:"arrow_down",label:"下一条",chip:"↓",description:"回到较新的命令",tone:"neutral"},{key:"arrow_left",label:"左移",chip:"←",description:"移动光标到左侧",tone:"neutral"},{key:"arrow_right",label:"右移",chip:"→",description:"移动光标到右侧",tone:"neutral"}],Av="ws://127.0.0.1:8787/ws",Tv="",Rs="pc-main",Zf="termpilot-app-state";function Rv(){if(typeof window>"u")return Av;const k=window.location.protocol==="https:"?"wss:":"ws:";return window.location.port==="5173"?`${k}//${window.location.hostname}:8787/ws`:`${k}//${window.location.host}/ws`}function Mv(k){const he=new URL(k);return he.protocol=he.protocol==="wss:"?"https:":"http:",he.pathname="",he.search="",he.hash="",he.toString().replace(/\/$/,"")}function Lv(k){try{return new URL(k)}catch{return null}}function Bv(){const k=_e.useRef(null),he=_e.useRef(null),ye=_e.useRef(null),G=_e.useRef(null),ce=_e.useRef(null),me=_e.useRef(null),F=_e.useRef(!1),u=_e.useRef(0),f=_e.useRef(Rs),d=_e.useRef(null),y=_e.useRef(!1),h=_e.useRef(Rs),p=_e.useRef(!1),b=_e.useRef({}),D=_e.useRef(!1),[S,l]=_e.useState(Rv),[c,o]=_e.useState(Tv),[a,_]=_e.useState(Rs),[g,C]=_e.useState(!1),[x,v]=_e.useState("idle"),[E,B]=_e.useState(!1),[z,L]=_e.useState([]),[U,ee]=_e.useState({}),[W,H]=_e.useState(null),[I,A]=_e.useState([]),[M,O]=_e.useState(""),[w,j]=_e.useState("all"),[Z,se]=_e.useState(""),[ae,fe]=_e.useState(""),[T,X]=_e.useState(!1),[J,ie]=_e.useState(!1),[Se,oe]=_e.useState(null),[xe,qe]=_e.useState(""),[Ye,ht]=_e.useState(""),[be,Yt]=_e.useState(""),[ii,si]=_e.useState(""),[ri,gi]=_e.useState(""),[_t,$e]=_e.useState(""),[Pe,ni]=_e.useState(null),[zi,xt]=_e.useState(()=>typeof window<"u"&&window.innerWidth>=1024),[Gt,Ct]=_e.useState(!1),li=_e.useMemo(()=>z.find(le=>le.sid===W)??null,[W,z]),Ue=c.trim().length>0,At=x==="connected",Ne=At&&E,ft=_e.useMemo(()=>Lv(S),[S]),Et=_e.useMemo(()=>ft?Mv(ft.toString()):null,[ft]),fn=_e.useMemo(()=>{const le=M.trim().toLowerCase();return z.filter(ue=>w!=="all"&&ue.status!==w?!1:le?ue.name.toLowerCase().includes(le)||ue.cwd.toLowerCase().includes(le):!0).sort((ue,De)=>{const Oe=I.includes(ue.sid),Ft=I.includes(De.sid);return Oe!==Ft?Oe?-1:1:De.startedAt.localeCompare(ue.startedAt)})},[I,M,z,w]);_e.useEffect(()=>{f.current=a},[a]),_e.useEffect(()=>{d.current=W},[W]),_e.useEffect(()=>{y.current=Ne},[Ne]),_e.useEffect(()=>{if(typeof window>"u")return;const le=()=>{xt(window.innerWidth>=1024)};return window.addEventListener("resize",le),()=>{window.removeEventListener("resize",le)}},[]),_e.useEffect(()=>{const le=a.trim()||Rs;if(!At){h.current=le;return}if(h.current===le)return;h.current=le,B(!1),L([]),ee({}),H(null);const ue=window.setTimeout(()=>{fi(le)},200);return()=>{window.clearTimeout(ue)}},[At,a]),_e.useEffect(()=>{try{const le=window.localStorage.getItem(Zf);if(!le)return;const ue=JSON.parse(le);ue.wsUrl&&l(ue.wsUrl),ue.clientToken&&o(ue.clientToken),typeof ue.deviceId=="string"&&ue.deviceId.trim()&&_(ue.deviceId.trim()),(typeof ue.activeSid=="string"||ue.activeSid===null)&&H(ue.activeSid??null),Array.isArray(ue.pinnedSids)&&A(ue.pinnedSids.filter(De=>typeof De=="string")),typeof ue.notificationsEnabled=="boolean"&&ie(ue.notificationsEnabled)}catch{}},[]),_e.useEffect(()=>{const le={wsUrl:S,clientToken:c,deviceId:a,activeSid:W,pinnedSids:I,notificationsEnabled:J};window.localStorage.setItem(Zf,JSON.stringify(le))},[W,c,a,J,I,S]);function dn(le=he.current){if(!le||!W)return;const ue=U[W]??"";le.clear(),ue&&le.write(ue.replace(/\n/g,`\r
18
+ `))}_e.useEffect(()=>{if(!Pe)return;const le=new wv.Terminal({convertEol:!0,cursorBlink:!0,fontFamily:'"SF Mono", "JetBrains Mono", Menlo, monospace',fontSize:13,theme:{background:"#020617",foreground:"#e2e8f0",cursor:"#38bdf8",black:"#0f172a",brightBlack:"#334155"}}),ue=new Cv.FitAddon;let De=0,Oe=!1;le.loadAddon(ue),le.open(Pe),le.onData(je=>{const Be=d.current;!Be||!y.current||Tt({type:"session.input",reqId:Ni("tty"),deviceId:f.current,sid:Be,payload:{text:je}})});const Ft=()=>{le.focus()};return Pe.addEventListener("pointerdown",Ft),he.current=le,ye.current=ue,De=window.requestAnimationFrame(()=>{Oe||(_n(),dn(le))}),()=>{Oe=!0,window.cancelAnimationFrame(De),Pe.removeEventListener("pointerdown",Ft),he.current=null,ye.current=null,le.dispose()}},[Pe]),_e.useEffect(()=>{if(!W||!he.current)return;const le=window.requestAnimationFrame(()=>{he.current?.focus()});return()=>window.cancelAnimationFrame(le)},[W,Gt]),_e.useEffect(()=>{ht(""),!W&&Ct(!1)},[W]),_e.useEffect(()=>{if(Gt||typeof document>"u")return;document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{});const le="orientation"in screen?screen.orientation:void 0;if(le?.unlock)try{le.unlock()}catch{}},[Gt]),_e.useEffect(()=>{const le=()=>{document.fullscreenElement||Ct(!1)};return document.addEventListener("fullscreenchange",le),()=>{document.removeEventListener("fullscreenchange",le)}},[]),_e.useEffect(()=>{if(!Pe||!ye.current)return;const le=()=>{!he.current||!_n()||!Ne||!W||he.current.cols===0||he.current.rows===0||Tt({type:"session.resize",reqId:Ni("resize"),deviceId:a,sid:W,payload:{cols:he.current.cols,rows:he.current.rows}})},ue=new ResizeObserver(()=>le());return ue.observe(Pe),le(),()=>{ue.disconnect()}},[W,Ne,a,Pe]),_e.useEffect(()=>{dn()},[W,U,Pe]),_e.useEffect(()=>()=>{ce.current!==null&&window.clearTimeout(ce.current),me.current!==null&&window.clearTimeout(me.current),G.current?.close()},[]),_e.useEffect(()=>{At&&(fi(f.current),W&&Ht(W,f.current))},[W,At]),_e.useEffect(()=>{!c.trim()||ft===null||G.current||x!=="idle"||F.current||us(!1)},[c,x,ft]),_e.useEffect(()=>{const le=new Set(z.map(ue=>ue.sid));A(ue=>ue.filter(De=>le.has(De)))},[z]),_e.useEffect(()=>{const le=p.current,ue=b.current,De=Object.fromEntries(z.map(Oe=>[Oe.sid,Oe.status]));if(D.current&&J&&typeof window<"u"&&"Notification"in window&&Notification.permission==="granted"&&document.hidden){le&&!E&&new Notification("TermPilot",{body:`设备 ${a} 已离线`});for(const Oe of z)ue[Oe.sid]==="running"&&Oe.status==="exited"&&new Notification("会话已退出",{body:`${Oe.name} 已结束`})}p.current=E,b.current=De,D.current=!0},[a,E,J,z]);function _n(){if(!ye.current||!he.current||!Pe||Pe.clientWidth===0||Pe.clientHeight===0)return!1;try{return ye.current.fit(),!0}catch{return!1}}function lt(le,ue){oe({kind:le,text:ue}),me.current!==null&&window.clearTimeout(me.current),me.current=window.setTimeout(()=>{oe(null),me.current=null},4e3)}function Tt(le){const ue=G.current;!ue||ue.readyState!==WebSocket.OPEN||ue.send(JSON.stringify(le))}function fi(le){Tt({type:"session.list",reqId:Ni("list"),deviceId:le??f.current})}function Ht(le,ue){Tt({type:"session.replay",reqId:Ni("replay"),deviceId:ue??f.current,sid:le,payload:{afterSeq:-1}})}function Ms(){if(F.current)return;const le=u.current+1;u.current=le;const ue=Math.min(1e3*2**Math.min(le,4),12e3);v("reconnecting"),ce.current=window.setTimeout(()=>{ce.current=null,us(!1)},ue)}function Ui(){F.current=!0,u.current=0,ce.current!==null&&(window.clearTimeout(ce.current),ce.current=null)}function _r(){Ui(),G.current?.close(),G.current=null,v("idle"),B(!1)}function vr(){_r(),o(""),_(Rs),C(!1),H(null),L([]),ee({}),fe("已清除本机保存的访问令牌,请重新配对。"),lt("info","已清除本机绑定。"),p.current=!1,b.current={},D.current=!1}function Ls(le){A(ue=>ue.includes(le)?ue.filter(De=>De!==le):[le,...ue])}async function ji(){if(J){ie(!1),lt("info","已关闭浏览器提醒。");return}if(typeof window>"u"||!("Notification"in window)){lt("error","当前浏览器不支持通知。");return}if(await Notification.requestPermission()==="granted"){ie(!0),lt("success","已开启浏览器提醒。页面在后台时,会在会话退出或设备离线时提醒。");return}ie(!1),lt("error","通知权限未开启。")}function us(le=!0,ue){if(!ft){fe("WebSocket 地址无效,请先输入完整地址。"),v("idle");return}le&&(F.current=!1,u.current=0),ce.current!==null&&(window.clearTimeout(ce.current),ce.current=null),G.current?.close(),v(le?"connecting":"reconnecting"),fe("");const De=new URL(ft.toString());De.searchParams.set("role","client"),De.searchParams.set("token",ue??c);const Oe=new WebSocket(De);G.current=Oe,Oe.addEventListener("open",()=>{G.current===Oe&&(u.current=0,v("connected"))}),Oe.addEventListener("close",()=>{G.current===Oe&&(G.current=null),!(G.current!==null&&G.current!==Oe)&&(v(Ft=>F.current?"idle":Ft),B(!1),F.current||Ms())}),Oe.addEventListener("message",Ft=>{if(G.current!==Oe)return;const je=JSON.parse(Ft.data);switch(je.type){case"auth.ok":{const Be=je.payload.deviceId??(f.current.trim()||Rs),Je=f.current,vt=!!je.payload.deviceId||!Je.trim();fe(""),C(!!je.payload.deviceId),f.current=Be,Be!==Je&&(L([]),ee({}),H(null)),vt&&_(Be),fi(Be),W&&Ht(W,Be)}return;case"relay.state":B(je.payload.agents.some(Be=>Be.deviceId===f.current&&Be.online));return;case"session.list.result":if(je.deviceId!==f.current)return;L(je.payload.sessions),ee(Be=>{const Je={};for(const vt of je.payload.sessions)Be[vt.sid]&&(Je[vt.sid]=Be[vt.sid]);return Je}),H(Be=>{const Je=Be&&je.payload.sessions.some(vt=>vt.sid===Be)?Be:null;return Je&&Ht(Je,f.current),Je});return;case"session.created":case"session.state":{const Be=je.payload.session;if(Be.deviceId!==f.current)return;L(Je=>{const vt=Je.filter(et=>et.sid!==Be.sid);return vt.push(Be),vt.sort((et,vn)=>vn.startedAt.localeCompare(et.startedAt)),vt}),H(Je=>Je??Be.sid);return}case"session.output":if(je.deviceId!==f.current)return;ee(Be=>({...Be,[je.sid]:je.payload.data}));return;case"session.exit":if(je.deviceId!==f.current)return;L(Be=>Be.map(Je=>Je.sid===je.sid?{...Je,status:"exited"}:Je));return;case"error":if(je.code==="AUTH_FAILED"||je.code==="AUTH_REVOKED"){Ui(),v("idle"),B(!1),je.code==="AUTH_REVOKED"&&o(""),fe(je.message),lt("error",je.message),Oe.close();return}lt("error",je.message)}})}async function Bs(){if(!Et){fe("WebSocket 地址无效,请先输入完整地址。");return}const le=Z.trim().toUpperCase();if(!le){fe("请先输入配对码。");return}X(!0),fe("");try{const ue=await fetch(`${Et}/api/pairings/redeem`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pairingCode:le})}),De=await ue.json().catch(()=>null);if(!ue.ok||!De||!("accessToken"in De)){const Oe=De&&"message"in De&&De.message?De.message:"配对失败";throw new Error(Oe)}L([]),ee({}),H(null),_(De.deviceId),o(De.accessToken),se(""),fe(""),lt("success",`已绑定设备 ${De.deviceId}。`),us(!0,De.accessToken)}catch(ue){const De=ue instanceof Error?ue.message:"配对失败";fe(De),lt("error",De)}finally{X(!1)}}function mr(le){if(le.preventDefault(),!Ne){lt("error",E?"当前未连接 relay,无法创建会话。":`设备 ${a||Rs} 当前离线,无法创建会话。`);return}Tt({type:"session.create",reqId:Ni("create"),deviceId:a,payload:{name:ii||void 0,cwd:ri||void 0,shell:_t||void 0}}),si(""),lt("success","已发送创建会话请求。")}function gr(le){le.preventDefault(),hs()}function ai(le){!W||!le||!Ne||Tt({type:"session.input",reqId:Ni("input"),deviceId:a,sid:W,payload:{text:le}})}function hs(){!W||!xe.trim()||!Ne||(ai(`${xe}
19
+ `),qe(""))}function pr(le){if(!W||!Ne){ht(le);return}if(le!==Ye){if(le.startsWith(Ye)){const ue=le.slice(Ye.length);ue&&ai(ue),ht(le);return}if(Ye.startsWith(le)){const ue=Ye.length-le.length;ue>0&&ai("".repeat(ue)),ht(le);return}Ye.length>0&&ai("".repeat(Ye.length)),le&&ai(le),ht(le)}}function Sr(le){if(!(!W||!Ne)){if(le==="enter"){ai(`
20
+ `),ht("");return}if(le==="backspace"){ai(""),ht(ue=>ue.slice(0,-1));return}st("tab")}}function oi(le){!W||!be||!Ne||(Tt({type:"session.input",reqId:Ni("paste"),deviceId:a,sid:W,payload:{text:le==="line"?`${be}
21
+ `:be}}),Yt(""),lt("success",le==="line"?"已发送多行内容并追加回车。":"已原样发送多行内容。"))}function st(le){!W||!Ne||Tt({type:"session.input",reqId:Ni("key"),deviceId:a,sid:W,payload:{key:le}})}function gt(le){Tt({type:"session.kill",reqId:Ni("kill"),deviceId:a,sid:le}),lt("info","已发送关闭会话请求。")}function qi(){if(!k.current||typeof window>"u"||window.innerWidth>=1024)return;const le=k.current;window.requestAnimationFrame(()=>{le.scrollIntoView({block:"start",inline:"nearest"})})}async function yr(){const le=!Gt;if(Ct(le),typeof document>"u")return;if(le){const De=document.documentElement;if(De.requestFullscreen)try{await De.requestFullscreen()}catch{}const Oe="orientation"in screen?screen.orientation:void 0;if(Oe?.lock)try{await Oe.lock("landscape")}catch{lt("info","已进入终端聚焦模式。若浏览器不支持自动横屏,请手动旋转手机。")}else lt("info","已进入终端聚焦模式。若想获得更宽终端,请手动旋转手机。");return}if(document.fullscreenElement&&document.exitFullscreen)try{await document.exitFullscreen()}catch{}const ue="orientation"in screen?screen.orientation:void 0;if(ue?.unlock)try{ue.unlock()}catch{}}return K.jsxs("main",{className:"mx-auto flex min-h-screen w-full max-w-7xl flex-col gap-5 px-4 py-5 text-slate-100 sm:px-6 lg:px-8",children:[K.jsxs("header",{className:"rounded-3xl border border-slate-800/80 bg-slate-900/70 p-5 shadow-2xl shadow-slate-950/40 backdrop-blur",children:[K.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.25em] text-sky-300",children:"TermPilot"}),K.jsx("h1",{className:"mt-2 text-3xl font-semibold text-white",children:Ue?"会话列表":"先绑定你的电脑"}),K.jsx("p",{className:"mt-2 max-w-2xl text-sm text-slate-400",children:Ue?"先选一个会话,再进入查看输出和补命令。":"在电脑上执行 termpilot agent --relay 你的 relay 地址。命令会直接启动后台 agent 并打印一次性配对码。"}),Ue?K.jsxs("p",{className:"mt-3 text-xs text-slate-500",children:[a," · ",E?"设备在线":"设备离线"," · ",At?"已连上 relay":x==="reconnecting"?"正在重连 relay":"relay 未连接"]}):null]}),Se?K.jsx(xv,{kind:Se.kind,text:Se.text,onDismiss:()=>{oe(null),me.current!==null&&(window.clearTimeout(me.current),me.current=null)}}):null,Ue?K.jsxs(K.Fragment,{children:[zi?K.jsxs("section",{className:"grid gap-5 lg:grid-cols-[360px_minmax(0,1fr)]",children:[K.jsxs("div",{className:"space-y-5",children:[K.jsx(Vf,{canControl:Ne,createName:ii,createCwd:ri,createShell:_t,onCreateNameChange:si,onCreateCwdChange:gi,onCreateShellChange:$e,onSubmit:mr}),K.jsx(Pf,{canControl:Ne,sessions:z,filteredSessions:fn,activeSid:W,pinnedSids:I,sessionQuery:M,statusFilter:w,onSessionQueryChange:O,onStatusFilterChange:j,onTogglePinnedSession:Ls,onSelectSession:le=>{H(le),Ht(le,f.current)},onKillSession:gt})]}),K.jsx("div",{"data-testid":"desktop-terminal-workspace",children:K.jsx(Wf,{activeSession:li,activeSid:W,canControl:Ne,command:xe,keyboardBridge:Ye,pasteBuffer:be,shortcutKeys:Qf,terminalHostRef:ni,onCommandChange:qe,onKeyboardBridgeChange:pr,onKeyboardBridgeKey:Sr,onSendCommandNow:hs,onSubmitCommand:gr,onPasteBufferChange:Yt,onSendPaste:oi,onSendKey:st})})]}):K.jsx("section",{className:"space-y-4",children:li?K.jsx("div",{ref:k,"data-testid":"terminal-workspace",className:Gt?"fixed inset-0 z-50 overflow-y-auto bg-[#020617]/98 px-3 py-3 pb-[calc(env(safe-area-inset-bottom)+1rem)]":void 0,children:K.jsx(Wf,{activeSession:li,activeSid:W,canControl:Ne,focusMode:Gt,command:xe,keyboardBridge:Ye,pasteBuffer:be,shortcutKeys:Qf,terminalHostRef:ni,onBack:()=>{ht(""),Ct(!1),H(null)},onToggleFocusMode:()=>{yr()},onCommandChange:qe,onKeyboardBridgeChange:pr,onKeyboardBridgeKey:Sr,onSendCommandNow:hs,onSubmitCommand:gr,onPasteBufferChange:Yt,onSendPaste:oi,onSendKey:st})}):K.jsxs(K.Fragment,{children:[K.jsx(Pf,{canControl:Ne,sessions:z,filteredSessions:fn,activeSid:W,pinnedSids:I,sessionQuery:M,statusFilter:w,onSessionQueryChange:O,onStatusFilterChange:j,onTogglePinnedSession:Ls,onSelectSession:le=>{H(le),Ht(le,f.current),qi()},onKillSession:gt}),K.jsxs("details",{className:"rounded-3xl border border-slate-800/80 bg-slate-900/72 p-5 shadow-2xl shadow-slate-950/30 backdrop-blur",children:[K.jsx("summary",{className:"cursor-pointer list-none text-sm font-medium text-slate-200",children:"新建会话"}),K.jsx("div",{className:"mt-4",children:K.jsx(Vf,{canControl:Ne,createName:ii,createCwd:ri,createShell:_t,onCreateNameChange:si,onCreateCwdChange:gi,onCreateShellChange:$e,onSubmit:mr})})]})]})}),K.jsxs("details",{className:"rounded-3xl border border-slate-800/80 bg-slate-900/72 p-5 shadow-2xl shadow-slate-950/30 backdrop-blur",children:[K.jsx("summary",{className:"cursor-pointer list-none text-sm font-medium text-slate-200",children:"连接与设备设置"}),K.jsx("p",{className:"mt-3 text-xs text-slate-500",children:"这里放不常用的信息和管理项。日常使用时,你主要只需要看会话列表和终端输出。"}),K.jsx("div",{className:"mt-4",children:K.jsx(Xf,{title:"连接与设备设置",wsUrl:S,wsUrlValid:ft!==null,clientToken:c,deviceId:a,deviceIdEditable:!g,pairingCode:Z,pairingMessage:ae,pairingPending:T,connectionPhase:x,notificationsEnabled:J,onWsUrlChange:l,onClientTokenChange:o,onDeviceIdChange:_,onPairingCodeChange:se,onRedeemPairingCode:()=>{Bs()},onConnect:()=>us(!0),onRefresh:()=>fi(f.current),onDisconnect:_r,onClearBinding:vr,onToggleNotifications:()=>{ji()},showPairingSection:!1})})]})]}):K.jsxs("section",{className:"mx-auto flex w-full max-w-md flex-col gap-4",children:[K.jsxs(hn,{title:"输入配对码",children:[K.jsx("p",{className:"text-sm text-slate-400",children:"电脑上执行 `termpilot agent --relay 你的 relay 地址`,然后把命令输出的配对码填到这里。"}),K.jsxs("div",{className:"mt-4 flex gap-3",children:[K.jsx("input",{className:"flex-1 rounded-2xl border border-slate-700 bg-slate-950/60 px-4 py-3 text-base uppercase outline-none placeholder:text-slate-500 md:text-sm",value:Z,onChange:le=>se(le.target.value),placeholder:"ABC-234"}),K.jsx("button",{className:"rounded-full bg-emerald-400 px-5 py-3 text-sm font-medium text-slate-950 disabled:opacity-60",type:"button",disabled:T||ft===null,onClick:()=>{Bs()},children:T?"配对中":"配对"})]}),ae?K.jsx("p",{className:"mt-3 text-sm text-slate-400",children:ae}):null]}),K.jsxs("details",{className:"rounded-3xl border border-slate-800/80 bg-slate-900/72 p-5 shadow-2xl shadow-slate-950/30 backdrop-blur",children:[K.jsx("summary",{className:"cursor-pointer list-none text-sm font-medium text-slate-200",children:"高级设置"}),K.jsx("div",{className:"mt-4",children:K.jsx(Xf,{title:"连接与设备设置",wsUrl:S,wsUrlValid:ft!==null,clientToken:c,deviceId:a,deviceIdEditable:!g,pairingCode:Z,pairingMessage:ae,pairingPending:T,connectionPhase:x,notificationsEnabled:J,onWsUrlChange:l,onClientTokenChange:o,onDeviceIdChange:_,onPairingCodeChange:se,onRedeemPairingCode:()=>{Bs()},onConnect:()=>us(!0),onRefresh:()=>fi(f.current),onDisconnect:_r,onClearBinding:vr,onToggleNotifications:()=>{ji()},showPairingSection:!1})})]})]})]})}yv.createRoot(document.getElementById("root")).render(K.jsx(fv.StrictMode,{children:K.jsx(Bv,{})}));